diff --git a/bower.json b/bower.json index 7fcb0afea..2f412ebf3 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "tabulator", "main": "dist/js/tabulator.js", - "version": "5.2.4", + "version": "5.2.5", "description": "Interactive table generation JavaScript library", "keywords": [ "table", diff --git a/dist/css/tabulator_bootstrap5.min.css b/dist/css/tabulator_bootstrap5.min.css index e27ebeb2f..c870d9db4 100644 --- a/dist/css/tabulator_bootstrap5.min.css +++ b/dist/css/tabulator_bootstrap5.min.css @@ -1,2 +1,2 @@ -.tabulator{position:relative;border:1px solid #dee2e6;font-size:16px;text-align:left;overflow:hidden;-webkit-transform:translatez(0);-moz-transform:translatez(0);-ms-transform:translatez(0);-o-transform:translatez(0);transform:translatez(0)}.tabulator[tabulator-layout=fitDataFill] .tabulator-tableholder .tabulator-table{min-width:100%}.tabulator[tabulator-layout=fitDataTable]{display:inline-block}.tabulator.tabulator-block-select{user-select:none}.tabulator .tabulator-header{position:relative;box-sizing:border-box;width:100%;border-bottom:1px solid #dee2e6;background-color:transparent;color:#555;font-weight:700;white-space:nowrap;overflow:hidden;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator .tabulator-header.tabulator-header-hidden{display:none}.tabulator .tabulator-header .tabulator-col{display:inline-block;position:relative;box-sizing:border-box;border-right:1px solid #aaa;background:transparent;text-align:left;vertical-align:bottom;overflow:hidden}.tabulator .tabulator-header .tabulator-col.tabulator-moving{position:absolute;border:1px solid #dee2e6;background:transparent;pointer-events:none}.tabulator .tabulator-header .tabulator-col .tabulator-col-content{box-sizing:border-box;position:relative;padding:4px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button{padding:0 8px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button:hover{cursor:pointer;opacity:.6}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title-holder{position:relative}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title{box-sizing:border-box;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-title-editor{box-sizing:border-box;width:100%;border:1px solid #999;padding:1px;background:#fff}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-header-popup-button+.tabulator-title-editor{width:calc(100% - 22px)}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{display:flex;align-items:center;position:absolute;top:0;bottom:0;right:4px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #bbb}.tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{position:relative;display:flex;border-top:1px solid #aaa;overflow:hidden;margin-right:-1px}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter{position:relative;box-sizing:border-box;margin-top:2px;width:100%;text-align:center}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter textarea{height:auto!important}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter svg{margin-top:3px}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input::-ms-clear{width:0;height:0}.tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title{padding-right:25px}.tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover{cursor:pointer;background-color:transparent}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter{color:#bbb}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-top:none;border-bottom:6px solid #bbb}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=asc] .tabulator-col-content .tabulator-col-sorter{color:#666}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=asc] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-top:none;border-bottom:6px solid #666}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=desc] .tabulator-col-content .tabulator-col-sorter{color:#666}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=desc] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-bottom:none;border-top:6px solid #666;color:#666}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title{writing-mode:vertical-rl;text-orientation:mixed;display:flex;align-items:center;justify-content:center}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-col-vertical-flip .tabulator-col-title{transform:rotate(180deg)}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-title{padding-right:0;padding-top:20px}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable.tabulator-col-vertical-flip .tabulator-col-title{padding-right:0;padding-bottom:20px}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-sorter{justify-content:center;left:0;right:0;top:4px;bottom:auto}.tabulator .tabulator-header .tabulator-frozen{display:inline-block;position:absolute;z-index:10}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-left{border-right:2px solid #dee2e6}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right{border-left:2px solid #dee2e6}.tabulator .tabulator-header .tabulator-calcs-holder{box-sizing:border-box;min-width:600%;background:rgba(13,13,13,0)!important;border-top:1px solid #dee2e6;border-bottom:1px solid #aaa;overflow:hidden}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row{background:rgba(13,13,13,0)!important}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-header .tabulator-frozen-rows-holder{min-width:600%}.tabulator .tabulator-header .tabulator-frozen-rows-holder:empty{display:none}.tabulator .tabulator-tableholder{position:relative;width:100%;white-space:nowrap;overflow:auto;-webkit-overflow-scrolling:touch}.tabulator .tabulator-tableholder:focus{outline:none}.tabulator .tabulator-tableholder .tabulator-placeholder{box-sizing:border-box;display:flex;align-items:center;width:100%}.tabulator .tabulator-tableholder .tabulator-placeholder[tabulator-render-mode=virtual]{min-height:100%;min-width:100%}.tabulator .tabulator-tableholder .tabulator-placeholder .tabulator-placeholder-contents{display:inline-block;text-align:center;padding:10px;color:#ccc;font-weight:700;font-size:20px;white-space:normal}.tabulator .tabulator-tableholder .tabulator-table{position:relative;display:inline-block;background-color:transparent;white-space:nowrap;overflow:visible;color:#333}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs{font-weight:700;background:rgba(0,0,0,.05)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-top{border-bottom:2px solid #dee2e6}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-bottom{border-top:2px solid #dee2e6}.tabulator .tabulator-footer{border-top:1px solid #dee2e6;background-color:#e6e6e6;color:#555;font-weight:700;white-space:nowrap;user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator .tabulator-footer .tabulator-footer-contents{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:5px 10px}.tabulator .tabulator-footer .tabulator-footer-contents:empty{display:none}.tabulator .tabulator-footer .tabulator-calcs-holder{box-sizing:border-box;width:calc(100% + 20px);text-align:left;background:#f3f3f3!important;border-bottom:1px solid #dee2e6;border-top:1px solid #dee2e6;overflow:hidden}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row{background:#f3f3f3!important}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-footer .tabulator-calcs-holder:only-child{margin-bottom:-5px;border-bottom:none}.tabulator .tabulator-footer>*+.tabulator-page-counter{margin-left:10px}.tabulator .tabulator-footer .tabulator-page-counter{font-weight:400}.tabulator .tabulator-footer .tabulator-paginator{flex:1;text-align:right;color:#555;font-family:inherit;font-weight:inherit;font-size:inherit}.tabulator .tabulator-footer .tabulator-page-size{display:inline-block;margin:0 5px;padding:2px 5px;border:1px solid #dee2e6;border-radius:3px}.tabulator .tabulator-footer .tabulator-pages{margin:0 7px}.tabulator .tabulator-footer .tabulator-page{display:inline-block;margin:0 2px;padding:2px 5px;border:1px solid #dee2e6;border-radius:3px;background:hsla(0,0%,100%,.2)}.tabulator .tabulator-footer .tabulator-page:disabled{opacity:.5}.tabulator .tabulator-footer .tabulator-page:not(.disabled):hover{cursor:pointer;background:rgba(0,0,0,.2);color:#fff}.tabulator .tabulator-col-resize-handle{position:relative;display:inline-block;width:6px;margin-left:-3px;margin-right:-3px;z-index:10;vertical-align:middle}.tabulator .tabulator-col-resize-handle:hover{cursor:ew-resize}.tabulator .tabulator-col-resize-handle:last-of-type{width:3px;margin-right:0}.tabulator .tabulator-alert{position:absolute;display:flex;align-items:center;top:0;left:0;z-index:100;height:100%;width:100%;background:rgba(0,0,0,.4);text-align:center}.tabulator .tabulator-alert .tabulator-alert-msg{display:inline-block;margin:0 auto;padding:10px 20px;border-radius:10px;background:#fff;font-weight:700;font-size:16px}.tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-msg{border:4px solid #333;color:#000}.tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-error{border:4px solid #d00;color:#590000}.tabulator-row{position:relative;box-sizing:border-box;min-height:24px;background-color:transparent}.tabulator-row.tabulator-row-even{background-color:rgba(0,0,0,.05)}.tabulator-row.tabulator-selectable:hover{background-color:rgba(0,0,0,.075);cursor:pointer}.tabulator-row.tabulator-selected{background-color:#9abcea}.tabulator-row.tabulator-selected:hover{background-color:#769bcc;cursor:pointer}.tabulator-row.tabulator-row-moving{border:1px solid #000;background:#fff}.tabulator-row.tabulator-moving{position:absolute;border-top:1px solid #dee2e6;border-bottom:1px solid #dee2e6;pointer-events:none;z-index:15}.tabulator-row .tabulator-row-resize-handle{position:absolute;right:0;bottom:0;left:0;height:5px}.tabulator-row .tabulator-row-resize-handle.prev{top:0;bottom:auto}.tabulator-row .tabulator-row-resize-handle:hover{cursor:ns-resize}.tabulator-row .tabulator-frozen{display:inline-block;position:absolute;background-color:inherit;z-index:10}.tabulator-row .tabulator-frozen.tabulator-frozen-left{border-right:2px solid #dee2e6}.tabulator-row .tabulator-frozen.tabulator-frozen-right{border-left:2px solid #dee2e6}.tabulator-row .tabulator-responsive-collapse{box-sizing:border-box;padding:5px;border-top:1px solid #dee2e6;border-bottom:1px solid #dee2e6}.tabulator-row .tabulator-responsive-collapse:empty{display:none}.tabulator-row .tabulator-responsive-collapse table{font-size:16px}.tabulator-row .tabulator-responsive-collapse table tr td{position:relative}.tabulator-row .tabulator-responsive-collapse table tr td:first-of-type{padding-right:10px}.tabulator-row .tabulator-cell{display:inline-block;position:relative;box-sizing:border-box;padding:4px;border-right:1px solid #dee2e6;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tabulator-row .tabulator-cell.tabulator-editing{border:1px solid #1d68cd;outline:none;padding:0}.tabulator-row .tabulator-cell.tabulator-editing input,.tabulator-row .tabulator-cell.tabulator-editing select{border:1px;background:transparent;outline:none}.tabulator-row .tabulator-cell.tabulator-validation-fail{border:1px solid #d00}.tabulator-row .tabulator-cell.tabulator-validation-fail input,.tabulator-row .tabulator-cell.tabulator-validation-fail select{border:1px;background:transparent;color:#d00}.tabulator-row .tabulator-cell.tabulator-row-handle{display:inline-flex;align-items:center;justify-content:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box{width:80%}.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box .tabulator-row-handle-bar{width:100%;height:3px;margin-top:2px;background:#666}.tabulator-row .tabulator-cell .tabulator-data-tree-branch{display:inline-block;vertical-align:middle;height:9px;width:7px;margin-top:-9px;margin-right:5px;border-bottom-left-radius:1px;border-left:2px solid #dee2e6;border-bottom:2px solid #dee2e6}.tabulator-row .tabulator-cell .tabulator-data-tree-control{display:inline-flex;justify-content:center;align-items:center;vertical-align:middle;height:11px;width:11px;margin-right:5px;border:1px solid #333;border-radius:2px;background:rgba(0,0,0,.1);overflow:hidden}.tabulator-row .tabulator-cell .tabulator-data-tree-control:hover{cursor:pointer;background:rgba(0,0,0,.2)}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse{display:inline-block;position:relative;height:7px;width:1px;background:transparent}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand{display:inline-block;position:relative;height:7px;width:1px;background:#333}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle{display:inline-flex;align-items:center;justify-content:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;height:15px;width:15px;border-radius:20px;background:#666;color:transparent;font-weight:700;font-size:1.1em}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle:hover{opacity:.7}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-close{display:initial}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-open,.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle .tabulator-responsive-collapse-toggle-close{display:none}.tabulator-row .tabulator-cell .tabulator-traffic-light{display:inline-block;height:14px;width:14px;border-radius:14px}.tabulator-row.tabulator-group{box-sizing:border-box;border-bottom:1px solid #999;border-right:1px solid #dee2e6;border-top:1px solid #999;padding:5px 5px 5px 10px;background:#ccc;font-weight:700;min-width:100%}.tabulator-row.tabulator-group:hover{cursor:pointer;background-color:rgba(0,0,0,.1)}.tabulator-row.tabulator-group.tabulator-group-visible .tabulator-arrow{margin-right:10px;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #666;border-bottom:0}.tabulator-row.tabulator-group.tabulator-group-level-1{padding-left:30px}.tabulator-row.tabulator-group.tabulator-group-level-2{padding-left:50px}.tabulator-row.tabulator-group.tabulator-group-level-3{padding-left:70px}.tabulator-row.tabulator-group.tabulator-group-level-4{padding-left:90px}.tabulator-row.tabulator-group.tabulator-group-level-5{padding-left:110px}.tabulator-row.tabulator-group .tabulator-group-toggle{display:inline-block}.tabulator-row.tabulator-group .tabulator-arrow{display:inline-block;width:0;height:0;margin-right:16px;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:0;border-left:6px solid #666;vertical-align:middle}.tabulator-row.tabulator-group span{margin-left:10px;color:#d00}.tabulator-popup-container{position:absolute;display:inline-block;box-sizing:border-box;background:transparent;border:1px solid #dee2e6;box-shadow:0 0 5px 0 rgba(0,0,0,.2);font-size:16px;overflow-y:auto;-webkit-overflow-scrolling:touch;z-index:10000}.tabulator-popup{padding:5px;border-radius:3px}.tabulator-tooltip{max-width:Min(500px,100%);padding:3px 5px;border-radius:2px;box-shadow:none;font-size:12px;pointer-events:none}.tabulator-menu .tabulator-menu-item{position:relative;box-sizing:border-box;padding:5px 10px;user-select:none}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-disabled{opacity:.5}.tabulator-menu .tabulator-menu-item:not(.tabulator-menu-item-disabled):hover{cursor:pointer;background:rgba(0,0,0,.05)}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu{padding-right:25px}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu:after{display:inline-block;position:absolute;top:calc(5px + .4em);right:10px;height:7px;width:7px;content:"";border-color:#dee2e6;border-style:solid;border-width:1px 1px 0 0;vertical-align:top;transform:rotate(45deg)}.tabulator-menu .tabulator-menu-separator{border-top:1px solid #dee2e6}.tabulator-edit-list{max-height:200px;font-size:16px;overflow-y:auto;-webkit-overflow-scrolling:touch}.tabulator-edit-list .tabulator-edit-list-item{padding:4px;color:#333;outline:none}.tabulator-edit-list .tabulator-edit-list-item.active{color:transparent;background:#1d68cd}.tabulator-edit-list .tabulator-edit-list-item.active.focused{outline:1px solid rgba(0,0,0,.5)}.tabulator-edit-list .tabulator-edit-list-item.focused{outline:1px solid #1d68cd}.tabulator-edit-list .tabulator-edit-list-item:hover{cursor:pointer;color:transparent;background:#1d68cd}.tabulator-edit-list .tabulator-edit-list-placeholder{padding:4px;color:#333;text-align:center}.tabulator-edit-list .tabulator-edit-list-group{border-bottom:1px solid #dee2e6;padding:6px 4px 4px;color:#333;font-weight:700}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-2,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-2{padding-left:12px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-3,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-3{padding-left:20px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-4,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-4{padding-left:28px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-5,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-5{padding-left:36px}.tabulator.tabulator-ltr{direction:ltr}.tabulator.tabulator-rtl{text-align:initial;direction:rtl}.tabulator.tabulator-rtl .tabulator-header .tabulator-col{border-left:1px solid #aaa;border-right:initial}.tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{margin-right:0;margin-left:-1px}.tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title{padding-right:0;padding-left:25px}.tabulator.tabulator-rtl .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{left:8px;right:auto}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell{border-right:initial;border-left:1px solid #dee2e6}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-branch{margin-right:0;margin-left:5px;border-bottom-left-radius:0;border-bottom-right-radius:1px;border-left:initial;border-right:2px solid #dee2e6}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-control{margin-right:0;margin-left:5px}.tabulator-print-fullscreen{position:absolute;top:0;bottom:0;left:0;right:0;z-index:10000}body.tabulator-print-fullscreen-hide>:not(.tabulator-print-fullscreen){display:none!important}.tabulator-print-table{border-collapse:collapse}.tabulator-print-table .tabulator-data-tree-branch{display:inline-block;vertical-align:middle;height:9px;width:7px;margin-top:-9px;margin-right:5px;border-bottom-left-radius:1px;border-left:2px solid #dee2e6;border-bottom:2px solid #dee2e6}.tabulator-print-table .tabulator-print-table-group{box-sizing:border-box;border-bottom:1px solid #999;border-right:1px solid #dee2e6;border-top:1px solid #999;padding:5px 5px 5px 10px;background:#ccc;font-weight:700;min-width:100%}.tabulator-print-table .tabulator-print-table-group:hover{cursor:pointer;background-color:rgba(0,0,0,.1)}.tabulator-print-table .tabulator-print-table-group.tabulator-group-visible .tabulator-arrow{margin-right:10px;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #666;border-bottom:0}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-1 td{padding-left:30px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-2 td{padding-left:50px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-3 td{padding-left:70px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-4 td{padding-left:90px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-5 td{padding-left:110px!important}.tabulator-print-table .tabulator-print-table-group .tabulator-group-toggle{display:inline-block}.tabulator-print-table .tabulator-print-table-group .tabulator-arrow{display:inline-block;width:0;height:0;margin-right:16px;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:0;border-left:6px solid #666;vertical-align:middle}.tabulator-print-table .tabulator-print-table-group span{margin-left:10px;color:#d00}.tabulator-print-table .tabulator-data-tree-control{display:inline-flex;justify-content:center;align-items:center;vertical-align:middle;height:11px;width:11px;margin-right:5px;border:1px solid #333;border-radius:2px;background:rgba(0,0,0,.1);overflow:hidden}.tabulator-print-table .tabulator-data-tree-control:hover{cursor:pointer;background:rgba(0,0,0,.2)}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse{display:inline-block;position:relative;height:7px;width:1px;background:transparent}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand{display:inline-block;position:relative;height:7px;width:1px;background:#333}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator{background-color:transparent;border:none}.tabulator .tabulator-header{border-top:1px solid #dee2e6;border-bottom:2px solid #dee2e6;color:inherit}.tabulator .tabulator-header .tabulator-col{border-right:none;background-color:transparent}.tabulator .tabulator-header .tabulator-col .tabulator-col-content{padding:12px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{right:0}.tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{border-top:1px solid #dee2e6}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input{padding:.375rem .75rem;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;font-size:1rem;line-height:1.5;color:#495057}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input:focus{color:#495057;background-color:#fff;border:1px solid #1d68cd;outline:0}.tabulator .tabulator-header .tabulator-calcs-holder{width:100%;border-bottom:1px solid #dee2e6}.tabulator .tabulator-tableholder .tabulator-placeholder span{color:#000}.tabulator .tabulator-footer,.tabulator .tabulator-footer .tabulator-paginator,.tabulator .tabulator-tableholder .tabulator-table{color:inherit}.tabulator .tabulator-footer .tabulator-pages{margin:0}.tabulator .tabulator-footer .tabulator-page{margin:5px 0 0;padding:8px 12px}.tabulator .tabulator-footer .tabulator-page[data-page=first]{border-top-left-radius:4px;border-bottom-left-radius:4px}.tabulator .tabulator-footer .tabulator-page[data-page=last]{border:1px solid #dee2e6;border-top-right-radius:4px;border-bottom-right-radius:4px}.tabulator .tabulator-footer .tabulator-page.active{border-color:#0d6efd;background-color:#0d6efd;color:#fff}.tabulator .tabulator-footer .tabulator-page:disabled{border-color:#dee2e6;background:#fff;color:#6c757d}.tabulator .tabulator-footer .tabulator-page:not(.disabled):hover{border-color:#dee2e6;background:#e9ecef;color:#0a58ca}.tabulator.thead-dark .tabulator-header,.tabulator.thead-dark .tabulator-header .tabulator-col{border-color:#dee2e6;background-color:transparent;color:#212529}.tabulator.table{background-color:transparent}.tabulator.table:not(.thead-light) .tabulator-header,.tabulator.table:not(.thead-light) .tabulator-header .tabulator-col{border-color:#dee2e6;background-color:transparent;color:#212529}.tabulator.table .tabulator-tableholder{color:#212529}.tabulator.table .tabulator-row{border-color:#dee2e6;background-color:transparent;color:#212529}.tabulator.table .tabulator-row:hover{background-color:#dee2e6}.tabulator.table .tabulator-row:hover .tabulator-cell{background-color:rgba(0,0,0,.075)}.tabulator.table .tabulator-row.tabulator-selected{background-color:#9abcea}.tabulator.table .tabulator-footer{border-color:#dee2e6!important}.tabulator.table .tabulator-footer .tabulator-calcs-holder{border-color:#dee2e6!important;background:transparent!important}.tabulator.table .tabulator-footer .tabulator-calcs-holder .tabulator-row{border-color:#dee2e6!important;background-color:transparent!important;color:#212529!important}.tabulator.table-striped:not(.table) .tabulator-row:nth-child(2n){background-color:rgba(0,0,0,.05)}.tabulator.table-striped:not(.table) .tabulator-row:nth-child(2n).tabulator-selected{background-color:#9abcea}.tabulator.table-striped:not(.table) .tabulator-row:nth-child(2n).tabulator-selectable:hover{background-color:rgba(0,0,0,.075);cursor:pointer}.tabulator.table-striped:not(.table) .tabulator-row:nth-child(2n).tabulator-selected:hover{background-color:#769bcc;cursor:pointer}.tabulator.table-striped.table .tabulator-row:nth-child(2n) .tabulator-cell{background-color:transparent}.tabulator.table-bordered{border:1px solid #dee2e6}.tabulator.table-bordered .tabulator-header .tabulator-col,.tabulator.table-bordered .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell{border-right:1px solid #dee2e6}.tabulator.table-borderless .tabulator-header,.tabulator.table-borderless .tabulator-row{border:none}.tabulator.table-sm .tabulator-header .tabulator-col .tabulator-col-content{padding:5px!important}.tabulator.table-sm .tabulator-tableholder .tabulator-table .tabulator-row{min-height:26px}.tabulator.table-sm .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell{padding:5px!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-primary{background:theme-color-level("primary",-9)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-secondary{background:theme-color-level("secondary",-9)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-success{background:theme-color-level("success",-9)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-info{background:theme-color-level("info",-9)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-warning{background:theme-color-level("warning",-9)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-danger{background:theme-color-level("danger",-9)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-light{background:theme-color-level("light",-9)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table{background:theme-color-level("dark",-9)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-active{background:rgba(0,0,0,.1)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-primary{background:theme-color-level("primary",0)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-secondary{background:theme-color-level("secondary",0)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-success{background:theme-color-level("success",0)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-info{background:theme-color-level("info",0)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-warning{background:theme-color-level("warning",0)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-danger{background:theme-color-level("danger",0)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-light{background:theme-color-level("light",0)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-dark{background:theme-color-level("dark",0)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-active{background:rgba(0,0,0,.1)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-primary{background:theme-color-level("primary",-9)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-secondary{background:theme-color-level("secondary",-9)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-success{background:theme-color-level("success",-9)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-info{background:theme-color-level("info",-9)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-warning{background:theme-color-level("warning",-9)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-danger{background:theme-color-level("danger",-9)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-light{background:theme-color-level("light",-9)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table{background:theme-color-level("dark",-9)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-active{background:rgba(0,0,0,.1)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-primary{background:theme-color-level("primary",0)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-secondary{background:theme-color-level("secondary",0)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-success{background:theme-color-level("success",0)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-info{background:theme-color-level("info",0)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-warning{background:theme-color-level("warning",0)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-danger{background:theme-color-level("danger",0)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-light{background:theme-color-level("light",0)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-dark{background:theme-color-level("dark",0)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-active{background:rgba(0,0,0,.1)!important}.tabulator-row{min-height:40px;border-bottom:1px solid #dee2e6}.tabulator-row .tabulator-cell{padding:12px;border-right:none}.tabulator-row .tabulator-cell:last-of-type{border-right:none}.tabulator-row .tabulator-cell .tabulator-data-tree-control{border:1px solid #ccc}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after,.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand,.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{background:#ccc}.tabulator-row.tabulator-group{background:#fafafa}.tabulator-row.tabulator-group span{color:#666}.tabulator-edit-select-list{background:transparent}.tabulator-edit-select-list .tabulator-edit-select-list-item.active{color:transparent}.tabulator-edit-select-list .tabulator-edit-select-list-item.active.focused{outline:1px solid rgba(0,0,0,.5)}.tabulator-edit-select-list .tabulator-edit-select-list-item:hover{color:transparent}.tabulator-edit-select-list .tabulator-edit-select-list-group,.tabulator-edit-select-list .tabulator-edit-select-list-notice{color:inherit}.tabulator.tabulator-rtl .tabulator-header .tabulator-col{text-align:initial;border-left:initial}.tabulator-print-table .tabulator-print-table-group{background:#fafafa}.tabulator-print-table .tabulator-print-table-group span{color:#666}.tabulator-print-table .tabulator-data-tree-control{color:inherit}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after,.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand,.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{background:#ccc}.tabulator-popup-container{background:#fff}.tabulator-edit-list .tabulator-edit-list-item.active{color:#fff}.tabulator-edit-list .tabulator-edit-list-item.active.focused{outline:1px solid hsla(0,0%,100%,.5)}.tabulator-edit-list .tabulator-edit-list-item:hover{color:#fff} +.tabulator{position:relative;border:1px solid #dee2e6;font-size:16px;text-align:left;overflow:hidden;-webkit-transform:translatez(0);-moz-transform:translatez(0);-ms-transform:translatez(0);-o-transform:translatez(0);transform:translatez(0)}.tabulator[tabulator-layout=fitDataFill] .tabulator-tableholder .tabulator-table{min-width:100%}.tabulator[tabulator-layout=fitDataTable]{display:inline-block}.tabulator.tabulator-block-select{user-select:none}.tabulator .tabulator-header{position:relative;box-sizing:border-box;width:100%;border-bottom:1px solid #dee2e6;background-color:transparent;color:#555;font-weight:700;white-space:nowrap;overflow:hidden;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator .tabulator-header.tabulator-header-hidden{display:none}.tabulator .tabulator-header .tabulator-col{display:inline-block;position:relative;box-sizing:border-box;border-right:1px solid #aaa;background:transparent;text-align:left;vertical-align:bottom;overflow:hidden}.tabulator .tabulator-header .tabulator-col.tabulator-moving{position:absolute;border:1px solid #dee2e6;background:transparent;pointer-events:none}.tabulator .tabulator-header .tabulator-col .tabulator-col-content{box-sizing:border-box;position:relative;padding:4px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button{padding:0 8px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button:hover{cursor:pointer;opacity:.6}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title-holder{position:relative}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title{box-sizing:border-box;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-title-editor{box-sizing:border-box;width:100%;border:1px solid #999;padding:1px;background:#fff}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-header-popup-button+.tabulator-title-editor{width:calc(100% - 22px)}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{display:flex;align-items:center;position:absolute;top:0;bottom:0;right:4px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #bbb}.tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{position:relative;display:flex;border-top:1px solid #aaa;overflow:hidden;margin-right:-1px}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter{position:relative;box-sizing:border-box;margin-top:2px;width:100%;text-align:center}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter textarea{height:auto!important}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter svg{margin-top:3px}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input::-ms-clear{width:0;height:0}.tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title{padding-right:25px}.tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover{cursor:pointer;background-color:transparent}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter{color:#bbb}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-top:none;border-bottom:6px solid #bbb}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=asc] .tabulator-col-content .tabulator-col-sorter{color:#666}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=asc] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-top:none;border-bottom:6px solid #666}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=desc] .tabulator-col-content .tabulator-col-sorter{color:#666}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=desc] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-bottom:none;border-top:6px solid #666;color:#666}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title{writing-mode:vertical-rl;text-orientation:mixed;display:flex;align-items:center;justify-content:center}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-col-vertical-flip .tabulator-col-title{transform:rotate(180deg)}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-title{padding-right:0;padding-top:20px}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable.tabulator-col-vertical-flip .tabulator-col-title{padding-right:0;padding-bottom:20px}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-sorter{justify-content:center;left:0;right:0;top:4px;bottom:auto}.tabulator .tabulator-header .tabulator-frozen{display:inline-block;position:absolute;z-index:10}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-left{border-right:2px solid #dee2e6}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right{border-left:2px solid #dee2e6}.tabulator .tabulator-header .tabulator-calcs-holder{box-sizing:border-box;min-width:600%;background:rgba(13,13,13,0)!important;border-top:1px solid #dee2e6;border-bottom:1px solid #aaa;overflow:hidden}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row{background:rgba(13,13,13,0)!important}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-header .tabulator-frozen-rows-holder{min-width:600%}.tabulator .tabulator-header .tabulator-frozen-rows-holder:empty{display:none}.tabulator .tabulator-tableholder{position:relative;width:100%;white-space:nowrap;overflow:auto;-webkit-overflow-scrolling:touch}.tabulator .tabulator-tableholder:focus{outline:none}.tabulator .tabulator-tableholder .tabulator-placeholder{box-sizing:border-box;display:flex;align-items:center;width:100%}.tabulator .tabulator-tableholder .tabulator-placeholder[tabulator-render-mode=virtual]{min-height:100%;min-width:100%}.tabulator .tabulator-tableholder .tabulator-placeholder .tabulator-placeholder-contents{display:inline-block;text-align:center;padding:10px;color:#ccc;font-weight:700;font-size:20px;white-space:normal}.tabulator .tabulator-tableholder .tabulator-table{position:relative;display:inline-block;background-color:transparent;white-space:nowrap;overflow:visible;color:#333}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs{font-weight:700;background:rgba(0,0,0,.05)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-top{border-bottom:2px solid #dee2e6}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-bottom{border-top:2px solid #dee2e6}.tabulator .tabulator-footer{border-top:1px solid #dee2e6;background-color:#e6e6e6;color:#555;font-weight:700;white-space:nowrap;user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator .tabulator-footer .tabulator-footer-contents{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:5px 10px}.tabulator .tabulator-footer .tabulator-footer-contents:empty{display:none}.tabulator .tabulator-footer .tabulator-calcs-holder{box-sizing:border-box;width:calc(100% + 20px);text-align:left;background:#f3f3f3!important;border-bottom:1px solid #dee2e6;border-top:1px solid #dee2e6;overflow:hidden}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row{background:#f3f3f3!important}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-footer .tabulator-calcs-holder:only-child{margin-bottom:-5px;border-bottom:none}.tabulator .tabulator-footer>*+.tabulator-page-counter{margin-left:10px}.tabulator .tabulator-footer .tabulator-page-counter{font-weight:400}.tabulator .tabulator-footer .tabulator-paginator{flex:1;text-align:right;color:#555;font-family:inherit;font-weight:inherit;font-size:inherit}.tabulator .tabulator-footer .tabulator-page-size{display:inline-block;margin:0 5px;padding:2px 5px;border:1px solid #dee2e6;border-radius:3px}.tabulator .tabulator-footer .tabulator-pages{margin:0 7px}.tabulator .tabulator-footer .tabulator-page{display:inline-block;margin:0 2px;padding:2px 5px;border:1px solid #dee2e6;border-radius:3px;background:hsla(0,0%,100%,.2)}.tabulator .tabulator-footer .tabulator-page:disabled{opacity:.5}.tabulator .tabulator-footer .tabulator-page:not(.disabled):hover{cursor:pointer;background:rgba(0,0,0,.2);color:#fff}.tabulator .tabulator-col-resize-handle{position:relative;display:inline-block;width:6px;margin-left:-3px;margin-right:-3px;z-index:10;vertical-align:middle}.tabulator .tabulator-col-resize-handle:hover{cursor:ew-resize}.tabulator .tabulator-col-resize-handle:last-of-type{width:3px;margin-right:0}.tabulator .tabulator-alert{position:absolute;display:flex;align-items:center;top:0;left:0;z-index:100;height:100%;width:100%;background:rgba(0,0,0,.4);text-align:center}.tabulator .tabulator-alert .tabulator-alert-msg{display:inline-block;margin:0 auto;padding:10px 20px;border-radius:10px;background:#fff;font-weight:700;font-size:16px}.tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-msg{border:4px solid #333;color:#000}.tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-error{border:4px solid #d00;color:#590000}.tabulator-row{position:relative;box-sizing:border-box;min-height:24px;background-color:transparent}.tabulator-row.tabulator-row-even{background-color:rgba(0,0,0,.05)}.tabulator-row.tabulator-selectable:hover{background-color:rgba(0,0,0,.075);cursor:pointer}.tabulator-row.tabulator-selected{background-color:#9abcea}.tabulator-row.tabulator-selected:hover{background-color:#769bcc;cursor:pointer}.tabulator-row.tabulator-row-moving{border:1px solid #000;background:#fff}.tabulator-row.tabulator-moving{position:absolute;border-top:1px solid #dee2e6;border-bottom:1px solid #dee2e6;pointer-events:none;z-index:15}.tabulator-row .tabulator-row-resize-handle{position:absolute;right:0;bottom:0;left:0;height:5px}.tabulator-row .tabulator-row-resize-handle.prev{top:0;bottom:auto}.tabulator-row .tabulator-row-resize-handle:hover{cursor:ns-resize}.tabulator-row .tabulator-frozen{display:inline-block;position:absolute;background-color:inherit;z-index:10}.tabulator-row .tabulator-frozen.tabulator-frozen-left{border-right:2px solid #dee2e6}.tabulator-row .tabulator-frozen.tabulator-frozen-right{border-left:2px solid #dee2e6}.tabulator-row .tabulator-responsive-collapse{box-sizing:border-box;padding:5px;border-top:1px solid #dee2e6;border-bottom:1px solid #dee2e6}.tabulator-row .tabulator-responsive-collapse:empty{display:none}.tabulator-row .tabulator-responsive-collapse table{font-size:16px}.tabulator-row .tabulator-responsive-collapse table tr td{position:relative}.tabulator-row .tabulator-responsive-collapse table tr td:first-of-type{padding-right:10px}.tabulator-row .tabulator-cell{display:inline-block;position:relative;box-sizing:border-box;padding:4px;border-right:1px solid #dee2e6;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tabulator-row .tabulator-cell.tabulator-editing{border:1px solid #1d68cd;outline:none;padding:0}.tabulator-row .tabulator-cell.tabulator-editing input,.tabulator-row .tabulator-cell.tabulator-editing select{border:1px;background:transparent;outline:none}.tabulator-row .tabulator-cell.tabulator-validation-fail{border:1px solid #d00}.tabulator-row .tabulator-cell.tabulator-validation-fail input,.tabulator-row .tabulator-cell.tabulator-validation-fail select{border:1px;background:transparent;color:#d00}.tabulator-row .tabulator-cell.tabulator-row-handle{display:inline-flex;align-items:center;justify-content:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box{width:80%}.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box .tabulator-row-handle-bar{width:100%;height:3px;margin-top:2px;background:#666}.tabulator-row .tabulator-cell .tabulator-data-tree-branch{display:inline-block;vertical-align:middle;height:9px;width:7px;margin-top:-9px;margin-right:5px;border-bottom-left-radius:1px;border-left:2px solid #dee2e6;border-bottom:2px solid #dee2e6}.tabulator-row .tabulator-cell .tabulator-data-tree-control{display:inline-flex;justify-content:center;align-items:center;vertical-align:middle;height:11px;width:11px;margin-right:5px;border:1px solid #333;border-radius:2px;background:rgba(0,0,0,.1);overflow:hidden}.tabulator-row .tabulator-cell .tabulator-data-tree-control:hover{cursor:pointer;background:rgba(0,0,0,.2)}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse{display:inline-block;position:relative;height:7px;width:1px;background:transparent}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand{display:inline-block;position:relative;height:7px;width:1px;background:#333}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle{display:inline-flex;align-items:center;justify-content:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;height:15px;width:15px;border-radius:20px;background:#666;color:transparent;font-weight:700;font-size:1.1em}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle:hover{opacity:.7}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-close{display:initial}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-open,.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle .tabulator-responsive-collapse-toggle-close{display:none}.tabulator-row .tabulator-cell .tabulator-traffic-light{display:inline-block;height:14px;width:14px;border-radius:14px}.tabulator-row.tabulator-group{box-sizing:border-box;border-bottom:1px solid #999;border-right:1px solid #dee2e6;border-top:1px solid #999;padding:5px 5px 5px 10px;background:#ccc;font-weight:700;min-width:100%}.tabulator-row.tabulator-group:hover{cursor:pointer;background-color:rgba(0,0,0,.1)}.tabulator-row.tabulator-group.tabulator-group-visible .tabulator-arrow{margin-right:10px;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #666;border-bottom:0}.tabulator-row.tabulator-group.tabulator-group-level-1{padding-left:30px}.tabulator-row.tabulator-group.tabulator-group-level-2{padding-left:50px}.tabulator-row.tabulator-group.tabulator-group-level-3{padding-left:70px}.tabulator-row.tabulator-group.tabulator-group-level-4{padding-left:90px}.tabulator-row.tabulator-group.tabulator-group-level-5{padding-left:110px}.tabulator-row.tabulator-group .tabulator-group-toggle{display:inline-block}.tabulator-row.tabulator-group .tabulator-arrow{display:inline-block;width:0;height:0;margin-right:16px;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:0;border-left:6px solid #666;vertical-align:middle}.tabulator-row.tabulator-group span{margin-left:10px;color:#d00}.tabulator-popup-container{position:absolute;display:inline-block;box-sizing:border-box;background:transparent;border:1px solid #dee2e6;box-shadow:0 0 5px 0 rgba(0,0,0,.2);font-size:16px;overflow-y:auto;-webkit-overflow-scrolling:touch;z-index:10000}.tabulator-popup{padding:5px;border-radius:3px}.tabulator-tooltip{max-width:Min(500px,100%);padding:3px 5px;border-radius:2px;box-shadow:none;font-size:12px;pointer-events:none}.tabulator-menu .tabulator-menu-item{position:relative;box-sizing:border-box;padding:5px 10px;user-select:none}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-disabled{opacity:.5}.tabulator-menu .tabulator-menu-item:not(.tabulator-menu-item-disabled):hover{cursor:pointer;background:rgba(0,0,0,.05)}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu{padding-right:25px}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu:after{display:inline-block;position:absolute;top:calc(5px + .4em);right:10px;height:7px;width:7px;content:"";border-color:#dee2e6;border-style:solid;border-width:1px 1px 0 0;vertical-align:top;transform:rotate(45deg)}.tabulator-menu .tabulator-menu-separator{border-top:1px solid #dee2e6}.tabulator-edit-list{max-height:200px;font-size:16px;overflow-y:auto;-webkit-overflow-scrolling:touch}.tabulator-edit-list .tabulator-edit-list-item{padding:4px;color:#333;outline:none}.tabulator-edit-list .tabulator-edit-list-item.active{color:transparent;background:#1d68cd}.tabulator-edit-list .tabulator-edit-list-item.active.focused{outline:1px solid rgba(0,0,0,.5)}.tabulator-edit-list .tabulator-edit-list-item.focused{outline:1px solid #1d68cd}.tabulator-edit-list .tabulator-edit-list-item:hover{cursor:pointer;color:transparent;background:#1d68cd}.tabulator-edit-list .tabulator-edit-list-placeholder{padding:4px;color:#333;text-align:center}.tabulator-edit-list .tabulator-edit-list-group{border-bottom:1px solid #dee2e6;padding:6px 4px 4px;color:#333;font-weight:700}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-2,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-2{padding-left:12px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-3,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-3{padding-left:20px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-4,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-4{padding-left:28px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-5,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-5{padding-left:36px}.tabulator.tabulator-ltr{direction:ltr}.tabulator.tabulator-rtl{text-align:initial;direction:rtl}.tabulator.tabulator-rtl .tabulator-header .tabulator-col{border-left:1px solid #aaa;border-right:initial}.tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{margin-right:0;margin-left:-1px}.tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title{padding-right:0;padding-left:25px}.tabulator.tabulator-rtl .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{left:8px;right:auto}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell{border-right:initial;border-left:1px solid #dee2e6}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-branch{margin-right:0;margin-left:5px;border-bottom-left-radius:0;border-bottom-right-radius:1px;border-left:initial;border-right:2px solid #dee2e6}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-control{margin-right:0;margin-left:5px}.tabulator-print-fullscreen{position:absolute;top:0;bottom:0;left:0;right:0;z-index:10000}body.tabulator-print-fullscreen-hide>:not(.tabulator-print-fullscreen){display:none!important}.tabulator-print-table{border-collapse:collapse}.tabulator-print-table .tabulator-data-tree-branch{display:inline-block;vertical-align:middle;height:9px;width:7px;margin-top:-9px;margin-right:5px;border-bottom-left-radius:1px;border-left:2px solid #dee2e6;border-bottom:2px solid #dee2e6}.tabulator-print-table .tabulator-print-table-group{box-sizing:border-box;border-bottom:1px solid #999;border-right:1px solid #dee2e6;border-top:1px solid #999;padding:5px 5px 5px 10px;background:#ccc;font-weight:700;min-width:100%}.tabulator-print-table .tabulator-print-table-group:hover{cursor:pointer;background-color:rgba(0,0,0,.1)}.tabulator-print-table .tabulator-print-table-group.tabulator-group-visible .tabulator-arrow{margin-right:10px;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #666;border-bottom:0}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-1 td{padding-left:30px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-2 td{padding-left:50px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-3 td{padding-left:70px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-4 td{padding-left:90px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-5 td{padding-left:110px!important}.tabulator-print-table .tabulator-print-table-group .tabulator-group-toggle{display:inline-block}.tabulator-print-table .tabulator-print-table-group .tabulator-arrow{display:inline-block;width:0;height:0;margin-right:16px;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:0;border-left:6px solid #666;vertical-align:middle}.tabulator-print-table .tabulator-print-table-group span{margin-left:10px;color:#d00}.tabulator-print-table .tabulator-data-tree-control{display:inline-flex;justify-content:center;align-items:center;vertical-align:middle;height:11px;width:11px;margin-right:5px;border:1px solid #333;border-radius:2px;background:rgba(0,0,0,.1);overflow:hidden}.tabulator-print-table .tabulator-data-tree-control:hover{cursor:pointer;background:rgba(0,0,0,.2)}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse{display:inline-block;position:relative;height:7px;width:1px;background:transparent}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand{display:inline-block;position:relative;height:7px;width:1px;background:#333}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator{background-color:transparent;border:none}.tabulator .tabulator-header{border-top:1px solid #dee2e6;border-bottom:2px solid #dee2e6;color:inherit}.tabulator .tabulator-header .tabulator-col{border-right:none;background-color:transparent}.tabulator .tabulator-header .tabulator-col .tabulator-col-content{padding:12px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{right:0}.tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{border-top:1px solid #dee2e6}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input{padding:.375rem .75rem;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;font-size:1rem;line-height:1.5;color:#495057}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input:focus{color:#495057;background-color:#fff;border:1px solid #1d68cd;outline:0}.tabulator .tabulator-header .tabulator-calcs-holder{width:100%;border-bottom:1px solid #dee2e6}.tabulator .tabulator-tableholder .tabulator-placeholder span{color:#000}.tabulator .tabulator-footer,.tabulator .tabulator-footer .tabulator-paginator,.tabulator .tabulator-tableholder .tabulator-table{color:inherit}.tabulator .tabulator-footer .tabulator-pages{margin:0}.tabulator .tabulator-footer .tabulator-page{margin:5px 0 0;padding:8px 12px}.tabulator .tabulator-footer .tabulator-page[data-page=first]{border-top-left-radius:4px;border-bottom-left-radius:4px}.tabulator .tabulator-footer .tabulator-page[data-page=last]{border:1px solid #dee2e6;border-top-right-radius:4px;border-bottom-right-radius:4px}.tabulator .tabulator-footer .tabulator-page.active{border-color:#0d6efd;background-color:#0d6efd;color:#fff}.tabulator .tabulator-footer .tabulator-page:disabled{border-color:#dee2e6;background:#fff;color:#6c757d}.tabulator .tabulator-footer .tabulator-page:not(.disabled):hover{border-color:#dee2e6;background:#e9ecef;color:#0a58ca}.tabulator.thead-dark .tabulator-header,.tabulator.thead-dark .tabulator-header .tabulator-col{border-color:#dee2e6;background-color:transparent;color:#212529}.tabulator.table{background-color:transparent}.tabulator.table:not(.thead-light) .tabulator-header,.tabulator.table:not(.thead-light) .tabulator-header .tabulator-col{border-color:#dee2e6;background-color:transparent;color:#212529}.tabulator.table .tabulator-tableholder{color:#212529}.tabulator.table .tabulator-row{border-color:#dee2e6;background-color:transparent;color:#212529}.tabulator.table .tabulator-row:hover{background-color:#dee2e6}.tabulator.table .tabulator-row:hover .tabulator-cell{background-color:rgba(0,0,0,.075)}.tabulator.table .tabulator-row.tabulator-selected{background-color:#9abcea}.tabulator.table .tabulator-footer{border-color:#dee2e6!important}.tabulator.table .tabulator-footer .tabulator-calcs-holder{border-color:#dee2e6!important;background:transparent!important}.tabulator.table .tabulator-footer .tabulator-calcs-holder .tabulator-row{border-color:#dee2e6!important;background-color:transparent!important;color:#212529!important}.tabulator.table-striped:not(.table) .tabulator-row:nth-child(2n){background-color:rgba(0,0,0,.05)}.tabulator.table-striped:not(.table) .tabulator-row:nth-child(2n).tabulator-selected{background-color:#9abcea}.tabulator.table-striped:not(.table) .tabulator-row:nth-child(2n).tabulator-selectable:hover{background-color:rgba(0,0,0,.075);cursor:pointer}.tabulator.table-striped:not(.table) .tabulator-row:nth-child(2n).tabulator-selected:hover{background-color:#769bcc;cursor:pointer}.tabulator.table-striped.table .tabulator-row:nth-child(2n) .tabulator-cell{background-color:transparent}.tabulator.table-bordered{border:1px solid #dee2e6}.tabulator.table-bordered .tabulator-header .tabulator-col,.tabulator.table-bordered .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell{border-right:1px solid #dee2e6}.tabulator.table-borderless .tabulator-header,.tabulator.table-borderless .tabulator-row{border:none}.tabulator.table-sm .tabulator-header .tabulator-col .tabulator-col-content{padding:5px!important}.tabulator.table-sm .tabulator-tableholder .tabulator-table .tabulator-row{min-height:26px}.tabulator.table-sm .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell{padding:5px!important}.tabulator.table-sm .tabulator-row{padding-top:0;padding-bottom:0}.tabulator.table-sm .tabulator-col-resize-handle{padding:0}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-primary{background:#cfe2ff!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-secondary{background:#e2e3e5!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-success{background:#d1e7dd!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-info{background:#cff4fc!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-warning{background:#fff3cd!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-danger{background:#f8d7da!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-light{background:#f8f9fa!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table{background:#212529!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-active{background:rgba(0,0,0,.1)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-primary{background:#cfe2ff!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-secondary{background:#e2e3e5!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-success{background:#d1e7dd!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-info{background:#cff4fc!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-warning{background:#fff3cd!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-danger{background:#f8d7da!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-light{background:#f8f9fa!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-dark{background:#212529!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-active{background:rgba(0,0,0,.1)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-primary{background:#cfe2ff!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-secondary{background:#e2e3e5!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-success{background:#d1e7dd!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-info{background:#cff4fc!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-warning{background:#fff3cd!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-danger{background:#f8d7da!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-light{background:#f8f9fa!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table{background:#212529!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-active{background:rgba(0,0,0,.1)!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-primary{background:#cfe2ff!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-secondary{background:#e2e3e5!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-success{background:#d1e7dd!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-info{background:#cff4fc!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-warning{background:#fff3cd!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-danger{background:#f8d7da!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-light{background:#f8f9fa!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-dark{background:#212529!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-active{background:rgba(0,0,0,.1)!important}.tabulator-row{min-height:40px;border-bottom:1px solid #dee2e6}.tabulator-row .tabulator-cell{padding:12px;border-right:none}.tabulator-row .tabulator-cell:last-of-type{border-right:none}.tabulator-row .tabulator-cell .tabulator-data-tree-control{border:1px solid #ccc}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after,.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand,.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{background:#ccc}.tabulator-row.tabulator-group{background:#fafafa}.tabulator-row.tabulator-group span{color:#666}.tabulator-edit-select-list{background:transparent}.tabulator-edit-select-list .tabulator-edit-select-list-item.active{color:transparent}.tabulator-edit-select-list .tabulator-edit-select-list-item.active.focused{outline:1px solid rgba(0,0,0,.5)}.tabulator-edit-select-list .tabulator-edit-select-list-item:hover{color:transparent}.tabulator-edit-select-list .tabulator-edit-select-list-group,.tabulator-edit-select-list .tabulator-edit-select-list-notice{color:inherit}.tabulator.tabulator-rtl .tabulator-header .tabulator-col{text-align:initial;border-left:initial}.tabulator-print-table .tabulator-print-table-group{background:#fafafa}.tabulator-print-table .tabulator-print-table-group span{color:#666}.tabulator-print-table .tabulator-data-tree-control{color:inherit}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after,.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand,.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{background:#ccc}.tabulator-popup-container{background:#fff}.tabulator-edit-list .tabulator-edit-list-item.active{color:#fff}.tabulator-edit-list .tabulator-edit-list-item.active.focused{outline:1px solid hsla(0,0%,100%,.5)}.tabulator-edit-list .tabulator-edit-list-item:hover{color:#fff} /*# sourceMappingURL=tabulator_bootstrap5.min.css.map */ \ No newline at end of file diff --git a/dist/css/tabulator_bootstrap5.min.css.map b/dist/css/tabulator_bootstrap5.min.css.map index 7a020882d..6c883b998 100644 --- a/dist/css/tabulator_bootstrap5.min.css.map +++ b/dist/css/tabulator_bootstrap5.min.css.map @@ -1 +1 @@ -{"version":3,"sources":["tabulator_bootstrap5.scss"],"names":[],"mappings":"AAAA,WACE,iBAAkB,CAClB,wBAAyB,CAEzB,cAAe,CACf,eAAgB,CAChB,eAAgB,CAChB,+BAAgC,CAChC,4BAA6B,CAC7B,2BAA4B,CAC5B,0BAA2B,CAC3B,uBAA0B,CAC1B,iFACE,cAAiB,CACnB,0CACE,oBAAuB,CACzB,kCACE,gBAAmB,CACrB,6BACE,iBAAkB,CAClB,qBAAsB,CACtB,UAAW,CACX,+BAAgC,CAChC,4BAA6B,CAC7B,UAAW,CACX,eAAiB,CACjB,kBAAmB,CACnB,eAAgB,CAChB,qBAAsB,CACtB,uBAAwB,CACxB,wBAAyB,CACzB,mBAAsB,CACtB,qDACE,YAAe,CACjB,4CACE,oBAAqB,CACrB,iBAAkB,CAClB,qBAAsB,CACtB,2BAA4B,CAC5B,sBAAuB,CACvB,eAAgB,CAChB,qBAAsB,CACtB,eAAkB,CAClB,6DACE,iBAAkB,CAClB,wBAAyB,CACzB,sBAA4B,CAC5B,mBAAsB,CACxB,mEACE,qBAAsB,CACtB,iBAAkB,CAClB,WAAc,CACd,kGACE,aAAgB,CAChB,wGACE,cAAe,CACf,UAAa,CACjB,+FACE,iBAAoB,CACtB,wFACE,qBAAsB,CACtB,UAAW,CACX,kBAAmB,CACnB,eAAgB,CAChB,sBAAuB,CACvB,qBAAwB,CACxB,gHACE,qBAAsB,CACtB,UAAW,CACX,qBAAsB,CACtB,WAAY,CACZ,eAAkB,CACpB,+IACE,u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CAC1D,+FACE,qDAA0D,CAC5D,6FACE,mDAAwD,CAC1D,0FACE,gDAAqD,CACvD,6FACE,mDAAwD,CAC1D,4FACE,kDAAuD,CACzD,2FACE,iDAAsD,CACxD,0FACE,gDAAqD,CACvD,4FACE,mCAA2C,CAE/C,eACE,eAAgB,CAChB,+BAAkC,CAClC,+BACE,YAAa,CACb,iBAAoB,CACpB,4CACE,iBAAoB,CACtB,4DACE,qBAAwB,CAKtB,8SACE,eAAkB,CAC1B,+BACE,kBAAqB,CACrB,oCACE,UAAa,CAEnB,4BACE,sBAAyB,CACzB,oEACE,iBAAoB,CACpB,4EACE,gCAAuC,CAC3C,mEACE,iBAAoB,CAGtB,6HACE,aAAgB,CAEpB,0DACE,kBAAmB,CACnB,mBAAsB,CAExB,oDACE,kBAAqB,CACrB,yDACE,UAAa,CAEjB,oDACE,aAAgB,CAKd,sRACE,eAAkB,CAExB,2BACE,eAAkB,CAEpB,sDACE,UAAa,CACb,8DACE,oCAA6C,CAEjD,qDACE,UAAa","file":"tabulator_bootstrap5.min.css","sourcesContent":[".tabulator {\n position: relative;\n border: 1px solid #dee2e6;\n background-color: transparent;\n font-size: 16px;\n text-align: left;\n overflow: hidden;\n -webkit-transform: translatez(0);\n -moz-transform: translatez(0);\n -ms-transform: translatez(0);\n -o-transform: translatez(0);\n transform: translatez(0); }\n .tabulator[tabulator-layout=\"fitDataFill\"] .tabulator-tableholder .tabulator-table {\n min-width: 100%; }\n .tabulator[tabulator-layout=\"fitDataTable\"] {\n display: inline-block; }\n .tabulator.tabulator-block-select {\n user-select: none; }\n .tabulator .tabulator-header {\n position: relative;\n box-sizing: border-box;\n width: 100%;\n border-bottom: 1px solid #dee2e6;\n background-color: transparent;\n color: #555;\n font-weight: bold;\n white-space: nowrap;\n overflow: hidden;\n -moz-user-select: none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n -o-user-select: none; }\n .tabulator .tabulator-header.tabulator-header-hidden {\n display: none; }\n .tabulator .tabulator-header .tabulator-col {\n display: inline-block;\n position: relative;\n box-sizing: border-box;\n border-right: 1px solid #aaa;\n background: transparent;\n text-align: left;\n vertical-align: bottom;\n overflow: hidden; }\n .tabulator .tabulator-header .tabulator-col.tabulator-moving {\n position: absolute;\n border: 1px solid #dee2e6;\n background: rgba(0, 0, 0, 0);\n pointer-events: none; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content {\n box-sizing: border-box;\n position: relative;\n padding: 4px; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button {\n padding: 0 8px; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button:hover {\n cursor: pointer;\n opacity: .6; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title-holder {\n position: relative; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title {\n box-sizing: border-box;\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n vertical-align: bottom; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-title-editor {\n box-sizing: border-box;\n width: 100%;\n border: 1px solid #999;\n padding: 1px;\n background: #fff; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-header-popup-button + .tabulator-title-editor {\n width: calc(100% - 22px); }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter {\n display: flex;\n align-items: center;\n position: absolute;\n top: 0;\n bottom: 0;\n right: 4px; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter .tabulator-arrow {\n width: 0;\n height: 0;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-bottom: 6px solid #bbb; }\n .tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols {\n position: relative;\n display: flex;\n border-top: 1px solid #aaa;\n overflow: hidden;\n margin-right: -1px; }\n .tabulator .tabulator-header .tabulator-col .tabulator-header-filter {\n position: relative;\n box-sizing: border-box;\n margin-top: 2px;\n width: 100%;\n text-align: center; }\n .tabulator .tabulator-header .tabulator-col .tabulator-header-filter textarea {\n height: auto !important; }\n .tabulator .tabulator-header .tabulator-col .tabulator-header-filter svg {\n margin-top: 3px; }\n .tabulator .tabulator-header .tabulator-col .tabulator-header-filter input::-ms-clear {\n width: 0;\n height: 0; }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title {\n padding-right: 25px; }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover {\n cursor: pointer;\n background-color: rgba(0, 0, 0, 0); }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=\"none\"] .tabulator-col-content .tabulator-col-sorter {\n color: #bbb; }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=\"none\"] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow {\n border-top: none;\n border-bottom: 6px solid #bbb; }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=\"asc\"] .tabulator-col-content .tabulator-col-sorter {\n color: #666; }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=\"asc\"] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow {\n border-top: none;\n border-bottom: 6px solid #666; }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=\"desc\"] .tabulator-col-content .tabulator-col-sorter {\n color: #666; }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=\"desc\"] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow {\n border-bottom: none;\n border-top: 6px solid #666;\n color: #666; }\n .tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title {\n writing-mode: vertical-rl;\n text-orientation: mixed;\n display: flex;\n align-items: center;\n justify-content: center; }\n .tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-col-vertical-flip .tabulator-col-title {\n transform: rotate(180deg); }\n .tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-title {\n padding-right: 0;\n padding-top: 20px; }\n .tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable.tabulator-col-vertical-flip .tabulator-col-title {\n padding-right: 0;\n padding-bottom: 20px; }\n .tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-sorter {\n justify-content: center;\n left: 0;\n right: 0;\n top: 4px;\n bottom: auto; }\n .tabulator .tabulator-header .tabulator-frozen {\n display: inline-block;\n position: absolute;\n z-index: 10; }\n .tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-left {\n border-right: 2px solid #dee2e6; }\n .tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right {\n border-left: 2px solid #dee2e6; }\n .tabulator .tabulator-header .tabulator-calcs-holder {\n box-sizing: border-box;\n min-width: 600%;\n background: rgba(13, 13, 13, 0) !important;\n border-top: 1px solid #dee2e6;\n border-bottom: 1px solid #aaa;\n overflow: hidden; }\n .tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row {\n background: rgba(13, 13, 13, 0) !important; }\n .tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle {\n display: none; }\n .tabulator .tabulator-header .tabulator-frozen-rows-holder {\n min-width: 600%; }\n .tabulator .tabulator-header .tabulator-frozen-rows-holder:empty {\n display: none; }\n .tabulator .tabulator-tableholder {\n position: relative;\n width: 100%;\n white-space: nowrap;\n overflow: auto;\n -webkit-overflow-scrolling: touch; }\n .tabulator .tabulator-tableholder:focus {\n outline: none; }\n .tabulator .tabulator-tableholder .tabulator-placeholder {\n box-sizing: border-box;\n display: flex;\n align-items: center;\n width: 100%; }\n .tabulator .tabulator-tableholder .tabulator-placeholder[tabulator-render-mode=\"virtual\"] {\n min-height: 100%;\n min-width: 100%; }\n .tabulator .tabulator-tableholder .tabulator-placeholder .tabulator-placeholder-contents {\n display: inline-block;\n text-align: center;\n padding: 10px;\n color: #ccc;\n font-weight: bold;\n font-size: 20px;\n white-space: normal; }\n .tabulator .tabulator-tableholder .tabulator-table {\n position: relative;\n display: inline-block;\n background-color: transparent;\n white-space: nowrap;\n overflow: visible;\n color: #333; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs {\n font-weight: bold;\n background: rgba(0, 0, 0, 0.05) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-top {\n border-bottom: 2px solid #dee2e6; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-bottom {\n border-top: 2px solid #dee2e6; }\n .tabulator .tabulator-footer {\n border-top: 1px solid #dee2e6;\n background-color: #e6e6e6;\n color: #555;\n font-weight: bold;\n white-space: nowrap;\n user-select: none;\n -moz-user-select: none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n -o-user-select: none; }\n .tabulator .tabulator-footer .tabulator-footer-contents {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n padding: 5px 10px; }\n .tabulator .tabulator-footer .tabulator-footer-contents:empty {\n display: none; }\n .tabulator .tabulator-footer .tabulator-calcs-holder {\n box-sizing: border-box;\n width: calc(100% + 20px);\n text-align: left;\n background: #f3f3f3 !important;\n border-bottom: 1px solid #dee2e6;\n border-top: 1px solid #dee2e6;\n overflow: hidden; }\n .tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row {\n background: #f3f3f3 !important; }\n .tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle {\n display: none; }\n .tabulator .tabulator-footer .tabulator-calcs-holder:only-child {\n margin-bottom: -5px;\n border-bottom: none; }\n .tabulator .tabulator-footer > * + .tabulator-page-counter {\n margin-left: 10px; }\n .tabulator .tabulator-footer .tabulator-page-counter {\n font-weight: normal; }\n .tabulator .tabulator-footer .tabulator-paginator {\n flex: 1;\n text-align: right;\n color: #555;\n font-family: inherit;\n font-weight: inherit;\n font-size: inherit; }\n .tabulator .tabulator-footer .tabulator-page-size {\n display: inline-block;\n margin: 0 5px;\n padding: 2px 5px;\n border: 1px solid #dee2e6;\n border-radius: 3px; }\n .tabulator .tabulator-footer .tabulator-pages {\n margin: 0 7px; }\n .tabulator .tabulator-footer .tabulator-page {\n display: inline-block;\n margin: 0 2px;\n padding: 2px 5px;\n border: 1px solid #dee2e6;\n border-radius: 3px;\n background: rgba(255, 255, 255, 0.2); }\n .tabulator .tabulator-footer .tabulator-page.active {\n color: #fff; }\n .tabulator .tabulator-footer .tabulator-page:disabled {\n opacity: .5; }\n .tabulator .tabulator-footer .tabulator-page:not(.disabled):hover {\n cursor: pointer;\n background: rgba(0, 0, 0, 0.2);\n color: #fff; }\n .tabulator .tabulator-col-resize-handle {\n position: relative;\n display: inline-block;\n width: 6px;\n margin-left: -3px;\n margin-right: -3px;\n z-index: 10;\n vertical-align: middle; }\n .tabulator .tabulator-col-resize-handle:hover {\n cursor: ew-resize; }\n .tabulator .tabulator-col-resize-handle:last-of-type {\n width: 3px;\n margin-right: 0; }\n .tabulator .tabulator-alert {\n position: absolute;\n display: flex;\n align-items: center;\n top: 0;\n left: 0;\n z-index: 100;\n height: 100%;\n width: 100%;\n background: rgba(0, 0, 0, 0.4);\n text-align: center; }\n .tabulator .tabulator-alert .tabulator-alert-msg {\n display: inline-block;\n margin: 0 auto;\n padding: 10px 20px;\n border-radius: 10px;\n background: #fff;\n font-weight: bold;\n font-size: 16px; }\n .tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-msg {\n border: 4px solid #333;\n color: #000; }\n .tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-error {\n border: 4px solid #D00;\n color: #590000; }\n\n.tabulator-row {\n position: relative;\n box-sizing: border-box;\n min-height: 24px;\n background-color: transparent; }\n .tabulator-row.tabulator-row-even {\n background-color: rgba(0, 0, 0, 0.05); }\n .tabulator-row.tabulator-selectable:hover {\n background-color: rgba(0, 0, 0, 0.075);\n cursor: pointer; }\n .tabulator-row.tabulator-selected {\n background-color: #9ABCEA; }\n .tabulator-row.tabulator-selected:hover {\n background-color: #769BCC;\n cursor: pointer; }\n .tabulator-row.tabulator-row-moving {\n border: 1px solid #000;\n background: #fff; }\n .tabulator-row.tabulator-moving {\n position: absolute;\n border-top: 1px solid #dee2e6;\n border-bottom: 1px solid #dee2e6;\n pointer-events: none;\n z-index: 15; }\n .tabulator-row .tabulator-row-resize-handle {\n position: absolute;\n right: 0;\n bottom: 0;\n left: 0;\n height: 5px; }\n .tabulator-row .tabulator-row-resize-handle.prev {\n top: 0;\n bottom: auto; }\n .tabulator-row .tabulator-row-resize-handle:hover {\n cursor: ns-resize; }\n .tabulator-row .tabulator-frozen {\n display: inline-block;\n position: absolute;\n background-color: inherit;\n z-index: 10; }\n .tabulator-row .tabulator-frozen.tabulator-frozen-left {\n border-right: 2px solid #dee2e6; }\n .tabulator-row .tabulator-frozen.tabulator-frozen-right {\n border-left: 2px solid #dee2e6; }\n .tabulator-row .tabulator-responsive-collapse {\n box-sizing: border-box;\n padding: 5px;\n border-top: 1px solid #dee2e6;\n border-bottom: 1px solid #dee2e6; }\n .tabulator-row .tabulator-responsive-collapse:empty {\n display: none; }\n .tabulator-row .tabulator-responsive-collapse table {\n font-size: 16px; }\n .tabulator-row .tabulator-responsive-collapse table tr td {\n position: relative; }\n .tabulator-row .tabulator-responsive-collapse table tr td:first-of-type {\n padding-right: 10px; }\n .tabulator-row .tabulator-cell {\n display: inline-block;\n position: relative;\n box-sizing: border-box;\n padding: 4px;\n border-right: 1px solid #dee2e6;\n vertical-align: middle;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis; }\n .tabulator-row .tabulator-cell.tabulator-editing {\n border: 1px solid #1D68CD;\n outline: none;\n padding: 0; }\n .tabulator-row .tabulator-cell.tabulator-editing input, .tabulator-row .tabulator-cell.tabulator-editing select {\n border: 1px;\n background: transparent;\n outline: none; }\n .tabulator-row .tabulator-cell.tabulator-validation-fail {\n border: 1px solid #dd0000; }\n .tabulator-row .tabulator-cell.tabulator-validation-fail input, .tabulator-row .tabulator-cell.tabulator-validation-fail select {\n border: 1px;\n background: transparent;\n color: #dd0000; }\n .tabulator-row .tabulator-cell.tabulator-row-handle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n -moz-user-select: none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n -o-user-select: none; }\n .tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box {\n width: 80%; }\n .tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box .tabulator-row-handle-bar {\n width: 100%;\n height: 3px;\n margin-top: 2px;\n background: #666; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-branch {\n display: inline-block;\n vertical-align: middle;\n height: 9px;\n width: 7px;\n margin-top: -9px;\n margin-right: 5px;\n border-bottom-left-radius: 1px;\n border-left: 2px solid #dee2e6;\n border-bottom: 2px solid #dee2e6; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n vertical-align: middle;\n height: 11px;\n width: 11px;\n margin-right: 5px;\n border: 1px solid #333;\n border-radius: 2px;\n background: rgba(0, 0, 0, 0.1);\n overflow: hidden; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control:hover {\n cursor: pointer;\n background: rgba(0, 0, 0, 0.2); }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse {\n display: inline-block;\n position: relative;\n height: 7px;\n width: 1px;\n background: transparent; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after {\n position: absolute;\n content: \"\";\n left: -3px;\n top: 3px;\n height: 1px;\n width: 7px;\n background: #333; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand {\n display: inline-block;\n position: relative;\n height: 7px;\n width: 1px;\n background: #333; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after {\n position: absolute;\n content: \"\";\n left: -3px;\n top: 3px;\n height: 1px;\n width: 7px;\n background: #333; }\n .tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n -moz-user-select: none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n -o-user-select: none;\n height: 15px;\n width: 15px;\n border-radius: 20px;\n background: #666;\n color: transparent;\n font-weight: bold;\n font-size: 1.1em; }\n .tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle:hover {\n opacity: .7; }\n .tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-close {\n display: initial; }\n .tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-open {\n display: none; }\n .tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle .tabulator-responsive-collapse-toggle-close {\n display: none; }\n .tabulator-row .tabulator-cell .tabulator-traffic-light {\n display: inline-block;\n height: 14px;\n width: 14px;\n border-radius: 14px; }\n .tabulator-row.tabulator-group {\n box-sizing: border-box;\n border-bottom: 1px solid #999;\n border-right: 1px solid #dee2e6;\n border-top: 1px solid #999;\n padding: 5px;\n padding-left: 10px;\n background: #ccc;\n font-weight: bold;\n min-width: 100%; }\n .tabulator-row.tabulator-group:hover {\n cursor: pointer;\n background-color: rgba(0, 0, 0, 0.1); }\n .tabulator-row.tabulator-group.tabulator-group-visible .tabulator-arrow {\n margin-right: 10px;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-top: 6px solid #666;\n border-bottom: 0; }\n .tabulator-row.tabulator-group.tabulator-group-level-1 {\n padding-left: 30px; }\n .tabulator-row.tabulator-group.tabulator-group-level-2 {\n padding-left: 50px; }\n .tabulator-row.tabulator-group.tabulator-group-level-3 {\n padding-left: 70px; }\n .tabulator-row.tabulator-group.tabulator-group-level-4 {\n padding-left: 90px; }\n .tabulator-row.tabulator-group.tabulator-group-level-5 {\n padding-left: 110px; }\n .tabulator-row.tabulator-group .tabulator-group-toggle {\n display: inline-block; }\n .tabulator-row.tabulator-group .tabulator-arrow {\n display: inline-block;\n width: 0;\n height: 0;\n margin-right: 16px;\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n border-right: 0;\n border-left: 6px solid #666;\n vertical-align: middle; }\n .tabulator-row.tabulator-group span {\n margin-left: 10px;\n color: #d00; }\n\n.tabulator-popup-container {\n position: absolute;\n display: inline-block;\n box-sizing: border-box;\n background: transparent;\n border: 1px solid #dee2e6;\n box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);\n font-size: 16px;\n overflow-y: auto;\n -webkit-overflow-scrolling: touch;\n z-index: 10000; }\n\n.tabulator-popup {\n padding: 5px;\n border-radius: 3px; }\n\n.tabulator-tooltip {\n max-width: Min(500px, 100%);\n padding: 3px 5px;\n border-radius: 2px;\n box-shadow: none;\n font-size: 12px;\n pointer-events: none; }\n\n.tabulator-menu .tabulator-menu-item {\n position: relative;\n box-sizing: border-box;\n padding: 5px 10px;\n user-select: none; }\n .tabulator-menu .tabulator-menu-item.tabulator-menu-item-disabled {\n opacity: .5; }\n .tabulator-menu .tabulator-menu-item:not(.tabulator-menu-item-disabled):hover {\n cursor: pointer;\n background: rgba(0, 0, 0, 0.05); }\n .tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu {\n padding-right: 25px; }\n .tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu::after {\n display: inline-block;\n position: absolute;\n top: calc(5px + .4em);\n right: 10px;\n height: 7px;\n width: 7px;\n content: '';\n border-width: 1px 1px 0 0;\n border-style: solid;\n border-color: #dee2e6;\n vertical-align: top;\n transform: rotate(45deg); }\n\n.tabulator-menu .tabulator-menu-separator {\n border-top: 1px solid #dee2e6; }\n\n.tabulator-edit-list {\n max-height: 200px;\n font-size: 16px;\n overflow-y: auto;\n -webkit-overflow-scrolling: touch; }\n .tabulator-edit-list .tabulator-edit-list-item {\n padding: 4px;\n color: #333;\n outline: none; }\n .tabulator-edit-list .tabulator-edit-list-item.active {\n color: transparent;\n background: #1D68CD; }\n .tabulator-edit-list .tabulator-edit-list-item.active.focused {\n outline: 1px solid rgba(0, 0, 0, 0.5); }\n .tabulator-edit-list .tabulator-edit-list-item.focused {\n outline: 1px solid #1D68CD; }\n .tabulator-edit-list .tabulator-edit-list-item:hover {\n cursor: pointer;\n color: transparent;\n background: #1D68CD; }\n .tabulator-edit-list .tabulator-edit-list-placeholder {\n padding: 4px;\n color: #333;\n text-align: center; }\n .tabulator-edit-list .tabulator-edit-list-group {\n border-bottom: 1px solid #dee2e6;\n padding: 4px;\n padding-top: 6px;\n color: #333;\n font-weight: bold; }\n .tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-2, .tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-2 {\n padding-left: 12px; }\n .tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-3, .tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-3 {\n padding-left: 20px; }\n .tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-4, .tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-4 {\n padding-left: 28px; }\n .tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-5, .tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-5 {\n padding-left: 36px; }\n\n.tabulator.tabulator-ltr {\n direction: ltr; }\n\n.tabulator.tabulator-rtl {\n text-align: initial;\n direction: rtl; }\n .tabulator.tabulator-rtl .tabulator-header .tabulator-col {\n text-align: initial;\n border-left: 1px solid #aaa;\n border-right: initial; }\n .tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols {\n margin-right: initial;\n margin-left: -1px; }\n .tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title {\n padding-right: 0;\n padding-left: 25px; }\n .tabulator.tabulator-rtl .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter {\n left: 8px;\n right: initial; }\n .tabulator.tabulator-rtl .tabulator-row .tabulator-cell {\n border-right: initial;\n border-left: 1px solid #dee2e6; }\n .tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-branch {\n margin-right: initial;\n margin-left: 5px;\n border-bottom-left-radius: initial;\n border-bottom-right-radius: 1px;\n border-left: initial;\n border-right: 2px solid #dee2e6; }\n .tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-control {\n margin-right: initial;\n margin-left: 5px; }\n\n.tabulator-print-fullscreen {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 10000; }\n\nbody.tabulator-print-fullscreen-hide > *:not(.tabulator-print-fullscreen) {\n display: none !important; }\n\n.tabulator-print-table {\n border-collapse: collapse; }\n .tabulator-print-table .tabulator-data-tree-branch {\n display: inline-block;\n vertical-align: middle;\n height: 9px;\n width: 7px;\n margin-top: -9px;\n margin-right: 5px;\n border-bottom-left-radius: 1px;\n border-left: 2px solid #dee2e6;\n border-bottom: 2px solid #dee2e6; }\n .tabulator-print-table .tabulator-print-table-group {\n box-sizing: border-box;\n border-bottom: 1px solid #999;\n border-right: 1px solid #dee2e6;\n border-top: 1px solid #999;\n padding: 5px;\n padding-left: 10px;\n background: #ccc;\n font-weight: bold;\n min-width: 100%; }\n .tabulator-print-table .tabulator-print-table-group:hover {\n cursor: pointer;\n background-color: rgba(0, 0, 0, 0.1); }\n .tabulator-print-table .tabulator-print-table-group.tabulator-group-visible .tabulator-arrow {\n margin-right: 10px;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-top: 6px solid #666;\n border-bottom: 0; }\n .tabulator-print-table .tabulator-print-table-group.tabulator-group-level-1 td {\n padding-left: 30px !important; }\n .tabulator-print-table .tabulator-print-table-group.tabulator-group-level-2 td {\n padding-left: 50px !important; }\n .tabulator-print-table .tabulator-print-table-group.tabulator-group-level-3 td {\n padding-left: 70px !important; }\n .tabulator-print-table .tabulator-print-table-group.tabulator-group-level-4 td {\n padding-left: 90px !important; }\n .tabulator-print-table .tabulator-print-table-group.tabulator-group-level-5 td {\n padding-left: 110px !important; }\n .tabulator-print-table .tabulator-print-table-group .tabulator-group-toggle {\n display: inline-block; }\n .tabulator-print-table .tabulator-print-table-group .tabulator-arrow {\n display: inline-block;\n width: 0;\n height: 0;\n margin-right: 16px;\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n border-right: 0;\n border-left: 6px solid #666;\n vertical-align: middle; }\n .tabulator-print-table .tabulator-print-table-group span {\n margin-left: 10px;\n color: #d00; }\n .tabulator-print-table .tabulator-data-tree-control {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n vertical-align: middle;\n height: 11px;\n width: 11px;\n margin-right: 5px;\n border: 1px solid #333;\n border-radius: 2px;\n background: rgba(0, 0, 0, 0.1);\n overflow: hidden; }\n .tabulator-print-table .tabulator-data-tree-control:hover {\n cursor: pointer;\n background: rgba(0, 0, 0, 0.2); }\n .tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse {\n display: inline-block;\n position: relative;\n height: 7px;\n width: 1px;\n background: transparent; }\n .tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after {\n position: absolute;\n content: \"\";\n left: -3px;\n top: 3px;\n height: 1px;\n width: 7px;\n background: #333; }\n .tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand {\n display: inline-block;\n position: relative;\n height: 7px;\n width: 1px;\n background: #333; }\n .tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after {\n position: absolute;\n content: \"\";\n left: -3px;\n top: 3px;\n height: 1px;\n width: 7px;\n background: #333; }\n\n.tabulator {\n background-color: transparent;\n border: none; }\n .tabulator .tabulator-header {\n border-top: 1px solid #dee2e6;\n border-bottom: 2px solid #dee2e6;\n color: inherit; }\n .tabulator .tabulator-header .tabulator-col {\n border-right: none;\n background-color: transparent; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content {\n padding: 12px; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter {\n right: 0; }\n .tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols {\n border-top: 1px solid #dee2e6; }\n .tabulator .tabulator-header .tabulator-col .tabulator-header-filter input {\n padding: .375rem .75rem;\n background-color: #fff;\n background-clip: padding-box;\n border: 1px solid #ced4da;\n border-radius: .25rem;\n transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;\n font-size: 1rem;\n line-height: 1.5;\n color: #495057; }\n .tabulator .tabulator-header .tabulator-col .tabulator-header-filter input:focus {\n color: #495057;\n background-color: #fff;\n border: 1px solid #1D68CD;\n outline: 0; }\n .tabulator .tabulator-header .tabulator-calcs-holder {\n width: 100%;\n border-bottom: 1px solid #dee2e6; }\n .tabulator .tabulator-tableholder .tabulator-placeholder span {\n color: #000; }\n .tabulator .tabulator-tableholder .tabulator-table {\n color: inherit; }\n .tabulator .tabulator-footer {\n color: inherit; }\n .tabulator .tabulator-footer .tabulator-paginator {\n color: inherit; }\n .tabulator .tabulator-footer .tabulator-pages {\n margin: 0; }\n .tabulator .tabulator-footer .tabulator-page {\n margin: 0;\n margin-top: 5px;\n padding: 8px 12px; }\n .tabulator .tabulator-footer .tabulator-page[data-page=\"first\"] {\n border-top-left-radius: 4px;\n border-bottom-left-radius: 4px; }\n .tabulator .tabulator-footer .tabulator-page[data-page=\"last\"] {\n border: 1px solid #dee2e6;\n border-top-right-radius: 4px;\n border-bottom-right-radius: 4px; }\n .tabulator .tabulator-footer .tabulator-page.active {\n border-color: #0d6efd;\n background-color: #0d6efd;\n color: #fff; }\n .tabulator .tabulator-footer .tabulator-page:disabled {\n border-color: #dee2e6;\n background: #fff;\n color: #6c757d; }\n .tabulator .tabulator-footer .tabulator-page:not(.disabled):hover {\n border-color: #dee2e6;\n background: #e9ecef;\n color: #0a58ca; }\n .tabulator.thead-dark .tabulator-header {\n border-color: #dee2e6;\n background-color: transparent;\n color: #212529; }\n .tabulator.thead-dark .tabulator-header .tabulator-col {\n border-color: #dee2e6;\n background-color: transparent;\n color: #212529; }\n .tabulator.table {\n background-color: transparent; }\n .tabulator.table:not(.thead-light) .tabulator-header {\n border-color: #dee2e6;\n background-color: transparent;\n color: #212529; }\n .tabulator.table:not(.thead-light) .tabulator-header .tabulator-col {\n border-color: #dee2e6;\n background-color: transparent;\n color: #212529; }\n .tabulator.table .tabulator-tableholder {\n color: #212529; }\n .tabulator.table .tabulator-row {\n border-color: #dee2e6;\n background-color: transparent;\n color: #212529; }\n .tabulator.table .tabulator-row:hover {\n background-color: #dee2e6; }\n .tabulator.table .tabulator-row:hover .tabulator-cell {\n background-color: rgba(0, 0, 0, 0.075); }\n .tabulator.table .tabulator-row.tabulator-selected {\n background-color: #9ABCEA; }\n .tabulator.table .tabulator-footer {\n border-color: #dee2e6 !important; }\n .tabulator.table .tabulator-footer .tabulator-calcs-holder {\n border-color: #dee2e6 !important;\n background: transparent !important; }\n .tabulator.table .tabulator-footer .tabulator-calcs-holder .tabulator-row {\n border-color: #dee2e6 !important;\n background-color: transparent !important;\n color: #212529 !important; }\n .tabulator.table-striped:not(.table) .tabulator-row:nth-child(even) {\n background-color: rgba(0, 0, 0, 0.05); }\n .tabulator.table-striped:not(.table) .tabulator-row:nth-child(even).tabulator-selected {\n background-color: #9ABCEA; }\n .tabulator.table-striped:not(.table) .tabulator-row:nth-child(even).tabulator-selectable:hover {\n background-color: rgba(0, 0, 0, 0.075);\n cursor: pointer; }\n .tabulator.table-striped:not(.table) .tabulator-row:nth-child(even).tabulator-selected:hover {\n background-color: #769BCC;\n cursor: pointer; }\n .tabulator.table-striped.table .tabulator-row:nth-child(even) .tabulator-cell {\n background-color: transparent; }\n .tabulator.table-bordered {\n border: 1px solid #dee2e6; }\n .tabulator.table-bordered .tabulator-header .tabulator-col {\n border-right: 1px solid #dee2e6; }\n .tabulator.table-bordered .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell {\n border-right: 1px solid #dee2e6; }\n .tabulator.table-borderless .tabulator-header {\n border: none; }\n .tabulator.table-borderless .tabulator-row {\n border: none; }\n .tabulator.table-sm .tabulator-header .tabulator-col .tabulator-col-content {\n padding: 5px !important; }\n .tabulator.table-sm .tabulator-tableholder .tabulator-table .tabulator-row {\n min-height: 26px; }\n .tabulator.table-sm .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell {\n padding: 5px !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-primary {\n background: theme-color-level(\"primary\", -9) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-secondary {\n background: theme-color-level(\"secondary\", -9) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-success {\n background: theme-color-level(\"success\", -9) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-info {\n background: theme-color-level(\"info\", -9) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-warning {\n background: theme-color-level(\"warning\", -9) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-danger {\n background: theme-color-level(\"danger\", -9) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-light {\n background: theme-color-level(\"light\", -9) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table {\n background: theme-color-level(\"dark\", -9) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-active {\n background: rgba(0, 0, 0, 0.1) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-primary {\n background: theme-color-level(\"primary\", 0) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-secondary {\n background: theme-color-level(\"secondary\", 0) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-success {\n background: theme-color-level(\"success\", 0) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-info {\n background: theme-color-level(\"info\", 0) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-warning {\n background: theme-color-level(\"warning\", 0) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-danger {\n background: theme-color-level(\"danger\", 0) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-light {\n background: theme-color-level(\"light\", 0) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-dark {\n background: theme-color-level(\"dark\", 0) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-active {\n background: rgba(0, 0, 0, 0.1) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-primary {\n background: theme-color-level(\"primary\", -9) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-secondary {\n background: theme-color-level(\"secondary\", -9) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-success {\n background: theme-color-level(\"success\", -9) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-info {\n background: theme-color-level(\"info\", -9) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-warning {\n background: theme-color-level(\"warning\", -9) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-danger {\n background: theme-color-level(\"danger\", -9) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-light {\n background: theme-color-level(\"light\", -9) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table {\n background: theme-color-level(\"dark\", -9) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-active {\n background: rgba(0, 0, 0, 0.1) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-primary {\n background: theme-color-level(\"primary\", 0) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-secondary {\n background: theme-color-level(\"secondary\", 0) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-success {\n background: theme-color-level(\"success\", 0) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-info {\n background: theme-color-level(\"info\", 0) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-warning {\n background: theme-color-level(\"warning\", 0) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-danger {\n background: theme-color-level(\"danger\", 0) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-light {\n background: theme-color-level(\"light\", 0) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-dark {\n background: theme-color-level(\"dark\", 0) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-active {\n background: rgba(0, 0, 0, 0.1) !important; }\n\n.tabulator-row {\n min-height: 40px;\n border-bottom: 1px solid #dee2e6; }\n .tabulator-row .tabulator-cell {\n padding: 12px;\n border-right: none; }\n .tabulator-row .tabulator-cell:last-of-type {\n border-right: none; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control {\n border: 1px solid #ccc; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after {\n background: #ccc; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand {\n background: #ccc; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after {\n background: #ccc; }\n .tabulator-row.tabulator-group {\n background: #fafafa; }\n .tabulator-row.tabulator-group span {\n color: #666; }\n\n.tabulator-edit-select-list {\n background: transparent; }\n .tabulator-edit-select-list .tabulator-edit-select-list-item.active {\n color: transparent; }\n .tabulator-edit-select-list .tabulator-edit-select-list-item.active.focused {\n outline: 1px solid rgba(0, 0, 0, 0.5); }\n .tabulator-edit-select-list .tabulator-edit-select-list-item:hover {\n color: transparent; }\n .tabulator-edit-select-list .tabulator-edit-select-list-notice {\n color: inherit; }\n .tabulator-edit-select-list .tabulator-edit-select-list-group {\n color: inherit; }\n\n.tabulator.tabulator-rtl .tabulator-header .tabulator-col {\n text-align: initial;\n border-left: initial; }\n\n.tabulator-print-table .tabulator-print-table-group {\n background: #fafafa; }\n .tabulator-print-table .tabulator-print-table-group span {\n color: #666; }\n\n.tabulator-print-table .tabulator-data-tree-control {\n color: inherit; }\n .tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after {\n background: #ccc; }\n .tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand {\n background: #ccc; }\n .tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after {\n background: #ccc; }\n\n.tabulator-popup-container {\n background: #fff; }\n\n.tabulator-edit-list .tabulator-edit-list-item.active {\n color: #fff; }\n .tabulator-edit-list .tabulator-edit-list-item.active.focused {\n outline: 1px solid rgba(255, 255, 255, 0.5); }\n\n.tabulator-edit-list .tabulator-edit-list-item:hover {\n color: #fff; }\n"]} \ No newline at end of file +{"version":3,"sources":["tabulator_bootstrap5.scss"],"names":[],"mappings":"AAAA,WACE,iBAAkB,CAClB,wBAAyB,CAEzB,cAAe,CACf,eAAgB,CAChB,eAAgB,CAChB,+BAAgC,CAChC,4BAA6B,CAC7B,2BAA4B,CAC5B,0BAA2B,CAC3B,uBAA0B,CAC1B,iFACE,cAAiB,CACnB,0CACE,oBAAuB,CACzB,kCACE,gBAAmB,CACrB,6BACE,iBAAkB,CAClB,qBAAsB,CACtB,UAAW,CACX,+BAAgC,CAChC,4BAA6B,CAC7B,UAAW,CACX,eAAiB,CACjB,kBAAmB,CACnB,eAAgB,CAChB,qBAAsB,CACtB,uBAAwB,CACxB,wBAAyB,CACzB,mBAAsB,CACtB,qDACE,YAAe,CACjB,4CACE,oBAAqB,CACrB,iBAAkB,CAClB,qBAAsB,CACtB,2BAA4B,CAC5B,sB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C,wEACE,4BAAgC,CAClC,+EACE,mCAA2C,CAC7C,6EACE,4BAAgC,CAClC,+EACE,4BAAgC,CAClC,6EACE,4BAAgC,CAClC,0EACE,4BAAgC,CAClC,6EACE,4BAAgC,CAClC,4EACE,4BAAgC,CAClC,2EACE,4BAAgC,CAClC,0EACE,4BAAgC,CAClC,4EACE,mCAA2C,CAC7C,gGACE,4BAAgC,CAClC,kGACE,4BAAgC,CAClC,gGACE,4BAAgC,CAClC,6FACE,4BAAgC,CAClC,gGACE,4BAAgC,CAClC,+FACE,4BAAgC,CAClC,8FACE,4BAAgC,CAClC,wFACE,4BAAgC,CAClC,+FACE,mCAA2C,CAC7C,6FACE,4BAAgC,CAClC,+FACE,4BAAgC,CAClC,6FACE,4BAAgC,CAClC,0FACE,4BAAgC,CAClC,6FACE,4BAAgC,CAClC,4FACE,4BAAgC,CAClC,2FACE,4BAAgC,CAClC,0FACE,4BAAgC,CAClC,4FACE,mCAA2C,CAE/C,eACE,eAAgB,CAChB,+BAAkC,CAClC,+BACE,YAAa,CACb,iBAAoB,CACpB,4CACE,iBAAoB,CACtB,4DACE,qBAAwB,CAKtB,8SACE,eAAkB,CAC1B,+BACE,kBAAqB,CACrB,oCACE,UAAa,CAEnB,4BACE,sBAAyB,CACzB,oEACE,iBAAoB,CACpB,4EACE,gCAAuC,CAC3C,mEACE,iBAAoB,CAGtB,6HACE,aAAgB,CAEpB,0DACE,kBAAmB,CACnB,mBAAsB,CAExB,oDACE,kBAAqB,CACrB,yDACE,UAAa,CAEjB,oDACE,aAAgB,CAKd,sRACE,eAAkB,CAExB,2BACE,eAAkB,CAEpB,sDACE,UAAa,CACb,8DACE,oCAA6C,CAEjD,qDACE,UAAa","file":"tabulator_bootstrap5.min.css","sourcesContent":[".tabulator {\n position: relative;\n border: 1px solid #dee2e6;\n background-color: transparent;\n font-size: 16px;\n text-align: left;\n overflow: hidden;\n -webkit-transform: translatez(0);\n -moz-transform: translatez(0);\n -ms-transform: translatez(0);\n -o-transform: translatez(0);\n transform: translatez(0); }\n .tabulator[tabulator-layout=\"fitDataFill\"] .tabulator-tableholder .tabulator-table {\n min-width: 100%; }\n .tabulator[tabulator-layout=\"fitDataTable\"] {\n display: inline-block; }\n .tabulator.tabulator-block-select {\n user-select: none; }\n .tabulator .tabulator-header {\n position: relative;\n box-sizing: border-box;\n width: 100%;\n border-bottom: 1px solid #dee2e6;\n background-color: transparent;\n color: #555;\n font-weight: bold;\n white-space: nowrap;\n overflow: hidden;\n -moz-user-select: none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n -o-user-select: none; }\n .tabulator .tabulator-header.tabulator-header-hidden {\n display: none; }\n .tabulator .tabulator-header .tabulator-col {\n display: inline-block;\n position: relative;\n box-sizing: border-box;\n border-right: 1px solid #aaa;\n background: transparent;\n text-align: left;\n vertical-align: bottom;\n overflow: hidden; }\n .tabulator .tabulator-header .tabulator-col.tabulator-moving {\n position: absolute;\n border: 1px solid #dee2e6;\n background: rgba(0, 0, 0, 0);\n pointer-events: none; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content {\n box-sizing: border-box;\n position: relative;\n padding: 4px; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button {\n padding: 0 8px; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button:hover {\n cursor: pointer;\n opacity: .6; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title-holder {\n position: relative; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title {\n box-sizing: border-box;\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n vertical-align: bottom; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-title-editor {\n box-sizing: border-box;\n width: 100%;\n border: 1px solid #999;\n padding: 1px;\n background: #fff; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-header-popup-button + .tabulator-title-editor {\n width: calc(100% - 22px); }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter {\n display: flex;\n align-items: center;\n position: absolute;\n top: 0;\n bottom: 0;\n right: 4px; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter .tabulator-arrow {\n width: 0;\n height: 0;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-bottom: 6px solid #bbb; }\n .tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols {\n position: relative;\n display: flex;\n border-top: 1px solid #aaa;\n overflow: hidden;\n margin-right: -1px; }\n .tabulator .tabulator-header .tabulator-col .tabulator-header-filter {\n position: relative;\n box-sizing: border-box;\n margin-top: 2px;\n width: 100%;\n text-align: center; }\n .tabulator .tabulator-header .tabulator-col .tabulator-header-filter textarea {\n height: auto !important; }\n .tabulator .tabulator-header .tabulator-col .tabulator-header-filter svg {\n margin-top: 3px; }\n .tabulator .tabulator-header .tabulator-col .tabulator-header-filter input::-ms-clear {\n width: 0;\n height: 0; }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title {\n padding-right: 25px; }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover {\n cursor: pointer;\n background-color: rgba(0, 0, 0, 0); }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=\"none\"] .tabulator-col-content .tabulator-col-sorter {\n color: #bbb; }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=\"none\"] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow {\n border-top: none;\n border-bottom: 6px solid #bbb; }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=\"asc\"] .tabulator-col-content .tabulator-col-sorter {\n color: #666; }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=\"asc\"] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow {\n border-top: none;\n border-bottom: 6px solid #666; }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=\"desc\"] .tabulator-col-content .tabulator-col-sorter {\n color: #666; }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=\"desc\"] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow {\n border-bottom: none;\n border-top: 6px solid #666;\n color: #666; }\n .tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title {\n writing-mode: vertical-rl;\n text-orientation: mixed;\n display: flex;\n align-items: center;\n justify-content: center; }\n .tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-col-vertical-flip .tabulator-col-title {\n transform: rotate(180deg); }\n .tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-title {\n padding-right: 0;\n padding-top: 20px; }\n .tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable.tabulator-col-vertical-flip .tabulator-col-title {\n padding-right: 0;\n padding-bottom: 20px; }\n .tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-sorter {\n justify-content: center;\n left: 0;\n right: 0;\n top: 4px;\n bottom: auto; }\n .tabulator .tabulator-header .tabulator-frozen {\n display: inline-block;\n position: absolute;\n z-index: 10; }\n .tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-left {\n border-right: 2px solid #dee2e6; }\n .tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right {\n border-left: 2px solid #dee2e6; }\n .tabulator .tabulator-header .tabulator-calcs-holder {\n box-sizing: border-box;\n min-width: 600%;\n background: rgba(13, 13, 13, 0) !important;\n border-top: 1px solid #dee2e6;\n border-bottom: 1px solid #aaa;\n overflow: hidden; }\n .tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row {\n background: rgba(13, 13, 13, 0) !important; }\n .tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle {\n display: none; }\n .tabulator .tabulator-header .tabulator-frozen-rows-holder {\n min-width: 600%; }\n .tabulator .tabulator-header .tabulator-frozen-rows-holder:empty {\n display: none; }\n .tabulator .tabulator-tableholder {\n position: relative;\n width: 100%;\n white-space: nowrap;\n overflow: auto;\n -webkit-overflow-scrolling: touch; }\n .tabulator .tabulator-tableholder:focus {\n outline: none; }\n .tabulator .tabulator-tableholder .tabulator-placeholder {\n box-sizing: border-box;\n display: flex;\n align-items: center;\n width: 100%; }\n .tabulator .tabulator-tableholder .tabulator-placeholder[tabulator-render-mode=\"virtual\"] {\n min-height: 100%;\n min-width: 100%; }\n .tabulator .tabulator-tableholder .tabulator-placeholder .tabulator-placeholder-contents {\n display: inline-block;\n text-align: center;\n padding: 10px;\n color: #ccc;\n font-weight: bold;\n font-size: 20px;\n white-space: normal; }\n .tabulator .tabulator-tableholder .tabulator-table {\n position: relative;\n display: inline-block;\n background-color: transparent;\n white-space: nowrap;\n overflow: visible;\n color: #333; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs {\n font-weight: bold;\n background: rgba(0, 0, 0, 0.05) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-top {\n border-bottom: 2px solid #dee2e6; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-bottom {\n border-top: 2px solid #dee2e6; }\n .tabulator .tabulator-footer {\n border-top: 1px solid #dee2e6;\n background-color: #e6e6e6;\n color: #555;\n font-weight: bold;\n white-space: nowrap;\n user-select: none;\n -moz-user-select: none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n -o-user-select: none; }\n .tabulator .tabulator-footer .tabulator-footer-contents {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n padding: 5px 10px; }\n .tabulator .tabulator-footer .tabulator-footer-contents:empty {\n display: none; }\n .tabulator .tabulator-footer .tabulator-calcs-holder {\n box-sizing: border-box;\n width: calc(100% + 20px);\n text-align: left;\n background: #f3f3f3 !important;\n border-bottom: 1px solid #dee2e6;\n border-top: 1px solid #dee2e6;\n overflow: hidden; }\n .tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row {\n background: #f3f3f3 !important; }\n .tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle {\n display: none; }\n .tabulator .tabulator-footer .tabulator-calcs-holder:only-child {\n margin-bottom: -5px;\n border-bottom: none; }\n .tabulator .tabulator-footer > * + .tabulator-page-counter {\n margin-left: 10px; }\n .tabulator .tabulator-footer .tabulator-page-counter {\n font-weight: normal; }\n .tabulator .tabulator-footer .tabulator-paginator {\n flex: 1;\n text-align: right;\n color: #555;\n font-family: inherit;\n font-weight: inherit;\n font-size: inherit; }\n .tabulator .tabulator-footer .tabulator-page-size {\n display: inline-block;\n margin: 0 5px;\n padding: 2px 5px;\n border: 1px solid #dee2e6;\n border-radius: 3px; }\n .tabulator .tabulator-footer .tabulator-pages {\n margin: 0 7px; }\n .tabulator .tabulator-footer .tabulator-page {\n display: inline-block;\n margin: 0 2px;\n padding: 2px 5px;\n border: 1px solid #dee2e6;\n border-radius: 3px;\n background: rgba(255, 255, 255, 0.2); }\n .tabulator .tabulator-footer .tabulator-page.active {\n color: #fff; }\n .tabulator .tabulator-footer .tabulator-page:disabled {\n opacity: .5; }\n .tabulator .tabulator-footer .tabulator-page:not(.disabled):hover {\n cursor: pointer;\n background: rgba(0, 0, 0, 0.2);\n color: #fff; }\n .tabulator .tabulator-col-resize-handle {\n position: relative;\n display: inline-block;\n width: 6px;\n margin-left: -3px;\n margin-right: -3px;\n z-index: 10;\n vertical-align: middle; }\n .tabulator .tabulator-col-resize-handle:hover {\n cursor: ew-resize; }\n .tabulator .tabulator-col-resize-handle:last-of-type {\n width: 3px;\n margin-right: 0; }\n .tabulator .tabulator-alert {\n position: absolute;\n display: flex;\n align-items: center;\n top: 0;\n left: 0;\n z-index: 100;\n height: 100%;\n width: 100%;\n background: rgba(0, 0, 0, 0.4);\n text-align: center; }\n .tabulator .tabulator-alert .tabulator-alert-msg {\n display: inline-block;\n margin: 0 auto;\n padding: 10px 20px;\n border-radius: 10px;\n background: #fff;\n font-weight: bold;\n font-size: 16px; }\n .tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-msg {\n border: 4px solid #333;\n color: #000; }\n .tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-error {\n border: 4px solid #D00;\n color: #590000; }\n\n.tabulator-row {\n position: relative;\n box-sizing: border-box;\n min-height: 24px;\n background-color: transparent; }\n .tabulator-row.tabulator-row-even {\n background-color: rgba(0, 0, 0, 0.05); }\n .tabulator-row.tabulator-selectable:hover {\n background-color: rgba(0, 0, 0, 0.075);\n cursor: pointer; }\n .tabulator-row.tabulator-selected {\n background-color: #9ABCEA; }\n .tabulator-row.tabulator-selected:hover {\n background-color: #769BCC;\n cursor: pointer; }\n .tabulator-row.tabulator-row-moving {\n border: 1px solid #000;\n background: #fff; }\n .tabulator-row.tabulator-moving {\n position: absolute;\n border-top: 1px solid #dee2e6;\n border-bottom: 1px solid #dee2e6;\n pointer-events: none;\n z-index: 15; }\n .tabulator-row .tabulator-row-resize-handle {\n position: absolute;\n right: 0;\n bottom: 0;\n left: 0;\n height: 5px; }\n .tabulator-row .tabulator-row-resize-handle.prev {\n top: 0;\n bottom: auto; }\n .tabulator-row .tabulator-row-resize-handle:hover {\n cursor: ns-resize; }\n .tabulator-row .tabulator-frozen {\n display: inline-block;\n position: absolute;\n background-color: inherit;\n z-index: 10; }\n .tabulator-row .tabulator-frozen.tabulator-frozen-left {\n border-right: 2px solid #dee2e6; }\n .tabulator-row .tabulator-frozen.tabulator-frozen-right {\n border-left: 2px solid #dee2e6; }\n .tabulator-row .tabulator-responsive-collapse {\n box-sizing: border-box;\n padding: 5px;\n border-top: 1px solid #dee2e6;\n border-bottom: 1px solid #dee2e6; }\n .tabulator-row .tabulator-responsive-collapse:empty {\n display: none; }\n .tabulator-row .tabulator-responsive-collapse table {\n font-size: 16px; }\n .tabulator-row .tabulator-responsive-collapse table tr td {\n position: relative; }\n .tabulator-row .tabulator-responsive-collapse table tr td:first-of-type {\n padding-right: 10px; }\n .tabulator-row .tabulator-cell {\n display: inline-block;\n position: relative;\n box-sizing: border-box;\n padding: 4px;\n border-right: 1px solid #dee2e6;\n vertical-align: middle;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis; }\n .tabulator-row .tabulator-cell.tabulator-editing {\n border: 1px solid #1D68CD;\n outline: none;\n padding: 0; }\n .tabulator-row .tabulator-cell.tabulator-editing input, .tabulator-row .tabulator-cell.tabulator-editing select {\n border: 1px;\n background: transparent;\n outline: none; }\n .tabulator-row .tabulator-cell.tabulator-validation-fail {\n border: 1px solid #dd0000; }\n .tabulator-row .tabulator-cell.tabulator-validation-fail input, .tabulator-row .tabulator-cell.tabulator-validation-fail select {\n border: 1px;\n background: transparent;\n color: #dd0000; }\n .tabulator-row .tabulator-cell.tabulator-row-handle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n -moz-user-select: none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n -o-user-select: none; }\n .tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box {\n width: 80%; }\n .tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box .tabulator-row-handle-bar {\n width: 100%;\n height: 3px;\n margin-top: 2px;\n background: #666; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-branch {\n display: inline-block;\n vertical-align: middle;\n height: 9px;\n width: 7px;\n margin-top: -9px;\n margin-right: 5px;\n border-bottom-left-radius: 1px;\n border-left: 2px solid #dee2e6;\n border-bottom: 2px solid #dee2e6; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n vertical-align: middle;\n height: 11px;\n width: 11px;\n margin-right: 5px;\n border: 1px solid #333;\n border-radius: 2px;\n background: rgba(0, 0, 0, 0.1);\n overflow: hidden; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control:hover {\n cursor: pointer;\n background: rgba(0, 0, 0, 0.2); }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse {\n display: inline-block;\n position: relative;\n height: 7px;\n width: 1px;\n background: transparent; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after {\n position: absolute;\n content: \"\";\n left: -3px;\n top: 3px;\n height: 1px;\n width: 7px;\n background: #333; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand {\n display: inline-block;\n position: relative;\n height: 7px;\n width: 1px;\n background: #333; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after {\n position: absolute;\n content: \"\";\n left: -3px;\n top: 3px;\n height: 1px;\n width: 7px;\n background: #333; }\n .tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n -moz-user-select: none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n -o-user-select: none;\n height: 15px;\n width: 15px;\n border-radius: 20px;\n background: #666;\n color: transparent;\n font-weight: bold;\n font-size: 1.1em; }\n .tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle:hover {\n opacity: .7; }\n .tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-close {\n display: initial; }\n .tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-open {\n display: none; }\n .tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle .tabulator-responsive-collapse-toggle-close {\n display: none; }\n .tabulator-row .tabulator-cell .tabulator-traffic-light {\n display: inline-block;\n height: 14px;\n width: 14px;\n border-radius: 14px; }\n .tabulator-row.tabulator-group {\n box-sizing: border-box;\n border-bottom: 1px solid #999;\n border-right: 1px solid #dee2e6;\n border-top: 1px solid #999;\n padding: 5px;\n padding-left: 10px;\n background: #ccc;\n font-weight: bold;\n min-width: 100%; }\n .tabulator-row.tabulator-group:hover {\n cursor: pointer;\n background-color: rgba(0, 0, 0, 0.1); }\n .tabulator-row.tabulator-group.tabulator-group-visible .tabulator-arrow {\n margin-right: 10px;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-top: 6px solid #666;\n border-bottom: 0; }\n .tabulator-row.tabulator-group.tabulator-group-level-1 {\n padding-left: 30px; }\n .tabulator-row.tabulator-group.tabulator-group-level-2 {\n padding-left: 50px; }\n .tabulator-row.tabulator-group.tabulator-group-level-3 {\n padding-left: 70px; }\n .tabulator-row.tabulator-group.tabulator-group-level-4 {\n padding-left: 90px; }\n .tabulator-row.tabulator-group.tabulator-group-level-5 {\n padding-left: 110px; }\n .tabulator-row.tabulator-group .tabulator-group-toggle {\n display: inline-block; }\n .tabulator-row.tabulator-group .tabulator-arrow {\n display: inline-block;\n width: 0;\n height: 0;\n margin-right: 16px;\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n border-right: 0;\n border-left: 6px solid #666;\n vertical-align: middle; }\n .tabulator-row.tabulator-group span {\n margin-left: 10px;\n color: #d00; }\n\n.tabulator-popup-container {\n position: absolute;\n display: inline-block;\n box-sizing: border-box;\n background: transparent;\n border: 1px solid #dee2e6;\n box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);\n font-size: 16px;\n overflow-y: auto;\n -webkit-overflow-scrolling: touch;\n z-index: 10000; }\n\n.tabulator-popup {\n padding: 5px;\n border-radius: 3px; }\n\n.tabulator-tooltip {\n max-width: Min(500px, 100%);\n padding: 3px 5px;\n border-radius: 2px;\n box-shadow: none;\n font-size: 12px;\n pointer-events: none; }\n\n.tabulator-menu .tabulator-menu-item {\n position: relative;\n box-sizing: border-box;\n padding: 5px 10px;\n user-select: none; }\n .tabulator-menu .tabulator-menu-item.tabulator-menu-item-disabled {\n opacity: .5; }\n .tabulator-menu .tabulator-menu-item:not(.tabulator-menu-item-disabled):hover {\n cursor: pointer;\n background: rgba(0, 0, 0, 0.05); }\n .tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu {\n padding-right: 25px; }\n .tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu::after {\n display: inline-block;\n position: absolute;\n top: calc(5px + .4em);\n right: 10px;\n height: 7px;\n width: 7px;\n content: '';\n border-width: 1px 1px 0 0;\n border-style: solid;\n border-color: #dee2e6;\n vertical-align: top;\n transform: rotate(45deg); }\n\n.tabulator-menu .tabulator-menu-separator {\n border-top: 1px solid #dee2e6; }\n\n.tabulator-edit-list {\n max-height: 200px;\n font-size: 16px;\n overflow-y: auto;\n -webkit-overflow-scrolling: touch; }\n .tabulator-edit-list .tabulator-edit-list-item {\n padding: 4px;\n color: #333;\n outline: none; }\n .tabulator-edit-list .tabulator-edit-list-item.active {\n color: transparent;\n background: #1D68CD; }\n .tabulator-edit-list .tabulator-edit-list-item.active.focused {\n outline: 1px solid rgba(0, 0, 0, 0.5); }\n .tabulator-edit-list .tabulator-edit-list-item.focused {\n outline: 1px solid #1D68CD; }\n .tabulator-edit-list .tabulator-edit-list-item:hover {\n cursor: pointer;\n color: transparent;\n background: #1D68CD; }\n .tabulator-edit-list .tabulator-edit-list-placeholder {\n padding: 4px;\n color: #333;\n text-align: center; }\n .tabulator-edit-list .tabulator-edit-list-group {\n border-bottom: 1px solid #dee2e6;\n padding: 4px;\n padding-top: 6px;\n color: #333;\n font-weight: bold; }\n .tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-2, .tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-2 {\n padding-left: 12px; }\n .tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-3, .tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-3 {\n padding-left: 20px; }\n .tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-4, .tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-4 {\n padding-left: 28px; }\n .tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-5, .tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-5 {\n padding-left: 36px; }\n\n.tabulator.tabulator-ltr {\n direction: ltr; }\n\n.tabulator.tabulator-rtl {\n text-align: initial;\n direction: rtl; }\n .tabulator.tabulator-rtl .tabulator-header .tabulator-col {\n text-align: initial;\n border-left: 1px solid #aaa;\n border-right: initial; }\n .tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols {\n margin-right: initial;\n margin-left: -1px; }\n .tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title {\n padding-right: 0;\n padding-left: 25px; }\n .tabulator.tabulator-rtl .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter {\n left: 8px;\n right: initial; }\n .tabulator.tabulator-rtl .tabulator-row .tabulator-cell {\n border-right: initial;\n border-left: 1px solid #dee2e6; }\n .tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-branch {\n margin-right: initial;\n margin-left: 5px;\n border-bottom-left-radius: initial;\n border-bottom-right-radius: 1px;\n border-left: initial;\n border-right: 2px solid #dee2e6; }\n .tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-control {\n margin-right: initial;\n margin-left: 5px; }\n\n.tabulator-print-fullscreen {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 10000; }\n\nbody.tabulator-print-fullscreen-hide > *:not(.tabulator-print-fullscreen) {\n display: none !important; }\n\n.tabulator-print-table {\n border-collapse: collapse; }\n .tabulator-print-table .tabulator-data-tree-branch {\n display: inline-block;\n vertical-align: middle;\n height: 9px;\n width: 7px;\n margin-top: -9px;\n margin-right: 5px;\n border-bottom-left-radius: 1px;\n border-left: 2px solid #dee2e6;\n border-bottom: 2px solid #dee2e6; }\n .tabulator-print-table .tabulator-print-table-group {\n box-sizing: border-box;\n border-bottom: 1px solid #999;\n border-right: 1px solid #dee2e6;\n border-top: 1px solid #999;\n padding: 5px;\n padding-left: 10px;\n background: #ccc;\n font-weight: bold;\n min-width: 100%; }\n .tabulator-print-table .tabulator-print-table-group:hover {\n cursor: pointer;\n background-color: rgba(0, 0, 0, 0.1); }\n .tabulator-print-table .tabulator-print-table-group.tabulator-group-visible .tabulator-arrow {\n margin-right: 10px;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-top: 6px solid #666;\n border-bottom: 0; }\n .tabulator-print-table .tabulator-print-table-group.tabulator-group-level-1 td {\n padding-left: 30px !important; }\n .tabulator-print-table .tabulator-print-table-group.tabulator-group-level-2 td {\n padding-left: 50px !important; }\n .tabulator-print-table .tabulator-print-table-group.tabulator-group-level-3 td {\n padding-left: 70px !important; }\n .tabulator-print-table .tabulator-print-table-group.tabulator-group-level-4 td {\n padding-left: 90px !important; }\n .tabulator-print-table .tabulator-print-table-group.tabulator-group-level-5 td {\n padding-left: 110px !important; }\n .tabulator-print-table .tabulator-print-table-group .tabulator-group-toggle {\n display: inline-block; }\n .tabulator-print-table .tabulator-print-table-group .tabulator-arrow {\n display: inline-block;\n width: 0;\n height: 0;\n margin-right: 16px;\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n border-right: 0;\n border-left: 6px solid #666;\n vertical-align: middle; }\n .tabulator-print-table .tabulator-print-table-group span {\n margin-left: 10px;\n color: #d00; }\n .tabulator-print-table .tabulator-data-tree-control {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n vertical-align: middle;\n height: 11px;\n width: 11px;\n margin-right: 5px;\n border: 1px solid #333;\n border-radius: 2px;\n background: rgba(0, 0, 0, 0.1);\n overflow: hidden; }\n .tabulator-print-table .tabulator-data-tree-control:hover {\n cursor: pointer;\n background: rgba(0, 0, 0, 0.2); }\n .tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse {\n display: inline-block;\n position: relative;\n height: 7px;\n width: 1px;\n background: transparent; }\n .tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after {\n position: absolute;\n content: \"\";\n left: -3px;\n top: 3px;\n height: 1px;\n width: 7px;\n background: #333; }\n .tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand {\n display: inline-block;\n position: relative;\n height: 7px;\n width: 1px;\n background: #333; }\n .tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after {\n position: absolute;\n content: \"\";\n left: -3px;\n top: 3px;\n height: 1px;\n width: 7px;\n background: #333; }\n\n.tabulator {\n background-color: transparent;\n border: none; }\n .tabulator .tabulator-header {\n border-top: 1px solid #dee2e6;\n border-bottom: 2px solid #dee2e6;\n color: inherit; }\n .tabulator .tabulator-header .tabulator-col {\n border-right: none;\n background-color: transparent; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content {\n padding: 12px; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter {\n right: 0; }\n .tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols {\n border-top: 1px solid #dee2e6; }\n .tabulator .tabulator-header .tabulator-col .tabulator-header-filter input {\n padding: .375rem .75rem;\n background-color: #fff;\n background-clip: padding-box;\n border: 1px solid #ced4da;\n border-radius: .25rem;\n transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;\n font-size: 1rem;\n line-height: 1.5;\n color: #495057; }\n .tabulator .tabulator-header .tabulator-col .tabulator-header-filter input:focus {\n color: #495057;\n background-color: #fff;\n border: 1px solid #1D68CD;\n outline: 0; }\n .tabulator .tabulator-header .tabulator-calcs-holder {\n width: 100%;\n border-bottom: 1px solid #dee2e6; }\n .tabulator .tabulator-tableholder .tabulator-placeholder span {\n color: #000; }\n .tabulator .tabulator-tableholder .tabulator-table {\n color: inherit; }\n .tabulator .tabulator-footer {\n color: inherit; }\n .tabulator .tabulator-footer .tabulator-paginator {\n color: inherit; }\n .tabulator .tabulator-footer .tabulator-pages {\n margin: 0; }\n .tabulator .tabulator-footer .tabulator-page {\n margin: 0;\n margin-top: 5px;\n padding: 8px 12px; }\n .tabulator .tabulator-footer .tabulator-page[data-page=\"first\"] {\n border-top-left-radius: 4px;\n border-bottom-left-radius: 4px; }\n .tabulator .tabulator-footer .tabulator-page[data-page=\"last\"] {\n border: 1px solid #dee2e6;\n border-top-right-radius: 4px;\n border-bottom-right-radius: 4px; }\n .tabulator .tabulator-footer .tabulator-page.active {\n border-color: #0d6efd;\n background-color: #0d6efd;\n color: #fff; }\n .tabulator .tabulator-footer .tabulator-page:disabled {\n border-color: #dee2e6;\n background: #fff;\n color: #6c757d; }\n .tabulator .tabulator-footer .tabulator-page:not(.disabled):hover {\n border-color: #dee2e6;\n background: #e9ecef;\n color: #0a58ca; }\n .tabulator.thead-dark .tabulator-header {\n border-color: #dee2e6;\n background-color: transparent;\n color: #212529; }\n .tabulator.thead-dark .tabulator-header .tabulator-col {\n border-color: #dee2e6;\n background-color: transparent;\n color: #212529; }\n .tabulator.table {\n background-color: transparent; }\n .tabulator.table:not(.thead-light) .tabulator-header {\n border-color: #dee2e6;\n background-color: transparent;\n color: #212529; }\n .tabulator.table:not(.thead-light) .tabulator-header .tabulator-col {\n border-color: #dee2e6;\n background-color: transparent;\n color: #212529; }\n .tabulator.table .tabulator-tableholder {\n color: #212529; }\n .tabulator.table .tabulator-row {\n border-color: #dee2e6;\n background-color: transparent;\n color: #212529; }\n .tabulator.table .tabulator-row:hover {\n background-color: #dee2e6; }\n .tabulator.table .tabulator-row:hover .tabulator-cell {\n background-color: rgba(0, 0, 0, 0.075); }\n .tabulator.table .tabulator-row.tabulator-selected {\n background-color: #9ABCEA; }\n .tabulator.table .tabulator-footer {\n border-color: #dee2e6 !important; }\n .tabulator.table .tabulator-footer .tabulator-calcs-holder {\n border-color: #dee2e6 !important;\n background: transparent !important; }\n .tabulator.table .tabulator-footer .tabulator-calcs-holder .tabulator-row {\n border-color: #dee2e6 !important;\n background-color: transparent !important;\n color: #212529 !important; }\n .tabulator.table-striped:not(.table) .tabulator-row:nth-child(even) {\n background-color: rgba(0, 0, 0, 0.05); }\n .tabulator.table-striped:not(.table) .tabulator-row:nth-child(even).tabulator-selected {\n background-color: #9ABCEA; }\n .tabulator.table-striped:not(.table) .tabulator-row:nth-child(even).tabulator-selectable:hover {\n background-color: rgba(0, 0, 0, 0.075);\n cursor: pointer; }\n .tabulator.table-striped:not(.table) .tabulator-row:nth-child(even).tabulator-selected:hover {\n background-color: #769BCC;\n cursor: pointer; }\n .tabulator.table-striped.table .tabulator-row:nth-child(even) .tabulator-cell {\n background-color: transparent; }\n .tabulator.table-bordered {\n border: 1px solid #dee2e6; }\n .tabulator.table-bordered .tabulator-header .tabulator-col {\n border-right: 1px solid #dee2e6; }\n .tabulator.table-bordered .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell {\n border-right: 1px solid #dee2e6; }\n .tabulator.table-borderless .tabulator-header {\n border: none; }\n .tabulator.table-borderless .tabulator-row {\n border: none; }\n .tabulator.table-sm .tabulator-header .tabulator-col .tabulator-col-content {\n padding: 5px !important; }\n .tabulator.table-sm .tabulator-tableholder .tabulator-table .tabulator-row {\n min-height: 26px; }\n .tabulator.table-sm .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell {\n padding: 5px !important; }\n .tabulator.table-sm .tabulator-row {\n padding-top: 0;\n padding-bottom: 0; }\n .tabulator.table-sm .tabulator-col-resize-handle {\n padding: 0; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-primary {\n background: #cfe2ff !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-secondary {\n background: #e2e3e5 !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-success {\n background: #d1e7dd !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-info {\n background: #cff4fc !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-warning {\n background: #fff3cd !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-danger {\n background: #f8d7da !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-light {\n background: #f8f9fa !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table {\n background: #212529 !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-active {\n background: rgba(0, 0, 0, 0.1) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-primary {\n background: #cfe2ff !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-secondary {\n background: #e2e3e5 !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-success {\n background: #d1e7dd !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-info {\n background: #cff4fc !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-warning {\n background: #fff3cd !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-danger {\n background: #f8d7da !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-light {\n background: #f8f9fa !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-dark {\n background: #212529 !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-active {\n background: rgba(0, 0, 0, 0.1) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-primary {\n background: #cfe2ff !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-secondary {\n background: #e2e3e5 !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-success {\n background: #d1e7dd !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-info {\n background: #cff4fc !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-warning {\n background: #fff3cd !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-danger {\n background: #f8d7da !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-light {\n background: #f8f9fa !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table {\n background: #212529 !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-active {\n background: rgba(0, 0, 0, 0.1) !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-primary {\n background: #cfe2ff !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-secondary {\n background: #e2e3e5 !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-success {\n background: #d1e7dd !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-info {\n background: #cff4fc !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-warning {\n background: #fff3cd !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-danger {\n background: #f8d7da !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-light {\n background: #f8f9fa !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-dark {\n background: #212529 !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-active {\n background: rgba(0, 0, 0, 0.1) !important; }\n\n.tabulator-row {\n min-height: 40px;\n border-bottom: 1px solid #dee2e6; }\n .tabulator-row .tabulator-cell {\n padding: 12px;\n border-right: none; }\n .tabulator-row .tabulator-cell:last-of-type {\n border-right: none; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control {\n border: 1px solid #ccc; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after {\n background: #ccc; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand {\n background: #ccc; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after {\n background: #ccc; }\n .tabulator-row.tabulator-group {\n background: #fafafa; }\n .tabulator-row.tabulator-group span {\n color: #666; }\n\n.tabulator-edit-select-list {\n background: transparent; }\n .tabulator-edit-select-list .tabulator-edit-select-list-item.active {\n color: transparent; }\n .tabulator-edit-select-list .tabulator-edit-select-list-item.active.focused {\n outline: 1px solid rgba(0, 0, 0, 0.5); }\n .tabulator-edit-select-list .tabulator-edit-select-list-item:hover {\n color: transparent; }\n .tabulator-edit-select-list .tabulator-edit-select-list-notice {\n color: inherit; }\n .tabulator-edit-select-list .tabulator-edit-select-list-group {\n color: inherit; }\n\n.tabulator.tabulator-rtl .tabulator-header .tabulator-col {\n text-align: initial;\n border-left: initial; }\n\n.tabulator-print-table .tabulator-print-table-group {\n background: #fafafa; }\n .tabulator-print-table .tabulator-print-table-group span {\n color: #666; }\n\n.tabulator-print-table .tabulator-data-tree-control {\n color: inherit; }\n .tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after {\n background: #ccc; }\n .tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand {\n background: #ccc; }\n .tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after {\n background: #ccc; }\n\n.tabulator-popup-container {\n background: #fff; }\n\n.tabulator-edit-list .tabulator-edit-list-item.active {\n color: #fff; }\n .tabulator-edit-list .tabulator-edit-list-item.active.focused {\n outline: 1px solid rgba(255, 255, 255, 0.5); }\n\n.tabulator-edit-list .tabulator-edit-list-item:hover {\n color: #fff; }\n"]} \ No newline at end of file diff --git a/dist/css/tabulator_bulma.min.css b/dist/css/tabulator_bulma.min.css index 01b109b0e..16db39901 100644 --- a/dist/css/tabulator_bulma.min.css +++ b/dist/css/tabulator_bulma.min.css @@ -1,2 +1,2 @@ -.tabulator{position:relative;border:1px solid #999;background-color:#fff;font-size:16px;text-align:left;overflow:hidden;-webkit-transform:translatez(0);-moz-transform:translatez(0);-ms-transform:translatez(0);-o-transform:translatez(0);transform:translatez(0)}.tabulator[tabulator-layout=fitDataFill] .tabulator-tableholder .tabulator-table{min-width:100%}.tabulator[tabulator-layout=fitDataTable]{display:inline-block}.tabulator.tabulator-block-select{user-select:none}.tabulator .tabulator-header{position:relative;box-sizing:border-box;width:100%;border-bottom:1px solid #999;background-color:transparent;color:#363636;font-weight:700;white-space:nowrap;overflow:hidden;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator .tabulator-header.tabulator-header-hidden{display:none}.tabulator .tabulator-header .tabulator-col{display:inline-block;position:relative;box-sizing:border-box;border-right:1px solid #aaa;background:transparent;text-align:left;vertical-align:bottom;overflow:hidden}.tabulator .tabulator-header .tabulator-col.tabulator-moving{position:absolute;border:1px solid #999;background:transparent;pointer-events:none}.tabulator .tabulator-header .tabulator-col .tabulator-col-content{box-sizing:border-box;position:relative;padding:4px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button{padding:0 8px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button:hover{cursor:pointer;opacity:.6}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title-holder{position:relative}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title{box-sizing:border-box;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-title-editor{box-sizing:border-box;width:100%;border:1px solid #999;padding:1px;background:#fff}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-header-popup-button+.tabulator-title-editor{width:calc(100% - 22px)}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{display:flex;align-items:center;position:absolute;top:0;bottom:0;right:4px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #bbb}.tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{position:relative;display:flex;border-top:1px solid #aaa;overflow:hidden;margin-right:-1px}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter{position:relative;box-sizing:border-box;margin-top:2px;width:100%;text-align:center}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter textarea{height:auto!important}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter svg{margin-top:3px}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input::-ms-clear{width:0;height:0}.tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title{padding-right:25px}.tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover{cursor:pointer;background-color:transparent}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter{color:#bbb}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-top:none;border-bottom:6px solid #bbb}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=asc] .tabulator-col-content .tabulator-col-sorter{color:#363636}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=asc] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-top:none;border-bottom:6px solid #363636}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=desc] .tabulator-col-content .tabulator-col-sorter{color:#363636}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=desc] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-bottom:none;border-top:6px solid #363636;color:#363636}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title{writing-mode:vertical-rl;text-orientation:mixed;display:flex;align-items:center;justify-content:center}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-col-vertical-flip .tabulator-col-title{transform:rotate(180deg)}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-title{padding-right:0;padding-top:20px}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable.tabulator-col-vertical-flip .tabulator-col-title{padding-right:0;padding-bottom:20px}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-sorter{justify-content:center;left:0;right:0;top:4px;bottom:auto}.tabulator .tabulator-header .tabulator-frozen{display:inline-block;position:absolute;z-index:10}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-left{border-right:2px solid #aaa}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right{border-left:2px solid #aaa}.tabulator .tabulator-header .tabulator-calcs-holder{box-sizing:border-box;min-width:600%;background:rgba(13,13,13,0)!important;border-top:1px solid #aaa;border-bottom:1px solid #aaa;overflow:hidden}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row{background:rgba(13,13,13,0)!important}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-header .tabulator-frozen-rows-holder{min-width:600%}.tabulator .tabulator-header .tabulator-frozen-rows-holder:empty{display:none}.tabulator .tabulator-tableholder{position:relative;width:100%;white-space:nowrap;overflow:auto;-webkit-overflow-scrolling:touch}.tabulator .tabulator-tableholder:focus{outline:none}.tabulator .tabulator-tableholder .tabulator-placeholder{box-sizing:border-box;display:flex;align-items:center;width:100%}.tabulator .tabulator-tableholder .tabulator-placeholder[tabulator-render-mode=virtual]{min-height:100%;min-width:100%}.tabulator .tabulator-tableholder .tabulator-placeholder .tabulator-placeholder-contents{display:inline-block;text-align:center;padding:10px;color:#ccc;font-weight:700;font-size:20px;white-space:normal}.tabulator .tabulator-tableholder .tabulator-table{position:relative;display:inline-block;background-color:transparent;white-space:nowrap;overflow:visible;color:#363636}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs{font-weight:700;background:#ededed!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-top{border-bottom:2px solid #aaa}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-bottom{border-top:2px solid #aaa}.tabulator .tabulator-footer{border-top:1px solid #999;background-color:transparent;color:#363636;font-weight:700;white-space:nowrap;user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator .tabulator-footer .tabulator-footer-contents{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:5px 10px}.tabulator .tabulator-footer .tabulator-footer-contents:empty{display:none}.tabulator .tabulator-footer .tabulator-calcs-holder{box-sizing:border-box;width:calc(100% + 20px);text-align:left;background:rgba(13,13,13,0)!important;border-bottom:1px solid #aaa;border-top:1px solid #aaa;overflow:hidden}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row{background:rgba(13,13,13,0)!important}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-footer .tabulator-calcs-holder:only-child{margin-bottom:-5px;border-bottom:none}.tabulator .tabulator-footer>*+.tabulator-page-counter{margin-left:10px}.tabulator .tabulator-footer .tabulator-page-counter{font-weight:400}.tabulator .tabulator-footer .tabulator-paginator{flex:1;text-align:right;color:#363636;font-family:inherit;font-weight:inherit;font-size:inherit}.tabulator .tabulator-footer .tabulator-page-size{display:inline-block;margin:0 5px;padding:2px 5px;border:1px solid #dbdbdb;border-radius:3px}.tabulator .tabulator-footer .tabulator-pages{margin:0 7px}.tabulator .tabulator-footer .tabulator-page{display:inline-block;margin:0 2px;padding:2px 5px;border-radius:3px;background:hsla(0,0%,100%,.2)}.tabulator .tabulator-footer .tabulator-page.active{color:#d00}.tabulator .tabulator-footer .tabulator-page:disabled{opacity:.5}.tabulator .tabulator-footer .tabulator-page:not(.disabled):hover{background:rgba(0,0,0,.2);color:#fff}.tabulator .tabulator-col-resize-handle{position:relative;display:inline-block;width:6px;margin-left:-3px;margin-right:-3px;z-index:10;vertical-align:middle}.tabulator .tabulator-col-resize-handle:hover{cursor:ew-resize}.tabulator .tabulator-col-resize-handle:last-of-type{width:3px;margin-right:0}.tabulator .tabulator-alert{position:absolute;display:flex;align-items:center;top:0;left:0;z-index:100;height:100%;width:100%;background:rgba(0,0,0,.4);text-align:center}.tabulator .tabulator-alert .tabulator-alert-msg{display:inline-block;margin:0 auto;padding:10px 20px;border-radius:10px;background:#fff;font-weight:700;font-size:16px}.tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-msg{border:4px solid #333;color:#000}.tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-error{border:4px solid #d00;color:#590000}.tabulator-row{position:relative;box-sizing:border-box;min-height:24px;background-color:transparent}.tabulator-row.tabulator-row-even{background-color:#fafafa}.tabulator-row.tabulator-selectable:hover{background-color:#fafafa;cursor:pointer}.tabulator-row.tabulator-selected{background-color:#00d1b2}.tabulator-row.tabulator-selected:hover{background-color:#769bcc;cursor:pointer}.tabulator-row.tabulator-row-moving{border:1px solid #000;background:#fff}.tabulator-row.tabulator-moving{position:absolute;border-top:1px solid #aaa;border-bottom:1px solid #aaa;pointer-events:none;z-index:15}.tabulator-row .tabulator-row-resize-handle{position:absolute;right:0;bottom:0;left:0;height:5px}.tabulator-row .tabulator-row-resize-handle.prev{top:0;bottom:auto}.tabulator-row .tabulator-row-resize-handle:hover{cursor:ns-resize}.tabulator-row .tabulator-frozen{display:inline-block;position:absolute;background-color:inherit;z-index:10}.tabulator-row .tabulator-frozen.tabulator-frozen-left{border-right:2px solid #aaa}.tabulator-row .tabulator-frozen.tabulator-frozen-right{border-left:2px solid #aaa}.tabulator-row .tabulator-responsive-collapse{box-sizing:border-box;padding:5px;border-top:1px solid #aaa;border-bottom:1px solid #aaa}.tabulator-row .tabulator-responsive-collapse:empty{display:none}.tabulator-row .tabulator-responsive-collapse table{font-size:16px}.tabulator-row .tabulator-responsive-collapse table tr td{position:relative}.tabulator-row .tabulator-responsive-collapse table tr td:first-of-type{padding-right:10px}.tabulator-row .tabulator-cell{display:inline-block;position:relative;box-sizing:border-box;padding:4px;border-right:1px solid #aaa;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tabulator-row .tabulator-cell.tabulator-editing{border:1px solid #1d68cd;outline:none;padding:0}.tabulator-row .tabulator-cell.tabulator-editing input,.tabulator-row .tabulator-cell.tabulator-editing select{border:1px;background:transparent;outline:none}.tabulator-row .tabulator-cell.tabulator-validation-fail{border:1px solid #d00}.tabulator-row .tabulator-cell.tabulator-validation-fail input,.tabulator-row .tabulator-cell.tabulator-validation-fail select{border:1px;background:transparent;color:#d00}.tabulator-row .tabulator-cell.tabulator-row-handle{display:inline-flex;align-items:center;justify-content:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box{width:80%}.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box .tabulator-row-handle-bar{width:100%;height:3px;margin-top:2px;background:#666}.tabulator-row .tabulator-cell .tabulator-data-tree-branch{display:inline-block;vertical-align:middle;height:9px;width:7px;margin-top:-9px;margin-right:5px;border-bottom-left-radius:1px;border-left:2px solid #aaa;border-bottom:2px solid #aaa}.tabulator-row .tabulator-cell .tabulator-data-tree-control{display:inline-flex;justify-content:center;align-items:center;vertical-align:middle;height:11px;width:11px;margin-right:5px;border:1px solid #363636;border-radius:2px;background:rgba(0,0,0,.1);overflow:hidden}.tabulator-row .tabulator-cell .tabulator-data-tree-control:hover{cursor:pointer;background:rgba(0,0,0,.2)}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse{display:inline-block;position:relative;height:7px;width:1px;background:transparent}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#363636}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand{display:inline-block;position:relative;height:7px;width:1px;background:#363636}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#363636}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle{display:inline-flex;align-items:center;justify-content:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;height:15px;width:15px;border-radius:20px;background:#666;color:transparent;font-weight:700;font-size:1.1em}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle:hover{opacity:.7}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-close{display:initial}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-open,.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle .tabulator-responsive-collapse-toggle-close{display:none}.tabulator-row .tabulator-cell .tabulator-traffic-light{display:inline-block;height:14px;width:14px;border-radius:14px}.tabulator-row.tabulator-group{box-sizing:border-box;border-right:1px solid #aaa;padding:5px 5px 5px 10px;background:#ccc;font-weight:700;min-width:100%}.tabulator-row.tabulator-group:hover{cursor:pointer;background-color:rgba(0,0,0,.1)}.tabulator-row.tabulator-group.tabulator-group-visible .tabulator-arrow{margin-right:10px;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #363636;border-bottom:0}.tabulator-row.tabulator-group.tabulator-group-level-1{padding-left:30px}.tabulator-row.tabulator-group.tabulator-group-level-2{padding-left:50px}.tabulator-row.tabulator-group.tabulator-group-level-3{padding-left:70px}.tabulator-row.tabulator-group.tabulator-group-level-4{padding-left:90px}.tabulator-row.tabulator-group.tabulator-group-level-5{padding-left:110px}.tabulator-row.tabulator-group .tabulator-group-toggle{display:inline-block}.tabulator-row.tabulator-group .tabulator-arrow{display:inline-block;width:0;height:0;margin-right:16px;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:0;border-left:6px solid #363636;vertical-align:middle}.tabulator-row.tabulator-group span{margin-left:10px;color:#d00}.tabulator-popup-container{position:absolute;display:inline-block;box-sizing:border-box;background:transparent;border:1px solid #aaa;box-shadow:0 0 5px 0 rgba(0,0,0,.2);font-size:16px;overflow-y:auto;-webkit-overflow-scrolling:touch;z-index:10000}.tabulator-popup{padding:5px;border-radius:3px}.tabulator-tooltip{max-width:Min(500px,100%);padding:3px 5px;border-radius:2px;box-shadow:none;font-size:12px;pointer-events:none}.tabulator-menu .tabulator-menu-item{position:relative;box-sizing:border-box;padding:5px 10px;user-select:none}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-disabled{opacity:.5}.tabulator-menu .tabulator-menu-item:not(.tabulator-menu-item-disabled):hover{cursor:pointer;background:#fafafa}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu{padding-right:25px}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu:after{display:inline-block;position:absolute;top:calc(5px + .4em);right:10px;height:7px;width:7px;content:"";border-color:#aaa;border-style:solid;border-width:1px 1px 0 0;vertical-align:top;transform:rotate(45deg)}.tabulator-menu .tabulator-menu-separator{border-top:1px solid #aaa}.tabulator-edit-list{max-height:200px;font-size:16px;overflow-y:auto;-webkit-overflow-scrolling:touch}.tabulator-edit-list .tabulator-edit-list-item{padding:4px;color:#363636;outline:none}.tabulator-edit-list .tabulator-edit-list-item.active{color:transparent;background:#1d68cd}.tabulator-edit-list .tabulator-edit-list-item.active.focused{outline:1px solid rgba(0,0,0,.5)}.tabulator-edit-list .tabulator-edit-list-item.focused{outline:1px solid #1d68cd}.tabulator-edit-list .tabulator-edit-list-item:hover{cursor:pointer;color:transparent;background:#1d68cd}.tabulator-edit-list .tabulator-edit-list-placeholder{padding:4px;color:#363636;text-align:center}.tabulator-edit-list .tabulator-edit-list-group{border-bottom:1px solid #aaa;padding:6px 4px 4px;color:#363636;font-weight:700}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-2,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-2{padding-left:12px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-3,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-3{padding-left:20px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-4,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-4{padding-left:28px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-5,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-5{padding-left:36px}.tabulator.tabulator-ltr{direction:ltr}.tabulator.tabulator-rtl{text-align:initial;direction:rtl}.tabulator.tabulator-rtl .tabulator-header .tabulator-col{text-align:initial;border-left:1px solid #aaa;border-right:initial}.tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{margin-right:0;margin-left:-1px}.tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title{padding-right:0;padding-left:25px}.tabulator.tabulator-rtl .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{left:8px;right:auto}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell{border-right:initial;border-left:1px solid #aaa}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-branch{margin-right:0;margin-left:5px;border-bottom-left-radius:0;border-bottom-right-radius:1px;border-left:initial;border-right:2px solid #aaa}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-control{margin-right:0;margin-left:5px}.tabulator-print-fullscreen{position:absolute;top:0;bottom:0;left:0;right:0;z-index:10000}body.tabulator-print-fullscreen-hide>:not(.tabulator-print-fullscreen){display:none!important}.tabulator-print-table{border-collapse:collapse}.tabulator-print-table .tabulator-data-tree-branch{display:inline-block;vertical-align:middle;height:9px;width:7px;margin-top:-9px;margin-right:5px;border-bottom-left-radius:1px;border-left:2px solid #aaa;border-bottom:2px solid #aaa}.tabulator-print-table .tabulator-print-table-group{border-right:1px solid #aaa;padding:5px 5px 5px 10px;background:#ccc;font-weight:700;min-width:100%}.tabulator-print-table .tabulator-print-table-group:hover{cursor:pointer;background-color:rgba(0,0,0,.1)}.tabulator-print-table .tabulator-print-table-group.tabulator-group-visible .tabulator-arrow{margin-right:10px;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #363636;border-bottom:0}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-1 td{padding-left:30px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-2 td{padding-left:50px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-3 td{padding-left:70px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-4 td{padding-left:90px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-5 td{padding-left:110px!important}.tabulator-print-table .tabulator-print-table-group .tabulator-group-toggle{display:inline-block}.tabulator-print-table .tabulator-print-table-group .tabulator-arrow{display:inline-block;width:0;height:0;margin-right:16px;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:0;border-left:6px solid #363636;vertical-align:middle}.tabulator-print-table .tabulator-print-table-group span{margin-left:10px;color:#d00}.tabulator-print-table .tabulator-data-tree-control{display:inline-flex;justify-content:center;align-items:center;vertical-align:middle;height:11px;width:11px;margin-right:5px;border:1px solid #363636;border-radius:2px;background:rgba(0,0,0,.1);overflow:hidden}.tabulator-print-table .tabulator-data-tree-control:hover{cursor:pointer;background:rgba(0,0,0,.2)}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse{display:inline-block;position:relative;height:7px;width:1px;background:transparent}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#363636}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand{display:inline-block;position:relative;height:7px;width:1px;background:#363636}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#363636}.tabulator{border:none}.tabulator .tabulator-header{border:solid #dbdbdb;border-width:0 0 2px}.tabulator .tabulator-header .tabulator-col{border-right:none}.tabulator .tabulator-header .tabulator-col.tabulator-moving{border:none}.tabulator .tabulator-header .tabulator-col .tabulator-col-content{padding:.5em .75em}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{right:0}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input{border:1px solid #dbdbdb}.tabulator .tabulator-header .tabulator-calcs-holder{border:solid #dbdbdb;border-width:2px 0 0}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-cell{border-bottom-width:0}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-top{border:solid #dbdbdb;border-width:0 0 2px}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-bottom{border:solid #dbdbdb;border-width:2px 0 0}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs .tabulator-cell{border-bottom-width:0}.tabulator .tabulator-footer{padding:.5em .75em;border:solid #dbdbdb;border-width:2px 0 0}.tabulator .tabulator-footer .tabulator-calcs-holder{margin:-5px -10px 10px;border:solid #dbdbdb;border-width:0 0 2px}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-cell{border-bottom-width:0}.tabulator .tabulator-footer .tabulator-page{margin:0 .1875em;padding:calc(.375em - 1px) .75em;border:1px solid #dbdbdb;font-size:16px}.tabulator .tabulator-footer .tabulator-page.active{border-color:#4a4a4a;color:#363636;font-weight:700}.tabulator .tabulator-footer .tabulator-page:not(.disabled):hover{cursor:pointer;border-color:#b5b5b5;background:inherit;color:inherit}.tabulator.is-striped .tabulator-row:nth-child(2n){background-color:#fafafa}.tabulator.is-bordered{border:1px solid #dbdbdb}.tabulator.is-bordered .tabulator-header .tabulator-col,.tabulator.is-bordered .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell{border-right:1px solid #dbdbdb}.tabulator.is-narrow .tabulator-header .tabulator-col .tabulator-col-content,.tabulator.is-narrow .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell{padding:.25em .5em}.tabulator-row{min-height:22px}.tabulator-row.tabulator-row-even{background-color:inherit}.tabulator-row.tabulator-selected{background-color:#00d1b2!important}.tabulator-row.tabulator-selected:hover{background-color:#009e86!important}.tabulator-row .tabulator-cell{padding:.5em .75em;border:solid #dbdbdb;border-width:0 0 1px}.tabulator-print-table .tabulator-print-table-group,.tabulator-row.tabulator-group{border-bottom:1px solid #999;border-right:none;border-top:1px solid #999;color:#363636}.tabulator-print-table .tabulator-print-table-group{box-sizing:border-box} +.tabulator{position:relative;border:1px solid #999;background-color:#fff;font-size:16px;text-align:left;overflow:hidden;-webkit-transform:translatez(0);-moz-transform:translatez(0);-ms-transform:translatez(0);-o-transform:translatez(0);transform:translatez(0)}.tabulator[tabulator-layout=fitDataFill] .tabulator-tableholder .tabulator-table{min-width:100%}.tabulator[tabulator-layout=fitDataTable]{display:inline-block}.tabulator.tabulator-block-select{user-select:none}.tabulator .tabulator-header{position:relative;box-sizing:border-box;width:100%;border-bottom:1px solid #999;background-color:transparent;color:#363636;font-weight:700;white-space:nowrap;overflow:hidden;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator .tabulator-header.tabulator-header-hidden{display:none}.tabulator .tabulator-header .tabulator-col{display:inline-block;position:relative;box-sizing:border-box;border-right:1px solid #aaa;background:transparent;text-align:left;vertical-align:bottom;overflow:hidden}.tabulator .tabulator-header .tabulator-col.tabulator-moving{position:absolute;border:1px solid #999;background:transparent;pointer-events:none}.tabulator .tabulator-header .tabulator-col .tabulator-col-content{box-sizing:border-box;position:relative;padding:4px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button{padding:0 8px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button:hover{cursor:pointer;opacity:.6}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title-holder{position:relative}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title{box-sizing:border-box;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-title-editor{box-sizing:border-box;width:100%;border:1px solid #999;padding:1px;background:#fff}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-header-popup-button+.tabulator-title-editor{width:calc(100% - 22px)}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{display:flex;align-items:center;position:absolute;top:0;bottom:0;right:4px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #bbb}.tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{position:relative;display:flex;border-top:1px solid #aaa;overflow:hidden;margin-right:-1px}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter{position:relative;box-sizing:border-box;margin-top:2px;width:100%;text-align:center}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter textarea{height:auto!important}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter svg{margin-top:3px}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input::-ms-clear{width:0;height:0}.tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title{padding-right:25px}.tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover{cursor:pointer;background-color:transparent}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter{color:#bbb}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-top:none;border-bottom:6px solid #bbb}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=asc] .tabulator-col-content .tabulator-col-sorter{color:#363636}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=asc] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-top:none;border-bottom:6px solid #363636}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=desc] .tabulator-col-content .tabulator-col-sorter{color:#363636}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=desc] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-bottom:none;border-top:6px solid #363636;color:#363636}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title{writing-mode:vertical-rl;text-orientation:mixed;display:flex;align-items:center;justify-content:center}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-col-vertical-flip .tabulator-col-title{transform:rotate(180deg)}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-title{padding-right:0;padding-top:20px}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable.tabulator-col-vertical-flip .tabulator-col-title{padding-right:0;padding-bottom:20px}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-sorter{justify-content:center;left:0;right:0;top:4px;bottom:auto}.tabulator .tabulator-header .tabulator-frozen{display:inline-block;position:absolute;z-index:10}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-left{border-right:2px solid #aaa}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right{border-left:2px solid #aaa}.tabulator .tabulator-header .tabulator-calcs-holder{box-sizing:border-box;min-width:600%;background:rgba(13,13,13,0)!important;border-top:1px solid #aaa;border-bottom:1px solid #aaa;overflow:hidden}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row{background:rgba(13,13,13,0)!important}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-header .tabulator-frozen-rows-holder{min-width:600%}.tabulator .tabulator-header .tabulator-frozen-rows-holder:empty{display:none}.tabulator .tabulator-tableholder{position:relative;width:100%;white-space:nowrap;overflow:auto;-webkit-overflow-scrolling:touch}.tabulator .tabulator-tableholder:focus{outline:none}.tabulator .tabulator-tableholder .tabulator-placeholder{box-sizing:border-box;display:flex;align-items:center;width:100%}.tabulator .tabulator-tableholder .tabulator-placeholder[tabulator-render-mode=virtual]{min-height:100%;min-width:100%}.tabulator .tabulator-tableholder .tabulator-placeholder .tabulator-placeholder-contents{display:inline-block;text-align:center;padding:10px;color:#ccc;font-weight:700;font-size:20px;white-space:normal}.tabulator .tabulator-tableholder .tabulator-table{position:relative;display:inline-block;background-color:transparent;white-space:nowrap;overflow:visible;color:#363636}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs{font-weight:700;background:#ededed!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-top{border-bottom:2px solid #aaa}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-bottom{border-top:2px solid #aaa}.tabulator .tabulator-footer{border-top:1px solid #999;background-color:transparent;color:#363636;font-weight:700;white-space:nowrap;user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator .tabulator-footer .tabulator-footer-contents{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:5px 10px}.tabulator .tabulator-footer .tabulator-footer-contents:empty{display:none}.tabulator .tabulator-footer .tabulator-calcs-holder{box-sizing:border-box;width:calc(100% + 20px);text-align:left;background:rgba(13,13,13,0)!important;border-bottom:1px solid #aaa;border-top:1px solid #aaa;overflow:hidden}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row{background:rgba(13,13,13,0)!important}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-footer .tabulator-calcs-holder:only-child{margin-bottom:-5px;border-bottom:none}.tabulator .tabulator-footer>*+.tabulator-page-counter{margin-left:10px}.tabulator .tabulator-footer .tabulator-page-counter{font-weight:400}.tabulator .tabulator-footer .tabulator-paginator{flex:1;text-align:right;color:#363636;font-family:inherit;font-weight:inherit;font-size:inherit}.tabulator .tabulator-footer .tabulator-page-size{display:inline-block;margin:0 5px;padding:2px 5px;border:1px solid #dbdbdb;border-radius:3px}.tabulator .tabulator-footer .tabulator-pages{margin:0 7px}.tabulator .tabulator-footer .tabulator-page{display:inline-block;margin:0 2px;padding:2px 5px;border-radius:3px;background:hsla(0,0%,100%,.2)}.tabulator .tabulator-footer .tabulator-page.active{color:#d00}.tabulator .tabulator-footer .tabulator-page:disabled{opacity:.5}.tabulator .tabulator-footer .tabulator-page:not(.disabled):hover{background:rgba(0,0,0,.2);color:#fff}.tabulator .tabulator-col-resize-handle{position:relative;display:inline-block;width:6px;margin-left:-3px;margin-right:-3px;z-index:10;vertical-align:middle}.tabulator .tabulator-col-resize-handle:hover{cursor:ew-resize}.tabulator .tabulator-col-resize-handle:last-of-type{width:3px;margin-right:0}.tabulator .tabulator-alert{position:absolute;display:flex;align-items:center;top:0;left:0;z-index:100;height:100%;width:100%;background:rgba(0,0,0,.4);text-align:center}.tabulator .tabulator-alert .tabulator-alert-msg{display:inline-block;margin:0 auto;padding:10px 20px;border-radius:10px;background:#fff;font-weight:700;font-size:16px}.tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-msg{border:4px solid #333;color:#000}.tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-error{border:4px solid #d00;color:#590000}.tabulator-row{position:relative;box-sizing:border-box;min-height:24px;background-color:transparent}.tabulator-row.tabulator-row-even{background-color:#fafafa}.tabulator-row.tabulator-selectable:hover{background-color:#fafafa;cursor:pointer}.tabulator-row.tabulator-selected{background-color:#00d1b2}.tabulator-row.tabulator-selected:hover{background-color:#769bcc;cursor:pointer}.tabulator-row.tabulator-row-moving{border:1px solid #000;background:#fff}.tabulator-row.tabulator-moving{position:absolute;border-top:1px solid #aaa;border-bottom:1px solid #aaa;pointer-events:none;z-index:15}.tabulator-row .tabulator-row-resize-handle{position:absolute;right:0;bottom:0;left:0;height:5px}.tabulator-row .tabulator-row-resize-handle.prev{top:0;bottom:auto}.tabulator-row .tabulator-row-resize-handle:hover{cursor:ns-resize}.tabulator-row .tabulator-frozen{display:inline-block;position:absolute;background-color:inherit;z-index:10}.tabulator-row .tabulator-frozen.tabulator-frozen-left{border-right:2px solid #aaa}.tabulator-row .tabulator-frozen.tabulator-frozen-right{border-left:2px solid #aaa}.tabulator-row .tabulator-responsive-collapse{box-sizing:border-box;padding:5px;border-top:1px solid #aaa;border-bottom:1px solid #aaa}.tabulator-row .tabulator-responsive-collapse:empty{display:none}.tabulator-row .tabulator-responsive-collapse table{font-size:16px}.tabulator-row .tabulator-responsive-collapse table tr td{position:relative}.tabulator-row .tabulator-responsive-collapse table tr td:first-of-type{padding-right:10px}.tabulator-row .tabulator-cell{display:inline-block;position:relative;box-sizing:border-box;padding:4px;border-right:1px solid #aaa;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tabulator-row .tabulator-cell.tabulator-editing{border:1px solid #1d68cd;outline:none;padding:0}.tabulator-row .tabulator-cell.tabulator-editing input,.tabulator-row .tabulator-cell.tabulator-editing select{border:1px;background:transparent;outline:none}.tabulator-row .tabulator-cell.tabulator-validation-fail{border:1px solid #d00}.tabulator-row .tabulator-cell.tabulator-validation-fail input,.tabulator-row .tabulator-cell.tabulator-validation-fail select{border:1px;background:transparent;color:#d00}.tabulator-row .tabulator-cell.tabulator-row-handle{display:inline-flex;align-items:center;justify-content:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box{width:80%}.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box .tabulator-row-handle-bar{width:100%;height:3px;margin-top:2px;background:#666}.tabulator-row .tabulator-cell .tabulator-data-tree-branch{display:inline-block;vertical-align:middle;height:9px;width:7px;margin-top:-9px;margin-right:5px;border-bottom-left-radius:1px;border-left:2px solid #aaa;border-bottom:2px solid #aaa}.tabulator-row .tabulator-cell .tabulator-data-tree-control{display:inline-flex;justify-content:center;align-items:center;vertical-align:middle;height:11px;width:11px;margin-right:5px;border:1px solid #363636;border-radius:2px;background:rgba(0,0,0,.1);overflow:hidden}.tabulator-row .tabulator-cell .tabulator-data-tree-control:hover{cursor:pointer;background:rgba(0,0,0,.2)}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse{display:inline-block;position:relative;height:7px;width:1px;background:transparent}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#363636}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand{display:inline-block;position:relative;height:7px;width:1px;background:#363636}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#363636}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle{display:inline-flex;align-items:center;justify-content:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;height:15px;width:15px;border-radius:20px;background:#666;color:transparent;font-weight:700;font-size:1.1em}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle:hover{opacity:.7}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-close{display:initial}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-open,.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle .tabulator-responsive-collapse-toggle-close{display:none}.tabulator-row .tabulator-cell .tabulator-traffic-light{display:inline-block;height:14px;width:14px;border-radius:14px}.tabulator-row.tabulator-group{box-sizing:border-box;border-right:1px solid #aaa;padding:5px 5px 5px 10px;background:#ccc;font-weight:700;min-width:100%}.tabulator-row.tabulator-group:hover{cursor:pointer;background-color:rgba(0,0,0,.1)}.tabulator-row.tabulator-group.tabulator-group-visible .tabulator-arrow{margin-right:10px;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #363636;border-bottom:0}.tabulator-row.tabulator-group.tabulator-group-level-1{padding-left:30px}.tabulator-row.tabulator-group.tabulator-group-level-2{padding-left:50px}.tabulator-row.tabulator-group.tabulator-group-level-3{padding-left:70px}.tabulator-row.tabulator-group.tabulator-group-level-4{padding-left:90px}.tabulator-row.tabulator-group.tabulator-group-level-5{padding-left:110px}.tabulator-row.tabulator-group .tabulator-group-toggle{display:inline-block}.tabulator-row.tabulator-group .tabulator-arrow{display:inline-block;width:0;height:0;margin-right:16px;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:0;border-left:6px solid #363636;vertical-align:middle}.tabulator-row.tabulator-group span{margin-left:10px;color:#d00}.tabulator-popup-container{position:absolute;display:inline-block;box-sizing:border-box;background:transparent;border:1px solid #aaa;box-shadow:0 0 5px 0 rgba(0,0,0,.2);font-size:16px;overflow-y:auto;-webkit-overflow-scrolling:touch;z-index:10000}.tabulator-popup{padding:5px;border-radius:3px}.tabulator-tooltip{max-width:Min(500px,100%);padding:3px 5px;border-radius:2px;box-shadow:none;font-size:12px;pointer-events:none}.tabulator-menu .tabulator-menu-item{position:relative;box-sizing:border-box;padding:5px 10px;user-select:none}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-disabled{opacity:.5}.tabulator-menu .tabulator-menu-item:not(.tabulator-menu-item-disabled):hover{cursor:pointer;background:#fafafa}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu{padding-right:25px}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu:after{display:inline-block;position:absolute;top:calc(5px + .4em);right:10px;height:7px;width:7px;content:"";border-color:#aaa;border-style:solid;border-width:1px 1px 0 0;vertical-align:top;transform:rotate(45deg)}.tabulator-menu .tabulator-menu-separator{border-top:1px solid #aaa}.tabulator-edit-list{max-height:200px;font-size:16px;overflow-y:auto;-webkit-overflow-scrolling:touch}.tabulator-edit-list .tabulator-edit-list-item{padding:4px;color:#363636;outline:none}.tabulator-edit-list .tabulator-edit-list-item.active{color:transparent;background:#1d68cd}.tabulator-edit-list .tabulator-edit-list-item.active.focused{outline:1px solid rgba(0,0,0,.5)}.tabulator-edit-list .tabulator-edit-list-item.focused{outline:1px solid #1d68cd}.tabulator-edit-list .tabulator-edit-list-item:hover{cursor:pointer;color:transparent;background:#1d68cd}.tabulator-edit-list .tabulator-edit-list-placeholder{padding:4px;color:#363636;text-align:center}.tabulator-edit-list .tabulator-edit-list-group{border-bottom:1px solid #aaa;padding:6px 4px 4px;color:#363636;font-weight:700}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-2,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-2{padding-left:12px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-3,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-3{padding-left:20px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-4,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-4{padding-left:28px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-5,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-5{padding-left:36px}.tabulator.tabulator-ltr{direction:ltr}.tabulator.tabulator-rtl{text-align:initial;direction:rtl}.tabulator.tabulator-rtl .tabulator-header .tabulator-col{text-align:initial;border-left:1px solid #aaa;border-right:initial}.tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{margin-right:0;margin-left:-1px}.tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title{padding-right:0;padding-left:25px}.tabulator.tabulator-rtl .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{left:8px;right:auto}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell{border-right:initial;border-left:1px solid #aaa}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-branch{margin-right:0;margin-left:5px;border-bottom-left-radius:0;border-bottom-right-radius:1px;border-left:initial;border-right:2px solid #aaa}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-control{margin-right:0;margin-left:5px}.tabulator-print-fullscreen{position:absolute;top:0;bottom:0;left:0;right:0;z-index:10000}body.tabulator-print-fullscreen-hide>:not(.tabulator-print-fullscreen){display:none!important}.tabulator-print-table{border-collapse:collapse}.tabulator-print-table .tabulator-data-tree-branch{display:inline-block;vertical-align:middle;height:9px;width:7px;margin-top:-9px;margin-right:5px;border-bottom-left-radius:1px;border-left:2px solid #aaa;border-bottom:2px solid #aaa}.tabulator-print-table .tabulator-print-table-group{border-right:1px solid #aaa;padding:5px 5px 5px 10px;background:#ccc;font-weight:700;min-width:100%}.tabulator-print-table .tabulator-print-table-group:hover{cursor:pointer;background-color:rgba(0,0,0,.1)}.tabulator-print-table .tabulator-print-table-group.tabulator-group-visible .tabulator-arrow{margin-right:10px;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #363636;border-bottom:0}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-1 td{padding-left:30px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-2 td{padding-left:50px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-3 td{padding-left:70px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-4 td{padding-left:90px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-5 td{padding-left:110px!important}.tabulator-print-table .tabulator-print-table-group .tabulator-group-toggle{display:inline-block}.tabulator-print-table .tabulator-print-table-group .tabulator-arrow{display:inline-block;width:0;height:0;margin-right:16px;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:0;border-left:6px solid #363636;vertical-align:middle}.tabulator-print-table .tabulator-print-table-group span{margin-left:10px;color:#d00}.tabulator-print-table .tabulator-data-tree-control{display:inline-flex;justify-content:center;align-items:center;vertical-align:middle;height:11px;width:11px;margin-right:5px;border:1px solid #363636;border-radius:2px;background:rgba(0,0,0,.1);overflow:hidden}.tabulator-print-table .tabulator-data-tree-control:hover{cursor:pointer;background:rgba(0,0,0,.2)}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse{display:inline-block;position:relative;height:7px;width:1px;background:transparent}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#363636}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand{display:inline-block;position:relative;height:7px;width:1px;background:#363636}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#363636}.tabulator{border:none}.tabulator .tabulator-header{border:solid #dbdbdb;border-width:0 0 2px}.tabulator .tabulator-header .tabulator-col{border-right:none}.tabulator .tabulator-header .tabulator-col.tabulator-moving{border:none}.tabulator .tabulator-header .tabulator-col .tabulator-col-content{padding:.5em .75em}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{right:0}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input{border:1px solid #dbdbdb}.tabulator .tabulator-header .tabulator-calcs-holder{border:solid #dbdbdb;border-width:2px 0 0}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-cell{border-bottom-width:0}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-top{border:solid #dbdbdb;border-width:0 0 2px}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-bottom{border:solid #dbdbdb;border-width:2px 0 0}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs .tabulator-cell{border-bottom-width:0}.tabulator .tabulator-footer{padding:.5em .75em;border:solid #dbdbdb;border-width:2px 0 0}.tabulator .tabulator-footer .tabulator-calcs-holder{margin:-5px -10px 10px;border:solid #dbdbdb;border-width:0 0 2px}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-cell{border-bottom-width:0}.tabulator .tabulator-footer .tabulator-page{margin:0 .1875em;padding:calc(.375em - 1px) .75em;border:1px solid #dbdbdb;font-size:16px}.tabulator .tabulator-footer .tabulator-page.active{border-color:#4a4a4a;color:#363636;font-weight:700}.tabulator .tabulator-footer .tabulator-page:not(.disabled):hover{cursor:pointer;border-color:#b5b5b5;background:inherit;color:inherit}.tabulator.is-striped .tabulator-row:nth-child(2n){background-color:#fafafa}.tabulator.is-bordered{border:1px solid #dbdbdb}.tabulator.is-bordered .tabulator-header .tabulator-col,.tabulator.is-bordered .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell{border-right:1px solid #dbdbdb}.tabulator.is-narrow .tabulator-header .tabulator-col .tabulator-col-content,.tabulator.is-narrow .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell{padding:.25em .5em}.tabulator-row{min-height:22px}.tabulator-row.tabulator-row-even{background-color:inherit}.tabulator-row.tabulator-selected{background-color:#00d1b2!important}.tabulator-row.tabulator-selected:hover{background-color:#009e86!important}.tabulator-row .tabulator-cell{padding:.5em .75em;border:solid #dbdbdb;border-width:0 0 1px}.tabulator-print-table .tabulator-print-table-group,.tabulator-row.tabulator-group{border-bottom:1px solid #999;border-right:none;border-top:1px solid #999;color:#363636}.tabulator-print-table .tabulator-print-table-group{box-sizing:border-box}.tabulator-popup-container{background:#fff}.tabulator-edit-list .tabulator-edit-list-item.active,.tabulator-edit-list .tabulator-edit-list-item:hover{color:#fff} /*# sourceMappingURL=tabulator_bulma.min.css.map */ \ No newline at end of file diff --git a/dist/css/tabulator_bulma.min.css.map b/dist/css/tabulator_bulma.min.css.map index c1e68ce44..4653dc179 100644 --- a/dist/css/tabulator_bulma.min.css.map +++ b/dist/css/tabulator_bulma.min.css.map @@ -1 +1 @@ -{"version":3,"sources":["tabulator_bulma.scss"],"names":[],"mappings":"AAAA,WACE,iBAAkB,CAClB,qBAAsB,CACtB,qBAAuB,CACvB,cAAe,CACf,eAAgB,CAChB,eAAgB,CAChB,+BAAgC,CAChC,4BAA6B,CAC7B,2BAA4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ACV,OAAQ,CACR,UAAW,CACX,SAAU,CACV,kBAAqB,CAE7B,WACE,WAAc,CACd,6BAEE,oBAAqB,CAArB,oBAAuB,CACvB,4CACE,iBAAoB,CACpB,6DACE,WAAc,CAChB,mEACE,kBAAuB,CACvB,yFACE,OAAY,CAChB,2EACE,wBAA2B,CAC/B,qDAEE,oBAAqB,CAArB,oBAAuB,CACvB,oFACE,qBAAwB,CAC9B,sGAEE,oBAAqB,CAArB,oBAAuB,CACzB,yGAEE,oBAAqB,CAArB,oBAAuB,CACzB,kGACE,qBAAwB,CAC1B,6BACE,kBAAqB,CAErB,oBAAqB,CAArB,oBAAuB,CACvB,qDACE,sBAA6B,CAE7B,oBAAqB,CAArB,oBAAuB,CACvB,oFACE,qBAAwB,CAC5B,6CACE,gBAAkB,CAClB,gCAAmC,CACnC,wBAAyB,CACzB,cAAiB,CACjB,oDACE,oBAAqB,CACrB,aAAc,CACd,eAAmB,CACrB,kEACE,cAAe,CACf,oBAAqB,CACrB,kBAAmB,CACnB,aAAgB,CACtB,mDACE,wBAA2B,CAC7B,uBACE,wBAA2B,CAG3B,sJACE,8BAAiC,CAGrC,yKACE,kBAAuB,CAE3B,eACE,eAAkB,CAClB,kCACE,wBAA2B,CAC7B,kCACE,kCAAsC,CACxC,wCACE,kCAAsC,CACxC,+BACE,kBAAqB,CAErB,oBAAqB,CAArB,oBAAuB,CAO3B,mFALI,4BAA6B,CAC7B,iBAAkB,CAClB,yBAA0B,CAC1B,aAOc,CALlB,oDACE,qBAIgB","file":"tabulator_bulma.min.css","sourcesContent":[".tabulator {\n position: relative;\n border: 1px solid #999;\n background-color: white;\n font-size: 16px;\n text-align: left;\n overflow: hidden;\n -webkit-transform: translatez(0);\n -moz-transform: translatez(0);\n -ms-transform: translatez(0);\n -o-transform: translatez(0);\n transform: translatez(0); }\n .tabulator[tabulator-layout=\"fitDataFill\"] .tabulator-tableholder .tabulator-table {\n min-width: 100%; }\n .tabulator[tabulator-layout=\"fitDataTable\"] {\n display: inline-block; }\n .tabulator.tabulator-block-select {\n user-select: none; }\n .tabulator .tabulator-header {\n position: relative;\n box-sizing: border-box;\n width: 100%;\n border-bottom: 1px solid #999;\n background-color: transparent;\n color: #363636;\n font-weight: bold;\n white-space: nowrap;\n overflow: hidden;\n -moz-user-select: none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n -o-user-select: none; }\n .tabulator .tabulator-header.tabulator-header-hidden {\n display: none; }\n .tabulator .tabulator-header .tabulator-col {\n display: inline-block;\n position: relative;\n box-sizing: border-box;\n border-right: 1px solid #aaa;\n background: transparent;\n text-align: left;\n vertical-align: bottom;\n overflow: hidden; }\n .tabulator .tabulator-header .tabulator-col.tabulator-moving {\n position: absolute;\n border: 1px solid #999;\n background: rgba(0, 0, 0, 0);\n pointer-events: none; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content {\n box-sizing: border-box;\n position: relative;\n padding: 4px; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button {\n padding: 0 8px; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button:hover {\n cursor: pointer;\n opacity: .6; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title-holder {\n position: relative; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title {\n box-sizing: border-box;\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n vertical-align: bottom; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-title-editor {\n box-sizing: border-box;\n width: 100%;\n border: 1px solid #999;\n padding: 1px;\n background: #fff; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-header-popup-button + .tabulator-title-editor {\n width: calc(100% - 22px); }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter {\n display: flex;\n align-items: center;\n position: absolute;\n top: 0;\n bottom: 0;\n right: 4px; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter .tabulator-arrow {\n width: 0;\n height: 0;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-bottom: 6px solid #bbb; }\n .tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols {\n position: relative;\n display: flex;\n border-top: 1px solid #aaa;\n overflow: hidden;\n margin-right: -1px; }\n .tabulator .tabulator-header .tabulator-col .tabulator-header-filter {\n position: relative;\n box-sizing: border-box;\n margin-top: 2px;\n width: 100%;\n text-align: center; }\n .tabulator .tabulator-header .tabulator-col .tabulator-header-filter textarea {\n height: auto !important; }\n .tabulator .tabulator-header .tabulator-col .tabulator-header-filter svg {\n margin-top: 3px; }\n .tabulator .tabulator-header .tabulator-col .tabulator-header-filter input::-ms-clear {\n width: 0;\n height: 0; }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title {\n padding-right: 25px; }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover {\n cursor: pointer;\n background-color: rgba(0, 0, 0, 0); }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=\"none\"] .tabulator-col-content .tabulator-col-sorter {\n color: #bbb; }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=\"none\"] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow {\n border-top: none;\n border-bottom: 6px solid #bbb; }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=\"asc\"] .tabulator-col-content .tabulator-col-sorter {\n color: #363636; }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=\"asc\"] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow {\n border-top: none;\n border-bottom: 6px solid #363636; }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=\"desc\"] .tabulator-col-content .tabulator-col-sorter {\n color: #363636; }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=\"desc\"] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow {\n border-bottom: none;\n border-top: 6px solid #363636;\n color: #363636; }\n .tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title {\n writing-mode: vertical-rl;\n text-orientation: mixed;\n display: flex;\n align-items: center;\n justify-content: center; }\n .tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-col-vertical-flip .tabulator-col-title {\n transform: rotate(180deg); }\n .tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-title {\n padding-right: 0;\n padding-top: 20px; }\n .tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable.tabulator-col-vertical-flip .tabulator-col-title {\n padding-right: 0;\n padding-bottom: 20px; }\n .tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-sorter {\n justify-content: center;\n left: 0;\n right: 0;\n top: 4px;\n bottom: auto; }\n .tabulator .tabulator-header .tabulator-frozen {\n display: inline-block;\n position: absolute;\n z-index: 10; }\n .tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-left {\n border-right: 2px solid #aaa; }\n .tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right {\n border-left: 2px solid #aaa; }\n .tabulator .tabulator-header .tabulator-calcs-holder {\n box-sizing: border-box;\n min-width: 600%;\n background: rgba(13, 13, 13, 0) !important;\n border-top: 1px solid #aaa;\n border-bottom: 1px solid #aaa;\n overflow: hidden; }\n .tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row {\n background: rgba(13, 13, 13, 0) !important; }\n .tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle {\n display: none; }\n .tabulator .tabulator-header .tabulator-frozen-rows-holder {\n min-width: 600%; }\n .tabulator .tabulator-header .tabulator-frozen-rows-holder:empty {\n display: none; }\n .tabulator .tabulator-tableholder {\n position: relative;\n width: 100%;\n white-space: nowrap;\n overflow: auto;\n -webkit-overflow-scrolling: touch; }\n .tabulator .tabulator-tableholder:focus {\n outline: none; }\n .tabulator .tabulator-tableholder .tabulator-placeholder {\n box-sizing: border-box;\n display: flex;\n align-items: center;\n width: 100%; }\n .tabulator .tabulator-tableholder .tabulator-placeholder[tabulator-render-mode=\"virtual\"] {\n min-height: 100%;\n min-width: 100%; }\n .tabulator .tabulator-tableholder .tabulator-placeholder .tabulator-placeholder-contents {\n display: inline-block;\n text-align: center;\n padding: 10px;\n color: #ccc;\n font-weight: bold;\n font-size: 20px;\n white-space: normal; }\n .tabulator .tabulator-tableholder .tabulator-table {\n position: relative;\n display: inline-block;\n background-color: transparent;\n white-space: nowrap;\n overflow: visible;\n color: #363636; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs {\n font-weight: bold;\n background: #ededed !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-top {\n border-bottom: 2px solid #aaa; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-bottom {\n border-top: 2px solid #aaa; }\n .tabulator .tabulator-footer {\n border-top: 1px solid #999;\n background-color: transparent;\n color: #363636;\n font-weight: bold;\n white-space: nowrap;\n user-select: none;\n -moz-user-select: none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n -o-user-select: none; }\n .tabulator .tabulator-footer .tabulator-footer-contents {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n padding: 5px 10px; }\n .tabulator .tabulator-footer .tabulator-footer-contents:empty {\n display: none; }\n .tabulator .tabulator-footer .tabulator-calcs-holder {\n box-sizing: border-box;\n width: calc(100% + 20px);\n text-align: left;\n background: rgba(13, 13, 13, 0) !important;\n border-bottom: 1px solid #aaa;\n border-top: 1px solid #aaa;\n overflow: hidden; }\n .tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row {\n background: rgba(13, 13, 13, 0) !important; }\n .tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle {\n display: none; }\n .tabulator .tabulator-footer .tabulator-calcs-holder:only-child {\n margin-bottom: -5px;\n border-bottom: none; }\n .tabulator .tabulator-footer > * + .tabulator-page-counter {\n margin-left: 10px; }\n .tabulator .tabulator-footer .tabulator-page-counter {\n font-weight: normal; }\n .tabulator .tabulator-footer .tabulator-paginator {\n flex: 1;\n text-align: right;\n color: #363636;\n font-family: inherit;\n font-weight: inherit;\n font-size: inherit; }\n .tabulator .tabulator-footer .tabulator-page-size {\n display: inline-block;\n margin: 0 5px;\n padding: 2px 5px;\n border: 1px solid #dbdbdb;\n border-radius: 3px; }\n .tabulator .tabulator-footer .tabulator-pages {\n margin: 0 7px; }\n .tabulator .tabulator-footer .tabulator-page {\n display: inline-block;\n margin: 0 2px;\n padding: 2px 5px;\n border: 1px solid #dbdbdb;\n border-radius: 3px;\n background: rgba(255, 255, 255, 0.2); }\n .tabulator .tabulator-footer .tabulator-page.active {\n color: #d00; }\n .tabulator .tabulator-footer .tabulator-page:disabled {\n opacity: .5; }\n .tabulator .tabulator-footer .tabulator-page:not(.disabled):hover {\n cursor: pointer;\n background: rgba(0, 0, 0, 0.2);\n color: #fff; }\n .tabulator .tabulator-col-resize-handle {\n position: relative;\n display: inline-block;\n width: 6px;\n margin-left: -3px;\n margin-right: -3px;\n z-index: 10;\n vertical-align: middle; }\n .tabulator .tabulator-col-resize-handle:hover {\n cursor: ew-resize; }\n .tabulator .tabulator-col-resize-handle:last-of-type {\n width: 3px;\n margin-right: 0; }\n .tabulator .tabulator-alert {\n position: absolute;\n display: flex;\n align-items: center;\n top: 0;\n left: 0;\n z-index: 100;\n height: 100%;\n width: 100%;\n background: rgba(0, 0, 0, 0.4);\n text-align: center; }\n .tabulator .tabulator-alert .tabulator-alert-msg {\n display: inline-block;\n margin: 0 auto;\n padding: 10px 20px;\n border-radius: 10px;\n background: #fff;\n font-weight: bold;\n font-size: 16px; }\n .tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-msg {\n border: 4px solid #333;\n color: #000; }\n .tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-error {\n border: 4px solid #D00;\n color: #590000; }\n\n.tabulator-row {\n position: relative;\n box-sizing: border-box;\n min-height: 24px;\n background-color: transparent; }\n .tabulator-row.tabulator-row-even {\n background-color: #fafafa; }\n .tabulator-row.tabulator-selectable:hover {\n background-color: #fafafa;\n cursor: pointer; }\n .tabulator-row.tabulator-selected {\n background-color: #00d1b2; }\n .tabulator-row.tabulator-selected:hover {\n background-color: #769BCC;\n cursor: pointer; }\n .tabulator-row.tabulator-row-moving {\n border: 1px solid #000;\n background: #fff; }\n .tabulator-row.tabulator-moving {\n position: absolute;\n border-top: 1px solid #aaa;\n border-bottom: 1px solid #aaa;\n pointer-events: none;\n z-index: 15; }\n .tabulator-row .tabulator-row-resize-handle {\n position: absolute;\n right: 0;\n bottom: 0;\n left: 0;\n height: 5px; }\n .tabulator-row .tabulator-row-resize-handle.prev {\n top: 0;\n bottom: auto; }\n .tabulator-row .tabulator-row-resize-handle:hover {\n cursor: ns-resize; }\n .tabulator-row .tabulator-frozen {\n display: inline-block;\n position: absolute;\n background-color: inherit;\n z-index: 10; }\n .tabulator-row .tabulator-frozen.tabulator-frozen-left {\n border-right: 2px solid #aaa; }\n .tabulator-row .tabulator-frozen.tabulator-frozen-right {\n border-left: 2px solid #aaa; }\n .tabulator-row .tabulator-responsive-collapse {\n box-sizing: border-box;\n padding: 5px;\n border-top: 1px solid #aaa;\n border-bottom: 1px solid #aaa; }\n .tabulator-row .tabulator-responsive-collapse:empty {\n display: none; }\n .tabulator-row .tabulator-responsive-collapse table {\n font-size: 16px; }\n .tabulator-row .tabulator-responsive-collapse table tr td {\n position: relative; }\n .tabulator-row .tabulator-responsive-collapse table tr td:first-of-type {\n padding-right: 10px; }\n .tabulator-row .tabulator-cell {\n display: inline-block;\n position: relative;\n box-sizing: border-box;\n padding: 4px;\n border-right: 1px solid #aaa;\n vertical-align: middle;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis; }\n .tabulator-row .tabulator-cell.tabulator-editing {\n border: 1px solid #1D68CD;\n outline: none;\n padding: 0; }\n .tabulator-row .tabulator-cell.tabulator-editing input, .tabulator-row .tabulator-cell.tabulator-editing select {\n border: 1px;\n background: transparent;\n outline: none; }\n .tabulator-row .tabulator-cell.tabulator-validation-fail {\n border: 1px solid #dd0000; }\n .tabulator-row .tabulator-cell.tabulator-validation-fail input, .tabulator-row .tabulator-cell.tabulator-validation-fail select {\n border: 1px;\n background: transparent;\n color: #dd0000; }\n .tabulator-row .tabulator-cell.tabulator-row-handle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n -moz-user-select: none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n -o-user-select: none; }\n .tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box {\n width: 80%; }\n .tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box .tabulator-row-handle-bar {\n width: 100%;\n height: 3px;\n margin-top: 2px;\n background: #666; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-branch {\n display: inline-block;\n vertical-align: middle;\n height: 9px;\n width: 7px;\n margin-top: -9px;\n margin-right: 5px;\n border-bottom-left-radius: 1px;\n border-left: 2px solid #aaa;\n border-bottom: 2px solid #aaa; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n vertical-align: middle;\n height: 11px;\n width: 11px;\n margin-right: 5px;\n border: 1px solid #363636;\n border-radius: 2px;\n background: rgba(0, 0, 0, 0.1);\n overflow: hidden; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control:hover {\n cursor: pointer;\n background: rgba(0, 0, 0, 0.2); }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse {\n display: inline-block;\n position: relative;\n height: 7px;\n width: 1px;\n background: transparent; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after {\n position: absolute;\n content: \"\";\n left: -3px;\n top: 3px;\n height: 1px;\n width: 7px;\n background: #363636; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand {\n display: inline-block;\n position: relative;\n height: 7px;\n width: 1px;\n background: #363636; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after {\n position: absolute;\n content: \"\";\n left: -3px;\n top: 3px;\n height: 1px;\n width: 7px;\n background: #363636; }\n .tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n -moz-user-select: none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n -o-user-select: none;\n height: 15px;\n width: 15px;\n border-radius: 20px;\n background: #666;\n color: transparent;\n font-weight: bold;\n font-size: 1.1em; }\n .tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle:hover {\n opacity: .7; }\n .tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-close {\n display: initial; }\n .tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-open {\n display: none; }\n .tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle .tabulator-responsive-collapse-toggle-close {\n display: none; }\n .tabulator-row .tabulator-cell .tabulator-traffic-light {\n display: inline-block;\n height: 14px;\n width: 14px;\n border-radius: 14px; }\n .tabulator-row.tabulator-group {\n box-sizing: border-box;\n border-bottom: 1px solid #999;\n border-right: 1px solid #aaa;\n border-top: 1px solid #999;\n padding: 5px;\n padding-left: 10px;\n background: #ccc;\n font-weight: bold;\n min-width: 100%; }\n .tabulator-row.tabulator-group:hover {\n cursor: pointer;\n background-color: rgba(0, 0, 0, 0.1); }\n .tabulator-row.tabulator-group.tabulator-group-visible .tabulator-arrow {\n margin-right: 10px;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-top: 6px solid #363636;\n border-bottom: 0; }\n .tabulator-row.tabulator-group.tabulator-group-level-1 {\n padding-left: 30px; }\n .tabulator-row.tabulator-group.tabulator-group-level-2 {\n padding-left: 50px; }\n .tabulator-row.tabulator-group.tabulator-group-level-3 {\n padding-left: 70px; }\n .tabulator-row.tabulator-group.tabulator-group-level-4 {\n padding-left: 90px; }\n .tabulator-row.tabulator-group.tabulator-group-level-5 {\n padding-left: 110px; }\n .tabulator-row.tabulator-group .tabulator-group-toggle {\n display: inline-block; }\n .tabulator-row.tabulator-group .tabulator-arrow {\n display: inline-block;\n width: 0;\n height: 0;\n margin-right: 16px;\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n border-right: 0;\n border-left: 6px solid #363636;\n vertical-align: middle; }\n .tabulator-row.tabulator-group span {\n margin-left: 10px;\n color: #d00; }\n\n.tabulator-popup-container {\n position: absolute;\n display: inline-block;\n box-sizing: border-box;\n background: transparent;\n border: 1px solid #aaa;\n box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);\n font-size: 16px;\n overflow-y: auto;\n -webkit-overflow-scrolling: touch;\n z-index: 10000; }\n\n.tabulator-popup {\n padding: 5px;\n border-radius: 3px; }\n\n.tabulator-tooltip {\n max-width: Min(500px, 100%);\n padding: 3px 5px;\n border-radius: 2px;\n box-shadow: none;\n font-size: 12px;\n pointer-events: none; }\n\n.tabulator-menu .tabulator-menu-item {\n position: relative;\n box-sizing: border-box;\n padding: 5px 10px;\n user-select: none; }\n .tabulator-menu .tabulator-menu-item.tabulator-menu-item-disabled {\n opacity: .5; }\n .tabulator-menu .tabulator-menu-item:not(.tabulator-menu-item-disabled):hover {\n cursor: pointer;\n background: #fafafa; }\n .tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu {\n padding-right: 25px; }\n .tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu::after {\n display: inline-block;\n position: absolute;\n top: calc(5px + .4em);\n right: 10px;\n height: 7px;\n width: 7px;\n content: '';\n border-width: 1px 1px 0 0;\n border-style: solid;\n border-color: #aaa;\n vertical-align: top;\n transform: rotate(45deg); }\n\n.tabulator-menu .tabulator-menu-separator {\n border-top: 1px solid #aaa; }\n\n.tabulator-edit-list {\n max-height: 200px;\n font-size: 16px;\n overflow-y: auto;\n -webkit-overflow-scrolling: touch; }\n .tabulator-edit-list .tabulator-edit-list-item {\n padding: 4px;\n color: #363636;\n outline: none; }\n .tabulator-edit-list .tabulator-edit-list-item.active {\n color: transparent;\n background: #1D68CD; }\n .tabulator-edit-list .tabulator-edit-list-item.active.focused {\n outline: 1px solid rgba(0, 0, 0, 0.5); }\n .tabulator-edit-list .tabulator-edit-list-item.focused {\n outline: 1px solid #1D68CD; }\n .tabulator-edit-list .tabulator-edit-list-item:hover {\n cursor: pointer;\n color: transparent;\n background: #1D68CD; }\n .tabulator-edit-list .tabulator-edit-list-placeholder {\n padding: 4px;\n color: #363636;\n text-align: center; }\n .tabulator-edit-list .tabulator-edit-list-group {\n border-bottom: 1px solid #aaa;\n padding: 4px;\n padding-top: 6px;\n color: #363636;\n font-weight: bold; }\n .tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-2, .tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-2 {\n padding-left: 12px; }\n .tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-3, .tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-3 {\n padding-left: 20px; }\n .tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-4, .tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-4 {\n padding-left: 28px; }\n .tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-5, .tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-5 {\n padding-left: 36px; }\n\n.tabulator.tabulator-ltr {\n direction: ltr; }\n\n.tabulator.tabulator-rtl {\n text-align: initial;\n direction: rtl; }\n .tabulator.tabulator-rtl .tabulator-header .tabulator-col {\n text-align: initial;\n border-left: 1px solid #aaa;\n border-right: initial; }\n .tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols {\n margin-right: initial;\n margin-left: -1px; }\n .tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title {\n padding-right: 0;\n padding-left: 25px; }\n .tabulator.tabulator-rtl .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter {\n left: 8px;\n right: initial; }\n .tabulator.tabulator-rtl .tabulator-row .tabulator-cell {\n border-right: initial;\n border-left: 1px solid #aaa; }\n .tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-branch {\n margin-right: initial;\n margin-left: 5px;\n border-bottom-left-radius: initial;\n border-bottom-right-radius: 1px;\n border-left: initial;\n border-right: 2px solid #aaa; }\n .tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-control {\n margin-right: initial;\n margin-left: 5px; }\n\n.tabulator-print-fullscreen {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 10000; }\n\nbody.tabulator-print-fullscreen-hide > *:not(.tabulator-print-fullscreen) {\n display: none !important; }\n\n.tabulator-print-table {\n border-collapse: collapse; }\n .tabulator-print-table .tabulator-data-tree-branch {\n display: inline-block;\n vertical-align: middle;\n height: 9px;\n width: 7px;\n margin-top: -9px;\n margin-right: 5px;\n border-bottom-left-radius: 1px;\n border-left: 2px solid #aaa;\n border-bottom: 2px solid #aaa; }\n .tabulator-print-table .tabulator-print-table-group {\n box-sizing: border-box;\n border-bottom: 1px solid #999;\n border-right: 1px solid #aaa;\n border-top: 1px solid #999;\n padding: 5px;\n padding-left: 10px;\n background: #ccc;\n font-weight: bold;\n min-width: 100%; }\n .tabulator-print-table .tabulator-print-table-group:hover {\n cursor: pointer;\n background-color: rgba(0, 0, 0, 0.1); }\n .tabulator-print-table .tabulator-print-table-group.tabulator-group-visible .tabulator-arrow {\n margin-right: 10px;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-top: 6px solid #363636;\n border-bottom: 0; }\n .tabulator-print-table .tabulator-print-table-group.tabulator-group-level-1 td {\n padding-left: 30px !important; }\n .tabulator-print-table .tabulator-print-table-group.tabulator-group-level-2 td {\n padding-left: 50px !important; }\n .tabulator-print-table .tabulator-print-table-group.tabulator-group-level-3 td {\n padding-left: 70px !important; }\n .tabulator-print-table .tabulator-print-table-group.tabulator-group-level-4 td {\n padding-left: 90px !important; }\n .tabulator-print-table .tabulator-print-table-group.tabulator-group-level-5 td {\n padding-left: 110px !important; }\n .tabulator-print-table .tabulator-print-table-group .tabulator-group-toggle {\n display: inline-block; }\n .tabulator-print-table .tabulator-print-table-group .tabulator-arrow {\n display: inline-block;\n width: 0;\n height: 0;\n margin-right: 16px;\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n border-right: 0;\n border-left: 6px solid #363636;\n vertical-align: middle; }\n .tabulator-print-table .tabulator-print-table-group span {\n margin-left: 10px;\n color: #d00; }\n .tabulator-print-table .tabulator-data-tree-control {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n vertical-align: middle;\n height: 11px;\n width: 11px;\n margin-right: 5px;\n border: 1px solid #363636;\n border-radius: 2px;\n background: rgba(0, 0, 0, 0.1);\n overflow: hidden; }\n .tabulator-print-table .tabulator-data-tree-control:hover {\n cursor: pointer;\n background: rgba(0, 0, 0, 0.2); }\n .tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse {\n display: inline-block;\n position: relative;\n height: 7px;\n width: 1px;\n background: transparent; }\n .tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after {\n position: absolute;\n content: \"\";\n left: -3px;\n top: 3px;\n height: 1px;\n width: 7px;\n background: #363636; }\n .tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand {\n display: inline-block;\n position: relative;\n height: 7px;\n width: 1px;\n background: #363636; }\n .tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after {\n position: absolute;\n content: \"\";\n left: -3px;\n top: 3px;\n height: 1px;\n width: 7px;\n background: #363636; }\n\n.tabulator {\n border: none; }\n .tabulator .tabulator-header {\n border: 1px solid #dbdbdb;\n border-width: 0 0 2px; }\n .tabulator .tabulator-header .tabulator-col {\n border-right: none; }\n .tabulator .tabulator-header .tabulator-col.tabulator-moving {\n border: none; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content {\n padding: 0.5em 0.75em; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter {\n right: 0px; }\n .tabulator .tabulator-header .tabulator-col .tabulator-header-filter input {\n border: 1px solid #dbdbdb; }\n .tabulator .tabulator-header .tabulator-calcs-holder {\n border: 1px solid #dbdbdb;\n border-width: 2px 0 0; }\n .tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-cell {\n border-bottom-width: 0; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-top {\n border: 1px solid #dbdbdb;\n border-width: 0 0 2px; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-bottom {\n border: 1px solid #dbdbdb;\n border-width: 2px 0 0; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs .tabulator-cell {\n border-bottom-width: 0; }\n .tabulator .tabulator-footer {\n padding: 0.5em 0.75em;\n border: 1px solid #dbdbdb;\n border-width: 2px 0 0; }\n .tabulator .tabulator-footer .tabulator-calcs-holder {\n margin: -5px -10px 10px -10px;\n border: 1px solid #dbdbdb;\n border-width: 0 0 2px; }\n .tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-cell {\n border-bottom-width: 0; }\n .tabulator .tabulator-footer .tabulator-page {\n margin: 0 0.1875em;\n padding: calc(0.375em - 1px) 0.75em;\n border: 1px solid #dbdbdb;\n font-size: 16px; }\n .tabulator .tabulator-footer .tabulator-page.active {\n border-color: #4a4a4a;\n color: #363636;\n font-weight: bold; }\n .tabulator .tabulator-footer .tabulator-page:not(.disabled):hover {\n cursor: pointer;\n border-color: #b5b5b5;\n background: inherit;\n color: inherit; }\n .tabulator.is-striped .tabulator-row:nth-child(even) {\n background-color: #fafafa; }\n .tabulator.is-bordered {\n border: 1px solid #dbdbdb; }\n .tabulator.is-bordered .tabulator-header .tabulator-col {\n border-right: 1px solid #dbdbdb; }\n .tabulator.is-bordered .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell {\n border-right: 1px solid #dbdbdb; }\n .tabulator.is-narrow .tabulator-header .tabulator-col .tabulator-col-content {\n padding: 0.25em 0.5em; }\n .tabulator.is-narrow .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell {\n padding: 0.25em 0.5em; }\n\n.tabulator-row {\n min-height: 22px; }\n .tabulator-row.tabulator-row-even {\n background-color: inherit; }\n .tabulator-row.tabulator-selected {\n background-color: #00d1b2 !important; }\n .tabulator-row.tabulator-selected:hover {\n background-color: #009e86 !important; }\n .tabulator-row .tabulator-cell {\n padding: 0.5em 0.75em;\n border: 1px solid #dbdbdb;\n border-width: 0 0 1px; }\n .tabulator-row.tabulator-group {\n border-bottom: 1px solid #999;\n border-right: none;\n border-top: 1px solid #999;\n color: #363636; }\n\n.tabulator-print-table .tabulator-print-table-group {\n box-sizing: border-box;\n border-bottom: 1px solid #999;\n border-right: none;\n border-top: 1px solid #999;\n color: #363636; }\n"]} \ No newline at end of file +{"version":3,"sources":["tabulator_bulma.scss"],"names":[],"mappings":"AAAA,WACE,iBAAkB,CAClB,qBAAsB,CACtB,qBAAuB,CACvB,cAAe,CACf,eAAgB,CAChB,eAAgB,CAChB,+BAAgC,CAChC,4BAA6B,CAC7B,2BAA4B,CAC5B,0BAA2B,CAC3B,uBAA0B,CAC1B,iFACE,cAAiB,CACnB,0CACE,oBAAuB,CACzB,kCACE,gBAAmB,CACrB,6BACE,iBAAkB,CAClB,qBAAsB,CACtB,UAAW,CACX,4BAA6B,CAC7B,4BAA6B,CAC7B,aAAc,CACd,eAAiB,CACjB,kBAAmB,CACnB,eAAgB,CAChB,qBAAs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vB,oFACE,qBAAwB,CAC9B,sGAEE,oBAAqB,CAArB,oBAAuB,CACzB,yGAEE,oBAAqB,CAArB,oBAAuB,CACzB,kGACE,qBAAwB,CAC1B,6BACE,kBAAqB,CAErB,oBAAqB,CAArB,oBAAuB,CACvB,qDACE,sBAA6B,CAE7B,oBAAqB,CAArB,oBAAuB,CACvB,oFACE,qBAAwB,CAC5B,6CACE,gBAAkB,CAClB,gCAAmC,CACnC,wBAAyB,CACzB,cAAiB,CACjB,oDACE,oBAAqB,CACrB,aAAc,CACd,eAAmB,CACrB,kEACE,cAAe,CACf,oBAAqB,CACrB,kBAAmB,CACnB,aAAgB,CACtB,mDACE,wBAA2B,CAC7B,uBACE,wBAA2B,CAG3B,sJACE,8BAAiC,CAGrC,yKACE,kBAAuB,CAE3B,eACE,eAAkB,CAClB,kCACE,wBAA2B,CAC7B,kCACE,kCAAsC,CACxC,wCACE,kCAAsC,CACxC,+BACE,kBAAqB,CAErB,oBAAqB,CAArB,oBAAuB,CAO3B,mFALI,4BAA6B,CAC7B,iBAAkB,CAClB,yBAA0B,CAC1B,aAOc,CALlB,oDACE,qBAIgB,CAElB,2BACE,eAAmB,CAKrB,2GACE,UAAc","file":"tabulator_bulma.min.css","sourcesContent":[".tabulator {\n position: relative;\n border: 1px solid #999;\n background-color: white;\n font-size: 16px;\n text-align: left;\n overflow: hidden;\n -webkit-transform: translatez(0);\n -moz-transform: translatez(0);\n -ms-transform: translatez(0);\n -o-transform: translatez(0);\n transform: translatez(0); }\n .tabulator[tabulator-layout=\"fitDataFill\"] .tabulator-tableholder .tabulator-table {\n min-width: 100%; }\n .tabulator[tabulator-layout=\"fitDataTable\"] {\n display: inline-block; }\n .tabulator.tabulator-block-select {\n user-select: none; }\n .tabulator .tabulator-header {\n position: relative;\n box-sizing: border-box;\n width: 100%;\n border-bottom: 1px solid #999;\n background-color: transparent;\n color: #363636;\n font-weight: bold;\n white-space: nowrap;\n overflow: hidden;\n -moz-user-select: none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n -o-user-select: none; }\n .tabulator .tabulator-header.tabulator-header-hidden {\n display: none; }\n .tabulator .tabulator-header .tabulator-col {\n display: inline-block;\n position: relative;\n box-sizing: border-box;\n border-right: 1px solid #aaa;\n background: transparent;\n text-align: left;\n vertical-align: bottom;\n overflow: hidden; }\n .tabulator .tabulator-header .tabulator-col.tabulator-moving {\n position: absolute;\n border: 1px solid #999;\n background: rgba(0, 0, 0, 0);\n pointer-events: none; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content {\n box-sizing: border-box;\n position: relative;\n padding: 4px; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button {\n padding: 0 8px; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button:hover {\n cursor: pointer;\n opacity: .6; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title-holder {\n position: relative; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title {\n box-sizing: border-box;\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n vertical-align: bottom; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-title-editor {\n box-sizing: border-box;\n width: 100%;\n border: 1px solid #999;\n padding: 1px;\n background: #fff; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-header-popup-button + .tabulator-title-editor {\n width: calc(100% - 22px); }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter {\n display: flex;\n align-items: center;\n position: absolute;\n top: 0;\n bottom: 0;\n right: 4px; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter .tabulator-arrow {\n width: 0;\n height: 0;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-bottom: 6px solid #bbb; }\n .tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols {\n position: relative;\n display: flex;\n border-top: 1px solid #aaa;\n overflow: hidden;\n margin-right: -1px; }\n .tabulator .tabulator-header .tabulator-col .tabulator-header-filter {\n position: relative;\n box-sizing: border-box;\n margin-top: 2px;\n width: 100%;\n text-align: center; }\n .tabulator .tabulator-header .tabulator-col .tabulator-header-filter textarea {\n height: auto !important; }\n .tabulator .tabulator-header .tabulator-col .tabulator-header-filter svg {\n margin-top: 3px; }\n .tabulator .tabulator-header .tabulator-col .tabulator-header-filter input::-ms-clear {\n width: 0;\n height: 0; }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title {\n padding-right: 25px; }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover {\n cursor: pointer;\n background-color: rgba(0, 0, 0, 0); }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=\"none\"] .tabulator-col-content .tabulator-col-sorter {\n color: #bbb; }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=\"none\"] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow {\n border-top: none;\n border-bottom: 6px solid #bbb; }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=\"asc\"] .tabulator-col-content .tabulator-col-sorter {\n color: #363636; }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=\"asc\"] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow {\n border-top: none;\n border-bottom: 6px solid #363636; }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=\"desc\"] .tabulator-col-content .tabulator-col-sorter {\n color: #363636; }\n .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=\"desc\"] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow {\n border-bottom: none;\n border-top: 6px solid #363636;\n color: #363636; }\n .tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title {\n writing-mode: vertical-rl;\n text-orientation: mixed;\n display: flex;\n align-items: center;\n justify-content: center; }\n .tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-col-vertical-flip .tabulator-col-title {\n transform: rotate(180deg); }\n .tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-title {\n padding-right: 0;\n padding-top: 20px; }\n .tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable.tabulator-col-vertical-flip .tabulator-col-title {\n padding-right: 0;\n padding-bottom: 20px; }\n .tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-sorter {\n justify-content: center;\n left: 0;\n right: 0;\n top: 4px;\n bottom: auto; }\n .tabulator .tabulator-header .tabulator-frozen {\n display: inline-block;\n position: absolute;\n z-index: 10; }\n .tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-left {\n border-right: 2px solid #aaa; }\n .tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right {\n border-left: 2px solid #aaa; }\n .tabulator .tabulator-header .tabulator-calcs-holder {\n box-sizing: border-box;\n min-width: 600%;\n background: rgba(13, 13, 13, 0) !important;\n border-top: 1px solid #aaa;\n border-bottom: 1px solid #aaa;\n overflow: hidden; }\n .tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row {\n background: rgba(13, 13, 13, 0) !important; }\n .tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle {\n display: none; }\n .tabulator .tabulator-header .tabulator-frozen-rows-holder {\n min-width: 600%; }\n .tabulator .tabulator-header .tabulator-frozen-rows-holder:empty {\n display: none; }\n .tabulator .tabulator-tableholder {\n position: relative;\n width: 100%;\n white-space: nowrap;\n overflow: auto;\n -webkit-overflow-scrolling: touch; }\n .tabulator .tabulator-tableholder:focus {\n outline: none; }\n .tabulator .tabulator-tableholder .tabulator-placeholder {\n box-sizing: border-box;\n display: flex;\n align-items: center;\n width: 100%; }\n .tabulator .tabulator-tableholder .tabulator-placeholder[tabulator-render-mode=\"virtual\"] {\n min-height: 100%;\n min-width: 100%; }\n .tabulator .tabulator-tableholder .tabulator-placeholder .tabulator-placeholder-contents {\n display: inline-block;\n text-align: center;\n padding: 10px;\n color: #ccc;\n font-weight: bold;\n font-size: 20px;\n white-space: normal; }\n .tabulator .tabulator-tableholder .tabulator-table {\n position: relative;\n display: inline-block;\n background-color: transparent;\n white-space: nowrap;\n overflow: visible;\n color: #363636; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs {\n font-weight: bold;\n background: #ededed !important; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-top {\n border-bottom: 2px solid #aaa; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-bottom {\n border-top: 2px solid #aaa; }\n .tabulator .tabulator-footer {\n border-top: 1px solid #999;\n background-color: transparent;\n color: #363636;\n font-weight: bold;\n white-space: nowrap;\n user-select: none;\n -moz-user-select: none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n -o-user-select: none; }\n .tabulator .tabulator-footer .tabulator-footer-contents {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n padding: 5px 10px; }\n .tabulator .tabulator-footer .tabulator-footer-contents:empty {\n display: none; }\n .tabulator .tabulator-footer .tabulator-calcs-holder {\n box-sizing: border-box;\n width: calc(100% + 20px);\n text-align: left;\n background: rgba(13, 13, 13, 0) !important;\n border-bottom: 1px solid #aaa;\n border-top: 1px solid #aaa;\n overflow: hidden; }\n .tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row {\n background: rgba(13, 13, 13, 0) !important; }\n .tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle {\n display: none; }\n .tabulator .tabulator-footer .tabulator-calcs-holder:only-child {\n margin-bottom: -5px;\n border-bottom: none; }\n .tabulator .tabulator-footer > * + .tabulator-page-counter {\n margin-left: 10px; }\n .tabulator .tabulator-footer .tabulator-page-counter {\n font-weight: normal; }\n .tabulator .tabulator-footer .tabulator-paginator {\n flex: 1;\n text-align: right;\n color: #363636;\n font-family: inherit;\n font-weight: inherit;\n font-size: inherit; }\n .tabulator .tabulator-footer .tabulator-page-size {\n display: inline-block;\n margin: 0 5px;\n padding: 2px 5px;\n border: 1px solid #dbdbdb;\n border-radius: 3px; }\n .tabulator .tabulator-footer .tabulator-pages {\n margin: 0 7px; }\n .tabulator .tabulator-footer .tabulator-page {\n display: inline-block;\n margin: 0 2px;\n padding: 2px 5px;\n border: 1px solid #dbdbdb;\n border-radius: 3px;\n background: rgba(255, 255, 255, 0.2); }\n .tabulator .tabulator-footer .tabulator-page.active {\n color: #d00; }\n .tabulator .tabulator-footer .tabulator-page:disabled {\n opacity: .5; }\n .tabulator .tabulator-footer .tabulator-page:not(.disabled):hover {\n cursor: pointer;\n background: rgba(0, 0, 0, 0.2);\n color: #fff; }\n .tabulator .tabulator-col-resize-handle {\n position: relative;\n display: inline-block;\n width: 6px;\n margin-left: -3px;\n margin-right: -3px;\n z-index: 10;\n vertical-align: middle; }\n .tabulator .tabulator-col-resize-handle:hover {\n cursor: ew-resize; }\n .tabulator .tabulator-col-resize-handle:last-of-type {\n width: 3px;\n margin-right: 0; }\n .tabulator .tabulator-alert {\n position: absolute;\n display: flex;\n align-items: center;\n top: 0;\n left: 0;\n z-index: 100;\n height: 100%;\n width: 100%;\n background: rgba(0, 0, 0, 0.4);\n text-align: center; }\n .tabulator .tabulator-alert .tabulator-alert-msg {\n display: inline-block;\n margin: 0 auto;\n padding: 10px 20px;\n border-radius: 10px;\n background: #fff;\n font-weight: bold;\n font-size: 16px; }\n .tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-msg {\n border: 4px solid #333;\n color: #000; }\n .tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-error {\n border: 4px solid #D00;\n color: #590000; }\n\n.tabulator-row {\n position: relative;\n box-sizing: border-box;\n min-height: 24px;\n background-color: transparent; }\n .tabulator-row.tabulator-row-even {\n background-color: #fafafa; }\n .tabulator-row.tabulator-selectable:hover {\n background-color: #fafafa;\n cursor: pointer; }\n .tabulator-row.tabulator-selected {\n background-color: #00d1b2; }\n .tabulator-row.tabulator-selected:hover {\n background-color: #769BCC;\n cursor: pointer; }\n .tabulator-row.tabulator-row-moving {\n border: 1px solid #000;\n background: #fff; }\n .tabulator-row.tabulator-moving {\n position: absolute;\n border-top: 1px solid #aaa;\n border-bottom: 1px solid #aaa;\n pointer-events: none;\n z-index: 15; }\n .tabulator-row .tabulator-row-resize-handle {\n position: absolute;\n right: 0;\n bottom: 0;\n left: 0;\n height: 5px; }\n .tabulator-row .tabulator-row-resize-handle.prev {\n top: 0;\n bottom: auto; }\n .tabulator-row .tabulator-row-resize-handle:hover {\n cursor: ns-resize; }\n .tabulator-row .tabulator-frozen {\n display: inline-block;\n position: absolute;\n background-color: inherit;\n z-index: 10; }\n .tabulator-row .tabulator-frozen.tabulator-frozen-left {\n border-right: 2px solid #aaa; }\n .tabulator-row .tabulator-frozen.tabulator-frozen-right {\n border-left: 2px solid #aaa; }\n .tabulator-row .tabulator-responsive-collapse {\n box-sizing: border-box;\n padding: 5px;\n border-top: 1px solid #aaa;\n border-bottom: 1px solid #aaa; }\n .tabulator-row .tabulator-responsive-collapse:empty {\n display: none; }\n .tabulator-row .tabulator-responsive-collapse table {\n font-size: 16px; }\n .tabulator-row .tabulator-responsive-collapse table tr td {\n position: relative; }\n .tabulator-row .tabulator-responsive-collapse table tr td:first-of-type {\n padding-right: 10px; }\n .tabulator-row .tabulator-cell {\n display: inline-block;\n position: relative;\n box-sizing: border-box;\n padding: 4px;\n border-right: 1px solid #aaa;\n vertical-align: middle;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis; }\n .tabulator-row .tabulator-cell.tabulator-editing {\n border: 1px solid #1D68CD;\n outline: none;\n padding: 0; }\n .tabulator-row .tabulator-cell.tabulator-editing input, .tabulator-row .tabulator-cell.tabulator-editing select {\n border: 1px;\n background: transparent;\n outline: none; }\n .tabulator-row .tabulator-cell.tabulator-validation-fail {\n border: 1px solid #dd0000; }\n .tabulator-row .tabulator-cell.tabulator-validation-fail input, .tabulator-row .tabulator-cell.tabulator-validation-fail select {\n border: 1px;\n background: transparent;\n color: #dd0000; }\n .tabulator-row .tabulator-cell.tabulator-row-handle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n -moz-user-select: none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n -o-user-select: none; }\n .tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box {\n width: 80%; }\n .tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box .tabulator-row-handle-bar {\n width: 100%;\n height: 3px;\n margin-top: 2px;\n background: #666; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-branch {\n display: inline-block;\n vertical-align: middle;\n height: 9px;\n width: 7px;\n margin-top: -9px;\n margin-right: 5px;\n border-bottom-left-radius: 1px;\n border-left: 2px solid #aaa;\n border-bottom: 2px solid #aaa; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n vertical-align: middle;\n height: 11px;\n width: 11px;\n margin-right: 5px;\n border: 1px solid #363636;\n border-radius: 2px;\n background: rgba(0, 0, 0, 0.1);\n overflow: hidden; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control:hover {\n cursor: pointer;\n background: rgba(0, 0, 0, 0.2); }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse {\n display: inline-block;\n position: relative;\n height: 7px;\n width: 1px;\n background: transparent; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after {\n position: absolute;\n content: \"\";\n left: -3px;\n top: 3px;\n height: 1px;\n width: 7px;\n background: #363636; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand {\n display: inline-block;\n position: relative;\n height: 7px;\n width: 1px;\n background: #363636; }\n .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after {\n position: absolute;\n content: \"\";\n left: -3px;\n top: 3px;\n height: 1px;\n width: 7px;\n background: #363636; }\n .tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n -moz-user-select: none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n -o-user-select: none;\n height: 15px;\n width: 15px;\n border-radius: 20px;\n background: #666;\n color: transparent;\n font-weight: bold;\n font-size: 1.1em; }\n .tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle:hover {\n opacity: .7; }\n .tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-close {\n display: initial; }\n .tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-open {\n display: none; }\n .tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle .tabulator-responsive-collapse-toggle-close {\n display: none; }\n .tabulator-row .tabulator-cell .tabulator-traffic-light {\n display: inline-block;\n height: 14px;\n width: 14px;\n border-radius: 14px; }\n .tabulator-row.tabulator-group {\n box-sizing: border-box;\n border-bottom: 1px solid #999;\n border-right: 1px solid #aaa;\n border-top: 1px solid #999;\n padding: 5px;\n padding-left: 10px;\n background: #ccc;\n font-weight: bold;\n min-width: 100%; }\n .tabulator-row.tabulator-group:hover {\n cursor: pointer;\n background-color: rgba(0, 0, 0, 0.1); }\n .tabulator-row.tabulator-group.tabulator-group-visible .tabulator-arrow {\n margin-right: 10px;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-top: 6px solid #363636;\n border-bottom: 0; }\n .tabulator-row.tabulator-group.tabulator-group-level-1 {\n padding-left: 30px; }\n .tabulator-row.tabulator-group.tabulator-group-level-2 {\n padding-left: 50px; }\n .tabulator-row.tabulator-group.tabulator-group-level-3 {\n padding-left: 70px; }\n .tabulator-row.tabulator-group.tabulator-group-level-4 {\n padding-left: 90px; }\n .tabulator-row.tabulator-group.tabulator-group-level-5 {\n padding-left: 110px; }\n .tabulator-row.tabulator-group .tabulator-group-toggle {\n display: inline-block; }\n .tabulator-row.tabulator-group .tabulator-arrow {\n display: inline-block;\n width: 0;\n height: 0;\n margin-right: 16px;\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n border-right: 0;\n border-left: 6px solid #363636;\n vertical-align: middle; }\n .tabulator-row.tabulator-group span {\n margin-left: 10px;\n color: #d00; }\n\n.tabulator-popup-container {\n position: absolute;\n display: inline-block;\n box-sizing: border-box;\n background: transparent;\n border: 1px solid #aaa;\n box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);\n font-size: 16px;\n overflow-y: auto;\n -webkit-overflow-scrolling: touch;\n z-index: 10000; }\n\n.tabulator-popup {\n padding: 5px;\n border-radius: 3px; }\n\n.tabulator-tooltip {\n max-width: Min(500px, 100%);\n padding: 3px 5px;\n border-radius: 2px;\n box-shadow: none;\n font-size: 12px;\n pointer-events: none; }\n\n.tabulator-menu .tabulator-menu-item {\n position: relative;\n box-sizing: border-box;\n padding: 5px 10px;\n user-select: none; }\n .tabulator-menu .tabulator-menu-item.tabulator-menu-item-disabled {\n opacity: .5; }\n .tabulator-menu .tabulator-menu-item:not(.tabulator-menu-item-disabled):hover {\n cursor: pointer;\n background: #fafafa; }\n .tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu {\n padding-right: 25px; }\n .tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu::after {\n display: inline-block;\n position: absolute;\n top: calc(5px + .4em);\n right: 10px;\n height: 7px;\n width: 7px;\n content: '';\n border-width: 1px 1px 0 0;\n border-style: solid;\n border-color: #aaa;\n vertical-align: top;\n transform: rotate(45deg); }\n\n.tabulator-menu .tabulator-menu-separator {\n border-top: 1px solid #aaa; }\n\n.tabulator-edit-list {\n max-height: 200px;\n font-size: 16px;\n overflow-y: auto;\n -webkit-overflow-scrolling: touch; }\n .tabulator-edit-list .tabulator-edit-list-item {\n padding: 4px;\n color: #363636;\n outline: none; }\n .tabulator-edit-list .tabulator-edit-list-item.active {\n color: transparent;\n background: #1D68CD; }\n .tabulator-edit-list .tabulator-edit-list-item.active.focused {\n outline: 1px solid rgba(0, 0, 0, 0.5); }\n .tabulator-edit-list .tabulator-edit-list-item.focused {\n outline: 1px solid #1D68CD; }\n .tabulator-edit-list .tabulator-edit-list-item:hover {\n cursor: pointer;\n color: transparent;\n background: #1D68CD; }\n .tabulator-edit-list .tabulator-edit-list-placeholder {\n padding: 4px;\n color: #363636;\n text-align: center; }\n .tabulator-edit-list .tabulator-edit-list-group {\n border-bottom: 1px solid #aaa;\n padding: 4px;\n padding-top: 6px;\n color: #363636;\n font-weight: bold; }\n .tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-2, .tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-2 {\n padding-left: 12px; }\n .tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-3, .tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-3 {\n padding-left: 20px; }\n .tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-4, .tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-4 {\n padding-left: 28px; }\n .tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-5, .tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-5 {\n padding-left: 36px; }\n\n.tabulator.tabulator-ltr {\n direction: ltr; }\n\n.tabulator.tabulator-rtl {\n text-align: initial;\n direction: rtl; }\n .tabulator.tabulator-rtl .tabulator-header .tabulator-col {\n text-align: initial;\n border-left: 1px solid #aaa;\n border-right: initial; }\n .tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols {\n margin-right: initial;\n margin-left: -1px; }\n .tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title {\n padding-right: 0;\n padding-left: 25px; }\n .tabulator.tabulator-rtl .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter {\n left: 8px;\n right: initial; }\n .tabulator.tabulator-rtl .tabulator-row .tabulator-cell {\n border-right: initial;\n border-left: 1px solid #aaa; }\n .tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-branch {\n margin-right: initial;\n margin-left: 5px;\n border-bottom-left-radius: initial;\n border-bottom-right-radius: 1px;\n border-left: initial;\n border-right: 2px solid #aaa; }\n .tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-control {\n margin-right: initial;\n margin-left: 5px; }\n\n.tabulator-print-fullscreen {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 10000; }\n\nbody.tabulator-print-fullscreen-hide > *:not(.tabulator-print-fullscreen) {\n display: none !important; }\n\n.tabulator-print-table {\n border-collapse: collapse; }\n .tabulator-print-table .tabulator-data-tree-branch {\n display: inline-block;\n vertical-align: middle;\n height: 9px;\n width: 7px;\n margin-top: -9px;\n margin-right: 5px;\n border-bottom-left-radius: 1px;\n border-left: 2px solid #aaa;\n border-bottom: 2px solid #aaa; }\n .tabulator-print-table .tabulator-print-table-group {\n box-sizing: border-box;\n border-bottom: 1px solid #999;\n border-right: 1px solid #aaa;\n border-top: 1px solid #999;\n padding: 5px;\n padding-left: 10px;\n background: #ccc;\n font-weight: bold;\n min-width: 100%; }\n .tabulator-print-table .tabulator-print-table-group:hover {\n cursor: pointer;\n background-color: rgba(0, 0, 0, 0.1); }\n .tabulator-print-table .tabulator-print-table-group.tabulator-group-visible .tabulator-arrow {\n margin-right: 10px;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-top: 6px solid #363636;\n border-bottom: 0; }\n .tabulator-print-table .tabulator-print-table-group.tabulator-group-level-1 td {\n padding-left: 30px !important; }\n .tabulator-print-table .tabulator-print-table-group.tabulator-group-level-2 td {\n padding-left: 50px !important; }\n .tabulator-print-table .tabulator-print-table-group.tabulator-group-level-3 td {\n padding-left: 70px !important; }\n .tabulator-print-table .tabulator-print-table-group.tabulator-group-level-4 td {\n padding-left: 90px !important; }\n .tabulator-print-table .tabulator-print-table-group.tabulator-group-level-5 td {\n padding-left: 110px !important; }\n .tabulator-print-table .tabulator-print-table-group .tabulator-group-toggle {\n display: inline-block; }\n .tabulator-print-table .tabulator-print-table-group .tabulator-arrow {\n display: inline-block;\n width: 0;\n height: 0;\n margin-right: 16px;\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n border-right: 0;\n border-left: 6px solid #363636;\n vertical-align: middle; }\n .tabulator-print-table .tabulator-print-table-group span {\n margin-left: 10px;\n color: #d00; }\n .tabulator-print-table .tabulator-data-tree-control {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n vertical-align: middle;\n height: 11px;\n width: 11px;\n margin-right: 5px;\n border: 1px solid #363636;\n border-radius: 2px;\n background: rgba(0, 0, 0, 0.1);\n overflow: hidden; }\n .tabulator-print-table .tabulator-data-tree-control:hover {\n cursor: pointer;\n background: rgba(0, 0, 0, 0.2); }\n .tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse {\n display: inline-block;\n position: relative;\n height: 7px;\n width: 1px;\n background: transparent; }\n .tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after {\n position: absolute;\n content: \"\";\n left: -3px;\n top: 3px;\n height: 1px;\n width: 7px;\n background: #363636; }\n .tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand {\n display: inline-block;\n position: relative;\n height: 7px;\n width: 1px;\n background: #363636; }\n .tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after {\n position: absolute;\n content: \"\";\n left: -3px;\n top: 3px;\n height: 1px;\n width: 7px;\n background: #363636; }\n\n.tabulator {\n border: none; }\n .tabulator .tabulator-header {\n border: 1px solid #dbdbdb;\n border-width: 0 0 2px; }\n .tabulator .tabulator-header .tabulator-col {\n border-right: none; }\n .tabulator .tabulator-header .tabulator-col.tabulator-moving {\n border: none; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content {\n padding: 0.5em 0.75em; }\n .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter {\n right: 0px; }\n .tabulator .tabulator-header .tabulator-col .tabulator-header-filter input {\n border: 1px solid #dbdbdb; }\n .tabulator .tabulator-header .tabulator-calcs-holder {\n border: 1px solid #dbdbdb;\n border-width: 2px 0 0; }\n .tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-cell {\n border-bottom-width: 0; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-top {\n border: 1px solid #dbdbdb;\n border-width: 0 0 2px; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-bottom {\n border: 1px solid #dbdbdb;\n border-width: 2px 0 0; }\n .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs .tabulator-cell {\n border-bottom-width: 0; }\n .tabulator .tabulator-footer {\n padding: 0.5em 0.75em;\n border: 1px solid #dbdbdb;\n border-width: 2px 0 0; }\n .tabulator .tabulator-footer .tabulator-calcs-holder {\n margin: -5px -10px 10px -10px;\n border: 1px solid #dbdbdb;\n border-width: 0 0 2px; }\n .tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-cell {\n border-bottom-width: 0; }\n .tabulator .tabulator-footer .tabulator-page {\n margin: 0 0.1875em;\n padding: calc(0.375em - 1px) 0.75em;\n border: 1px solid #dbdbdb;\n font-size: 16px; }\n .tabulator .tabulator-footer .tabulator-page.active {\n border-color: #4a4a4a;\n color: #363636;\n font-weight: bold; }\n .tabulator .tabulator-footer .tabulator-page:not(.disabled):hover {\n cursor: pointer;\n border-color: #b5b5b5;\n background: inherit;\n color: inherit; }\n .tabulator.is-striped .tabulator-row:nth-child(even) {\n background-color: #fafafa; }\n .tabulator.is-bordered {\n border: 1px solid #dbdbdb; }\n .tabulator.is-bordered .tabulator-header .tabulator-col {\n border-right: 1px solid #dbdbdb; }\n .tabulator.is-bordered .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell {\n border-right: 1px solid #dbdbdb; }\n .tabulator.is-narrow .tabulator-header .tabulator-col .tabulator-col-content {\n padding: 0.25em 0.5em; }\n .tabulator.is-narrow .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell {\n padding: 0.25em 0.5em; }\n\n.tabulator-row {\n min-height: 22px; }\n .tabulator-row.tabulator-row-even {\n background-color: inherit; }\n .tabulator-row.tabulator-selected {\n background-color: #00d1b2 !important; }\n .tabulator-row.tabulator-selected:hover {\n background-color: #009e86 !important; }\n .tabulator-row .tabulator-cell {\n padding: 0.5em 0.75em;\n border: 1px solid #dbdbdb;\n border-width: 0 0 1px; }\n .tabulator-row.tabulator-group {\n border-bottom: 1px solid #999;\n border-right: none;\n border-top: 1px solid #999;\n color: #363636; }\n\n.tabulator-print-table .tabulator-print-table-group {\n box-sizing: border-box;\n border-bottom: 1px solid #999;\n border-right: none;\n border-top: 1px solid #999;\n color: #363636; }\n\n.tabulator-popup-container {\n background: white; }\n\n.tabulator-edit-list .tabulator-edit-list-item.active {\n color: white; }\n\n.tabulator-edit-list .tabulator-edit-list-item:hover {\n color: white; }\n"]} \ No newline at end of file diff --git a/dist/js/tabulator.js b/dist/js/tabulator.js index d01d5f9bd..bbff91221 100644 --- a/dist/js/tabulator.js +++ b/dist/js/tabulator.js @@ -1,4 +1,4 @@ -/* Tabulator v5.2.4 (c) Oliver Folkerd 2022 */ +/* Tabulator v5.2.5 (c) Oliver Folkerd 2022 */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : @@ -897,7 +897,6 @@ break; case "undefined": - case "null": this.element.innerHTML = ""; break; @@ -1277,7 +1276,6 @@ } } - this.contentElement = this._bindEvents(); this.contentElement = this._buildColumnHeaderContent(); this.element.appendChild(this.contentElement); @@ -1288,92 +1286,12 @@ } this.dispatch("column-init", this); - } - }, { - key: "_bindEvents", - value: function _bindEvents() { - var _this3 = this; - - var def = this.definition, - dblTap, - tapHold, - tap; //setup header click event bindings - - if (typeof def.headerClick == "function") { - this.element.addEventListener("click", function (e) { - def.headerClick(e, _this3.getComponent()); - }); - } - - if (typeof def.headerDblClick == "function") { - this.element.addEventListener("dblclick", function (e) { - def.headerDblClick(e, _this3.getComponent()); - }); - } - - if (typeof def.headerContext == "function") { - this.element.addEventListener("contextmenu", function (e) { - def.headerContext(e, _this3.getComponent()); - }); - } //setup header tap event bindings - - - if (typeof def.headerTap == "function") { - tap = false; - this.element.addEventListener("touchstart", function (e) { - tap = true; - }, { - passive: true - }); - this.element.addEventListener("touchend", function (e) { - if (tap) { - def.headerTap(e, _this3.getComponent()); - } - - tap = false; - }); - } - - if (typeof def.headerDblTap == "function") { - dblTap = null; - this.element.addEventListener("touchend", function (e) { - if (dblTap) { - clearTimeout(dblTap); - dblTap = null; - def.headerDblTap(e, _this3.getComponent()); - } else { - dblTap = setTimeout(function () { - clearTimeout(dblTap); - dblTap = null; - }, 300); - } - }); - } - - if (typeof def.headerTapHold == "function") { - tapHold = null; - this.element.addEventListener("touchstart", function (e) { - clearTimeout(tapHold); - tapHold = setTimeout(function () { - clearTimeout(tapHold); - tapHold = null; - tap = false; - def.headerTapHold(e, this.getComponent()); - }, 1000); - }, { - passive: true - }); - this.element.addEventListener("touchend", function (e) { - clearTimeout(tapHold); - tapHold = null; - }); - } } //build header element for header }, { key: "_buildColumnHeader", value: function _buildColumnHeader() { - var _this4 = this; + var _this3 = this; var def = this.definition, table = this.table; @@ -1391,7 +1309,7 @@ if (def.cssClass) { var classeNames = def.cssClass.split(" "); classeNames.forEach(function (className) { - _this4.element.classList.add(className); + _this3.element.classList.add(className); }); } @@ -1434,7 +1352,7 @@ }, { key: "_buildColumnHeaderTitle", value: function _buildColumnHeaderTitle() { - var _this5 = this; + var _this4 = this; var def = this.definition; var titleHolderElement = document.createElement("div"); @@ -1450,7 +1368,7 @@ titleElement.addEventListener("change", function () { def.title = titleElement.value; - _this5.dispatchExternal("columnTitleChanged", _this5.getComponent()); + _this4.dispatchExternal("columnTitleChanged", _this4.getComponent()); }); titleHolderElement.appendChild(titleElement); @@ -1464,7 +1382,7 @@ } else { if (def.field) { this.langBind("columns|" + def.field, function (text) { - _this5._formatColumnHeaderTitle(titleHolderElement, text || def.title || " "); + _this4._formatColumnHeaderTitle(titleHolderElement, text || def.title || " "); }); } else { this._formatColumnHeaderTitle(titleHolderElement, def.title || " "); @@ -1492,7 +1410,6 @@ break; case "undefined": - case "null": el.innerHTML = ""; break; @@ -1504,7 +1421,7 @@ }, { key: "_buildGroupHeader", value: function _buildGroupHeader() { - var _this6 = this; + var _this5 = this; this.element.classList.add("tabulator-col-group"); this.element.setAttribute("role", "columngroup"); @@ -1513,7 +1430,7 @@ if (this.definition.cssClass) { var classeNames = this.definition.cssClass.split(" "); classeNames.forEach(function (className) { - _this6.element.classList.add(className); + _this5.element.classList.add(className); }); } @@ -1944,40 +1861,40 @@ }, { key: "delete", value: function _delete() { - var _this7 = this; + var _this6 = this; return new Promise(function (resolve, reject) { - if (_this7.isGroup) { - _this7.columns.forEach(function (column) { + if (_this6.isGroup) { + _this6.columns.forEach(function (column) { column["delete"](); }); } - _this7.dispatch("column-delete", _this7); + _this6.dispatch("column-delete", _this6); - var cellCount = _this7.cells.length; + var cellCount = _this6.cells.length; for (var i = 0; i < cellCount; i++) { - _this7.cells[0]["delete"](); + _this6.cells[0]["delete"](); } - if (_this7.element.parentNode) { - _this7.element.parentNode.removeChild(_this7.element); + if (_this6.element.parentNode) { + _this6.element.parentNode.removeChild(_this6.element); } - _this7.element = false; - _this7.contentElement = false; - _this7.titleElement = false; - _this7.groupElement = false; + _this6.element = false; + _this6.contentElement = false; + _this6.titleElement = false; + _this6.groupElement = false; - if (_this7.parent.isGroup) { - _this7.parent.removeChild(_this7); + if (_this6.parent.isGroup) { + _this6.parent.removeChild(_this6); } - _this7.table.columnManager.deregisterColumn(_this7); + _this6.table.columnManager.deregisterColumn(_this6); - _this7.table.columnManager.renderer.rerenderColumns(true); + _this6.table.columnManager.renderer.rerenderColumns(true); resolve(); }); @@ -2078,7 +1995,7 @@ }, { key: "updateDefinition", value: function updateDefinition(updates) { - var _this8 = this; + var _this7 = this; var definition; @@ -2087,11 +2004,11 @@ definition = Object.assign({}, this.getDefinition()); definition = Object.assign(definition, updates); return this.table.columnManager.addColumn(definition, false, this).then(function (column) { - if (definition.field == _this8.field) { - _this8.field = false; //cleair field name to prevent deletion of duplicate column from arrays + if (definition.field == _this7.field) { + _this7.field = false; //cleair field name to prevent deletion of duplicate column from arrays } - return _this8["delete"]().then(function () { + return _this7["delete"]().then(function () { return column.getComponent(); }); }); @@ -2442,6 +2359,8 @@ _this2.elementVertical.scrollTop = _this2.elementVertical.scrollTop - _this2.elementVertical.clientHeight + rowEl.offsetHeight; } + break; + case "top": _this2.elementVertical.scrollTop = rowEl.offsetTop; break; @@ -5103,8 +5022,8 @@ value: function createHolderElement() { var el = document.createElement("div"); el.classList.add("tabulator-tableholder"); - el.setAttribute("tabindex", 0); - el.setAttribute("role", "rowgroup"); + el.setAttribute("tabindex", 0); // el.setAttribute("role", "rowgroup"); + return el; } }, { @@ -7212,6 +7131,7 @@ _this.blurEvent = _this.hide.bind(_assertThisInitialized(_this), false); _this.escEvent = _this._escapeCheck.bind(_assertThisInitialized(_this)); + _this.destroyBinding = _this.hide.bind(_assertThisInitialized(_this), true); return _this; } @@ -7344,6 +7264,7 @@ this._fitToScreen(x, y, parentEl, parentOffset, position); this.visible = true; + this.subscribe("table-destroy", this.destroyBinding); return this; } }, { @@ -7446,6 +7367,8 @@ if (this.blurCallback && !silent) { this.blurCallback(); } + + this.unsubscribe("table-destroy", this.destroyBinding); } return this; @@ -11529,11 +11452,10 @@ if (col) { switch (_typeof(col.value)) { case "object": - col.value = JSON.stringify(col.value); + col.value = col.value !== null ? JSON.stringify(col.value) : ""; break; case "undefined": - case "null": col.value = ""; break; } @@ -11647,11 +11569,10 @@ if (col) { switch (_typeof(col.value)) { case "object": - col.value = JSON.stringify(col.value); + col.value = col.value !== null ? JSON.stringify(col.value) : ""; break; case "undefined": - case "null": col.value = ""; break; } @@ -12522,7 +12443,7 @@ this.initialValues = this.params.multiselect ? initialValue : [initialValue]; if (this.isFilter) { - this.input.value = this.initialValues.join(","); + this.input.value = this.initialValues ? this.initialValues.join(",") : ""; this.headerFilterInitialListGen(); } } @@ -15170,11 +15091,10 @@ } else { switch (_typeof(value)) { case "object": - value = JSON.stringify(value); + value = value !== null ? JSON.stringify(value) : ""; break; case "undefined": - case "null": value = ""; break; @@ -22499,7 +22419,6 @@ break; case "undefined": - case "null": this.pageCounterElement.innerHTML = ""; break; @@ -24155,7 +24074,7 @@ config.handleEl = handle; - if (element.parentNode) { + if (element.parentNode && column.visible) { element.after(handle); } } @@ -26067,7 +25986,7 @@ key: "setColumnHeader", value: function setColumnHeader(column, dir) { column.modules.sort.dir = dir; - column.getElement().setAttribute("aria-sort", dir); + column.getElement().setAttribute("aria-sort", dir === "asc" ? "ascending" : "descending"); } //sort each item in sort list }, { diff --git a/dist/js/tabulator.js.map b/dist/js/tabulator.js.map index 691981443..668a48531 100644 --- a/dist/js/tabulator.js.map +++ b/dist/js/tabulator.js.map @@ -1 +1 @@ -{"version":3,"file":"tabulator.js","sources":["../../src/js/core/defaults/options.js","../../src/js/core/CoreFeature.js","../../src/js/core/column/ColumnComponent.js","../../src/js/core/column/defaults/options.js","../../src/js/core/cell/CellComponent.js","../../src/js/core/cell/Cell.js","../../src/js/core/column/Column.js","../../src/js/core/tools/Helpers.js","../../src/js/core/tools/OptionsList.js","../../src/js/core/rendering/Renderer.js","../../src/js/core/rendering/renderers/BasicHorizontal.js","../../src/js/core/rendering/renderers/VirtualDomHorizontal.js","../../src/js/core/ColumnManager.js","../../src/js/core/row/RowComponent.js","../../src/js/core/row/Row.js","../../src/js/core/rendering/renderers/BasicVertical.js","../../src/js/core/rendering/renderers/VirtualDomVertical.js","../../src/js/core/RowManager.js","../../src/js/core/FooterManager.js","../../src/js/core/tools/InteractionMonitor.js","../../src/js/core/tools/ComponentFunctionBinder.js","../../src/js/core/tools/DataLoader.js","../../src/js/core/tools/ExternalEventBus.js","../../src/js/core/tools/InternalEventBus.js","../../src/js/core/tools/TableRegistry.js","../../src/js/core/tools/Popup.js","../../src/js/core/Module.js","../../src/js/modules/Layout/defaults/modes/fitData.js","../../src/js/modules/Layout/defaults/modes/fitDataGeneral.js","../../src/js/modules/Layout/defaults/modes/fitDataStretch.js","../../src/js/modules/Layout/defaults/modes/fitColumns.js","../../src/js/modules/Layout/defaults/modes.js","../../src/js/modules/Layout/Layout.js","../../src/js/modules/Localize/defaults/langs.js","../../src/js/modules/Localize/Localize.js","../../src/js/modules/Comms/Comms.js","../../src/js/core/tools/ModuleBinder.js","../../src/js/core/tools/Alert.js","../../src/js/core/Tabulator.js","../../src/js/modules/Accessor/defaults/accessors.js","../../src/js/modules/Accessor/Accessor.js","../../src/js/modules/Ajax/defaults/config.js","../../src/js/modules/Ajax/defaults/urlGenerator.js","../../src/js/modules/Ajax/defaults/loaderPromise.js","../../src/js/modules/Ajax/defaults/contentTypeFormatters.js","../../src/js/modules/Ajax/Ajax.js","../../src/js/modules/Clipboard/defaults/pasteActions.js","../../src/js/modules/Clipboard/defaults/pasteParsers.js","../../src/js/modules/Clipboard/Clipboard.js","../../src/js/modules/ColumnCalcs/CalcComponent.js","../../src/js/modules/ColumnCalcs/defaults/calculations.js","../../src/js/modules/ColumnCalcs/ColumnCalcs.js","../../src/js/modules/DataTree/DataTree.js","../../src/js/modules/Download/defaults/downloaders/csv.js","../../src/js/modules/Download/defaults/downloaders/json.js","../../src/js/modules/Download/defaults/downloaders/pdf.js","../../src/js/modules/Download/defaults/downloaders/xlsx.js","../../src/js/modules/Download/defaults/downloaders/html.js","../../src/js/modules/Download/defaults/downloaders/jsonLines.js","../../src/js/modules/Download/defaults/downloaders.js","../../src/js/modules/Download/Download.js","../../src/js/modules/Edit/inputMask.js","../../src/js/modules/Edit/defaults/editors/input.js","../../src/js/modules/Edit/defaults/editors/textarea.js","../../src/js/modules/Edit/defaults/editors/number.js","../../src/js/modules/Edit/defaults/editors/range.js","../../src/js/modules/Edit/List.js","../../src/js/modules/Edit/defaults/editors/select.js","../../src/js/modules/Edit/defaults/editors/list.js","../../src/js/modules/Edit/defaults/editors/autocomplete.js","../../src/js/modules/Edit/defaults/editors/star.js","../../src/js/modules/Edit/defaults/editors/progress.js","../../src/js/modules/Edit/defaults/editors/tickCross.js","../../src/js/modules/Edit/defaults/editors.js","../../src/js/modules/Edit/Edit.js","../../src/js/modules/Export/ExportRow.js","../../src/js/modules/Export/ExportColumn.js","../../src/js/modules/Export/Export.js","../../src/js/modules/Filter/defaults/filters.js","../../src/js/modules/Filter/Filter.js","../../src/js/modules/Format/defaults/formatters/plaintext.js","../../src/js/modules/Format/defaults/formatters/html.js","../../src/js/modules/Format/defaults/formatters/textarea.js","../../src/js/modules/Format/defaults/formatters/money.js","../../src/js/modules/Format/defaults/formatters/link.js","../../src/js/modules/Format/defaults/formatters/image.js","../../src/js/modules/Format/defaults/formatters/tickCross.js","../../src/js/modules/Format/defaults/formatters/datetime.js","../../src/js/modules/Format/defaults/formatters/datetimediff.js","../../src/js/modules/Format/defaults/formatters/lookup.js","../../src/js/modules/Format/defaults/formatters/star.js","../../src/js/modules/Format/defaults/formatters/traffic.js","../../src/js/modules/Format/defaults/formatters/progress.js","../../src/js/modules/Format/defaults/formatters/color.js","../../src/js/modules/Format/defaults/formatters/buttonTick.js","../../src/js/modules/Format/defaults/formatters/buttonCross.js","../../src/js/modules/Format/defaults/formatters/rownum.js","../../src/js/modules/Format/defaults/formatters/handle.js","../../src/js/modules/Format/defaults/formatters/responsiveCollapse.js","../../src/js/modules/Format/defaults/formatters/rowSelection.js","../../src/js/modules/Format/defaults/formatters.js","../../src/js/modules/Format/Format.js","../../src/js/modules/FrozenColumns/FrozenColumns.js","../../src/js/modules/FrozenRows/FrozenRows.js","../../src/js/modules/GroupRows/GroupComponent.js","../../src/js/modules/GroupRows/Group.js","../../src/js/modules/GroupRows/GroupRows.js","../../src/js/modules/History/defaults/undoers.js","../../src/js/modules/History/defaults/redoers.js","../../src/js/modules/History/History.js","../../src/js/modules/HtmlTableImport/HtmlTableImport.js","../../src/js/modules/Import/defaults/importers/csv.js","../../src/js/modules/Import/defaults/importers/json.js","../../src/js/modules/Import/defaults/importers.js","../../src/js/modules/Import/Import.js","../../src/js/modules/Interaction/Interaction.js","../../src/js/modules/Keybindings/defaults/bindings.js","../../src/js/modules/Keybindings/defaults/actions.js","../../src/js/modules/Keybindings/Keybindings.js","../../src/js/modules/Menu/Menu.js","../../src/js/modules/MoveColumns/MoveColumns.js","../../src/js/modules/MoveRows/MoveRows.js","../../src/js/modules/Mutator/defaults/mutators.js","../../src/js/modules/Mutator/Mutator.js","../../src/js/modules/Page/defaults/pageCounters/rows.js","../../src/js/modules/Page/defaults/pageCounters/pages.js","../../src/js/modules/Page/defaults/pageCounters.js","../../src/js/modules/Page/Page.js","../../src/js/modules/Persistence/defaults/readers.js","../../src/js/modules/Persistence/defaults/writers.js","../../src/js/modules/Persistence/Persistence.js","../../src/js/modules/Popup/Popup.js","../../src/js/modules/Print/Print.js","../../src/js/modules/ReactiveData/ReactiveData.js","../../src/js/modules/ResizeColumns/ResizeColumns.js","../../src/js/modules/ResizeRows/ResizeRows.js","../../src/js/modules/ResizeTable/ResizeTable.js","../../src/js/modules/ResponsiveLayout/ResponsiveLayout.js","../../src/js/modules/SelectRow/SelectRow.js","../../src/js/modules/Sort/defaults/sorters/number.js","../../src/js/modules/Sort/defaults/sorters/string.js","../../src/js/modules/Sort/defaults/sorters/datetime.js","../../src/js/modules/Sort/defaults/sorters/date.js","../../src/js/modules/Sort/defaults/sorters/time.js","../../src/js/modules/Sort/defaults/sorters/boolean.js","../../src/js/modules/Sort/defaults/sorters/array.js","../../src/js/modules/Sort/defaults/sorters/exists.js","../../src/js/modules/Sort/defaults/sorters/alphanum.js","../../src/js/modules/Sort/defaults/sorters.js","../../src/js/modules/Sort/Sort.js","../../src/js/modules/Tooltip/Tooltip.js","../../src/js/modules/Validate/defaults/validators.js","../../src/js/modules/Validate/Validate.js","../../src/js/core/TabulatorFull.js"],"sourcesContent":["export default {\r\n\r\n\tdebugEventsExternal:false, //flag to console log events\r\n\tdebugEventsInternal:false, //flag to console log events\r\n\tdebugInvalidOptions:true, //allow toggling of invalid option warnings\r\n\tdebugInitialization:true, //allow toggling of invalid option warnings\r\n\r\n\theight:false, //height of tabulator\r\n\tminHeight:false, //minimum height of tabulator\r\n\tmaxHeight:false, //maximum height of tabulator\r\n\r\n\tcolumnHeaderVertAlign:\"top\", //vertical alignment of column headers\r\n\r\n\tpopupContainer:false,\r\n\r\n\tcolumns:[],//store for colum header info\r\n\tcolumnDefaults:{}, //store column default props\r\n\r\n\tdata:false, //default starting data\r\n\r\n\tautoColumns:false, //build columns from data row structure\r\n\tautoColumnsDefinitions:false,\r\n\r\n\tnestedFieldSeparator:\".\", //separator for nested data\r\n\r\n\tfooterElement:false, //hold footer element\r\n\r\n\tindex:\"id\", //filed for row index\r\n\r\n\ttextDirection:\"auto\",\r\n\r\n\taddRowPos:\"bottom\", //position to insert blank rows, top|bottom\r\n\r\n\theaderVisible:true, //hide header\r\n\r\n\trenderVertical:\"virtual\",\r\n\trenderHorizontal:\"basic\",\r\n\trenderVerticalBuffer:0, // set virtual DOM buffer size\r\n\r\n\tscrollToRowPosition:\"top\",\r\n\tscrollToRowIfVisible:true,\r\n\r\n\tscrollToColumnPosition:\"left\",\r\n\tscrollToColumnIfVisible:true,\r\n\r\n\trowFormatter:false,\r\n\trowFormatterPrint:null,\r\n\trowFormatterClipboard:null,\r\n\trowFormatterHtmlOutput:null,\r\n\r\n\trowHeight:null,\r\n\r\n\tplaceholder:false,\r\n\r\n\tdataLoader:true,\r\n\tdataLoaderLoading:false,\r\n\tdataLoaderError:false,\r\n\tdataLoaderErrorTimeout:3000,\r\n\r\n\tdataSendParams:{},\r\n\r\n\tdataReceiveParams:{},\r\n}\r\n","export default class CoreFeature{\r\n\r\n\tconstructor(table){\r\n\t\tthis.table = table;\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t/////////////// DataLoad /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\treloadData(data, silent, columnsChanged){\r\n\t\treturn this.table.dataLoader.load(data, undefined, undefined, undefined, silent, columnsChanged);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t///////////// Localization ///////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tlangText(){\r\n\t\treturn this.table.modules.localize.getText(...arguments);\r\n\t}\r\n\r\n\tlangBind(){\r\n\t\treturn this.table.modules.localize.bind(...arguments);\r\n\t}\r\n\r\n\tlangLocale(){\r\n\t\treturn this.table.modules.localize.getLocale(...arguments);\r\n\t}\r\n\r\n\r\n\t//////////////////////////////////////////\r\n\t////////// Inter Table Comms /////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tcommsConnections(){\r\n\t\treturn this.table.modules.comms.getConnections(...arguments);\r\n\t}\r\n\r\n\tcommsSend(){\r\n\t\treturn this.table.modules.comms.send(...arguments);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t//////////////// Layout /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tlayoutMode(){\r\n\t\treturn this.table.modules.layout.getMode();\r\n\t}\r\n\r\n\tlayoutRefresh(){\r\n\t\treturn this.table.modules.layout.layout();\r\n\t}\r\n\r\n\r\n\t//////////////////////////////////////////\r\n\t/////////////// Event Bus ////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tsubscribe(){\r\n\t\treturn this.table.eventBus.subscribe(...arguments);\r\n\t}\r\n\r\n\tunsubscribe(){\r\n\t\treturn this.table.eventBus.unsubscribe(...arguments);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.table.eventBus.subscribed(key);\r\n\t}\r\n\r\n\tsubscriptionChange(){\r\n\t\treturn this.table.eventBus.subscriptionChange(...arguments);\r\n\t}\r\n\r\n\tdispatch(){\r\n\t\treturn this.table.eventBus.dispatch(...arguments);\r\n\t}\r\n\r\n\tchain(){\r\n\t\treturn this.table.eventBus.chain(...arguments);\r\n\t}\r\n\r\n\tconfirm(){\r\n\t\treturn this.table.eventBus.confirm(...arguments);\r\n\t}\r\n\r\n\tdispatchExternal(){\r\n\t\treturn this.table.externalEvents.dispatch(...arguments);\r\n\t}\r\n\r\n\tsubscribedExternal(key){\r\n\t\treturn this.table.externalEvents.subscribed(key);\r\n\t}\r\n\r\n\tsubscriptionChangeExternal(){\r\n\t\treturn this.table.externalEvents.subscriptionChange(...arguments);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t//////////////// Options /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\toptions(key){\r\n\t\treturn this.table.options[key];\r\n\t}\r\n\r\n\tsetOption(key, value){\r\n\t\tif(typeof value !== \"undefined\"){\r\n\t\t\tthis.table.options[key] = value;\r\n\t\t}\r\n\r\n\t\treturn this.table.options[key];\r\n\t}\r\n\r\n\r\n\t//////////////////////////////////////////\r\n\t//////////////// Modules /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tmodule(key){\r\n\t\treturn this.table.module(key);\r\n\t}\r\n}","import Column from './Column.js';\r\n\r\n//public column object\r\nexport default class ColumnComponent {\r\n\tconstructor (column){\r\n\t\tthis._column = column;\r\n\t\tthis.type = \"ColumnComponent\";\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._column.table.componentFunctionBinder.handle(\"column\", target._column, name)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._column.getElement();\r\n\t}\r\n\r\n\tgetDefinition(){\r\n\t\treturn this._column.getDefinition();\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._column.getField();\r\n\t}\r\n\r\n\tgetTitleDownload() {\r\n\t\treturn this._column.getTitleDownload();\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._column.cells.forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tisVisible(){\r\n\t\treturn this._column.visible;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tif(this._column.isGroup){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\tcolumn.show();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis._column.show();\r\n\t\t}\r\n\t}\r\n\r\n\thide(){\r\n\t\tif(this._column.isGroup){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\tcolumn.hide();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis._column.hide();\r\n\t\t}\r\n\t}\r\n\r\n\ttoggle(){\r\n\t\tif(this._column.visible){\r\n\t\t\tthis.hide();\r\n\t\t}else{\r\n\t\t\tthis.show();\r\n\t\t}\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn this._column.delete();\r\n\t}\r\n\r\n\tgetSubColumns(){\r\n\t\tvar output = [];\r\n\r\n\t\tif(this._column.columns.length){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\toutput.push(column.getComponent());\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetParentColumn(){\r\n\t\treturn this._column.parent instanceof Column ? this._column.parent.getComponent() : false;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._column;\r\n\t}\r\n\r\n\tscrollTo(){\r\n\t\treturn this._column.table.columnManager.scrollToColumn(this._column);\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._column.table;\r\n\t}\r\n\r\n\tmove(to, after){\r\n\t\tvar toColumn = this._column.table.columnManager.findColumn(to);\r\n\r\n\t\tif(toColumn){\r\n\t\t\tthis._column.table.columnManager.moveColumn(this._column, toColumn, after)\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching column found:\", toColumn);\r\n\t\t}\r\n\t}\r\n\r\n\tgetNextColumn(){\r\n\t\tvar nextCol = this._column.nextColumn();\r\n\r\n\t\treturn nextCol ? nextCol.getComponent() : false;\r\n\t}\r\n\r\n\tgetPrevColumn(){\r\n\t\tvar prevCol = this._column.prevColumn();\r\n\r\n\t\treturn prevCol ? prevCol.getComponent() : false;\r\n\t}\r\n\r\n\tupdateDefinition(updates){\r\n\t\treturn this._column.updateDefinition(updates);\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\treturn this._column.getWidth();\r\n\t}\r\n\r\n\tsetWidth(width){\r\n\t\tvar result;\r\n\r\n\t\tif(width === true){\r\n\t\t\tresult = this._column.reinitializeWidth(true);\r\n\t\t}else{\r\n\t\t\tresult = this._column.setWidth(width);\r\n\t\t}\r\n\r\n\t\tthis._column.table.columnManager.renderer.rerenderColumns(true);\r\n\r\n\t\treturn result;\r\n\t}\r\n}","export default {\r\n\t\"title\": undefined,\r\n\t\"field\": undefined,\r\n\t\"columns\": undefined,\r\n\t\"visible\": undefined,\r\n\t\"hozAlign\": undefined,\r\n\t\"vertAlign\": undefined,\r\n\t\"width\": undefined,\r\n\t\"minWidth\": 40,\r\n\t\"maxWidth\": undefined,\r\n\t\"maxInitialWidth\": undefined,\r\n\t\"cssClass\": undefined,\r\n\t\"variableHeight\": undefined,\r\n\t\"headerVertical\": undefined,\r\n\t\"headerHozAlign\": undefined,\r\n\t\"editableTitle\": undefined,\r\n}","//public cell object\r\nexport default class CellComponent {\r\n\r\n\tconstructor (cell){\r\n\t\tthis._cell = cell;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._cell.table.componentFunctionBinder.handle(\"cell\", target._cell, name)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\tgetValue(){\r\n\t\treturn this._cell.getValue();\r\n\t}\r\n\r\n\tgetOldValue(){\r\n\t\treturn this._cell.getOldValue();\r\n\t}\r\n\r\n\tgetInitialValue(){\r\n\t\treturn this._cell.initialValue;\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._cell.getElement();\r\n\t}\r\n\r\n\tgetRow(){\r\n\t\treturn this._cell.row.getComponent();\r\n\t}\r\n\r\n\tgetData(){\r\n\t\treturn this._cell.row.getData();\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._cell.column.getField();\r\n\t}\r\n\r\n\tgetColumn(){\r\n\t\treturn this._cell.column.getComponent();\r\n\t}\r\n\r\n\tsetValue(value, mutate){\r\n\t\tif(typeof mutate == \"undefined\"){\r\n\t\t\tmutate = true;\r\n\t\t}\r\n\r\n\t\tthis._cell.setValue(value, mutate);\r\n\t}\r\n\r\n\trestoreOldValue(){\r\n\t\tthis._cell.setValueActual(this._cell.getOldValue());\r\n\t}\r\n\r\n\trestoreInitialValue(){\r\n\t\tthis._cell.setValueActual(this._cell.initialValue);\r\n\t}\r\n\r\n\tcheckHeight(){\r\n\t\tthis._cell.checkHeight();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._cell.table;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._cell;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport CellComponent from './CellComponent.js';\r\n\r\nexport default class Cell extends CoreFeature{\r\n\tconstructor(column, row){\r\n\t\tsuper(column.table);\r\n\r\n\t\tthis.table = column.table;\r\n\t\tthis.column = column;\r\n\t\tthis.row = row;\r\n\t\tthis.element = null;\r\n\t\tthis.value = null;\r\n\t\tthis.initialValue;\r\n\t\tthis.oldValue = null;\r\n\t\tthis.modules = {};\r\n\r\n\t\tthis.height = null;\r\n\t\tthis.width = null;\r\n\t\tthis.minWidth = null;\r\n\r\n\t\tthis.component = null;\r\n\r\n\t\tthis.loaded = false; //track if the cell has been added to the DOM yet\r\n\r\n\t\tthis.build();\r\n\t}\r\n\r\n\t//////////////// Setup Functions /////////////////\r\n\t//generate element\r\n\tbuild(){\r\n\t\tthis.generateElement();\r\n\r\n\t\tthis.setWidth();\r\n\r\n\t\tthis._configureCell();\r\n\r\n\t\tthis.setValueActual(this.column.getFieldValue(this.row.data));\r\n\r\n\t\tthis.initialValue = this.value;\r\n\t}\r\n\r\n\tgenerateElement(){\r\n\t\tthis.element = document.createElement('div');\r\n\t\tthis.element.className = \"tabulator-cell\";\r\n\t\tthis.element.setAttribute(\"role\", \"gridcell\");\r\n\t\tthis.element = this.element;\r\n\t}\r\n\r\n\t_configureCell(){\r\n\t\tvar element = this.element,\r\n\t\tfield = this.column.getField(),\r\n\t\tvertAligns = {\r\n\t\t\ttop:\"flex-start\",\r\n\t\t\tbottom:\"flex-end\",\r\n\t\t\tmiddle:\"center\",\r\n\t\t},\r\n\t\thozAligns = {\r\n\t\t\tleft:\"flex-start\",\r\n\t\t\tright:\"flex-end\",\r\n\t\t\tcenter:\"center\",\r\n\t\t};\r\n\r\n\t\t//set text alignment\r\n\t\telement.style.textAlign = this.column.hozAlign;\r\n\r\n\t\tif(this.column.vertAlign){\r\n\t\t\telement.style.display = \"inline-flex\";\r\n\r\n\t\t\telement.style.alignItems = vertAligns[this.column.vertAlign] || \"\";\r\n\r\n\t\t\tif(this.column.hozAlign){\r\n\t\t\t\telement.style.justifyContent = hozAligns[this.column.hozAlign] || \"\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(field){\r\n\t\t\telement.setAttribute(\"tabulator-field\", field);\r\n\t\t}\r\n\r\n\t\t//add class to cell if needed\r\n\t\tif(this.column.definition.cssClass){\r\n\t\t\tvar classNames = this.column.definition.cssClass.split(\" \")\r\n\t\t\tclassNames.forEach((className) => {\r\n\t\t\t\telement.classList.add(className)\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"cell-init\", this);\r\n\r\n\t\t//hide cell if not visible\r\n\t\tif(!this.column.visible){\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\t//generate cell contents\r\n\t_generateContents(){\r\n\t\tvar val;\r\n\r\n\t\tval = this.chain(\"cell-format\", this, null, () => {\r\n\t\t\treturn this.element.innerHTML = this.value;\r\n\t\t});\r\n\r\n\t\tswitch(typeof val){\r\n\t\t\tcase \"object\":\r\n\t\t\tif(val instanceof Node){\r\n\r\n\t\t\t\t//clear previous cell contents\r\n\t\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\r\n\t\t\t\tthis.element.appendChild(val);\r\n\t\t\t}else{\r\n\t\t\t\tthis.element.innerHTML = \"\";\r\n\r\n\t\t\t\tif(val != null){\r\n\t\t\t\t\tconsole.warn(\"Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:\", val);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\tcase \"undefined\":\r\n\t\t\tcase \"null\":\r\n\t\t\tthis.element.innerHTML = \"\";\r\n\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\tthis.element.innerHTML = val;\r\n\t\t}\r\n\t}\r\n\r\n\tcellRendered(){\r\n\t\tthis.dispatch(\"cell-rendered\", this);\r\n\t}\r\n\r\n\t//////////////////// Getters ////////////////////\r\n\tgetElement(containerOnly){\r\n\t\tif(!this.loaded){\r\n\t\t\tthis.loaded = true;\r\n\t\t\tif(!containerOnly){\r\n\t\t\t\tthis.layoutElement();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\tgetValue(){\r\n\t\treturn this.value;\r\n\t}\r\n\r\n\tgetOldValue(){\r\n\t\treturn this.oldValue;\r\n\t}\r\n\r\n\t//////////////////// Actions ////////////////////\r\n\tsetValue(value, mutate, force){\r\n\t\tvar changed = this.setValueProcessData(value, mutate, force);\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.dispatch(\"cell-value-updated\", this);\r\n\r\n\t\t\tthis.cellRendered();\r\n\r\n\t\t\tif(this.column.definition.cellEdited){\r\n\t\t\t\tthis.column.definition.cellEdited.call(this.table, this.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"cellEdited\", this.getComponent());\r\n\r\n\t\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tsetValueProcessData(value, mutate, force){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(this.value !== value || force){\r\n\r\n\t\t\tchanged = true;\r\n\r\n\t\t\tif(mutate){\r\n\t\t\t\tvalue = this.chain(\"cell-value-changing\", [this, value], null, value);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.setValueActual(value);\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.dispatch(\"cell-value-changed\", this);\r\n\t\t}\r\n\r\n\t\treturn changed;\r\n\t}\r\n\r\n\tsetValueActual(value){\r\n\t\tthis.oldValue = this.value;\r\n\r\n\t\tthis.value = value;\r\n\r\n\t\tthis.dispatch(\"cell-value-save-before\", this);\r\n\r\n\t\tthis.column.setFieldValue(this.row.data, value);\r\n\r\n\t\tthis.dispatch(\"cell-value-save-after\", this);\r\n\r\n\t\tif(this.loaded){\r\n\t\t\tthis.layoutElement();\r\n\t\t}\r\n\t}\r\n\r\n\tlayoutElement(){\r\n\t\tthis._generateContents();\r\n\r\n\t\tthis.dispatch(\"cell-layout\", this);\r\n\t}\r\n\r\n\tsetWidth(){\r\n\t\tthis.width = this.column.width;\r\n\t\tthis.element.style.width = this.column.widthStyled;\r\n\t}\r\n\r\n\tclearWidth(){\r\n\t\tthis.width = \"\";\r\n\t\tthis.element.style.width = \"\";\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\treturn this.width || this.element.offsetWidth;\r\n\t}\r\n\r\n\tsetMinWidth(){\r\n\t\tthis.minWidth = this.column.minWidth;\r\n\t\tthis.element.style.minWidth = this.column.minWidthStyled;\r\n\t}\r\n\r\n\tsetMaxWidth(){\r\n\t\tthis.maxWidth = this.column.maxWidth;\r\n\t\tthis.element.style.maxWidth = this.column.maxWidthStyled;\r\n\t}\r\n\r\n\tcheckHeight(){\r\n\t\t// var height = this.element.css(\"height\");\r\n\t\tthis.row.reinitializeHeight();\r\n\t}\r\n\r\n\tclearHeight(){\r\n\t\tthis.element.style.height = \"\";\r\n\t\tthis.height = null;\r\n\r\n\t\tthis.dispatch(\"cell-height\", this, \"\");\r\n\t}\r\n\r\n\tsetHeight(){\r\n\t\tthis.height = this.row.height;\r\n\t\tthis.element.style.height = this.row.heightStyled;\r\n\r\n\t\tthis.dispatch(\"cell-height\", this, this.row.heightStyled);\r\n\t}\r\n\r\n\tgetHeight(){\r\n\t\treturn this.height || this.element.offsetHeight;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tthis.element.style.display = this.column.vertAlign ? \"inline-flex\" : \"\";\r\n\t}\r\n\r\n\thide(){\r\n\t\tthis.element.style.display = \"none\";\r\n\t}\r\n\r\n\tdelete(){\r\n\t\tthis.dispatch(\"cell-delete\", this);\r\n\r\n\t\tif(!this.table.rowManager.redrawBlock && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\r\n\t\tthis.element = false;\r\n\t\tthis.column.deleteCell(this);\r\n\t\tthis.row.deleteCell(this);\r\n\t\tthis.calcs = {};\r\n\t}\r\n\r\n\tgetIndex(){\r\n\t\treturn this.row.getCellIndex(this);\r\n\t}\r\n\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new CellComponent(this);\r\n\t\t}\r\n\r\n\t\treturn this.component;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport ColumnComponent from './ColumnComponent.js';\r\nimport defaultOptions from './defaults/options.js';\r\n\r\nimport Cell from '../cell/Cell.js';\r\n\r\nclass Column extends CoreFeature{\r\n\r\n\tconstructor(def, parent){\r\n\t\tsuper(parent.table);\r\n\r\n\t\tthis.definition = def; //column definition\r\n\t\tthis.parent = parent; //hold parent object\r\n\t\tthis.type = \"column\"; //type of element\r\n\t\tthis.columns = []; //child columns\r\n\t\tthis.cells = []; //cells bound to this column\r\n\t\tthis.element = this.createElement(); //column header element\r\n\t\tthis.contentElement = false;\r\n\t\tthis.titleHolderElement = false;\r\n\t\tthis.titleElement = false;\r\n\t\tthis.groupElement = this.createGroupElement(); //column group holder element\r\n\t\tthis.isGroup = false;\r\n\t\tthis.hozAlign = \"\"; //horizontal text alignment\r\n\t\tthis.vertAlign = \"\"; //vert text alignment\r\n\r\n\t\t//multi dimensional filed handling\r\n\t\tthis.field =\"\";\r\n\t\tthis.fieldStructure = \"\";\r\n\t\tthis.getFieldValue = \"\";\r\n\t\tthis.setFieldValue = \"\";\r\n\r\n\t\tthis.titleDownload = null;\r\n\t\tthis.titleFormatterRendered = false;\r\n\r\n\t\tthis.mapDefinitions();\r\n\r\n\t\tthis.setField(this.definition.field);\r\n\r\n\t\tthis.modules = {}; //hold module variables;\r\n\r\n\t\tthis.width = null; //column width\r\n\t\tthis.widthStyled = \"\"; //column width prestyled to improve render efficiency\r\n\t\tthis.maxWidth = null; //column maximum width\r\n\t\tthis.maxWidthStyled = \"\"; //column maximum prestyled to improve render efficiency\r\n\t\tthis.maxInitialWidth = null;\r\n\t\tthis.minWidth = null; //column minimum width\r\n\t\tthis.minWidthStyled = \"\"; //column minimum prestyled to improve render efficiency\r\n\t\tthis.widthFixed = false; //user has specified a width for this column\r\n\r\n\t\tthis.visible = true; //default visible state\r\n\r\n\t\tthis.component = null;\r\n\r\n\t\t//initialize column\r\n\t\tif(this.definition.columns){\r\n\r\n\t\t\tthis.isGroup = true;\r\n\r\n\t\t\tthis.definition.columns.forEach((def, i) => {\r\n\t\t\t\tvar newCol = new Column(def, this);\r\n\t\t\t\tthis.attachColumn(newCol);\r\n\t\t\t});\r\n\r\n\t\t\tthis.checkColumnVisibility();\r\n\t\t}else{\r\n\t\t\tparent.registerColumnField(this);\r\n\t\t}\r\n\r\n\t\tthis._initialize();\r\n\r\n\t\tthis.bindModuleColumns();\r\n\t}\r\n\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-col\");\r\n\t\tel.setAttribute(\"role\", \"columnheader\");\r\n\t\tel.setAttribute(\"aria-sort\", \"none\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tcreateGroupElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-col-group-cols\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tmapDefinitions(){\r\n\t\tvar defaults = this.table.options.columnDefaults;\r\n\r\n\t\t//map columnDefaults onto column definitions\r\n\t\tif(defaults){\r\n\t\t\tfor(let key in defaults){\r\n\t\t\t\tif(typeof this.definition[key] === \"undefined\"){\r\n\t\t\t\t\tthis.definition[key] = defaults[key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.definition = this.table.columnManager.optionsList.generate(Column.defaultOptionList, this.definition)\r\n\t}\r\n\r\n\tcheckDefinition(){\r\n\t\tObject.keys(this.definition).forEach((key) => {\r\n\t\t\tif(Column.defaultOptionList.indexOf(key) === -1){\r\n\t\t\t\tconsole.warn(\"Invalid column definition option in '\" + (this.field || this.definition.title) + \"' column:\", key)\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tsetField(field){\r\n\t\tthis.field = field;\r\n\t\tthis.fieldStructure = field ? (this.table.options.nestedFieldSeparator ? field.split(this.table.options.nestedFieldSeparator) : [field]) : [];\r\n\t\tthis.getFieldValue = this.fieldStructure.length > 1 ? this._getNestedData : this._getFlatData;\r\n\t\tthis.setFieldValue = this.fieldStructure.length > 1 ? this._setNestedData : this._setFlatData;\r\n\t}\r\n\r\n\t//register column position with column manager\r\n\tregisterColumnPosition(column){\r\n\t\tthis.parent.registerColumnPosition(column);\r\n\t}\r\n\r\n\t//register column position with column manager\r\n\tregisterColumnField(column){\r\n\t\tthis.parent.registerColumnField(column);\r\n\t}\r\n\r\n\t//trigger position registration\r\n\treRegisterPosition(){\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tcolumn.reRegisterPosition();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.registerColumnPosition(this);\r\n\t\t}\r\n\t}\r\n\r\n\t_mapDepricatedFunctionality(){\r\n\t\t//all previously deprecated functionality removed in the 5.0 release\r\n\t}\r\n\r\n\t//build header element\r\n\t_initialize(){\r\n\t\tvar def = this.definition;\r\n\r\n\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\r\n\t\tif(def.headerVertical){\r\n\t\t\tthis.element.classList.add(\"tabulator-col-vertical\");\r\n\r\n\t\t\tif(def.headerVertical === \"flip\"){\r\n\t\t\t\tthis.element.classList.add(\"tabulator-col-vertical-flip\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.contentElement = this._bindEvents();\r\n\r\n\t\tthis.contentElement = this._buildColumnHeaderContent();\r\n\r\n\t\tthis.element.appendChild(this.contentElement);\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis._buildGroupHeader();\r\n\t\t}else{\r\n\t\t\tthis._buildColumnHeader();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-init\", this);\r\n\t}\r\n\r\n\t_bindEvents(){\r\n\t\tvar def = this.definition,\r\n\t\tdblTap,\ttapHold, tap;\r\n\r\n\t\t//setup header click event bindings\r\n\t\tif(typeof(def.headerClick) == \"function\"){\r\n\t\t\tthis.element.addEventListener(\"click\", (e) => {def.headerClick(e, this.getComponent());});\r\n\t\t}\r\n\r\n\t\tif(typeof(def.headerDblClick) == \"function\"){\r\n\t\t\tthis.element.addEventListener(\"dblclick\", (e) => {def.headerDblClick(e, this.getComponent());});\r\n\t\t}\r\n\r\n\t\tif(typeof(def.headerContext) == \"function\"){\r\n\t\t\tthis.element.addEventListener(\"contextmenu\", (e) => {def.headerContext(e, this.getComponent());});\r\n\t\t}\r\n\r\n\t\t//setup header tap event bindings\r\n\t\tif(typeof(def.headerTap) == \"function\"){\r\n\t\t\ttap = false;\r\n\r\n\t\t\tthis.element.addEventListener(\"touchstart\", (e) => {\r\n\t\t\t\ttap = true;\r\n\t\t\t}, {passive: true});\r\n\r\n\t\t\tthis.element.addEventListener(\"touchend\", (e) => {\r\n\t\t\t\tif(tap){\r\n\t\t\t\t\tdef.headerTap(e, this.getComponent());\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttap = false;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(typeof(def.headerDblTap) == \"function\"){\r\n\t\t\tdblTap = null;\r\n\r\n\t\t\tthis.element.addEventListener(\"touchend\", (e) => {\r\n\r\n\t\t\t\tif(dblTap){\r\n\t\t\t\t\tclearTimeout(dblTap);\r\n\t\t\t\t\tdblTap = null;\r\n\r\n\t\t\t\t\tdef.headerDblTap(e, this.getComponent());\r\n\t\t\t\t}else{\r\n\r\n\t\t\t\t\tdblTap = setTimeout(() => {\r\n\t\t\t\t\t\tclearTimeout(dblTap);\r\n\t\t\t\t\t\tdblTap = null;\r\n\t\t\t\t\t}, 300);\r\n\t\t\t\t}\r\n\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(typeof(def.headerTapHold) == \"function\"){\r\n\t\t\ttapHold = null;\r\n\r\n\t\t\tthis.element.addEventListener(\"touchstart\", (e) => {\r\n\t\t\t\tclearTimeout(tapHold);\r\n\r\n\t\t\t\ttapHold = setTimeout(function(){\r\n\t\t\t\t\tclearTimeout(tapHold);\r\n\t\t\t\t\ttapHold = null;\r\n\t\t\t\t\ttap = false;\r\n\t\t\t\t\tdef.headerTapHold(e, this.getComponent());\r\n\t\t\t\t}, 1000);\r\n\r\n\t\t\t}, {passive: true});\r\n\r\n\t\t\tthis.element.addEventListener(\"touchend\", (e) => {\r\n\t\t\t\tclearTimeout(tapHold);\r\n\t\t\t\ttapHold = null;\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t//build header element for header\r\n\t_buildColumnHeader(){\r\n\t\tvar def = this.definition,\r\n\t\ttable = this.table;\r\n\r\n\t\tthis.dispatch(\"column-layout\", this);\r\n\r\n\t\t//set column visibility\r\n\t\tif(typeof def.visible != \"undefined\"){\r\n\t\t\tif(def.visible){\r\n\t\t\t\tthis.show(true);\r\n\t\t\t}else{\r\n\t\t\t\tthis.hide(true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//asign additional css classes to column header\r\n\t\tif(def.cssClass){\r\n\t\t\tvar classeNames = def.cssClass.split(\" \");\r\n\t\t\tclasseNames.forEach((className) => {\r\n\t\t\t\tthis.element.classList.add(className);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(def.field){\r\n\t\t\tthis.element.setAttribute(\"tabulator-field\", def.field);\r\n\t\t}\r\n\r\n\t\t//set min width if present\r\n\t\tthis.setMinWidth(parseInt(def.minWidth));\r\n\r\n\t\tif (def.maxInitialWidth) {\r\n\t\t\tthis.maxInitialWidth = parseInt(def.maxInitialWidth);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.maxWidth){\r\n\t\t\tthis.setMaxWidth(parseInt(def.maxWidth));\r\n\t\t}\r\n\r\n\t\tthis.reinitializeWidth();\r\n\r\n\t\t//set orizontal text alignment\r\n\t\tthis.hozAlign = this.definition.hozAlign;\r\n\t\tthis.vertAlign = this.definition.vertAlign;\r\n\r\n\t\tthis.titleElement.style.textAlign = this.definition.headerHozAlign;\r\n\t}\r\n\r\n\t_buildColumnHeaderContent(){\r\n\t\tvar def = this.definition,\r\n\t\ttable = this.table;\r\n\r\n\t\tvar contentElement = document.createElement(\"div\");\r\n\t\tcontentElement.classList.add(\"tabulator-col-content\");\r\n\r\n\t\tthis.titleHolderElement = document.createElement(\"div\");\r\n\t\tthis.titleHolderElement.classList.add(\"tabulator-col-title-holder\");\r\n\r\n\t\tcontentElement.appendChild(this.titleHolderElement);\r\n\r\n\t\tthis.titleElement = this._buildColumnHeaderTitle();\r\n\r\n\t\tthis.titleHolderElement.appendChild(this.titleElement);\r\n\r\n\t\treturn contentElement;\r\n\t}\r\n\r\n\t//build title element of column\r\n\t_buildColumnHeaderTitle(){\r\n\t\tvar def = this.definition,\r\n\t\ttitle;\r\n\r\n\t\tvar titleHolderElement = document.createElement(\"div\");\r\n\t\ttitleHolderElement.classList.add(\"tabulator-col-title\");\r\n\r\n\t\tif(def.editableTitle){\r\n\t\t\tvar titleElement = document.createElement(\"input\");\r\n\t\t\ttitleElement.classList.add(\"tabulator-title-editor\");\r\n\r\n\t\t\ttitleElement.addEventListener(\"click\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\ttitleElement.focus();\r\n\t\t\t});\r\n\r\n\t\t\ttitleElement.addEventListener(\"change\", () => {\r\n\t\t\t\tdef.title = titleElement.value;\r\n\t\t\t\tthis.dispatchExternal(\"columnTitleChanged\", this.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\ttitleHolderElement.appendChild(titleElement);\r\n\r\n\t\t\tif(def.field){\r\n\t\t\t\tthis.langBind(\"columns|\" + def.field, (text) => {\r\n\t\t\t\t\ttitleElement.value = text || (def.title || \" \");\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\ttitleElement.value = def.title || \" \";\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tif(def.field){\r\n\t\t\t\tthis.langBind(\"columns|\" + def.field, (text) => {\r\n\t\t\t\t\tthis._formatColumnHeaderTitle(titleHolderElement, text || (def.title || \" \"));\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tthis._formatColumnHeaderTitle(titleHolderElement, def.title || \" \");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn titleHolderElement;\r\n\t}\r\n\r\n\t_formatColumnHeaderTitle(el, title){\r\n\t\tvar contents = this.chain(\"column-format\", [this, title, el], null, () => {\r\n\t\t\treturn title;\r\n\t\t});\r\n\r\n\t\tswitch(typeof contents){\r\n\t\t\tcase \"object\":\r\n\t\t\tif(contents instanceof Node){\r\n\t\t\t\tel.appendChild(contents);\r\n\t\t\t}else{\r\n\t\t\t\tel.innerHTML = \"\";\r\n\t\t\t\tconsole.warn(\"Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:\", contents);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\tcase \"undefined\":\r\n\t\t\tcase \"null\":\r\n\t\t\tel.innerHTML = \"\";\r\n\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\tel.innerHTML = contents;\r\n\t\t}\r\n\t}\r\n\r\n\t//build header element for column group\r\n\t_buildGroupHeader(){\r\n\t\tthis.element.classList.add(\"tabulator-col-group\");\r\n\t\tthis.element.setAttribute(\"role\", \"columngroup\");\r\n\t\tthis.element.setAttribute(\"aria-title\", this.definition.title);\r\n\r\n\t\t//asign additional css classes to column header\r\n\t\tif(this.definition.cssClass){\r\n\t\t\tvar classeNames = this.definition.cssClass.split(\" \");\r\n\t\t\tclasseNames.forEach((className) => {\r\n\t\t\t\tthis.element.classList.add(className);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.titleElement.style.textAlign = this.definition.headerHozAlign;\r\n\r\n\t\tthis.element.appendChild(this.groupElement);\r\n\t}\r\n\r\n\t//flat field lookup\r\n\t_getFlatData(data){\r\n\t\treturn data[this.field];\r\n\t}\r\n\r\n\t//nested field lookup\r\n\t_getNestedData(data){\r\n\t\tvar dataObj = data,\r\n\t\tstructure = this.fieldStructure,\r\n\t\tlength = structure.length,\r\n\t\toutput;\r\n\r\n\t\tfor(let i = 0; i < length; i++){\r\n\r\n\t\t\tdataObj = dataObj[structure[i]];\r\n\r\n\t\t\toutput = dataObj;\r\n\r\n\t\t\tif(!dataObj){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//flat field set\r\n\t_setFlatData(data, value){\r\n\t\tif(this.field){\r\n\t\t\tdata[this.field] = value;\r\n\t\t}\r\n\t}\r\n\r\n\t//nested field set\r\n\t_setNestedData(data, value){\r\n\t\tvar dataObj = data,\r\n\t\tstructure = this.fieldStructure,\r\n\t\tlength = structure.length;\r\n\r\n\t\tfor(let i = 0; i < length; i++){\r\n\r\n\t\t\tif(i == length -1){\r\n\t\t\t\tdataObj[structure[i]] = value;\r\n\t\t\t}else{\r\n\t\t\t\tif(!dataObj[structure[i]]){\r\n\t\t\t\t\tif(typeof value !== \"undefined\"){\r\n\t\t\t\t\t\tdataObj[structure[i]] = {};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdataObj = dataObj[structure[i]];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//attach column to this group\r\n\tattachColumn(column){\r\n\t\tif(this.groupElement){\r\n\t\t\tthis.columns.push(column);\r\n\t\t\tthis.groupElement.appendChild(column.getElement());\r\n\r\n\t\t\tcolumn.columnRendered();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Warning - Column being attached to another column instead of column group\");\r\n\t\t}\r\n\t}\r\n\r\n\t//vertically align header in column\r\n\tverticalAlign(alignment, height){\r\n\r\n\t\t//calculate height of column header and group holder element\r\n\t\tvar parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : (height || this.parent.getHeadersElement().clientHeight);\r\n\t\t// var parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : this.parent.getHeadersElement().clientHeight;\r\n\r\n\t\tthis.element.style.height = parentHeight + \"px\";\r\n\r\n\t\tthis.dispatch(\"column-height\", this, this.element.style.height);\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.groupElement.style.minHeight = (parentHeight - this.contentElement.offsetHeight) + \"px\";\r\n\t\t}\r\n\r\n\t\t//vertically align cell contents\r\n\t\tif(!this.isGroup && alignment !== \"top\"){\r\n\t\t\tif(alignment === \"bottom\"){\r\n\t\t\t\tthis.element.style.paddingTop = (this.element.clientHeight - this.contentElement.offsetHeight) + \"px\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.element.style.paddingTop = ((this.element.clientHeight - this.contentElement.offsetHeight) / 2) + \"px\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.verticalAlign(alignment);\r\n\t\t});\r\n\t}\r\n\r\n\t//clear vertical alignmenet\r\n\tclearVerticalAlign(){\r\n\t\tthis.element.style.paddingTop = \"\";\r\n\t\tthis.element.style.height = \"\";\r\n\t\tthis.element.style.minHeight = \"\";\r\n\t\tthis.groupElement.style.minHeight = \"\";\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.clearVerticalAlign();\r\n\t\t});\r\n\r\n\t\tthis.dispatch(\"column-height\", this, \"\");\r\n\t}\r\n\r\n\tbindModuleColumns (){\r\n\t\t//check if rownum formatter is being used on a column\r\n\t\tif(this.definition.formatter == \"rownum\"){\r\n\t\t\tthis.table.rowManager.rowNumColumn = this;\r\n\t\t}\r\n\t}\r\n\r\n\t//// Retreive Column Information ////\r\n\t//return column header element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\t//return colunm group element\r\n\tgetGroupElement(){\r\n\t\treturn this.groupElement;\r\n\t}\r\n\r\n\t//return field name\r\n\tgetField(){\r\n\t\treturn this.field;\r\n\t}\r\n\r\n\tgetTitleDownload() {\r\n\t\treturn this.titleDownload;\r\n\t}\r\n\r\n\t//return the first column in a group\r\n\tgetFirstColumn(){\r\n\t\tif(!this.isGroup){\r\n\t\t\treturn this;\r\n\t\t}else{\r\n\t\t\tif(this.columns.length){\r\n\t\t\t\treturn this.columns[0].getFirstColumn();\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//return the last column in a group\r\n\tgetLastColumn(){\r\n\t\tif(!this.isGroup){\r\n\t\t\treturn this;\r\n\t\t}else{\r\n\t\t\tif(this.columns.length){\r\n\t\t\t\treturn this.columns[this.columns.length -1].getLastColumn();\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//return all columns in a group\r\n\tgetColumns(){\r\n\t\treturn this.columns;\r\n\t}\r\n\r\n\t//return all columns in a group\r\n\tgetCells(){\r\n\t\treturn this.cells;\r\n\t}\r\n\r\n\t//retreive the top column in a group of columns\r\n\tgetTopColumn(){\r\n\t\tif(this.parent.isGroup){\r\n\t\t\treturn this.parent.getTopColumn();\r\n\t\t}else{\r\n\t\t\treturn this;\r\n\t\t}\r\n\t}\r\n\r\n\t//return column definition object\r\n\tgetDefinition(updateBranches){\r\n\t\tvar colDefs = [];\r\n\r\n\t\tif(this.isGroup && updateBranches){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tcolDefs.push(column.getDefinition(true));\r\n\t\t\t});\r\n\r\n\t\t\tthis.definition.columns = colDefs;\r\n\t\t}\r\n\r\n\t\treturn this.definition;\r\n\t}\r\n\r\n\t//////////////////// Actions ////////////////////\r\n\tcheckColumnVisibility(){\r\n\t\tvar visible = false;\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvisible = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(visible){\r\n\t\t\tthis.show();\r\n\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), false);\r\n\t\t}else{\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\t//show column\r\n\tshow(silent, responsiveToggle){\r\n\t\tif(!this.visible){\r\n\t\t\tthis.visible = true;\r\n\r\n\t\t\tthis.element.style.display = \"\";\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.checkColumnVisibility();\r\n\t\t\t}\r\n\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.show();\r\n\t\t\t});\r\n\r\n\t\t\tif(!this.isGroup && this.width === null){\r\n\t\t\t\tthis.reinitializeWidth();\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.columnManager.verticalAlignHeaders();\r\n\r\n\t\t\tthis.dispatch(\"column-show\", this, responsiveToggle);\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), true);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\r\n\t\t\tif(!this.silent){\r\n\t\t\t\tthis.table.columnManager.renderer.rerenderColumns();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//hide column\r\n\thide(silent, responsiveToggle){\r\n\t\tif(this.visible){\r\n\t\t\tthis.visible = false;\r\n\r\n\t\t\tthis.element.style.display = \"none\";\r\n\r\n\t\t\tthis.table.columnManager.verticalAlignHeaders();\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.checkColumnVisibility();\r\n\t\t\t}\r\n\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.hide();\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatch(\"column-hide\", this, responsiveToggle);\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), false);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\r\n\t\t\tif(!this.silent){\r\n\t\t\t\tthis.table.columnManager.renderer.rerenderColumns();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmatchChildWidths(){\r\n\t\tvar childWidth = 0;\r\n\r\n\t\tif(this.contentElement && this.columns.length){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tif(column.visible){\r\n\t\t\t\t\tchildWidth += column.getWidth();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.contentElement.style.maxWidth = (childWidth - 1) + \"px\";\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tremoveChild(child){\r\n\t\tvar index = this.columns.indexOf(child);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.columns.splice(index, 1);\r\n\t\t}\r\n\r\n\t\tif(!this.columns.length){\r\n\t\t\tthis.delete();\r\n\t\t}\r\n\t}\r\n\r\n\tsetWidth(width){\r\n\t\tthis.widthFixed = true;\r\n\t\tthis.setWidthActual(width);\r\n\t}\r\n\r\n\tsetWidthActual(width){\r\n\t\tif(isNaN(width)){\r\n\t\t\twidth = Math.floor((this.table.element.clientWidth/100) * parseInt(width));\r\n\t\t}\r\n\r\n\t\twidth = Math.max(this.minWidth, width);\r\n\r\n\t\tif(this.maxWidth){\r\n\t\t\twidth = Math.min(this.maxWidth, width);\r\n\t\t}\r\n\r\n\t\tthis.width = width;\r\n\t\tthis.widthStyled = width ? width + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.width = this.widthStyled;\r\n\r\n\t\tif(!this.isGroup){\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.setWidth();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.parent.isGroup){\r\n\t\t\tthis.parent.matchChildWidths();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-width\", this);\r\n\t}\r\n\r\n\tcheckCellHeights(){\r\n\t\tvar rows = [];\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tif(cell.row.heightInitialized){\r\n\t\t\t\tif(cell.row.getElement().offsetParent !== null){\r\n\t\t\t\t\trows.push(cell.row);\r\n\t\t\t\t\tcell.row.clearCellHeight();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcell.row.heightInitialized = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\trow.calcHeight();\r\n\t\t});\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\trow.setCellHeight();\r\n\t\t});\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\tvar width = 0;\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tif(column.visible){\r\n\t\t\t\t\twidth += column.getWidth();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\twidth = this.width;\r\n\t\t}\r\n\r\n\t\treturn width;\r\n\t}\r\n\r\n\tgetHeight(){\r\n\t\treturn Math.ceil(this.element.getBoundingClientRect().height);\r\n\t}\r\n\r\n\tsetMinWidth(minWidth){\r\n\t\tthis.minWidth = minWidth;\r\n\t\tthis.minWidthStyled = minWidth ? minWidth + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.minWidth = this.minWidthStyled;\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setMinWidth();\r\n\t\t});\r\n\t}\r\n\r\n\tsetMaxWidth(maxWidth){\r\n\t\tthis.maxWidth = maxWidth;\r\n\t\tthis.maxWidthStyled = maxWidth ? maxWidth + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.maxWidth = this.maxWidthStyled;\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setMaxWidth();\r\n\t\t});\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar index;\r\n\r\n\t\t\tif(this.isGroup){\r\n\t\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\t\tcolumn.delete();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatch(\"column-delete\", this);\r\n\r\n\t\t\tvar cellCount = this.cells.length;\r\n\r\n\t\t\tfor(let i = 0; i < cellCount; i++){\r\n\t\t\t\tthis.cells[0].delete();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.element.parentNode){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element = false;\r\n\t\t\tthis.contentElement = false;\r\n\t\t\tthis.titleElement = false;\r\n\t\t\tthis.groupElement = false;\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.removeChild(this);\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.columnManager.deregisterColumn(this);\r\n\r\n\t\t\tthis.table.columnManager.renderer.rerenderColumns(true);\r\n\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\r\n\tcolumnRendered(){\r\n\t\tif(this.titleFormatterRendered){\r\n\t\t\tthis.titleFormatterRendered();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-rendered\", this);\r\n\t}\r\n\r\n\t//////////////// Cell Management /////////////////\r\n\t//generate cell for this column\r\n\tgenerateCell(row){\r\n\t\tvar cell = new Cell(this, row);\r\n\r\n\t\tthis.cells.push(cell);\r\n\r\n\t\treturn cell;\r\n\t}\r\n\r\n\tnextColumn(){\r\n\t\tvar index = this.table.columnManager.findColumnIndex(this);\r\n\t\treturn index > -1 ? this._nextVisibleColumn(index + 1) : false;\r\n\t}\r\n\r\n\t_nextVisibleColumn(index){\r\n\t\tvar column = this.table.columnManager.getColumnByIndex(index);\r\n\t\treturn !column || column.visible ? column : this._nextVisibleColumn(index + 1);\r\n\t}\r\n\r\n\tprevColumn(){\r\n\t\tvar index = this.table.columnManager.findColumnIndex(this);\r\n\t\treturn index > -1 ? this._prevVisibleColumn(index - 1) : false;\r\n\t}\r\n\r\n\t_prevVisibleColumn(index){\r\n\t\tvar column = this.table.columnManager.getColumnByIndex(index);\r\n\t\treturn !column || column.visible ? column : this._prevVisibleColumn(index - 1);\r\n\t}\r\n\r\n\treinitializeWidth(force){\r\n\t\tthis.widthFixed = false;\r\n\r\n\t\t//set width if present\r\n\t\tif(typeof this.definition.width !== \"undefined\" && !force){\r\n\t\t\t// maxInitialWidth ignored here as width specified\r\n\t\t\tthis.setWidth(this.definition.width);\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-width-fit-before\", this);\r\n\r\n\t\tthis.fitToData(force);\r\n\r\n\t\tthis.dispatch(\"column-width-fit-after\", this);\r\n\t}\r\n\r\n\t//set column width to maximum cell width for non group columns\r\n\tfitToData(force){\r\n\t\tif(this.isGroup){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(!this.widthFixed){\r\n\t\t\tthis.element.style.width = \"\";\r\n\r\n\t\t\tthis.cells.forEach((cell) => {\r\n\t\t\t\tcell.clearWidth();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tvar maxWidth = this.element.offsetWidth;\r\n\r\n\t\tif(!this.width || !this.widthFixed){\r\n\t\t\tthis.cells.forEach((cell) => {\r\n\t\t\t\tvar width = cell.getWidth();\r\n\r\n\t\t\t\tif(width > maxWidth){\r\n\t\t\t\t\tmaxWidth = width;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(maxWidth){\r\n\t\t\t\tvar setTo = maxWidth + 1;\r\n\t\t\t\tif (this.maxInitialWidth && !force) {\r\n\t\t\t\t\tsetTo = Math.min(setTo, this.maxInitialWidth);\r\n\t\t\t\t}\r\n\t\t\t\tthis.setWidthActual(setTo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdateDefinition(updates){\r\n\t\tvar definition;\r\n\r\n\t\tif(!this.isGroup){\r\n\t\t\tif(!this.parent.isGroup){\r\n\t\t\t\tdefinition = Object.assign({}, this.getDefinition());\r\n\t\t\t\tdefinition = Object.assign(definition, updates);\r\n\r\n\t\t\t\treturn this.table.columnManager.addColumn(definition, false, this)\r\n\t\t\t\t.then((column) => {\r\n\r\n\t\t\t\t\tif(definition.field == this.field){\r\n\t\t\t\t\t\tthis.field = false; //cleair field name to prevent deletion of duplicate column from arrays\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn this.delete()\r\n\t\t\t\t\t.then(() => {\r\n\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Column Update Error - The updateDefinition function is only available on ungrouped columns\");\r\n\t\t\t\treturn Promise.reject(\"Column Update Error - The updateDefinition function is only available on columns, not column groups\");\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Column Update Error - The updateDefinition function is only available on ungrouped columns\");\r\n\t\t\treturn Promise.reject(\"Column Update Error - The updateDefinition function is only available on columns, not column groups\");\r\n\t\t}\r\n\t}\r\n\r\n\tdeleteCell(cell){\r\n\t\tvar index = this.cells.indexOf(cell);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.cells.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new ColumnComponent(this);\r\n\t\t}\r\n\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n\r\nColumn.defaultOptionList = defaultOptions;\r\n\r\nexport default Column;","export default class Helpers{\r\n\r\n\tstatic elVisible(el){\r\n\t\treturn !(el.offsetWidth <= 0 && el.offsetHeight <= 0);\r\n\t}\r\n\r\n\tstatic elOffset(el){\r\n\t\tvar box = el.getBoundingClientRect();\r\n\r\n\t\treturn {\r\n\t\t\ttop: box.top + window.pageYOffset - document.documentElement.clientTop,\r\n\t\t\tleft: box.left + window.pageXOffset - document.documentElement.clientLeft\r\n\t\t};\r\n\t}\r\n\r\n\tstatic deepClone(obj, clone, list = []){\r\n\t\tvar objectProto = {}.__proto__,\r\n\t\tarrayProto = [].__proto__;\r\n\r\n\t\tif (!clone){\r\n\t\t\tclone = Object.assign(Array.isArray(obj) ? [] : {}, obj);\r\n\t\t}\r\n\r\n\t\tfor(var i in obj) {\r\n\t\t\tlet subject = obj[i],\r\n\t\t\tmatch, copy;\r\n\r\n\t\t\tif(subject != null && typeof subject === \"object\" && (subject.__proto__ === objectProto || subject.__proto__ === arrayProto)){\r\n\t\t\t\tmatch = list.findIndex((item) => {\r\n\t\t\t\t\treturn item.subject === subject;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(match > -1){\r\n\t\t\t\t\tclone[i] = list[match].copy;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcopy = Object.assign(Array.isArray(subject) ? [] : {}, subject);\r\n\r\n\t\t\t\t\tlist.unshift({subject, copy});\r\n\r\n\t\t\t\t\tclone[i] = this.deepClone(subject, copy, list);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn clone;\r\n\t}\r\n}","export default class OptionsList {\r\n\tconstructor(table, msgType, defaults = {}){\r\n\t\tthis.table = table;\r\n\t\tthis.msgType = msgType;\r\n\t\tthis.registeredDefaults = Object.assign({}, defaults)\r\n\t}\r\n\r\n\tregister(option, value){\r\n\t\tthis.registeredDefaults[option] = value;\r\n\t}\r\n\r\n\tgenerate(defaultOptions, userOptions = {}){\r\n\t\tvar output = Object.assign({}, this.registeredDefaults);\r\n\r\n\t\tObject.assign(output, defaultOptions);\r\n\r\n\t\tif(userOptions.debugInvalidOptions !== false || this.table.options.debugInvalidOptions){\r\n\t\t\tfor (var key in userOptions){\r\n\t\t\t\tif(!output.hasOwnProperty(key)){\r\n\t\t\t\t\tconsole.warn(\"Invalid \" + this.msgType + \" option:\", key)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (var key in output){\r\n\t\t\tif(key in userOptions){\r\n\t\t\t\toutput[key] = userOptions[key];\r\n\t\t\t}else{\r\n\t\t\t\tif(Array.isArray(output[key])){\r\n\t\t\t\t\toutput[key] = Object.assign([], output[key]);\r\n\t\t\t\t}else if(typeof output[key] === \"object\" && output[key] !== null){\r\n\t\t\t\t\toutput[key] = Object.assign({}, output[key]);\r\n\t\t\t\t}else if (typeof output[key] === \"undefined\"){\r\n\t\t\t\t\tdelete output[key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from '../tools/Helpers.js';\r\n\r\nexport default class Renderer extends CoreFeature{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.elementVertical = table.rowManager.element;\r\n\t\tthis.elementHorizontal = table.columnManager.element;\r\n\t\tthis.tableElement = table.rowManager.tableElement;\r\n\r\n\t\tthis.verticalFillMode = \"fit\"; // used by row manager to determin how to size the render area (\"fit\" - fits container to the contents, \"fill\" - fills the contianer without resizing it)\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t/////// Internal Bindings /////////\r\n\t///////////////////////////////////\r\n\r\n\tinitialize(){\r\n\t\t//initialize core functionality\r\n\t}\r\n\r\n\tclearRows(){\r\n\t\t//clear down existing rows layout\r\n\t}\r\n\r\n\tclearColumns(){\r\n\t\t//clear down existing columns layout\r\n\t}\r\n\r\n\r\n\treinitializeColumnWidths(columns){\r\n\t\t//resize columns to fit data\r\n\t}\r\n\r\n\r\n\trenderRows(){\r\n\t\t//render rows from a clean slate\r\n\t}\r\n\r\n\trenderColumns(){\r\n\t\t//render columns from a clean slate\r\n\t}\r\n\r\n\trerenderRows(callback){\r\n\t\t// rerender rows and keep position\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\t}\r\n\r\n\trerenderColumns(update, blockRedraw){\r\n\t\t//rerender columns\r\n\t}\r\n\r\n\trenderRowCells(row){\r\n\t\t//render the cells in a row\r\n\t}\r\n\r\n\trerenderRowCells(row, force){\r\n\t\t//rerender the cells in a row\r\n\t}\r\n\r\n\tscrollColumns(left, dir){\r\n\t\t//handle horizontal scrolling\r\n\t}\r\n\r\n\tscrollRows(top, dir){\r\n\t\t//handle vertical scolling\r\n\t}\r\n\r\n\tresize(){\r\n\t\t//container has rezied, carry out any needed recalculations (DO NOT RERENDER IN THIS FUNCTION)\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\t//scroll to a specific row\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\t//determine weather the row is nearest the top or bottom of the table, retur true for top or false for bottom\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\t//return the visible rows\r\n\t\treturn [];\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t//////// Helper Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\trows(){\r\n\t\treturn this.table.rowManager.getDisplayRows();\r\n\t}\r\n\r\n\tstyleRow(row, index){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tif(index % 2){\r\n\t\t\trowEl.classList.add(\"tabulator-row-even\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-odd\");\r\n\t\t}else{\r\n\t\t\trowEl.classList.add(\"tabulator-row-odd\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-even\");\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t/////// External Triggers /////////\r\n\t/////// (DO NOT OVERRIDE) /////////\r\n\t///////////////////////////////////\r\n\r\n\tclear(){\r\n\t\t//clear down existing layout\r\n\t\tthis.clearRows();\r\n\t\tthis.clearColumns();\r\n\t}\r\n\r\n\trender(){\r\n\t\t//render from a clean slate\r\n\t\tthis.renderRows();\r\n\t\tthis.renderColumns();\r\n\t}\r\n\r\n\trerender(callback){\r\n\t\t// rerender and keep position\r\n\t\tthis.rerenderRows();\r\n\t\tthis.rerenderColumns();\r\n\t}\r\n\r\n\tscrollToRowPosition(row, position, ifVisible){\r\n\t\tvar rowIndex = this.rows().indexOf(row),\r\n\t\trowEl = row.getElement(),\r\n\t\toffset = 0;\r\n\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tif(rowIndex > -1){\r\n\r\n\t\t\t\tif(typeof ifVisible === \"undefined\"){\r\n\t\t\t\t\tifVisible = this.table.options.scrollToRowIfVisible;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//check row visibility\r\n\t\t\t\tif(!ifVisible){\r\n\t\t\t\t\tif(Helpers.elVisible(rowEl)){\r\n\t\t\t\t\t\toffset = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(offset > 0 && offset < this.elementVertical.clientHeight - rowEl.offsetHeight){\r\n\t\t\t\t\t\t\tresolve();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(typeof position === \"undefined\"){\r\n\t\t\t\t\tposition = this.table.options.scrollToRowPosition;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(position === \"nearest\"){\r\n\t\t\t\t\tposition = this.scrollToRowNearestTop(row) ? \"top\" : \"bottom\"\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//scroll to row\r\n\t\t\t\tthis.scrollToRow(row);\r\n\r\n\t\t\t\t//align to correct position\r\n\t\t\t\tswitch(position){\r\n\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\tcase \"center\":\r\n\r\n\t\t\t\t\tif(this.elementVertical.scrollHeight - this.elementVertical.scrollTop == this.elementVertical.clientHeight){\r\n\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop + (rowEl.offsetTop - this.elementVertical.scrollTop) - ((this.elementVertical.scrollHeight - rowEl.offsetTop) / 2);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - (this.elementVertical.clientHeight / 2);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"bottom\":\r\n\r\n\t\t\t\t\tif(this.elementVertical.scrollHeight - this.elementVertical.scrollTop == this.elementVertical.clientHeight){\r\n\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - (this.elementVertical.scrollHeight - rowEl.offsetTop) + rowEl.offsetHeight;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - this.elementVertical.clientHeight + rowEl.offsetHeight;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tcase \"top\":\r\n\t\t\t\t\tthis.elementVertical.scrollTop = rowEl.offsetTop;\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tresolve();\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - Row not visible\");\r\n\t\t\t\treject(\"Scroll Error - Row not visible\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class BaiscHorizontal extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t}\r\n\r\n\trenderRowCells(row){\r\n\t\trow.cells.forEach((cell) => {\r\n\t\t\trow.element.appendChild(cell.getElement());\r\n\t\t\tcell.cellRendered();\r\n\t\t});\r\n\t}\r\n\r\n\treinitializeColumnWidths(columns){\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t});\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class VirtualDomHorizontal extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.leftCol = 0;\r\n\t\tthis.rightCol = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = 0;\r\n\t\tthis.vDomScrollPosRight = 0;\r\n\t\t\r\n\t\tthis.vDomPadLeft = 0;\r\n\t\tthis.vDomPadRight = 0;\r\n\t\t\r\n\t\tthis.fitDataColAvg = 0;\r\n\t\t\r\n\t\tthis.windowBuffer = 200; //pixel margin to make column visible before it is shown on screen\r\n\t\t\r\n\t\tthis.visibleRows = null;\r\n\r\n\t\tthis.initialized = false;\r\n\t\tthis.isFitData = false;\r\n\t\t\r\n\t\tthis.columns = [];\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.compatibilityCheck();\r\n\t\tthis.layoutCheck();\r\n\t\tthis.vertScrollListen();\r\n\t}\r\n\t\r\n\tcompatibilityCheck(){\r\n\t\tvar columns = this.options(\"columns\"),\r\n\t\tfrozen = false,\r\n\t\tok = true;\r\n\t\t\r\n\t\tif(this.options(\"layout\") == \"fitDataTable\"){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with fitDataTable layout mode\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.options(\"responsiveLayout\")){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with responsive columns\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.options(\"rtl\")){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not currently compatible with RTL text direction\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(columns){\r\n\t\t\tfrozen = columns.find((col) => {\r\n\t\t\t\treturn col.frozen;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(frozen){\r\n\t\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with frozen columns\");\r\n\t\t\t\tok = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// if(!ok){\r\n\t\t// \toptions.virtualDomHoz = false;\r\n\t\t// }\r\n\t\t\r\n\t\treturn ok;\r\n\t}\r\n\t\r\n\tlayoutCheck(){\r\n\t\tthis.isFitData = this.options(\"layout\").startsWith('fitData');\r\n\t}\r\n\r\n\tvertScrollListen(){\r\n\t\tthis.subscribe(\"scroll-vertical\", this.clearVisRowCache.bind(this));\r\n\t\tthis.subscribe(\"data-refreshed\", this.clearVisRowCache.bind(this));\r\n\t}\r\n\r\n\tclearVisRowCache(){\r\n\t\tthis.visibleRows = null;\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t///////// Public Functions ///////////\r\n\t//////////////////////////////////////\r\n\t\r\n\trenderColumns(row, force){\r\n\t\tthis.dataChange();\r\n\t}\r\n\r\n\t\r\n\tscrollColumns(left, dir){\r\n\t\tif(this.scrollLeft != left){\r\n\t\t\tthis.scrollLeft = left;\r\n\t\t\t\r\n\t\t\tthis.scroll(left - (this.vDomScrollPosLeft + this.windowBuffer));\r\n\t\t}\r\n\t}\r\n\t\r\n\tcalcWindowBuffer(){\r\n\t\tvar buffer = this.elementVertical.clientWidth;\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvar width = column.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tif(width > buffer){\r\n\t\t\t\t\tbuffer = width;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.windowBuffer = buffer * 2;\r\n\t}\r\n\t\r\n\trerenderColumns(update, blockRedraw){\t\t\r\n\t\tvar old = {\r\n\t\t\tcols:this.columns,\r\n\t\t\tleftCol:this.leftCol,\r\n\t\t\trightCol:this.rightCol,\r\n\t\t},\r\n\t\tcolPos = 0;\r\n\t\t\r\n\t\t\r\n\t\tif(update && !this.initialized){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tthis.clear();\r\n\t\t\r\n\t\tthis.calcWindowBuffer();\r\n\t\t\r\n\t\tthis.scrollLeft = this.elementVertical.scrollLeft;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = this.scrollLeft - this.windowBuffer;\r\n\t\tthis.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.windowBuffer;\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tvar config = {};\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvar width = column.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tconfig.leftPos = colPos;\r\n\t\t\t\tconfig.rightPos = colPos + width;\r\n\t\t\t\t\r\n\t\t\t\tconfig.width = width;\r\n\t\t\t\t\r\n\t\t\t\tif (this.isFitData) {\r\n\t\t\t\t\tconfig.fitDataCheck = column.modules.vdomHoz ? column.modules.vdomHoz.fitDataCheck : true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif((colPos + width > this.vDomScrollPosLeft) && (colPos < this.vDomScrollPosRight)){\r\n\t\t\t\t\t//column is visible\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.leftCol == -1){\r\n\t\t\t\t\t\tthis.leftCol = this.columns.length;\r\n\t\t\t\t\t\tthis.vDomPadLeft = colPos;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.rightCol = this.columns.length;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t// column is hidden\r\n\t\t\t\t\tif(this.leftCol !== -1){\r\n\t\t\t\t\t\tthis.vDomPadRight += width;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.columns.push(column);\r\n\t\t\t\t\r\n\t\t\t\tcolumn.modules.vdomHoz = config;\r\n\t\t\t\t\r\n\t\t\t\tcolPos += width;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t\r\n\t\tthis.initialized = true;\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tif(!update || this.reinitChanged(old)){\r\n\t\t\t\tthis.reinitializeRows();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.elementVertical.scrollLeft = this.scrollLeft;\r\n\t}\r\n\t\r\n\trenderRowCells(row){\r\n\t\tif(this.initialized){\r\n\t\t\tthis.initializeRow(row);\r\n\t\t}else{\r\n\t\t\trow.cells.forEach((cell) => {\r\n\t\t\t\trow.element.appendChild(cell.getElement());\r\n\t\t\t\tcell.cellRendered();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\trerenderRowCells(row, force){\r\n\t\tthis.reinitializeRow(row, force);\r\n\t}\r\n\t\r\n\treinitializeColumnWidths(columns){\r\n\t\tfor(let i = this.leftCol; i <= this.rightCol; i++){\r\n\t\t\tthis.columns[i].reinitializeWidth();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t//////// Internal Rendering //////////\r\n\t//////////////////////////////////////\r\n\t\r\n\tdeinitialize(){\r\n\t\tthis.initialized = false;\r\n\t}\r\n\t\r\n\tclear(){\r\n\t\tthis.columns = [];\r\n\t\t\r\n\t\tthis.leftCol = -1;\r\n\t\tthis.rightCol = 0;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = 0;\r\n\t\tthis.vDomScrollPosRight = 0;\r\n\t\tthis.vDomPadLeft = 0;\r\n\t\tthis.vDomPadRight = 0;\r\n\t}\r\n\t\r\n\tdataChange(){\r\n\t\tvar change = false,\r\n\t\tcollsWidth = 0,\r\n\t\tcolEnd = 0,\r\n\t\tgroup, row, rowEl;\r\n\t\t\r\n\t\tif(this.isFitData){\r\n\t\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\t\tif(!column.definition.width && column.visible){\r\n\t\t\t\t\tchange = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(change){\r\n\t\t\t\tif(change && this.table.rowManager.getDisplayRows().length){\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.windowBuffer;\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar row = this.chain(\"rows-sample\", [1], [], () => {\r\n\t\t\t\t\t\treturn this.table.rowManager.getDisplayRows();\r\n\t\t\t\t\t})[0];\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trowEl = row.getElement();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trow.generateCells();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.tableElement.appendChild(rowEl);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor(var colEnd = 0; colEnd < row.cells.length; colEnd++){\r\n\t\t\t\t\t\t\tlet cell = row.cells[colEnd];\r\n\t\t\t\t\t\t\trowEl.appendChild(cell.getElement());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcell.column.reinitializeWidth();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcollsWidth += cell.column.getWidth();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// if(collsWidth > this.vDomScrollPosRight){\r\n\t\t\t\t\t\t\t// \tbreak;\r\n\t\t\t\t\t\t\t// }\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// this.fitDataColAvg = Math.floor(collsWidth / (colEnd + 1));\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// for(colEnd; colEnd < this.table.columnManager.columnsByIndex.length; colEnd++){\r\n\t\t\t\t\t\t// \tthis.table.columnManager.columnsByIndex[colEnd].setWidth(this.fitDataColAvg);\r\n\t\t\t\t\t\t// }\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.rerenderColumns(false, true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.options(\"layout\") === \"fitColumns\"){\r\n\t\t\t\tthis.layoutRefresh();\r\n\t\t\t\tthis.rerenderColumns(false, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitChanged(old){\r\n\t\tvar match = true;\r\n\t\t\r\n\t\tif(old.cols.length !== this.columns.length || old.leftCol !== this.leftCol || old.rightCol !== this.rightCol){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\told.cols.forEach((col, i) => {\r\n\t\t\tif(col !== this.columns[i]){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn !match;\r\n\t}\r\n\t\r\n\treinitializeRows(){\r\n\t\tvar rows = this.getVisibleRows();\r\n\t\trows.forEach((row) => {\r\n\t\t\tthis.reinitializeRow(row, true);\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetVisibleRows(){\r\n\t\tif (!this.visibleRows){\r\n\t\t\tthis.visibleRows = this.table.rowManager.getVisibleRows();\r\n\t\t}\r\n\r\n\t\treturn this.visibleRows;\t\r\n\t}\r\n\t\r\n\tscroll(diff){\r\n\t\tthis.vDomScrollPosLeft += diff;\r\n\t\tthis.vDomScrollPosRight += diff;\r\n\r\n\t\tif(Math.abs(diff) > (this.windowBuffer / 2)){\r\n\t\t\tthis.rerenderColumns();\r\n\t\t}else{\r\n\t\t\tif(diff > 0){\r\n\t\t\t\t//scroll right\r\n\t\t\t\tthis.addColRight();\r\n\t\t\t\tthis.removeColLeft();\r\n\t\t\t}else{\r\n\t\t\t\t//scroll left\r\n\t\t\t\tthis.addColLeft();\r\n\t\t\t\tthis.removeColRight();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolPositionAdjust (start, end, diff){\r\n\t\tfor(let i = start; i < end; i++){\r\n\t\t\tlet column = this.columns[i];\r\n\t\t\t\r\n\t\t\tcolumn.modules.vdomHoz.leftPos += diff;\r\n\t\t\tcolumn.modules.vdomHoz.rightPos += diff;\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColRight(){\r\n\t\tvar changes = false;\r\n\t\t\r\n\t\twhile(true){\r\n\t\t\t\r\n\t\t\tlet column = this.columns[this.rightCol + 1];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.leftPos <= this.vDomScrollPosRight){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\trow.getElement().appendChild(cell.getElement());\r\n\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.fitDataColActualWidthCheck(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.rightCol++; // Don't move this below the >= check below\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.rightCol >= (this.columns.length - 1)){\r\n\t\t\t\t\t\tthis.vDomPadRight = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomPadRight -= column.getWidth();\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColLeft(){\r\n\t\tvar changes = false;\r\n\t\t\r\n\t\twhile(true){\r\n\t\t\tlet column = this.columns[this.leftCol - 1];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.rightPos >= this.vDomScrollPosLeft){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\trow.getElement().prepend(cell.getElement());\r\n\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.leftCol--; // don't move this below the <= check below\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.leftCol <= 0){ // replicating logic in addColRight\r\n\t\t\t\t\t\tthis.vDomPadLeft = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomPadLeft -= column.getWidth();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tlet diff = this.fitDataColActualWidthCheck(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(diff){\r\n\t\t\t\t\t\tthis.scrollLeft = this.elementVertical.scrollLeft = this.elementVertical.scrollLeft + diff;\r\n\t\t\t\t\t\tthis.vDomPadRight -= diff;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveColRight(){\r\n\t\tvar changes = false;\r\n\t\t\r\n\t\twhile(true){\r\n\t\t\tlet column = this.columns[this.rightCol];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.leftPos > this.vDomScrollPosRight){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\trow.getElement().removeChild(cell.getElement());\r\n\t\t\t\t\t\t\t} catch (ex) {\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Could not removeColRight\", ex.message)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.vDomPadRight += column.getWidth();\r\n\t\t\t\t\tthis.rightCol --;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveColLeft(){\r\n\t\tvar changes = false;\r\n\t\t\r\n\t\twhile(true){\r\n\t\t\tlet column = this.columns[this.leftCol];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.rightPos < this.vDomScrollPosLeft){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\t\t\t\t\t\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\trow.getElement().removeChild(cell.getElement());\r\n\t\t\t\t\t\t\t} catch (ex) {\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Could not removeColLeft\", ex.message)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.vDomPadLeft += column.getWidth();\r\n\t\t\t\t\tthis.leftCol ++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\tfitDataColActualWidthCheck(column){\r\n\t\tvar newWidth, widthDiff;\r\n\t\t\r\n\t\tif(column.modules.vdomHoz.fitDataCheck){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t\t\r\n\t\t\tnewWidth = column.getWidth();\r\n\t\t\twidthDiff = newWidth - column.modules.vdomHoz.width;\r\n\t\t\t\r\n\t\t\tif(widthDiff){\r\n\t\t\t\tcolumn.modules.vdomHoz.rightPos += widthDiff;\r\n\t\t\t\tcolumn.modules.vdomHoz.width = newWidth;\r\n\t\t\t\tthis.colPositionAdjust(this.columns.indexOf(column) + 1, this.columns.length, widthDiff);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.vdomHoz.fitDataCheck = false;\r\n\t\t}\r\n\t\t\r\n\t\treturn widthDiff;\r\n\t}\r\n\t\r\n\tinitializeRow(row){\r\n\t\tif(row.type !== \"group\"){\r\n\t\t\trow.modules.vdomHoz = {\r\n\t\t\t\tleftCol:this.leftCol,\r\n\t\t\t\trightCol:this.rightCol,\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tfor(let i = this.leftCol; i <= this.rightCol; i++){\r\n\t\t\t\tlet column = this.columns[i];\r\n\t\t\t\t\r\n\t\t\t\tif(column && column.visible){\r\n\t\t\t\t\tlet cell = row.getCell(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\trow.getElement().appendChild(cell.getElement());\r\n\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeRow(row, force){\r\n\t\tif(row.type !== \"group\"){\r\n\t\t\tif(force || !row.modules.vdomHoz || row.modules.vdomHoz.leftCol !== this.leftCol || row.modules.vdomHoz.rightCol !== this.rightCol){\r\n\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\twhile(rowEl.firstChild) rowEl.removeChild(rowEl.firstChild);\r\n\t\t\t\t\r\n\t\t\t\tthis.initializeRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Column from './column/Column.js';\r\nimport ColumnComponent from './column/ColumnComponent.js';\r\nimport Helpers from './tools/Helpers.js';\r\nimport OptionsList from './tools/OptionsList.js';\r\n\r\nimport RendererBasicHorizontal from './rendering/renderers/BasicHorizontal.js';\r\nimport RendererVirtualDomHorizontal from './rendering/renderers/VirtualDomHorizontal.js';\r\n\r\nimport defaultColumnOptions from './column/defaults/options.js';\r\n\r\nexport default class ColumnManager extends CoreFeature {\r\n\r\n\tconstructor (table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.blockHozScrollEvent = false;\r\n\t\tthis.headersElement = null;\r\n\t\tthis.element = null ; //containing element\r\n\t\tthis.columns = []; // column definition object\r\n\t\tthis.columnsByIndex = []; //columns by index\r\n\t\tthis.columnsByField = {}; //columns by field\r\n\t\tthis.scrollLeft = 0;\r\n\t\tthis.optionsList = new OptionsList(this.table, \"column definition\", defaultColumnOptions);\r\n\r\n\t\tthis.renderer = null;\r\n\t}\r\n\r\n\t////////////// Setup Functions /////////////////\r\n\r\n\tinitialize(){\r\n\t\tthis.initializeRenderer();\r\n\r\n\t\tthis.headersElement = this.createHeadersElement();\r\n\t\tthis.element = this.createHeaderElement();\r\n\r\n\t\tthis.element.insertBefore(this.headersElement, this.element.firstChild);\r\n\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t}\r\n\r\n\tinitializeRenderer(){\r\n\t\tvar renderClass;\r\n\r\n\t\tvar renderers = {\r\n\t\t\t\"virtual\": RendererVirtualDomHorizontal,\r\n\t\t\t\"basic\": RendererBasicHorizontal,\r\n\t\t};\r\n\r\n\t\tif(typeof this.table.options.renderHorizontal === \"string\"){\r\n\t\t\trenderClass = renderers[this.table.options.renderHorizontal];\r\n\t\t}else{\r\n\t\t\trenderClass = this.table.options.renderHorizontal;\r\n\t\t}\r\n\r\n\t\tif(renderClass){\r\n\t\t\tthis.renderer = new renderClass(this.table, this.element, this.tableElement);\r\n\t\t\tthis.renderer.initialize();\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Unable to find matching renderer:\", table.options.renderHorizontal);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tcreateHeadersElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-headers\");\r\n\t\tel.setAttribute(\"role\", \"row\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tcreateHeaderElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-header\");\r\n\t\tel.setAttribute(\"role\", \"rowgroup\");\r\n\r\n\t\tif(!this.table.options.headerVisible){\r\n\t\t\tel.classList.add(\"tabulator-header-hidden\");\r\n\t\t}\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\t//return containing element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\t//return header containing element\r\n\tgetHeadersElement(){\r\n\t\treturn this.headersElement;\r\n\t}\r\n\r\n\t//scroll horizontally to match table body\r\n\tscrollHorizontal(left){\r\n\t\tvar hozAdjust = 0,\r\n\t\tscrollWidth = this.element.scrollWidth - this.table.element.clientWidth;\r\n\r\n\t\t// this.tempScrollBlock();\r\n\t\tthis.element.scrollLeft = left;\r\n\r\n\t\t//adjust for vertical scrollbar moving table when present\r\n\t\tif(left > scrollWidth){\r\n\t\t\thozAdjust = left - scrollWidth;\r\n\t\t\tthis.element.style.marginLeft = (-(hozAdjust)) + \"px\";\r\n\t\t}else{\r\n\t\t\tthis.element.style.marginLeft = 0;\r\n\t\t}\r\n\r\n\t\tthis.scrollLeft = left;\r\n\r\n\t\tthis.renderer.scrollColumns(left);\r\n\t}\r\n\r\n\t///////////// Column Setup Functions /////////////\r\n\tgenerateColumnsFromRowData(data){\r\n\t\tvar cols = [],\r\n\t\tdefinitions = this.table.options.autoColumnsDefinitions,\r\n\t\trow, sorter;\r\n\r\n\t\tif(data && data.length){\r\n\r\n\t\t\trow = data[0];\r\n\r\n\t\t\tfor(var key in row){\r\n\t\t\t\tlet col = {\r\n\t\t\t\t\tfield:key,\r\n\t\t\t\t\ttitle:key,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tlet value = row[key];\r\n\r\n\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\tsorter = \"boolean\";\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\tif(Array.isArray(value)){\r\n\t\t\t\t\t\tsorter = \"array\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\tif(!isNaN(value) && value !== \"\"){\r\n\t\t\t\t\t\tsorter = \"number\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)){\r\n\t\t\t\t\t\t\tsorter = \"alphanum\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcol.sorter = sorter;\r\n\r\n\t\t\t\tcols.push(col);\r\n\t\t\t}\r\n\r\n\t\t\tif(definitions){\r\n\r\n\t\t\t\tswitch(typeof definitions){\r\n\t\t\t\t\tcase \"function\":\r\n\t\t\t\t\tthis.table.options.columns = definitions.call(this.table, cols);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\tif(Array.isArray(definitions)){\r\n\t\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\t\tvar match = definitions.find((def) => {\r\n\t\t\t\t\t\t\t\treturn def.field === col.field;\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\tif(match){\r\n\t\t\t\t\t\t\t\tObject.assign(col, match);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\t\tif(definitions[col.field]){\r\n\t\t\t\t\t\t\t\tObject.assign(col, definitions[col.field]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.table.options.columns = cols;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.table.options.columns = cols;\r\n\t\t\t}\r\n\r\n\t\t\tthis.setColumns(this.table.options.columns);\r\n\t\t}\r\n\t}\r\n\r\n\tsetColumns(cols, row){\r\n\t\twhile(this.headersElement.firstChild) this.headersElement.removeChild(this.headersElement.firstChild);\r\n\r\n\t\tthis.columns = [];\r\n\t\tthis.columnsByIndex = [];\r\n\t\tthis.columnsByField = {};\r\n\r\n\t\tthis.dispatch(\"columns-loading\");\r\n\r\n\t\tcols.forEach((def, i) => {\r\n\t\t\tthis._addColumn(def);\r\n\t\t});\r\n\r\n\t\tthis._reIndexColumns();\r\n\r\n\t\tthis.dispatch(\"columns-loaded\");\r\n\r\n\t\tthis.renderer.rerenderColumns(false, true);\r\n\r\n\t\tthis.redraw(true);\r\n\t}\r\n\r\n\t_addColumn(definition, before, nextToColumn){\r\n\t\tvar column = new Column(definition, this),\r\n\t\tcolEl = column.getElement(),\r\n\t\tindex = nextToColumn ? this.findColumnIndex(nextToColumn) : nextToColumn;\r\n\r\n\t\tif(nextToColumn && index > -1){\r\n\t\t\tvar topColumn = nextToColumn.getTopColumn()\r\n\t\t\tvar parentIndex = this.columns.indexOf(topColumn);\r\n\t\t\tvar nextEl = topColumn.getElement();\r\n\r\n\t\t\tif(before){\r\n\t\t\t\tthis.columns.splice(parentIndex, 0, column);\r\n\t\t\t\tnextEl.parentNode.insertBefore(colEl, nextEl);\r\n\t\t\t}else{\r\n\t\t\t\tthis.columns.splice(parentIndex + 1, 0, column);\r\n\t\t\t\tnextEl.parentNode.insertBefore(colEl, nextEl.nextSibling);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(before){\r\n\t\t\t\tthis.columns.unshift(column);\r\n\t\t\t\tthis.headersElement.insertBefore(column.getElement(), this.headersElement.firstChild);\r\n\t\t\t}else{\r\n\t\t\t\tthis.columns.push(column);\r\n\t\t\t\tthis.headersElement.appendChild(column.getElement());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcolumn.columnRendered();\r\n\r\n\t\treturn column;\r\n\t}\r\n\r\n\tregisterColumnField(col){\r\n\t\tif(col.definition.field){\r\n\t\t\tthis.columnsByField[col.definition.field] = col;\r\n\t\t}\r\n\t}\r\n\r\n\tregisterColumnPosition(col){\r\n\t\tthis.columnsByIndex.push(col);\r\n\t}\r\n\r\n\t_reIndexColumns(){\r\n\t\tthis.columnsByIndex = [];\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.reRegisterPosition();\r\n\t\t});\r\n\t}\r\n\r\n\t//ensure column headers take up the correct amount of space in column groups\r\n\tverticalAlignHeaders(){\r\n\t\tvar minHeight = 0;\r\n\r\n\t\tthis.columns.forEach((column) => {\r\n\t\t\tvar height;\r\n\r\n\t\t\tcolumn.clearVerticalAlign();\r\n\r\n\t\t\theight = column.getHeight();\r\n\r\n\t\t\tif(height > minHeight){\r\n\t\t\t\tminHeight = height;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.columns.forEach((column) => {\r\n\t\t\tcolumn.verticalAlign(this.table.options.columnHeaderVertAlign, minHeight);\r\n\t\t});\r\n\r\n\t\tthis.table.rowManager.adjustTableSize();\r\n\t}\r\n\r\n\t//////////////// Column Details /////////////////\r\n\tfindColumn(subject){\r\n\t\tif(typeof subject == \"object\"){\r\n\r\n\t\t\tif(subject instanceof Column){\r\n\t\t\t\t//subject is column element\r\n\t\t\t\treturn subject;\r\n\t\t\t}else if(subject instanceof ColumnComponent){\r\n\t\t\t\t//subject is public column component\r\n\t\t\t\treturn subject._getSelf() || false;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\t\t\t\t//subject is a HTML element of the column header\r\n\t\t\t\tlet match = this.columns.find((column) => {\r\n\t\t\t\t\treturn column.element === subject;\r\n\t\t\t\t});\r\n\r\n\t\t\t\treturn match || false;\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the field name of the column\r\n\t\t\treturn this.columnsByField[subject] || false;\r\n\t\t}\r\n\r\n\t\t//catch all for any other type of input\r\n\t\treturn false;\r\n\t}\r\n\r\n\tgetColumnByField(field){\r\n\t\treturn this.columnsByField[field];\r\n\t}\r\n\r\n\tgetColumnsByFieldRoot(root){\r\n\t\tvar matches = [];\r\n\r\n\t\tObject.keys(this.columnsByField).forEach((field) => {\r\n\t\t\tvar fieldRoot = field.split(\".\")[0];\r\n\t\t\tif(fieldRoot === root){\r\n\t\t\t\tmatches.push(this.columnsByField[field]);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn matches;\r\n\t}\r\n\r\n\tgetColumnByIndex(index){\r\n\t\treturn this.columnsByIndex[index];\r\n\t}\r\n\r\n\tgetFirstVisibleColumn(index){\r\n\t\tvar index = this.columnsByIndex.findIndex((col) => {\r\n\t\t\treturn col.visible;\r\n\t\t});\r\n\r\n\t\treturn index > -1 ? this.columnsByIndex[index] : false;\r\n\t}\r\n\r\n\tgetColumns(){\r\n\t\treturn this.columns;\r\n\t}\r\n\r\n\tfindColumnIndex(column){\r\n\t\treturn this.columnsByIndex.findIndex((col) => {\r\n\t\t\treturn column === col;\r\n\t\t});\r\n\t}\r\n\r\n\t//return all columns that are not groups\r\n\tgetRealColumns(){\r\n\t\treturn this.columnsByIndex;\r\n\t}\r\n\r\n\t//travers across columns and call action\r\n\ttraverse(callback){\r\n\t\tthis.columnsByIndex.forEach((column,i) =>{\r\n\t\t\tcallback(column, i);\r\n\t\t});\r\n\t}\r\n\r\n\t//get defintions of actual columns\r\n\tgetDefinitions(active){\r\n\t\tvar output = [];\r\n\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tif(!active || (active && column.visible)){\r\n\t\t\t\toutput.push(column.getDefinition());\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//get full nested definition tree\r\n\tgetDefinitionTree(){\r\n\t\tvar output = [];\r\n\r\n\t\tthis.columns.forEach((column) => {\r\n\t\t\toutput.push(column.getDefinition(true));\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetComponents(structured){\r\n\t\tvar output = [],\r\n\t\tcolumns = structured ? this.columns : this.columnsByIndex;\r\n\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\toutput.push(column.getComponent());\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\tvar width = 0;\r\n\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tif(column.visible){\r\n\t\t\t\twidth += column.getWidth();\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn width;\r\n\t}\r\n\r\n\tmoveColumn(from, to, after){\r\n\t\tthis.moveColumnActual(from, to, after);\r\n\r\n\t\tto.element.parentNode.insertBefore(from.element, to.element);\r\n\r\n\t\tif(after){\r\n\t\t\tto.element.parentNode.insertBefore(to.element, from.element);\r\n\t\t}\r\n\r\n\t\tthis.verticalAlignHeaders();\r\n\r\n\t\tthis.table.rowManager.reinitialize();\r\n\t}\r\n\r\n\tmoveColumnActual(from, to, after){\r\n\t\tif(from.parent.isGroup){\r\n\t\t\tthis._moveColumnInArray(from.parent.columns, from, to, after);\r\n\t\t}else{\r\n\t\t\tthis._moveColumnInArray(this.columns, from, to, after);\r\n\t\t}\r\n\r\n\t\tthis._moveColumnInArray(this.columnsByIndex, from, to, after, true);\r\n\r\n\t\tthis.renderer.rerenderColumns(true);\r\n\r\n\t\tthis.dispatch(\"column-moved\", from, to, after);\r\n\r\n\t\tif(this.subscribedExternal(\"columnMoved\")){\r\n\t\t\tthis.dispatchExternal(\"columnMoved\", from.getComponent(), this.table.columnManager.getComponents());\r\n\t\t}\r\n\t}\r\n\r\n\t_moveColumnInArray(columns, from, to, after, updateRows){\r\n\t\tvar\tfromIndex = columns.indexOf(from),\r\n\t\ttoIndex, rows = [];\r\n\r\n\t\tif (fromIndex > -1) {\r\n\r\n\t\t\tcolumns.splice(fromIndex, 1);\r\n\r\n\t\t\ttoIndex = columns.indexOf(to);\r\n\r\n\t\t\tif (toIndex > -1) {\r\n\r\n\t\t\t\tif(after){\r\n\t\t\t\t\ttoIndex = toIndex+1;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\ttoIndex = fromIndex;\r\n\t\t\t}\r\n\r\n\t\t\tcolumns.splice(toIndex, 0, from);\r\n\r\n\t\t\tif(updateRows){\r\n\r\n\t\t\t\trows = this.chain(\"column-moving-rows\", [from, to, after], null, []) || [];\r\n\r\n\t\t\t\trows = rows.concat(this.table.rowManager.rows);\r\n\r\n\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\tif(row.cells.length){\r\n\t\t\t\t\t\tvar cell = row.cells.splice(fromIndex, 1)[0];\r\n\t\t\t\t\t\trow.cells.splice(toIndex, 0, cell);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tscrollToColumn(column, position, ifVisible){\r\n\t\tvar left = 0,\r\n\t\toffset = 0,\r\n\t\tadjust = 0,\r\n\t\tcolEl = column.getElement();\r\n\r\n\t\treturn new Promise((resolve, reject) => {\r\n\r\n\t\t\tif(typeof position === \"undefined\"){\r\n\t\t\t\tposition = this.table.options.scrollToColumnPosition;\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof ifVisible === \"undefined\"){\r\n\t\t\t\tifVisible = this.table.options.scrollToColumnIfVisible;\r\n\t\t\t}\r\n\r\n\t\t\tif(column.visible){\r\n\r\n\t\t\t\t//align to correct position\r\n\t\t\t\tswitch(position){\r\n\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\tcase \"center\":\r\n\t\t\t\t\tadjust = -this.element.clientWidth / 2;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"right\":\r\n\t\t\t\t\tadjust = colEl.clientWidth - this.headersElement.clientWidth;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//check column visibility\r\n\t\t\t\tif(!ifVisible){\r\n\r\n\t\t\t\t\toffset = colEl.offsetLeft;\r\n\r\n\t\t\t\t\tif(offset > 0 && offset + colEl.offsetWidth < this.element.clientWidth){\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//calculate scroll position\r\n\t\t\t\tleft = colEl.offsetLeft + adjust;\r\n\r\n\t\t\t\tleft = Math.max(Math.min(left, this.table.rowManager.element.scrollWidth - this.table.rowManager.element.clientWidth),0);\r\n\r\n\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\tthis.scrollHorizontal(left);\r\n\r\n\t\t\t\tresolve();\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - Column not visible\");\r\n\t\t\t\treject(\"Scroll Error - Column not visible\");\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t}\r\n\r\n\t//////////////// Cell Management /////////////////\r\n\tgenerateCells(row){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tcells.push(column.generateCell(row));\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\t//////////////// Column Management /////////////////\r\n\tgetFlexBaseWidth(){\r\n\t\tvar totalWidth = this.table.element.clientWidth, //table element width\r\n\t\tfixedWidth = 0;\r\n\r\n\t\t//adjust for vertical scrollbar if present\r\n\t\tif(this.table.rowManager.element.scrollHeight > this.table.rowManager.element.clientHeight){\r\n\t\t\ttotalWidth -= this.table.rowManager.element.offsetWidth - this.table.rowManager.element.clientWidth;\r\n\t\t}\r\n\r\n\t\tthis.columnsByIndex.forEach(function(column){\r\n\t\t\tvar width, minWidth, colWidth;\r\n\r\n\t\t\tif(column.visible){\r\n\r\n\t\t\t\twidth = column.definition.width || 0;\r\n\r\n\t\t\t\tminWidth = parseInt(column.minWidth);\r\n\r\n\t\t\t\tif(typeof(width) == \"string\"){\r\n\t\t\t\t\tif(width.indexOf(\"%\") > -1){\r\n\t\t\t\t\t\tcolWidth = (totalWidth / 100) * parseInt(width) ;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tcolWidth = parseInt(width);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolWidth = width;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfixedWidth += colWidth > minWidth ? colWidth : minWidth;\r\n\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn fixedWidth;\r\n\t}\r\n\r\n\taddColumn(definition, before, nextToColumn){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar column = this._addColumn(definition, before, nextToColumn);\r\n\r\n\t\t\tthis._reIndexColumns();\r\n\r\n\t\t\tthis.dispatch(\"column-add\", definition, before, nextToColumn);\r\n\r\n\t\t\tif(this.layoutMode() != \"fitColumns\"){\r\n\t\t\t\tcolumn.reinitializeWidth();\r\n\t\t\t}\r\n\r\n\t\t\tthis.redraw(true);\r\n\r\n\t\t\tthis.table.rowManager.reinitialize();\r\n\r\n\t\t\tthis.renderer.rerenderColumns();\r\n\r\n\t\t\tresolve(column);\r\n\t\t});\r\n\t}\r\n\r\n\t//remove column from system\r\n\tderegisterColumn(column){\r\n\t\tvar field = column.getField(),\r\n\t\tindex;\r\n\r\n\t\t//remove from field list\r\n\t\tif(field){\r\n\t\t\tdelete this.columnsByField[field];\r\n\t\t}\r\n\r\n\t\t//remove from index list\r\n\t\tindex = this.columnsByIndex.indexOf(column);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.columnsByIndex.splice(index, 1);\r\n\t\t}\r\n\r\n\t\t//remove from column list\r\n\t\tindex = this.columns.indexOf(column);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.columns.splice(index, 1);\r\n\t\t}\r\n\r\n\t\tthis.verticalAlignHeaders();\r\n\r\n\t\tthis.redraw();\r\n\t}\r\n\r\n\t//redraw columns\r\n\tredraw(force){\r\n\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\tthis.verticalAlignHeaders();\r\n\t\t}\r\n\r\n\t\tif(force){\r\n\t\t\tthis.table.rowManager.resetScroll();\r\n\t\t\tthis.table.rowManager.reinitialize();\r\n\t\t}\r\n\r\n\t\tif(!this.confirm(\"table-redrawing\", force)){\r\n\t\t\tthis.layoutRefresh();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"table-redraw\", force);\r\n\r\n\t\tthis.table.footerManager.redraw();\r\n\t}\r\n}","//public row object\r\nexport default class RowComponent {\r\n\r\n\tconstructor (row){\r\n\t\tthis._row = row;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._row.table.componentFunctionBinder.handle(\"row\", target._row, name)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\tgetData(transform){\r\n\t\treturn this._row.getData(transform);\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._row.getElement();\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._row.getCells().forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tgetCell(column){\r\n\t\tvar cell = this._row.getCell(column);\r\n\t\treturn cell ? cell.getComponent() : false;\r\n\t}\r\n\r\n\tgetIndex(){\r\n\t\treturn this._row.getData(\"data\")[this._row.table.options.index];\r\n\t}\r\n\r\n\tgetPosition(active){\r\n\t\treturn this._row.table.rowManager.getRowPosition(this._row, active);\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn this._row.delete();\r\n\t}\r\n\r\n\tscrollTo(){\r\n\t\treturn this._row.table.rowManager.scrollToRow(this._row);\r\n\t}\r\n\r\n\tmove(to, after){\r\n\t\tthis._row.moveToRow(to, after);\r\n\t}\r\n\r\n\tupdate(data){\r\n\t\treturn this._row.updateData(data);\r\n\t}\r\n\r\n\tnormalizeHeight(){\r\n\t\tthis._row.normalizeHeight(true);\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._row;\r\n\t}\r\n\r\n\treformat(){\r\n\t\treturn this._row.reinitialize();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._row.table;\r\n\t}\r\n\r\n\tgetNextRow(){\r\n\t\tvar row = this._row.nextRow();\r\n\t\treturn row ? row.getComponent() : row;\r\n\t}\r\n\r\n\tgetPrevRow(){\r\n\t\tvar row = this._row.prevRow();\r\n\t\treturn row ? row.getComponent() : row;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport RowComponent from './RowComponent.js';\r\nimport Helpers from '../tools/Helpers.js';\r\n\r\nexport default class Row extends CoreFeature{\r\n\tconstructor (data, parent, type = \"row\"){\r\n\t\tsuper(parent.table);\r\n\t\t\r\n\t\tthis.parent = parent;\r\n\t\tthis.data = {};\r\n\t\tthis.type = type; //type of element\r\n\t\tthis.element = false;\r\n\t\tthis.modules = {}; //hold module variables;\r\n\t\tthis.cells = [];\r\n\t\tthis.height = 0; //hold element height\r\n\t\tthis.heightStyled = \"\"; //hold element height prestyled to improve render efficiency\r\n\t\tthis.manualHeight = false; //user has manually set row height\r\n\t\tthis.outerHeight = 0; //hold elements outer height\r\n\t\tthis.initialized = false; //element has been rendered\r\n\t\tthis.heightInitialized = false; //element has resized cells to fit\r\n\t\t\r\n\t\tthis.component = null;\r\n\t\t\r\n\t\tthis.created = false;\r\n\t\t\r\n\t\tthis.setData(data);\r\n\t}\r\n\t\r\n\tcreate(){\r\n\t\tif(!this.created){\r\n\t\t\tthis.created = true;\r\n\t\t\tthis.generateElement();\r\n\t\t}\r\n\t}\r\n\t\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-row\");\r\n\t\tel.setAttribute(\"role\", \"row\");\r\n\t\t\r\n\t\tthis.element = el;\r\n\t}\r\n\t\r\n\tgetElement(){\r\n\t\tthis.create();\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\tdetachElement(){\r\n\t\tif (this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgenerateElement(){\r\n\t\tthis.createElement();\r\n\t\tthis.dispatch(\"row-init\", this);\r\n\t}\r\n\t\r\n\tgenerateCells(){\r\n\t\tthis.cells = this.table.columnManager.generateCells(this);\r\n\t}\r\n\t\r\n\t//functions to setup on first render\r\n\tinitialize(force){\r\n\t\tthis.create();\r\n\t\t\r\n\t\tif(!this.initialized || force){\r\n\t\t\t\r\n\t\t\tthis.deleteCells();\r\n\t\t\t\r\n\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout-before\", this);\r\n\t\t\t\r\n\t\t\tthis.generateCells();\r\n\t\t\t\r\n\t\t\tthis.initialized = true;\r\n\t\t\t\r\n\t\t\tthis.table.columnManager.renderer.renderRowCells(this);\r\n\t\t\t\r\n\t\t\tif(force){\r\n\t\t\t\tthis.normalizeHeight();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout\", this);\r\n\t\t\t\r\n\t\t\tif(this.table.options.rowFormatter){\r\n\t\t\t\tthis.table.options.rowFormatter(this.getComponent());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout-after\", this);\r\n\t\t}else{\r\n\t\t\tthis.table.columnManager.renderer.rerenderRowCells(this);\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeHeight(){\r\n\t\tthis.heightInitialized = false;\r\n\t\t\r\n\t\tif(this.element && this.element.offsetParent !== null){\r\n\t\t\tthis.normalizeHeight(true);\r\n\t\t}\r\n\t}\r\n\r\n\tdeinitialize(){\r\n\t\tthis.initialized = false;\r\n\t}\r\n\t\r\n\tdeinitializeHeight(){\r\n\t\tthis.heightInitialized = false;\r\n\t}\r\n\t\r\n\treinitialize(children){\r\n\t\tthis.initialized = false;\r\n\t\tthis.heightInitialized = false;\r\n\t\t\r\n\t\tif(!this.manualHeight){\r\n\t\t\tthis.height = 0;\r\n\t\t\tthis.heightStyled = \"\";\r\n\t\t}\r\n\t\t\r\n\t\tif(this.element && this.element.offsetParent !== null){\r\n\t\t\tthis.initialize(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatch(\"row-relayout\", this);\r\n\t}\r\n\t\r\n\t//get heights when doing bulk row style calcs in virtual DOM\r\n\tcalcHeight(force){\r\n\t\tvar maxHeight = 0,\r\n\t\tminHeight;\r\n\t\t\r\n\t\tif(this.table.options.rowHeight){\r\n\t\t\tthis.height = this.table.options.rowHeight;\r\n\t\t}else{\r\n\t\t\tminHeight = this.table.options.resizableRows ? this.element.clientHeight : 0;\r\n\t\t\t\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tvar height = cell.getHeight();\r\n\t\t\t\tif(height > maxHeight){\r\n\t\t\t\t\tmaxHeight = height;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(force){\r\n\t\t\t\tthis.height = Math.max(maxHeight, minHeight);\r\n\t\t\t}else{\r\n\t\t\t\tthis.height = this.manualHeight ? this.height : Math.max(maxHeight, minHeight);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.heightStyled = this.height ? this.height + \"px\" : \"\";\r\n\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t}\r\n\t\r\n\t//set of cells\r\n\tsetCellHeight(){\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setHeight();\r\n\t\t});\r\n\t\t\r\n\t\tthis.heightInitialized = true;\r\n\t}\r\n\t\r\n\tclearCellHeight(){\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.clearHeight();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//normalize the height of elements in the row\r\n\tnormalizeHeight(force){\r\n\t\tif(force && !this.table.options.rowHeight){\r\n\t\t\tthis.clearCellHeight();\r\n\t\t}\r\n\t\t\r\n\t\tthis.calcHeight(force);\r\n\t\t\r\n\t\tthis.setCellHeight();\r\n\t}\r\n\t\r\n\t//set height of rows\r\n\tsetHeight(height, force){\r\n\t\tif(this.height != height || force){\r\n\t\t\t\r\n\t\t\tthis.manualHeight = true;\r\n\t\t\t\r\n\t\t\tthis.height = height;\r\n\t\t\tthis.heightStyled = height ? height + \"px\" : \"\";\r\n\t\t\t\r\n\t\t\tthis.setCellHeight();\r\n\t\t\t\r\n\t\t\t// this.outerHeight = this.element.outerHeight();\r\n\t\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return rows outer height\r\n\tgetHeight(){\r\n\t\treturn this.outerHeight;\r\n\t}\r\n\t\r\n\t//return rows outer Width\r\n\tgetWidth(){\r\n\t\treturn this.element.offsetWidth;\r\n\t}\r\n\t\r\n\t//////////////// Cell Management /////////////////\r\n\tdeleteCell(cell){\r\n\t\tvar index = this.cells.indexOf(cell);\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.cells.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////// Data Management /////////////////\r\n\tsetData(data){\r\n\t\tthis.data = this.chain(\"row-data-init-before\", [this, data], undefined, data);\r\n\t\t\r\n\t\tthis.dispatch(\"row-data-init-after\", this);\r\n\t}\r\n\t\r\n\t//update the rows data\r\n\tupdateData(updatedData){\r\n\t\tvar visible = this.element && Helpers.elVisible(this.element),\r\n\t\ttempData = {},\r\n\t\tnewRowData;\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\r\n\t\t\tif(typeof updatedData === \"string\"){\r\n\t\t\t\tupdatedData = JSON.parse(updatedData);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-save-before\", this);\r\n\t\t\t\r\n\t\t\tif(this.subscribed(\"row-data-changing\")){\r\n\t\t\t\ttempData = Object.assign(tempData, this.data);\r\n\t\t\t\ttempData = Object.assign(tempData, updatedData);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tnewRowData = this.chain(\"row-data-changing\", [this, tempData, updatedData], null, updatedData);\r\n\t\t\t\r\n\t\t\t//set data\r\n\t\t\tfor (var attrname in newRowData) {\r\n\t\t\t\tthis.data[attrname] = newRowData[attrname];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-save-after\", this);\r\n\t\t\t\r\n\t\t\t//update affected cells only\r\n\t\t\tfor (var attrname in updatedData) {\r\n\t\t\t\t\r\n\t\t\t\tlet columns = this.table.columnManager.getColumnsByFieldRoot(attrname);\r\n\t\t\t\t\r\n\t\t\t\tcolumns.forEach((column) => {\r\n\t\t\t\t\tlet cell = this.getCell(column.getField());\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(cell){\r\n\t\t\t\t\t\tlet value = column.getFieldValue(newRowData);\r\n\t\t\t\t\t\tif(cell.getValue() != value){\r\n\t\t\t\t\t\t\tcell.setValueProcessData(value);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(visible){\r\n\t\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Partial reinitialization if visible\r\n\t\t\tif(visible){\r\n\t\t\t\tthis.normalizeHeight(true);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.rowFormatter){\r\n\t\t\t\t\tthis.table.options.rowFormatter(this.getComponent());\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.initialized = false;\r\n\t\t\t\tthis.height = 0;\r\n\t\t\t\tthis.heightStyled = \"\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-changed\", this, visible, updatedData);\r\n\t\t\t\r\n\t\t\t//this.reinitialize();\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"rowUpdated\", this.getComponent());\r\n\t\t\t\r\n\t\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetData(transform){\r\n\t\tif(transform){\r\n\t\t\treturn this.chain(\"row-data-retrieve\", [this, transform], null, this.data);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.data;\r\n\t}\r\n\t\r\n\tgetCell(column){\r\n\t\tvar match = false;\r\n\t\t\r\n\t\tcolumn = this.table.columnManager.findColumn(column);\r\n\t\t\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.generateCells();\r\n\t\t}\r\n\t\t\r\n\t\tmatch = this.cells.find(function(cell){\r\n\t\t\treturn cell.column === column;\r\n\t\t});\r\n\t\t\r\n\t\treturn match;\r\n\t}\r\n\t\r\n\tgetCellIndex(findCell){\r\n\t\treturn this.cells.findIndex(function(cell){\r\n\t\t\treturn cell === findCell;\r\n\t\t});\r\n\t}\r\n\t\r\n\tfindCell(subject){\r\n\t\treturn this.cells.find((cell) => {\r\n\t\t\treturn cell.element === subject;\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetCells(){\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.generateCells();\r\n\t\t}\r\n\t\t\r\n\t\treturn this.cells;\r\n\t}\r\n\t\r\n\tnextRow(){\r\n\t\tvar row = this.table.rowManager.nextDisplayRow(this, true);\r\n\t\treturn row || false;\r\n\t}\r\n\t\r\n\tprevRow(){\r\n\t\tvar row = this.table.rowManager.prevDisplayRow(this, true);\r\n\t\treturn row || false;\r\n\t}\r\n\t\r\n\tmoveToRow(to, before){\r\n\t\tvar toRow = this.table.rowManager.findRow(to);\r\n\t\t\r\n\t\tif(toRow){\r\n\t\t\tthis.table.rowManager.moveRowActual(this, toRow, !before);\r\n\t\t\tthis.table.rowManager.refreshActiveData(\"display\", false, true);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching row found:\", to);\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////// Actions /////////////////////\r\n\tdelete(){\r\n\t\tthis.dispatch(\"row-delete\", this);\r\n\t\t\r\n\t\tthis.deleteActual();\r\n\t\t\r\n\t\treturn Promise.resolve();\r\n\t}\r\n\t\r\n\tdeleteActual(blockRedraw){\r\n\t\tvar index = this.table.rowManager.getRowIndex(this);\r\n\t\t\r\n\t\tthis.detatchModules();\r\n\t\t\r\n\t\tthis.table.rowManager.deleteRow(this, blockRedraw);\r\n\t\t\r\n\t\tthis.deleteCells();\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.heightInitialized = false;\r\n\t\tthis.element = false;\r\n\t\t\r\n\t\tthis.dispatch(\"row-deleted\", this);\r\n\t}\r\n\t\r\n\tdetatchModules(){\r\n\t\tthis.dispatch(\"row-deleting\", this);\r\n\t}\r\n\t\r\n\tdeleteCells(){\r\n\t\tvar cellCount = this.cells.length;\r\n\t\t\r\n\t\tfor(let i = 0; i < cellCount; i++){\r\n\t\t\tthis.cells[0].delete();\r\n\t\t}\r\n\t}\r\n\t\r\n\twipe(){\r\n\t\tthis.detatchModules();\r\n\t\tthis.deleteCells();\r\n\t\t\r\n\t\tif(this.element){\r\n\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\t\r\n\t\t\tif(this.element.parentNode){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.element = false;\r\n\t\tthis.modules = {};\r\n\t}\r\n\t\r\n\tgetGroup(){\r\n\t\treturn this.modules.group || false;\r\n\t}\r\n\t\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new RowComponent(this);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.component;\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class BaiscVertical extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.verticalFillMode = \"fill\";\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t}\r\n\r\n\tclearRows(){\r\n\t\tvar element = this.tableElement;\r\n\r\n\t\t// element.children.detach();\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\telement.scrollTop = 0;\r\n\t\telement.scrollLeft = 0;\r\n\r\n\t\telement.style.minWidth = \"\";\r\n\t\telement.style.minHeight = \"\";\r\n\t\telement.style.display = \"\";\r\n\t\telement.style.visibility = \"\";\r\n\t}\r\n\r\n\trenderRows(){\r\n\t\tvar element = this.tableElement,\r\n\t\tonlyGroupHeaders = true;\r\n\r\n\t\tthis.rows().forEach((row, index) => {\r\n\t\t\tthis.styleRow(row, index);\r\n\t\t\telement.appendChild(row.getElement());\r\n\t\t\trow.initialize(true);\r\n\r\n\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\tonlyGroupHeaders = false;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(onlyGroupHeaders){\r\n\t\t\telement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t}else{\r\n\t\t\telement.style.minWidth = \"\";\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trerenderRows(callback){\r\n\t\tthis.clearRows();\r\n\t\tthis.renderRows();\r\n\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\tvar rowTop = Helpers.elOffset(row.getElement()).top;\r\n\r\n\t\treturn !(Math.abs(this.elementVertical.scrollTop - rowTop) > Math.abs(this.elementVertical.scrollTop + this.elementVertical.clientHeight - rowTop));\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tthis.elementVertical.scrollTop = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top + this.elementVertical.scrollTop;\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\treturn this.rows();\r\n\t}\r\n\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class VirtualDomVertical extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.verticalFillMode = \"fill\";\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.vDomRowHeight = 20; //approximation of row heights for padding\r\n\r\n\t\tthis.vDomTop = 0; //hold position for first rendered row in the virtual DOM\r\n\t\tthis.vDomBottom = 0; //hold possition for last rendered row in the virtual DOM\r\n\r\n\t\tthis.vDomScrollPosTop = 0; //last scroll position of the vDom top;\r\n\t\tthis.vDomScrollPosBottom = 0; //last scroll position of the vDom bottom;\r\n\r\n\t\tthis.vDomTopPad = 0; //hold value of padding for top of virtual DOM\r\n\t\tthis.vDomBottomPad = 0; //hold value of padding for bottom of virtual DOM\r\n\r\n\t\tthis.vDomMaxRenderChain = 90; //the maximum number of dom elements that can be rendered in 1 go\r\n\r\n\t\tthis.vDomWindowBuffer = 0; //window row buffer before removing elements, to smooth scrolling\r\n\r\n\t\tthis.vDomWindowMinTotalRows = 20; //minimum number of rows to be generated in virtual dom (prevent buffering issues on tables with tall rows)\r\n\t\tthis.vDomWindowMinMarginRows = 5; //minimum number of rows to be generated in virtual dom margin\r\n\r\n\t\tthis.vDomTopNewRows = []; //rows to normalize after appending to optimize render speed\r\n\t\tthis.vDomBottomNewRows = []; //rows to normalize after appending to optimize render speed\r\n\t}\r\n\r\n\t//////////////////////////////////////\r\n\t///////// Public Functions ///////////\r\n\t//////////////////////////////////////\r\n\r\n\tclearRows(){\r\n\t\tvar element = this.tableElement;\r\n\r\n\t\t// element.children.detach();\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\telement.style.paddingTop = \"\";\r\n\t\telement.style.paddingBottom = \"\";\r\n\t\t// element.style.minWidth = \"\";\r\n\t\telement.style.minHeight = \"\";\r\n\t\telement.style.display = \"\";\r\n\t\telement.style.visibility = \"\";\r\n\r\n\t\tthis.elementVertical.scrollTop = 0;\r\n\t\tthis.elementVertical.scrollLeft = 0;\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.vDomTop = 0;\r\n\t\tthis.vDomBottom = 0;\r\n\t\tthis.vDomTopPad = 0;\r\n\t\tthis.vDomBottomPad = 0;\r\n\t\tthis.vDomScrollPosTop = 0;\r\n\t\tthis.vDomScrollPosBottom = 0;\r\n\t}\r\n\r\n\trenderRows(){\r\n\t\tthis._virtualRenderFill();\r\n\t}\r\n\r\n\trerenderRows(callback){\r\n\t\tvar scrollTop = this.elementVertical.scrollTop;\r\n\t\tvar topRow = false;\r\n\t\tvar topOffset = false;\r\n\r\n\t\tvar left = this.table.rowManager.scrollLeft;\r\n\r\n\t\tvar rows = this.rows();\r\n\r\n\t\tfor(var i = this.vDomTop; i <= this.vDomBottom; i++){\r\n\r\n\t\t\tif(rows[i]){\r\n\t\t\t\tvar diff = scrollTop - rows[i].getElement().offsetTop;\r\n\r\n\t\t\t\tif(topOffset === false || Math.abs(diff) < topOffset){\r\n\t\t\t\t\ttopOffset = diff;\r\n\t\t\t\t\ttopRow = i;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\trows.forEach((row) => {\r\n\t\t\trow.deinitializeHeight();\r\n\t\t});\r\n\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\r\n\t\tthis._virtualRenderFill((topRow === false ? this.rows.length - 1 : topRow), true, topOffset || 0);\r\n\r\n\t\tthis.scrollColumns(left);\r\n\t}\r\n\r\n\tscrollColumns(left){\r\n\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t}\r\n\r\n\tscrollRows(top, dir){\r\n\t\tvar topDiff = top - this.vDomScrollPosTop;\r\n\t\tvar bottomDiff = top - this.vDomScrollPosBottom;\r\n\t\tvar margin = this.vDomWindowBuffer * 2;\r\n\t\tvar rows = this.rows();\r\n\r\n\t\tthis.scrollTop = top;\r\n\r\n\t\tif(-topDiff > margin || bottomDiff > margin){\r\n\t\t\t//if big scroll redraw table;\r\n\t\t\tvar left = this.table.rowManager.scrollLeft;\r\n\t\t\tthis._virtualRenderFill(Math.floor((this.elementVertical.scrollTop / this.elementVertical.scrollHeight) * rows.length));\r\n\t\t\tthis.scrollColumns(left);\r\n\t\t}else{\r\n\r\n\t\t\tif(dir){\r\n\t\t\t\t//scrolling up\r\n\t\t\t\tif(topDiff < 0){\r\n\t\t\t\t\tthis._addTopRow(rows, -topDiff);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(bottomDiff < 0){\r\n\t\t\t\t\t//hide bottom row if needed\r\n\t\t\t\t\tif(this.vDomScrollHeight - this.scrollTop > this.vDomWindowBuffer){\r\n\t\t\t\t\t\tthis._removeBottomRow(rows, -bottomDiff);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomScrollPosBottom = this.scrollTop;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\r\n\t\t\t\tif(bottomDiff >= 0){\r\n\t\t\t\t\tthis._addBottomRow(rows, bottomDiff);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//scrolling down\r\n\t\t\t\tif(topDiff >= 0){\r\n\t\t\t\t\t//hide top row if needed\r\n\t\t\t\t\tif(this.scrollTop > this.vDomWindowBuffer){\r\n\t\t\t\t\t\tthis._removeTopRow(rows, topDiff);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomScrollPosTop = this.scrollTop;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tresize(){\r\n\t\tthis.vDomWindowBuffer = this.table.options.renderVerticalBuffer || this.elementVertical.clientHeight;\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\tvar rowIndex = this.rows().indexOf(row);\r\n\r\n\t\treturn !(Math.abs(this.vDomTop - rowIndex) > Math.abs(this.vDomBottom - rowIndex));\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\tvar index = this.rows().indexOf(row);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis._virtualRenderFill(index, true);\r\n\t\t}\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\tvar topEdge = this.elementVertical.scrollTop,\r\n\t\tbottomEdge = this.elementVertical.clientHeight + topEdge,\r\n\t\ttopFound = false,\r\n\t\ttopRow = 0,\r\n\t\tbottomRow = 0,\r\n\t\trows = this.rows();\r\n\r\n\t\tif(includingBuffer){\r\n\t\t\ttopRow = this.vDomTop;\r\n\t\t\tbottomRow = this.vDomBottom;\r\n\t\t}else{\r\n\t\t\tfor(var i = this.vDomTop; i <= this.vDomBottom; i++){\r\n\t\t\t\tif(rows[i]){\r\n\t\t\t\t\tif(!topFound){\r\n\t\t\t\t\t\tif((topEdge - rows[i].getElement().offsetTop) >= 0){\r\n\t\t\t\t\t\t\ttopRow = i;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\ttopFound = true;\r\n\r\n\t\t\t\t\t\t\tif(bottomEdge - rows[i].getElement().offsetTop >= 0){\r\n\t\t\t\t\t\t\t\tbottomRow = i;\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(bottomEdge - rows[i].getElement().offsetTop >= 0){\r\n\t\t\t\t\t\t\tbottomRow = i;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn rows.slice(topRow, bottomRow + 1);\r\n\t}\r\n\r\n\t//////////////////////////////////////\r\n\t//////// Internal Rendering //////////\r\n\t//////////////////////////////////////\r\n\r\n\t//full virtual render\r\n\t_virtualRenderFill(position, forceMove, offset){\r\n\t\tvar\telement = this.tableElement,\r\n\t\tholder = this.elementVertical,\r\n\t\ttopPad = 0,\r\n\t\trowsHeight = 0,\r\n\t\theightOccupied = 0,\r\n\t\ttopPadHeight = 0,\r\n\t\ti = 0,\r\n\t\trows = this.rows(),\r\n\t\trowsCount = rows.length,\r\n\t\tcontainerHeight = this.elementVertical.clientHeight;\r\n\r\n\t\tposition = position || 0;\r\n\r\n\t\toffset = offset || 0;\r\n\r\n\t\tif(!position){\r\n\t\t\tthis.clear();\r\n\t\t}else{\r\n\t\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\t\t//check if position is too close to bottom of table\r\n\t\t\theightOccupied = (rowsCount - position + 1) * this.vDomRowHeight;\r\n\r\n\t\t\tif(heightOccupied < containerHeight){\r\n\t\t\t\tposition -= Math.ceil((containerHeight - heightOccupied) / this.vDomRowHeight);\r\n\t\t\t\tif(position < 0){\r\n\t\t\t\t\tposition = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//calculate initial pad\r\n\t\t\ttopPad = Math.min(Math.max(Math.floor(this.vDomWindowBuffer / this.vDomRowHeight), this.vDomWindowMinMarginRows), position);\r\n\t\t\tposition -= topPad;\r\n\t\t}\r\n\r\n\t\tif(rowsCount && Helpers.elVisible(this.elementVertical)){\r\n\t\t\tthis.vDomTop = position;\r\n\r\n\t\t\tthis.vDomBottom = position -1;\r\n\r\n\t\t\twhile ((rowsHeight <= containerHeight + this.vDomWindowBuffer || i < this.vDomWindowMinTotalRows) && this.vDomBottom < rowsCount -1){\r\n\t\t\t\tvar index = this.vDomBottom + 1,\r\n\t\t\t\trow = rows[index],\r\n\t\t\t\trowHeight = 0;\r\n\r\n\t\t\t\tthis.styleRow(row, index);\r\n\r\n\t\t\t\telement.appendChild(row.getElement());\r\n\r\n\t\t\t\trow.initialize();\r\n\r\n\t\t\t\tif(!row.heightInitialized){\r\n\t\t\t\t\trow.normalizeHeight(true);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowHeight = row.getHeight();\r\n\r\n\t\t\t\tif(i < topPad){\r\n\t\t\t\t\ttopPadHeight += rowHeight;\r\n\t\t\t\t}else{\r\n\t\t\t\t\trowsHeight += rowHeight;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.vDomBottom ++;\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\r\n\t\t\tif(!position){\r\n\t\t\t\tthis.vDomTopPad = 0;\r\n\t\t\t\t//adjust rowheight to match average of rendered elements\r\n\t\t\t\tthis.vDomRowHeight = Math.floor((rowsHeight + topPadHeight) / i);\r\n\t\t\t\tthis.vDomBottomPad = this.vDomRowHeight * (rowsCount - this.vDomBottom -1);\r\n\r\n\t\t\t\tthis.vDomScrollHeight = topPadHeight + rowsHeight + this.vDomBottomPad - containerHeight;\r\n\t\t\t}else{\r\n\t\t\t\tthis.vDomTopPad = !forceMove ? this.scrollTop - topPadHeight : (this.vDomRowHeight * this.vDomTop) + offset;\r\n\t\t\t\tthis.vDomBottomPad = this.vDomBottom == rowsCount-1 ? 0 : Math.max(this.vDomScrollHeight - this.vDomTopPad - rowsHeight - topPadHeight, 0);\r\n\t\t\t}\r\n\r\n\t\t\telement.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\telement.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\r\n\t\t\tif(forceMove){\r\n\t\t\t\tthis.scrollTop = this.vDomTopPad + (topPadHeight) + offset - (this.elementVertical.scrollWidth > this.elementVertical.clientWidth ? this.elementVertical.offsetHeight - containerHeight : 0);\r\n\t\t\t}\r\n\r\n\t\t\tthis.scrollTop = Math.min(this.scrollTop, this.elementVertical.scrollHeight - containerHeight);\r\n\r\n\t\t\t//adjust for horizontal scrollbar if present (and not at top of table)\r\n\t\t\tif(this.elementVertical.scrollWidth > this.elementVertical.offsetWidth && forceMove){\r\n\t\t\t\tthis.scrollTop += this.elementVertical.offsetHeight - containerHeight;\r\n\t\t\t}\r\n\r\n\t\t\tthis.vDomScrollPosTop = this.scrollTop;\r\n\t\t\tthis.vDomScrollPosBottom = this.scrollTop;\r\n\r\n\t\t\tholder.scrollTop = this.scrollTop;\r\n\r\n\t\t\tthis.dispatch(\"render-virtual-fill\");\r\n\t\t}\r\n\t}\r\n\r\n\t_addTopRow(rows, fillableSpace){\r\n\t\tvar table = this.tableElement,\r\n\t\taddedRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\tindex = this.vDomTop -1,\r\n\t\ti = 0;\r\n\r\n\t\twhile(true){\r\n\t\t\tif(this.vDomTop){\r\n\t\t\t\tlet row = rows[index],\r\n\t\t\t\trowHeight, initialized;\r\n\r\n\t\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\t\t\t\t\tinitialized = row.initialized;\r\n\r\n\t\t\t\t\tif(fillableSpace >= rowHeight){\r\n\r\n\t\t\t\t\t\tthis.styleRow(row, index);\r\n\t\t\t\t\t\ttable.insertBefore(row.getElement(), table.firstChild);\r\n\r\n\t\t\t\t\t\tif(!row.initialized || !row.heightInitialized){\r\n\t\t\t\t\t\t\taddedRows.push(row);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\trow.initialize();\r\n\r\n\t\t\t\t\t\tif(!initialized){\r\n\t\t\t\t\t\t\trowHeight = row.getElement().offsetHeight;\r\n\r\n\t\t\t\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\t\tthis.vDomTop--;\r\n\t\t\t\t\t\tindex--;\r\n\t\t\t\t\t\ti++;\r\n\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of addedRows){\r\n\t\t\trow.clearCellHeight();\r\n\t\t}\r\n\r\n\t\tthis._quickNormalizeRowHeight(addedRows);\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomTopPad -= paddingAdjust;\r\n\r\n\t\t\tif(this.vDomTopPad < 0){\r\n\t\t\t\tthis.vDomTopPad = index * this.vDomRowHeight;\r\n\t\t\t}\r\n\r\n\t\t\tif(index < 1){\r\n\t\t\t\tthis.vDomTopPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\ttable.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\tthis.vDomScrollPosTop -= paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_removeTopRow(rows, fillableSpace){\r\n\t\tvar removableRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\ti = 0;\r\n\r\n\t\twhile(true){\r\n\t\t\tlet row = rows[this.vDomTop],\r\n\t\t\trowHeight, diff;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\t\t\t\t\tthis.vDomTop++;\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tremovableRows.push(row);\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of removableRows){\r\n\t\t\tlet rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomTopPad += paddingAdjust;\r\n\t\t\tthis.tableElement.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\tthis.vDomScrollPosTop += this.vDomTop ? paddingAdjust : paddingAdjust + this.vDomWindowBuffer;\r\n\t\t}\r\n\t}\r\n\r\n\t_addBottomRow(rows, fillableSpace){\r\n\t\tvar table = this.tableElement,\r\n\t\taddedRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\tindex = this.vDomBottom + 1,\r\n\t\ti = 0;\r\n\r\n\t\twhile(true){\r\n\t\t\tlet row = rows[index],\r\n\t\t\trowHeight, initialized;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\t\t\t\tinitialized = row.initialized;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\r\n\t\t\t\t\tthis.styleRow(row, index);\r\n\t\t\t\t\ttable.appendChild(row.getElement());\r\n\r\n\t\t\t\t\tif(!row.initialized || !row.heightInitialized){\r\n\t\t\t\t\t\taddedRows.push(row);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\trow.initialize();\r\n\r\n\t\t\t\t\tif(!initialized){\r\n\t\t\t\t\t\trowHeight = row.getElement().offsetHeight;\r\n\r\n\t\t\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tthis.vDomBottom++;\r\n\t\t\t\t\tindex++;\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of addedRows){\r\n\t\t\trow.clearCellHeight();\r\n\t\t}\r\n\r\n\t\tthis._quickNormalizeRowHeight(addedRows);\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomBottomPad -= paddingAdjust;\r\n\r\n\t\t\tif(this.vDomBottomPad < 0 || index == rows.length -1){\r\n\t\t\t\tthis.vDomBottomPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\ttable.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\t\t\tthis.vDomScrollPosBottom += paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_removeBottomRow(rows, fillableSpace){\r\n\t\tvar removableRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\ti = 0;\r\n\r\n\t\twhile(true){\r\n\t\t\tlet row = rows[this.vDomBottom],\r\n\t\t\trowHeight, diff;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\t\t\t\t\tthis.vDomBottom --;\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tremovableRows.push(row);\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of removableRows){\r\n\t\t\tlet rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomBottomPad += paddingAdjust;\r\n\r\n\t\t\tif(this.vDomBottomPad < 0){\r\n\t\t\t\tthis.vDomBottomPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\tthis.tableElement.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\t\t\tthis.vDomScrollPosBottom -= paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_quickNormalizeRowHeight(rows){\r\n\t\tfor(let row of rows){\r\n\t\t\trow.calcHeight();\r\n\t\t}\r\n\r\n\t\tfor(let row of rows){\r\n\t\t\trow.setCellHeight();\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Row from './row/Row.js';\r\nimport RowComponent from './row/RowComponent.js';\r\nimport Helpers from './tools/Helpers.js';\r\n\r\nimport RendererBasicVertical from './rendering/renderers/BasicVertical.js';\r\nimport RendererVirtualDomVertical from './rendering/renderers/VirtualDomVertical.js';\r\n\r\nexport default class RowManager extends CoreFeature{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.element = this.createHolderElement(); //containing element\r\n\t\tthis.tableElement = this.createTableElement(); //table element\r\n\t\tthis.heightFixer = this.createTableElement(); //table element\r\n\t\tthis.placeholder = null; //placeholder element\r\n\t\tthis.placeholderContents = null; //placeholder element\r\n\t\t\r\n\t\tthis.firstRender = false; //handle first render\r\n\t\tthis.renderMode = \"virtual\"; //current rendering mode\r\n\t\tthis.fixedHeight = false; //current rendering mode\r\n\t\t\r\n\t\tthis.rows = []; //hold row data objects\r\n\t\tthis.activeRowsPipeline = []; //hold calculation of active rows\r\n\t\tthis.activeRows = []; //rows currently available to on display in the table\r\n\t\tthis.activeRowsCount = 0; //count of active rows\r\n\t\t\r\n\t\tthis.displayRows = []; //rows currently on display in the table\r\n\t\tthis.displayRowsCount = 0; //count of display rows\r\n\t\t\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.rowNumColumn = false; //hold column component for row number column\r\n\t\t\r\n\t\tthis.redrawBlock = false; //prevent redraws to allow multiple data manipulations before continuing\r\n\t\tthis.redrawBlockRestoreConfig = false; //store latest redraw function calls for when redraw is needed\r\n\t\tthis.redrawBlockRenderInPosition = false; //store latest redraw function calls for when redraw is needed\r\n\t\t\r\n\t\tthis.dataPipeline = []; //hold data pipeline tasks\r\n\t\tthis.displayPipeline = []; //hold data display pipeline tasks\r\n\t\t\r\n\t\tthis.renderer = null;\r\n\t}\r\n\t\r\n\t//////////////// Setup Functions /////////////////\r\n\t\r\n\tcreateHolderElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-tableholder\");\r\n\t\tel.setAttribute(\"tabindex\", 0);\r\n\t\tel.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tcreateTableElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-table\");\r\n\t\tel.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tinitializePlaceholder(){\r\n\t\t//configure placeholder element\r\n\t\tif(typeof this.table.options.placeholder == \"string\"){\r\n\t\t\tlet el = document.createElement(\"div\");\r\n\t\t\tel.classList.add(\"tabulator-placeholder\");\r\n\t\t\t\r\n\t\t\tlet contents = document.createElement(\"div\");\r\n\t\t\tcontents.classList.add(\"tabulator-placeholder-contents\");\r\n\t\t\tcontents.innerHTML = this.table.options.placeholder;\r\n\t\t\t\r\n\t\t\tel.appendChild(contents);\r\n\t\t\t\r\n\t\t\tthis.placeholderContents = contents;\r\n\t\t\tthis.placeholder = el;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return containing element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\t//return table element\r\n\tgetTableElement(){\r\n\t\treturn this.tableElement;\r\n\t}\r\n\t\r\n\t//return position of row in table\r\n\tgetRowPosition(row, active){\r\n\t\tif(active){\r\n\t\t\treturn this.activeRows.indexOf(row);\r\n\t\t}else{\r\n\t\t\treturn this.rows.indexOf(row);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.initializePlaceholder()\r\n\t\tthis.initializeRenderer();\r\n\t\t\r\n\t\t//initialize manager\r\n\t\tthis.element.appendChild(this.tableElement);\r\n\t\t\r\n\t\tthis.firstRender = true;\r\n\t\t\r\n\t\t//scroll header along with table body\r\n\t\tthis.element.addEventListener(\"scroll\", () => {\r\n\t\t\tvar left = this.element.scrollLeft,\r\n\t\t\tleftDir = this.scrollLeft > left,\r\n\t\t\ttop = this.element.scrollTop,\r\n\t\t\ttopDir = this.scrollTop > top;\r\n\t\t\t\r\n\t\t\t//handle horizontal scrolling\r\n\t\t\tif(this.scrollLeft != left){\r\n\t\t\t\tthis.scrollLeft = left;\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"scroll-horizontal\", left, leftDir);\r\n\t\t\t\tthis.dispatchExternal(\"scrollHorizontal\", left, leftDir);\r\n\r\n\t\t\t\tthis._positionPlaceholder();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//handle vertical scrolling\r\n\t\t\tif(this.scrollTop != top){\r\n\t\t\t\tthis.scrollTop = top;\r\n\t\t\t\t\r\n\t\t\t\tthis.renderer.scrollRows(top, topDir);\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"scroll-vertical\", top, topDir);\r\n\t\t\t\tthis.dispatchExternal(\"scrollVertical\", top, topDir);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t////////////////// Row Manipulation //////////////////\r\n\tfindRow(subject){\r\n\t\tif(typeof subject == \"object\"){\r\n\t\t\tif(subject instanceof Row){\r\n\t\t\t\t//subject is row element\r\n\t\t\t\treturn subject;\r\n\t\t\t}else if(subject instanceof RowComponent){\r\n\t\t\t\t//subject is public row component\r\n\t\t\t\treturn subject._getSelf() || false;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\t\t\t\t//subject is a HTML element of the row\r\n\t\t\t\tlet match = this.rows.find((row) => {\r\n\t\t\t\t\treturn row.getElement() === subject;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\treturn match || false;\r\n\t\t\t}\r\n\t\t}else if(typeof subject == \"undefined\" || subject === null){\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the index of the row\r\n\t\t\tlet match = this.rows.find((row) => {\r\n\t\t\t\treturn row.data[this.table.options.index] == subject;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\treturn match || false;\r\n\t\t}\r\n\t\t\r\n\t\t//catch all for any other type of input\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tgetRowFromDataObject(data){\r\n\t\tvar match = this.rows.find((row) => {\r\n\t\t\treturn row.data === data;\r\n\t\t});\r\n\t\t\r\n\t\treturn match || false;\r\n\t}\r\n\t\r\n\tgetRowFromPosition(position, active){\r\n\t\tif(active){\r\n\t\t\treturn this.activeRows[position];\r\n\t\t}else{\r\n\t\t\treturn this.rows[position];\r\n\t\t}\r\n\t}\r\n\t\r\n\tscrollToRow(row, position, ifVisible){\r\n\t\treturn this.renderer.scrollToRowPosition(row, position, ifVisible);\r\n\t}\r\n\t\r\n\t////////////////// Data Handling //////////////////\r\n\tsetData(data, renderInPosition, columnsChanged){\r\n\t\treturn new Promise((resolve, reject)=>{\r\n\t\t\tif(renderInPosition && this.getDisplayRows().length){\r\n\t\t\t\tif(this.table.options.pagination){\r\n\t\t\t\t\tthis._setDataActual(data, true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.reRenderInPosition(() => {\r\n\t\t\t\t\t\tthis._setDataActual(data);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.options.autoColumns && columnsChanged && this.table.initialized){\r\n\t\t\t\t\tthis.table.columnManager.generateColumnsFromRowData(data);\r\n\t\t\t\t}\r\n\t\t\t\tthis.resetScroll();\r\n\t\t\t\t\r\n\t\t\t\tthis._setDataActual(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\t\r\n\t_setDataActual(data, renderInPosition){\r\n\t\tthis.dispatchExternal(\"dataProcessing\", data);\r\n\t\t\r\n\t\tthis._wipeElements();\r\n\t\t\r\n\t\tif(Array.isArray(data)){\r\n\t\t\tthis.dispatch(\"data-processing\", data);\r\n\t\t\t\r\n\t\t\tdata.forEach((def, i) => {\r\n\t\t\t\tif(def && typeof def === \"object\"){\r\n\t\t\t\t\tvar row = new Row(def, this);\r\n\t\t\t\t\tthis.rows.push(row);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Data Loading Warning - Invalid row data detected and ignored, expecting object but received:\", def);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.refreshActiveData(false, false, renderInPosition);\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"data-processed\", data);\r\n\t\t\tthis.dispatchExternal(\"dataProcessed\", data);\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Data Loading Error - Unable to process data due to invalid data type \\nExpecting: array \\nReceived: \", typeof data, \"\\nData: \", data);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_wipeElements(){\r\n\t\tthis.dispatch(\"rows-wipe\");\r\n\t\t\r\n\t\tthis.rows.forEach((row) => {\r\n\t\t\trow.wipe();\r\n\t\t});\r\n\t\t\r\n\t\tthis.rows = [];\r\n\t\tthis.activeRows = [];\r\n\t\tthis.activeRowsPipeline = [];\r\n\t\tthis.activeRowsCount = 0;\r\n\t\tthis.displayRows = [];\r\n\t\tthis.displayRowsCount = 0;\r\n\t\t\r\n\t\tthis.adjustTableSize();\r\n\t}\r\n\t\r\n\tdeleteRow(row, blockRedraw){\r\n\t\tvar allIndex = this.rows.indexOf(row),\r\n\t\tactiveIndex = this.activeRows.indexOf(row);\r\n\t\t\r\n\t\tif(activeIndex > -1){\r\n\t\t\tthis.activeRows.splice(activeIndex, 1);\r\n\t\t}\r\n\t\t\r\n\t\tif(allIndex > -1){\r\n\t\t\tthis.rows.splice(allIndex, 1);\r\n\t\t}\r\n\t\t\r\n\t\tthis.setActiveRows(this.activeRows);\r\n\t\t\r\n\t\tthis.displayRowIterator((rows) => {\r\n\t\t\tvar displayIndex = rows.indexOf(row);\r\n\t\t\t\r\n\t\t\tif(displayIndex > -1){\r\n\t\t\t\trows.splice(displayIndex, 1);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t}\r\n\t\t\r\n\t\tthis.regenerateRowNumbers();\r\n\t\t\r\n\t\tthis.dispatchExternal(\"rowDeleted\", row.getComponent());\r\n\t\t\r\n\t\tif(!this.displayRowsCount){\r\n\t\t\tthis._showPlaceholder();\r\n\t\t}\r\n\t\t\r\n\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\tthis.dispatchExternal(\"dataChanged\", this.getData());\r\n\t\t}\r\n\t}\r\n\t\r\n\taddRow(data, pos, index, blockRedraw){\r\n\t\tvar row = this.addRowActual(data, pos, index, blockRedraw);\r\n\t\treturn row;\r\n\t}\r\n\t\r\n\t//add multiple rows\r\n\taddRows(data, pos, index){\r\n\t\tvar length = 0,\r\n\t\trows = [];\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tpos = this.findAddRowPos(pos);\r\n\t\t\t\r\n\t\t\tif(!Array.isArray(data)){\r\n\t\t\t\tdata = [data];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tlength = data.length - 1;\r\n\t\t\t\r\n\t\t\tif((typeof index == \"undefined\" && pos) || (typeof index !== \"undefined\" && !pos)){\r\n\t\t\t\tdata.reverse();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdata.forEach((item, i) => {\r\n\t\t\t\tvar row = this.addRow(item, pos, index, true);\r\n\t\t\t\trows.push(row);\r\n\t\t\t\tthis.dispatch(\"row-added\", row, data, pos, index);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.refreshActiveData(false, false, true);\r\n\t\t\t\r\n\t\t\tthis.regenerateRowNumbers();\r\n\t\t\t\r\n\t\t\tif(rows.length){\r\n\t\t\t\tthis._clearPlaceholder();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve(rows);\r\n\t\t});\r\n\t}\r\n\t\r\n\tfindAddRowPos(pos){\r\n\t\tif(typeof pos === \"undefined\"){\r\n\t\t\tpos = this.table.options.addRowPos;\r\n\t\t}\r\n\t\t\r\n\t\tif(pos === \"pos\"){\r\n\t\t\tpos = true;\r\n\t\t}\r\n\t\t\r\n\t\tif(pos === \"bottom\"){\r\n\t\t\tpos = false;\r\n\t\t}\r\n\t\t\r\n\t\treturn pos;\r\n\t}\r\n\t\r\n\taddRowActual(data, pos, index, blockRedraw){\r\n\t\tvar row = data instanceof Row ? data : new Row(data || {}, this),\r\n\t\ttop = this.findAddRowPos(pos),\r\n\t\tallIndex = -1,\r\n\t\tactiveIndex, chainResult;\r\n\t\t\r\n\t\tif(!index){\r\n\t\t\tchainResult = this.chain(\"row-adding-position\", [row, top], null, {index, top});\r\n\t\t\t\r\n\t\t\tindex = chainResult.index;\r\n\t\t\ttop = chainResult.top;\r\n\t\t}\r\n\t\t\r\n\t\tif(typeof index !== \"undefined\"){\r\n\t\t\tindex = this.findRow(index);\r\n\t\t}\r\n\t\t\r\n\t\tindex = this.chain(\"row-adding-index\", [row, index, top], null, index);\r\n\t\t\r\n\t\tif(index){\r\n\t\t\tallIndex = this.rows.indexOf(index);\r\n\t\t}\r\n\t\t\r\n\t\tif(index && allIndex > -1){\r\n\t\t\tactiveIndex = this.activeRows.indexOf(index);\r\n\t\t\t\r\n\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\tvar displayIndex = rows.indexOf(index);\r\n\t\t\t\t\r\n\t\t\t\tif(displayIndex > -1){\r\n\t\t\t\t\trows.splice((top ? displayIndex : displayIndex + 1), 0, row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(activeIndex > -1){\r\n\t\t\t\tthis.activeRows.splice((top ? activeIndex : activeIndex + 1), 0, row);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.rows.splice((top ? allIndex : allIndex + 1), 0, row);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tif(top){\r\n\t\t\t\t\r\n\t\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\t\trows.unshift(row);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.activeRows.unshift(row);\r\n\t\t\t\tthis.rows.unshift(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\t\trows.push(row);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.activeRows.push(row);\r\n\t\t\t\tthis.rows.push(row);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.setActiveRows(this.activeRows);\r\n\t\t\r\n\t\tthis.dispatchExternal(\"rowAdded\", row.getComponent());\r\n\t\t\r\n\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t}\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t}\r\n\t\t\r\n\t\treturn row;\r\n\t}\r\n\t\r\n\tmoveRow(from, to, after){\r\n\t\tthis.dispatch(\"row-move\", from, to, after);\r\n\t\t\r\n\t\tthis.moveRowActual(from, to, after);\r\n\t\t\r\n\t\tthis.regenerateRowNumbers();\r\n\t\t\r\n\t\tthis.dispatch(\"row-moved\", from, to, after);\r\n\t\tthis.dispatchExternal(\"rowMoved\", from.getComponent());\r\n\t}\r\n\t\r\n\tmoveRowActual(from, to, after){\r\n\t\tthis.moveRowInArray(this.rows, from, to, after);\r\n\t\tthis.moveRowInArray(this.activeRows, from, to, after);\r\n\t\t\r\n\t\tthis.displayRowIterator((rows) => {\r\n\t\t\tthis.moveRowInArray(rows, from, to, after);\r\n\t\t});\r\n\t\t\r\n\t\tthis.dispatch(\"row-moving\", from, to, after);\r\n\t}\r\n\t\r\n\tmoveRowInArray(rows, from, to, after){\r\n\t\tvar\tfromIndex, toIndex, start, end;\r\n\t\t\r\n\t\tif(from !== to){\r\n\t\t\t\r\n\t\t\tfromIndex = rows.indexOf(from);\r\n\t\t\t\r\n\t\t\tif (fromIndex > -1) {\r\n\t\t\t\t\r\n\t\t\t\trows.splice(fromIndex, 1);\r\n\t\t\t\t\r\n\t\t\t\ttoIndex = rows.indexOf(to);\r\n\t\t\t\t\r\n\t\t\t\tif (toIndex > -1) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(after){\r\n\t\t\t\t\t\trows.splice(toIndex+1, 0, from);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trows.splice(toIndex, 0, from);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\trows.splice(fromIndex, 0, from);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//restyle rows\r\n\t\t\tif(rows === this.getDisplayRows()){\r\n\t\t\t\t\r\n\t\t\t\tstart = fromIndex < toIndex ? fromIndex : toIndex;\r\n\t\t\t\tend = toIndex > fromIndex ? toIndex : fromIndex +1;\r\n\t\t\t\t\r\n\t\t\t\tfor(let i = start; i <= end; i++){\r\n\t\t\t\t\tif(rows[i]){\r\n\t\t\t\t\t\tthis.styleRow(rows[i], i);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearData(){\r\n\t\tthis.setData([]);\r\n\t}\r\n\t\r\n\tgetRowIndex(row){\r\n\t\treturn this.findRowIndex(row, this.rows);\r\n\t}\r\n\t\r\n\tgetDisplayRowIndex(row){\r\n\t\tvar index = this.getDisplayRows().indexOf(row);\r\n\t\treturn index > -1 ? index : false;\r\n\t}\r\n\t\r\n\tnextDisplayRow(row, rowOnly){\r\n\t\tvar index = this.getDisplayRowIndex(row),\r\n\t\tnextRow = false;\r\n\t\t\r\n\t\t\r\n\t\tif(index !== false && index < this.displayRowsCount -1){\r\n\t\t\tnextRow = this.getDisplayRows()[index+1];\r\n\t\t}\r\n\t\t\r\n\t\tif(nextRow && (!(nextRow instanceof Row) || nextRow.type != \"row\")){\r\n\t\t\treturn this.nextDisplayRow(nextRow, rowOnly);\r\n\t\t}\r\n\t\t\r\n\t\treturn nextRow;\r\n\t}\r\n\t\r\n\tprevDisplayRow(row, rowOnly){\r\n\t\tvar index = this.getDisplayRowIndex(row),\r\n\t\tprevRow = false;\r\n\t\t\r\n\t\tif(index){\r\n\t\t\tprevRow = this.getDisplayRows()[index-1];\r\n\t\t}\r\n\t\t\r\n\t\tif(rowOnly && prevRow && (!(prevRow instanceof Row) || prevRow.type != \"row\")){\r\n\t\t\treturn this.prevDisplayRow(prevRow, rowOnly);\r\n\t\t}\r\n\t\t\r\n\t\treturn prevRow;\r\n\t}\r\n\t\r\n\tfindRowIndex(row, list){\r\n\t\tvar rowIndex;\r\n\t\t\r\n\t\trow = this.findRow(row);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\trowIndex = list.indexOf(row);\r\n\t\t\t\r\n\t\t\tif(rowIndex > -1){\r\n\t\t\t\treturn rowIndex;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tgetData(active, transform){\r\n\t\tvar output = [],\r\n\t\trows = this.getRows(active);\r\n\t\t\r\n\t\trows.forEach(function(row){\r\n\t\t\tif(row.type == \"row\"){\r\n\t\t\t\toutput.push(row.getData(transform || \"data\"));\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetComponents(active){\r\n\t\tvar\toutput = [],\r\n\t\trows = this.getRows(active);\r\n\t\t\r\n\t\trows.forEach(function(row){\r\n\t\t\toutput.push(row.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetDataCount(active){\r\n\t\tvar rows = this.getRows(active);\r\n\t\t\r\n\t\treturn rows.length;\r\n\t}\r\n\t\r\n\tscrollHorizontal(left){\r\n\t\tthis.scrollLeft = left;\r\n\t\tthis.element.scrollLeft = left;\r\n\t\t\r\n\t\tthis.dispatch(\"scroll-horizontal\", left);\r\n\t}\r\n\t\r\n\tregisterDataPipelineHandler(handler, priority){\r\n\t\tif(typeof priority !== \"undefined\"){\r\n\t\t\tthis.dataPipeline.push({handler, priority})\r\n\t\t\tthis.dataPipeline.sort((a, b) => {\r\n\t\t\t\treturn a.priority - b.priority;\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Data pipeline handlers must have a priority in order to be registered\")\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterDisplayPipelineHandler(handler, priority){\r\n\t\tif(typeof priority !== \"undefined\"){\r\n\t\t\tthis.displayPipeline.push({handler, priority})\r\n\t\t\tthis.displayPipeline.sort((a, b) => {\r\n\t\t\t\treturn a.priority - b.priority;\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Display pipeline handlers must have a priority in order to be registered\")\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set active data set\r\n\trefreshActiveData(handler, skipStage, renderInPosition){\r\n\t\tvar table = this.table,\r\n\t\tstage = \"\",\r\n\t\tindex = 0,\r\n\t\tcascadeOrder = [\"all\", \"dataPipeline\", \"display\", \"displayPipeline\", \"end\"],\r\n\t\tdisplayIndex;\r\n\t\t\r\n\t\t\r\n\t\tif(typeof handler === \"function\"){\r\n\t\t\tindex = this.dataPipeline.findIndex((item) => {\r\n\t\t\t\treturn item.handler === handler;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tstage = \"dataPipeline\";\r\n\t\t\t\t\r\n\t\t\t\tif(skipStage){\r\n\t\t\t\t\tif(index == this.dataPipeline.length - 1){\r\n\t\t\t\t\t\tstage = \"display\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tindex = this.displayPipeline.findIndex((item) => {\r\n\t\t\t\t\treturn item.handler === handler;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tstage = \"displayPipeline\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(skipStage){\r\n\t\t\t\t\t\tif(index == this.displayPipeline.length - 1){\r\n\t\t\t\t\t\t\tstage = \"end\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.error(\"Unable to refresh data, invalid handler provided\", handler)\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tstage = handler || \"all\";\r\n\t\t\tindex = 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.redrawBlock){\r\n\t\t\tif(!this.redrawBlockRestoreConfig || (this.redrawBlockRestoreConfig && ((this.redrawBlockRestoreConfig.stage === stage && index < this.redrawBlockRestoreConfig.index) || (cascadeOrder.indexOf(stage) < cascadeOrder.indexOf(this.redrawBlockRestoreConfig.stage))))){\r\n\t\t\t\tthis.redrawBlockRestoreConfig = {\r\n\t\t\t\t\thandler: handler,\r\n\t\t\t\t\tskipStage: skipStage,\r\n\t\t\t\t\trenderInPosition: renderInPosition,\r\n\t\t\t\t\tstage:stage,\r\n\t\t\t\t\tindex:index,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn;\r\n\t\t}else{\r\n\t\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\t\tif(renderInPosition){\r\n\t\t\t\t\tthis.reRenderInPosition(this.refreshPipelines.bind(this, handler, stage, index, renderInPosition));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!handler){\r\n\t\t\t\t\t\tthis.table.columnManager.renderer.renderColumns();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.renderTable();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(table.options.layoutColumnsOnNewData){\r\n\t\t\t\t\t\tthis.table.columnManager.redraw(true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"data-refreshed\");\r\n\t\t}\r\n\t}\r\n\t\r\n\trefreshPipelines(handler, stage, index, renderInPosition){\r\n\t\tthis.dispatch(\"data-refreshing\");\r\n\t\t\r\n\t\tif(!handler){\r\n\t\t\tthis.activeRowsPipeline[0] = this.rows.slice(0);\r\n\t\t}\r\n\t\t\r\n\t\t//cascade through data refresh stages\r\n\t\tswitch(stage){\r\n\t\t\tcase \"all\":\r\n\t\t\t//handle case where alldata needs refreshing\r\n\t\t\t\r\n\t\t\tcase \"dataPipeline\":\r\n\t\t\t\r\n\t\t\tfor(let i = index; i < this.dataPipeline.length; i++){\r\n\t\t\t\tlet result = this.dataPipeline[i].handler(this.activeRowsPipeline[i].slice(0));\r\n\t\t\t\t\r\n\t\t\t\tthis.activeRowsPipeline[i + 1] = result || this.activeRowsPipeline[i].slice(0);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.setActiveRows(this.activeRowsPipeline[this.dataPipeline.length]);\r\n\t\t\t\r\n\t\t\tthis.regenerateRowNumbers();\r\n\t\t\t\r\n\t\t\tcase \"display\":\r\n\t\t\tindex = 0;\r\n\t\t\tthis.resetDisplayRows();\r\n\t\t\t\r\n\t\t\tcase \"displayPipeline\":\r\n\t\t\tfor(let i = index; i < this.displayPipeline.length; i++){\r\n\t\t\t\tlet result = this.displayPipeline[i].handler((i ? this.getDisplayRows(i - 1) : this.activeRows).slice(0), renderInPosition);\r\n\t\t\t\t\r\n\t\t\t\tthis.setDisplayRows(result || this.getDisplayRows(i - 1).slice(0), i);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase \"end\":\r\n\t\t\t//case to handle scenario when trying to skip past end stage\r\n\t\t}\r\n\t}\r\n\t\r\n\t//regenerate row numbers for row number formatter if in use\r\n\tregenerateRowNumbers(){\r\n\t\tif(this.rowNumColumn){\r\n\t\t\tthis.activeRows.forEach((row) => {\r\n\t\t\t\tvar cell = row.getCell(this.rowNumColumn);\r\n\t\t\t\t\r\n\t\t\t\tif(cell){\r\n\t\t\t\t\tcell._generateContents();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetActiveRows(activeRows){\r\n\t\tthis.activeRows = activeRows;\r\n\t\tthis.activeRowsCount = this.activeRows.length;\r\n\t}\r\n\t\r\n\t//reset display rows array\r\n\tresetDisplayRows(){\r\n\t\tthis.displayRows = [];\r\n\t\t\r\n\t\tthis.displayRows.push(this.activeRows.slice(0));\r\n\t\t\r\n\t\tthis.displayRowsCount = this.displayRows[0].length;\r\n\t}\r\n\t\r\n\tgetNextDisplayIndex(){\r\n\t\treturn this.displayRows.length;\r\n\t}\r\n\t\r\n\t//set display row pipeline data\r\n\tsetDisplayRows(displayRows, index){\r\n\t\t\r\n\t\tvar output = true;\r\n\t\t\r\n\t\tif(index && typeof this.displayRows[index] != \"undefined\"){\r\n\t\t\tthis.displayRows[index] = displayRows;\r\n\t\t\toutput = true;\r\n\t\t}else{\r\n\t\t\tthis.displayRows.push(displayRows)\r\n\t\t\toutput = index = this.displayRows.length -1;\r\n\t\t}\r\n\t\t\r\n\t\tif(index == this.displayRows.length -1){\r\n\t\t\tthis.displayRowsCount = this.displayRows[this.displayRows.length -1].length;\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetDisplayRows(index){\r\n\t\tif(typeof index == \"undefined\"){\r\n\t\t\treturn this.displayRows.length ? this.displayRows[this.displayRows.length -1] : [];\r\n\t\t}else{\r\n\t\t\treturn this.displayRows[index] || [];\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetVisibleRows(chain, viewable){\r\n\t\tvar rows = Object.assign([], this.renderer.visibleRows(!viewable));\r\n\t\t\r\n\t\tif(chain){\r\n\t\t\trows = this.chain(\"rows-visible\", [viewable], rows, rows);\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t//repeat action accross display rows\r\n\tdisplayRowIterator(callback){\r\n\t\tthis.activeRowsPipeline.forEach(callback);\r\n\t\tthis.displayRows.forEach(callback);\r\n\t\t\r\n\t\tthis.displayRowsCount = this.displayRows[this.displayRows.length -1].length;\r\n\t}\r\n\t\r\n\t//return only actual rows (not group headers etc)\r\n\tgetRows(type){\r\n\t\tvar rows;\r\n\t\t\r\n\t\tswitch(type){\r\n\t\t\tcase \"active\":\r\n\t\t\trows = this.activeRows;\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"display\":\r\n\t\t\trows = this.table.rowManager.getDisplayRows();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"visible\":\r\n\t\t\trows = this.getVisibleRows(false, true);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\trows = this.chain(\"rows-retrieve\", type, null, this.rows) || this.rows;\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t///////////////// Table Rendering /////////////////\r\n\t//trigger rerender of table in current position\r\n\treRenderInPosition(callback){\r\n\t\tif(this.redrawBlock){\r\n\t\t\tif(callback){\r\n\t\t\t\tcallback();\r\n\t\t\t}else{\r\n\t\t\t\tthis.redrawBlockRenderInPosition = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"renderStarted\");\r\n\t\t\tthis.renderer.rerenderRows(callback);\r\n\t\t\tthis.dispatchExternal(\"renderComplete\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeRenderer(){\r\n\t\tvar renderClass;\r\n\t\t\r\n\t\tvar renderers = {\r\n\t\t\t\"virtual\": RendererVirtualDomVertical,\r\n\t\t\t\"basic\": RendererBasicVertical,\r\n\t\t};\r\n\t\t\r\n\t\tif(typeof this.table.options.renderVertical === \"string\"){\r\n\t\t\trenderClass = renderers[this.table.options.renderVertical];\r\n\t\t}else{\r\n\t\t\trenderClass = this.table.options.renderVertical;\r\n\t\t}\r\n\t\t\r\n\t\tif(renderClass){\r\n\t\t\tthis.renderer = new renderClass(this.table, this.element, this.tableElement);\r\n\t\t\tthis.renderer.initialize();\r\n\t\t\t\r\n\t\t\tif((this.table.element.clientHeight || this.table.options.height)){\r\n\t\t\t\tthis.fixedHeight = true;\r\n\t\t\t}else{\r\n\t\t\t\tthis.fixedHeight = false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Unable to find matching renderer:\", table.options.renderVertical);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRenderMode(){\r\n\t\treturn this.renderMode;\r\n\t}\r\n\t\r\n\trenderTable(){\r\n\t\tthis.dispatchExternal(\"renderStarted\");\r\n\t\t\r\n\t\tthis.element.scrollTop = 0;\r\n\t\t\r\n\t\tthis._clearTable();\r\n\t\t\r\n\t\tif(this.displayRowsCount){\r\n\t\t\tthis.renderer.renderRows();\r\n\t\t\t\r\n\t\t\tif(this.firstRender){\r\n\t\t\t\tthis.firstRender = false;\r\n\t\t\t\tthis.layoutRefresh();\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.renderEmptyScroll();\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.fixedHeight){\r\n\t\t\tthis.adjustTableSize();\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatch(\"table-layout\");\r\n\t\t\r\n\t\tif(!this.displayRowsCount){\r\n\t\t\tthis._showPlaceholder();\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatchExternal(\"renderComplete\");\r\n\t}\r\n\t\r\n\t//show scrollbars on empty table div\r\n\trenderEmptyScroll(){\r\n\t\tif(this.placeholder){\r\n\t\t\tthis.tableElement.style.display = \"none\";\r\n\t\t}else{\r\n\t\t\tthis.tableElement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t\t// this.tableElement.style.minHeight = \"1px\";\r\n\t\t\t// this.tableElement.style.visibility = \"hidden\";\r\n\t\t}\r\n\t}\r\n\t\r\n\t_clearTable(){\r\n\t\tvar element = this.tableElement;\r\n\t\t\r\n\t\tthis._clearPlaceholder();\r\n\t\t\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.renderer.clearRows();\r\n\t}\r\n\t\r\n\t_showPlaceholder(){\r\n\t\tif(this.placeholder){\r\n\t\t\tthis.placeholder.setAttribute(\"tabulator-render-mode\", this.renderMode);\r\n\t\t\t\r\n\t\t\tthis.getElement().appendChild(this.placeholder);\r\n\t\t\tthis._positionPlaceholder();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_clearPlaceholder(){\r\n\t\tif(this.placeholder && this.placeholder.parentNode){\r\n\t\t\tthis.placeholder.parentNode.removeChild(this.placeholder);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_positionPlaceholder(){\r\n\t\tif(this.placeholder && this.placeholder.parentNode){\r\n\t\t\tthis.placeholder.style.width = this.table.columnManager.getWidth() + \"px\";\r\n\t\t\tthis.placeholderContents.style.width = this.table.rowManager.element.clientWidth + \"px\";\r\n\t\t\tthis.placeholderContents.style.marginLeft = this.scrollLeft + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tstyleRow(row, index){\r\n\t\tvar rowEl = row.getElement();\r\n\t\t\r\n\t\tif(index % 2){\r\n\t\t\trowEl.classList.add(\"tabulator-row-even\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-odd\");\r\n\t\t}else{\r\n\t\t\trowEl.classList.add(\"tabulator-row-odd\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-even\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t//normalize height of active rows\r\n\tnormalizeHeight(){\r\n\t\tthis.activeRows.forEach(function(row){\r\n\t\t\trow.normalizeHeight();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//adjust the height of the table holder to fit in the Tabulator element\r\n\tadjustTableSize(){\r\n\t\tvar initialHeight = this.element.clientHeight,\r\n\t\tmodExists;\r\n\t\t\r\n\t\tif(this.renderer.verticalFillMode === \"fill\"){\r\n\t\t\tlet otherHeight = Math.floor(this.table.columnManager.getElement().getBoundingClientRect().height + (this.table.footerManager && this.table.footerManager.active && !this.table.footerManager.external ? this.table.footerManager.getElement().getBoundingClientRect().height : 0));\r\n\t\t\t\r\n\t\t\tif(this.fixedHeight){\r\n\t\t\t\tthis.element.style.minHeight = \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t\tthis.element.style.height = \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t\tthis.element.style.maxHeight = \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.element.style.height = \"\";\r\n\t\t\t\tthis.element.style.height = (this.table.element.clientHeight - otherHeight) + \"px\";\r\n\t\t\t\tthis.element.scrollTop = this.scrollTop;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.renderer.resize();\r\n\t\t\t\r\n\t\t\t//check if the table has changed size when dealing with variable height tables\r\n\t\t\tif(!this.fixedHeight && initialHeight != this.element.clientHeight){\r\n\t\t\t\tif(this.subscribed(\"table-resize\")){\r\n\t\t\t\t\tthis.dispatch(\"table-resize\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.redraw();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis._positionPlaceholder();\r\n\t}\r\n\t\r\n\t//renitialize all rows\r\n\treinitialize(){\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\trow.reinitialize(true);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//prevent table from being redrawn\r\n\tblockRedraw (){\r\n\t\tthis.redrawBlock = true;\r\n\t\tthis.redrawBlockRestoreConfig = false;\r\n\t}\r\n\t\r\n\t//restore table redrawing\r\n\trestoreRedraw (){\r\n\t\tthis.redrawBlock = false;\r\n\t\t\r\n\t\tif(this.redrawBlockRestoreConfig){\r\n\t\t\tthis.refreshActiveData(this.redrawBlockRestoreConfig.handler, this.redrawBlockRestoreConfig.skipStage, this.redrawBlockRestoreConfig.renderInPosition)\r\n\t\t\t\r\n\t\t\tthis.redrawBlockRestoreConfig = false;\r\n\t\t}else{\r\n\t\t\tif(this.redrawBlockRenderInPosition){\r\n\t\t\t\tthis.reRenderInPosition();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.redrawBlockRenderInPosition = false;\r\n\t}\r\n\t\r\n\t//redraw table\r\n\tredraw (force){\r\n\t\tvar pos = 0,\r\n\t\tleft = this.scrollLeft;\r\n\t\t\r\n\t\tthis.adjustTableSize();\r\n\t\t\r\n\t\tthis.table.tableWidth = this.table.element.clientWidth;\r\n\t\t\r\n\t\tif(!force){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t\tthis.scrollHorizontal(left);\r\n\t\t}else{\r\n\t\t\tthis.renderTable();\r\n\t\t}\r\n\t}\r\n\t\r\n\tresetScroll(){\r\n\t\tthis.element.scrollLeft = 0;\r\n\t\tthis.element.scrollTop = 0;\r\n\t\t\r\n\t\tif(this.table.browser === \"ie\"){\r\n\t\t\tvar event = document.createEvent(\"Event\");\r\n\t\t\tevent.initEvent(\"scroll\", false, true);\r\n\t\t\tthis.element.dispatchEvent(event);\r\n\t\t}else{\r\n\t\t\tthis.element.dispatchEvent(new Event('scroll'));\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\n\r\nexport default class FooterManager extends CoreFeature{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.active = false;\r\n\t\tthis.element = this.createElement(); //containing element\r\n\t\tthis.containerElement = this.createContainerElement(); //containing element\r\n\t\tthis.external = false;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.initializeElement();\r\n\t}\r\n\r\n\tcreateElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-footer\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\t\r\n\tcreateContainerElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-footer-contents\");\r\n\r\n\t\tthis.element.appendChild(el);\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitializeElement(){\r\n\t\tif(this.table.options.footerElement){\r\n\r\n\t\t\tswitch(typeof this.table.options.footerElement){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tif(this.table.options.footerElement[0] === \"<\"){\r\n\t\t\t\t\tthis.containerElement.innerHTML = this.table.options.footerElement;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.external = true;\r\n\t\t\t\t\tthis.containerElement = document.querySelector(this.table.options.footerElement);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\tthis.element = this.table.options.footerElement;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\tappend(element){\r\n\t\tthis.activate();\r\n\r\n\t\tthis.containerElement.appendChild(element);\r\n\t\tthis.table.rowManager.adjustTableSize();\r\n\t}\r\n\r\n\tprepend(element){\r\n\t\tthis.activate();\r\n\r\n\t\tthis.element.insertBefore(element, this.element.firstChild);\r\n\t\tthis.table.rowManager.adjustTableSize();\r\n\t}\r\n\r\n\tremove(element){\r\n\t\telement.parentNode.removeChild(element);\r\n\t\tthis.deactivate();\r\n\t}\r\n\r\n\tdeactivate(force){\r\n\t\tif(!this.element.firstChild || force){\r\n\t\t\tif(!this.external){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\t\t\tthis.active = false;\r\n\t\t}\r\n\t}\r\n\r\n\tactivate(){\r\n\t\tif(!this.active){\r\n\t\t\tthis.active = true;\r\n\t\t\tif(!this.external){\r\n\t\t\t\tthis.table.element.appendChild(this.getElement());\r\n\t\t\t\tthis.table.element.style.display = '';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tredraw(){\r\n\t\tthis.dispatch(\"footer-redraw\")\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from './Helpers.js';\r\nimport Row from '../row/Row.js';\r\n\r\nexport default class InteractionManager extends CoreFeature {\r\n\t\r\n\tconstructor (table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.el = null;\r\n\t\t\r\n\t\tthis.abortClasses = [\"tabulator-headers\", \"tabulator-table\"];\r\n\t\t\r\n\t\tthis.previousTargets = {};\r\n\t\t\r\n\t\tthis.listeners = [\r\n\t\t\t\"click\",\r\n\t\t\t\"dblclick\",\r\n\t\t\t\"contextmenu\",\r\n\t\t\t\"mouseenter\",\r\n\t\t\t\"mouseleave\",\r\n\t\t\t\"mouseover\",\r\n\t\t\t\"mouseout\",\r\n\t\t\t\"mousemove\",\r\n\t\t\t\"touchstart\",\r\n\t\t\t\"touchend\",\r\n\t\t];\r\n\t\t\r\n\t\tthis.componentMap = {\r\n\t\t\t\"tabulator-cell\":\"cell\",\r\n\t\t\t\"tabulator-row\":\"row\",\r\n\t\t\t\"tabulator-group\":\"group\",\r\n\t\t\t\"tabulator-col\":\"column\",\r\n\t\t};\r\n\t\t\r\n\t\tthis.pseudoTrackers = {\r\n\t\t\t\"row\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"cell\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"group\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"column\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t}\r\n\t\t\r\n\t\tthis.pseudoTracking = false;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.el = this.table.element;\r\n\t\t\r\n\t\tthis.buildListenerMap();\r\n\t\tthis.bindSubscriptionWatchers();\r\n\t}\r\n\t\r\n\tbuildListenerMap(){\r\n\t\tvar listenerMap = {};\r\n\t\t\r\n\t\tthis.listeners.forEach((listener) => {\r\n\t\t\tlistenerMap[listener] = {\r\n\t\t\t\thandler:null,\r\n\t\t\t\tcomponents:[],\r\n\t\t\t}\r\n\t\t})\r\n\t\t\r\n\t\tthis.listeners = listenerMap;\r\n\t}\r\n\t\r\n\tbindPseudoEvents(){\r\n\t\tObject.keys(this.pseudoTrackers).forEach((key) => {\r\n\t\t\tthis.pseudoTrackers[key].subscriber = this.pseudoMouseEnter.bind(this, key);\r\n\t\t\tthis.subscribe(key + \"-mouseover\", this.pseudoTrackers[key].subscriber);\r\n\t\t});\r\n\t\t\r\n\t\tthis.pseudoTracking = true;\r\n\t}\r\n\t\r\n\tpseudoMouseEnter(key, e, target){\r\n\t\tif(this.pseudoTrackers[key].target !== target){\r\n\t\t\t\r\n\t\t\tif(this.pseudoTrackers[key].target){\r\n\t\t\t\tthis.dispatch(key + \"-mouseleave\", e, this.pseudoTrackers[key].target);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.pseudoMouseLeave(key, e);\r\n\t\t\t\r\n\t\t\tthis.pseudoTrackers[key].target = target;\r\n\t\t\t\r\n\t\t\tthis.dispatch(key + \"-mouseenter\", e, target);\r\n\t\t}\r\n\t}\r\n\t\r\n\tpseudoMouseLeave(key, e){\r\n\t\tvar leaveList = Object.keys(this.pseudoTrackers),\r\n\t\tlinkedKeys = {\r\n\t\t\t\"row\":[\"cell\"],\r\n\t\t\t\"cell\":[\"row\"],\r\n\t\t};\r\n\t\t\r\n\t\tleaveList = leaveList.filter((item) => {\r\n\t\t\tvar links = linkedKeys[key];\r\n\t\t\treturn item !== key && (!links || (links && !links.includes(item)));\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\tleaveList.forEach((key) => {\r\n\t\t\tvar target = this.pseudoTrackers[key].target;\r\n\t\t\t\r\n\t\t\tif(this.pseudoTrackers[key].target){\r\n\t\t\t\tthis.dispatch(key + \"-mouseleave\", e, target);\r\n\t\t\t\t\r\n\t\t\t\tthis.pseudoTrackers[key].target = null;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t\r\n\tbindSubscriptionWatchers(){\r\n\t\tvar listeners = Object.keys(this.listeners),\r\n\t\tcomponents = Object.values(this.componentMap);\r\n\t\t\r\n\t\tfor(let comp of components){\r\n\t\t\tfor(let listener of listeners){\r\n\t\t\t\tlet key = comp + \"-\" + listener;\r\n\t\t\t\t\r\n\t\t\t\tthis.subscriptionChange(key, this.subscriptionChanged.bind(this, comp, listener));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.subscribe(\"table-destroy\", this.clearWatchers.bind(this))\r\n\t}\r\n\t\r\n\tsubscriptionChanged(component, key, added){\r\n\t\tvar listener = this.listeners[key].components,\r\n\t\tindex = listener.indexOf(component),\r\n\t\tchanged = false;\r\n\t\t\r\n\t\tif(added){\r\n\t\t\tif(index === -1){\r\n\t\t\t\tlistener.push(component);\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!this.subscribed(component + \"-\" + key)){\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tlistener.splice(index, 1);\r\n\t\t\t\t\tchanged = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif((key === \"mouseenter\" || key === \"mouseleave\") && !this.pseudoTracking){\r\n\t\t\tthis.bindPseudoEvents();\r\n\t\t}\r\n\t\t\r\n\t\tif(changed){\r\n\t\t\tthis.updateEventListeners();\r\n\t\t}\r\n\t}\r\n\t\r\n\tupdateEventListeners(){\r\n\t\tfor(let key in this.listeners){\r\n\t\t\tlet listener = this.listeners[key];\r\n\t\t\t\r\n\t\t\tif(listener.components.length){\r\n\t\t\t\tif(!listener.handler){\r\n\t\t\t\t\tlistener.handler = this.track.bind(this, key);\r\n\t\t\t\t\tthis.el.addEventListener(key, listener.handler)\r\n\t\t\t\t\t// this.el.addEventListener(key, listener.handler, {passive: true})\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(listener.handler){\r\n\t\t\t\t\tthis.el.removeEventListener(key, listener.handler)\r\n\t\t\t\t\tlistener.handler = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\ttrack(type, e){\r\n\t\tvar path = (e.composedPath && e.composedPath()) || e.path;\r\n\t\t\r\n\t\tvar targets = this.findTargets(path);\r\n\t\ttargets = this.bindComponents(type, targets);\r\n\t\t\r\n\t\tthis.triggerEvents(type, e, targets);\r\n\t\t\r\n\t\tif(this.pseudoTracking && (type == \"mouseover\" || type == \"mouseleave\") && !Object.keys(targets).length){\r\n\t\t\tthis.pseudoMouseLeave(\"none\", e);\r\n\t\t}\r\n\t}\r\n\t\r\n\tfindTargets(path){\r\n\t\tvar targets = {};\r\n\t\t\r\n\t\tlet componentMap = Object.keys(this.componentMap);\r\n\t\t\r\n\t\tfor (let el of path) {\r\n\t\t\tlet classList = el.classList ? [...el.classList] : [];\r\n\t\t\t\r\n\t\t\tlet abort = classList.filter((item) => {\r\n\t\t\t\treturn this.abortClasses.includes(item);\r\n\t\t\t})\r\n\t\t\t\r\n\t\t\tif(abort.length){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tlet elTargets = classList.filter((item) => {\r\n\t\t\t\treturn componentMap.includes(item);\r\n\t\t\t})\r\n\t\t\t\r\n\t\t\tfor (let target of elTargets) {\r\n\t\t\t\ttargets[this.componentMap[target]] = el;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(targets.group && targets.group === targets.row){\r\n\t\t\tdelete targets.row;\r\n\t\t}\r\n\t\t\r\n\t\treturn targets;\r\n\t}\r\n\t\r\n\tbindComponents(type, targets){\r\n\t\t//ensure row component is looked up before cell\r\n\t\tvar keys = Object.keys(targets).reverse(),\r\n\t\tlistener = this.listeners[type],\r\n\t\ttargetMatches = {};\r\n\t\t\r\n\t\tfor(let key of keys){\r\n\t\t\tlet component;\r\n\t\t\tlet target = targets[key];\r\n\t\t\tlet previousTarget = this.previousTargets[key];\r\n\t\t\t\r\n\t\t\tif(previousTarget && previousTarget.target === target){\r\n\t\t\t\tcomponent = previousTarget.component;\r\n\t\t\t}else{\r\n\t\t\t\tswitch(key){\r\n\t\t\t\t\tcase \"row\":\r\n\t\t\t\t\tcase \"group\":\r\n\t\t\t\t\tif(listener.components.includes(\"row\") || listener.components.includes(\"cell\") || listener.components.includes(\"group\")){\r\n\t\t\t\t\t\tlet rows = this.table.rowManager.getVisibleRows(true);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcomponent = rows.find((row) => {\r\n\t\t\t\t\t\t\treturn row.getElement() === target;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(targets[\"row\"] && targets[\"row\"].parentNode && targets[\"row\"].parentNode.closest(\".tabulator-row\")){\r\n\t\t\t\t\t\t\ttargets[key] = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"column\":\r\n\t\t\t\t\tif(listener.components.includes(\"column\")){\r\n\t\t\t\t\t\tcomponent = this.table.columnManager.findColumn(target);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"cell\":\r\n\t\t\t\t\tif(listener.components.includes(\"cell\")){\r\n\t\t\t\t\t\tif(targets[\"row\"] instanceof Row){\r\n\t\t\t\t\t\t\tcomponent = targets[\"row\"].findCell(target);\r\n\t\t\t\t\t\t}else{\t\r\n\t\t\t\t\t\t\tif(targets[\"row\"]){\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?\")\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(component){\r\n\t\t\t\ttargets[key] = component;\r\n\t\t\t\ttargetMatches[key] = {\r\n\t\t\t\t\ttarget:target,\r\n\t\t\t\t\tcomponent:component,\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.previousTargets = targetMatches;\r\n\t\t\r\n\t\treturn targets;\r\n\t}\r\n\t\r\n\ttriggerEvents(type, e, targets){\r\n\t\tvar listener = this.listeners[type];\r\n\t\t\r\n\t\tfor(let key in targets){\r\n\t\t\tif(targets[key] && listener.components.includes(key)){\r\n\t\t\t\tthis.dispatch(key + \"-\" + type, e, targets[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearWatchers(){\r\n\t\tfor(let key in this.listeners){\r\n\t\t\tlet listener = this.listeners[key];\r\n\t\t\t\r\n\t\t\tif(listener.handler){\r\n\t\t\t\tthis.el.removeEventListener(key, listener.handler)\r\n\t\t\t\tlistener.handler = null;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}","export default class ComponentFunctionBinder{\r\n\r\n\tconstructor(table){\r\n\t\tthis.table = table;\r\n\r\n\t\tthis.bindings = {};\r\n\t}\r\n\r\n\tbind(type, funcName, handler){\r\n\t\tif(!this.bindings[type]){\r\n\t\t\tthis.bindings[type] = {};\r\n\t\t}\r\n\r\n\t\tif(this.bindings[type][funcName]){\r\n\t\t\tconsole.warn(\"Unable to bind component handler, a matching function name is already bound\", type, funcName, handler)\r\n\t\t}else{\r\n\t\t\tthis.bindings[type][funcName] = handler;\r\n\t\t}\r\n\t}\r\n\r\n\thandle(type, component, name){\r\n\t\tif(this.bindings[type] && this.bindings[type][name] && typeof this.bindings[type][name].bind === 'function'){\r\n\t\t\treturn this.bindings[type][name].bind(null, component);\r\n\t\t}else{\r\n\t\t\tif(name !== \"then\" && typeof name === \"string\" && !name.startsWith(\"_\")){\r\n\t\t\t\t\tconsole.error(\"The \" + type + \" component does not have a \" + name + \" function, have you checked that you have the correct Tabulator module installed?\")\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n","import CoreFeature from '../CoreFeature.js';\r\n\r\nexport default class DataLoader extends CoreFeature{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.requestOrder = 0; //prevent requests coming out of sequence if overridden by another load request\r\n\t\tthis.loading = false;\r\n\t}\r\n\r\n\tinitialize(){}\r\n\r\n\tload(data, params, config, replace, silent, columnsChanged){\r\n\t\tvar requestNo = ++this.requestOrder;\r\n\r\n\t\tthis.dispatchExternal(\"dataLoading\", data);\r\n\r\n\t\t//parse json data to array\r\n\t\tif (data && (data.indexOf(\"{\") == 0 || data.indexOf(\"[\") == 0)){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\r\n\t\tif(this.confirm(\"data-loading\", [data, params, config, silent])){\r\n\t\t\tthis.loading = true;\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.alertLoader();\r\n\t\t\t}\r\n\r\n\t\t\t//get params for request\r\n\t\t\tparams = this.chain(\"data-params\", [data, config, silent], params || {}, params || {});\r\n\r\n\t\t\tparams = this.mapParams(params, this.table.options.dataSendParams);\r\n\r\n\t\t\tvar result = this.chain(\"data-load\", [data, params, config, silent], false, Promise.resolve([]));\r\n\t\t\t\r\n\t\t\treturn result.then((response) => {\r\n\t\t\t\tif(!Array.isArray(response) && typeof response == \"object\"){\r\n\t\t\t\t\tresponse = this.mapParams(response, this.objectInvert(this.table.options.dataReceiveParams));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar rowData = this.chain(\"data-loaded\", response, null, response);\r\n\r\n\t\t\t\tif(requestNo == this.requestOrder){\r\n\t\t\t\t\tthis.clearAlert();\r\n\r\n\t\t\t\t\tif(rowData !== false){\r\n\t\t\t\t\t\tthis.dispatchExternal(\"dataLoaded\", rowData);\r\n\t\t\t\t\t\tthis.table.rowManager.setData(rowData, replace, typeof columnsChanged === \"undefined\" ? !replace : columnsChanged);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made\");\r\n\t\t\t\t}\r\n\t\t\t}).catch((error) => {\r\n\t\t\t\tconsole.error(\"Data Load Error: \", error);\r\n\t\t\t\tthis.dispatchExternal(\"dataLoadError\", error);\r\n\r\n\t\t\t\tif(!silent){\r\n\t\t\t\t\tthis.alertError();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tthis.clearAlert();\r\n\t\t\t\t}, this.table.options.dataLoaderErrorTimeout);\r\n\t\t\t})\r\n\t\t\t.finally(() => {\r\n\t\t\t\tthis.loading = false;\r\n\t\t\t})\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"dataLoaded\", data);\r\n\r\n\t\t\tif(!data){\r\n\t\t\t\tdata = [];\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.rowManager.setData(data, replace, typeof columnsChanged === \"undefined\" ? !replace : columnsChanged);\r\n\t\t\treturn Promise.resolve();\r\n\t\t}\r\n\t}\r\n\r\n\tmapParams(params, map){\r\n\t\tvar output = {};\r\n\r\n\t\tfor(let key in params){\r\n\t\t\toutput[map.hasOwnProperty(key) ? map[key] : key] = params[key];\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tobjectInvert(obj){\r\n\t\tvar output = {};\r\n\r\n\t\tfor(let key in obj){\r\n\t\t\toutput[obj[key]] = key;\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tblockActiveLoad(){\r\n\t\tthis.requestOrder++;\r\n\t}\r\n\r\n\talertLoader(){\r\n\t\tvar shouldLoad = typeof this.table.options.dataLoader === \"function\" ? this.table.options.dataLoader() : this.table.options.dataLoader;\r\n\r\n\t\tif(shouldLoad){\r\n\t\t\tthis.table.alertManager.alert(this.table.options.dataLoaderLoading || this.langText(\"data|loading\"));\r\n\t\t}\r\n\t}\r\n\r\n\talertError(){\r\n\t\tthis.table.alertManager.alert(this.table.options.dataLoaderError || this.langText(\"data|error\"), \"error\");\r\n\t}\r\n\r\n\tclearAlert(){\r\n\t\tthis.table.alertManager.clear();\r\n\t}\r\n}","export default class ExternalEventBus {\r\n\r\n\tconstructor(table, optionsList, debug){\r\n\t\tthis.table = table;\r\n\t\tthis.events = {};\r\n\t\tthis.optionsList = optionsList || {};\r\n\t\tthis.subscriptionNotifiers = {};\r\n\r\n\t\tthis.dispatch = debug ? this._debugDispatch.bind(this) : this._dispatch.bind(this);\r\n\t\tthis.debug = debug;\r\n\t}\r\n\r\n\tsubscriptionChange(key, callback){\r\n\t\tif(!this.subscriptionNotifiers[key]){\r\n\t\t\tthis.subscriptionNotifiers[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.subscriptionNotifiers[key].push(callback);\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis._notifiySubscriptionChange(key, true);\r\n\t\t}\r\n\t}\r\n\r\n\tsubscribe(key, callback){\r\n\t\tif(!this.events[key]){\r\n\t\t\tthis.events[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.events[key].push(callback);\r\n\r\n\t\tthis._notifiySubscriptionChange(key, true);\r\n\t}\r\n\r\n\tunsubscribe(key, callback){\r\n\t\tvar index;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tif(callback){\r\n\t\t\t\tindex = this.events[key].findIndex((item) => {\r\n\t\t\t\t\treturn item === callback;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tthis.events[key].splice(index, 1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Cannot remove event, no matching event found:\", key, callback);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tdelete this.events[key];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cannot remove event, no events set on:\", key);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._notifiySubscriptionChange(key, false);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.events[key] && this.events[key].length;\r\n\t}\r\n\r\n\t_notifiySubscriptionChange(key, subscribed){\r\n\t\tvar notifiers = this.subscriptionNotifiers[key];\r\n\r\n\t\tif(notifiers){\r\n\t\t\tnotifiers.forEach((callback)=>{\r\n\t\t\t\tcallback(subscribed);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_dispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args.shift(),\r\n\t\tresult;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tthis.events[key].forEach((callback, i) => {\r\n\t\t\t\tlet callResult = callback.apply(this.table, args);\r\n\r\n\t\t\t\tif(!i){\r\n\t\t\t\t\tresult = callResult;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\t_debugDispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"ExternalEvent:\" + args[0];\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._dispatch(...arguments)\r\n\t}\r\n}","export default class InternalEventBus {\r\n\r\n\tconstructor(debug){\r\n\t\tthis.events = {};\r\n\t\tthis.subscriptionNotifiers = {};\r\n\r\n\t\tthis.dispatch = debug ? this._debugDispatch.bind(this) : this._dispatch.bind(this);\r\n\t\tthis.chain = debug ? this._debugChain.bind(this) : this._chain.bind(this);\r\n\t\tthis.confirm = debug ? this._debugConfirm.bind(this) : this._confirm.bind(this);\r\n\t\tthis.debug = debug;\r\n\t}\r\n\r\n\tsubscriptionChange(key, callback){\r\n\t\tif(!this.subscriptionNotifiers[key]){\r\n\t\t\tthis.subscriptionNotifiers[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.subscriptionNotifiers[key].push(callback);\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis._notifiySubscriptionChange(key, true);\r\n\t\t}\r\n\t}\r\n\r\n\tsubscribe(key, callback, priority = 10000){\r\n\t\tif(!this.events[key]){\r\n\t\t\tthis.events[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.events[key].push({callback, priority});\r\n\r\n\t\tthis.events[key].sort((a, b) => {\r\n\t\t\treturn a.priority - b.priority;\r\n\t\t});\r\n\r\n\t\tthis._notifiySubscriptionChange(key, true);\r\n\t}\r\n\r\n\tunsubscribe(key, callback){\r\n\t\tvar index;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tif(callback){\r\n\t\t\t\tindex = this.events[key].findIndex((item) => {\r\n\t\t\t\t\treturn item.callback === callback;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tthis.events[key].splice(index, 1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Cannot remove event, no matching event found:\", key, callback);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cannot remove event, no events set on:\", key);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._notifiySubscriptionChange(key, false);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.events[key] && this.events[key].length;\r\n\t}\r\n\r\n\t_chain(key, args, initialValue, fallback){\r\n\t\tvar value = initialValue;\r\n\r\n\t\tif(!Array.isArray(args)){\r\n\t\t\targs = [args];\r\n\t\t}\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis.events[key].forEach((subscriber, i) => {\r\n\t\t\t\tvalue = subscriber.callback.apply(this, args.concat([value]));\r\n\t\t\t});\r\n\r\n\t\t\treturn value;\r\n\t\t}else{\r\n\t\t\treturn typeof fallback === \"function\" ? fallback() : fallback;\r\n\t\t}\r\n\t}\r\n\r\n\t_confirm(key, args){\r\n\t\tvar confirmed = false;\r\n\r\n\t\tif(!Array.isArray(args)){\r\n\t\t\targs = [args];\r\n\t\t}\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis.events[key].forEach((subscriber, i) => {\r\n\t\t\t\tif(subscriber.callback.apply(this, args)){\r\n\t\t\t\t\tconfirmed = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn confirmed;\r\n\t}\r\n\r\n\t_notifiySubscriptionChange(key, subscribed){\r\n\t\tvar notifiers = this.subscriptionNotifiers[key];\r\n\r\n\t\tif(notifiers){\r\n\t\t\tnotifiers.forEach((callback)=>{\r\n\t\t\t\tcallback(subscribed);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_dispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args.shift();\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tthis.events[key].forEach((subscriber) => {\r\n\t\t\t\tlet callResult = subscriber.callback.apply(this, args);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_debugDispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._dispatch(...arguments);\r\n\t}\r\n\r\n\t_debugChain(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._chain(...arguments);\r\n\t}\r\n\r\n\t_debugConfirm(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._confirm(...arguments);\r\n\t}\r\n}","import Tabulator from '../Tabulator.js';\r\n\r\nclass TableRegistry {\r\n\r\n\tstatic register(table){\r\n\t\tTableRegistry.tables.push(table);\r\n\t}\r\n\r\n\tstatic deregister(table){\r\n\t\tvar index = TableRegistry.tables.indexOf(table);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tTableRegistry.tables.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\tstatic lookupTable(query, silent){\r\n\t\tvar results = [],\r\n\t\tmatches, match;\r\n\r\n\t\tif(typeof query === \"string\"){\r\n\t\t\tmatches = document.querySelectorAll(query);\r\n\r\n\t\t\tif(matches.length){\r\n\t\t\t\tfor(var i = 0; i < matches.length; i++){\r\n\t\t\t\t\tmatch = TableRegistry.matchElement(matches[i]);\r\n\r\n\t\t\t\t\tif(match){\r\n\t\t\t\t\t\tresults.push(match);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}else if((typeof HTMLElement !== \"undefined\" && query instanceof HTMLElement) || query instanceof Tabulator){\r\n\t\t\tmatch = TableRegistry.matchElement(query);\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tresults.push(match);\r\n\t\t\t}\r\n\t\t}else if(Array.isArray(query)){\r\n\t\t\tquery.forEach(function(item){\r\n\t\t\t\tresults = results.concat(TableRegistry.lookupTable(item));\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Table Connection Error - Invalid Selector\", query);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\tstatic matchElement(element){\r\n\t\treturn TableRegistry.tables.find(function(table){\r\n\t\t\treturn element instanceof Tabulator ? table === element : table.element === element;\r\n\t\t});\r\n\t}\r\n}\r\n\r\nTableRegistry.tables = [];\r\n\r\nexport default TableRegistry;","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from './Helpers.js';\r\n\r\nexport default class Popup extends CoreFeature{\r\n constructor(table, element, parent){\r\n super(table);\r\n \r\n this.element = element;\r\n this.container = this._lookupContainer();\r\n \r\n this.parent = parent;\r\n \r\n this.reversedX = false;\r\n this.childPopup = null;\r\n this.blurable = false;\r\n this.blurCallback = null;\r\n this.renderedCallback = null;\r\n \r\n this.visible = false;\r\n \r\n this.element.classList.add(\"tabulator-popup-container\");\r\n \r\n this.blurEvent = this.hide.bind(this, false);\r\n this.escEvent = this._escapeCheck.bind(this);\r\n }\r\n \r\n _lookupContainer(){\r\n var container = this.table.options.popupContainer;\r\n \r\n if(typeof container === \"string\"){\r\n container = document.querySelector(container);\r\n \r\n if(!container){\r\n console.warn(\"Menu Error - no container element found matching selector:\", this.table.options.popupContainer , \"(defaulting to document body)\");\r\n }\r\n }else if (container === true){\r\n container = this.table.element;\r\n }\r\n \r\n if(container && !this._checkContainerIsParent(container)){\r\n container = false;\r\n console.warn(\"Menu Error - container element does not contain this table:\", this.table.options.popupContainer , \"(defaulting to document body)\");\r\n }\r\n \r\n if(!container){\r\n container = document.body;\r\n }\r\n \r\n return container;\r\n }\r\n \r\n _checkContainerIsParent(container, element = this.table.element){\r\n if(container === element){\r\n return true;\r\n }else{\r\n return element.parentNode ? this._checkContainerIsParent(container, element.parentNode) : false;\r\n }\r\n }\r\n \r\n renderCallback(callback){\r\n this.renderedCallback = callback;\r\n }\r\n \r\n containerEventCoords(e){\r\n var touch = !(e instanceof MouseEvent);\r\n \r\n var x = touch ? e.touches[0].pageX : e.pageX;\r\n var y = touch ? e.touches[0].pageY : e.pageY;\r\n \r\n if(this.container !== document.body){\r\n let parentOffset = Helpers.elOffset(this.container);\r\n \r\n x -= parentOffset.left;\r\n y -= parentOffset.top;\r\n }\r\n \r\n return {x, y};\r\n }\r\n \r\n elementPositionCoords(element, position = \"right\"){\r\n var offset = Helpers.elOffset(element),\r\n containerOffset, x, y;\r\n \r\n if(this.container !== document.body){\r\n containerOffset = Helpers.elOffset(this.container);\r\n \r\n offset.left -= containerOffset.left;\r\n offset.top -= containerOffset.top;\r\n }\r\n \r\n switch(position){\r\n case \"right\":\r\n x = offset.left + element.offsetWidth;\r\n y = offset.top - 1;\r\n break;\r\n \r\n case \"bottom\":\r\n x = offset.left;\r\n y = offset.top + element.offsetHeight;\r\n break;\r\n }\r\n \r\n return {x, y, offset};\r\n }\r\n \r\n show(origin, position){\r\n var x, y, parentEl, parentOffset, containerOffset, coords;\r\n \r\n if(origin instanceof HTMLElement){\r\n parentEl = origin;\r\n coords = this.elementPositionCoords(origin, position);\r\n \r\n parentOffset = coords.offset;\r\n x = coords.x;\r\n y = coords.y;\r\n \r\n }else if(typeof origin === \"number\"){\r\n parentOffset = {top:0, left:0};\r\n x = origin;\r\n y = position;\r\n }else{\r\n coords = this.containerEventCoords(origin);\r\n \r\n x = coords.x;\r\n y = coords.y;\r\n \r\n this.reversedX = false;\r\n }\r\n \r\n this.element.style.top = y + \"px\";\r\n this.element.style.left = x + \"px\";\r\n \r\n this.container.appendChild(this.element);\r\n \r\n if(typeof this.renderedCallback === \"function\"){\r\n this.renderedCallback();\r\n }\r\n \r\n this._fitToScreen(x, y, parentEl, parentOffset, position);\r\n \r\n this.visible = true;\r\n \r\n return this;\r\n }\r\n \r\n _fitToScreen(x, y, parentEl, parentOffset, position){\r\n var scrollTop = this.container === document.body ? document.documentElement.scrollTop : this.container.scrollTop;\r\n\r\n //move menu to start on right edge if it is too close to the edge of the screen\r\n if((x + this.element.offsetWidth) >= this.container.offsetWidth || this.reversedX){\r\n this.element.style.left = \"\";\r\n \r\n if(parentEl){\r\n this.element.style.right = (this.container.offsetWidth - parentOffset.left) + \"px\";\r\n }else{\r\n this.element.style.right = (this.container.offsetWidth - x) + \"px\";\r\n }\r\n \r\n this.reversedX = true;\r\n }\r\n\r\n //move menu to start on bottom edge if it is too close to the edge of the screen\r\n if((y + this.element.offsetHeight) > Math.max(this.container.offsetHeight, scrollTop ? this.container.scrollHeight : 0)) {\r\n if(parentEl){\r\n switch(position){\r\n case \"bottom\":\r\n this.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight - parentEl.offsetHeight - 1) + \"px\";\r\n break;\r\n\r\n default:\r\n this.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight + parentEl.offsetHeight + 1) + \"px\";\r\n }\r\n \r\n }else{\r\n this.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight) + \"px\";\r\n }\r\n }\r\n }\r\n \r\n isVisible(){\r\n return this.visible;\r\n }\r\n \r\n hideOnBlur(callback){\r\n this.blurable = true;\r\n \r\n if(this.visible){\r\n setTimeout(() => {\r\n this.table.rowManager.element.addEventListener(\"scroll\", this.blurEvent);\r\n this.subscribe(\"cell-editing\", this.blurEvent);\r\n document.body.addEventListener(\"click\", this.blurEvent);\r\n document.body.addEventListener(\"contextmenu\", this.blurEvent);\r\n window.addEventListener(\"resize\", this.blurEvent);\r\n document.body.addEventListener(\"keydown\", this.escEvent);\r\n }, 100);\r\n \r\n this.blurCallback = callback;\r\n }\r\n \r\n return this;\r\n }\r\n \r\n _escapeCheck(e){\r\n if(e.keyCode == 27){\r\n this.hide();\r\n }\r\n }\r\n \r\n hide(silent = false){\r\n if(this.visible){\r\n if(this.blurable){\r\n document.body.removeEventListener(\"keydown\", this.escEvent);\r\n document.body.removeEventListener(\"click\", this.blurEvent);\r\n document.body.removeEventListener(\"contextmenu\", this.blurEvent);\r\n window.removeEventListener(\"resize\", this.blurEvent);\r\n this.table.rowManager.element.removeEventListener(\"scroll\", this.blurEvent);\r\n this.unsubscribe(\"cell-editing\", this.blurEvent);\r\n }\r\n \r\n if(this.childPopup){\r\n this.childPopup.hide();\r\n }\r\n \r\n if(this.parent){\r\n this.parent.childPopup = null;\r\n }\r\n \r\n if(this.element.parentNode){\r\n this.element.parentNode.removeChild(this.element);\r\n }\r\n\r\n this.visible = false;\r\n\r\n if(this.blurCallback && !silent){\r\n this.blurCallback();\r\n }\r\n }\r\n \r\n return this;\r\n }\r\n \r\n child(element){\r\n if(this.childPopup){\r\n this.childPopup.hide();\r\n }\r\n \r\n this.childPopup = new Popup(this.table, element, this);\r\n \r\n return this.childPopup;\r\n }\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Popup from './tools/Popup.js';\r\n\r\nclass Module extends CoreFeature{\r\n\r\n\tconstructor(table, name){\r\n\t\tsuper(table);\r\n\r\n\t\tthis._handler = null;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\t// setup module when table is initialized, to be overriden in module\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t////// Options Registration ///////\r\n\t///////////////////////////////////\r\n\r\n\tregisterTableOption(key, value){\r\n\t\tthis.table.optionsList.register(key, value);\r\n\t}\r\n\r\n\tregisterColumnOption(key, value){\r\n\t\tthis.table.columnManager.optionsList.register(key, value);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t/// Public Function Registration ///\r\n\t///////////////////////////////////\r\n\r\n\tregisterTableFunction(name, func){\r\n\t\tif(typeof this.table[name] === \"undefined\"){\r\n\t\t\tthis.table[name] = (...args) => {\r\n\t\t\t\tthis.table.initGuard(name);\r\n\r\n\t\t\t\treturn func(...args);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Unable to bind table function, name already in use\", name)\r\n\t\t}\r\n\t}\r\n\r\n\tregisterComponentFunction(component, func, handler){\r\n\t\treturn this.table.componentFunctionBinder.bind(component, func, handler);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t////////// Data Pipeline //////////\r\n\t///////////////////////////////////\r\n\r\n\tregisterDataHandler(handler, priority){\r\n\t\tthis.table.rowManager.registerDataPipelineHandler(handler, priority)\r\n\t\tthis._handler = handler;\r\n\t}\r\n\r\n\tregisterDisplayHandler(handler, priority){\r\n\t\tthis.table.rowManager.registerDisplayPipelineHandler(handler, priority)\r\n\t\tthis._handler = handler;\r\n\t}\r\n\r\n\trefreshData(renderInPosition, handler){\r\n\t\tif(!handler){\r\n\t\t\thandler = this._handler;\r\n\t\t}\r\n\r\n\t\tif(handler){\r\n\t\t\tthis.table.rowManager.refreshActiveData(handler, false, renderInPosition);\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t//////// Footer Management ////////\r\n\t///////////////////////////////////\r\n\r\n\tfooterAppend(element){\r\n\t\treturn this.table.footerManager.append(element)\r\n\t}\r\n\r\n\tfooterPrepend(element){\r\n\t\treturn this.table.footerManager.prepend(element)\r\n\t}\r\n\r\n\tfooterRemove(element){\r\n\t\treturn this.table.footerManager.remove(element)\r\n\t} \r\n\r\n\t///////////////////////////////////\r\n\t//////// Popups Management ////////\r\n\t///////////////////////////////////\r\n\t\r\n\tpopup(menuEl, menuContainer){\r\n\t\treturn new Popup(this.table, menuEl, menuContainer);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t//////// Alert Management ////////\r\n\t///////////////////////////////////\r\n\r\n\talert(content, type){\r\n\t\treturn this.table.alertManager.alert(content, type);\r\n\t}\r\n\r\n\tclearAlert(){\r\n\t\treturn this.table.alertManager.clear();\r\n\t}\r\n\t\r\n}\r\n\r\nexport default Module;","//resize columns to fit data they contain\r\nexport default function(columns){\r\n\tthis.table.columnManager.renderer.reinitializeColumnWidths(columns);\r\n\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n};","//resize columns to fit data they contain and stretch row to fill table, also used for fitDataTable\r\nexport default function(columns){\r\n\tcolumns.forEach(function(column){\r\n\t\tcolumn.reinitializeWidth();\r\n\t});\r\n\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n};","//resize columns to fit data the contain and stretch last column to fill table\r\nexport default function(columns){\r\n\tvar colsWidth = 0,\r\n\ttableWidth = this.table.rowManager.element.clientWidth,\r\n\tgap = 0,\r\n\tlastCol = false;\r\n\r\n\tcolumns.forEach((column, i) => {\r\n\t\tif(!column.widthFixed){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t}\r\n\r\n\t\tif(this.table.options.responsiveLayout ? column.modules.responsive.visible : column.visible){\r\n\t\t\tlastCol = column;\r\n\t\t}\r\n\r\n\t\tif(column.visible){\r\n\t\t\tcolsWidth += column.getWidth();\r\n\t\t}\r\n\t});\r\n\r\n\tif(lastCol){\r\n\t\tgap = tableWidth - colsWidth + lastCol.getWidth();\r\n\r\n\t\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\t\tlastCol.setWidth(0);\r\n\t\t\tthis.table.modules.responsiveLayout.update();\r\n\t\t}\r\n\r\n\t\tif(gap > 0){\r\n\t\t\tlastCol.setWidth(gap);\r\n\t\t}else{\r\n\t\t\tlastCol.reinitializeWidth();\r\n\t\t}\r\n\t}else{\r\n\t\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\t\tthis.table.modules.responsiveLayout.update();\r\n\t\t}\r\n\t}\r\n};","//resize columns to fit\r\nexport default function(columns){\r\n\tvar totalWidth = this.table.element.clientWidth; //table element width\r\n\tvar fixedWidth = 0; //total width of columns with a defined width\r\n\tvar flexWidth = 0; //total width available to flexible columns\r\n\tvar flexGrowUnits = 0; //total number of widthGrow blocks accross all columns\r\n\tvar flexColWidth = 0; //desired width of flexible columns\r\n\tvar flexColumns = []; //array of flexible width columns\r\n\tvar fixedShrinkColumns = []; //array of fixed width columns that can shrink\r\n\tvar flexShrinkUnits = 0; //total number of widthShrink blocks accross all columns\r\n\tvar overflowWidth = 0; //horizontal overflow width\r\n\tvar gapFill=0; //number of pixels to be added to final column to close and half pixel gaps\r\n\r\n\tfunction calcWidth(width){\r\n\t\tvar colWidth;\r\n\r\n\t\tif(typeof(width) == \"string\"){\r\n\t\t\tif(width.indexOf(\"%\") > -1){\r\n\t\t\t\tcolWidth = (totalWidth / 100) * parseInt(width);\r\n\t\t\t}else{\r\n\t\t\t\tcolWidth = parseInt(width);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcolWidth = width;\r\n\t\t}\r\n\r\n\t\treturn colWidth;\r\n\t}\r\n\r\n\t//ensure columns resize to take up the correct amount of space\r\n\tfunction scaleColumns(columns, freeSpace, colWidth, shrinkCols){\r\n\r\n\t\tvar oversizeCols = [],\r\n\t\toversizeSpace = 0,\r\n\t\tremainingSpace = 0,\r\n\t\tnextColWidth = 0,\r\n\t\tremainingFlexGrowUnits = flexGrowUnits,\r\n\t\tgap = 0,\r\n\t\tchangeUnits = 0,\r\n\t\tundersizeCols = [];\r\n\r\n\t\tfunction calcGrow(col){\r\n\t\t\treturn (colWidth * (col.column.definition.widthGrow || 1));\r\n\t\t}\r\n\r\n\t\tfunction calcShrink(col){\r\n\t\t\treturn (calcWidth(col.width) - (colWidth * (col.column.definition.widthShrink || 0)))\r\n\t\t}\r\n\r\n\t\tcolumns.forEach(function(col, i){\r\n\t\t\tvar width = shrinkCols ? calcShrink(col) : calcGrow(col);\r\n\t\t\tif(col.column.minWidth >= width){\r\n\t\t\t\toversizeCols.push(col);\r\n\t\t\t}else{\r\n\t\t\t\tif(col.column.maxWidth && col.column.maxWidth < width){\r\n\t\t\t\t\tcol.width = col.column.maxWidth;\r\n\t\t\t\t\tfreeSpace -= col.column.maxWidth;\r\n\r\n\t\t\t\t\tremainingFlexGrowUnits -= shrinkCols ? (col.column.definition.widthShrink || 1) : (col.column.definition.widthGrow || 1);\r\n\r\n\t\t\t\t\tif(remainingFlexGrowUnits){\r\n\t\t\t\t\t\tcolWidth = Math.floor(freeSpace/remainingFlexGrowUnits);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tundersizeCols.push(col);\r\n\t\t\t\t\tchangeUnits += shrinkCols ? (col.column.definition.widthShrink || 1) : (col.column.definition.widthGrow || 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(oversizeCols.length){\r\n\t\t\toversizeCols.forEach(function(col){\r\n\t\t\t\toversizeSpace += shrinkCols ? col.width - col.column.minWidth : col.column.minWidth;\r\n\t\t\t\tcol.width = col.column.minWidth;\r\n\t\t\t});\r\n\r\n\t\t\tremainingSpace = freeSpace - oversizeSpace;\r\n\r\n\t\t\tnextColWidth = changeUnits ? Math.floor(remainingSpace/changeUnits) : remainingSpace;\r\n\r\n\t\t\tgap = remainingSpace - (nextColWidth * changeUnits);\r\n\r\n\t\t\tgap += scaleColumns(undersizeCols, remainingSpace, nextColWidth, shrinkCols);\r\n\t\t}else{\r\n\t\t\tgap = changeUnits ? freeSpace - (Math.floor(freeSpace/changeUnits) * changeUnits) : freeSpace;\r\n\r\n\t\t\tundersizeCols.forEach(function(column){\r\n\t\t\t\tcolumn.width = shrinkCols ? calcShrink(column) : calcGrow(column);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn gap;\r\n\t}\r\n\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n\r\n\t//adjust for vertical scrollbar if present\r\n\tif(this.table.rowManager.element.scrollHeight > this.table.rowManager.element.clientHeight){\r\n\t\ttotalWidth -= this.table.rowManager.element.offsetWidth - this.table.rowManager.element.clientWidth;\r\n\t}\r\n\r\n\tcolumns.forEach(function(column){\r\n\t\tvar width, minWidth, colWidth;\r\n\r\n\t\tif(column.visible){\r\n\r\n\t\t\twidth = column.definition.width;\r\n\t\t\tminWidth = parseInt(column.minWidth);\r\n\r\n\t\t\tif(width){\r\n\r\n\t\t\t\tcolWidth = calcWidth(width);\r\n\r\n\t\t\t\tfixedWidth += colWidth > minWidth ? colWidth : minWidth;\r\n\r\n\t\t\t\tif(column.definition.widthShrink){\r\n\t\t\t\t\tfixedShrinkColumns.push({\r\n\t\t\t\t\t\tcolumn:column,\r\n\t\t\t\t\t\twidth:colWidth > minWidth ? colWidth : minWidth\r\n\t\t\t\t\t});\r\n\t\t\t\t\tflexShrinkUnits += column.definition.widthShrink;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tflexColumns.push({\r\n\t\t\t\t\tcolumn:column,\r\n\t\t\t\t\twidth:0,\r\n\t\t\t\t});\r\n\t\t\t\tflexGrowUnits += column.definition.widthGrow || 1;\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\t//calculate available space\r\n\tflexWidth = totalWidth - fixedWidth;\r\n\r\n\t//calculate correct column size\r\n\tflexColWidth = Math.floor(flexWidth / flexGrowUnits)\r\n\r\n\t//generate column widths\r\n\tvar gapFill = scaleColumns(flexColumns, flexWidth, flexColWidth, false);\r\n\r\n\t//increase width of last column to account for rounding errors\r\n\tif(flexColumns.length && gapFill > 0){\r\n\t\tflexColumns[flexColumns.length-1].width += + gapFill;\r\n\t}\r\n\r\n\t//caculate space for columns to be shrunk into\r\n\tflexColumns.forEach(function(col){\r\n\t\tflexWidth -= col.width;\r\n\t});\r\n\r\n\toverflowWidth = Math.abs(gapFill) + flexWidth;\r\n\r\n\t//shrink oversize columns if there is no available space\r\n\tif(overflowWidth > 0 && flexShrinkUnits){\r\n\t\tgapFill = scaleColumns(fixedShrinkColumns, overflowWidth, Math.floor(overflowWidth / flexShrinkUnits), true);\r\n\t}\r\n\r\n\t//decrease width of last column to account for rounding errors\r\n\tif(fixedShrinkColumns.length){\r\n\t\tfixedShrinkColumns[fixedShrinkColumns.length-1].width -= gapFill;\r\n\t}\r\n\r\n\tflexColumns.forEach(function(col){\r\n\t\tcol.column.setWidth(col.width);\r\n\t});\r\n\r\n\tfixedShrinkColumns.forEach(function(col){\r\n\t\tcol.column.setWidth(col.width);\r\n\t});\r\n};","import fitData from './modes/fitData.js';\r\nimport fitDataGeneral from './modes/fitDataGeneral.js';\r\nimport fitDataStretch from './modes/fitDataStretch.js';\r\nimport fitColumns from './modes/fitColumns.js';\r\n\r\nexport default {\r\n\tfitData:fitData,\r\n\tfitDataFill:fitDataGeneral,\r\n\tfitDataTable:fitDataGeneral,\r\n\tfitDataStretch:fitDataStretch,\r\n\tfitColumns:fitColumns ,\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultModes from './defaults/modes.js';\r\n\r\nclass Layout extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table, \"layout\");\r\n\r\n\t\tthis.mode = null;\r\n\r\n\t\tthis.registerTableOption(\"layout\", \"fitData\"); //layout type\r\n\t\tthis.registerTableOption(\"layoutColumnsOnNewData\", false); //update column widths on setData\r\n\r\n\t\tthis.registerColumnOption(\"widthGrow\");\r\n\t\tthis.registerColumnOption(\"widthShrink\");\r\n\t}\r\n\r\n\t//initialize layout system\r\n\tinitialize(){\r\n\t\tvar layout = this.table.options.layout;\r\n\r\n\t\tif(Layout.modes[layout]){\r\n\t\t\tthis.mode = layout;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Layout Error - invalid mode set, defaulting to 'fitData' : \" + layout);\r\n\t\t\tthis.mode = 'fitData';\r\n\t\t}\r\n\r\n\t\tthis.table.element.setAttribute(\"tabulator-layout\", this.mode);\r\n\t}\r\n\r\n\tgetMode(){\r\n\t\treturn this.mode;\r\n\t}\r\n\r\n\t//trigger table layout\r\n\tlayout(){\r\n\t\tthis.dispatch(\"layout-refreshing\")\r\n\t\tLayout.modes[this.mode].call(this, this.table.columnManager.columnsByIndex);\r\n\r\n\t\tthis.dispatch(\"layout-refreshed\")\r\n\t}\r\n}\r\n\r\nLayout.moduleName = \"layout\";\r\n\r\n//load defaults\r\nLayout.modes = defaultModes;\r\n\r\nexport default Layout;","export default {\r\n\t\"default\":{ //hold default locale text\r\n\t\t\"groups\":{\r\n\t\t\t\"item\":\"item\",\r\n\t\t\t\"items\":\"items\",\r\n\t\t},\r\n\t\t\"columns\":{\r\n\t\t},\r\n\t\t\"data\":{\r\n\t\t\t\"loading\":\"Loading\",\r\n\t\t\t\"error\":\"Error\",\r\n\t\t},\r\n\t\t\"pagination\":{\r\n\t\t\t\"page_size\":\"Page Size\",\r\n\t\t\t\"page_title\":\"Show Page\",\r\n\t\t\t\"first\":\"First\",\r\n\t\t\t\"first_title\":\"First Page\",\r\n\t\t\t\"last\":\"Last\",\r\n\t\t\t\"last_title\":\"Last Page\",\r\n\t\t\t\"prev\":\"Prev\",\r\n\t\t\t\"prev_title\":\"Prev Page\",\r\n\t\t\t\"next\":\"Next\",\r\n\t\t\t\"next_title\":\"Next Page\",\r\n\t\t\t\"all\":\"All\",\r\n\t\t\t\"counter\":{\r\n\t\t\t\t\"showing\": \"Showing\",\r\n\t\t\t\t\"of\": \"of\",\r\n\t\t\t\t\"rows\": \"rows\",\r\n\t\t\t\t\"pages\": \"pages\",\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"headerFilters\":{\r\n\t\t\t\"default\":\"filter column...\",\r\n\t\t\t\"columns\":{}\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defaultLangs from './defaults/langs.js';\r\n\r\nclass Localize extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.locale = \"default\"; //current locale\r\n\t\tthis.lang = false; //current language\r\n\t\tthis.bindings = {}; //update events to call when locale is changed\r\n\t\tthis.langList = {};\r\n\r\n\t\tthis.registerTableOption(\"locale\", false); //current system language\r\n\t\tthis.registerTableOption(\"langs\", {});\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.langList = Helpers.deepClone(Localize.langs);\r\n\r\n\t\tif(this.table.options.columnDefaults.headerFilterPlaceholder !== false){\r\n\t\t\tthis.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder);\r\n\t\t}\r\n\r\n\t\tfor(let locale in this.table.options.langs){\r\n\t\t\tthis.installLang(locale, this.table.options.langs[locale]);\r\n\t\t}\r\n\r\n\t\tthis.setLocale(this.table.options.locale);\r\n\r\n\t\tthis.registerTableFunction(\"setLocale\", this.setLocale.bind(this));\r\n\t\tthis.registerTableFunction(\"getLocale\", this.getLocale.bind(this));\r\n\t\tthis.registerTableFunction(\"getLang\", this.getLang.bind(this));\r\n\t}\r\n\r\n\t//set header placehoder\r\n\tsetHeaderFilterPlaceholder(placeholder){\r\n\t\tthis.langList.default.headerFilters.default = placeholder;\r\n\t}\r\n\r\n\t//set header filter placeholder by column\r\n\tsetHeaderFilterColumnPlaceholder(column, placeholder){\r\n\t\tthis.langList.default.headerFilters.columns[column] = placeholder;\r\n\r\n\t\tif(this.lang && !this.lang.headerFilters.columns[column]){\r\n\t\t\tthis.lang.headerFilters.columns[column] = placeholder;\r\n\t\t}\r\n\t}\r\n\r\n\t//setup a lang description object\r\n\tinstallLang(locale, lang){\r\n\t\tif(this.langList[locale]){\r\n\t\t\tthis._setLangProp(this.langList[locale], lang);\r\n\t\t}else{\r\n\t\t\tthis.langList[locale] = lang;\r\n\t\t}\r\n\t}\r\n\r\n\t_setLangProp(lang, values){\r\n\t\tfor(let key in values){\r\n\t\t\tif(lang[key] && typeof lang[key] == \"object\"){\r\n\t\t\t\tthis._setLangProp(lang[key], values[key])\r\n\t\t\t}else{\r\n\t\t\t\tlang[key] = values[key];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//set current locale\r\n\tsetLocale(desiredLocale){\r\n\t\tdesiredLocale = desiredLocale || \"default\";\r\n\r\n\t\t//fill in any matching languge values\r\n\t\tfunction traverseLang(trans, path){\r\n\t\t\tfor(var prop in trans){\r\n\t\t\t\tif(typeof trans[prop] == \"object\"){\r\n\t\t\t\t\tif(!path[prop]){\r\n\t\t\t\t\t\tpath[prop] = {};\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttraverseLang(trans[prop], path[prop]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tpath[prop] = trans[prop];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//determing correct locale to load\r\n\t\tif(desiredLocale === true && navigator.language){\r\n\t\t\t//get local from system\r\n\t\t\tdesiredLocale = navigator.language.toLowerCase();\r\n\t\t}\r\n\r\n\t\tif(desiredLocale){\r\n\t\t\t//if locale is not set, check for matching top level locale else use default\r\n\t\t\tif(!this.langList[desiredLocale]){\r\n\t\t\t\tlet prefix = desiredLocale.split(\"-\")[0];\r\n\r\n\t\t\t\tif(this.langList[prefix]){\r\n\t\t\t\t\tconsole.warn(\"Localization Error - Exact matching locale not found, using closest match: \", desiredLocale, prefix);\r\n\t\t\t\t\tdesiredLocale = prefix;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Localization Error - Matching locale not found, using default: \", desiredLocale);\r\n\t\t\t\t\tdesiredLocale = \"default\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.locale = desiredLocale;\r\n\r\n\t\t//load default lang template\r\n\t\tthis.lang = Helpers.deepClone(this.langList.default || {});\r\n\r\n\t\tif(desiredLocale != \"default\"){\r\n\t\t\ttraverseLang(this.langList[desiredLocale], this.lang);\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(\"localized\", this.locale, this.lang);\r\n\r\n\t\tthis._executeBindings();\r\n\t}\r\n\r\n\t//get current locale\r\n\tgetLocale(locale){\r\n\t\treturn this.locale;\r\n\t}\r\n\r\n\t//get lang object for given local or current if none provided\r\n\tgetLang(locale){\r\n\t\treturn locale ? this.langList[locale] : this.lang;\r\n\t}\r\n\r\n\t//get text for current locale\r\n\tgetText(path, value){\r\n\t\tvar path = value ? path + \"|\" + value : path,\r\n\t\tpathArray = path.split(\"|\"),\r\n\t\ttext = this._getLangElement(pathArray, this.locale);\r\n\r\n\t\t// if(text === false){\r\n\t\t// \tconsole.warn(\"Localization Error - Matching localized text not found for given path: \", path);\r\n\t\t// }\r\n\r\n\t\treturn text || \"\";\r\n\t}\r\n\r\n\t//traverse langs object and find localized copy\r\n\t_getLangElement(path, locale){\r\n\t\tvar root = this.lang;\r\n\r\n\t\tpath.forEach(function(level){\r\n\t\t\tvar rootPath;\r\n\r\n\t\t\tif(root){\r\n\t\t\t\trootPath = root[level];\r\n\r\n\t\t\t\tif(typeof rootPath != \"undefined\"){\r\n\t\t\t\t\troot = rootPath;\r\n\t\t\t\t}else{\r\n\t\t\t\t\troot = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn root;\r\n\t}\r\n\r\n\t//set update binding\r\n\tbind(path, callback){\r\n\t\tif(!this.bindings[path]){\r\n\t\t\tthis.bindings[path] = [];\r\n\t\t}\r\n\r\n\t\tthis.bindings[path].push(callback);\r\n\r\n\t\tcallback(this.getText(path), this.lang);\r\n\t}\r\n\r\n\t//itterate through bindings and trigger updates\r\n\t_executeBindings(){\r\n\t\tfor(let path in this.bindings){\r\n\t\t\tthis.bindings[path].forEach((binding) => {\r\n\t\t\t\tbinding(this.getText(path), this.lang);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n}\r\n\r\nLocalize.moduleName = \"localize\";\r\n\r\n//load defaults\r\nLocalize.langs = defaultLangs;\r\n\r\nexport default Localize;","import Module from '../../core/Module.js';\r\nimport TableRegistry from '../../core/tools/TableRegistry.js';\r\n\r\nclass Comms extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"tableComms\", this.receive.bind(this));\r\n\t}\r\n\r\n\tgetConnections(selectors){\r\n\t\tvar connections = [],\r\n\t\tconnection;\r\n\r\n\t\tconnection = TableRegistry.lookupTable(selectors);\r\n\r\n\t\tconnection.forEach((con) =>{\r\n\t\t\tif(this.table !== con){\r\n\t\t\t\tconnections.push(con);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn connections;\r\n\t}\r\n\r\n\tsend(selectors, module, action, data){\r\n\t\tvar connections = this.getConnections(selectors);\r\n\r\n\t\tconnections.forEach((connection) => {\r\n\t\t\tconnection.tableComms(this.table.element, module, action, data);\r\n\t\t});\r\n\r\n\t\tif(!connections.length && selectors){\r\n\t\t\tconsole.warn(\"Table Connection Error - No tables matching selector found\", selectors);\r\n\t\t}\r\n\t}\r\n\r\n\treceive(table, module, action, data){\r\n\t\tif(this.table.modExists(module)){\r\n\t\t\treturn this.table.modules[module].commsReceived(table, action, data);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Inter-table Comms Error - no such module:\", module);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nComms.moduleName = \"comms\";\r\n\r\nexport default Comms;","import * as coreModules from '../modules/core.js';\r\nimport TableRegistry from './TableRegistry.js';\r\n\r\nexport default class ModuleBinder {\r\n\t\r\n\tconstructor(tabulator, modules){\r\n\t\tthis.bindStaticFuctionality(tabulator);\r\n\t\tthis.bindModules(tabulator, coreModules, true);\r\n\t\t\r\n\t\tif(modules){\r\n\t\t\tthis.bindModules(tabulator, modules);\r\n\t\t}\r\n\t}\r\n\t\r\n\tbindStaticFuctionality(tabulator){\r\n\t\ttabulator.moduleBindings = {};\r\n\t\t\r\n\t\ttabulator.extendModule = function(name, property, values){\r\n\t\t\tif(tabulator.moduleBindings[name]){\r\n\t\t\t\tvar source = tabulator.moduleBindings[name][property];\r\n\t\t\t\t\r\n\t\t\t\tif(source){\r\n\t\t\t\t\tif(typeof values == \"object\"){\r\n\t\t\t\t\t\tfor(let key in values){\r\n\t\t\t\t\t\t\tsource[key] = values[key];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Module Error - Invalid value type, it must be an object\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Module Error - property does not exist:\", property);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Module Error - module does not exist:\", name);\r\n\t\t\t}\r\n\t\t};\r\n\t\t\r\n\t\ttabulator.registerModule = function(modules){\r\n\t\t\tif(!Array.isArray(modules)){\r\n\t\t\t\tmodules = [modules];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmodules.forEach((mod) => {\r\n\t\t\t\ttabulator.registerModuleBinding(mod)\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\ttabulator.registerModuleBinding = function(mod){\r\n\t\t\ttabulator.moduleBindings[mod.moduleName] = mod;\r\n\t\t};\r\n\t\t\r\n\t\ttabulator.findTable = function(query){\r\n\t\t\tvar results = TableRegistry.lookupTable(query, true);\r\n\t\t\treturn Array.isArray(results) && !results.length ? false : results;\r\n\t\t}\r\n\t\t\r\n\t\t//ensure that module are bound to instantiated function\r\n\t\ttabulator.prototype.bindModules = function(){\r\n\t\t\tvar orderedStartMods = [],\r\n\t\t\torderedEndMods = [],\r\n\t\t\tunOrderedMods = [];\r\n\t\t\t\r\n\t\t\tthis.modules = {};\r\n\t\t\t\r\n\t\t\tfor(var name in tabulator.moduleBindings){\r\n\t\t\t\tlet mod = tabulator.moduleBindings[name];\r\n\t\t\t\tlet module = new mod(this);\r\n\t\t\t\t\r\n\t\t\t\tthis.modules[name] = module;\r\n\t\t\t\t\r\n\t\t\t\tif(mod.prototype.moduleCore){\r\n\t\t\t\t\tthis.modulesCore.push(module);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(mod.moduleInitOrder){\r\n\t\t\t\t\t\tif(mod.moduleInitOrder < 0){\r\n\t\t\t\t\t\t\torderedStartMods.push(module);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\torderedEndMods.push(module);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tunOrderedMods.push(module);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\torderedStartMods.sort((a, b) => a.moduleInitOrder > b.moduleInitOrder ? 1 : -1);\r\n\t\t\torderedEndMods.sort((a, b) => a.moduleInitOrder > b.moduleInitOrder ? 1 : -1);\r\n\t\t\t\r\n\t\t\tthis.modulesRegular = orderedStartMods.concat(unOrderedMods.concat(orderedEndMods));\r\n\t\t}\r\n\t}\r\n\t\r\n\tbindModules(tabulator, modules, core){\r\n\t\tvar mods = Object.values(modules);\r\n\t\t\r\n\t\tif(core){\r\n\t\t\tmods.forEach((mod) => {\r\n\t\t\t\tmod.prototype.moduleCore = true;\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\ttabulator.registerModule(mods);\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from './Helpers.js';\r\n\r\nexport default class Alert extends CoreFeature{\r\n constructor(table){\r\n super(table);\r\n \r\n this.element = this._createAlertElement();\r\n this.msgElement = this._createMsgElement();\r\n this.type = null;\r\n \r\n this.element.appendChild(this.msgElement);\r\n }\r\n \r\n _createAlertElement(){\r\n var el = document.createElement(\"div\");\r\n el.classList.add(\"tabulator-alert\");\r\n return el;\r\n }\r\n \r\n _createMsgElement(){\r\n var el = document.createElement(\"div\");\r\n el.classList.add(\"tabulator-alert-msg\");\r\n el.setAttribute(\"role\", \"alert\");\r\n return el;\r\n }\r\n \r\n _typeClass(){\r\n return \"tabulator-alert-state-\" + this.type;\r\n }\r\n \r\n alert(content, type = \"msg\"){\r\n if(content){\r\n this.clear();\r\n \r\n this.type = type;\r\n \r\n while(this.msgElement.firstChild) this.msgElement.removeChild(this.msgElement.firstChild);\r\n \r\n this.msgElement.classList.add(this._typeClass());\r\n \r\n if(typeof content === \"function\"){\r\n content = content();\r\n }\r\n \r\n if(content instanceof HTMLElement){\r\n this.msgElement.appendChild(content);\r\n }else{\r\n this.msgElement.innerHTML = content;\r\n }\r\n \r\n this.table.element.appendChild(this.element);\r\n }\r\n }\r\n \r\n clear(){\r\n if(this.element.parentNode){\r\n this.element.parentNode.removeChild(this.element);\r\n }\r\n \r\n this.msgElement.classList.remove(this._typeClass());\r\n }\r\n}","'use strict';\r\n\r\nimport defaultOptions from './defaults/options.js';\r\n\r\nimport ColumnManager from './ColumnManager.js';\r\nimport RowManager from './RowManager.js';\r\nimport FooterManager from './FooterManager.js';\r\n\r\nimport InteractionMonitor from './tools/InteractionMonitor.js';\r\nimport ComponentFunctionBinder from './tools/ComponentFunctionBinder.js';\r\nimport DataLoader from './tools/DataLoader.js';\r\n\r\nimport ExternalEventBus from './tools/ExternalEventBus.js';\r\nimport InternalEventBus from './tools/InternalEventBus.js';\r\n\r\nimport TableRegistry from './tools/TableRegistry.js';\r\nimport ModuleBinder from './tools/ModuleBinder.js';\r\n\r\nimport OptionsList from './tools/OptionsList.js';\r\n\r\nimport Alert from './tools/Alert.js';\r\n\r\nclass Tabulator {\r\n\t\r\n\tconstructor(element, options){\r\n\t\t\r\n\t\tthis.options = {};\r\n\t\t\r\n\t\tthis.columnManager = null; // hold Column Manager\r\n\t\tthis.rowManager = null; //hold Row Manager\r\n\t\tthis.footerManager = null; //holder Footer Manager\r\n\t\tthis.alertManager = null; //hold Alert Manager\r\n\t\tthis.vdomHoz = null; //holder horizontal virtual dom\r\n\t\tthis.externalEvents = null; //handle external event messaging\r\n\t\tthis.eventBus = null; //handle internal event messaging\r\n\t\tthis.interactionMonitor = false; //track user interaction\r\n\t\tthis.browser = \"\"; //hold current browser type\r\n\t\tthis.browserSlow = false; //handle reduced functionality for slower browsers\r\n\t\tthis.browserMobile = false; //check if running on mobile, prevent resize cancelling edit on keyboard appearance\r\n\t\tthis.rtl = false; //check if the table is in RTL mode\r\n\t\tthis.originalElement = null; //hold original table element if it has been replaced\r\n\t\t\r\n\t\tthis.componentFunctionBinder = new ComponentFunctionBinder(this); //bind component functions\r\n\t\tthis.dataLoader = false; //bind component functions\r\n\t\t\r\n\t\tthis.modules = {}; //hold all modules bound to this table\r\n\t\tthis.modulesCore = []; //hold core modules bound to this table (for initialization purposes)\r\n\t\tthis.modulesRegular = []; //hold regular modules bound to this table (for initialization purposes)\r\n\t\t\r\n\t\tthis.optionsList = new OptionsList(this, \"table constructor\");\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\t\r\n\t\tif(this.initializeElement(element)){\r\n\t\t\t\r\n\t\t\tthis.initializeCoreSystems(options);\r\n\t\t\t\r\n\t\t\t//delay table creation to allow event bindings immediately after the constructor\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tthis._create();\r\n\t\t\t})\r\n\t\t}\r\n\t\t\r\n\t\tTableRegistry.register(this); //register table for inter-device communication\r\n\t}\r\n\t\r\n\tinitializeElement(element){\r\n\t\tif(typeof HTMLElement !== \"undefined\" && element instanceof HTMLElement){\r\n\t\t\tthis.element = element;\r\n\t\t\treturn true;\r\n\t\t}else if(typeof element === \"string\"){\r\n\t\t\tthis.element = document.querySelector(element);\r\n\t\t\t\r\n\t\t\tif(this.element){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Tabulator Creation Error - no element found matching selector: \", element);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Tabulator Creation Error - Invalid element provided:\", element);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeCoreSystems(options){\r\n\t\tthis.columnManager = new ColumnManager(this);\r\n\t\tthis.rowManager = new RowManager(this);\r\n\t\tthis.footerManager = new FooterManager(this);\r\n\t\tthis.dataLoader = new DataLoader(this);\r\n\t\tthis.alertManager = new Alert(this);\r\n\t\t\r\n\t\tthis.bindModules();\r\n\t\t\r\n\t\tthis.options = this.optionsList.generate(Tabulator.defaultOptions, options)\r\n\t\t\r\n\t\tthis._clearObjectPointers();\r\n\t\t\r\n\t\tthis._mapDeprecatedFunctionality();\r\n\t\t\r\n\t\tthis.externalEvents = new ExternalEventBus(this, this.options, this.options.debugEventsExternal);\r\n\t\tthis.eventBus = new InternalEventBus(this.options.debugEventsInternal);\r\n\t\t\r\n\t\tthis.interactionMonitor = new InteractionMonitor(this);\r\n\t\t\r\n\t\tthis.dataLoader.initialize();\r\n\t\t// this.columnManager.initialize();\r\n\t\t// this.rowManager.initialize();\r\n\t\tthis.footerManager.initialize();\r\n\t}\r\n\t\r\n\t//convert deprecated functionality to new functions\r\n\t_mapDeprecatedFunctionality(){\r\n\t\t//all previously deprecated functionality removed in the 5.0 release\r\n\t}\r\n\t\r\n\t_clearSelection(){\r\n\t\t\r\n\t\tthis.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\tif (window.getSelection) {\r\n\t\t\tif (window.getSelection().empty) { // Chrome\r\n\t\t\t\twindow.getSelection().empty();\r\n\t\t\t} else if (window.getSelection().removeAllRanges) { // Firefox\r\n\t\t\t\twindow.getSelection().removeAllRanges();\r\n\t\t\t}\r\n\t\t} else if (document.selection) { // IE?\r\n\t\t\tdocument.selection.empty();\r\n\t\t}\r\n\t\t\r\n\t\tthis.element.classList.remove(\"tabulator-block-select\");\r\n\t}\r\n\t\r\n\t//create table\r\n\t_create(){\r\n\t\tthis.externalEvents.dispatch(\"tableBuilding\");\r\n\t\tthis.eventBus.dispatch(\"table-building\");\r\n\t\t\r\n\t\tthis._rtlCheck();\r\n\t\t\r\n\t\tthis._buildElement();\r\n\t\t\r\n\t\tthis._initializeTable();\r\n\t\t\r\n\t\tthis._loadInitialData();\r\n\t\t\r\n\t\tthis.initialized = true;\r\n\t\t\r\n\t\tthis.externalEvents.dispatch(\"tableBuilt\");\r\n\t}\r\n\t\r\n\t_rtlCheck(){\r\n\t\tvar style = window.getComputedStyle(this.element);\r\n\t\t\r\n\t\tswitch(this.options.textDirection){\r\n\t\t\tcase\"auto\":\r\n\t\t\tif(style.direction !== \"rtl\"){\r\n\t\t\t\tbreak;\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tcase \"rtl\":\r\n\t\t\tthis.element.classList.add(\"tabulator-rtl\");\r\n\t\t\tthis.rtl = true;\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"ltr\":\r\n\t\t\tthis.element.classList.add(\"tabulator-ltr\");\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\tthis.rtl = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//clear pointers to objects in default config object\r\n\t_clearObjectPointers(){\r\n\t\tthis.options.columns = this.options.columns.slice(0);\r\n\t\t\r\n\t\tif(Array.isArray(this.options.data) && !this.options.reactiveData){\r\n\t\t\tthis.options.data = this.options.data.slice(0);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//build tabulator element\r\n\t_buildElement(){\r\n\t\tvar element = this.element,\r\n\t\toptions = this.options,\r\n\t\tnewElement;\r\n\t\t\r\n\t\tif(element.tagName === \"TABLE\"){\r\n\t\t\tthis.originalElement = this.element;\r\n\t\t\tnewElement = document.createElement(\"div\");\r\n\t\t\t\r\n\t\t\t//transfer attributes to new element\r\n\t\t\tvar attributes = element.attributes;\r\n\t\t\t\r\n\t\t\t// loop through attributes and apply them on div\r\n\t\t\tfor(var i in attributes){\r\n\t\t\t\tif(typeof attributes[i] == \"object\"){\r\n\t\t\t\t\tnewElement.setAttribute(attributes[i].name, attributes[i].value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// replace table with div element\r\n\t\t\telement.parentNode.replaceChild(newElement, element);\r\n\t\t\t\r\n\t\t\tthis.element = element = newElement;\r\n\t\t}\r\n\t\t\r\n\t\telement.classList.add(\"tabulator\");\r\n\t\telement.setAttribute(\"role\", \"grid\");\r\n\t\t\r\n\t\t//empty element\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\t\r\n\t\t//set table height\r\n\t\tif(options.height){\r\n\t\t\toptions.height = isNaN(options.height) ? options.height : options.height + \"px\";\r\n\t\t\telement.style.height = options.height;\r\n\t\t}\r\n\t\t\r\n\t\t//set table min height\r\n\t\tif(options.minHeight !== false){\r\n\t\t\toptions.minHeight = isNaN(options.minHeight) ? options.minHeight : options.minHeight + \"px\";\r\n\t\t\telement.style.minHeight = options.minHeight;\r\n\t\t}\r\n\t\t\r\n\t\t//set table maxHeight\r\n\t\tif(options.maxHeight !== false){\r\n\t\t\toptions.maxHeight = isNaN(options.maxHeight) ? options.maxHeight : options.maxHeight + \"px\";\r\n\t\t\telement.style.maxHeight = options.maxHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//initialize core systems and modules\r\n\t_initializeTable(){\r\n\t\tvar element = this.element,\r\n\t\toptions = this.options;\r\n\t\t\r\n\t\tthis.interactionMonitor.initialize();\r\n\t\t\r\n\t\tthis.columnManager.initialize();\r\n\t\tthis.rowManager.initialize();\r\n\t\t\r\n\t\tthis._detectBrowser();\r\n\t\t\r\n\t\t//initialize core modules\r\n\t\tthis.modulesCore.forEach((mod) => {\r\n\t\t\tmod.initialize();\r\n\t\t})\r\n\t\t\r\n\t\t//build table elements\r\n\t\telement.appendChild(this.columnManager.getElement());\r\n\t\telement.appendChild(this.rowManager.getElement());\r\n\t\t\r\n\t\tif(options.footerElement){\r\n\t\t\tthis.footerManager.activate();\r\n\t\t}\r\n\t\t\r\n\t\tif(options.autoColumns && options.data){\r\n\t\t\t\r\n\t\t\tthis.columnManager.generateColumnsFromRowData(this.options.data);\r\n\t\t}\r\n\t\t\r\n\t\t//initialize regular modules\r\n\t\tthis.modulesRegular.forEach((mod) => {\r\n\t\t\tmod.initialize();\r\n\t\t});\r\n\t\t\r\n\t\tthis.columnManager.setColumns(options.columns);\r\n\t\t\r\n\t\tthis.eventBus.dispatch(\"table-built\");\r\n\t}\r\n\t\r\n\t_loadInitialData(){\r\n\t\tthis.dataLoader.load(this.options.data);\r\n\t}\r\n\t\r\n\t//deconstructor\r\n\tdestroy(){\r\n\t\tvar element = this.element;\r\n\t\t\r\n\t\tTableRegistry.deregister(this); //deregister table from inter-device communication\r\n\t\t\r\n\t\tthis.eventBus.dispatch(\"table-destroy\");\r\n\t\t\r\n\t\t//clear row data\r\n\t\tthis.rowManager.rows.forEach(function(row){\r\n\t\t\trow.wipe();\r\n\t\t});\r\n\t\t\r\n\t\tthis.rowManager.rows = [];\r\n\t\tthis.rowManager.activeRows = [];\r\n\t\tthis.rowManager.displayRows = [];\r\n\t\t\r\n\t\t//clear DOM\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\telement.classList.remove(\"tabulator\");\r\n\t}\r\n\t\r\n\t_detectBrowser(){\r\n\t\tvar ua = navigator.userAgent||navigator.vendor||window.opera;\r\n\t\t\r\n\t\tif(ua.indexOf(\"Trident\") > -1){\r\n\t\t\tthis.browser = \"ie\";\r\n\t\t\tthis.browserSlow = true;\r\n\t\t}else if(ua.indexOf(\"Edge\") > -1){\r\n\t\t\tthis.browser = \"edge\";\r\n\t\t\tthis.browserSlow = true;\r\n\t\t}else if(ua.indexOf(\"Firefox\") > -1){\r\n\t\t\tthis.browser = \"firefox\";\r\n\t\t\tthis.browserSlow = false;\r\n\t\t}else{\r\n\t\t\tthis.browser = \"other\";\r\n\t\t\tthis.browserSlow = false;\r\n\t\t}\r\n\t\t\r\n\t\tthis.browserMobile = /(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ua)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(ua.slice(0,4));\r\n\t}\r\n\t\r\n\tinitGuard(func, msg){\r\n\t\tvar stack, line;\r\n\t\t\r\n\t\tif(this.options.debugInitialization && !this.initialized){\r\n\t\t\tif(!func){\r\n\t\t\t\tstack = new Error().stack.split(\"\\n\");\r\n\t\t\t\t\r\n\t\t\t\tline = stack[0] == \"Error\" ? stack[2] : stack[1];\r\n\t\t\t\t\r\n\t\t\t\tif(line[0] == \" \"){\r\n\t\t\t\t\tfunc = line.trim().split(\" \")[1].split(\".\")[1];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfunc = line.trim().split(\"@\")[0];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconsole.warn(\"Table Not Initialized - Calling the \" + func + \" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function.\" + (msg ? \" \" + msg : \"\"));\r\n\t\t}\r\n\t\t\r\n\t\treturn this.initialized;\r\n\t}\r\n\t\r\n\t////////////////// Data Handling //////////////////\r\n\t//block table redrawing\r\n\tblockRedraw(){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.rowManager.blockRedraw();\r\n\t}\r\n\t\r\n\t//restore table redrawing\r\n\trestoreRedraw(){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.rowManager.restoreRedraw();\r\n\t}\r\n\t\r\n\t//load data\r\n\tsetData(data, params, config){\r\n\t\tthis.initGuard(false, \"To set initial data please use the 'data' property in the table constructor.\");\r\n\t\t\r\n\t\treturn this.dataLoader.load(data, params, config, false);\r\n\t}\r\n\t\r\n\t//clear data\r\n\tclearData(){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tthis.dataLoader.blockActiveLoad();\r\n\t\tthis.rowManager.clearData();\r\n\t}\r\n\t\r\n\t//get table data array\r\n\tgetData(active){\r\n\t\treturn this.rowManager.getData(active);\r\n\t}\r\n\t\r\n\t//get table data array count\r\n\tgetDataCount(active){\r\n\t\treturn this.rowManager.getDataCount(active);\r\n\t}\r\n\t\r\n\t//replace data, keeping table in position with same sort\r\n\treplaceData(data, params, config){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.dataLoader.load(data, params, config, true, true);\r\n\t}\r\n\t\r\n\t//update table data\r\n\tupdateData(data){\r\n\t\tvar responses = 0;\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data){\r\n\t\t\t\tdata.forEach((item) => {\r\n\t\t\t\t\tvar row = this.rowManager.findRow(item[this.options.index]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(row){\r\n\t\t\t\t\t\tresponses++;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trow.updateData(item)\r\n\t\t\t\t\t\t.then(()=>{\r\n\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\tresolve();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\taddData(data, pos, index){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data){\r\n\t\t\t\tthis.rowManager.addRows(data, pos, index)\r\n\t\t\t\t.then((rows) => {\r\n\t\t\t\t\tvar output = [];\r\n\t\t\t\t\t\r\n\t\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\t\toutput.push(row.getComponent());\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tresolve(output);\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//update table data\r\n\tupdateOrAddData(data){\r\n\t\tvar rows = [],\r\n\t\tresponses = 0;\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data){\r\n\t\t\t\tdata.forEach((item) => {\r\n\t\t\t\t\tvar row = this.rowManager.findRow(item[this.options.index]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tresponses++;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(row){\r\n\t\t\t\t\t\trow.updateData(item)\r\n\t\t\t\t\t\t.then(()=>{\r\n\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\trows.push(row.getComponent());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\tresolve(rows);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.rowManager.addRows(item)\r\n\t\t\t\t\t\t.then((newRows)=>{\r\n\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\trows.push(newRows[0].getComponent());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\tresolve(rows);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//get row object\r\n\tgetRow(index){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching row found:\", index);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//get row object\r\n\tgetRowFromPosition(position, active){\r\n\t\tvar row = this.rowManager.getRowFromPosition(position, active);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching row found:\", position);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//delete row from table\r\n\tdeleteRow(index){\r\n\t\tvar foundRows = [];\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(!Array.isArray(index)){\r\n\t\t\tindex = [index];\r\n\t\t}\r\n\t\t\r\n\t\t//find matching rows\r\n\t\tfor(let item of index){\r\n\t\t\tlet row = this.rowManager.findRow(item, true);\r\n\t\t\t\r\n\t\t\tif(row){\r\n\t\t\t\tfoundRows.push(row);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Delete Error - No matching row found:\", item);\r\n\t\t\t\treturn Promise.reject(\"Delete Error - No matching row found\")\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//sort rows into correct order to ensure smooth delete from table\r\n\t\tfoundRows.sort((a, b) => {\r\n\t\t\treturn this.rowManager.rows.indexOf(a) > this.rowManager.rows.indexOf(b) ? 1 : -1;\r\n\t\t});\r\n\t\t\r\n\t\t//delete rows\r\n\t\tfoundRows.forEach((row) =>{\r\n\t\t\trow.delete()\r\n\t\t});\r\n\t\t\r\n\t\tthis.rowManager.reRenderInPosition();\r\n\t\t\r\n\t\treturn Promise.resolve();\r\n\t}\r\n\t\r\n\t//add row to table\r\n\taddRow(data, pos, index){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.rowManager.addRows(data, pos, index)\r\n\t\t.then((rows)=>{\r\n\t\t\treturn rows[0].getComponent();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//update a row if it exitsts otherwise create it\r\n\tupdateOrAddRow(index, data){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.updateData(data)\r\n\t\t\t.then(()=>{\r\n\t\t\t\treturn row.getComponent();\r\n\t\t\t})\r\n\t\t}else{\r\n\t\t\treturn this.rowManager.addRows(data)\r\n\t\t\t.then((rows)=>{\r\n\t\t\t\treturn rows[0].getComponent();\r\n\t\t\t})\r\n\t\t}\r\n\t}\r\n\t\r\n\t//update row data\r\n\tupdateRow(index, data){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.updateData(data)\r\n\t\t\t.then(()=>{\r\n\t\t\t\treturn Promise.resolve(row.getComponent());\r\n\t\t\t})\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Update Error - No matching row found:\", index);\r\n\t\t\treturn Promise.reject(\"Update Error - No matching row found\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t//scroll to row in DOM\r\n\tscrollToRow(index, position, ifVisible){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn this.rowManager.scrollToRow(row, position, ifVisible)\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Scroll Error - No matching row found:\", index);\r\n\t\t\treturn Promise.reject(\"Scroll Error - No matching row found\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveRow(from, to, after){\r\n\t\tvar fromRow = this.rowManager.findRow(from);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(fromRow){\r\n\t\t\tfromRow.moveToRow(to, after);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching row found:\", from);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRows(active){\r\n\t\treturn this.rowManager.getComponents(active);\t\r\n\t}\r\n\t\r\n\t//get position of row in table\r\n\tgetRowPosition(index, active){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn this.rowManager.getRowPosition(row, active);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Position Error - No matching row found:\", index);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t/////////////// Column Functions ///////////////\r\n\tsetColumns(definition){\r\n\t\tthis.initGuard(false, \"To set initial columns please use the 'columns' property in the table constructor\");\r\n\t\t\r\n\t\tthis.columnManager.setColumns(definition);\r\n\t}\r\n\t\r\n\tgetColumns(structured){\r\n\t\treturn this.columnManager.getComponents(structured);\r\n\t}\r\n\t\r\n\tgetColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetColumnDefinitions(){\r\n\t\treturn this.columnManager.getDefinitionTree();\r\n\t}\r\n\t\r\n\tshowColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tcolumn.show();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Show Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\thideColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field); \r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tcolumn.hide();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Hide Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\ttoggleColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tif(column.visible){\r\n\t\t\t\tcolumn.hide();\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.show();\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Visibility Toggle Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColumn(definition, before, field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.columnManager.addColumn(definition, before, column)\r\n\t\t.then((column) => {\r\n\t\t\treturn column.getComponent();\r\n\t\t});\r\n\t}\r\n\t\r\n\tdeleteColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.delete();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Delete Error - No matching column found:\", field);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tupdateColumnDefinition(field, definition){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.updateDefinition(definition)\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Update Error - No matching column found:\", field);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveColumn(from, to, after){\r\n\t\tvar fromColumn = this.columnManager.findColumn(from),\r\n\t\ttoColumn = this.columnManager.findColumn(to);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(fromColumn){\r\n\t\t\tif(toColumn){\r\n\t\t\t\tthis.columnManager.moveColumn(fromColumn, toColumn, after)\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Move Error - No matching column found:\", toColumn);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching column found:\", from);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//scroll to column in DOM\r\n\tscrollToColumn(field, position, ifVisible){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\treturn this.columnManager.scrollToColumn(column, position, ifVisible)\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - No matching column found:\", field);\r\n\t\t\t\treturn Promise.reject(\"Scroll Error - No matching column found\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//////////// General Public Functions ////////////\r\n\t//redraw list without updating data\r\n\tredraw(force){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.columnManager.redraw(force);\r\n\t\tthis.rowManager.redraw(force);\r\n\t}\r\n\t\r\n\tsetHeight(height){\r\n\t\tthis.options.height = isNaN(height) ? height : height + \"px\";\r\n\t\tthis.element.style.height = this.options.height;\r\n\t\tthis.rowManager.initializeRenderer();\r\n\t\tthis.rowManager.redraw();\r\n\t}\r\n\t\r\n\t//////////////////// Event Bus ///////////////////\r\n\t\r\n\ton(key, callback){\r\n\t\tthis.externalEvents.subscribe(key, callback);\r\n\t}\r\n\t\r\n\toff(key, callback){\r\n\t\tthis.externalEvents.unsubscribe(key, callback);\r\n\t}\r\n\t\r\n\tdispatchEvent(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args.shift();\r\n\t\t\r\n\t\tthis.externalEvents.dispatch(...arguments)\r\n\t}\r\n\r\n\t//////////////////// Alerts ///////////////////\r\n\r\n\talert(contents, type){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.alertManager.alert(contents, type);\r\n\t}\r\n\r\n\tclearAlert(){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.alertManager.clear();\r\n\t}\r\n\t\r\n\t////////////// Extension Management //////////////\r\n\tmodExists(plugin, required){\r\n\t\tif(this.modules[plugin]){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tif(required){\r\n\t\t\t\tconsole.error(\"Tabulator Module Not Installed: \" + plugin);\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tmodule(key){\r\n\t\tvar mod = this.modules[key];\r\n\t\t\r\n\t\tif(!mod){\r\n\t\t\tconsole.error(\"Tabulator module not installed: \" + key);\r\n\t\t}\r\n\t\t\r\n\t\treturn mod;\r\n\t}\r\n}\r\n\r\n//default setup options\r\nTabulator.defaultOptions = defaultOptions;\r\n\r\n//bind modules and static functionality\r\nnew ModuleBinder(Tabulator);\r\n\r\nexport default Tabulator;\r\n","export default {}","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defautlAccessors from './defaults/accessors.js';\r\n\r\nclass Accessor extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.allowedTypes = [\"\", \"data\", \"download\", \"clipboard\", \"print\", \"htmlOutput\"] //list of accessor types\r\n\r\n\t\tthis.registerColumnOption(\"accessor\");\r\n\t\tthis.registerColumnOption(\"accessorParams\");\r\n\t\tthis.registerColumnOption(\"accessorData\");\r\n\t\tthis.registerColumnOption(\"accessorDataParams\");\r\n\t\tthis.registerColumnOption(\"accessorDownload\");\r\n\t\tthis.registerColumnOption(\"accessorDownloadParams\");\r\n\t\tthis.registerColumnOption(\"accessorClipboard\");\r\n\t\tthis.registerColumnOption(\"accessorClipboardParams\");\r\n\t\tthis.registerColumnOption(\"accessorPrint\");\r\n\t\tthis.registerColumnOption(\"accessorPrintParams\");\r\n\t\tthis.registerColumnOption(\"accessorHtmlOutput\");\r\n\t\tthis.registerColumnOption(\"accessorHtmlOutputParams\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"row-data-retrieve\", this.transformRow.bind(this));\r\n\t}\r\n\r\n\t//initialize column accessor\r\n\tinitializeColumn(column){\r\n\t\tvar match = false,\r\n\t\tconfig = {};\r\n\r\n\t\tthis.allowedTypes.forEach((type) => {\r\n\t\t\tvar key = \"accessor\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\t\taccessor;\r\n\r\n\t\t\tif(column.definition[key]){\r\n\t\t\t\taccessor = this.lookupAccessor(column.definition[key]);\r\n\r\n\t\t\t\tif(accessor){\r\n\t\t\t\t\tmatch = true;\r\n\r\n\t\t\t\t\tconfig[key] = {\r\n\t\t\t\t\t\taccessor:accessor,\r\n\t\t\t\t\t\tparams: column.definition[key + \"Params\"] || {},\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(match){\r\n\t\t\tcolumn.modules.accessor = config;\r\n\t\t}\r\n\t}\r\n\r\n\tlookupAccessor(value){\r\n\t\tvar accessor = false;\r\n\r\n\t\t//set column accessor\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(Accessor.accessors[value]){\r\n\t\t\t\taccessor = Accessor.accessors[value]\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Accessor Error - No such accessor found, ignoring: \", value);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\taccessor = value;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn accessor;\r\n\t}\r\n\r\n\t//apply accessor to row\r\n\ttransformRow(row, type){\r\n\t\tvar key = \"accessor\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\trowComponent = row.getComponent();\r\n\r\n\t\t//clone data object with deep copy to isolate internal data from returned result\r\n\t\tvar data = Helpers.deepClone(row.data || {});\r\n\r\n\t\tthis.table.columnManager.traverse(function(column){\r\n\t\t\tvar value, accessor, params, colCompnent;\r\n\r\n\t\t\tif(column.modules.accessor){\r\n\r\n\t\t\t\taccessor = column.modules.accessor[key] || column.modules.accessor.accessor || false;\r\n\r\n\t\t\t\tif(accessor){\r\n\t\t\t\t\tvalue = column.getFieldValue(data);\r\n\r\n\t\t\t\t\tif(value != \"undefined\"){\r\n\t\t\t\t\t\tcolCompnent = column.getComponent();\r\n\t\t\t\t\t\tparams = typeof accessor.params === \"function\" ? accessor.params(value, data, type, colCompnent, rowComponent) : accessor.params;\r\n\t\t\t\t\t\tcolumn.setFieldValue(data, accessor.accessor(value, data, type, params, colCompnent, rowComponent));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n}\r\n\r\n//load defaults\r\nAccessor.moduleName = \"accessor\";\r\nAccessor.accessors = defautlAccessors;\r\n\r\nexport default Accessor;","export default {\r\n\tmethod: \"GET\",\r\n};","function generateParamsList(data, prefix){\r\n\tvar output = [];\r\n\r\n\tprefix = prefix || \"\";\r\n\r\n\tif(Array.isArray(data)){\r\n\t\tdata.forEach((item, i) => {\r\n\t\t\toutput = output.concat(generateParamsList(item, prefix ? prefix + \"[\" + i + \"]\" : i));\r\n\t\t});\r\n\t}else if (typeof data === \"object\"){\r\n\t\tfor (var key in data){\r\n\t\t\toutput = output.concat(generateParamsList(data[key], prefix ? prefix + \"[\" + key + \"]\" : key));\r\n\t\t}\r\n\t}else{\r\n\t\toutput.push({key:prefix, value:data});\r\n\t}\r\n\r\n\treturn output;\r\n}\r\n\r\nfunction serializeParams(params){\r\n\tvar output = generateParamsList(params),\r\n\tencoded = [];\r\n\r\n\toutput.forEach(function(item){\r\n\t\tencoded.push(encodeURIComponent(item.key) + \"=\" + encodeURIComponent(item.value));\r\n\t});\r\n\r\n\treturn encoded.join(\"&\");\r\n}\r\n\r\nexport default function(url, config, params){\r\n\tif(url){\r\n\t\tif(params && Object.keys(params).length){\r\n\t\t\tif(!config.method || config.method.toLowerCase() == \"get\"){\r\n\t\t\t\tconfig.method = \"get\";\r\n\r\n\t\t\t\turl += (url.includes(\"?\") ? \"&\" : \"?\") + serializeParams(params);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn url;\r\n};","export default function(url, config, params){\r\n\tvar contentType;\r\n\r\n\treturn new Promise((resolve, reject) => {\r\n\t\t//set url\r\n\t\turl = this.urlGenerator.call(this.table, url, config, params);\r\n\r\n\t\t//set body content if not GET request\r\n\t\tif(config.method.toUpperCase() != \"GET\"){\r\n\t\t\tcontentType = typeof this.table.options.ajaxContentType === \"object\" ? this.table.options.ajaxContentType : this.contentTypeFormatters[this.table.options.ajaxContentType];\r\n\t\t\tif(contentType){\r\n\r\n\t\t\t\tfor(var key in contentType.headers){\r\n\t\t\t\t\tif(!config.headers){\r\n\t\t\t\t\t\tconfig.headers = {};\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(typeof config.headers[key] === \"undefined\"){\r\n\t\t\t\t\t\tconfig.headers[key] = contentType.headers[key];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconfig.body = contentType.body.call(this, url, config, params);\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Ajax Error - Invalid ajaxContentType value:\", this.table.options.ajaxContentType);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(url){\r\n\t\t\t//configure headers\r\n\t\t\tif(typeof config.headers === \"undefined\"){\r\n\t\t\t\tconfig.headers = {};\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.headers.Accept === \"undefined\"){\r\n\t\t\t\tconfig.headers.Accept = \"application/json\";\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.headers[\"X-Requested-With\"] === \"undefined\"){\r\n\t\t\t\tconfig.headers[\"X-Requested-With\"] = \"XMLHttpRequest\";\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.mode === \"undefined\"){\r\n\t\t\t\tconfig.mode = \"cors\";\r\n\t\t\t}\r\n\r\n\t\t\tif(config.mode == \"cors\"){\r\n\t\t\t\tif(typeof config.headers[\"Origin\"] === \"undefined\"){\r\n\t\t\t\t\tconfig.headers[\"Origin\"] = window.location.origin;\r\n\t\t\t\t}\r\n \r\n\t\t\t\tif(typeof config.credentials === \"undefined\"){\r\n\t\t\t\t\tconfig.credentials = 'same-origin';\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(typeof config.credentials === \"undefined\"){\r\n\t\t\t\t\tconfig.credentials = 'include';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//send request\r\n\t\t\tfetch(url, config)\r\n\t\t\t.then((response)=>{\r\n\t\t\t\tif(response.ok) {\r\n\t\t\t\t\tresponse.json()\r\n\t\t\t\t\t.then((data)=>{\r\n\t\t\t\t\t\tresolve(data);\r\n\t\t\t\t\t}).catch((error)=>{\r\n\t\t\t\t\t\treject(error);\r\n\t\t\t\t\t\tconsole.warn(\"Ajax Load Error - Invalid JSON returned\", error);\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.error(\"Ajax Load Error - Connection Error: \" + response.status, response.statusText);\r\n\t\t\t\t\treject(response);\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.catch((error)=>{\r\n\t\t\t\tconsole.error(\"Ajax Load Error - Connection Error: \", error);\r\n\t\t\t\treject(error);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Ajax Load Error - No URL Set\");\r\n\t\t\tresolve([]);\r\n\t\t}\r\n\t});\r\n};","function generateParamsList(data, prefix){\r\n\tvar output = [];\r\n\r\n\tprefix = prefix || \"\";\r\n\r\n\tif(Array.isArray(data)){\r\n\t\tdata.forEach((item, i) => {\r\n\t\t\toutput = output.concat(generateParamsList(item, prefix ? prefix + \"[\" + i + \"]\" : i));\r\n\t\t});\r\n\t}else if (typeof data === \"object\"){\r\n\t\tfor (var key in data){\r\n\t\t\toutput = output.concat(generateParamsList(data[key], prefix ? prefix + \"[\" + key + \"]\" : key));\r\n\t\t}\r\n\t}else{\r\n\t\toutput.push({key:prefix, value:data});\r\n\t}\r\n\r\n\treturn output;\r\n}\r\n\r\nexport default {\r\n\t\"json\":{\r\n\t\theaders:{\r\n\t\t\t'Content-Type': 'application/json',\r\n\t\t},\r\n\t\tbody:function(url, config, params){\r\n\t\t\treturn JSON.stringify(params);\r\n\t\t},\r\n\t},\r\n\t\"form\":{\r\n\t\theaders:{\r\n\t\t},\r\n\t\tbody:function(url, config, params){\r\n\r\n\t\t\tvar output = generateParamsList(params),\r\n\t\t\tform = new FormData();\r\n\r\n\t\t\toutput.forEach(function(item){\r\n\t\t\t\tform.append(item.key, item.value);\r\n\t\t\t});\r\n\r\n\t\t\treturn form;\r\n\t\t},\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultConfig from './defaults/config.js';\r\nimport defaultURLGenerator from './defaults/urlGenerator.js';\r\nimport defaultLoaderPromise from './defaults/loaderPromise.js';\r\nimport defaultContentTypeFormatters from './defaults/contentTypeFormatters.js';\r\n\r\nclass Ajax extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.config = {}; //hold config object for ajax request\r\n\t\tthis.url = \"\"; //request URL\r\n\t\tthis.urlGenerator = false;\r\n\t\tthis.params = false; //request parameters\r\n\t\t\r\n\t\tthis.loaderPromise = false;\r\n\t\t\r\n\t\tthis.registerTableOption(\"ajaxURL\", false); //url for ajax loading\r\n\t\tthis.registerTableOption(\"ajaxURLGenerator\", false);\r\n\t\tthis.registerTableOption(\"ajaxParams\", {}); //params for ajax loading\r\n\t\tthis.registerTableOption(\"ajaxConfig\", \"get\"); //ajax request type\r\n\t\tthis.registerTableOption(\"ajaxContentType\", \"form\"); //ajax request type\r\n\t\tthis.registerTableOption(\"ajaxRequestFunc\", false); //promise function\r\n\t\t\r\n\t\tthis.registerTableOption(\"ajaxRequesting\", function(){});\r\n\t\tthis.registerTableOption(\"ajaxResponse\", false);\r\n\t\t\r\n\t\tthis.contentTypeFormatters = Ajax.contentTypeFormatters;\r\n\t}\r\n\t\r\n\t//initialize setup options\r\n\tinitialize(){\r\n\t\tthis.loaderPromise = this.table.options.ajaxRequestFunc || Ajax.defaultLoaderPromise;\r\n\t\tthis.urlGenerator = this.table.options.ajaxURLGenerator || Ajax.defaultURLGenerator;\r\n\t\t\r\n\t\tif(this.table.options.ajaxURL){\r\n\t\t\tthis.setUrl(this.table.options.ajaxURL);\r\n\t\t}\r\n\r\n\r\n\t\tthis.setDefaultConfig(this.table.options.ajaxConfig);\r\n\t\t\r\n\t\tthis.registerTableFunction(\"getAjaxUrl\", this.getUrl.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"data-loading\", this.requestDataCheck.bind(this));\r\n\t\tthis.subscribe(\"data-params\", this.requestParams.bind(this));\r\n\t\tthis.subscribe(\"data-load\", this.requestData.bind(this));\r\n\t}\r\n\t\r\n\trequestParams(data, config, silent, params){\r\n\t\tvar ajaxParams = this.table.options.ajaxParams;\r\n\t\t\r\n\t\tif(ajaxParams){\r\n\t\t\tif(typeof ajaxParams === \"function\"){\r\n\t\t\t\tajaxParams = ajaxParams.call(this.table);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tparams = Object.assign(params, ajaxParams);\r\n\t\t}\t\t\r\n\t\t\r\n\t\treturn params;\r\n\t}\r\n\t\r\n\trequestDataCheck(data, params, config, silent){\r\n\t\treturn !!((!data && this.url) || typeof data === \"string\");\r\n\t}\r\n\t\r\n\trequestData(url, params, config, silent, previousData){\r\n\t\tvar ajaxConfig;\r\n\t\t\r\n\t\tif(!previousData && this.requestDataCheck(url)){\r\n\t\t\tif(url){\r\n\t\t\t\tthis.setUrl(url);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tajaxConfig = this.generateConfig(config);\r\n\t\t\t\r\n\t\t\treturn this.sendRequest(this.url, params, ajaxConfig);\r\n\t\t}else{\r\n\t\t\treturn previousData;\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetDefaultConfig(config = {}){\r\n\t\tthis.config = Object.assign({}, Ajax.defaultConfig);\r\n\r\n\t\tif(typeof config == \"string\"){\r\n\t\t\tthis.config.method = config;\r\n\t\t}else{\r\n\t\t\tObject.assign(this.config, config);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//load config object\r\n\tgenerateConfig(config = {}){\r\n\t\tvar ajaxConfig = Object.assign({}, this.config)\r\n\t\t\r\n\t\tif(typeof config == \"string\"){\r\n\t\t\tajaxConfig.method = config;\r\n\t\t}else{\r\n\t\t\tObject.assign(ajaxConfig, config);\r\n\t\t}\r\n\t\t\r\n\t\treturn ajaxConfig;\r\n\t}\r\n\t\r\n\t//set request url\r\n\tsetUrl(url){\r\n\t\tthis.url = url;\r\n\t}\r\n\t\r\n\t//get request url\r\n\tgetUrl(){\r\n\t\treturn this.url;\r\n\t}\r\n\t\r\n\t//send ajax request\r\n\tsendRequest(url, params, config){\r\n\t\tif(this.table.options.ajaxRequesting.call(this.table, url, params) !== false){\r\n\t\t\treturn this.loaderPromise(url, config, params)\r\n\t\t\t.then((data)=>{\r\n\t\t\t\tif(this.table.options.ajaxResponse){\r\n\t\t\t\t\tdata = this.table.options.ajaxResponse.call(this.table, url, params, data);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn data;\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n}\r\n\r\nAjax.moduleName = \"ajax\";\r\n\r\n//load defaults\r\nAjax.defaultConfig = defaultConfig;\r\nAjax.defaultURLGenerator = defaultURLGenerator;\r\nAjax.defaultLoaderPromise = defaultLoaderPromise;\r\nAjax.contentTypeFormatters = defaultContentTypeFormatters;\r\n\r\nexport default Ajax;","export default {\r\n\treplace:function(rows){\r\n\t\treturn this.table.setData(rows);\r\n\t},\r\n\tupdate:function(rows){\r\n\t\treturn this.table.updateOrAddData(rows);\r\n\t},\r\n\tinsert:function(rows){\r\n\t\treturn this.table.addData(rows);\r\n\t},\r\n};","export default {\r\n\ttable:function(clipboard){\r\n\t\tvar data = [],\r\n\t\tsuccess = false,\r\n\t\theaderFindSuccess = true,\r\n\t\tcolumns = this.table.columnManager.columns,\r\n\t\tcolumnMap = [],\r\n\t\trows = [];\r\n\r\n\t\t//get data from clipboard into array of columns and rows.\r\n\t\tclipboard = clipboard.split(\"\\n\");\r\n\r\n\t\tclipboard.forEach(function(row){\r\n\t\t\tdata.push(row.split(\"\\t\"));\r\n\t\t});\r\n\r\n\t\tif(data.length && !(data.length === 1 && data[0].length < 2)){\r\n\t\t\tsuccess = true;\r\n\r\n\t\t\t//check if headers are present by title\r\n\t\t\tdata[0].forEach(function(value){\r\n\t\t\t\tvar column = columns.find(function(column){\r\n\t\t\t\t\treturn value && column.definition.title && value.trim() && column.definition.title.trim() === value.trim();\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tcolumnMap.push(column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\theaderFindSuccess = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t//check if column headers are present by field\r\n\t\t\tif(!headerFindSuccess){\r\n\t\t\t\theaderFindSuccess = true;\r\n\t\t\t\tcolumnMap = [];\r\n\r\n\t\t\t\tdata[0].forEach(function(value){\r\n\t\t\t\t\tvar column = columns.find(function(column){\r\n\t\t\t\t\t\treturn value && column.field && value.trim() && column.field.trim() === value.trim();\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(column){\r\n\t\t\t\t\t\tcolumnMap.push(column);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\theaderFindSuccess = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(!headerFindSuccess){\r\n\t\t\t\t\tcolumnMap = this.table.columnManager.columnsByIndex;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//remove header row if found\r\n\t\t\tif(headerFindSuccess){\r\n\t\t\t\tdata.shift();\r\n\t\t\t}\r\n\r\n\t\t\tdata.forEach(function(item){\r\n\t\t\t\tvar row = {};\r\n\r\n\t\t\t\titem.forEach(function(value, i){\r\n\t\t\t\t\tif(columnMap[i]){\r\n\t\t\t\t\t\trow[columnMap[i].field] = value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\trows.push(row);\r\n\t\t\t});\r\n\r\n\t\t\treturn rows;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultPasteActions from './defaults/pasteActions.js';\r\nimport defaultPasteParsers from './defaults/pasteParsers.js';\r\n\r\nclass Clipboard extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.mode = true;\r\n\t\tthis.pasteParser = function(){};\r\n\t\tthis.pasteAction = function(){};\r\n\t\tthis.customSelection = false;\r\n\t\tthis.rowRange = false;\r\n\t\tthis.blocked = true; //block copy actions not originating from this command\r\n\r\n\t\tthis.registerTableOption(\"clipboard\", false); //enable clipboard\r\n\t\tthis.registerTableOption(\"clipboardCopyStyled\", true); //formatted table data\r\n\t\tthis.registerTableOption(\"clipboardCopyConfig\", false); //clipboard config\r\n\t\tthis.registerTableOption(\"clipboardCopyFormatter\", false); //DEPRICATED - REMOVE in 5.0\r\n\t\tthis.registerTableOption(\"clipboardCopyRowRange\", \"active\"); //restrict clipboard to visible rows only\r\n\t\tthis.registerTableOption(\"clipboardPasteParser\", \"table\"); //convert pasted clipboard data to rows\r\n\t\tthis.registerTableOption(\"clipboardPasteAction\", \"insert\"); //how to insert pasted data into the table\r\n\r\n\t\tthis.registerColumnOption(\"clipboard\");\r\n\t\tthis.registerColumnOption(\"titleClipboard\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.mode = this.table.options.clipboard;\r\n\r\n\t\tthis.rowRange = this.table.options.clipboardCopyRowRange;\r\n\r\n\t\tif(this.mode === true || this.mode === \"copy\"){\r\n\t\t\tthis.table.element.addEventListener(\"copy\", (e) => {\r\n\t\t\t\tvar plain, html, list;\r\n\r\n\t\t\t\tif(!this.blocked){\r\n\t\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\t\tif(this.customSelection){\r\n\t\t\t\t\t\tplain = this.customSelection;\r\n\r\n\t\t\t\t\t\tif(this.table.options.clipboardCopyFormatter){\r\n\t\t\t\t\t\t\tplain = this.table.options.clipboardCopyFormatter(\"plain\", plain);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\r\n\t\t\t\t\t\tvar list = this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig, this.table.options.clipboardCopyStyled, this.rowRange, \"clipboard\");\r\n\r\n\t\t\t\t\t\thtml = this.table.modules.export.genereateHTMLTable(list);\r\n\t\t\t\t\t\tplain = html ? this.generatePlainContent(list) : \"\";\r\n\r\n\t\t\t\t\t\tif(this.table.options.clipboardCopyFormatter){\r\n\t\t\t\t\t\t\tplain = this.table.options.clipboardCopyFormatter(\"plain\", plain);\r\n\t\t\t\t\t\t\thtml = this.table.options.clipboardCopyFormatter(\"html\", html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (window.clipboardData && window.clipboardData.setData) {\r\n\t\t\t\t\t\twindow.clipboardData.setData('Text', plain);\r\n\t\t\t\t\t} else if (e.clipboardData && e.clipboardData.setData) {\r\n\t\t\t\t\t\te.clipboardData.setData('text/plain', plain);\r\n\t\t\t\t\t\tif(html){\r\n\t\t\t\t\t\t\te.clipboardData.setData('text/html', html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (e.originalEvent && e.originalEvent.clipboardData.setData) {\r\n\t\t\t\t\t\te.originalEvent.clipboardData.setData('text/plain', plain);\r\n\t\t\t\t\t\tif(html){\r\n\t\t\t\t\t\t\te.originalEvent.clipboardData.setData('text/html', html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.dispatchExternal(\"clipboardCopied\", plain, html);\r\n\r\n\t\t\t\t\tthis.reset();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.mode === true || this.mode === \"paste\"){\r\n\t\t\tthis.table.element.addEventListener(\"paste\", (e) => {\r\n\t\t\t\tthis.paste(e);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.setPasteParser(this.table.options.clipboardPasteParser);\r\n\t\tthis.setPasteAction(this.table.options.clipboardPasteAction);\r\n\r\n\t\tthis.registerTableFunction(\"copyToClipboard\", this.copy.bind(this));\r\n\t}\r\n\r\n\treset(){\r\n\t\tthis.blocked = true;\r\n\t\tthis.customSelection = false;\r\n\t}\r\n\r\n\tgeneratePlainContent (list) {\r\n\t\tvar output = [];\r\n\r\n\t\tlist.forEach((row) => {\r\n\t\t\tvar rowData = [];\r\n\r\n\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\tvar value = \"\";\r\n\r\n\t\t\t\tif(col){\r\n\r\n\t\t\t\t\tif(row.type === \"group\"){\r\n\t\t\t\t\t\tcol.value = col.component.getKey();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(col.value === null){\r\n\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\t\tvalue = JSON.stringify(col.value);\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tvalue = col.value;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowData.push(value);\r\n\t\t\t});\r\n\r\n\t\t\toutput.push(rowData.join(\"\\t\"));\r\n\t\t});\r\n\r\n\t\treturn output.join(\"\\n\");\r\n\t}\r\n\r\n\tcopy (range, internal) {\r\n\t\tvar range, sel, textRange;\r\n\t\tthis.blocked = false;\r\n\t\tthis.customSelection = false;\r\n\r\n\t\tif (this.mode === true || this.mode === \"copy\") {\r\n\r\n\t\t\tthis.rowRange = range || this.table.options.clipboardCopyRowRange;\r\n\r\n\t\t\tif (typeof window.getSelection != \"undefined\" && typeof document.createRange != \"undefined\") {\r\n\t\t\t\trange = document.createRange();\r\n\t\t\t\trange.selectNodeContents(this.table.element);\r\n\t\t\t\tsel = window.getSelection();\r\n\r\n\t\t\t\tif (sel.toString() && internal) {\r\n\t\t\t\t\tthis.customSelection = sel.toString();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tsel.removeAllRanges();\r\n\t\t\t\tsel.addRange(range);\r\n\t\t\t} else if (typeof document.selection != \"undefined\" && typeof document.body.createTextRange != \"undefined\") {\r\n\t\t\t\ttextRange = document.body.createTextRange();\r\n\t\t\t\ttextRange.moveToElementText(this.table.element);\r\n\t\t\t\ttextRange.select();\r\n\t\t\t}\r\n\r\n\t\t\tdocument.execCommand('copy');\r\n\r\n\t\t\tif (sel) {\r\n\t\t\t\tsel.removeAllRanges();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//PASTE EVENT HANDLING\r\n\tsetPasteAction(action){\r\n\r\n\t\tswitch(typeof action){\r\n\t\t\tcase \"string\":\r\n\t\t\tthis.pasteAction = Clipboard.pasteActions[action];\r\n\r\n\t\t\tif(!this.pasteAction){\r\n\t\t\t\tconsole.warn(\"Clipboard Error - No such paste action found:\", action);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tthis.pasteAction = action;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tsetPasteParser(parser){\r\n\t\tswitch(typeof parser){\r\n\t\t\tcase \"string\":\r\n\t\t\tthis.pasteParser = Clipboard.pasteParsers[parser];\r\n\r\n\t\t\tif(!this.pasteParser){\r\n\t\t\t\tconsole.warn(\"Clipboard Error - No such paste parser found:\", parser);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tthis.pasteParser = parser;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tpaste(e){\r\n\t\tvar data, rowData, rows;\r\n\r\n\t\tif(this.checkPaseOrigin(e)){\r\n\r\n\t\t\tdata = this.getPasteData(e);\r\n\r\n\t\t\trowData = this.pasteParser.call(this, data);\r\n\r\n\t\t\tif(rowData){\r\n\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\t\t\trowData = this.mutateData(rowData);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trows = this.pasteAction.call(this, rowData);\r\n\r\n\t\t\t\tthis.dispatchExternal(\"clipboardPasted\", data, rowData, rows);\r\n\t\t\t}else{\r\n\t\t\t\tthis.dispatchExternal(\"clipboardPasteError\", data);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmutateData(data){\r\n\t\tvar output = [];\r\n\r\n\t\tif(Array.isArray(data)){\r\n\t\t\tdata.forEach((row) => {\r\n\t\t\t\toutput.push(this.table.modules.mutator.transformRow(row, \"clipboard\"));\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\toutput = data;\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\r\n\tcheckPaseOrigin(e){\r\n\t\tvar valid = true;\r\n\r\n\t\tif(e.target.tagName != \"DIV\" || this.table.modules.edit.currentCell){\r\n\t\t\tvalid = false;\r\n\t\t}\r\n\r\n\t\treturn valid;\r\n\t}\r\n\r\n\tgetPasteData(e){\r\n\t\tvar data;\r\n\r\n\t\tif (window.clipboardData && window.clipboardData.getData) {\r\n\t\t\tdata = window.clipboardData.getData('Text');\r\n\t\t} else if (e.clipboardData && e.clipboardData.getData) {\r\n\t\t\tdata = e.clipboardData.getData('text/plain');\r\n\t\t} else if (e.originalEvent && e.originalEvent.clipboardData.getData) {\r\n\t\t\tdata = e.originalEvent.clipboardData.getData('text/plain');\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n}\r\n\r\nClipboard.moduleName = \"clipboard\";\r\n\r\n//load defaults\r\nClipboard.pasteActions = defaultPasteActions;\r\nClipboard.pasteParsers = defaultPasteParsers;\r\n\r\nexport default Clipboard;","class CalcComponent{\r\n\tconstructor (row){\r\n\t\tthis._row = row;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._row.table.componentFunctionBinder.handle(\"row\", target._row, name)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\tgetData(transform){\r\n\t\treturn this._row.getData(transform);\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._row.getElement();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._row.table;\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._row.getCells().forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tgetCell(column){\r\n\t\tvar cell = this._row.getCell(column);\r\n\t\treturn cell ? cell.getComponent() : false;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._row;\r\n\t}\r\n}\r\n\r\nexport default CalcComponent;","export default {\r\n\t\"avg\":function(values, data, calcParams){\r\n\t\tvar output = 0,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : 2\r\n\r\n\t\tif(values.length){\r\n\t\t\toutput = values.reduce(function(sum, value){\r\n\t\t\t\treturn Number(sum) + Number(value);\r\n\t\t\t});\r\n\r\n\t\t\toutput = output / values.length;\r\n\r\n\t\t\toutput = precision !== false ? output.toFixed(precision) : output;\r\n\t\t}\r\n\r\n\t\treturn parseFloat(output).toString();\r\n\t},\r\n\t\"max\":function(values, data, calcParams){\r\n\t\tvar output = null,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tvalues.forEach(function(value){\r\n\r\n\t\t\tvalue = Number(value);\r\n\r\n\t\t\tif(value > output || output === null){\r\n\t\t\t\toutput = value;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output !== null ? (precision !== false ? output.toFixed(precision) : output) : \"\";\r\n\t},\r\n\t\"min\":function(values, data, calcParams){\r\n\t\tvar output = null,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tvalues.forEach(function(value){\r\n\r\n\t\t\tvalue = Number(value);\r\n\r\n\t\t\tif(value < output || output === null){\r\n\t\t\t\toutput = value;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output !== null ? (precision !== false ? output.toFixed(precision) : output) : \"\";\r\n\t},\r\n\t\"sum\":function(values, data, calcParams){\r\n\t\tvar output = 0,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tif(values.length){\r\n\t\t\tvalues.forEach(function(value){\r\n\t\t\t\tvalue = Number(value);\r\n\r\n\t\t\t\toutput += !isNaN(value) ? Number(value) : 0;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn precision !== false ? output.toFixed(precision) : output;\r\n\t},\r\n\t\"concat\":function(values, data, calcParams){\r\n\t\tvar output = 0;\r\n\r\n\t\tif(values.length){\r\n\t\t\toutput = values.reduce(function(sum, value){\r\n\t\t\t\treturn String(sum) + String(value);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t},\r\n\t\"count\":function(values, data, calcParams){\r\n\t\tvar output = 0;\r\n\r\n\t\tif(values.length){\r\n\t\t\tvalues.forEach(function(value){\r\n\t\t\t\tif(value){\r\n\t\t\t\t\toutput ++;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport CalcComponent from './CalcComponent.js';\r\n\r\nimport Cell from '../../core/cell/Cell.js';\r\nimport Column from '../../core/column/Column.js';\r\nimport Row from '../../core/row/Row.js';\r\n\r\nimport defaultCalculations from './defaults/calculations.js';\r\n\r\nclass ColumnCalcs extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.topCalcs = [];\r\n\t\tthis.botCalcs = [];\r\n\t\tthis.genColumn = false;\r\n\t\tthis.topElement = this.createElement();\r\n\t\tthis.botElement = this.createElement();\r\n\t\tthis.topRow = false;\r\n\t\tthis.botRow = false;\r\n\t\tthis.topInitialized = false;\r\n\t\tthis.botInitialized = false;\r\n\r\n\t\tthis.registerTableOption(\"columnCalcs\", true);\r\n\r\n\t\tthis.registerColumnOption(\"topCalc\");\r\n\t\tthis.registerColumnOption(\"topCalcParams\");\r\n\t\tthis.registerColumnOption(\"topCalcFormatter\");\r\n\t\tthis.registerColumnOption(\"topCalcFormatterParams\");\r\n\t\tthis.registerColumnOption(\"bottomCalc\");\r\n\t\tthis.registerColumnOption(\"bottomCalcParams\");\r\n\t\tthis.registerColumnOption(\"bottomCalcFormatter\");\r\n\t\tthis.registerColumnOption(\"bottomCalcFormatterParams\");\r\n\t}\r\n\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tel.classList.add(\"tabulator-calcs-holder\");\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.genColumn = new Column({field:\"value\"}, this);\r\n\r\n\t\tthis.subscribe(\"cell-value-changed\", this.cellValueChanged.bind(this));\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumnCheck.bind(this));\r\n\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"row-added\", this.rowsUpdated.bind(this));\r\n\t\tthis.subscribe(\"column-moved\", this.recalcActiveRows.bind(this));\r\n\t\tthis.subscribe(\"column-add\", this.recalcActiveRows.bind(this));\r\n\t\tthis.subscribe(\"data-refreshed\", this.recalcActiveRowsRefresh.bind(this));\r\n\t\tthis.subscribe(\"table-redraw\", this.tableRedraw.bind(this));\r\n\t\tthis.subscribe(\"rows-visible\", this.visibleRows.bind(this));\r\n\r\n\t\tthis.registerTableFunction(\"getCalcResults\", this.getResults.bind(this));\r\n\t\tthis.registerTableFunction(\"recalc\", this.userRecalc.bind(this));\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\r\n\t\tif(force){\r\n\t\t\tthis.redraw();\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\tuserRecalc(){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tvisibleRows(viewable, rows){\r\n\t\tif(this.topRow){\r\n\t\t\trows.unshift(this.topRow);\r\n\t\t}\r\n\r\n\t\tif(this.botRow){\r\n\t\t\trows.push(this.botRow);\r\n\t\t}\r\n\t\r\n\t\treturn rows;\r\n\t}\r\n\r\n\trowsUpdated(row){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.recalcRowGroup(this);\r\n\t\t}else{\r\n\t\t\tthis.recalcActiveRows();\r\n\t\t}\r\n\t}\r\n\r\n\trecalcActiveRowsRefresh(){\r\n\t\tif(this.table.options.groupBy && this.table.options.dataTreeStartExpanded && this.table.options.dataTree){\r\n\t\t\tthis.recalcAll();\r\n\t\t}else{\r\n\t\t\tthis.recalcActiveRows();\r\n\t\t}\r\n\t}\r\n\r\n\trecalcActiveRows(){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\t}\r\n\r\n\tcellValueChanged(cell){\r\n\t\tif(cell.column.definition.topCalc || cell.column.definition.bottomCalc){\r\n\t\t\tif(this.table.options.groupBy){\r\n\t\t\t\tif(this.table.options.columnCalcs == \"table\" || this.table.options.columnCalcs == \"both\"){\r\n\t\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"table\"){\r\n\t\t\t\t\tthis.recalcRowGroup(cell.row);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeColumnCheck(column){\r\n\t\tif(column.definition.topCalc || column.definition.bottomCalc){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\r\n\t//initialize column calcs\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.definition\r\n\r\n\t\tvar config = {\r\n\t\t\ttopCalcParams:def.topCalcParams || {},\r\n\t\t\tbotCalcParams:def.bottomCalcParams || {},\r\n\t\t};\r\n\r\n\t\tif(def.topCalc){\r\n\r\n\t\t\tswitch(typeof def.topCalc){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tif(ColumnCalcs.calculations[def.topCalc]){\r\n\t\t\t\t\tconfig.topCalc = ColumnCalcs.calculations[def.topCalc]\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Column Calc Error - No such calculation found, ignoring: \", def.topCalc);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tconfig.topCalc = def.topCalc;\r\n\t\t\t\tbreak\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(config.topCalc){\r\n\t\t\t\tcolumn.modules.columnCalcs = config;\r\n\t\t\t\tthis.topCalcs.push(column);\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"group\"){\r\n\t\t\t\t\tthis.initializeTopRow();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tif(def.bottomCalc){\r\n\t\t\tswitch(typeof def.bottomCalc){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tif(ColumnCalcs.calculations[def.bottomCalc]){\r\n\t\t\t\t\tconfig.botCalc = ColumnCalcs.calculations[def.bottomCalc]\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Column Calc Error - No such calculation found, ignoring: \", def.bottomCalc);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tconfig.botCalc = def.bottomCalc;\r\n\t\t\t\tbreak\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(config.botCalc){\r\n\t\t\t\tcolumn.modules.columnCalcs = config;\r\n\t\t\t\tthis.botCalcs.push(column);\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"group\"){\r\n\t\t\t\t\tthis.initializeBottomRow();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t//dummy functions to handle being mock column manager\r\n\tregisterColumnField(){};\r\n\r\n\tremoveCalcs(){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(this.topInitialized){\r\n\t\t\tthis.topInitialized = false;\r\n\t\t\tthis.topElement.parentNode.removeChild(this.topElement);\r\n\t\t\tchanged = true;\r\n\t\t}\r\n\r\n\t\tif(this.botInitialized){\r\n\t\t\tthis.botInitialized = false;\r\n\t\t\tthis.footerRemove(this.botElement);\r\n\t\t\tchanged = true;\r\n\t\t}\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeTopRow(){\r\n\t\tif(!this.topInitialized){\r\n\t\t\tthis.table.columnManager.getElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling);\r\n\t\t\tthis.topInitialized = true;\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeBottomRow(){\r\n\t\tif(!this.botInitialized){\r\n\t\t\tthis.footerPrepend(this.botElement);\r\n\t\t\tthis.botInitialized = true;\r\n\t\t}\r\n\t}\r\n\r\n\tscrollHorizontal(left){\r\n\t\tif(this.botInitialized && this.botRow){\r\n\t\t\tthis.botRow.getElement().style.marginLeft = (-left) + \"px\";\r\n\t\t}\r\n\t}\r\n\r\n\trecalc(rows){\r\n\t\tvar data, row;\r\n\r\n\t\tif(this.topInitialized || this.botInitialized){\r\n\t\t\tdata = this.rowsToData(rows);\r\n\r\n\t\t\tif(this.topInitialized){\r\n\t\t\t\tif(this.topRow){\r\n\t\t\t\t\tthis.topRow.deleteCells();\r\n\t\t\t\t}\r\n\r\n\t\t\t\trow = this.generateRow(\"top\", this.rowsToData(rows))\r\n\t\t\t\tthis.topRow = row;\r\n\t\t\t\twhile(this.topElement.firstChild) this.topElement.removeChild(this.topElement.firstChild);\r\n\t\t\t\tthis.topElement.appendChild(row.getElement());\r\n\t\t\t\trow.initialize(true);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.botInitialized){\r\n\t\t\t\tif(this.botRow){\r\n\t\t\t\t\tthis.botRow.deleteCells();\r\n\t\t\t\t}\r\n\r\n\t\t\t\trow = this.generateRow(\"bottom\", this.rowsToData(rows))\r\n\t\t\t\tthis.botRow = row;\r\n\t\t\t\twhile(this.botElement.firstChild) this.botElement.removeChild(this.botElement.firstChild);\r\n\t\t\t\tthis.botElement.appendChild(row.getElement());\r\n\t\t\t\trow.initialize(true);\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\t//set resizable handles\r\n\t\t\tif(this.table.modExists(\"frozenColumns\")){\r\n\t\t\t\tthis.table.modules.frozenColumns.layout();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trecalcRowGroup(row){\r\n\t\tthis.recalcGroup(this.table.modules.groupRows.getRowGroup(row));\r\n\t}\r\n\r\n\trecalcAll(){\r\n\t\tif(this.topCalcs.length || this.botCalcs.length){\r\n\t\t\tif(this.table.options.columnCalcs !== \"group\"){\r\n\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.options.groupBy && this.table.options.columnCalcs !== \"table\"){\r\n\r\n\t\t\t\tvar groups = this.table.modules.groupRows.getChildGroups();\r\n\r\n\t\t\t\tgroups.forEach((group) => {\r\n\t\t\t\t\tthis.recalcGroup(group);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trecalcGroup(group){\r\n\t\tvar data, rowData;\r\n\r\n\t\tif(group){\r\n\t\t\tif(group.calcs){\r\n\t\t\t\tif(group.calcs.bottom){\r\n\t\t\t\t\tdata = this.rowsToData(group.rows);\r\n\t\t\t\t\trowData = this.generateRowData(\"bottom\", data);\r\n\r\n\t\t\t\t\tgroup.calcs.bottom.updateData(rowData);\r\n\t\t\t\t\tgroup.calcs.bottom.reinitialize();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(group.calcs.top){\r\n\t\t\t\t\tdata = this.rowsToData(group.rows);\r\n\t\t\t\t\trowData = this.generateRowData(\"top\", data);\r\n\r\n\t\t\t\t\tgroup.calcs.top.updateData(rowData);\r\n\t\t\t\t\tgroup.calcs.top.reinitialize();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//generate top stats row\r\n\tgenerateTopRow(rows){\r\n\t\treturn this.generateRow(\"top\", this.rowsToData(rows));\r\n\t}\r\n\t//generate bottom stats row\r\n\tgenerateBottomRow(rows){\r\n\t\treturn this.generateRow(\"bottom\", this.rowsToData(rows));\r\n\t}\r\n\r\n\trowsToData(rows){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\trows.forEach((row) => {\r\n\t\t\tdata.push(row.getData());\r\n\r\n\t\t\tif(this.table.options.dataTree && this.table.options.dataTreeChildColumnCalcs){\r\n\t\t\t\tif(row.modules.dataTree && row.modules.dataTree.open){\r\n\t\t\t\t\tvar children = this.rowsToData(this.table.modules.dataTree.getFilteredTreeChildren(row));\r\n\t\t\t\t\tdata = data.concat(children);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//generate stats row\r\n\tgenerateRow(pos, data){\r\n\t\tvar rowData = this.generateRowData(pos, data),\r\n\t\trow;\r\n\r\n\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\tthis.table.modules.mutator.disable();\r\n\t\t}\r\n\r\n\t\trow = new Row(rowData, this, \"calc\");\r\n\r\n\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\tthis.table.modules.mutator.enable();\r\n\t\t}\r\n\r\n\t\trow.getElement().classList.add(\"tabulator-calcs\", \"tabulator-calcs-\" + pos);\r\n\r\n\t\trow.component = false;\r\n\r\n\t\trow.getComponent = () => {\r\n\t\t\tif(!row.component){\r\n\t\t\t\trow.component = new CalcComponent(row);\r\n\t\t\t}\r\n\r\n\t\t\treturn row.component;\r\n\t\t};\r\n\r\n\t\trow.generateCells = () => {\r\n\r\n\t\t\tvar cells = [];\r\n\r\n\t\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\r\n\t\t\t\t\t//set field name of mock column\r\n\t\t\t\t\tthis.genColumn.setField(column.getField());\r\n\t\t\t\t\tthis.genColumn.hozAlign = column.hozAlign;\r\n\r\n\t\t\t\t\tif(column.definition[pos + \"CalcFormatter\"] && this.table.modExists(\"format\")){\r\n\t\t\t\t\t\tthis.genColumn.modules.format = {\r\n\t\t\t\t\t\t\tformatter: this.table.modules.format.getFormatter(column.definition[pos + \"CalcFormatter\"]),\r\n\t\t\t\t\t\t\tparams: column.definition[pos + \"CalcFormatterParams\"] || {},\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.genColumn.modules.format = {\r\n\t\t\t\t\t\t\tformatter: this.table.modules.format.getFormatter(\"plaintext\"),\r\n\t\t\t\t\t\t\tparams:{}\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//ensure css class defintion is replicated to calculation cell\r\n\t\t\t\t\tthis.genColumn.definition.cssClass = column.definition.cssClass;\r\n\r\n\t\t\t\t\t//generate cell and assign to correct column\r\n\t\t\t\t\tvar cell = new Cell(this.genColumn, row);\r\n\t\t\t\t\tcell.getElement();\r\n\t\t\t\t\tcell.column = column;\r\n\t\t\t\t\tcell.setWidth();\r\n\r\n\t\t\t\t\tcolumn.cells.push(cell);\r\n\t\t\t\t\tcells.push(cell);\r\n\r\n\t\t\t\t\tif(!column.visible){\r\n\t\t\t\t\t\tcell.hide();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\trow.cells = cells;\r\n\t\t};\r\n\r\n\t\treturn row;\r\n\t}\r\n\r\n\t//generate stats row\r\n\tgenerateRowData(pos, data){\r\n\t\tvar rowData = {},\r\n\t\tcalcs = pos == \"top\" ? this.topCalcs : this.botCalcs,\r\n\t\ttype = pos == \"top\" ? \"topCalc\" : \"botCalc\",\r\n\t\tparams, paramKey;\r\n\r\n\t\tcalcs.forEach(function(column){\r\n\t\t\tvar values = [];\r\n\r\n\t\t\tif(column.modules.columnCalcs && column.modules.columnCalcs[type]){\r\n\t\t\t\tdata.forEach(function(item){\r\n\t\t\t\t\tvalues.push(column.getFieldValue(item));\r\n\t\t\t\t});\r\n\r\n\t\t\t\tparamKey = type + \"Params\";\r\n\t\t\t\tparams = typeof column.modules.columnCalcs[paramKey] === \"function\" ? column.modules.columnCalcs[paramKey](values, data) : column.modules.columnCalcs[paramKey];\r\n\r\n\t\t\t\tcolumn.setFieldValue(rowData, column.modules.columnCalcs[type](values, data, params));\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowData;\r\n\t}\r\n\r\n\thasTopCalcs(){\r\n\t\treturn\t!!(this.topCalcs.length);\r\n\t}\r\n\r\n\thasBottomCalcs(){\r\n\t\treturn\t!!(this.botCalcs.length);\r\n\t}\r\n\r\n\t//handle table redraw\r\n\tredraw(){\r\n\t\tif(this.topRow){\r\n\t\t\tthis.topRow.normalizeHeight(true);\r\n\t\t}\r\n\t\tif(this.botRow){\r\n\t\t\tthis.botRow.normalizeHeight(true);\r\n\t\t}\r\n\t}\r\n\r\n\t//return the calculated\r\n\tgetResults(){\r\n\t\tvar results = {},\r\n\t\tgroups;\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tgroups = this.table.modules.groupRows.getGroups(true);\r\n\r\n\t\t\tgroups.forEach((group) => {\r\n\t\t\t\tresults[group.getKey()] = this.getGroupResults(group);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tresults = {\r\n\t\t\t\ttop: this.topRow ? this.topRow.getData() : {},\r\n\t\t\t\tbottom: this.botRow ? this.botRow.getData() : {},\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\t//get results from a group\r\n\tgetGroupResults(group){\r\n\t\tvar groupObj = group._getSelf(),\r\n\t\tsubGroups = group.getSubGroups(),\r\n\t\tsubGroupResults = {},\r\n\t\tresults = {};\r\n\r\n\t\tsubGroups.forEach((subgroup) => {\r\n\t\t\tsubGroupResults[subgroup.getKey()] = this.getGroupResults(subgroup);\r\n\t\t});\r\n\r\n\t\tresults = {\r\n\t\t\ttop: groupObj.calcs.top ? groupObj.calcs.top.getData() : {},\r\n\t\t\tbottom: groupObj.calcs.bottom ? groupObj.calcs.bottom.getData() : {},\r\n\t\t\tgroups: subGroupResults,\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n}\r\n\r\nColumnCalcs.moduleName = \"columnCalcs\";\r\n\r\n//load defaults\r\nColumnCalcs.calculations = defaultCalculations;\r\n\r\nexport default ColumnCalcs;","import Module from '../../core/Module.js';\r\n\r\nimport Row from '../../core/row/Row.js';\r\n\r\nclass DataTree extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.indent = 10;\r\n\t\tthis.field = \"\";\r\n\t\tthis.collapseEl = null;\r\n\t\tthis.expandEl = null;\r\n\t\tthis.branchEl = null;\r\n\t\tthis.elementField = false;\r\n\r\n\t\tthis.startOpen = function(){};\r\n\r\n\t\tthis.displayIndex = 0;\r\n\r\n\t\tthis.registerTableOption(\"dataTree\", false); //enable data tree\r\n\t\tthis.registerTableOption(\"dataTreeFilter\", true); //filter child rows\r\n\t\tthis.registerTableOption(\"dataTreeSort\", true); //sort child rows\r\n\t\tthis.registerTableOption(\"dataTreeElementColumn\", false);\r\n\t\tthis.registerTableOption(\"dataTreeBranchElement\", true);//show data tree branch element\r\n\t\tthis.registerTableOption(\"dataTreeChildIndent\", 9); //data tree child indent in px\r\n\t\tthis.registerTableOption(\"dataTreeChildField\", \"_children\");//data tre column field to look for child rows\r\n\t\tthis.registerTableOption(\"dataTreeCollapseElement\", false);//data tree row collapse element\r\n\t\tthis.registerTableOption(\"dataTreeExpandElement\", false);//data tree row expand element\r\n\t\tthis.registerTableOption(\"dataTreeStartExpanded\", false);\r\n\t\tthis.registerTableOption(\"dataTreeChildColumnCalcs\", false);//include visible data tree rows in column calculations\r\n\t\tthis.registerTableOption(\"dataTreeSelectPropagate\", false);//seleccting a parent row selects its children\r\n\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"treeCollapse\", this.collapseRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"treeExpand\", this.expandRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"treeToggle\", this.toggleRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"getTreeParent\", this.getTreeParent.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"getTreeChildren\", this.getRowChildren.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"addTreeChild\", this.addTreeChildRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isTreeExpanded\", this.isRowExpanded.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.dataTree){\r\n\t\t\tvar dummyEl = null,\r\n\t\t\toptions = this.table.options;\r\n\r\n\t\t\tthis.field = options.dataTreeChildField;\r\n\t\t\tthis.indent = options.dataTreeChildIndent;\r\n\r\n\t\t\tif(options.dataTreeBranchElement){\r\n\r\n\t\t\t\tif(options.dataTreeBranchElement === true){\r\n\t\t\t\t\tthis.branchEl = document.createElement(\"div\");\r\n\t\t\t\t\tthis.branchEl.classList.add(\"tabulator-data-tree-branch\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(typeof options.dataTreeBranchElement === \"string\"){\r\n\t\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\t\tdummyEl.innerHTML = options.dataTreeBranchElement;\r\n\t\t\t\t\t\tthis.branchEl = dummyEl.firstChild;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.branchEl = options.dataTreeBranchElement;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(options.dataTreeCollapseElement){\r\n\t\t\t\tif(typeof options.dataTreeCollapseElement === \"string\"){\r\n\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\tdummyEl.innerHTML = options.dataTreeCollapseElement;\r\n\t\t\t\t\tthis.collapseEl = dummyEl.firstChild;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.collapseEl = options.dataTreeCollapseElement;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.collapseEl = document.createElement(\"div\");\r\n\t\t\t\tthis.collapseEl.classList.add(\"tabulator-data-tree-control\");\r\n\t\t\t\tthis.collapseEl.tabIndex = 0;\r\n\t\t\t\tthis.collapseEl.innerHTML = \"
\";\r\n\t\t\t}\r\n\r\n\t\t\tif(options.dataTreeExpandElement){\r\n\t\t\t\tif(typeof options.dataTreeExpandElement === \"string\"){\r\n\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\tdummyEl.innerHTML = options.dataTreeExpandElement;\r\n\t\t\t\t\tthis.expandEl = dummyEl.firstChild;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.expandEl = options.dataTreeExpandElement;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.expandEl = document.createElement(\"div\");\r\n\t\t\t\tthis.expandEl.classList.add(\"tabulator-data-tree-control\");\r\n\t\t\t\tthis.expandEl.tabIndex = 0;\r\n\t\t\t\tthis.expandEl.innerHTML = \"
\";\r\n\t\t\t}\r\n\r\n\r\n\t\t\tswitch(typeof options.dataTreeStartExpanded){\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\tthis.startOpen = function(row, index){\r\n\t\t\t\t\treturn options.dataTreeStartExpanded;\r\n\t\t\t\t};\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tthis.startOpen = options.dataTreeStartExpanded;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\tthis.startOpen = function(row, index){\r\n\t\t\t\t\treturn options.dataTreeStartExpanded[index];\r\n\t\t\t\t};\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-layout-after\", this.layoutRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowDelete.bind(this),0);\r\n\t\t\tthis.subscribe(\"row-data-changed\", this.rowDataChanged.bind(this), 10);\r\n\t\t\tthis.subscribe(\"cell-value-updated\", this.cellValueChanged.bind(this));\r\n\t\t\tthis.subscribe(\"edit-cancelled\", this.cellValueChanged.bind(this));\r\n\t\t\tthis.subscribe(\"column-moving-rows\", this.columnMoving.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.initializeElementField.bind(this));\r\n\t\t\tthis.subscribe(\"table-redrawing\", this.tableRedrawing.bind(this));\r\n\r\n\t\t\tthis.registerDisplayHandler(this.getRows.bind(this), 30);\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedrawing(force){\r\n\t\tvar rows;\r\n\r\n\t\tif(force){\r\n\t\t\trows = this.table.rowManager.getRows();\r\n\t\t\t\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.reinitializeRowChildren(row);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeElementField(){\r\n\t\tvar firstCol = this.table.columnManager.getFirstVisibleColumn();\r\n\r\n\t\tthis.elementField = this.table.options.dataTreeElementColumn || (firstCol ? firstCol.field : false);\r\n\t}\r\n\t\r\n\tgetRowChildren(row){\r\n\t\treturn this.getTreeChildren(row, true);\r\n\t}\r\n\r\n\tcolumnMoving(){\r\n\t\tvar rows = [];\r\n\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\trows = rows.concat(this.getTreeChildren(row, false, true));\r\n\t\t});\r\n\r\n\t\treturn rows;\r\n\t}\r\n\r\n\trowDataChanged(row, visible, updatedData){\r\n\t\tif(this.redrawNeeded(updatedData)){\r\n\t\t\tthis.initializeRow(row);\r\n\r\n\t\t\tif(visible){\r\n\t\t\t\tthis.layoutRow(row);\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tcellValueChanged(cell){\r\n\t\tvar field = cell.column.getField();\r\n\r\n\t\tif(field === this.elementField){\r\n\t\t\tthis.layoutRow(cell.row);\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar childArray = row.getData()[this.field];\r\n\t\tvar isArray = Array.isArray(childArray);\r\n\r\n\t\tvar children = isArray || (!isArray && typeof childArray === \"object\" && childArray !== null);\r\n\r\n\t\tif(!children && row.modules.dataTree && row.modules.dataTree.branchEl){\r\n\t\t\trow.modules.dataTree.branchEl.parentNode.removeChild(row.modules.dataTree.branchEl);\r\n\t\t}\r\n\r\n\t\tif(!children && row.modules.dataTree && row.modules.dataTree.controlEl){\r\n\t\t\trow.modules.dataTree.controlEl.parentNode.removeChild(row.modules.dataTree.controlEl);\r\n\t\t}\r\n\r\n\t\trow.modules.dataTree = {\r\n\t\t\tindex: row.modules.dataTree ? row.modules.dataTree.index : 0,\r\n\t\t\topen: children ? (row.modules.dataTree ? row.modules.dataTree.open : this.startOpen(row.getComponent(), 0)) : false,\r\n\t\t\tcontrolEl: row.modules.dataTree && children ? row.modules.dataTree.controlEl : false,\r\n\t\t\tbranchEl: row.modules.dataTree && children ? row.modules.dataTree.branchEl : false,\r\n\t\t\tparent: row.modules.dataTree ? row.modules.dataTree.parent : false,\r\n\t\t\tchildren:children,\r\n\t\t};\r\n\t}\r\n\r\n\treinitializeRowChildren(row){\r\n\t\tvar children = this.getTreeChildren(row, false, true);\r\n\r\n\t\tchildren.forEach(function(child){\r\n\t\t\tchild.reinitialize(true);\r\n\t\t});\r\n\t}\r\n\r\n\tlayoutRow(row){\r\n\t\tvar cell = this.elementField ? row.getCell(this.elementField) : row.getCells()[0],\r\n\t\tel = cell.getElement(),\r\n\t\tconfig = row.modules.dataTree;\r\n\r\n\t\tif(config.branchEl){\r\n\t\t\tif(config.branchEl.parentNode){\r\n\t\t\t\tconfig.branchEl.parentNode.removeChild(config.branchEl);\r\n\t\t\t}\r\n\t\t\tconfig.branchEl = false;\r\n\t\t}\r\n\r\n\t\tif(config.controlEl){\r\n\t\t\tif(config.controlEl.parentNode){\r\n\t\t\t\tconfig.controlEl.parentNode.removeChild(config.controlEl);\r\n\t\t\t}\r\n\t\t\tconfig.controlEl = false;\r\n\t\t}\r\n\r\n\t\tthis.generateControlElement(row, el);\r\n\r\n\t\trow.getElement().classList.add(\"tabulator-tree-level-\" + config.index);\r\n\r\n\t\tif(config.index){\r\n\t\t\tif(this.branchEl){\r\n\t\t\t\tconfig.branchEl = this.branchEl.cloneNode(true);\r\n\t\t\t\tel.insertBefore(config.branchEl, el.firstChild);\r\n\r\n\t\t\t\tif(this.table.rtl){\r\n\t\t\t\t\tconfig.branchEl.style.marginRight = (((config.branchEl.offsetWidth + config.branchEl.style.marginLeft) * (config.index - 1)) + (config.index * this.indent)) + \"px\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconfig.branchEl.style.marginLeft = (((config.branchEl.offsetWidth + config.branchEl.style.marginRight) * (config.index - 1)) + (config.index * this.indent)) + \"px\";\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\r\n\t\t\t\tif(this.table.rtl){\r\n\t\t\t\t\tel.style.paddingRight = parseInt(window.getComputedStyle(el, null).getPropertyValue('padding-right')) + (config.index * this.indent) + \"px\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.style.paddingLeft = parseInt(window.getComputedStyle(el, null).getPropertyValue('padding-left')) + (config.index * this.indent) + \"px\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateControlElement(row, el){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\tel = el || row.getCells()[0].getElement(),\r\n\t\toldControl = config.controlEl;\r\n\r\n\t\tif(config.children !== false){\r\n\r\n\t\t\tif(config.open){\r\n\t\t\t\tconfig.controlEl = this.collapseEl.cloneNode(true);\r\n\t\t\t\tconfig.controlEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\tthis.collapseRow(row);\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconfig.controlEl = this.expandEl.cloneNode(true);\r\n\t\t\t\tconfig.controlEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\tthis.expandRow(row);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tconfig.controlEl.addEventListener(\"mousedown\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t});\r\n\r\n\t\t\tif(oldControl && oldControl.parentNode === el){\r\n\t\t\t\toldControl.parentNode.replaceChild(config.controlEl,oldControl);\r\n\t\t\t}else{\r\n\t\t\t\tel.insertBefore(config.controlEl, el.firstChild);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tsetDisplayIndex (index) {\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\r\n\tgetDisplayIndex () {\r\n\t\treturn this.displayIndex;\r\n\t}\r\n\r\n\tgetRows(rows){\r\n\t\tvar output = [];\r\n\r\n\t\trows.forEach((row, i) => {\r\n\t\t\tvar config, children;\r\n\r\n\t\t\toutput.push(row);\r\n\r\n\t\t\tif(row instanceof Row){\r\n\r\n\t\t\t\trow.create();\r\n\r\n\t\t\t\tconfig = row.modules.dataTree.children;\r\n\r\n\t\t\t\tif(!config.index && config.children !== false){\r\n\t\t\t\t\tchildren = this.getChildren(row);\r\n\r\n\t\t\t\t\tchildren.forEach((child) => {\r\n\t\t\t\t\t\tchild.create();\r\n\t\t\t\t\t\toutput.push(child);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetChildren(row, allChildren){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\tchildren = [],\r\n\t\toutput = [];\r\n\r\n\t\tif(config.children !== false && (config.open || allChildren)){\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"filter\") && this.table.options.dataTreeFilter){\r\n\t\t\t\tchildren = this.table.modules.filter.filter(config.children);\r\n\t\t\t}else{\r\n\t\t\t\tchildren = config.children;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"sort\") && this.table.options.dataTreeSort){\r\n\t\t\t\tthis.table.modules.sort.sort(children);\r\n\t\t\t}\r\n\r\n\t\t\tchildren.forEach((child) => {\r\n\t\t\t\toutput.push(child);\r\n\r\n\t\t\t\tvar subChildren = this.getChildren(child);\r\n\r\n\t\t\t\tsubChildren.forEach((sub) => {\r\n\t\t\t\t\toutput.push(sub);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgenerateChildren(row){\r\n\t\tvar children = [];\r\n\r\n\t\tvar childArray = row.getData()[this.field];\r\n\r\n\t\tif(!Array.isArray(childArray)){\r\n\t\t\tchildArray = [childArray];\r\n\t\t}\r\n\r\n\t\tchildArray.forEach((childData) => {\r\n\t\t\tvar childRow = new Row(childData || {}, this.table.rowManager);\r\n\r\n\t\t\tchildRow.create();\r\n\r\n\t\t\tchildRow.modules.dataTree.index = row.modules.dataTree.index + 1;\r\n\t\t\tchildRow.modules.dataTree.parent = row;\r\n\r\n\t\t\tif(childRow.modules.dataTree.children){\r\n\t\t\t\tchildRow.modules.dataTree.open = this.startOpen(childRow.getComponent(), childRow.modules.dataTree.index);\r\n\t\t\t}\r\n\t\t\tchildren.push(childRow);\r\n\t\t});\r\n\r\n\t\treturn children;\r\n\t}\r\n\r\n\texpandRow(row, silent){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tconfig.open = true;\r\n\r\n\t\t\trow.reinitialize();\r\n\r\n\t\t\tthis.refreshData(true);\r\n\r\n\t\t\tthis.dispatchExternal(\"dataTreeRowExpanded\", row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\t}\r\n\r\n\tcollapseRow(row){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tconfig.open = false;\r\n\r\n\t\t\trow.reinitialize();\r\n\r\n\t\t\tthis.refreshData(true);\r\n\r\n\t\t\tthis.dispatchExternal(\"dataTreeRowCollapsed\", row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\t}\r\n\r\n\ttoggleRow(row){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tif(config.open){\r\n\t\t\t\tthis.collapseRow(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.expandRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tisRowExpanded(row){\r\n\t\treturn row.modules.dataTree.open;\r\n\t}\r\n\r\n\tgetTreeParent(row){\r\n\t\treturn row.modules.dataTree.parent ? row.modules.dataTree.parent.getComponent() : false;\r\n\t}\r\n\r\n\tgetTreeParentRoot(row){\r\n\t\treturn row.modules.dataTree.parent ? this.getTreeParentRoot(row.modules.dataTree.parent) : row;\r\n\t}\r\n\r\n\tgetFilteredTreeChildren(row){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\toutput = [], children;\r\n\r\n\t\tif(config.children){\r\n\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"filter\") && this.table.options.dataTreeFilter){\r\n\t\t\t\tchildren = this.table.modules.filter.filter(config.children);\r\n\t\t\t}else{\r\n\t\t\t\tchildren = config.children;\r\n\t\t\t}\r\n\r\n\t\t\tchildren.forEach((childRow) => {\r\n\t\t\t\tif(childRow instanceof Row){\r\n\t\t\t\t\toutput.push(childRow);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\trowDelete(row){\r\n\t\tvar parent = row.modules.dataTree.parent,\r\n\t\tchildIndex;\r\n\r\n\t\tif(parent){\r\n\t\t\tchildIndex = this.findChildIndex(row, parent);\r\n\r\n\t\t\tif(childIndex !== false){\r\n\t\t\t\tparent.data[this.field].splice(childIndex, 1);\r\n\t\t\t}\r\n\r\n\t\t\tif(!parent.data[this.field].length){\r\n\t\t\t\tdelete parent.data[this.field];\r\n\t\t\t}\r\n\r\n\t\t\tthis.initializeRow(parent);\r\n\t\t\tthis.layoutRow(parent);\r\n\t\t}\r\n\r\n\t\tthis.refreshData(true);\r\n\t}\r\n\r\n\taddTreeChildRow(row, data, top, index){\r\n\t\tvar childIndex = false;\r\n\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\r\n\t\tif(!Array.isArray(row.data[this.field])){\r\n\t\t\trow.data[this.field] = [];\r\n\r\n\t\t\trow.modules.dataTree.open = this.startOpen(row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\r\n\t\tif(typeof index !== \"undefined\"){\r\n\t\t\tchildIndex = this.findChildIndex(index, row);\r\n\r\n\t\t\tif(childIndex !== false){\r\n\t\t\t\trow.data[this.field].splice((top ? childIndex : childIndex + 1), 0, data);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(childIndex === false){\r\n\t\t\tif(top){\r\n\t\t\t\trow.data[this.field].unshift(data);\r\n\t\t\t}else{\r\n\t\t\t\trow.data[this.field].push(data);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.initializeRow(row);\r\n\t\tthis.layoutRow(row);\r\n\r\n\t\tthis.refreshData(true);\r\n\t}\r\n\r\n\tfindChildIndex(subject, parent){\r\n\t\tvar match = false;\r\n\r\n\t\tif(typeof subject == \"object\"){\r\n\r\n\t\t\tif(subject instanceof Row){\r\n\t\t\t\t//subject is row element\r\n\t\t\t\tmatch = subject.data;\r\n\t\t\t}else if(subject instanceof RowComponent){\r\n\t\t\t\t//subject is public row component\r\n\t\t\t\tmatch = subject._getSelf().data;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\t\t\t\tif(parent.modules.dataTree){\r\n\t\t\t\t\tmatch = parent.modules.dataTree.children.find((childRow) => {\r\n\t\t\t\t\t\treturn childRow instanceof Row ? childRow.element === subject : false;\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(match){\r\n\t\t\t\t\t\tmatch = match.data;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}else if(typeof subject == \"undefined\" || subject === null){\r\n\t\t\tmatch = false\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the index of the row\r\n\t\t\tmatch = parent.data[this.field].find((row) => {\r\n\t\t\t\treturn row.data[this.table.options.index] == subject;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(match){\r\n\r\n\t\t\tif(Array.isArray(parent.data[this.field])){\r\n\t\t\t\tmatch = parent.data[this.field].indexOf(match);\r\n\t\t\t}\r\n\r\n\t\t\tif(match == -1){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//catch all for any other type of input\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tgetTreeChildren(row, component, recurse){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\toutput = [];\r\n\r\n\t\tif(config.children){\r\n\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tconfig.children.forEach((childRow) => {\r\n\t\t\t\tif(childRow instanceof Row){\r\n\t\t\t\t\toutput.push(component ? childRow.getComponent() : childRow);\r\n\r\n\t\t\t\t\tif(recurse){\r\n\t\t\t\t\t\toutput = output.concat(this.getTreeChildren(childRow, component, recurse));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetChildField(){\r\n\t\treturn this.field;\r\n\t}\r\n\r\n\tredrawNeeded(data){\r\n\t\treturn (this.field ? typeof data[this.field] !== \"undefined\" : false) || (this.elementField ? typeof data[this.elementField] !== \"undefined\" : false);\r\n\t}\r\n}\r\n\r\nDataTree.moduleName = \"dataTree\";\r\n\r\nexport default DataTree;","export default function(list, options, setFileContents){\r\n\tvar delimiter = options && options.delimiter ? options.delimiter : \",\",\r\n\tfileContents = [],\r\n\theaders = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tvar item = [];\r\n\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"group\":\r\n\t\t\tconsole.warn(\"Download Warning - CSV downloader cannot process row groups\");\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\tconsole.warn(\"Download Warning - CSV downloader cannot process column calculations\");\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"header\":\r\n\t\t\trow.columns.forEach((col, i) => {\r\n\t\t\t\tif(col && col.depth === 1){\r\n\t\t\t\t\theaders[i] = typeof col.value == \"undefined\" || col.value === null ? \"\" : ('\"' + String(col.value).split('\"').join('\"\"') + '\"');\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\trow.columns.forEach((col) => {\r\n\r\n\t\t\t\tif(col){\r\n\r\n\t\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\tcol.value = JSON.stringify(col.value);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\tcase \"null\":\r\n\t\t\t\t\t\tcol.value = \"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\titem.push('\"' + String(col.value).split('\"').join('\"\"') + '\"');\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tfileContents.push(item.join(delimiter));\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(headers.length){\r\n\t\tfileContents.unshift(headers.join(delimiter));\r\n\t}\r\n\r\n\tfileContents = fileContents.join(\"\\n\");\r\n\r\n\tif(options.bom){\r\n\t\tfileContents = \"\\ufeff\" + fileContents;\r\n\t}\r\n\r\n\tsetFileContents(fileContents, \"text/csv\");\r\n};","export default function(list, options, setFileContents){\r\n\tvar fileContents = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tvar item = {};\r\n\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"header\":\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process row groups\");\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process column calculations\");\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\tif(col){\r\n\t\t\t\t\titem[col.component.getTitleDownload() || col.component.getField()] = col.value;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tfileContents.push(item);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tfileContents = JSON.stringify(fileContents, null, '\\t');\r\n\r\n\tsetFileContents(fileContents, \"application/json\");\r\n};","export default function(list, options, setFileContents){\r\n\tvar header = [],\r\n\tbody = [],\r\n\tautoTableParams = {},\r\n\trowGroupStyles = options.rowGroupStyles || {\r\n\t\tfontStyle: \"bold\",\r\n\t\tfontSize: 12,\r\n\t\tcellPadding: 6,\r\n\t\tfillColor: 220,\r\n\t},\r\n\trowCalcStyles = options.rowCalcStyles || {\r\n\t\tfontStyle: \"bold\",\r\n\t\tfontSize: 10,\r\n\t\tcellPadding: 4,\r\n\t\tfillColor: 232,\r\n\t},\r\n\tjsPDFParams = options.jsPDF || {},\r\n\ttitle = options && options.title ? options.title : \"\";\r\n\r\n\tif(!jsPDFParams.orientation){\r\n\t\tjsPDFParams.orientation = options.orientation || \"landscape\";\r\n\t}\r\n\r\n\tif(!jsPDFParams.unit){\r\n\t\tjsPDFParams.unit = \"pt\";\r\n\t}\r\n\r\n\t//parse row list\r\n\tlist.forEach((row) => {\r\n\t\tvar item = {};\r\n\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"header\":\r\n\t\t\theader.push(parseRow(row));\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\tbody.push(parseRow(row, rowGroupStyles));\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\tbody.push(parseRow(row, rowCalcStyles));\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\tbody.push(parseRow(row));\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tfunction parseRow(row, styles){\r\n\t\tvar rowData = [];\r\n\r\n\t\trow.columns.forEach((col) =>{\r\n\t\t\tvar cell;\r\n\r\n\t\t\tif(col){\r\n\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\tcol.value = JSON.stringify(col.value);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\tcase \"null\":\r\n\t\t\t\t\tcol.value = \"\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcell = {\r\n\t\t\t\t\tcontent:col.value,\r\n\t\t\t\t\tcolSpan:col.width,\r\n\t\t\t\t\trowSpan:col.height,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tif(styles){\r\n\t\t\t\t\tcell.styles = styles;\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowData.push(cell);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowData;\r\n\t}\r\n\r\n\r\n\t//configure PDF\r\n\tvar doc = new jspdf.jsPDF(jsPDFParams); //set document to landscape, better for most tables\r\n\r\n\tif(options && options.autoTable){\r\n\t\tif(typeof options.autoTable === \"function\"){\r\n\t\t\tautoTableParams = options.autoTable(doc) || {};\r\n\t\t}else{\r\n\t\t\tautoTableParams = options.autoTable;\r\n\t\t}\r\n\t}\r\n\r\n\tif(title){\r\n\t\tautoTableParams.didDrawPage = function(data) {\r\n\t\t\tdoc.text(title, 40, 30);\r\n\t\t};\r\n\t}\r\n\r\n\tautoTableParams.head = header;\r\n\tautoTableParams.body = body;\r\n\r\n\tdoc.autoTable(autoTableParams);\r\n\r\n\tif(options && options.documentProcessing){\r\n\t\toptions.documentProcessing(doc);\r\n\t}\r\n\r\n\tsetFileContents(doc.output(\"arraybuffer\"), \"application/pdf\");\r\n};","import CoreFeature from '../../../../core/CoreFeature.js';\r\n\r\nexport default function(list, options, setFileContents){\r\n\tvar self = this,\r\n\tsheetName = options.sheetName || \"Sheet1\",\r\n\tworkbook = XLSX.utils.book_new(),\r\n\ttableFeatures = new CoreFeature(this),\r\n\toutput;\r\n\r\n\tworkbook.SheetNames = [];\r\n\tworkbook.Sheets = {};\r\n\r\n\tfunction generateSheet(){\r\n\t\tvar rows = [],\r\n\t\tmerges = [],\r\n\t\tworksheet = {},\r\n\t\trange = {s: {c:0, r:0}, e: {c:(list[0] ? list[0].columns.reduce((a, b) => a + (b && b.width ? b.width : 1), 0) : 0), r:list.length }};\r\n\r\n\t\t//parse row list\r\n\t\tlist.forEach((row, i) => {\r\n\t\t\tvar rowData = [];\r\n\r\n\t\t\trow.columns.forEach(function(col, j){\r\n\r\n\t\t\t\tif(col){\r\n\t\t\t\t\trowData.push(!(col.value instanceof Date) && typeof col.value === \"object\" ? JSON.stringify(col.value) : col.value);\r\n\r\n\t\t\t\t\tif(col.width > 1 || col.height > -1){\r\n\t\t\t\t\t\tif(col.height > 1 || col.width > 1){\r\n\t\t\t\t\t\t\tmerges.push({s:{r:i,c:j},e:{r:i + col.height - 1,c:j + col.width - 1}});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\trowData.push(\"\");\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trows.push(rowData);\r\n\t\t});\r\n\r\n\t\t//convert rows to worksheet\r\n\t\tXLSX.utils.sheet_add_aoa(worksheet, rows);\r\n\r\n\t\tworksheet['!ref'] = XLSX.utils.encode_range(range);\r\n\r\n\t\tif(merges.length){\r\n\t\t\tworksheet[\"!merges\"] = merges;\r\n\t\t}\r\n\r\n\t\treturn worksheet;\r\n\t}\r\n\r\n\tif(options.sheetOnly){\r\n\t\tsetFileContents(generateSheet());\r\n\t\treturn;\r\n\t}\r\n\r\n\tif(options.sheets){\r\n\t\tfor(var sheet in options.sheets){\r\n\r\n\t\t\tif(options.sheets[sheet] === true){\r\n\t\t\t\tworkbook.SheetNames.push(sheet);\r\n\t\t\t\tworkbook.Sheets[sheet] = generateSheet();\r\n\t\t\t}else{\r\n\r\n\t\t\t\tworkbook.SheetNames.push(sheet);\r\n\r\n\t\t\t\ttableFeatures.commsSend(options.sheets[sheet], \"download\", \"intercept\",{\r\n\t\t\t\t\ttype:\"xlsx\",\r\n\t\t\t\t\toptions:{sheetOnly:true},\r\n\t\t\t\t\tactive:self.active,\r\n\t\t\t\t\tintercept:function(data){\r\n\t\t\t\t\t\tworkbook.Sheets[sheet] = data;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tworkbook.SheetNames.push(sheetName);\r\n\t\tworkbook.Sheets[sheetName] = generateSheet();\r\n\t}\r\n\r\n\tif(options.documentProcessing){\r\n\t\tworkbook = options.documentProcessing(workbook);\r\n\t}\r\n\r\n\t//convert workbook to binary array\r\n\tfunction s2ab(s) {\r\n\t\tvar buf = new ArrayBuffer(s.length);\r\n\t\tvar view = new Uint8Array(buf);\r\n\t\tfor (var i=0; i!=s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;\r\n\t\t\treturn buf;\r\n\t}\r\n\r\n\toutput = XLSX.write(workbook, {bookType:'xlsx', bookSST:true, type: 'binary'});\r\n\r\n\tsetFileContents(s2ab(output), \"application/octet-stream\");\r\n};","export default function(list, options, setFileContents){\r\n\tif(this.modExists(\"export\", true)){\r\n\t\tsetFileContents(this.modules.export.genereateHTMLTable(list), \"text/html\");\r\n\t}\r\n};","export default function (list, options, setFileContents) {\r\n\tconst fileContents = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tconst item = {};\r\n\r\n\t\tswitch (row.type) {\r\n\t\t\tcase \"header\":\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process row groups\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process column calculations\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\t\tif (col) {\r\n\t\t\t\t\t\titem[col.component.getTitleDownload() || col.component.getField()] = col.value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tfileContents.push(JSON.stringify(item));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tsetFileContents(fileContents.join(\"\\n\"), \"application/x-ndjson\");\r\n};","import csv from './downloaders/csv.js';\r\nimport json from './downloaders/json.js';\r\nimport pdf from './downloaders/pdf.js';\r\nimport xlsx from './downloaders/xlsx.js';\r\nimport html from './downloaders/html.js';\r\nimport jsonLines from './downloaders/jsonLines.js';\r\n\r\nexport default {\r\n\tcsv:csv,\r\n\tjson:json,\r\n\tjsonLines:jsonLines,\r\n\tpdf:pdf,\r\n\txlsx:xlsx,\r\n\thtml:html,\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultDownloaders from './defaults/downloaders.js';\r\n\r\nclass Download extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.registerTableOption(\"downloadReady\", function(data, blob){return blob;}); //function to manipulate download data\r\n\t\tthis.registerTableOption(\"downloadConfig\", {}); //download config\r\n\t\tthis.registerTableOption(\"downloadRowRange\", \"active\"); //restrict download to active rows only\r\n\r\n\t\tthis.registerColumnOption(\"download\");\r\n\t\tthis.registerColumnOption(\"titleDownload\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"download\", this.download.bind(this));\r\n\t\tthis.registerTableFunction(\"downloadToTab\", this.downloadToTab.bind(this));\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tdownloadToTab(type, filename, options, active){\r\n\t\tthis.download(type, filename, options, active, true);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\t//trigger file download\r\n\tdownload(type, filename, options, range, interceptCallback){\r\n\t\tvar downloadFunc = false;\r\n\r\n\t\tfunction buildLink(data, mime){\r\n\t\t\tif(interceptCallback){\r\n\t\t\t\tif(interceptCallback === true){\r\n\t\t\t\t\tthis.triggerDownload(data, mime, type, filename, true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tinterceptCallback(data);\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tthis.triggerDownload(data, mime, type, filename);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(typeof type == \"function\"){\r\n\t\t\tdownloadFunc = type;\r\n\t\t}else{\r\n\t\t\tif(Download.downloaders[type]){\r\n\t\t\t\tdownloadFunc = Download.downloaders[type];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Download Error - No such download type found: \", type);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(downloadFunc){\r\n\t\t\tvar list = this.generateExportList(range);\r\n\r\n\t\t\tdownloadFunc.call(this.table, list , options || {}, buildLink.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateExportList(range){\r\n\t\tvar list = this.table.modules.export.generateExportList(this.table.options.downloadConfig, false, range || this.table.options.downloadRowRange, \"download\");\r\n\r\n\t\t//assign group header formatter\r\n\t\tvar groupHeader = this.table.options.groupHeaderDownload;\r\n\r\n\t\tif(groupHeader && !Array.isArray(groupHeader)){\r\n\t\t\tgroupHeader = [groupHeader];\r\n\t\t}\r\n\r\n\t\tlist.forEach((row) => {\r\n\t\t\tvar group;\r\n\r\n\t\t\tif(row.type === \"group\"){\r\n\t\t\t\tgroup = row.columns[0];\r\n\r\n\t\t\t\tif(groupHeader && groupHeader[row.indent]){\r\n\t\t\t\t\tgroup.value = groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn list;\r\n\t}\r\n\r\n\ttriggerDownload(data, mime, type, filename, newTab){\r\n\t\tvar element = document.createElement('a'),\r\n\t\tblob = new Blob([data],{type:mime}),\r\n\t\tfilename = filename || \"Tabulator.\" + (typeof type === \"function\" ? \"txt\" : type);\r\n\r\n\t\tblob = this.table.options.downloadReady(data, blob);\r\n\r\n\t\tif(blob){\r\n\r\n\t\t\tif(newTab){\r\n\t\t\t\twindow.open(window.URL.createObjectURL(blob));\r\n\t\t\t}else{\r\n\t\t\t\tif(navigator.msSaveOrOpenBlob){\r\n\t\t\t\t\tnavigator.msSaveOrOpenBlob(blob, filename);\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.setAttribute('href', window.URL.createObjectURL(blob));\r\n\r\n\t\t\t\t\t//set file title\r\n\t\t\t\t\telement.setAttribute('download', filename);\r\n\r\n\t\t\t\t\t//trigger download\r\n\t\t\t\t\telement.style.display = 'none';\r\n\t\t\t\t\tdocument.body.appendChild(element);\r\n\t\t\t\t\telement.click();\r\n\r\n\t\t\t\t\t//remove temporary link element\r\n\t\t\t\t\tdocument.body.removeChild(element);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"downloadComplete\");\r\n\t\t}\r\n\t}\r\n\r\n\tcommsReceived(table, action, data){\r\n\t\tswitch(action){\r\n\t\t\tcase \"intercept\":\r\n\t\t\tthis.download(data.type, \"\", data.options, data.active, data.intercept);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nDownload.moduleName = \"download\";\r\n\r\n//load defaults\r\nDownload.downloaders = defaultDownloaders;\r\n\r\nexport default Download;","export default function maskInput(el, options){\r\n\tvar mask = options.mask,\r\n\tmaskLetter = typeof options.maskLetterChar !== \"undefined\" ? options.maskLetterChar : \"A\",\r\n\tmaskNumber = typeof options.maskNumberChar !== \"undefined\" ? options.maskNumberChar : \"9\",\r\n\tmaskWildcard = typeof options.maskWildcardChar !== \"undefined\" ? options.maskWildcardChar : \"*\",\r\n\tsuccess = false;\r\n\r\n\tfunction fillSymbols(index){\r\n\t\tvar symbol = mask[index];\r\n\t\tif(typeof symbol !== \"undefined\" && symbol !== maskWildcard && symbol !== maskLetter && symbol !== maskNumber){\r\n\t\t\tel.value = el.value + \"\" + symbol;\r\n\t\t\tfillSymbols(index+1);\r\n\t\t}\r\n\t}\r\n\r\n\tel.addEventListener(\"keydown\", (e) => {\r\n\t\tvar index = el.value.length,\r\n\t\tchar = e.key;\r\n\r\n\t\tif(e.keyCode > 46){\r\n\t\t\tif(index >= mask.length){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tsuccess = false;\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\tswitch(mask[index]){\r\n\t\t\t\t\tcase maskLetter:\r\n\t\t\t\t\tif(char.toUpperCase() == char.toLowerCase()){\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\tsuccess = false;\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase maskNumber:\r\n\t\t\t\t\tif(isNaN(char)){\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\tsuccess = false;\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase maskWildcard:\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\tif(char !== mask[index]){\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\tsuccess = false;\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tsuccess = true;\r\n\t\t}\r\n\r\n\t\treturn;\r\n\t});\r\n\r\n\tel.addEventListener(\"keyup\", (e) => {\r\n\t\tif(e.keyCode > 46){\r\n\t\t\tif(options.maskAutoFill){\r\n\t\t\t\tfillSymbols(el.value.length);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\r\n\tif(!el.placeholder){\r\n\t\tel.placeholder = mask;\r\n\t}\r\n\r\n\tif(options.maskAutoFill){\r\n\t\tfillSymbols(el.value.length);\r\n\t}\r\n}","import maskInput from '../../inputMask.js';\r\n\r\n//input element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\t//create and style input\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", editorParams.search ? \"search\" : \"text\");\r\n\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = typeof cellValue !== \"undefined\" ? cellValue : \"\";\r\n\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\r\n\tfunction onChange(e){\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && input.value !== \"\") || input.value !== cellValue){\r\n\t\t\tif(success(input.value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t// case 9:\r\n\t\t\tcase 13:\r\n\t\t\tonChange(e);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\tcancel();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\te.stopPropagation();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(editorParams.mask){\r\n\t\tmaskInput(input, editorParams);\r\n\t}\r\n\r\n\treturn input;\r\n};","import maskInput from '../../inputMask.js';\r\n\r\n//resizable text area element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n var self = this,\r\n cellValue = cell.getValue(),\r\n vertNav = editorParams.verticalNavigation || \"hybrid\",\r\n value = String(cellValue !== null && typeof cellValue !== \"undefined\" ? cellValue : \"\"),\r\n count = (value.match(/(?:\\r\\n|\\r|\\n)/g) || []).length + 1,\r\n input = document.createElement(\"textarea\"),\r\n scrollHeight = 0;\r\n\r\n //create and style input\r\n input.style.display = \"block\";\r\n input.style.padding = \"2px\";\r\n input.style.height = \"100%\";\r\n input.style.width = \"100%\";\r\n input.style.boxSizing = \"border-box\";\r\n input.style.whiteSpace = \"pre-wrap\";\r\n input.style.resize = \"none\";\r\n\r\n if(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n for (let key in editorParams.elementAttributes){\r\n if(key.charAt(0) == \"+\"){\r\n key = key.slice(1);\r\n input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n }else{\r\n input.setAttribute(key, editorParams.elementAttributes[key]);\r\n }\r\n }\r\n }\r\n\r\n input.value = value;\r\n\r\n onRendered(function(){\r\n input.focus({preventScroll: true});\r\n input.style.height = \"100%\";\r\n\r\n input.scrollHeight;\r\n input.style.height = input.scrollHeight + \"px\";\r\n cell.getRow().normalizeHeight();\r\n\r\n if(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n });\r\n\r\n function onChange(e){\r\n\r\n if(((cellValue === null || typeof cellValue === \"undefined\") && input.value !== \"\") || input.value !== cellValue){\r\n\r\n if(success(input.value)){\r\n cellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n }\r\n\r\n setTimeout(function(){\r\n cell.getRow().normalizeHeight();\r\n },300)\r\n }else{\r\n cancel();\r\n }\r\n }\r\n\r\n //submit new value on blur or change\r\n input.addEventListener(\"change\", onChange);\r\n input.addEventListener(\"blur\", onChange);\r\n\r\n input.addEventListener(\"keyup\", function(){\r\n\r\n input.style.height = \"\";\r\n\r\n var heightNow = input.scrollHeight;\r\n\r\n input.style.height = heightNow + \"px\";\r\n\r\n if(heightNow != scrollHeight){\r\n scrollHeight = heightNow;\r\n cell.getRow().normalizeHeight();\r\n }\r\n });\r\n\r\n input.addEventListener(\"keydown\", function(e){\r\n\r\n switch(e.keyCode){\r\n case 27:\r\n cancel();\r\n break;\r\n\r\n case 38: //up arrow\r\n if(vertNav == \"editor\" || (vertNav == \"hybrid\" && input.selectionStart)){\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n }\r\n\r\n break;\r\n\r\n case 40: //down arrow\r\n if(vertNav == \"editor\" || (vertNav == \"hybrid\" && input.selectionStart !== input.value.length)){\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n }\r\n break;\r\n\r\n case 35:\r\n case 36:\r\n e.stopPropagation();\r\n break;\r\n }\r\n });\r\n\r\n if(editorParams.mask){\r\n maskInput(input, editorParams);\r\n }\r\n\r\n return input;\r\n};","import maskInput from '../../inputMask.js';\r\n\r\n//input element with type of number\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar cellValue = cell.getValue(),\r\n\tvertNav = editorParams.verticalNavigation || \"editor\",\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", \"number\");\r\n\r\n\tif(typeof editorParams.max != \"undefined\"){\r\n\t\tinput.setAttribute(\"max\", editorParams.max);\r\n\t}\r\n\r\n\tif(typeof editorParams.min != \"undefined\"){\r\n\t\tinput.setAttribute(\"min\", editorParams.min);\r\n\t}\r\n\r\n\tif(typeof editorParams.step != \"undefined\"){\r\n\t\tinput.setAttribute(\"step\", editorParams.step);\r\n\t}\r\n\r\n\t//create and style input\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\r\n\tvar blurFunc = function(e){\r\n\t\tonChange();\r\n\t};\r\n\r\n\tonRendered(function () {\r\n\t\t//submit new value on blur\r\n\t\tinput.removeEventListener(\"blur\", blurFunc);\r\n\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\r\n\t\t//submit new value on blur\r\n\t\tinput.addEventListener(\"blur\", blurFunc);\r\n\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\r\n\tfunction onChange(){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(!isNaN(value) && value !==\"\"){\r\n\t\t\tvalue = Number(value);\r\n\t\t}\r\n\r\n\t\tif(value !== cellValue){\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 13:\r\n\t\t\t// case 9:\r\n\t\t\tonChange();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\tcancel();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 38: //up arrow\r\n\t\t\tcase 40: //down arrow\r\n\t\t\tif(vertNav == \"editor\"){\r\n\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\te.stopPropagation();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(editorParams.mask){\r\n\t\tmaskInput(input, editorParams);\r\n\t}\r\n\r\n\treturn input;\r\n};","//input element with type of number\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", \"range\");\r\n\r\n\tif (typeof editorParams.max != \"undefined\") {\r\n\t\tinput.setAttribute(\"max\", editorParams.max);\r\n\t}\r\n\r\n\tif (typeof editorParams.min != \"undefined\") {\r\n\t\tinput.setAttribute(\"min\", editorParams.min);\r\n\t}\r\n\r\n\tif (typeof editorParams.step != \"undefined\") {\r\n\t\tinput.setAttribute(\"step\", editorParams.step);\r\n\t}\r\n\r\n\t//create and style input\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\r\n\tonRendered(function () {\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\t});\r\n\r\n\tfunction onChange(){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(!isNaN(value) && value !==\"\"){\r\n\t\t\tvalue = Number(value);\r\n\t\t}\r\n\r\n\t\tif(value != cellValue){\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur\r\n\tinput.addEventListener(\"blur\", function(e){\r\n\t\tonChange();\r\n\t});\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 13:\r\n\t\t\t// case 9:\r\n\t\t\tonChange();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\tcancel();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\treturn input;\r\n};","import maskInput from './inputMask.js';\r\nimport urlBuilder from '../Ajax/defaults/urlGenerator.js';\r\n\r\nexport default class Edit{\r\n constructor(editor, cell, onRendered, success, cancel, editorParams){\r\n this.edit = editor;\r\n this.table = editor.table;\r\n this.cell = cell;\r\n this.params = this._initializeParams(editorParams);\r\n \r\n this.data = [];\r\n this.displayItems = [];\r\n this.currentItems = [];\r\n this.focusedItem = null;\r\n \r\n this.input = this._createInputElement();\r\n this.listEl = this._createListElement();\r\n \r\n this.initialValues = null; \r\n \r\n this.isFilter = !cell._getSelf;\r\n \r\n this.filterTimeout = null;\r\n this.filtered = false;\r\n this.typing = false;\r\n \r\n this.values = []; \r\n this.popup = null; \r\n \r\n this.listIteration = 0;\r\n \r\n this.blurable = true;\r\n \r\n this.actions = {\r\n success:success,\r\n cancel:cancel\r\n }\r\n \r\n this._deprecationCheck();\r\n this._initializeValue();\r\n \r\n onRendered(this._onRendered.bind(this));\r\n }\r\n \r\n _deprecationCheck(){\r\n if(this.params.listItemFormatter){\r\n console.warn(\"The listItemFormatter editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n }\r\n \r\n if(this.params.sortValuesList){\r\n console.warn(\"The sortValuesList editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n }\r\n \r\n if(this.params.searchFunc){\r\n console.warn(\"The searchFunc editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n }\r\n \r\n if(this.params.searchingPlaceholder){\r\n console.warn(\"The searchingPlaceholder editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n }\r\n }\r\n \r\n _initializeValue(){\r\n var initialValue = this.cell.getValue();\r\n \r\n if(typeof initialValue === \"undefined\" && typeof this.params.defaultValue !== \"undefined\"){\r\n initialValue = this.params.defaultValue;\r\n }\r\n \r\n this.initialValues = this.params.multiselect ? initialValue : [initialValue];\r\n \r\n if(this.isFilter){\r\n this.input.value = this.initialValues.join(\",\");\r\n this.headerFilterInitialListGen(); \r\n }\r\n }\r\n \r\n _onRendered(){\r\n var cellEl = this.cell.getElement();\r\n \r\n function clickStop(e){\r\n e.stopPropagation();\r\n }\r\n \r\n this.input.style.height = \"100%\";\r\n this.input.focus({preventScroll: true});\r\n \r\n \r\n cellEl.addEventListener(\"click\", clickStop);\r\n \r\n setTimeout(() => {\r\n cellEl.removeEventListener(\"click\", clickStop);\r\n }, 1000)\r\n }\r\n \r\n _createListElement(){\r\n var listEl = document.createElement(\"div\");\r\n listEl.classList.add(\"tabulator-edit-list\");\r\n \r\n listEl.addEventListener(\"mousedown\", this._preventBlur.bind(this));\r\n listEl.addEventListener(\"keydown\", this._inputKeyDown.bind(this))\r\n \r\n return listEl;\r\n }\r\n \r\n _setListWidth(){\r\n var element = this.isFilter ? this.input : this.cell.getElement();\r\n \r\n this.listEl.style.minWidth = element.offsetWidth + \"px\";\r\n \r\n if(this.params.maxWidth){\r\n if(this.params.maxWidth === true){\r\n this.listEl.style.maxWidth = element.offsetWidth + \"px\";\r\n }else if(typeof this.params.maxWidth === \"number\"){\r\n this.listEl.style.maxWidth = this.params.maxWidth + \"px\";\r\n }else{\r\n this.listEl.style.maxWidth = this.params.maxWidth;\r\n }\r\n }\r\n \r\n }\r\n \r\n _createInputElement(){\r\n var attribs = this.params.elementAttributes;\r\n var input = document.createElement(\"input\");\r\n \r\n input.setAttribute(\"type\", this.params.clearable ? \"search\" : \"text\");\r\n \r\n input.style.padding = \"4px\";\r\n input.style.width = \"100%\";\r\n input.style.boxSizing = \"border-box\";\r\n \r\n if(!this.params.autocomplete){\r\n input.style.cursor = \"default\";\r\n input.style.caretColor = \"transparent\";\r\n // input.readOnly = (this.edit.currentCell != false);\r\n }\r\n \r\n if(attribs && typeof attribs == \"object\"){\r\n for (let key in attribs){\r\n if(key.charAt(0) == \"+\"){\r\n key = key.slice(1);\r\n input.setAttribute(key, input.getAttribute(key) + attribs[\"+\" + key]);\r\n }else{\r\n input.setAttribute(key, attribs[key]);\r\n }\r\n }\r\n }\r\n \r\n if(this.params.mask){\r\n maskInput(input, this.params);\r\n }\r\n \r\n this._bindInputEvents(input);\r\n \r\n return input;\r\n }\r\n \r\n _initializeParams(params){\r\n var valueKeys = [\"values\", \"valuesURL\", \"valuesLookup\"],\r\n valueCheck;\r\n\r\n params = Object.assign({}, params);\r\n \r\n params.verticalNavigation = params.verticalNavigation || \"editor\";\r\n params.placeholderLoading = typeof params.placeholderLoading === \"undefined\" ? \"Searching ...\" : params.placeholderLoading;\r\n params.placeholderEmpty = typeof params.placeholderEmpty === \"undefined\" ? \"No Results Found\" : params.placeholderEmpty;\r\n params.filterDelay = typeof params.filterDelay === \"undefined\" ? 300 : params.filterDelay;\r\n \r\n params.emptyValue = Object.keys(params).includes(\"emptyValue\") ? params.emptyValue : \"\";\r\n\r\n valueCheck = Object.keys(params).filter(key => valueKeys.includes(key)).length;\r\n\r\n if(!valueCheck){\r\n console.warn(\"list editor config error - either the values, valuesURL, or valuesLookup option must be set\")\r\n }else if(valueCheck > 1){\r\n console.warn(\"list editor config error - only one of the values, valuesURL, or valuesLookup options can be set on the same editor\")\r\n }\r\n \r\n if(params.autocomplete){\r\n if(params.multiselect){\r\n params.multiselect = false;\r\n console.warn(\"list editor config error - multiselect option is not available when autocomplete is enabled\")\r\n }\r\n }else{\r\n if(params.freetext){\r\n params.freetext = false;\r\n console.warn(\"list editor config error - freetext option is only available when autocomplete is enabled\");\r\n }\r\n \r\n if(params.filterFunc){\r\n params.filterFunc = false;\r\n console.warn(\"list editor config error - filterFunc option is only available when autocomplete is enabled\");\r\n }\r\n \r\n if(params.filterRemote){\r\n params.filterRemote = false;\r\n console.warn(\"list editor config error - filterRemote option is only available when autocomplete is enabled\");\r\n }\r\n \r\n if(params.mask){\r\n params.mask = false;\r\n console.warn(\"list editor config error - mask option is only available when autocomplete is enabled\");\r\n }\r\n \r\n if(params.allowEmpty){\r\n params.allowEmpty = false;\r\n console.warn(\"list editor config error - allowEmpty option is only available when autocomplete is enabled\");\r\n }\r\n \r\n if(params.listOnEmpty){\r\n params.listOnEmpty = false;\r\n console.warn(\"list editor config error - listOnEmpty option is only available when autocomplete is enabled\");\r\n }\r\n }\r\n \r\n if(params.filterRemote && !(typeof params.valuesLookup === \"function\" || typeof params.valuesURL)){\r\n params.filterRemote = false;\r\n console.warn(\"list editor config error - filterRemote option should only be used when values list is populated from a remote source\");\r\n }\r\n return params;\r\n }\r\n //////////////////////////////////////\r\n ////////// Event Handling ////////////\r\n //////////////////////////////////////\r\n \r\n _bindInputEvents(input){\r\n input.addEventListener(\"focus\", this._inputFocus.bind(this))\r\n input.addEventListener(\"click\", this._inputClick.bind(this))\r\n input.addEventListener(\"blur\", this._inputBlur.bind(this))\r\n input.addEventListener(\"keydown\", this._inputKeyDown.bind(this))\r\n input.addEventListener(\"search\", this._inputSearch.bind(this))\r\n \r\n if(this.params.autocomplete){\r\n input.addEventListener(\"keyup\", this._inputKeyUp.bind(this))\r\n }\r\n }\r\n \r\n \r\n _inputFocus(e){\r\n this.rebuildOptionsList();\r\n }\r\n \r\n _filter(){\r\n if(this.params.filterRemote){\r\n clearTimeout(this.filterTimeout);\r\n \r\n this.filterTimeout = setTimeout(() => {\r\n this.rebuildOptionsList();\r\n }, this.params.filterDelay);\r\n }else{\r\n this._filterList();\r\n }\r\n }\r\n \r\n _inputClick(e){\r\n e.stopPropagation();\r\n }\r\n \r\n _inputBlur(e){\r\n if(this.blurable && this.popup){\r\n this.popup.hide();\r\n }\r\n }\r\n \r\n _inputSearch(){\r\n this._clearChoices();\r\n }\r\n \r\n _inputKeyDown(e){\r\n switch(e.keyCode){\r\n \r\n case 38: //up arrow\r\n this._keyUp(e);\r\n break\r\n \r\n case 40: //down arrow\r\n this._keyDown(e);\r\n break;\r\n \r\n case 37: //left arrow\r\n case 39: //right arrow\r\n this._keySide(e);\r\n break;\r\n \r\n case 13: //enter\r\n this._keyEnter();\r\n break;\r\n \r\n case 27: //escape\r\n this._keyEsc();\r\n break;\r\n \r\n case 36: //home\r\n case 35: //end\r\n this._keyHomeEnd(e);\r\n break;\r\n \r\n case 9: //tab\r\n break;\r\n \r\n default:\r\n this._keySelectLetter(e);\r\n }\r\n }\r\n \r\n _inputKeyUp(e){\r\n switch(e.keyCode){\r\n case 38: //up arrow\r\n case 37: //left arrow\r\n case 39: //up arrow\r\n case 40: //right arrow\r\n case 13: //enter\r\n case 27: //escape\r\n break;\r\n \r\n default:\r\n this._keyAutoCompLetter(e);\r\n }\r\n }\r\n \r\n _preventBlur(){\r\n this.blurable = false;\r\n \r\n setTimeout(function(){\r\n this.blurable = true;\r\n }, 10);\r\n }\r\n \r\n //////////////////////////////////////\r\n //////// Keyboard Navigation /////////\r\n //////////////////////////////////////\r\n \r\n _keyUp(e){\r\n var index = this.displayItems.indexOf(this.focusedItem);\r\n \r\n if(this.params.verticalNavigation == \"editor\" || (this.params.verticalNavigation == \"hybrid\" && index)){\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n e.preventDefault();\r\n \r\n if(index > 0){\r\n this._focusItem(this.displayItems[index - 1]);\r\n }\r\n }\r\n }\r\n \r\n _keyDown(e){\r\n var index = this.displayItems.indexOf(this.focusedItem);\r\n \r\n if(this.params.verticalNavigation == \"editor\" || (this.params.verticalNavigation == \"hybrid\" && index < this.displayItems.length - 1)){\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n e.preventDefault();\r\n \r\n if(index < this.displayItems.length - 1){\r\n if(index == -1){\r\n this._focusItem(this.displayItems[0]);\r\n }else{\r\n this._focusItem(this.displayItems[index + 1]);\r\n }\r\n }\r\n }\r\n }\r\n \r\n _keySide(e){\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n e.preventDefault();\r\n }\r\n \r\n _keyEnter(e){\r\n if(this.focusedItem){\r\n this._chooseItem(this.focusedItem);\r\n }else{\r\n this._cancel();\r\n }\r\n }\r\n \r\n _keyEsc(e){\r\n this._cancel();\r\n }\r\n \r\n _keyHomeEnd(e){\r\n if(this.params.autocomplete){\r\n //prevent table navigation while using input element\r\n e.stopImmediatePropagation();\r\n }\r\n }\r\n \r\n _keySelectLetter(e){\r\n if(!this.params.autocomplete){\r\n // if(this.edit.currentCell === false){\r\n e.preventDefault();\r\n // }\r\n \r\n if(e.keyCode >= 38 && e.keyCode <= 90){\r\n this._scrollToValue(e.keyCode);\r\n }\r\n }\r\n }\r\n \r\n _keyAutoCompLetter(e){\r\n this._filter();\r\n this.typing = true;\r\n }\r\n \r\n \r\n _scrollToValue(char){\r\n clearTimeout(this.filterTimeout);\r\n \r\n var character = String.fromCharCode(char).toLowerCase();\r\n this.filterTerm += character.toLowerCase();\r\n \r\n var match = this.displayItems.find((item) => {\r\n return typeof item.label !== \"undefined\" && item.label.toLowerCase().startsWith(this.filterTerm);\r\n });\r\n \r\n if(match){\r\n this._focusItem(match);\r\n }\r\n \r\n this.filterTimeout = setTimeout(() => {\r\n this.filterTerm = \"\";\r\n }, 800)\r\n }\r\n \r\n _focusItem(item){\r\n if(this.focusedItem && this.focusedItem.element){\r\n this.focusedItem.element.classList.remove(\"focused\");\r\n }\r\n \r\n this.focusedItem = item;\r\n \r\n if(item && item.element){\r\n item.element.classList.add(\"focused\");\r\n item.element.scrollIntoView({behavior: 'smooth', block: 'nearest', inline: 'start'});\r\n }\r\n }\r\n \r\n \r\n //////////////////////////////////////\r\n /////// Data List Generation /////////\r\n //////////////////////////////////////\r\n headerFilterInitialListGen(){\r\n this._generateOptions(true);\r\n }\r\n \r\n rebuildOptionsList(){\r\n this._generateOptions()\r\n .then(this._sortOptions.bind(this))\r\n .then(this._buildList.bind(this))\r\n .then(this._showList.bind(this))\r\n .catch((e) => {\r\n if(!Number.isInteger(e)){\r\n console.error(\"List generation error\", e);\r\n }\r\n })\r\n }\r\n \r\n _filterList(){\r\n this._buildList(this._filterOptions());\r\n this._showList();\r\n }\r\n \r\n _generateOptions(silent){\r\n var values = [];\r\n var itteration = ++ this.listIteration;\r\n \r\n this.filtered = false;\r\n \r\n if(this.params.values){\r\n values = this.params.values;\r\n }else if (this.params.valuesURL){\r\n values = this._ajaxRequest(this.params.valuesURL, this.input.value);\r\n }else{\r\n if(typeof this.params.valuesLookup === \"function\"){\r\n values = this.params.valuesLookup(this.cell, this.input.value);\r\n }else if(this.params.valuesLookup){\r\n values = this._uniqueColumnValues(this.params.valuesLookupField);\r\n }\r\n }\r\n \r\n if(values instanceof Promise){\r\n if(!silent){\r\n this._addPlaceholder(this.params.placeholderLoading);\r\n }\r\n \r\n return values.then()\r\n .then((responseValues) => {\r\n if(this.listIteration === itteration){\r\n return this._parseList(responseValues);\r\n }else{\r\n return Promise.reject(itteration);\r\n }\r\n });\r\n }else{\r\n return Promise.resolve(this._parseList(values))\r\n }\r\n }\r\n \r\n _addPlaceholder(contents){\r\n var placeholder = document.createElement(\"div\");\r\n \r\n if(typeof contents === \"function\"){\r\n contents = contents(cell.getComponent(), this.listEl);\r\n }\r\n \r\n if(contents){\r\n this._clearList();\r\n \r\n if(contents instanceof HTMLElement){\r\n placeholder = contents;\r\n }else{\r\n placeholder.classList.add(\"tabulator-edit-list-placeholder\")\r\n placeholder.innerHTML = contents;\r\n }\r\n \r\n this.listEl.appendChild(placeholder);\r\n \r\n this._showList();\r\n }\r\n }\r\n \r\n _ajaxRequest(url, term){\r\n var params = this.params.filterRemote ? {term:term} : {};\r\n url = urlBuilder(url, {}, params);\r\n \r\n return fetch(url)\r\n .then((response)=>{\r\n if(response.ok) {\r\n return response.json()\r\n .catch((error)=>{\r\n console.warn(\"List Ajax Load Error - Invalid JSON returned\", error);\r\n return Promise.reject(error);\r\n });\r\n }else{\r\n console.error(\"List Ajax Load Error - Connection Error: \" + response.status, response.statusText);\r\n return Promise.reject(response);\r\n }\r\n })\r\n .catch((error)=>{\r\n console.error(\"List Ajax Load Error - Connection Error: \", error);\r\n return Promise.reject(error);\r\n });\r\n }\r\n \r\n _uniqueColumnValues(field){\r\n var output = {},\r\n data = this.table.getData(this.params.valuesLookup),\r\n column;\r\n \r\n if(field){\r\n column = this.table.columnManager.getColumnByField(field);\r\n }else{\r\n column = this.cell.getColumn()._getSelf();\r\n }\r\n \r\n if(column){\r\n data.forEach((row) => {\r\n var val = column.getFieldValue(row);\r\n \r\n if(val !== null && typeof val !== \"undefined\" && val !== \"\"){\r\n output[val] = true;\r\n }\r\n });\r\n }else{\r\n console.warn(\"unable to find matching column to create select lookup list:\", field);\r\n output = [];\r\n }\r\n \r\n return Object.keys(output);\r\n }\r\n \r\n \r\n _parseList(inputValues){\r\n var data = [];\r\n \r\n if(!Array.isArray(inputValues)){\r\n inputValues = Object.entries(inputValues).map(([key, value]) => {\r\n return {\r\n label:value,\r\n value:key,\r\n };\r\n });\r\n }\r\n \r\n inputValues.forEach((value) => {\r\n if(typeof value !== \"object\"){\r\n value = {\r\n label:value,\r\n value:value,\r\n };\r\n }\r\n \r\n this._parseListItem(value, data, 0);\r\n });\r\n \r\n this.data = data;\r\n \r\n return data; \r\n }\r\n \r\n _parseListItem(option, data, level){\r\n var item = {};\r\n \r\n if(option.options){\r\n item = this._parseListGroup(option, level + 1);\r\n }else{\r\n item = {\r\n label:option.label,\r\n value:option.value,\r\n itemParams:option.itemParams,\r\n elementAttributes: option.elementAttributes,\r\n element:false,\r\n selected:false,\r\n visible:true,\r\n level:level,\r\n original:option,\r\n };\r\n \r\n if(this.initialValues && this.initialValues.indexOf(option.value) > -1){\r\n this._chooseItem(item, true);\r\n }\r\n }\r\n \r\n data.push(item);\r\n }\r\n \r\n _parseListGroup(option, level){\r\n var item = {\r\n label:option.label,\r\n group:true,\r\n itemParams:option.itemParams,\r\n elementAttributes:option.elementAttributes,\r\n element:false,\r\n visible:true,\r\n level:level,\r\n options:[],\r\n original:option,\r\n };\r\n \r\n option.options.forEach((child) => {\r\n this._parseListItem(child, item.options, level);\r\n });\r\n \r\n return item;\r\n }\r\n \r\n _sortOptions(options){\r\n var sorter;\r\n \r\n if(this.params.sort){\r\n sorter = typeof this.params.sort === \"function\" ? this.params.sort : this._defaultSortFunction.bind(this);\r\n \r\n this._sortGroup(sorter, options);\r\n }\r\n \r\n return options;\r\n }\r\n \r\n _sortGroup(sorter, options){\r\n options.sort((a,b) => {\r\n return sorter(a.label, b.label, a.value, b.value, a.original, b.original);\r\n });\r\n \r\n options.forEach((option) => {\r\n if(option.group){\r\n this._sortGroup(sorter, option.options);\r\n }\r\n })\r\n }\r\n \r\n _defaultSortFunction(as, bs){\r\n var a, b, a1, b1, i= 0, L, rx = /(\\d+)|(\\D+)/g, rd = /\\d/;\r\n var emptyAlign = 0;\r\n \r\n if(this.params.sort === \"desc\"){\r\n [as, bs] = [bs, as];\r\n }\r\n \r\n //handle empty values\r\n if(!as && as!== 0){\r\n emptyAlign = !bs && bs!== 0 ? 0 : -1;\r\n }else if(!bs && bs!== 0){\r\n emptyAlign = 1;\r\n }else{\r\n if(isFinite(as) && isFinite(bs)) return as - bs;\r\n a = String(as).toLowerCase();\r\n b = String(bs).toLowerCase();\r\n if(a === b) return 0;\r\n if(!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1;\r\n a = a.match(rx);\r\n b = b.match(rx);\r\n L = a.length > b.length ? b.length : a.length;\r\n while(i < L){\r\n a1= a[i];\r\n b1= b[i++];\r\n if(a1 !== b1){\r\n if(isFinite(a1) && isFinite(b1)){\r\n if(a1.charAt(0) === \"0\") a1 = \".\" + a1;\r\n if(b1.charAt(0) === \"0\") b1 = \".\" + b1;\r\n return a1 - b1;\r\n }\r\n else return a1 > b1 ? 1 : -1;\r\n }\r\n }\r\n \r\n return a.length > b.length;\r\n }\r\n \r\n return emptyAlign;\r\n }\r\n \r\n _filterOptions(){\r\n var filterFunc = this.params.filterFunc || this._defaultFilterFunc;\r\n var term = this.input.value;\r\n var results = [];\r\n \r\n if(term){\r\n this.filtered = true;\r\n \r\n this.data.forEach((item) => {\r\n this._filterItem(filterFunc, term, item);\r\n });\r\n }else{\r\n this.filtered = false;\r\n }\r\n \r\n return this.data;\r\n }\r\n \r\n _filterItem(func, term, item){\r\n var matches = false;\r\n \r\n if(!item.group){\r\n item.visible = func(term, item.label, item.value, item.original);\r\n }else{\r\n item.options.forEach((option) => {\r\n if(this._filterItem(func, term, option)){\r\n matches = true;\r\n }\r\n });\r\n \r\n item.visible = matches;\r\n }\r\n \r\n return item.visible;\r\n }\r\n \r\n _defaultFilterFunc(term, label, value, item){\r\n var term = String(term).toLowerCase();\r\n \r\n if(label !== null || typeof label !== \"undefined\"){\r\n if(String(label).toLowerCase().indexOf(term) > -1 || String(value).toLowerCase(term).indexOf() > -1){\r\n return true;\r\n }\r\n }\r\n \r\n return false;\r\n }\r\n \r\n //////////////////////////////////////\r\n /////////// Display List /////////////\r\n //////////////////////////////////////\r\n \r\n _clearList(){\r\n while(this.listEl.firstChild) this.listEl.removeChild(this.listEl.firstChild);\r\n \r\n this.displayItems = [];\r\n }\r\n \r\n _buildList(data){\r\n this._clearList();\r\n \r\n data.forEach((option) => {\r\n this._buildItem(option);\r\n });\r\n \r\n if(!this.displayItems.length){\r\n this._addPlaceholder(this.params.placeholderEmpty);\r\n } \r\n }\r\n \r\n _buildItem(item){\r\n var el = item.element,\r\n contents;\r\n \r\n if(!this.filtered || item.visible){\r\n \r\n if(!el){\r\n el = document.createElement(\"div\");\r\n el.tabIndex = 0;\r\n \r\n contents = this.params.itemFormatter ? this.params.itemFormatter(item.label, item.value, item.original, el) : item.label;\r\n \r\n if(contents instanceof HTMLElement){\r\n el.appendChild(contents)\r\n }else{\r\n el.innerHTML = contents;\r\n }\r\n \r\n if(item.group){\r\n el.classList.add(\"tabulator-edit-list-group\");\r\n }else{\r\n el.classList.add(\"tabulator-edit-list-item\");\r\n }\r\n \r\n el.classList.add(\"tabulator-edit-list-group-level-\" + item.level);\r\n \r\n if(item.elementAttributes && typeof item.elementAttributes == \"object\"){\r\n for (let key in item.elementAttributes){\r\n if(key.charAt(0) == \"+\"){\r\n key = key.slice(1);\r\n el.setAttribute(key, this.input.getAttribute(key) + item.elementAttributes[\"+\" + key]);\r\n }else{\r\n el.setAttribute(key, item.elementAttributes[key]);\r\n }\r\n }\r\n }\r\n \r\n if(item.group){\r\n el.addEventListener(\"click\", this._groupClick.bind(this, item));\r\n }else{\r\n el.addEventListener(\"click\", this._itemClick.bind(this, item));\r\n }\r\n \r\n el.addEventListener(\"mousedown\", this._preventBlur.bind(this));\r\n \r\n item.element = el;\r\n }\r\n \r\n this._styleItem(item);\r\n \r\n this.listEl.appendChild(el);\r\n \r\n if(item.group){\r\n item.options.forEach((option) => {\r\n this._buildItem(option);\r\n });\r\n }else{\r\n this.displayItems.push(item);\r\n }\r\n }\r\n }\r\n \r\n _showList(){\r\n var startVis = this.popup && this.popup.isVisible();\r\n \r\n if(this.input.parentNode){\r\n if(this.params.autocomplete && this.input.value === \"\" && !this.params.listOnEmpty){\r\n if(this.popup){\r\n this.popup.hide(true);\r\n return;\r\n }\r\n }\r\n \r\n this._setListWidth();\r\n \r\n if(!this.popup){\r\n this.popup = this.edit.popup(this.listEl);\r\n }\r\n \r\n this.popup.show(this.cell.getElement(), \"bottom\")\r\n \r\n if(!startVis){\r\n this.popup.hideOnBlur(this._resolveValue.bind(this, true));\r\n }\r\n }\r\n }\r\n \r\n _styleItem(item){\r\n if(item && item.element){\r\n if(item.selected){\r\n item.element.classList.add(\"active\");\r\n }else{\r\n item.element.classList.remove(\"active\");\r\n }\r\n }\r\n }\r\n \r\n //////////////////////////////////////\r\n ///////// User Interaction ///////////\r\n //////////////////////////////////////\r\n \r\n _itemClick(item, e){\r\n e.stopPropagation();\r\n \r\n this._chooseItem(item);\r\n }\r\n \r\n _groupClick(item, e){\r\n e.stopPropagation();\r\n }\r\n \r\n \r\n //////////////////////////////////////\r\n ////// Current Item Management ///////\r\n //////////////////////////////////////\r\n \r\n _cancel(){\r\n this.popup.hide(true);\r\n this.actions.cancel();\r\n }\r\n \r\n _clearChoices(){\r\n this.typing = true;\r\n \r\n this.currentItems.forEach((item) => {\r\n item.selected = false;\r\n this._styleItem(item);\r\n });\r\n \r\n this.currentItems = [];\r\n \r\n this.focusedItem = null;\r\n }\r\n \r\n _chooseItem(item, silent){\r\n var index;\r\n \r\n this.typing = false;\r\n \r\n if(this.params.multiselect){\r\n index = this.currentItems.indexOf(item);\r\n \r\n if(index > -1){\r\n this.currentItems.splice(index, 1);\r\n item.selected = false;\r\n }else{\r\n this.currentItems.push(item);\r\n item.selected = true;\r\n }\r\n \r\n this.input.value = this.currentItems.map(item => item.label).join(\",\");\r\n \r\n this._styleItem(item);\r\n \r\n }else{\r\n this.currentItems = [item];\r\n item.selected = true;\r\n \r\n this.input.value = item.label;\r\n \r\n this._styleItem(item);\r\n \r\n if(!silent){\r\n this._resolveValue();\r\n }\r\n }\r\n \r\n this._focusItem(item);\r\n }\r\n \r\n _resolveValue(blur){\r\n var output, initialValue;\r\n \r\n this.popup.hide(true);\r\n \r\n if(this.params.multiselect){\r\n output = this.currentItems.map(item => item.value);\r\n }else{\r\n if(blur && this.params.autocomplete && this.typing){\r\n if(this.params.freetext || (this.params.allowEmpty && this.input.value === \"\")){\r\n output = this.input.value;\r\n }else{\r\n this.actions.cancel();\r\n return;\r\n }\r\n }else{\r\n if(this.currentItems[0]){\r\n output = this.currentItems[0].value;\r\n }else{\r\n initialValue = this.initialValues[0];\r\n \r\n if(initialValue === null || typeof initialValue === \"undefined\" || initialValue === \"\"){\r\n output = initialValue;\r\n }else{\r\n output = this.params.emptyValue;\r\n }\r\n }\r\n \r\n }\r\n }\r\n \r\n if(output === \"\"){\r\n output = this.params.emptyValue;\r\n }\r\n \r\n this.actions.success(output);\r\n \r\n if(this.isFilter){\r\n this.initialValues = output && !Array.isArray[output] ? [output] : output;\r\n }\r\n }\r\n \r\n}\r\n","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\r\n\t console.warn(\"The select editor has been deprecated, please use the new list editor\");\r\n\r\n var list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n return list.input;\r\n}","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n var list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n return list.input;\r\n}","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\r\n\tconsole.warn(\"The autocomplete editor has been deprecated, please use the new list editor with the 'autocomplete' editorParam\");\r\n\r\n\teditorParams.autocomplete = true;\r\n\r\n var list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n return list.input;\r\n}","//star rating\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar self = this,\r\n\telement = cell.getElement(),\r\n\tvalue = cell.getValue(),\r\n\tmaxStars = element.getElementsByTagName(\"svg\").length || 5,\r\n\tsize = element.getElementsByTagName(\"svg\")[0] ? element.getElementsByTagName(\"svg\")[0].getAttribute(\"width\") : 14,\r\n\tstars = [],\r\n\tstarsHolder = document.createElement(\"div\"),\r\n\tstar = document.createElementNS('http://www.w3.org/2000/svg', \"svg\");\r\n\r\n\r\n\t//change star type\r\n\tfunction starChange(val){\r\n\t\tstars.forEach(function(star, i){\r\n\t\t\tif(i < val){\r\n\t\t\t\tif(self.table.browser == \"ie\"){\r\n\t\t\t\t\tstar.setAttribute(\"class\", \"tabulator-star-active\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tstar.classList.replace(\"tabulator-star-inactive\", \"tabulator-star-active\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstar.innerHTML = '';\r\n\t\t\t}else{\r\n\t\t\t\tif(self.table.browser == \"ie\"){\r\n\t\t\t\t\tstar.setAttribute(\"class\", \"tabulator-star-inactive\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tstar.classList.replace(\"tabulator-star-active\", \"tabulator-star-inactive\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstar.innerHTML = '';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//build stars\r\n\tfunction buildStar(i){\r\n\r\n\t\tvar starHolder = document.createElement(\"span\");\r\n\t\tvar nextStar = star.cloneNode(true);\r\n\r\n\t\tstars.push(nextStar);\r\n\r\n\t\tstarHolder.addEventListener(\"mouseenter\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\tstarChange(i);\r\n\t\t});\r\n\r\n\t\tstarHolder.addEventListener(\"mousemove\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t});\r\n\r\n\t\tstarHolder.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\tsuccess(i);\r\n\t\t\telement.blur();\r\n\t\t});\r\n\r\n\t\tstarHolder.appendChild(nextStar);\r\n\t\tstarsHolder.appendChild(starHolder);\r\n\r\n\t}\r\n\r\n\t//handle keyboard navigation value change\r\n\tfunction changeValue(val){\r\n\t\tvalue = val;\r\n\t\tstarChange(val);\r\n\t}\r\n\r\n\t//style cell\r\n\telement.style.whiteSpace = \"nowrap\";\r\n\telement.style.overflow = \"hidden\";\r\n\telement.style.textOverflow = \"ellipsis\";\r\n\r\n\t//style holding element\r\n\tstarsHolder.style.verticalAlign = \"middle\";\r\n\tstarsHolder.style.display = \"inline-block\";\r\n\tstarsHolder.style.padding = \"4px\";\r\n\r\n\t//style star\r\n\tstar.setAttribute(\"width\", size);\r\n\tstar.setAttribute(\"height\", size);\r\n\tstar.setAttribute(\"viewBox\", \"0 0 512 512\");\r\n\tstar.setAttribute(\"xml:space\", \"preserve\");\r\n\tstar.style.padding = \"0 1px\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tstarsHolder.setAttribute(key, starsHolder.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tstarsHolder.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//create correct number of stars\r\n\tfor(var i=1;i<= maxStars;i++){\r\n\t\tbuildStar(i);\r\n\t}\r\n\r\n\t//ensure value does not exceed number of stars\r\n\tvalue = Math.min(parseInt(value), maxStars);\r\n\r\n\t// set initial styling of stars\r\n\tstarChange(value);\r\n\r\n\tstarsHolder.addEventListener(\"mousemove\", function(e){\r\n\t\tstarChange(0);\r\n\t});\r\n\r\n\tstarsHolder.addEventListener(\"click\", function(e){\r\n\t\tsuccess(0);\r\n\t});\r\n\r\n\telement.addEventListener(\"blur\", function(e){\r\n\t\tcancel();\r\n\t});\r\n\r\n\t//allow key based navigation\r\n\telement.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 39: //right arrow\r\n\t\t\tchangeValue(value + 1);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 37: //left arrow\r\n\t\t\tchangeValue(value - 1);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 13: //enter\r\n\t\t\tsuccess(value);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 27: //escape\r\n\t\t\tcancel();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\treturn starsHolder;\r\n};","//draggable progress bar\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar element = cell.getElement(),\r\n\tmax = typeof editorParams.max === \"undefined\" ? ((element.getElementsByTagName(\"div\")[0] && element.getElementsByTagName(\"div\")[0].getAttribute(\"max\")) || 100) : editorParams.max,\r\n\tmin = typeof editorParams.min === \"undefined\" ? ((element.getElementsByTagName(\"div\")[0] && element.getElementsByTagName(\"div\")[0].getAttribute(\"min\")) || 0) : editorParams.min,\r\n\tpercent = (max - min) / 100,\r\n\tvalue = cell.getValue() || 0,\r\n\thandle = document.createElement(\"div\"),\r\n\tbar = document.createElement(\"div\"),\r\n\tmouseDrag, mouseDragWidth;\r\n\r\n\t//set new value\r\n\tfunction updateValue(){\r\n\t\tvar style = window.getComputedStyle(element, null);\r\n\r\n\t\tvar calcVal = (percent * Math.round(bar.offsetWidth / ((element.clientWidth - parseInt(style.getPropertyValue(\"padding-left\")) - parseInt(style.getPropertyValue(\"padding-right\")))/100))) + min;\r\n\t\tsuccess(calcVal);\r\n\t\telement.setAttribute(\"aria-valuenow\", calcVal);\r\n\t\telement.setAttribute(\"aria-label\", value);\r\n\t}\r\n\r\n\t//style handle\r\n\thandle.style.position = \"absolute\";\r\n\thandle.style.right = \"0\";\r\n\thandle.style.top = \"0\";\r\n\thandle.style.bottom = \"0\";\r\n\thandle.style.width = \"5px\";\r\n\thandle.classList.add(\"tabulator-progress-handle\");\r\n\r\n\t//style bar\r\n\tbar.style.display = \"inline-block\";\r\n\tbar.style.position = \"relative\";\r\n\t// bar.style.top = \"8px\";\r\n\t// bar.style.bottom = \"8px\";\r\n\t// bar.style.left = \"4px\";\r\n\t// bar.style.marginRight = \"4px\";\r\n\tbar.style.height = \"100%\";\r\n\tbar.style.backgroundColor = \"#488CE9\";\r\n\tbar.style.maxWidth = \"100%\";\r\n\tbar.style.minWidth = \"0%\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tbar.setAttribute(key, bar.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tbar.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//style cell\r\n\telement.style.padding = \"4px 4px\";\r\n\r\n\t//make sure value is in range\r\n\tvalue = Math.min(parseFloat(value), max);\r\n\tvalue = Math.max(parseFloat(value), min);\r\n\r\n\t//workout percentage\r\n\tvalue = Math.round((value - min) / percent);\r\n\t// bar.style.right = value + \"%\";\r\n\tbar.style.width = value + \"%\";\r\n\r\n\telement.setAttribute(\"aria-valuemin\", min);\r\n\telement.setAttribute(\"aria-valuemax\", max);\r\n\r\n\tbar.appendChild(handle);\r\n\r\n\thandle.addEventListener(\"mousedown\", function(e){\r\n\t\tmouseDrag = e.screenX;\r\n\t\tmouseDragWidth = bar.offsetWidth;\r\n\t});\r\n\r\n\thandle.addEventListener(\"mouseover\", function(){\r\n\t\thandle.style.cursor = \"ew-resize\";\r\n\t});\r\n\r\n\telement.addEventListener(\"mousemove\", function(e){\r\n\t\tif(mouseDrag){\r\n\t\t\tbar.style.width = (mouseDragWidth + e.screenX - mouseDrag) + \"px\";\r\n\t\t}\r\n\t});\r\n\r\n\telement.addEventListener(\"mouseup\", function(e){\r\n\t\tif(mouseDrag){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\r\n\t\t\tmouseDrag = false;\r\n\t\t\tmouseDragWidth = false;\r\n\r\n\t\t\tupdateValue();\r\n\t\t}\r\n\t});\r\n\r\n\t//allow key based navigation\r\n\telement.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 39: //right arrow\r\n\t\t\te.preventDefault();\r\n\t\t\tbar.style.width = (bar.clientWidth + element.clientWidth/100) + \"px\";\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 37: //left arrow\r\n\t\t\te.preventDefault();\r\n\t\t\tbar.style.width = (bar.clientWidth - element.clientWidth/100) + \"px\";\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 9: //tab\r\n\t\t\tcase 13: //enter\r\n\t\t\tupdateValue();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 27: //escape\r\n\t\t\tcancel();\r\n\t\t\tbreak;\r\n\r\n\t\t}\r\n\t});\r\n\r\n\telement.addEventListener(\"blur\", function(){\r\n\t\tcancel();\r\n\t});\r\n\r\n\treturn bar;\r\n};","//checkbox\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar value = cell.getValue(),\r\n\tinput = document.createElement(\"input\"),\r\n\ttristate = editorParams.tristate,\r\n\tindetermValue = typeof editorParams.indeterminateValue === \"undefined\" ? null : editorParams.indeterminateValue,\r\n\tindetermState = false,\r\n\ttrueValueSet = Object.keys(editorParams).includes(\"trueValue\"),\r\n\tfalseValueSet = Object.keys(editorParams).includes(\"falseValue\");\r\n\r\n\tinput.setAttribute(\"type\", \"checkbox\");\r\n\tinput.style.marginTop = \"5px\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = value;\r\n\r\n\tif(tristate && (typeof value === \"undefined\" || value === indetermValue || value === \"\")){\r\n\t\tindetermState = true;\r\n\t\tinput.indeterminate = true;\r\n\t}\r\n\r\n\tif(this.table.browser != \"firefox\"){ //prevent blur issue on mac firefox\r\n\t\tonRendered(function(){\r\n\t\t\tinput.focus({preventScroll: true});\r\n\t\t});\r\n\t}\r\n\r\n\tinput.checked = trueValueSet ? value === editorParams.trueValue : (value === true || value === \"true\" || value === \"True\" || value === 1);\r\n\r\n\tonRendered(function(){\r\n\t\tinput.focus();\r\n\t});\r\n\r\n\tfunction setValue(blur){\r\n\t\tvar checkedValue = input.checked;\r\n\r\n\t\tif(trueValueSet && checkedValue){\r\n\t\t\tcheckedValue = editorParams.trueValue;\r\n\t\t}else if(falseValueSet && !checkedValue){\r\n\t\t\tcheckedValue = editorParams.falseValue;\r\n\t\t}else{\r\n\t\t\tcheckedValue = checkedValue;\r\n\t\t}\r\n\r\n\t\tif(tristate){\r\n\t\t\tif(!blur){\r\n\t\t\t\tif(input.checked && !indetermState){\r\n\t\t\t\t\tinput.checked = false;\r\n\t\t\t\t\tinput.indeterminate = true;\r\n\t\t\t\t\tindetermState = true;\r\n\t\t\t\t\treturn indetermValue;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tindetermState = false;\r\n\t\t\t\t\treturn checkedValue;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(indetermState){\r\n\t\t\t\t\treturn indetermValue;\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn checkedValue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn checkedValue;\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur\r\n\tinput.addEventListener(\"change\", function(e){\r\n\t\tsuccess(setValue());\r\n\t});\r\n\r\n\tinput.addEventListener(\"blur\", function(e){\r\n\t\tsuccess(setValue(true));\r\n\t});\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tif(e.keyCode == 13){\r\n\t\t\tsuccess(setValue());\r\n\t\t}\r\n\t\tif(e.keyCode == 27){\r\n\t\t\tcancel();\r\n\t\t}\r\n\t});\r\n\r\n\treturn input;\r\n};","import input from './editors/input.js';\r\nimport textarea from './editors/textarea.js';\r\nimport number from './editors/number.js';\r\nimport range from './editors/range.js';\r\nimport select from './editors/select.js';\r\nimport list from './editors/list.js';\r\nimport autocomplete from './editors/autocomplete.js';\r\nimport star from './editors/star.js';\r\nimport progress from './editors/progress.js';\r\nimport tickCross from './editors/tickCross.js';\r\n\r\nexport default {\r\n\tinput:input,\r\n\ttextarea:textarea,\r\n number:number,\r\n range:range,\r\n\tselect:select,\r\n\tlist:list,\r\n\tautocomplete:autocomplete,\r\n\tstar:star,\r\n\tprogress:progress,\r\n\ttickCross:tickCross,\r\n};","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defaultEditors from './defaults/editors.js';\r\n\r\nclass Edit extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.currentCell = false; //hold currently editing cell\r\n\t\tthis.mouseClick = false; //hold mousedown state to prevent click binding being overriden by editor opening\r\n\t\tthis.recursionBlock = false; //prevent focus recursion\r\n\t\tthis.invalidEdit = false;\r\n\t\tthis.editedCells = [];\r\n\r\n\t\tthis.editors = Edit.editors;\r\n\r\n\t\tthis.registerColumnOption(\"editable\");\r\n\t\tthis.registerColumnOption(\"editor\");\r\n\t\tthis.registerColumnOption(\"editorParams\");\r\n\r\n\t\tthis.registerColumnOption(\"cellEditing\");\r\n\t\tthis.registerColumnOption(\"cellEdited\");\r\n\t\tthis.registerColumnOption(\"cellEditCancelled\");\r\n\r\n\t\tthis.registerTableFunction(\"getEditedCells\", this.getEditedCells.bind(this));\r\n\t\tthis.registerTableFunction(\"clearCellEdited\", this.clearCellEdited.bind(this));\r\n\t\tthis.registerTableFunction(\"navigatePrev\", this.navigatePrev.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateNext\", this.navigateNext.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateLeft\", this.navigateLeft.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateRight\", this.navigateRight.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateUp\", this.navigateUp.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateDown\", this.navigateDown.bind(this));\r\n\r\n\t\tthis.registerComponentFunction(\"cell\", \"isEdited\", this.cellisEdited.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"clearEdited\", this.clearEdited.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"edit\", this.editCell.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"cancelEdit\", this.cellCancelEdit.bind(this));\r\n\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigatePrev\", this.navigatePrev.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateNext\", this.navigateNext.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateLeft\", this.navigateLeft.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateRight\", this.navigateRight.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateUp\", this.navigateUp.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateDown\", this.navigateDown.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-init\", this.bindEditor.bind(this));\r\n\t\tthis.subscribe(\"cell-delete\", this.clearEdited.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumnCheck.bind(this));\r\n\t\tthis.subscribe(\"column-delete\", this.columnDeleteCheck.bind(this));\r\n\t\tthis.subscribe(\"row-deleting\", this.rowDeleteCheck.bind(this));\r\n\t\tthis.subscribe(\"data-refreshing\", this.cancelEdit.bind(this));\r\n\r\n\t\tthis.subscribe(\"keybinding-nav-prev\", this.navigatePrev.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-next\", this.keybindingNavigateNext.bind(this));\r\n\t\tthis.subscribe(\"keybinding-nav-left\", this.navigateLeft.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-right\", this.navigateRight.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-up\", this.navigateUp.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-down\", this.navigateDown.bind(this, undefined));\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t////// Keybinding Functions ///////\r\n\t///////////////////////////////////\r\n\r\n\tkeybindingNavigateNext(e){\r\n\t\tvar cell = this.currentCell,\r\n\t\tnewRow = this.options(\"tabEndNewRow\");\r\n\r\n\t\tif(cell){\r\n\t\t\tif(!this.navigateNext(cell, e)){\r\n\t\t\t\tif(newRow){\r\n\t\t\t\t\tcell.getElement().firstChild.blur();\r\n\r\n\t\t\t\t\tif(newRow === true){\r\n\t\t\t\t\t\tnewRow = this.table.addRow({})\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(typeof newRow == \"function\"){\r\n\t\t\t\t\t\t\tnewRow = this.table.addRow(newRow(cell.row.getComponent()))\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnewRow = this.table.addRow(Object.assign({}, newRow));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tnewRow.then(() => {\r\n\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\tcell.getComponent().navigateNext();\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Cell Functions //////////\r\n\t///////////////////////////////////\r\n\r\n\tcellisEdited(cell){\r\n\t\treturn !! cell.modules.edit && cell.modules.edit.edited;\r\n\t}\r\n\r\n\tcellCancelEdit(cell){\r\n\t\tif(cell === this.currentCell){\r\n\t\t\tthis.table.modules.edit.cancelEdit();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cancel Editor Error - This cell is not currently being edited \");\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\tclearCellEdited(cells){\r\n\t\tif(!cells){\r\n\t\t\tcells = this.table.modules.edit.getEditedCells();\r\n\t\t}\r\n\r\n\t\tif(!Array.isArray(cells)){\r\n\t\t\tcells = [cells];\r\n\t\t}\r\n\r\n\t\tcells.forEach((cell) => {\r\n\t\t\tthis.table.modules.edit.clearEdited(cell._getSelf());\r\n\t\t});\r\n\t}\r\n\r\n\tnavigatePrev(cell = this.currentCell, e){\r\n\t\tvar nextCell, prevRow;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tnextCell = this.navigateLeft();\r\n\r\n\t\t\tif(nextCell){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tprevRow = this.table.rowManager.prevDisplayRow(cell.row, true);\r\n\r\n\t\t\t\tif(prevRow){\r\n\t\t\t\t\tnextCell = this.findNextEditableCell(prevRow, prevRow.cells.length);\r\n\r\n\t\t\t\t\tif(nextCell){\r\n\t\t\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tnavigateNext(cell = this.currentCell, e){\r\n\t\tvar nextCell, nextRow;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tnextCell = this.navigateRight();\r\n\r\n\t\t\tif(nextCell){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tnextRow = this.table.rowManager.nextDisplayRow(cell.row, true);\r\n\r\n\t\t\t\tif(nextRow){\r\n\t\t\t\t\tnextCell = this.findNextEditableCell(nextRow, -1);\r\n\r\n\t\t\t\t\tif(nextCell){\r\n\t\t\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tnavigateLeft(cell = this.currentCell, e){\r\n\t\tvar index, nextCell;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextCell = this.findPrevEditableCell(cell.row, index);\r\n\r\n\t\t\tif(nextCell){\r\n\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tnavigateRight(cell = this.currentCell, e){\r\n\t\tvar index, nextCell;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextCell = this.findNextEditableCell(cell.row, index);\r\n\r\n\t\t\tif(nextCell){\r\n\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tnavigateUp(cell = this.currentCell, e){\r\n\t\tvar index, nextRow;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextRow = this.table.rowManager.prevDisplayRow(cell.row, true);\r\n\r\n\t\t\tif(nextRow){\r\n\t\t\t\tnextRow.cells[index].getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tnavigateDown(cell = this.currentCell, e){\r\n\t\tvar index, nextRow;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextRow = this.table.rowManager.nextDisplayRow(cell.row, true);\r\n\r\n\t\t\tif(nextRow){\r\n\t\t\t\tnextRow.cells[index].getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfindNextEditableCell(row, index){\r\n\t\tvar nextCell = false;\r\n\r\n\t\tif(index < row.cells.length-1){\r\n\t\t\tfor(var i = index+1; i < row.cells.length; i++){\r\n\t\t\t\tlet cell = row.cells[i];\r\n\r\n\t\t\t\tif(cell.column.modules.edit && Helpers.elVisible(cell.getElement())){\r\n\t\t\t\t\tlet allowEdit = true;\r\n\r\n\t\t\t\t\tif(typeof cell.column.modules.edit.check == \"function\"){\r\n\t\t\t\t\t\tallowEdit = cell.column.modules.edit.check(cell.getComponent());\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(allowEdit){\r\n\t\t\t\t\t\tnextCell = cell;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn nextCell;\r\n\t}\r\n\r\n\tfindPrevEditableCell(row, index){\r\n\t\tvar prevCell = false;\r\n\r\n\t\tif(index > 0){\r\n\t\t\tfor(var i = index-1; i >= 0; i--){\r\n\t\t\t\tlet cell = row.cells[i],\r\n\t\t\t\tallowEdit = true;\r\n\r\n\t\t\t\tif(cell.column.modules.edit && Helpers.elVisible(cell.getElement())){\r\n\t\t\t\t\tif(typeof cell.column.modules.edit.check == \"function\"){\r\n\t\t\t\t\t\tallowEdit = cell.column.modules.edit.check(cell.getComponent());\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(allowEdit){\r\n\t\t\t\t\t\tprevCell = cell;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn prevCell;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tinitializeColumnCheck(column){\r\n\t\tif(typeof column.definition.editor !== \"undefined\"){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\r\n\tcolumnDeleteCheck(column){\r\n\t\tif(this.currentCell && this.currentCell.column === column){\r\n\t\t\tthis.cancelEdit();\r\n\t\t}\r\n\t}\r\n\r\n\trowDeleteCheck(row){\r\n\t\tif(this.currentCell && this.currentCell.row === row){\r\n\t\t\tthis.cancelEdit();\r\n\t\t}\r\n\t}\r\n\r\n\t//initialize column editor\r\n\tinitializeColumn(column){\r\n\t\tvar self = this,\r\n\t\tconfig = {\r\n\t\t\teditor:false,\r\n\t\t\tblocked:false,\r\n\t\t\tcheck:column.definition.editable,\r\n\t\t\tparams:column.definition.editorParams || {}\r\n\t\t};\r\n\r\n\t\t//set column editor\r\n\t\tswitch(typeof column.definition.editor){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(this.editors[column.definition.editor]){\r\n\t\t\t\tconfig.editor = this.editors[column.definition.editor];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Editor Error - No such editor found: \", column.definition.editor);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tconfig.editor = column.definition.editor;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"boolean\":\r\n\t\t\tif(column.definition.editor === true){\r\n\t\t\t\tif(typeof column.definition.formatter !== \"function\"){\r\n\t\t\t\t\tif(this.editors[column.definition.formatter]){\r\n\t\t\t\t\t\tconfig.editor = this.editors[column.definition.formatter];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconfig.editor = this.editors[\"input\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Editor Error - Cannot auto lookup editor for a custom formatter: \", column.definition.formatter);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(config.editor){\r\n\t\t\tcolumn.modules.edit = config;\r\n\t\t}\r\n\t}\r\n\r\n\tgetCurrentCell(){\r\n\t\treturn this.currentCell ? this.currentCell.getComponent() : false;\r\n\t}\r\n\r\n\tclearEditor(cancel){\r\n\t\tvar cell = this.currentCell,\r\n\t\tcellEl;\r\n\r\n\t\tthis.invalidEdit = false;\r\n\r\n\t\tif(cell){\r\n\t\t\tthis.currentCell = false;\r\n\r\n\t\t\tcellEl = cell.getElement();\r\n\r\n\t\t\tthis.dispatch(\"edit-editor-clear\", cell, cancel);\r\n\r\n\t\t\tcellEl.classList.remove(\"tabulator-editing\");\r\n\r\n\t\t\twhile(cellEl.firstChild) cellEl.removeChild(cellEl.firstChild);\r\n\r\n\t\t\tcell.row.getElement().classList.remove(\"tabulator-row-editing\");\r\n\t\t}\r\n\t}\r\n\r\n\tcancelEdit(){\r\n\t\tif(this.currentCell){\r\n\t\t\tvar cell = this.currentCell;\r\n\t\t\tvar component = this.currentCell.getComponent();\r\n\r\n\t\t\tthis.clearEditor(true);\r\n\t\t\tcell.setValueActual(cell.getValue());\r\n\t\t\tcell.cellRendered();\r\n\r\n\t\t\tif(cell.column.definition.editor == \"textarea\" || cell.column.definition.variableHeight){\r\n\t\t\t\tcell.row.normalizeHeight(true);\r\n\t\t\t}\r\n\r\n\t\t\tif(cell.column.definition.cellEditCancelled){\r\n\t\t\t\tcell.column.definition.cellEditCancelled.call(this.table, component);\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatch(\"edit-cancelled\", cell);\r\n\t\t\tthis.dispatchExternal(\"cellEditCancelled\", component);\r\n\t\t}\r\n\t}\r\n\r\n\t//return a formatted value for a cell\r\n\tbindEditor(cell){\r\n\t\tif(cell.column.modules.edit){\r\n\t\t\tvar self = this,\r\n\t\t\telement = cell.getElement(true);\r\n\r\n\t\t\telement.setAttribute(\"tabindex\", 0);\r\n\r\n\t\t\telement.addEventListener(\"click\", function(e){\r\n\t\t\t\tif(!element.classList.contains(\"tabulator-editing\")){\r\n\t\t\t\t\telement.focus({preventScroll: true});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\telement.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif (e.button === 2) {\r\n\t\t\t\t\te.preventDefault();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself.mouseClick = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\telement.addEventListener(\"focus\", function(e){\r\n\t\t\t\tif(!self.recursionBlock){\r\n\t\t\t\t\tself.edit(cell, e, false);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tfocusCellNoEvent(cell, block){\r\n\t\tthis.recursionBlock = true;\r\n\r\n\t\tif(!(block && this.table.browser === \"ie\")){\r\n\t\t\tcell.getElement().focus({preventScroll: true});\r\n\t\t}\r\n\r\n\t\tthis.recursionBlock = false;\r\n\t}\r\n\r\n\teditCell(cell, forceEdit){\r\n\t\tthis.focusCellNoEvent(cell);\r\n\t\tthis.edit(cell, false, forceEdit);\r\n\t}\r\n\r\n\tfocusScrollAdjust(cell){\r\n\t\tif(this.table.rowManager.getRenderMode() == \"virtual\"){\r\n\t\t\tvar topEdge = this.table.rowManager.element.scrollTop,\r\n\t\t\tbottomEdge = this.table.rowManager.element.clientHeight + this.table.rowManager.element.scrollTop,\r\n\t\t\trowEl = cell.row.getElement(),\r\n\t\t\toffset = rowEl.offsetTop;\r\n\r\n\t\t\tif(rowEl.offsetTop < topEdge){\r\n\t\t\t\tthis.table.rowManager.element.scrollTop -= (topEdge - rowEl.offsetTop);\r\n\t\t\t}else{\r\n\t\t\t\tif(rowEl.offsetTop + rowEl.offsetHeight > bottomEdge){\r\n\t\t\t\t\tthis.table.rowManager.element.scrollTop += (rowEl.offsetTop + rowEl.offsetHeight - bottomEdge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar leftEdge = this.table.rowManager.element.scrollLeft,\r\n\t\t\trightEdge = this.table.rowManager.element.clientWidth + this.table.rowManager.element.scrollLeft,\r\n\t\t\tcellEl = cell.getElement(),\r\n\t\t\toffset = cellEl.offsetLeft;\r\n\r\n\t\t\tif(this.table.modExists(\"frozenColumns\")){\r\n\t\t\t\tleftEdge += parseInt(this.table.modules.frozenColumns.leftMargin);\r\n\t\t\t\trightEdge -= parseInt(this.table.modules.frozenColumns.rightMargin);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.options.renderHorizontal === \"virtual\"){\r\n\t\t\t\tleftEdge -= parseInt(this.table.columnManager.renderer.vDomPadLeft);\r\n\t\t\t\trightEdge -= parseInt(this.table.columnManager.renderer.vDomPadLeft);\r\n\t\t\t}\r\n\r\n\t\t\tif(cellEl.offsetLeft < leftEdge){\r\n\r\n\t\t\t\tthis.table.rowManager.element.scrollLeft -= (leftEdge - cellEl.offsetLeft);\r\n\t\t\t}else{\r\n\t\t\t\tif(cellEl.offsetLeft + cellEl.offsetWidth > rightEdge){\r\n\t\t\t\t\tthis.table.rowManager.element.scrollLeft += (cellEl.offsetLeft + cellEl.offsetWidth - rightEdge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tedit(cell, e, forceEdit){\r\n\t\tvar self = this,\r\n\t\tallowEdit = true,\r\n\t\trendered = function(){},\r\n\t\telement = cell.getElement(),\r\n\t\tcellEditor, component, params;\r\n\r\n\t\t//prevent editing if another cell is refusing to leave focus (eg. validation fail)\r\n\t\tif(this.currentCell){\r\n\t\t\tif(!this.invalidEdit){\r\n\t\t\t\tthis.cancelEdit();\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//handle successful value change\r\n\t\tfunction success(value){\r\n\t\t\tif(self.currentCell === cell){\r\n\t\t\t\tvar valid = self.chain(\"edit-success\", [cell, value], true, true);\r\n\r\n\t\t\t\tif(valid === true || self.table.options.validationMode === \"highlight\"){\r\n\t\t\t\t\tself.clearEditor();\r\n\r\n\r\n\t\t\t\t\tif(!cell.modules.edit){\r\n\t\t\t\t\t\tcell.modules.edit = {};\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tcell.modules.edit.edited = true;\r\n\r\n\t\t\t\t\tif(self.editedCells.indexOf(cell) == -1){\r\n\t\t\t\t\t\tself.editedCells.push(cell);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tcell.setValue(value, true);\r\n\r\n\t\t\t\t\treturn valid === true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself.invalidEdit = true;\r\n\t\t\t\t\tself.focusCellNoEvent(cell, true);\r\n\t\t\t\t\trendered();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t// console.warn(\"Edit Success Error - cannot call success on a cell that is no longer being edited\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//handle aborted edit\r\n\t\tfunction cancel(){\r\n\t\t\tif(self.currentCell === cell){\r\n\t\t\t\tself.cancelEdit();\r\n\t\t\t}else{\r\n\t\t\t\t// console.warn(\"Edit Success Error - cannot call cancel on a cell that is no longer being edited\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\trendered = callback;\r\n\t\t}\r\n\r\n\t\tif(!cell.column.modules.edit.blocked){\r\n\t\t\tif(e){\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t}\r\n\r\n\t\t\tswitch(typeof cell.column.modules.edit.check){\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tallowEdit = cell.column.modules.edit.check(cell.getComponent());\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\tallowEdit = cell.column.modules.edit.check;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(allowEdit || forceEdit){\r\n\r\n\t\t\t\tself.cancelEdit();\r\n\r\n\t\t\t\tself.currentCell = cell;\r\n\r\n\t\t\t\tthis.focusScrollAdjust(cell);\r\n\r\n\t\t\t\tcomponent = cell.getComponent();\r\n\r\n\t\t\t\tif(this.mouseClick){\r\n\t\t\t\t\tthis.mouseClick = false;\r\n\r\n\t\t\t\t\tif(cell.column.definition.cellClick){\r\n\t\t\t\t\t\tcell.column.definition.cellClick.call(this.table, e, component);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(cell.column.definition.cellEditing){\r\n\t\t\t\t\tcell.column.definition.cellEditing.call(this.table, component);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.dispatch(\"cell-editing\", cell);\r\n\t\t\t\tthis.dispatchExternal(\"cellEditing\", component);\r\n\r\n\t\t\t\tparams = typeof cell.column.modules.edit.params === \"function\" ? cell.column.modules.edit.params(component) : cell.column.modules.edit.params;\r\n\r\n\t\t\t\tcellEditor = cell.column.modules.edit.editor.call(self, component, onRendered, success, cancel, params);\r\n\r\n\t\t\t\t//if editor returned, add to DOM, if false, abort edit\r\n\t\t\t\tif(cellEditor !== false){\r\n\r\n\t\t\t\t\tif(cellEditor instanceof Node){\r\n\t\t\t\t\t\telement.classList.add(\"tabulator-editing\");\r\n\t\t\t\t\t\tcell.row.getElement().classList.add(\"tabulator-row-editing\");\r\n\t\t\t\t\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\t\t\t\t\telement.appendChild(cellEditor);\r\n\r\n\t\t\t\t\t\t//trigger onRendered Callback\r\n\t\t\t\t\t\trendered();\r\n\r\n\t\t\t\t\t\t//prevent editing from triggering rowClick event\r\n\t\t\t\t\t\tvar children = element.children;\r\n\r\n\t\t\t\t\t\tfor (var i = 0; i < children.length; i++) {\r\n\t\t\t\t\t\t\tchildren[i].addEventListener(\"click\", function(e){\r\n\t\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Edit Error - Editor should return an instance of Node, the editor returned:\", cellEditor);\r\n\t\t\t\t\t\telement.blur();\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.blur();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tthis.mouseClick = false;\r\n\t\t\t\telement.blur();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.mouseClick = false;\r\n\t\t\telement.blur();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tgetEditedCells(){\r\n\t\tvar output = [];\r\n\r\n\t\tthis.editedCells.forEach((cell) => {\r\n\t\t\toutput.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tclearEdited(cell){\r\n\t\tvar editIndex;\r\n\r\n\t\tif(cell.modules.edit && cell.modules.edit.edited){\r\n\t\t\tcell.modules.edit.edited = false;\r\n\r\n\t\t\tthis.dispatch(\"edit-edited-clear\", cell);\r\n\t\t}\r\n\r\n\t\teditIndex = this.editedCells.indexOf(cell);\r\n\r\n\t\tif(editIndex > -1){\r\n\t\t\tthis.editedCells.splice(editIndex, 1);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nEdit.moduleName = \"edit\";\r\n\r\n//load defaults\r\nEdit.editors = defaultEditors;\r\n\r\n\r\nexport default Edit;\r\n","class ExportRow{\r\n\tconstructor(type, columns, component, indent){\r\n\t\tthis.type = type;\r\n\t\tthis.columns = columns;\r\n\t\tthis.component = component || false;\r\n\t\tthis.indent = indent || 0;\r\n\t}\r\n}\r\n\r\nexport default ExportRow;","class ExportColumn{\r\n\tconstructor(value, component, width, height, depth){\r\n\t\tthis.value = value;\r\n\t\tthis.component = component || false;\r\n\t\tthis.width = width;\r\n\t\tthis.height = height;\r\n\t\tthis.depth = depth;\r\n\t}\r\n}\r\n\r\nexport default ExportColumn;","import Module from '../../core/Module.js';\r\n\r\nimport ExportRow from './ExportRow.js';\r\nimport ExportColumn from './ExportColumn.js';\r\n\r\nclass Export extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.config = {};\r\n\t\tthis.cloneTableStyle = true;\r\n\t\tthis.colVisProp = \"\";\r\n\r\n\t\tthis.registerTableOption(\"htmlOutputConfig\", false); //html outypu config\r\n\r\n\t\tthis.registerColumnOption(\"htmlOutput\");\r\n\t\tthis.registerColumnOption(\"titleHtmlOutput\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"getHtml\", this.getHtml.bind(this));\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tgenerateExportList(config, style, range, colVisProp){\r\n\t\tthis.cloneTableStyle = style;\r\n\t\tthis.config = config || {};\r\n\t\tthis.colVisProp = colVisProp;\r\n\r\n\t\tvar headers = this.config.columnHeaders !== false ? this.headersToExportRows(this.generateColumnGroupHeaders()) : [];\r\n\t\tvar body = this.bodyToExportRows(this.rowLookup(range));\r\n\r\n\t\treturn headers.concat(body);\r\n\t}\r\n\r\n\tgenereateTable(config, style, range, colVisProp){\r\n\t\tvar list = this.generateExportList(config, style, range, colVisProp);\r\n\r\n\t\treturn this.genereateTableElement(list);\r\n\t}\r\n\r\n\trowLookup(range){\r\n\t\tvar rows = [];\r\n\r\n\t\tif(typeof range == \"function\"){\r\n\t\t\trange.call(this.table).forEach((row) =>{\r\n\t\t\t\trow = this.table.rowManager.findRow(row);\r\n\r\n\t\t\t\tif(row){\r\n\t\t\t\t\trows.push(row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tswitch(range){\r\n\t\t\t\tcase true:\r\n\t\t\t\tcase \"visible\":\r\n\t\t\t\trows = this.table.rowManager.getVisibleRows(false, true);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"all\":\r\n\t\t\t\trows = this.table.rowManager.rows;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"selected\":\r\n\t\t\t\trows = this.table.modules.selectRow.selectedRows;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"active\":\r\n\t\t\t\tdefault:\r\n\t\t\t\tif(this.table.options.pagination){\r\n\t\t\t\t\trows = this.table.rowManager.getDisplayRows(this.table.rowManager.displayRows.length - 2);\r\n\t\t\t\t}else{\r\n\t\t\t\t\trows = this.table.rowManager.getDisplayRows();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Object.assign([], rows);\r\n\t}\r\n\r\n\tgenerateColumnGroupHeaders(){\r\n\t\tvar output = [];\r\n\r\n\t\tvar columns = this.config.columnGroups !== false ? this.table.columnManager.columns : this.table.columnManager.columnsByIndex;\r\n\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\tvar colData = this.processColumnGroup(column);\r\n\r\n\t\t\tif(colData){\r\n\t\t\t\toutput.push(colData);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tprocessColumnGroup(column){\r\n\t\tvar subGroups = column.columns,\r\n\t\tmaxDepth = 0,\r\n\t\ttitle = column.definition[\"title\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))] || column.definition.title;\r\n\r\n\t\tvar groupData = {\r\n\t\t\ttitle:title,\r\n\t\t\tcolumn:column,\r\n\t\t\tdepth:1,\r\n\t\t};\r\n\r\n\t\tif(subGroups.length){\r\n\t\t\tgroupData.subGroups = [];\r\n\t\t\tgroupData.width = 0;\r\n\r\n\t\t\tsubGroups.forEach((subGroup) => {\r\n\t\t\t\tvar subGroupData = this.processColumnGroup(subGroup);\r\n\r\n\t\t\t\tif(subGroupData){\r\n\t\t\t\t\tgroupData.width += subGroupData.width;\r\n\t\t\t\t\tgroupData.subGroups.push(subGroupData);\r\n\r\n\t\t\t\t\tif(subGroupData.depth > maxDepth){\r\n\t\t\t\t\t\tmaxDepth = subGroupData.depth;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tgroupData.depth += maxDepth;\r\n\r\n\t\t\tif(!groupData.width){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.columnVisCheck(column)){\r\n\t\t\t\tgroupData.width = 1;\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn groupData;\r\n\t}\r\n\r\n\tcolumnVisCheck(column){\r\n\t\treturn column.definition[this.colVisProp] !== false && (column.visible || (!column.visible && column.definition[this.colVisProp]));\r\n\t}\r\n\r\n\theadersToExportRows(columns){\r\n\t\tvar headers = [],\r\n\t\theaderDepth = 0,\r\n\t\texportRows = [];\r\n\r\n\t\tfunction parseColumnGroup(column, level){\r\n\r\n\t\t\tvar depth = headerDepth - level;\r\n\r\n\t\t\tif(typeof headers[level] === \"undefined\"){\r\n\t\t\t\theaders[level] = [];\r\n\t\t\t}\r\n\r\n\t\t\tcolumn.height = column.subGroups ? 1 : (depth - column.depth) + 1;\r\n\r\n\t\t\theaders[level].push(column);\r\n\r\n\t\t\tif(column.height > 1){\r\n\t\t\t\tfor(let i = 1; i < column.height; i ++){\r\n\r\n\t\t\t\t\tif(typeof headers[level + i] === \"undefined\"){\r\n\t\t\t\t\t\theaders[level + i] = [];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\theaders[level + i].push(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(column.width > 1){\r\n\t\t\t\tfor(let i = 1; i < column.width; i ++){\r\n\t\t\t\t\theaders[level].push(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(column.subGroups){\r\n\t\t\t\tcolumn.subGroups.forEach(function(subGroup){\r\n\t\t\t\t\tparseColumnGroup(subGroup, level+1);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//calculate maximum header debth\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tif(column.depth > headerDepth){\r\n\t\t\t\theaderDepth = column.depth;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tparseColumnGroup(column,0);\r\n\t\t});\r\n\r\n\t\theaders.forEach((header) => {\r\n\t\t\tvar columns = [];\r\n\r\n\t\t\theader.forEach((col) => {\r\n\t\t\t\tif(col){\r\n\t\t\t\t\tlet title = typeof col.title === \"undefined\" ? \"\" : col.title;\r\n\t\t\t\t\tcolumns.push(new ExportColumn(title, col.column.getComponent(), col.width, col.height, col.depth));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolumns.push(null);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\texportRows.push(new ExportRow(\"header\", columns));\r\n\t\t});\r\n\r\n\t\treturn exportRows;\r\n\t}\r\n\r\n\tbodyToExportRows(rows){\r\n\r\n\t\tvar columns = [];\r\n\t\tvar exportRows = [];\r\n\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tif (this.columnVisCheck(column)) {\r\n\t\t\t\tcolumns.push(column.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(this.config.columnCalcs !== false && this.table.modExists(\"columnCalcs\")){\r\n\t\t\tif(this.table.modules.columnCalcs.topInitialized){\r\n\t\t\t\trows.unshift(this.table.modules.columnCalcs.topRow);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modules.columnCalcs.botInitialized){\r\n\t\t\t\trows.push(this.table.modules.columnCalcs.botRow);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\trows = rows.filter((row) => {\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\treturn this.config.rowGroups !== false;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"calc\":\r\n\t\t\t\treturn this.config.columnCalcs !== false;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"row\":\r\n\t\t\t\treturn !(this.table.options.dataTree && this.config.dataTree === false && row.modules.dataTree.parent);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\trows.forEach((row, i) => {\r\n\t\t\tvar rowData = row.getData(this.colVisProp);\r\n\t\t\tvar exportCols = [];\r\n\t\t\tvar indent = 0;\r\n\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\tindent = row.level;\r\n\t\t\t\texportCols.push(new ExportColumn(row.key, row.getComponent(), columns.length, 1));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"calc\" :\r\n\t\t\t\tcase \"row\" :\r\n\t\t\t\tcolumns.forEach((col) => {\r\n\t\t\t\t\texportCols.push(new ExportColumn(col._column.getFieldValue(rowData), col, 1, 1));\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(this.table.options.dataTree && this.config.dataTree !== false){\r\n\t\t\t\t\tindent = row.modules.dataTree.index;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\texportRows.push(new ExportRow(row.type, exportCols, row.getComponent(), indent));\r\n\t\t});\r\n\r\n\t\treturn exportRows;\r\n\t}\r\n\r\n\tgenereateTableElement(list){\r\n\t\tvar table = document.createElement(\"table\"),\r\n\t\theaderEl = document.createElement(\"thead\"),\r\n\t\tbodyEl = document.createElement(\"tbody\"),\r\n\t\tstyles = this.lookupTableStyles(),\r\n\t\trowFormatter = this.table.options[\"rowFormatter\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))],\r\n\t\tsetup = {};\r\n\r\n\t\tsetup.rowFormatter = rowFormatter !== null ? rowFormatter : this.table.options.rowFormatter;\r\n\r\n\t\tif(this.table.options.dataTree &&this.config.dataTree !== false && this.table.modExists(\"columnCalcs\")){\r\n\t\t\tsetup.treeElementField = this.table.modules.dataTree.elementField;\r\n\t\t}\r\n\r\n\t\t//assign group header formatter\r\n\t\tsetup.groupHeader = this.table.options[\"groupHeader\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))];\r\n\r\n\t\tif(setup.groupHeader && !Array.isArray(setup.groupHeader)){\r\n\t\t\tsetup.groupHeader = [setup.groupHeader];\r\n\t\t}\r\n\r\n\t\ttable.classList.add(\"tabulator-print-table\");\r\n\r\n\t\tthis.mapElementStyles(this.table.columnManager.getHeadersElement(), headerEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"background-color\", \"color\", \"font-weight\", \"font-family\", \"font-size\"]);\r\n\r\n\r\n\t\tif(list.length > 1000){\r\n\t\t\tconsole.warn(\"It may take a long time to render an HTML table with more than 1000 rows\");\r\n\t\t}\r\n\r\n\t\tlist.forEach((row, i) => {\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"header\":\r\n\t\t\t\theaderEl.appendChild(this.genereateHeaderElement(row, setup, styles));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\tbodyEl.appendChild(this.genereateGroupElement(row, setup, styles));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"calc\":\r\n\t\t\t\tbodyEl.appendChild(this.genereateCalcElement(row, setup, styles));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"row\":\r\n\t\t\t\tlet rowEl = this.genereateRowElement(row, setup, styles);\r\n\t\t\t\tthis.mapElementStyles(((i % 2) && styles.evenRow) ? styles.evenRow : styles.oddRow, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\t\t\t\tbodyEl.appendChild(rowEl);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(headerEl.innerHTML){\r\n\t\t\ttable.appendChild(headerEl);\r\n\t\t}\r\n\r\n\t\ttable.appendChild(bodyEl);\r\n\r\n\r\n\t\tthis.mapElementStyles(this.table.element, table, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\"]);\r\n\t\treturn table;\r\n\t}\r\n\r\n\tlookupTableStyles(){\r\n\t\tvar styles = {};\r\n\r\n\t\t//lookup row styles\r\n\t\tif(this.cloneTableStyle && window.getComputedStyle){\r\n\t\t\tstyles.oddRow = this.table.element.querySelector(\".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.evenRow = this.table.element.querySelector(\".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.calcRow = this.table.element.querySelector(\".tabulator-row.tabulator-calcs\");\r\n\t\t\tstyles.firstRow = this.table.element.querySelector(\".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.firstGroup = this.table.element.getElementsByClassName(\"tabulator-group\")[0];\r\n\r\n\t\t\tif(styles.firstRow){\r\n\t\t\t\tstyles.styleCells = styles.firstRow.getElementsByClassName(\"tabulator-cell\");\r\n\t\t\t\tstyles.firstCell = styles.styleCells[0];\r\n\t\t\t\tstyles.lastCell = styles.styleCells[styles.styleCells.length - 1];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn styles;\r\n\t}\r\n\r\n\tgenereateHeaderElement(row, setup, styles){\r\n\t\tvar rowEl = document.createElement(\"tr\");\r\n\r\n\t\trow.columns.forEach((column) => {\r\n\t\t\tif(column){\r\n\t\t\t\tvar cellEl = document.createElement(\"th\");\r\n\t\t\t\tvar classNames = column.component._column.definition.cssClass ? column.component._column.definition.cssClass.split(\" \") : [];\r\n\r\n\t\t\t\tcellEl.colSpan = column.width;\r\n\t\t\t\tcellEl.rowSpan = column.height;\r\n\r\n\t\t\t\tcellEl.innerHTML = column.value;\r\n\r\n\t\t\t\tif(this.cloneTableStyle){\r\n\t\t\t\t\tcellEl.style.boxSizing = \"border-box\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\tclassNames.forEach(function(className) {\r\n\t\t\t\t\tcellEl.classList.add(className);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.mapElementStyles(column.component.getElement(), cellEl, [\"text-align\", \"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"background-color\", \"color\", \"font-weight\", \"font-family\", \"font-size\"]);\r\n\t\t\t\tthis.mapElementStyles(column.component._column.contentElement, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\"]);\r\n\r\n\t\t\t\tif(column.component._column.visible){\r\n\t\t\t\t\tthis.mapElementStyles(column.component.getElement(), cellEl, [\"width\"]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(column.component._column.definition.width){\r\n\t\t\t\t\t\tcellEl.style.width = column.component._column.definition.width + \"px\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(column.component._column.parent){\r\n\t\t\t\t\tthis.mapElementStyles(column.component._column.parent.groupElement, cellEl, [\"border-top\"]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowEl.appendChild(cellEl);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenereateGroupElement(row, setup, styles){\r\n\r\n\t\tvar rowEl = document.createElement(\"tr\"),\r\n\t\tcellEl = document.createElement(\"td\"),\r\n\t\tgroup = row.columns[0];\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-row\");\r\n\r\n\t\tif(setup.groupHeader && setup.groupHeader[row.indent]){\r\n\t\t\tgroup.value = setup.groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t}else{\r\n\t\t\tif(setup.groupHeader === false){\r\n\t\t\t\tgroup.value = group.value;\r\n\t\t\t}else{\r\n\t\t\t\tgroup.value = row.component._group.generator(group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcellEl.colSpan = group.width;\r\n\t\tcellEl.innerHTML = group.value;\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-group\");\r\n\t\trowEl.classList.add(\"tabulator-group-level-\" + row.indent);\r\n\r\n\t\tif(group.component.isVisible()){\r\n\t\t\trowEl.classList.add(\"tabulator-group-visible\");\r\n\t\t}\r\n\r\n\t\tthis.mapElementStyles(styles.firstGroup, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\t\tthis.mapElementStyles(styles.firstGroup, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\"]);\r\n\r\n\t\trowEl.appendChild(cellEl);\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenereateCalcElement(row, setup, styles){\r\n\t\tvar rowEl = this.genereateRowElement(row, setup, styles);\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-calcs\");\r\n\t\tthis.mapElementStyles(styles.calcRow, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenereateRowElement(row, setup, styles){\r\n\t\tvar rowEl = document.createElement(\"tr\");\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-row\");\r\n\r\n\t\trow.columns.forEach((col) => {\r\n\t\t\tif(col){\r\n\t\t\t\tvar cellEl = document.createElement(\"td\"),\r\n\t\t\t\tcolumn = col.component._column,\r\n\t\t\t\tindex = this.table.columnManager.findColumnIndex(column),\r\n\t\t\t\tvalue = col.value;\r\n\r\n\t\t\t\tvar cellWrapper = {\r\n\t\t\t\t\tmodules:{},\r\n\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetField:function(){\r\n\t\t\t\t\t\treturn column.definition.field;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\treturn cellEl;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetData:function(){\r\n\t\t\t\t\t\treturn row.component.getData();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\treturn row.component;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetComponent:function(){\r\n\t\t\t\t\t\treturn cellWrapper;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tcolumn:column,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tvar classNames = column.definition.cssClass ? column.definition.cssClass.split(\" \") : [];\r\n\r\n\t\t\t\tclassNames.forEach(function(className) {\r\n\t\t\t\t\tcellEl.classList.add(className);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(this.table.modExists(\"format\") && this.config.formatCells !== false){\r\n\t\t\t\t\tvalue = this.table.modules.format.formatExportValue(cellWrapper, this.colVisProp);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\tvalue = JSON.stringify(value);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\tcase \"null\":\r\n\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tvalue = value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(value instanceof Node){\r\n\t\t\t\t\tcellEl.appendChild(value);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcellEl.innerHTML = value;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(styles.styleCells[index] || styles.firstCell){\r\n\t\t\t\t\tthis.mapElementStyles(styles.styleCells[index] || styles.firstCell, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\", \"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"text-align\"]);\r\n\r\n\t\t\t\t\tif(column.definition.align){\r\n\t\t\t\t\t\tcellEl.style.textAlign = column.definition.align;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(this.table.options.dataTree && this.config.dataTree !== false){\r\n\t\t\t\t\tif((setup.treeElementField && setup.treeElementField == column.field) || (!setup.treeElementField && i == 0)){\r\n\t\t\t\t\t\tif(row.component._row.modules.dataTree.controlEl){\r\n\t\t\t\t\t\t\tcellEl.insertBefore(row.component._row.modules.dataTree.controlEl.cloneNode(true), cellEl.firstChild);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(row.component._row.modules.dataTree.branchEl){\r\n\t\t\t\t\t\t\tcellEl.insertBefore(row.component._row.modules.dataTree.branchEl.cloneNode(true), cellEl.firstChild);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowEl.appendChild(cellEl);\r\n\r\n\t\t\t\tif(cellWrapper.modules.format && cellWrapper.modules.format.renderedCallback){\r\n\t\t\t\t\tcellWrapper.modules.format.renderedCallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(setup.rowFormatter && this.config.formatCells !== false){\r\n\t\t\t\t\tsetup.rowFormatter(row.component);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenereateHTMLTable(list){\r\n\t\tvar holder = document.createElement(\"div\");\r\n\r\n\t\tholder.appendChild(this.genereateTableElement(list));\r\n\r\n\t\treturn holder.innerHTML;\r\n\t}\r\n\r\n\tgetHtml(visible, style, config, colVisProp){\r\n\t\tvar list = this.generateExportList(config || this.table.options.htmlOutputConfig, style, visible, colVisProp || \"htmlOutput\");\r\n\r\n\t\treturn this.genereateHTMLTable(list);\r\n\t}\r\n\r\n\tmapElementStyles(from, to, props){\r\n\t\tif(this.cloneTableStyle && from && to){\r\n\r\n\t\t\tvar lookup = {\r\n\t\t\t\t\"background-color\" : \"backgroundColor\",\r\n\t\t\t\t\"color\" : \"fontColor\",\r\n\t\t\t\t\"width\" : \"width\",\r\n\t\t\t\t\"font-weight\" : \"fontWeight\",\r\n\t\t\t\t\"font-family\" : \"fontFamily\",\r\n\t\t\t\t\"font-size\" : \"fontSize\",\r\n\t\t\t\t\"text-align\" : \"textAlign\",\r\n\t\t\t\t\"border-top\" : \"borderTop\",\r\n\t\t\t\t\"border-left\" : \"borderLeft\",\r\n\t\t\t\t\"border-right\" : \"borderRight\",\r\n\t\t\t\t\"border-bottom\" : \"borderBottom\",\r\n\t\t\t\t\"padding-top\" : \"paddingTop\",\r\n\t\t\t\t\"padding-left\" : \"paddingLeft\",\r\n\t\t\t\t\"padding-right\" : \"paddingRight\",\r\n\t\t\t\t\"padding-bottom\" : \"paddingBottom\",\r\n\t\t\t};\r\n\r\n\t\t\tif(window.getComputedStyle){\r\n\t\t\t\tvar fromStyle = window.getComputedStyle(from);\r\n\r\n\t\t\t\tprops.forEach(function(prop){\r\n\t\t\t\t\tto.style[lookup[prop]] = fromStyle.getPropertyValue(prop);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nExport.moduleName = \"export\";\r\n\r\nexport default Export;\r\n","export default {\r\n\r\n\t//equal to\r\n\t\"=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal == filterVal ? true : false;\r\n\t},\r\n\r\n\t//less than\r\n\t\"<\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal < filterVal ? true : false;\r\n\t},\r\n\r\n\t//less than or equal to\r\n\t\"<=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal <= filterVal ? true : false;\r\n\t},\r\n\r\n\t//greater than\r\n\t\">\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal > filterVal ? true : false;\r\n\t},\r\n\r\n\t//greater than or equal to\r\n\t\">=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal >= filterVal ? true : false;\r\n\t},\r\n\r\n\t//not equal to\r\n\t\"!=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal != filterVal ? true : false;\r\n\t},\r\n\r\n\t\"regex\":function(filterVal, rowVal, rowData, filterParams){\r\n\r\n\t\tif(typeof filterVal == \"string\"){\r\n\t\t\tfilterVal = new RegExp(filterVal);\r\n\t\t}\r\n\r\n\t\treturn filterVal.test(rowVal);\r\n\t},\r\n\r\n\t//contains the string\r\n\t\"like\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().indexOf(filterVal.toLowerCase()) > -1;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//contains the keywords\r\n\t\"keywords\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tvar keywords = filterVal.toLowerCase().split(typeof filterParams.separator === \"undefined\" ? \" \" : filterParams.separator),\r\n\t\tvalue = String(rowVal === null || typeof rowVal === \"undefined\" ? \"\" : rowVal).toLowerCase(),\r\n\t\tmatches = [];\r\n\r\n\t\tkeywords.forEach((keyword) =>{\r\n\t\t\tif(value.includes(keyword)){\r\n\t\t\t\tmatches.push(true);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn filterParams.matchAll ? matches.length === keywords.length : !!matches.length;\r\n\t},\r\n\r\n\t//starts with the string\r\n\t\"starts\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().startsWith(filterVal.toLowerCase());\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//ends with the string\r\n\t\"ends\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().endsWith(filterVal.toLowerCase());\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//in array\r\n\t\"in\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(Array.isArray(filterVal)){\r\n\t\t\treturn filterVal.length ? filterVal.indexOf(rowVal) > -1 : true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Filter Error - filter value is not an array:\", filterVal);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultFilters from './defaults/filters.js';\r\n\r\nclass Filter extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.filterList = []; //hold filter list\r\n\t\tthis.headerFilters = {}; //hold column filters\r\n\t\tthis.headerFilterColumns = []; //hold columns that use header filters\r\n\r\n\t\tthis.prevHeaderFilterChangeCheck = \"\";\r\n\t\tthis.prevHeaderFilterChangeCheck = \"{}\";\r\n\r\n\t\tthis.changed = false; //has filtering changed since last render\r\n\t\tthis.tableInitialized = false;\r\n\r\n\t\tthis.registerTableOption(\"filterMode\", \"local\"); //local or remote filtering\r\n\r\n\t\tthis.registerTableOption(\"initialFilter\", false); //initial filtering criteria\r\n\t\tthis.registerTableOption(\"initialHeaderFilter\", false); //initial header filtering criteria\r\n\t\tthis.registerTableOption(\"headerFilterLiveFilterDelay\", 300); //delay before updating column after user types in header filter\r\n\r\n\t\tthis.registerColumnOption(\"headerFilter\");\r\n\t\tthis.registerColumnOption(\"headerFilterPlaceholder\");\r\n\t\tthis.registerColumnOption(\"headerFilterParams\");\r\n\t\tthis.registerColumnOption(\"headerFilterEmptyCheck\");\r\n\t\tthis.registerColumnOption(\"headerFilterFunc\");\r\n\t\tthis.registerColumnOption(\"headerFilterFuncParams\");\r\n\t\tthis.registerColumnOption(\"headerFilterLiveFilter\");\r\n\r\n\t\tthis.registerTableFunction(\"searchRows\", this.searchRows.bind(this));\r\n\t\tthis.registerTableFunction(\"searchData\", this.searchData.bind(this));\r\n\r\n\t\tthis.registerTableFunction(\"setFilter\", this.userSetFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"refreshFilter\", this.userRefreshFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"addFilter\", this.userAddFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"getFilters\", this.getFilters.bind(this));\r\n\t\tthis.registerTableFunction(\"setHeaderFilterFocus\", this.userSetHeaderFilterFocus.bind(this));\r\n\t\tthis.registerTableFunction(\"getHeaderFilterValue\", this.userGetHeaderFilterValue.bind(this));\r\n\t\tthis.registerTableFunction(\"setHeaderFilterValue\", this.userSetHeaderFilterValue.bind(this));\r\n\t\tthis.registerTableFunction(\"getHeaderFilters\", this.getHeaderFilters.bind(this));\r\n\t\tthis.registerTableFunction(\"removeFilter\", this.userRemoveFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"clearFilter\", this.userClearFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"clearHeaderFilter\", this.userClearHeaderFilter.bind(this));\r\n\r\n\t\tthis.registerComponentFunction(\"column\", \"headerFilterFocus\", this.setHeaderFilterFocus.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"reloadHeaderFilter\", this.reloadHeaderFilter.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"getHeaderFilterValue\", this.getHeaderFilterValue.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"setHeaderFilterValue\", this.setHeaderFilterValue.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumnHeaderFilter.bind(this));\r\n\t\tthis.subscribe(\"column-width-fit-before\", this.hideHeaderFilterElements.bind(this));\r\n\t\tthis.subscribe(\"column-width-fit-after\", this.showHeaderFilterElements.bind(this));\r\n\t\tthis.subscribe(\"table-built\", this.tableBuilt.bind(this));\r\n\r\n\t\tif(this.table.options.filterMode === \"remote\"){\r\n\t\t\tthis.subscribe(\"data-params\", this.remoteFilterParams.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerDataHandler(this.filter.bind(this), 10);\r\n\t}\r\n\r\n\ttableBuilt(){\r\n\t\tif(this.table.options.initialFilter){\r\n\t\t\tthis.setFilter(this.table.options.initialFilter);\r\n\t\t}\r\n\r\n\t\tif(this.table.options.initialHeaderFilter){\r\n\t\t\tthis.table.options.initialHeaderFilter.forEach((item) => {\r\n\r\n\t\t\t\tvar column = this.table.columnManager.findColumn(item.field);\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tthis.setHeaderFilterValue(column, item.value);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", item.field);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.tableInitialized = true;\r\n\t}\r\n\r\n\tremoteFilterParams(data, config, silent, params){\r\n\t\tparams.filter = this.getFilters(true, true);\r\n\t\treturn params;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\t//set standard filters\r\n\tuserSetFilter(field, type, value, params){\r\n\t\tthis.setFilter(field, type, value, params);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//set standard filters\r\n\tuserRefreshFilter(){\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//add filter to array\r\n\tuserAddFilter(field, type, value, params){\r\n\t\tthis.addFilter(field, type, value, params);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\tuserSetHeaderFilterFocus(field){\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\tthis.setHeaderFilterFocus(column);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Focus Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tuserGetHeaderFilterValue(field) {\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\treturn this.getHeaderFilterValue(column);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", field);\r\n\t\t}\r\n\t}\r\n\r\n\tuserSetHeaderFilterValue(field, value){\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\tthis.setHeaderFilterValue(column, value);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//remove filter from array\r\n\tuserRemoveFilter(field, type, value){\r\n\t\tthis.removeFilter(field, type, value);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//clear filters\r\n\tuserClearFilter(all){\r\n\t\tthis.clearFilter(all);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//clear header filters\r\n\tuserClearHeaderFilter(){\r\n\t\tthis.clearHeaderFilter();\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\r\n\t//search for specific row components\r\n\tsearchRows(field, type, value){\r\n\t\treturn this.search(\"rows\", field, type, value);\r\n\t}\r\n\r\n\t//search for specific data\r\n\tsearchData(field, type, value){\r\n\t\treturn this.search(\"data\", field, type, value);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tinitializeColumnHeaderFilter(column){\r\n\t\tvar def = column.definition;\r\n\r\n\t\tif(def.headerFilter){\r\n\r\n\t\t\tif(typeof def.headerFilterPlaceholder !== \"undefined\" && def.field){\r\n\t\t\t\tthis.module(\"localize\").setHeaderFilterColumnPlaceholder(def.field, def.headerFilterPlaceholder);\r\n\t\t\t}\r\n\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\r\n\t//initialize column header filter\r\n\tinitializeColumn(column, value){\r\n\t\tvar self = this,\r\n\t\tfield = column.getField(),\r\n\t\tparams;\r\n\r\n\t\t//handle successfull value change\r\n\t\tfunction success(value){\r\n\t\t\tvar filterType = (column.modules.filter.tagType == \"input\" && column.modules.filter.attrType == \"text\") || column.modules.filter.tagType == \"textarea\" ? \"partial\" : \"match\",\r\n\t\t\ttype = \"\",\r\n\t\t\tfilterChangeCheck = \"\",\r\n\t\t\tfilterFunc;\r\n\r\n\t\t\tif(typeof column.modules.filter.prevSuccess === \"undefined\" || column.modules.filter.prevSuccess !== value){\r\n\r\n\t\t\t\tcolumn.modules.filter.prevSuccess = value;\r\n\r\n\t\t\t\tif(!column.modules.filter.emptyFunc(value)){\r\n\t\t\t\t\tcolumn.modules.filter.value = value;\r\n\r\n\t\t\t\t\tswitch(typeof column.definition.headerFilterFunc){\r\n\t\t\t\t\t\tcase \"string\":\r\n\t\t\t\t\t\tif(Filter.filters[column.definition.headerFilterFunc]){\r\n\t\t\t\t\t\t\ttype = column.definition.headerFilterFunc;\r\n\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\tvar params = column.definition.headerFilterFuncParams || {};\r\n\t\t\t\t\t\t\t\tvar fieldVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\t\tparams = typeof params === \"function\" ? params(value, fieldVal, data) : params;\r\n\r\n\t\t\t\t\t\t\t\treturn Filter.filters[column.definition.headerFilterFunc](value, fieldVal, data, params);\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tconsole.warn(\"Header Filter Error - Matching filter function not found: \", column.definition.headerFilterFunc);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"function\":\r\n\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\tvar params = column.definition.headerFilterFuncParams || {};\r\n\t\t\t\t\t\t\tvar fieldVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\tparams = typeof params === \"function\" ? params(value, fieldVal, data) : params;\r\n\r\n\t\t\t\t\t\t\treturn column.definition.headerFilterFunc(value, fieldVal, data, params);\r\n\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\ttype = filterFunc;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(!filterFunc){\r\n\t\t\t\t\t\tswitch(filterType){\r\n\t\t\t\t\t\t\tcase \"partial\":\r\n\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\tvar colVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\t\tif(typeof colVal !== 'undefined' && colVal !== null){\r\n\t\t\t\t\t\t\t\t\treturn String(colVal).toLowerCase().indexOf(String(value).toLowerCase()) > -1;\r\n\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\ttype = \"like\";\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\treturn column.getFieldValue(data) == value;\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\ttype = \"=\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tself.headerFilters[field] = {value:value, func:filterFunc, type:type, params:params || {}};\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdelete self.headerFilters[field];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcolumn.modules.filter.value = value;\r\n\r\n\t\t\t\tfilterChangeCheck = JSON.stringify(self.headerFilters);\r\n\r\n\t\t\t\tif(self.prevHeaderFilterChangeCheck !== filterChangeCheck){\r\n\t\t\t\t\tself.prevHeaderFilterChangeCheck = filterChangeCheck;\r\n\r\n\t\t\t\t\tself.trackChanges();\r\n\t\t\t\t\tself.refreshFilter();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tcolumn.modules.filter = {\r\n\t\t\tsuccess:success,\r\n\t\t\tattrType:false,\r\n\t\t\ttagType:false,\r\n\t\t\temptyFunc:false,\r\n\t\t};\r\n\r\n\t\tthis.generateHeaderFilterElement(column);\r\n\t}\r\n\r\n\tgenerateHeaderFilterElement(column, initialValue, reinitialize){\r\n\t\tvar self = this,\r\n\t\tsuccess = column.modules.filter.success,\r\n\t\tfield = column.getField(),\r\n\t\tfilterElement, editor, editorElement, cellWrapper, typingTimer, searchTrigger, params;\r\n\r\n\t\tcolumn.modules.filter.value = initialValue;\r\n\r\n\t\t//handle aborted edit\r\n\t\tfunction cancel(){}\r\n\r\n\t\tif(column.modules.filter.headerElement && column.modules.filter.headerElement.parentNode){\r\n\t\t\tcolumn.contentElement.removeChild(column.modules.filter.headerElement.parentNode);\r\n\t\t}\r\n\r\n\t\tif(field){\r\n\r\n\t\t\t//set empty value function\r\n\t\t\tcolumn.modules.filter.emptyFunc = column.definition.headerFilterEmptyCheck || function(value){\r\n\t\t\t\treturn !value && value !== \"0\" && value !== 0;\r\n\t\t\t};\r\n\r\n\t\t\tfilterElement = document.createElement(\"div\");\r\n\t\t\tfilterElement.classList.add(\"tabulator-header-filter\");\r\n\r\n\t\t\t//set column editor\r\n\t\t\tswitch(typeof column.definition.headerFilter){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tif(self.table.modules.edit.editors[column.definition.headerFilter]){\r\n\t\t\t\t\teditor = self.table.modules.edit.editors[column.definition.headerFilter];\r\n\r\n\t\t\t\t\tif((column.definition.headerFilter === \"tick\" || column.definition.headerFilter === \"tickCross\") && !column.definition.headerFilterEmptyCheck){\r\n\t\t\t\t\t\tcolumn.modules.filter.emptyFunc = function(value){\r\n\t\t\t\t\t\t\treturn value !== true && value !== false;\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Filter Error - Cannot build header filter, No such editor found: \", column.definition.editor);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\teditor = column.definition.headerFilter;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\tif(column.modules.edit && column.modules.edit.editor){\r\n\t\t\t\t\teditor = column.modules.edit.editor;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(column.definition.formatter && self.table.modules.edit.editors[column.definition.formatter]){\r\n\t\t\t\t\t\teditor = self.table.modules.edit.editors[column.definition.formatter];\r\n\r\n\t\t\t\t\t\tif((column.definition.formatter === \"tick\" || column.definition.formatter === \"tickCross\") && !column.definition.headerFilterEmptyCheck){\r\n\t\t\t\t\t\t\tcolumn.modules.filter.emptyFunc = function(value){\r\n\t\t\t\t\t\t\t\treturn value !== true && value !== false;\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\teditor = self.table.modules.edit.editors[\"input\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(editor){\r\n\r\n\t\t\t\tcellWrapper = {\r\n\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\treturn typeof initialValue !== \"undefined\" ? initialValue : \"\";\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetField:function(){\r\n\t\t\t\t\t\treturn column.definition.field;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\treturn filterElement;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tnormalizeHeight:function(){\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\r\n\t\t\t\tparams = column.definition.headerFilterParams || {};\r\n\r\n\t\t\t\tparams = typeof params === \"function\" ? params.call(self.table, cellWrapper) : params;\r\n\r\n\t\t\t\teditorElement = editor.call(this.table.modules.edit, cellWrapper, function(){}, success, cancel, params);\r\n\r\n\t\t\t\tif(!editorElement){\r\n\t\t\t\t\tconsole.warn(\"Filter Error - Cannot add filter to \" + field + \" column, editor returned a value of false\");\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!(editorElement instanceof Node)){\r\n\t\t\t\t\tconsole.warn(\"Filter Error - Cannot add filter to \" + field + \" column, editor should return an instance of Node, the editor returned:\", editorElement);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//set Placeholder Text\r\n\t\t\t\tif(field){\r\n\t\t\t\t\tself.langBind(\"headerFilters|columns|\" + column.definition.field, function(value){\r\n\t\t\t\t\t\teditorElement.setAttribute(\"placeholder\", typeof value !== \"undefined\" && value ? value : self.langText(\"headerFilters|default\"));\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself.langBind(\"headerFilters|default\", function(value){\r\n\t\t\t\t\t\teditorElement.setAttribute(\"placeholder\", value);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//focus on element on click\r\n\t\t\t\teditorElement.addEventListener(\"click\", function(e){\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\teditorElement.focus();\r\n\t\t\t\t});\r\n\r\n\t\t\t\teditorElement.addEventListener(\"focus\", (e) => {\r\n\t\t\t\t\tvar left = this.table.columnManager.element.scrollLeft;\r\n\r\n\t\t\t\t\tvar headerPos = this.table.rowManager.element.scrollLeft + parseInt(this.table.columnManager.element.style.marginLeft);\r\n\r\n\t\t\t\t\tif(left !== headerPos){\r\n\t\t\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\t\t\tthis.table.columnManager.scrollHorizontal(left);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\t//live update filters as user types\r\n\t\t\t\ttypingTimer = false;\r\n\r\n\t\t\t\tsearchTrigger = function(e){\r\n\t\t\t\t\tif(typingTimer){\r\n\t\t\t\t\t\tclearTimeout(typingTimer);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\ttypingTimer = setTimeout(function(){\r\n\t\t\t\t\t\tsuccess(editorElement.value);\r\n\t\t\t\t\t},self.table.options.headerFilterLiveFilterDelay);\r\n\t\t\t\t};\r\n\r\n\t\t\t\tcolumn.modules.filter.headerElement = editorElement;\r\n\t\t\t\tcolumn.modules.filter.attrType = editorElement.hasAttribute(\"type\") ? editorElement.getAttribute(\"type\").toLowerCase() : \"\" ;\r\n\t\t\t\tcolumn.modules.filter.tagType = editorElement.tagName.toLowerCase();\r\n\r\n\t\t\t\tif(column.definition.headerFilterLiveFilter !== false){\r\n\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\t!(\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === 'autocomplete' ||\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === 'tickCross' ||\r\n\t\t\t\t\t\t\t((column.definition.editor === 'autocomplete' ||\r\n\t\t\t\t\t\t\t\tcolumn.definition.editor === 'tickCross') &&\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === true)\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t) {\r\n\t\t\t\t\t\teditorElement.addEventListener(\"keyup\", searchTrigger);\r\n\t\t\t\t\teditorElement.addEventListener(\"search\", searchTrigger);\r\n\r\n\r\n\t\t\t\t\t//update number filtered columns on change\r\n\t\t\t\t\tif(column.modules.filter.attrType == \"number\"){\r\n\t\t\t\t\t\teditorElement.addEventListener(\"change\", function(e){\r\n\t\t\t\t\t\t\tsuccess(editorElement.value);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//change text inputs to search inputs to allow for clearing of field\r\n\t\t\t\t\tif(column.modules.filter.attrType == \"text\" && this.table.browser !== \"ie\"){\r\n\t\t\t\t\t\teditorElement.setAttribute(\"type\", \"search\");\r\n\t\t\t\t\t\t// editorElement.off(\"change blur\"); //prevent blur from triggering filter and preventing selection click\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t\t//prevent input and select elements from propegating click to column sorters etc\r\n\t\t\t\t\tif(column.modules.filter.tagType == \"input\" || column.modules.filter.tagType == \"select\" || column.modules.filter.tagType == \"textarea\"){\r\n\t\t\t\t\t\teditorElement.addEventListener(\"mousedown\",function(e){\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfilterElement.appendChild(editorElement);\r\n\r\n\t\t\t\tcolumn.contentElement.appendChild(filterElement);\r\n\r\n\t\t\t\tif(!reinitialize){\r\n\t\t\t\t\tself.headerFilterColumns.push(column);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Filter Error - Cannot add header filter, column has no field set:\", column.definition.title);\r\n\t\t}\r\n\t}\r\n\r\n\t//hide all header filter elements (used to ensure correct column widths in \"fitData\" layout mode)\r\n\thideHeaderFilterElements(){\r\n\t\tthis.headerFilterColumns.forEach(function(column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tcolumn.modules.filter.headerElement.style.display = 'none';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//show all header filter elements (used to ensure correct column widths in \"fitData\" layout mode)\r\n\tshowHeaderFilterElements(){\r\n\t\tthis.headerFilterColumns.forEach(function(column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tcolumn.modules.filter.headerElement.style.display = '';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//programatically set focus of header filter\r\n\tsetHeaderFilterFocus(column){\r\n\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\tcolumn.modules.filter.headerElement.focus();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Focus Error - No header filter set on column:\", column.getField());\r\n\t\t}\r\n\t}\r\n\r\n\t//programmatically get value of header filter\r\n\tgetHeaderFilterValue(column){\r\n\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\treturn column.modules.filter.value;\r\n\t\t} else {\r\n\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t}\r\n\t}\r\n\r\n\t//programatically set value of header filter\r\n\tsetHeaderFilterValue(column, value){\r\n\t\tif (column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tthis.generateHeaderFilterElement(column, value, true);\r\n\t\t\t\tcolumn.modules.filter.success(value);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treloadHeaderFilter(column){\r\n\t\tif (column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tthis.generateHeaderFilterElement(column, column.modules.filter.value, true);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trefreshFilter(){\r\n\t\tif(this.tableInitialized){\r\n\t\t\tif(this.table.options.filterMode === \"remote\"){\r\n\t\t\t\tthis.reloadData(null, false, false);\r\n\t\t\t}else{\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//TODO - Persist left position of row manager\r\n\t\t// left = this.scrollLeft;\r\n\t\t// this.scrollHorizontal(left);\r\n\t}\r\n\r\n\t//check if the filters has changed since last use\r\n\ttrackChanges(){\r\n\t\tthis.changed = true;\r\n\t\tthis.dispatch(\"filter-changed\");\r\n\t}\r\n\r\n\t//check if the filters has changed since last use\r\n\thasChanged(){\r\n\t\tvar changed = this.changed;\r\n\t\tthis.changed = false;\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t//set standard filters\r\n\tsetFilter(field, type, value, params){\r\n\t\tthis.filterList = [];\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value, params:params}];\r\n\t\t}\r\n\r\n\t\tthis.addFilter(field);\r\n\t}\r\n\r\n\t//add filter to array\r\n\taddFilter(field, type, value, params){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value, params:params}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\tthis.filterList.push(filter);\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.trackChanges();\r\n\t\t}\r\n\t}\r\n\r\n\tfindFilter(filter){\r\n\t\tvar column;\r\n\r\n\t\tif(Array.isArray(filter)){\r\n\t\t\treturn this.findSubFilters(filter);\r\n\t\t}\r\n\r\n\t\tvar filterFunc = false;\r\n\r\n\t\tif(typeof filter.field == \"function\"){\r\n\t\t\tfilterFunc = function(data){\r\n\t\t\t\treturn filter.field(data, filter.type || {})// pass params to custom filter function\r\n\t\t\t};\r\n\t\t}else{\r\n\r\n\t\t\tif(Filter.filters[filter.type]){\r\n\r\n\t\t\t\tcolumn = this.table.columnManager.getColumnByField(filter.field);\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\treturn Filter.filters[filter.type](filter.value, column.getFieldValue(data), data, filter.params || {});\r\n\t\t\t\t\t};\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\treturn Filter.filters[filter.type](filter.value, data[filter.field], data, filter.params || {});\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Filter Error - No such filter type found, ignoring: \", filter.type);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfilter.func = filterFunc;\r\n\r\n\t\treturn filter.func ? filter : false;\r\n\t}\r\n\r\n\tfindSubFilters(filters){\r\n\t\tvar output = [];\r\n\r\n\t\tfilters.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\toutput.push(filter);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output.length ? output : false;\r\n\t}\r\n\r\n\t//get all filters\r\n\tgetFilters(all, ajax){\r\n\t\tvar output = [];\r\n\r\n\t\tif(all){\r\n\t\t\toutput = this.getHeaderFilters();\r\n\t\t}\r\n\r\n\t\tif(ajax){\r\n\t\t\toutput.forEach(function(item){\r\n\t\t\t\tif(typeof item.type == \"function\"){\r\n\t\t\t\t\titem.type = \"function\";\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\toutput = output.concat(this.filtersToArray(this.filterList, ajax));\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//filter to Object\r\n\tfiltersToArray(filterList, ajax){\r\n\t\tvar output = [];\r\n\r\n\t\tfilterList.forEach((filter) => {\r\n\t\t\tvar item;\r\n\r\n\t\t\tif(Array.isArray(filter)){\r\n\t\t\t\toutput.push(this.filtersToArray(filter, ajax));\r\n\t\t\t}else{\r\n\t\t\t\titem = {field:filter.field, type:filter.type, value:filter.value}\r\n\r\n\t\t\t\tif(ajax){\r\n\t\t\t\t\tif(typeof item.type == \"function\"){\r\n\t\t\t\t\t\titem.type = \"function\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\toutput.push(item);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//get all filters\r\n\tgetHeaderFilters(){\r\n\t\tvar output = [];\r\n\r\n\t\tfor(var key in this.headerFilters){\r\n\t\t\toutput.push({field:key, type:this.headerFilters[key].type, value:this.headerFilters[key].value});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//remove filter from array\r\n\tremoveFilter(field, type, value){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tvar index = -1;\r\n\r\n\t\t\tif(typeof filter.field == \"object\"){\r\n\t\t\t\tindex = this.filterList.findIndex((element) => {\r\n\t\t\t\t\treturn filter === element;\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tindex = this.filterList.findIndex((element) => {\r\n\t\t\t\t\treturn filter.field === element.field && filter.type === element.type && filter.value === element.value;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.filterList.splice(index, 1);\r\n\t\t\t\tchanged = true;\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Filter Error - No matching filter type found, ignoring: \", filter.type);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//clear filters\r\n\tclearFilter(all){\r\n\t\tthis.filterList = [];\r\n\r\n\t\tif(all){\r\n\t\t\tthis.clearHeaderFilter();\r\n\t\t}\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//clear header filters\r\n\tclearHeaderFilter(){\r\n\t\tthis.headerFilters = {};\r\n\t\tthis.prevHeaderFilterChangeCheck = \"{}\";\r\n\r\n\t\tthis.headerFilterColumns.forEach((column) => {\r\n\t\t\tif(typeof column.modules.filter.value !== \"undefined\"){\r\n\t\t\t\tdelete column.modules.filter.value;\r\n\t\t\t}\r\n\t\t\tcolumn.modules.filter.prevSuccess = undefined;\r\n\t\t\tthis.reloadHeaderFilter(column);\r\n\t\t});\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//search data and return matching rows\r\n\tsearch (searchType, field, type, value){\r\n\t\tvar activeRows = [],\r\n\t\tfilterList = [];\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\tfilterList.push(filter);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\tvar match = true;\r\n\r\n\t\t\tfilterList.forEach((filter) => {\r\n\t\t\t\tif(!this.filterRecurse(filter, row.getData())){\r\n\t\t\t\t\tmatch = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tactiveRows.push(searchType === \"data\" ? row.getData(\"data\") : row.getComponent());\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t\treturn activeRows;\r\n\t}\r\n\r\n\t//filter row array\r\n\tfilter(rowList, filters){\r\n\t\tvar activeRows = [],\r\n\t\tactiveRowComponents = [];\r\n\r\n\t\tif(this.subscribedExternal(\"dataFiltering\")){\r\n\t\t\tthis.dispatchExternal(\"dataFiltering\", this.getFilters(true));\r\n\t\t}\r\n\r\n\t\tif(this.table.options.filterMode !== \"remote\" && (this.filterList.length || Object.keys(this.headerFilters).length)){\r\n\r\n\t\t\trowList.forEach((row) => {\r\n\t\t\t\tif(this.filterRow(row)){\r\n\t\t\t\t\tactiveRows.push(row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t}else{\r\n\t\t\tactiveRows = rowList.slice(0);\r\n\t\t}\r\n\r\n\t\tif(this.subscribedExternal(\"dataFiltered\")){\r\n\r\n\t\t\tactiveRows.forEach((row) => {\r\n\t\t\t\tactiveRowComponents.push(row.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatchExternal(\"dataFiltered\", this.getFilters(true), activeRowComponents);\r\n\t\t}\r\n\r\n\t\treturn activeRows;\r\n\t}\r\n\r\n\t//filter individual row\r\n\tfilterRow(row, filters){\r\n\t\tvar match = true,\r\n\t\tdata = row.getData();\r\n\r\n\t\tthis.filterList.forEach((filter) => {\r\n\t\t\tif(!this.filterRecurse(filter, data)){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\tfor(var field in this.headerFilters){\r\n\t\t\tif(!this.headerFilters[field].func(data)){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tfilterRecurse(filter, data){\r\n\t\tvar match = false;\r\n\r\n\t\tif(Array.isArray(filter)){\r\n\t\t\tfilter.forEach((subFilter) => {\r\n\t\t\t\tif(this.filterRecurse(subFilter, data)){\r\n\t\t\t\t\tmatch = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tmatch = filter.func(data);\r\n\t\t}\r\n\r\n\t\treturn match;\r\n\t}\r\n}\r\n\r\nFilter.moduleName = \"filter\";\r\n\r\n//load defaults\r\nFilter.filters = defaultFilters;\r\n\r\nexport default Filter;","export default function(cell, formatterParams, onRendered){\r\n\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n};","export default function(cell, formatterParams, onRendered){\r\n\treturn cell.getValue();\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().style.whiteSpace = \"pre-wrap\";\r\n\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar floatVal = parseFloat(cell.getValue()),\r\n\tsign = \"\",\r\n\tnumber, integer, decimal, rgx;\r\n\r\n\tvar decimalSym = formatterParams.decimal || \".\";\r\n\tvar thousandSym = formatterParams.thousand || \",\";\r\n\tvar negativeSign = formatterParams.negativeSign || \"-\";\r\n\tvar symbol = formatterParams.symbol || \"\";\r\n\tvar after = !!formatterParams.symbolAfter;\r\n\tvar precision = typeof formatterParams.precision !== \"undefined\" ? formatterParams.precision : 2;\r\n\r\n\tif(isNaN(floatVal)){\r\n\t\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n\t}\r\n\r\n\tif(floatVal < 0){\r\n\t\tfloatVal = Math.abs(floatVal);\r\n\t\tsign = negativeSign;\r\n\t}\r\n\r\n\tnumber = precision !== false ? floatVal.toFixed(precision) : floatVal;\r\n\tnumber = String(number).split(\".\");\r\n\r\n\tinteger = number[0];\r\n\tdecimal = number.length > 1 ? decimalSym + number[1] : \"\";\r\n\r\n\tif (formatterParams.thousand !== false) {\r\n\t\trgx = /(\\d+)(\\d{3})/;\r\n\r\n\t\twhile (rgx.test(integer)){\r\n\t\t\tinteger = integer.replace(rgx, \"$1\" + thousandSym + \"$2\");\r\n\t\t}\r\n\t}\r\n\r\n\treturn after ? sign + integer + decimal + symbol : sign + symbol + integer + decimal;\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\turlPrefix = formatterParams.urlPrefix || \"\",\r\n\tdownload = formatterParams.download,\r\n\tlabel = value,\r\n\tel = document.createElement(\"a\"),\r\n\tdata;\r\n\r\n\tfunction labelTraverse(path, data){\r\n\t\tvar item = path.shift(),\r\n\t\tvalue = data[item];\r\n\t\t\r\n\t\tif(path.length && typeof value === \"object\"){\r\n\t\t\treturn labelTraverse(path, value);\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t};\r\n\r\n\tif(formatterParams.labelField){\r\n\t\tdata = cell.getData();\r\n\t\tlabel = labelTraverse(formatterParams.labelField.split(this.table.options.nestedFieldSeparator), data);\r\n\t}\r\n\r\n\tif(formatterParams.label){\r\n\t\tswitch(typeof formatterParams.label){\r\n\t\t\tcase \"string\":\r\n\t\t\tlabel = formatterParams.label;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tlabel = formatterParams.label(cell);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif(label){\r\n\t\tif(formatterParams.urlField){\r\n\t\t\tdata = cell.getData();\r\n\t\t\tvalue = data[formatterParams.urlField];\r\n\t\t}\r\n\r\n\t\tif(formatterParams.url){\r\n\t\t\tswitch(typeof formatterParams.url){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tvalue = formatterParams.url;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tvalue = formatterParams.url(cell);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tel.setAttribute(\"href\", urlPrefix + value);\r\n\r\n\t\tif(formatterParams.target){\r\n\t\t\tel.setAttribute(\"target\", formatterParams.target);\r\n\t\t}\r\n\r\n\t\tif(formatterParams.download){\r\n\r\n\t\t\tif(typeof download == \"function\"){\r\n\t\t\t\tdownload = download(cell);\r\n\t\t\t}else{\r\n\t\t\t\tdownload = download === true ? \"\" : download;\r\n\t\t\t}\r\n\r\n\t\t\tel.setAttribute(\"download\", download);\r\n\t\t}\r\n\r\n\t\tel.innerHTML = this.emptyToSpace(this.sanitizeHTML(label));\r\n\r\n\t\treturn el;\r\n\t}else{\r\n\t\treturn \" \";\r\n\t}\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar el = document.createElement(\"img\"),\r\n\tsrc = cell.getValue();\r\n\r\n\tif(formatterParams.urlPrefix){\r\n\t\tsrc = formatterParams.urlPrefix + cell.getValue();\r\n\t}\r\n\r\n\tif(formatterParams.urlSuffix){\r\n\t\tsrc = src + formatterParams.urlSuffix;\r\n\t}\r\n\r\n\tel.setAttribute(\"src\", src);\r\n\r\n\tswitch(typeof formatterParams.height){\r\n\t\tcase \"number\":\r\n\t\tel.style.height = formatterParams.height + \"px\";\r\n\t\tbreak;\r\n\r\n\t\tcase \"string\":\r\n\t\tel.style.height = formatterParams.height;\r\n\t\tbreak;\r\n\t}\r\n\r\n\tswitch(typeof formatterParams.width){\r\n\t\tcase \"number\":\r\n\t\tel.style.width = formatterParams.width + \"px\";\r\n\t\tbreak;\r\n\r\n\t\tcase \"string\":\r\n\t\tel.style.width = formatterParams.width;\r\n\t\tbreak;\r\n\t}\r\n\r\n\tel.addEventListener(\"load\", function(){\r\n\t\tcell.getRow().normalizeHeight();\r\n\t});\r\n\r\n\treturn el;\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\telement = cell.getElement(),\r\n\tempty = formatterParams.allowEmpty,\r\n\ttruthy = formatterParams.allowTruthy,\r\n\ttrueValueSet = Object.keys(formatterParams).includes(\"trueValue\"),\r\n\ttick = typeof formatterParams.tickElement !== \"undefined\" ? formatterParams.tickElement : '',\r\n\tcross = typeof formatterParams.crossElement !== \"undefined\" ? formatterParams.crossElement : '';\r\n\r\n\tif((trueValueSet && value === formatterParams.trueValue) || (!trueValueSet && ((truthy && value) || (value === true || value === \"true\" || value === \"True\" || value === 1 || value === \"1\")))){\r\n\t\telement.setAttribute(\"aria-checked\", true);\r\n\t\treturn tick || \"\";\r\n\t}else{\r\n\t\tif(empty && (value === \"null\" || value === \"\" || value === null || typeof value === \"undefined\")){\r\n\t\t\telement.setAttribute(\"aria-checked\", \"mixed\");\r\n\t\t\treturn \"\";\r\n\t\t}else{\r\n\t\t\telement.setAttribute(\"aria-checked\", false);\r\n\t\t\treturn cross || \"\";\r\n\t\t}\r\n\t}\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar inputFormat = formatterParams.inputFormat || \"yyyy-MM-dd HH:mm:ss\";\r\n\tvar\toutputFormat = formatterParams.outputFormat || \"dd/MM/yyyy HH:mm:ss\";\r\n\tvar\tinvalid = typeof formatterParams.invalidPlaceholder !== \"undefined\" ? formatterParams.invalidPlaceholder : \"\";\r\n\tvar value = cell.getValue();\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tvar newDatetime;\r\n\r\n\t\tif(DT.isDateTime(value)){\r\n\t\t\t newDatetime = value;\r\n\t\t }else if(inputFormat === \"iso\"){\r\n\t\t\t newDatetime = DT.fromISO(String(value));\r\n\t\t }else{\r\n\t\t\t newDatetime = DT.fromFormat(String(value), inputFormat);\r\n\t\t }\r\n\r\n\t\tif(newDatetime.isValid){\r\n\t\t\tif(formatterParams.timezone){\r\n\t\t\t\tnewDatetime = newDatetime.setZone(formatterParams.timezone);\r\n\t\t\t}\r\n\r\n\t\t\treturn newDatetime.toFormat(outputFormat);\r\n\t\t}else{\r\n\t\t\tif(invalid === true || !value){\r\n\t\t\t\treturn value;\r\n\t\t\t}else if(typeof invalid === \"function\"){\r\n\t\t\t\treturn invalid(value);\r\n\t\t\t}else{\r\n\t\t\t\treturn invalid;\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tconsole.error(\"Format Error - 'datetime' formatter is dependant on luxon.js\");\r\n\t}\r\n};","export default function (cell, formatterParams, onRendered) {\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar inputFormat = formatterParams.inputFormat || \"yyyy-MM-dd HH:mm:ss\";\r\n\tvar invalid = typeof formatterParams.invalidPlaceholder !== \"undefined\" ? formatterParams.invalidPlaceholder : \"\";\r\n\tvar suffix = typeof formatterParams.suffix !== \"undefined\" ? formatterParams.suffix : false;\r\n\tvar unit = typeof formatterParams.unit !== \"undefined\" ? formatterParams.unit : \"days\";\r\n\tvar humanize = typeof formatterParams.humanize !== \"undefined\" ? formatterParams.humanize : false;\r\n\tvar date = typeof formatterParams.date !== \"undefined\" ? formatterParams.date : DT.now();\r\n\tvar value = cell.getValue();\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tvar newDatetime;\r\n\r\n\t\tif(DT.isDateTime(value)){\r\n\t\t\t newDatetime = value;\r\n\t\t }else if(inputFormat === \"iso\"){\r\n\t\t\t newDatetime = DT.fromISO(String(value));\r\n\t\t }else{\r\n\t\t\t newDatetime = DT.fromFormat(String(value), inputFormat);\r\n\t\t }\r\n\r\n\t\tif (newDatetime.isValid){\r\n\t\t\tif(humanize){\r\n\t\t\t\treturn newDatetime.diff(date, unit).toHuman() + (suffix ? \" \" + suffix : \"\");\r\n\t\t\t}else{\r\n\t\t\t\treturn parseInt(newDatetime.diff(date, unit)[unit]) + (suffix ? \" \" + suffix : \"\");\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\tif (invalid === true) {\r\n\t\t\t\treturn value;\r\n\t\t\t} else if (typeof invalid === \"function\") {\r\n\t\t\t\treturn invalid(value);\r\n\t\t\t} else {\r\n\t\t\t\treturn invalid;\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tconsole.error(\"Format Error - 'datetimediff' formatter is dependant on luxon.js\");\r\n\t}\r\n};","export default function (cell, formatterParams, onRendered) {\r\n\tvar value = cell.getValue();\r\n\r\n\tif (typeof formatterParams[value] === \"undefined\") {\r\n\t\tconsole.warn('Missing display value for ' + value);\r\n\t\treturn value;\r\n\t}\r\n\r\n\treturn formatterParams[value];\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\telement = cell.getElement(),\r\n\tmaxStars = formatterParams && formatterParams.stars ? formatterParams.stars : 5,\r\n\tstars = document.createElement(\"span\"),\r\n\tstar = document.createElementNS('http://www.w3.org/2000/svg', \"svg\"),\r\n\tstarActive = '',\r\n\tstarInactive = '';\r\n\r\n\t//style stars holder\r\n\tstars.style.verticalAlign = \"middle\";\r\n\r\n\t//style star\r\n\tstar.setAttribute(\"width\", \"14\");\r\n\tstar.setAttribute(\"height\", \"14\");\r\n\tstar.setAttribute(\"viewBox\", \"0 0 512 512\");\r\n\tstar.setAttribute(\"xml:space\", \"preserve\");\r\n\tstar.style.padding = \"0 1px\";\r\n\r\n\tvalue = value && !isNaN(value) ? parseInt(value) : 0;\r\n\r\n\tvalue = Math.max(0, Math.min(value, maxStars));\r\n\r\n\tfor(var i=1;i<= maxStars;i++){\r\n\t\tvar nextStar = star.cloneNode(true);\r\n\t\tnextStar.innerHTML = i <= value ? starActive : starInactive;\r\n\r\n\t\tstars.appendChild(nextStar);\r\n\t}\r\n\r\n\telement.style.whiteSpace = \"nowrap\";\r\n\telement.style.overflow = \"hidden\";\r\n\telement.style.textOverflow = \"ellipsis\";\r\n\r\n\telement.setAttribute(\"aria-label\", value);\r\n\r\n\treturn stars;\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar value = this.sanitizeHTML(cell.getValue()) || 0,\r\n\tel = document.createElement(\"span\"),\r\n\tmax = formatterParams && formatterParams.max ? formatterParams.max : 100,\r\n\tmin = formatterParams && formatterParams.min ? formatterParams.min : 0,\r\n\tcolors = formatterParams && typeof formatterParams.color !== \"undefined\" ? formatterParams.color : [\"red\", \"orange\", \"green\"],\r\n\tcolor = \"#666666\",\r\n\tpercent, percentValue;\r\n\r\n\tif(isNaN(value) || typeof cell.getValue() === \"undefined\"){\r\n\t\treturn;\r\n\t}\r\n\r\n\tel.classList.add(\"tabulator-traffic-light\");\r\n\r\n\t//make sure value is in range\r\n\tpercentValue = parseFloat(value) <= max ? parseFloat(value) : max;\r\n\tpercentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min;\r\n\r\n\t//workout percentage\r\n\tpercent = (max - min) / 100;\r\n\tpercentValue = Math.round((percentValue - min) / percent);\r\n\r\n\t//set color\r\n\tswitch(typeof colors){\r\n\t\tcase \"string\":\r\n\t\tcolor = colors;\r\n\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\tcolor = colors(value);\r\n\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\tif(Array.isArray(colors)){\r\n\t\t\tvar unit = 100 / colors.length;\r\n\t\t\tvar index = Math.floor(percentValue / unit);\r\n\r\n\t\t\tindex = Math.min(index, colors.length - 1);\r\n\t\t\tindex = Math.max(index, 0);\r\n\t\t\tcolor = colors[index];\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tel.style.backgroundColor = color;\r\n\r\n\treturn el;\r\n};","import CellComponent from '../../../../core/cell/CellComponent.js';\r\n\r\nexport default function(cell, formatterParams, onRendered){ //progress bar\r\n\tvar value = this.sanitizeHTML(cell.getValue()) || 0,\r\n\telement = cell.getElement(),\r\n\tmax = formatterParams && formatterParams.max ? formatterParams.max : 100,\r\n\tmin = formatterParams && formatterParams.min ? formatterParams.min : 0,\r\n\tlegendAlign = formatterParams && formatterParams.legendAlign ? formatterParams.legendAlign : \"center\",\r\n\tpercent, percentValue, color, legend, legendColor, top, left, right, bottom;\r\n\r\n\t//make sure value is in range\r\n\tpercentValue = parseFloat(value) <= max ? parseFloat(value) : max;\r\n\tpercentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min;\r\n\r\n\t//workout percentage\r\n\tpercent = (max - min) / 100;\r\n\tpercentValue = Math.round((percentValue - min) / percent);\r\n\r\n\t//set bar color\r\n\tswitch(typeof formatterParams.color){\r\n\t\tcase \"string\":\r\n\t\tcolor = formatterParams.color;\r\n\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\tcolor = formatterParams.color(value);\r\n\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\tif(Array.isArray(formatterParams.color)){\r\n\t\t\tvar unit = 100 / formatterParams.color.length;\r\n\t\t\tvar index = Math.floor(percentValue / unit);\r\n\r\n\t\t\tindex = Math.min(index, formatterParams.color.length - 1);\r\n\t\t\tindex = Math.max(index, 0);\r\n\t\t\tcolor = formatterParams.color[index];\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tdefault:\r\n\t\tcolor = \"#2DC214\";\r\n\t}\r\n\r\n\t//generate legend\r\n\tswitch(typeof formatterParams.legend){\r\n\t\tcase \"string\":\r\n\t\tlegend = formatterParams.legend;\r\n\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\tlegend = formatterParams.legend(value);\r\n\t\tbreak;\r\n\t\tcase \"boolean\":\r\n\t\tlegend = value;\r\n\t\tbreak;\r\n\t\tdefault:\r\n\t\tlegend = false;\r\n\t}\r\n\r\n\t//set legend color\r\n\tswitch(typeof formatterParams.legendColor){\r\n\t\tcase \"string\":\r\n\t\tlegendColor = formatterParams.legendColor;\r\n\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\tlegendColor = formatterParams.legendColor(value);\r\n\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\tif(Array.isArray(formatterParams.legendColor)){\r\n\t\t\tvar unit = 100 / formatterParams.legendColor.length;\r\n\t\t\tvar index = Math.floor(percentValue / unit);\r\n\r\n\t\t\tindex = Math.min(index, formatterParams.legendColor.length - 1);\r\n\t\t\tindex = Math.max(index, 0);\r\n\t\t\tlegendColor = formatterParams.legendColor[index];\r\n\t\t}\r\n\t\tbreak;\r\n\t\tdefault:\r\n\t\tlegendColor = \"#000\";\r\n\t}\r\n\r\n\telement.style.minWidth = \"30px\";\r\n\telement.style.position = \"relative\";\r\n\r\n\telement.setAttribute(\"aria-label\", percentValue);\r\n\r\n\tvar barEl = document.createElement(\"div\");\r\n\tbarEl.style.display = \"inline-block\";\r\n\tbarEl.style.position = \"absolute\";\r\n\tbarEl.style.width = percentValue + \"%\";\r\n\tbarEl.style.backgroundColor = color;\r\n\tbarEl.style.height = \"100%\";\r\n\r\n\tbarEl.setAttribute('data-max', max);\r\n\tbarEl.setAttribute('data-min', min);\r\n\r\n\tvar barContainer = document.createElement(\"div\");\r\n\tbarContainer.style.position = \"relative\";\r\n\tbarContainer.style.width = \"100%\";\r\n\tbarContainer.style.height = \"100%\";\r\n\r\n\tif(legend){\r\n\t\tvar legendEl = document.createElement(\"div\");\r\n\t\tlegendEl.style.position = \"absolute\";\r\n\t\tlegendEl.style.top = 0;\r\n\t\tlegendEl.style.left = 0;\r\n\t\tlegendEl.style.textAlign = legendAlign;\r\n\t\tlegendEl.style.width = \"100%\";\r\n\t\tlegendEl.style.color = legendColor;\r\n\t\tlegendEl.innerHTML = legend;\r\n\t}\r\n\r\n\tonRendered(function(){\r\n\r\n\t\t//handle custom element needed if formatter is to be included in printed/downloaded output\r\n\t\tif(!(cell instanceof CellComponent)){\r\n\t\t\tvar holderEl = document.createElement(\"div\");\r\n\t\t\tholderEl.style.position = \"absolute\";\r\n\t\t\tholderEl.style.top = \"4px\";\r\n\t\t\tholderEl.style.bottom = \"4px\";\r\n\t\t\tholderEl.style.left = \"4px\";\r\n\t\t\tholderEl.style.right = \"4px\";\r\n\r\n\t\t\telement.appendChild(holderEl);\r\n\r\n\t\t\telement = holderEl;\r\n\t\t}\r\n\r\n\t\telement.appendChild(barContainer);\r\n\t\tbarContainer.appendChild(barEl);\r\n\r\n\t\tif(legend){\r\n\t\t\tbarContainer.appendChild(legendEl);\r\n\t\t}\r\n\t});\r\n\r\n\treturn \"\";\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().style.backgroundColor = this.sanitizeHTML(cell.getValue());\r\n\treturn \"\";\r\n};","export default function(cell, formatterParams, onRendered){\r\n\treturn '';\r\n};","export default function(cell, formatterParams, onRendered){\r\n\treturn '';\r\n};","export default function(cell, formatterParams, onRendered){\r\n\treturn this.table.rowManager.activeRows.indexOf(cell.getRow()._getSelf()) + 1 || \"\";\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().classList.add(\"tabulator-row-handle\");\r\n\treturn \"
\";\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar open = false,\r\n\tel = document.createElement(\"div\"),\r\n\tconfig = cell.getRow()._row.modules.responsiveLayout;\r\n\r\n\tel.classList.add(\"tabulator-responsive-collapse-toggle\");\r\n\tel.innerHTML = \"+-\";\r\n\r\n\tcell.getElement().classList.add(\"tabulator-row-handle\");\r\n\r\n\tfunction toggleList(isOpen){\r\n\t\tvar collapseEl = config.element;\r\n\r\n\t\tconfig.open = isOpen;\r\n\r\n\t\tif(collapseEl){\r\n\r\n\t\t\tif(config.open){\r\n\t\t\t\tel.classList.add(\"open\");\r\n\t\t\t\tcollapseEl.style.display = '';\r\n\t\t\t}else{\r\n\t\t\t\tel.classList.remove(\"open\");\r\n\t\t\t\tcollapseEl.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tel.addEventListener(\"click\", function(e){\r\n\t\te.stopImmediatePropagation();\r\n\t\ttoggleList(!config.open);\r\n\t});\r\n\r\n\ttoggleList(config.open);\r\n\r\n\treturn el;\r\n};","import RowComponent from '../../../../core/row/RowComponent.js';\r\n\r\nexport default function(cell, formatterParams, onRendered){\r\n\tvar checkbox = document.createElement(\"input\");\r\n\tvar blocked = false;\r\n\r\n\tcheckbox.type = 'checkbox';\r\n\r\n\tcheckbox.setAttribute(\"aria-label\", \"Select Row\");\r\n\t\r\n\tif(this.table.modExists(\"selectRow\", true)){\r\n\r\n\t\tcheckbox.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tif(typeof cell.getRow == 'function'){\r\n\t\t\tvar row = cell.getRow();\r\n\r\n\t\t\tif(row instanceof RowComponent){\r\n\r\n\t\t\t\tcheckbox.addEventListener(\"change\", (e) => {\r\n\t\t\t\t\tif(this.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\t\tif(!blocked){\r\n\t\t\t\t\t\t\trow.toggleSelect();\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tblocked = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trow.toggleSelect();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(this.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\tcheckbox.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\tblocked = true;\r\n\t\t\t\t\t\tthis.table.modules.selectRow.handleComplexRowClick(row._row, e);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcheckbox.checked = row.isSelected && row.isSelected();\r\n\t\t\t\tthis.table.modules.selectRow.registerRowSelectCheckbox(row, checkbox);\r\n\t\t\t}else{\r\n\t\t\t\tcheckbox = \"\";\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\tcheckbox.addEventListener(\"change\", (e) => {\r\n\t\t\t\tif(this.table.modules.selectRow.selectedRows.length){\r\n\t\t\t\t\tthis.table.deselectRow();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis.table.selectRow(formatterParams.rowRange);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.table.modules.selectRow.registerHeaderSelectCheckbox(checkbox);\r\n\t\t}\r\n\t}\r\n\r\n\treturn checkbox;\r\n};","import plaintext from './formatters/plaintext.js';\r\nimport html from './formatters/html.js';\r\nimport textarea from './formatters/textarea.js';\r\nimport money from './formatters/money.js';\r\nimport link from './formatters/link.js';\r\nimport image from './formatters/image.js';\r\nimport tickCross from './formatters/tickCross.js';\r\nimport datetime from './formatters/datetime.js';\r\nimport datetimediff from './formatters/datetimediff.js';\r\nimport lookup from './formatters/lookup.js';\r\nimport star from './formatters/star.js';\r\nimport traffic from './formatters/traffic.js';\r\nimport progress from './formatters/progress.js';\r\nimport color from './formatters/color.js';\r\nimport buttonTick from './formatters/buttonTick.js';\r\nimport buttonCross from './formatters/buttonCross.js';\r\nimport rownum from './formatters/rownum.js';\r\nimport handle from './formatters/handle.js';\r\nimport responsiveCollapse from './formatters/responsiveCollapse.js';\r\nimport rowSelection from './formatters/rowSelection.js';\r\n\r\nexport default {\r\n\tplaintext:plaintext,\r\n\thtml:html,\r\n\ttextarea:textarea,\r\n\tmoney:money,\r\n\tlink:link,\r\n\timage:image,\r\n\ttickCross:tickCross,\r\n\tdatetime:datetime,\r\n\tdatetimediff:datetimediff,\r\n\tlookup:lookup,\r\n\tstar:star,\r\n\ttraffic:traffic,\r\n\tprogress:progress,\r\n\tcolor:color,\r\n\tbuttonTick:buttonTick,\r\n\tbuttonCross:buttonCross,\r\n\trownum:rownum,\r\n\thandle:handle,\r\n\tresponsiveCollapse:responsiveCollapse,\r\n\trowSelection:rowSelection,\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultFormatters from './defaults/formatters.js';\r\n\r\nclass Format extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.registerColumnOption(\"formatter\");\r\n\t\tthis.registerColumnOption(\"formatterParams\");\r\n\r\n\t\tthis.registerColumnOption(\"formatterPrint\");\r\n\t\tthis.registerColumnOption(\"formatterPrintParams\");\r\n\t\tthis.registerColumnOption(\"formatterClipboard\");\r\n\t\tthis.registerColumnOption(\"formatterClipboardParams\");\r\n\t\tthis.registerColumnOption(\"formatterHtmlOutput\");\r\n\t\tthis.registerColumnOption(\"formatterHtmlOutputParams\");\r\n\t\tthis.registerColumnOption(\"titleFormatter\");\r\n\t\tthis.registerColumnOption(\"titleFormatterParams\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-format\", this.formatValue.bind(this));\r\n\t\tthis.subscribe(\"cell-rendered\", this.cellRendered.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"column-format\", this.formatHeader.bind(this));\r\n\t}\r\n\r\n\t//initialize column formatter\r\n\tinitializeColumn(column){\r\n\t\tcolumn.modules.format = this.lookupFormatter(column, \"\");\r\n\r\n\t\tif(typeof column.definition.formatterPrint !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.print = this.lookupFormatter(column, \"Print\");\r\n\t\t}\r\n\r\n\t\tif(typeof column.definition.formatterClipboard !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.clipboard = this.lookupFormatter(column, \"Clipboard\");\r\n\t\t}\r\n\r\n\t\tif(typeof column.definition.formatterHtmlOutput !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.htmlOutput = this.lookupFormatter(column, \"HtmlOutput\");\r\n\t\t}\r\n\t}\r\n\r\n\tlookupFormatter(column, type){\r\n\t\tvar config = {params:column.definition[\"formatter\" + type + \"Params\"] || {}},\r\n\t\tformatter = column.definition[\"formatter\" + type];\r\n\r\n\t\t//set column formatter\r\n\t\tswitch(typeof formatter){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(Format.formatters[formatter]){\r\n\t\t\t\tconfig.formatter = Format.formatters[formatter];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Formatter Error - No such formatter found: \", formatter);\r\n\t\t\t\tconfig.formatter = Format.formatters.plaintext;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tconfig.formatter = formatter;\r\n\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\tconfig.formatter = Format.formatters.plaintext;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn config;\r\n\t}\r\n\r\n\tcellRendered(cell){\r\n\t\tif(cell.modules.format && cell.modules.format.renderedCallback && !cell.modules.format.rendered){\r\n\t\t\tcell.modules.format.renderedCallback();\r\n\t\t\tcell.modules.format.rendered = true;\r\n\t\t}\r\n\t}\r\n\r\n\t//return a formatted value for a column header\r\n\tformatHeader(column, title, el){\r\n\t\tvar formatter, params, onRendered, mockCell;\r\n\r\n\t\tif(column.definition.titleFormatter){\r\n\t\t\tformatter = this.getFormatter(column.definition.titleFormatter);\r\n\r\n\t\t\tonRendered = (callback) => {\r\n\t\t\t\tcolumn.titleFormatterRendered = callback;\r\n\t\t\t};\r\n\r\n\t\t\tmockCell = {\r\n\t\t\t\tgetValue:function(){\r\n\t\t\t\t\treturn title;\r\n\t\t\t\t},\r\n\t\t\t\tgetElement:function(){\r\n\t\t\t\t\treturn el;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\tparams = column.definition.titleFormatterParams || {};\r\n\r\n\t\t\tparams = typeof params === \"function\" ? params() : params;\r\n\r\n\t\t\treturn formatter.call(this, mockCell, params, onRendered);\r\n\t\t}else{\r\n\t\t\treturn title;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t//return a formatted value for a cell\r\n\tformatValue(cell){\r\n\t\tvar component = cell.getComponent(),\r\n\t\tparams = typeof cell.column.modules.format.params === \"function\" ? cell.column.modules.format.params(component) : cell.column.modules.format.params;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\tif(!cell.modules.format){\r\n\t\t\t\tcell.modules.format = {};\r\n\t\t\t}\r\n\r\n\t\t\tcell.modules.format.renderedCallback = callback;\r\n\t\t\tcell.modules.format.rendered = false;\r\n\t\t}\r\n\r\n\t\treturn cell.column.modules.format.formatter.call(this, component, params, onRendered);\r\n\t}\r\n\r\n\tformatExportValue(cell, type){\r\n\t\tvar formatter = cell.column.modules.format[type],\r\n\t\tparams;\r\n\r\n\t\tif(formatter){\r\n\t\t\tparams = typeof formatter.params === \"function\" ? formatter.params(component) : formatter.params;\r\n\r\n\t\t\tfunction onRendered(callback){\r\n\t\t\t\tif(!cell.modules.format){\r\n\t\t\t\t\tcell.modules.format = {};\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcell.modules.format.renderedCallback = callback;\r\n\t\t\t\tcell.modules.format.rendered = false;\r\n\t\t\t}\r\n\r\n\t\t\treturn formatter.formatter.call(this, cell.getComponent(), params, onRendered);\r\n\r\n\t\t}else{\r\n\t\t\treturn this.formatValue(cell);\r\n\t\t}\r\n\t}\r\n\r\n\tsanitizeHTML(value){\r\n\t\tif(value){\r\n\t\t\tvar entityMap = {\r\n\t\t\t\t'&': '&',\r\n\t\t\t\t'<': '<',\r\n\t\t\t\t'>': '>',\r\n\t\t\t\t'\"': '"',\r\n\t\t\t\t\"'\": ''',\r\n\t\t\t\t'/': '/',\r\n\t\t\t\t'`': '`',\r\n\t\t\t\t'=': '='\r\n\t\t\t};\r\n\r\n\t\t\treturn String(value).replace(/[&<>\"'`=\\/]/g, function (s) {\r\n\t\t\t\treturn entityMap[s];\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn value;\r\n\t\t}\r\n\t}\r\n\r\n\temptyToSpace(value){\r\n\t\treturn value === null || typeof value === \"undefined\" || value === \"\" ? \" \" : value;\r\n\t}\r\n\r\n\t//get formatter for cell\r\n\tgetFormatter(formatter){\r\n\t\tvar formatter;\r\n\r\n\t\tswitch(typeof formatter){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(Format.formatters[formatter]){\r\n\t\t\t\tformatter = Format.formatters[formatter]\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Formatter Error - No such formatter found: \", formatter);\r\n\t\t\t\tformatter = Format.formatters.plaintext;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tformatter = formatter;\r\n\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\tformatter = Format.formatters.plaintext;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn formatter;\r\n\t}\r\n}\r\n\r\nFormat.moduleName = \"format\";\r\n\r\n//load defaults\r\nFormat.formatters = defaultFormatters;\r\n\r\nexport default Format;","import Module from '../../core/Module.js';\r\n\r\nclass FrozenColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.leftColumns = [];\r\n\t\tthis.rightColumns = [];\r\n\t\tthis.leftMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.rightPadding = 0;\r\n\t\tthis.initializationMode = \"left\";\r\n\t\tthis.active = false;\r\n\t\tthis.blocked = true;\r\n\t\t\r\n\t\tthis.registerColumnOption(\"frozen\");\r\n\t}\r\n\t\r\n\t//reset initial state\r\n\treset(){\r\n\t\tthis.initializationMode = \"left\";\r\n\t\tthis.leftColumns = [];\r\n\t\tthis.rightColumns = [];\r\n\t\tthis.leftMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.active = false;\r\n\t\t\r\n\t\tthis.table.columnManager.headersElement.style.marginLeft = 0;\r\n\t\tthis.table.columnManager.element.style.paddingRight = 0;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-layout\", this.layoutCell.bind(this));\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"column-width\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"row-layout-after\", this.layoutRow.bind(this));\r\n\t\tthis.subscribe(\"table-layout\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"columns-loading\", this.reset.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"column-add\", this.reinitializeColumns.bind(this));\r\n\t\tthis.subscribe(\"column-delete\", this.reinitializeColumns.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"table-redraw\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"layout-refreshing\", this.blockLayout.bind(this));\r\n\t\tthis.subscribe(\"layout-refreshed\", this.unblockLayout.bind(this));\r\n\t}\r\n\t\r\n\tblockLayout(){\r\n\t\tthis.blocked = true;\r\n\t}\r\n\t\r\n\tunblockLayout(){\r\n\t\tthis.blocked = false;\r\n\t}\r\n\t\r\n\tlayoutCell(cell){\r\n\t\tthis.layoutElement(cell.element, cell.column)\r\n\t}\r\n\t\r\n\treinitializeColumns(){\r\n\t\tthis.reset();\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//initialize specific column\r\n\tinitializeColumn(column){\r\n\t\tvar config = {margin:0, edge:false};\r\n\t\t\r\n\t\tif(!column.isGroup){\r\n\t\t\t\r\n\t\t\tif(this.frozenCheck(column)){\r\n\t\t\t\t\r\n\t\t\t\tconfig.position = this.initializationMode;\r\n\t\t\t\t\r\n\t\t\t\tif(this.initializationMode == \"left\"){\r\n\t\t\t\t\tthis.leftColumns.push(column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.rightColumns.unshift(column);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.active = true;\r\n\t\t\t\t\r\n\t\t\t\tcolumn.modules.frozen = config;\r\n\t\t\t}else{\r\n\t\t\t\tthis.initializationMode = \"right\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tfrozenCheck(column){\r\n\t\tif(column.parent.isGroup && column.definition.frozen){\r\n\t\t\tconsole.warn(\"Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups\");\r\n\t\t}\r\n\t\t\r\n\t\tif(column.parent.isGroup){\r\n\t\t\treturn this.frozenCheck(column.parent);\r\n\t\t}else{\r\n\t\t\treturn column.definition.frozen;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//quick layout to smooth horizontal scrolling\r\n\tscrollHorizontal(){\r\n\t\tvar rows;\r\n\t\t\r\n\t\tif(this.active){\t\t\r\n\t\t\tthis.calcMargins(true);\r\n\t\t\t\r\n\t\t\tthis.layoutColumnPosition();\r\n\t\t\t\r\n\t\t\tthis.layoutCalcRows();\r\n\t\t\t\r\n\t\t\tthis.reinitializeRows();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//calculate margins for rows\r\n\tcalcMargins(scroll){\r\n\t\t\r\n\t\tif(!scroll){\r\n\t\t\tthis.leftMargin = this._calcSpace(this.leftColumns, this.leftColumns.length) + \"px\";\t\t\t\r\n\t\t\tthis.rightMargin = this._calcSpace(this.rightColumns, this.rightColumns.length) + \"px\";\t\r\n\t\t\tthis.table.rowManager.tableElement.style.marginRight = this.rightMargin;\r\n\t\t}\r\n\t\t\r\n\t\t//calculate right frozen columns\r\n\t\tthis.rightPadding = this.table.rowManager.element.clientWidth + this.table.columnManager.scrollLeft;\r\n\t}\r\n\t\r\n\t//layout calculation rows\r\n\tlayoutCalcRows(){\r\n\t\tif(this.table.modExists(\"columnCalcs\")){\r\n\t\t\tif(this.table.modules.columnCalcs.topInitialized && this.table.modules.columnCalcs.topRow){\r\n\t\t\t\tthis.layoutRow(this.table.modules.columnCalcs.topRow);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.modules.columnCalcs.botInitialized && this.table.modules.columnCalcs.botRow){\r\n\t\t\t\tthis.layoutRow(this.table.modules.columnCalcs.botRow);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.modExists(\"groupRows\")){\r\n\t\t\t\tthis.layoutGroupCalcs(this.table.modules.groupRows.getGroups())\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tlayoutGroupCalcs(groups){\r\n\t\tgroups.forEach((group) => {\r\n\t\t\tif(group.calcs.top){\r\n\t\t\t\tthis.layoutRow(group.calcs.top);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(group.calcs.bottom){\r\n\t\t\t\tthis.layoutRow(group.calcs.bottom);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(group.groupList && group.groupList.length){\r\n\t\t\t\tthis.layoutGroupCalcs(group.groupList && group.groupList);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//calculate column positions and layout headers\r\n\tlayoutColumnPosition(allCells){\r\n\t\tvar leftParents = [];\r\n\t\t\r\n\t\tvar leftMargin = 0;\r\n\t\tvar rightMargin = 0;\r\n\t\t\r\n\t\tthis.table.columnManager.headersElement.style.marginLeft = this.leftMargin;\r\n\t\tthis.table.columnManager.element.style.paddingRight = this.rightMargin;\r\n\t\t\r\n\t\tthis.leftColumns.forEach((column, i) => {\t\r\n\t\t\tcolumn.modules.frozen.marginValue = leftMargin + this.table.columnManager.scrollLeft;\r\n\t\t\tcolumn.modules.frozen.margin = column.modules.frozen.marginValue + \"px\";\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\tleftMargin += column.getWidth();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(i == this.leftColumns.length - 1){\r\n\t\t\t\tcolumn.modules.frozen.edge = true;\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.modules.frozen.edge = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(column.parent.isGroup){\r\n\t\t\t\tvar parentEl = this.getColGroupParentElement(column);\r\n\t\t\t\tif(!leftParents.includes(parentEl)){\r\n\t\t\t\t\tthis.layoutElement(parentEl, column);\r\n\t\t\t\t\tleftParents.push(parentEl);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(column.modules.frozen.edge){\r\n\t\t\t\t\tparentEl.classList.add(\"tabulator-frozen-\" + column.modules.frozen.position);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.layoutElement(column.getElement(), column);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(allCells){\r\n\t\t\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.rightColumns.forEach((column, i) => {\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\trightMargin += column.getWidth();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.frozen.marginValue = this.rightPadding - rightMargin;\r\n\t\t\tcolumn.modules.frozen.margin = column.modules.frozen.marginValue + \"px\";\r\n\t\t\t\r\n\t\t\tif(i == this.rightColumns.length - 1){\r\n\t\t\t\tcolumn.modules.frozen.edge = true;\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.modules.frozen.edge = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif(column.parent.isGroup){\r\n\t\t\t\tthis.layoutElement(this.getColGroupParentElement(column), column);\r\n\t\t\t}else{\r\n\t\t\t\tthis.layoutElement(column.getElement(), column);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(allCells){\r\n\t\t\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetColGroupParentElement(column){\r\n\t\treturn column.parent.isGroup ? this.getColGroupParentElement(column.parent) : column.getElement();\r\n\t}\r\n\t\r\n\t//layout columns appropriately\r\n\tlayout(){\t\r\n\t\tif(this.active && !this.blocked){\r\n\t\t\t//calculate row padding\r\n\t\t\tthis.calcMargins();\r\n\t\t\t\r\n\t\t\t//calculate left columns\r\n\t\t\tthis.layoutColumnPosition();\r\n\r\n\t\t\tthis.reinitializeRows();\r\n\t\t\t\r\n\t\t\tthis.layoutCalcRows();\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeRows(){\r\n\t\tvar visibleRows = this.table.rowManager.getVisibleRows();\r\n\t\tvar otherRows = this.table.rowManager.getRows().filter(row => !visibleRows.includes(row));\r\n\r\n\t\totherRows.forEach((row) =>{\r\n\t\t\trow.deinitialize();\r\n\t\t});\r\n\t\t\r\n\t\tvisibleRows.forEach((row) =>{\r\n\t\t\tif(row.type === \"row\"){\r\n\t\t\t\tthis.layoutRow(row);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tlayoutRow(row){\r\n\t\t// console.trace(\"row\")\r\n\t\tvar rowEl = row.getElement();\r\n\t\t\r\n\t\trowEl.style.paddingLeft = this.leftMargin;\r\n\t\t\r\n\t\tif(this.table.options.layout === \"fitDataFill\" && this.rightColumns.length){\r\n\t\t\tthis.table.rowManager.getTableElement().style.minWidth = \"calc(100% - \" + this.rightMargin + \")\";\r\n\t\t}\r\n\t\t\r\n\t\tthis.leftColumns.forEach((column) => {\r\n\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\r\n\t\t\tif(cell){\r\n\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.rightColumns.forEach((column) => {\r\n\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\r\n\t\t\tif(cell){\r\n\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tlayoutElement(element, column){\r\n\t\t\r\n\t\tif(column.modules.frozen){\r\n\t\t\telement.style.position = \"absolute\";\r\n\t\t\telement.style.left = column.modules.frozen.margin;\r\n\t\t\t\r\n\t\t\telement.classList.add(\"tabulator-frozen\");\r\n\t\t\t\r\n\t\t\tif(column.modules.frozen.edge){\r\n\t\t\t\telement.classList.add(\"tabulator-frozen-\" + column.modules.frozen.position);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_calcSpace(columns, index){\r\n\t\tvar width = 0;\r\n\t\t\r\n\t\tfor (let i = 0; i < index; i++){\r\n\t\t\tif(columns[i].visible){\r\n\t\t\t\twidth += columns[i].getWidth();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn width;\r\n\t}\r\n}\r\n\r\nFrozenColumns.moduleName = \"frozenColumns\";\r\n\r\nexport default FrozenColumns;","import Module from '../../core/Module.js';\r\n\r\nclass FrozenRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.topElement = document.createElement(\"div\");\r\n\t\tthis.rows = [];\r\n\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"freeze\", this.freezeRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"unfreeze\", this.unfreezeRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isFrozen\", this.isRowFrozen.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.rows = [];\r\n\r\n\t\tthis.topElement.classList.add(\"tabulator-frozen-rows-holder\");\r\n\r\n\t\t// this.table.columnManager.element.append(this.topElement);\r\n\t\tthis.table.columnManager.getElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling);\r\n\r\n\t\tthis.subscribe(\"row-deleting\", this.detachRow.bind(this));\r\n\t\tthis.subscribe(\"rows-visible\", this.visibleRows.bind(this));\r\n\r\n\t\tthis.registerDisplayHandler(this.getRows.bind(this), 10);\r\n\t}\r\n\r\n\tisRowFrozen(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\t\treturn index > -1;\r\n\t}\r\n\r\n\tisFrozen(){\r\n\t\treturn !!this.rows.length;\r\n\t}\r\n\r\n\tvisibleRows(viewable, rows){\r\n\t\tthis.rows.forEach((row) => {\r\n\t\t\trows.push(row);\r\n\t\t});\r\n\r\n\t\treturn rows;\r\n\t}\r\n\r\n\t//filter frozen rows out of display data\r\n\tgetRows(rows){\r\n\t\tvar self = this,\r\n\t\tfrozen = [],\r\n\t\toutput = rows.slice(0);\r\n\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\tvar index = output.indexOf(row);\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\toutput.splice(index, 1);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tfreezeRow(row){\r\n\t\tif(!row.modules.frozen){\r\n\t\t\trow.modules.frozen = true;\r\n\t\t\tthis.topElement.appendChild(row.getElement());\r\n\t\t\trow.initialize();\r\n\t\t\trow.normalizeHeight();\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\tthis.rows.push(row);\r\n\r\n\t\t\tthis.refreshData(false, \"display\")\r\n\r\n\t\t\tthis.styleRows();\r\n\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Freeze Error - Row is already frozen\");\r\n\t\t}\r\n\t}\r\n\r\n\tunfreezeRow(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\r\n\t\tif(row.modules.frozen){\r\n\r\n\t\t\trow.modules.frozen = false;\r\n\r\n\t\t\tthis.detachRow(row);\r\n\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\tthis.refreshData(false, \"display\")\r\n\r\n\t\t\tif(this.rows.length){\r\n\t\t\t\tthis.styleRows();\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Freeze Error - Row is already unfrozen\");\r\n\t\t}\r\n\t}\r\n\r\n\tdetachRow(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tvar rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\r\n\t\t\tthis.rows.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\tstyleRows(row){\r\n\t\tthis.rows.forEach((row, i) => {\r\n\t\t\tthis.table.rowManager.styleRow(row, i);\r\n\t\t});\r\n\t}\r\n}\r\n\r\nFrozenRows.moduleName = \"frozenRows\";\r\n\r\nexport default FrozenRows;","//public group object\r\nclass GroupComponent {\r\n\tconstructor (group){\r\n\t\tthis._group = group;\r\n\t\tthis.type = \"GroupComponent\";\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._group.groupManager.table.componentFunctionBinder.handle(\"row\", target._group, name)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\tgetKey(){\r\n\t\treturn this._group.key;\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._group.field;\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._group.element;\r\n\t}\r\n\r\n\tgetRows(){\r\n\t\treturn this._group.getRows(true);\r\n\t}\r\n\r\n\tgetSubGroups(){\r\n\t\treturn this._group.getSubGroups(true);\r\n\t}\r\n\r\n\tgetParentGroup(){\r\n\t\treturn this._group.parent ? this._group.parent.getComponent() : false;\r\n\t}\r\n\r\n\tisVisible(){\r\n\t\treturn this._group.visible;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tthis._group.show();\r\n\t}\r\n\r\n\thide(){\r\n\t\tthis._group.hide();\r\n\t}\r\n\r\n\ttoggle(){\r\n\t\tthis._group.toggleVisibility();\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._group;\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._group.groupManager.table;\r\n\t}\r\n}\r\n\r\nexport default GroupComponent;","import Helpers from '../../core/tools/Helpers.js';\r\nimport GroupComponent from './GroupComponent.js';\r\n\r\n//Group functions\r\nclass Group{\r\n\t\r\n\tconstructor(groupManager, parent, level, key, field, generator, oldGroup){\r\n\t\tthis.groupManager = groupManager;\r\n\t\tthis.parent = parent;\r\n\t\tthis.key = key;\r\n\t\tthis.level = level;\r\n\t\tthis.field = field;\r\n\t\tthis.hasSubGroups = level < (groupManager.groupIDLookups.length - 1);\r\n\t\tthis.addRow = this.hasSubGroups ? this._addRowToGroup : this._addRow;\r\n\t\tthis.type = \"group\"; //type of element\r\n\t\tthis.old = oldGroup;\r\n\t\tthis.rows = [];\r\n\t\tthis.groups = [];\r\n\t\tthis.groupList = [];\r\n\t\tthis.generator = generator;\r\n\t\tthis.element = false;\r\n\t\tthis.elementContents = false;\r\n\t\tthis.height = 0;\r\n\t\tthis.outerHeight = 0;\r\n\t\tthis.initialized = false;\r\n\t\tthis.calcs = {};\r\n\t\tthis.initialized = false;\r\n\t\tthis.modules = {};\r\n\t\tthis.arrowElement = false;\r\n\t\t\r\n\t\tthis.visible = oldGroup ? oldGroup.visible : (typeof groupManager.startOpen[level] !== \"undefined\" ? groupManager.startOpen[level] : groupManager.startOpen[0]);\r\n\t\t\r\n\t\tthis.component = null;\r\n\t\t\r\n\t\tthis.createElements();\r\n\t\tthis.addBindings();\r\n\t\t\r\n\t\tthis.createValueGroups();\r\n\t}\r\n\t\r\n\twipe(){\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\tgroup.wipe();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\tif(row.modules){\r\n\t\t\t\t\tdelete row.modules.group;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tthis.element = false;\r\n\t\tthis.arrowElement = false;\r\n\t\tthis.elementContents = false;\r\n\t}\r\n\t\r\n\tcreateElements(){\r\n\t\tvar arrow = document.createElement(\"div\");\r\n\t\tarrow.classList.add(\"tabulator-arrow\");\r\n\t\t\r\n\t\tthis.element = document.createElement(\"div\");\r\n\t\tthis.element.classList.add(\"tabulator-row\");\r\n\t\tthis.element.classList.add(\"tabulator-group\");\r\n\t\tthis.element.classList.add(\"tabulator-group-level-\" + this.level);\r\n\t\tthis.element.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\tthis.arrowElement = document.createElement(\"div\");\r\n\t\tthis.arrowElement.classList.add(\"tabulator-group-toggle\");\r\n\t\tthis.arrowElement.appendChild(arrow);\r\n\t\t\r\n\t\t//setup movable rows\r\n\t\tif(this.groupManager.table.options.movableRows !== false && this.groupManager.table.modExists(\"moveRow\")){\r\n\t\t\tthis.groupManager.table.modules.moveRow.initializeGroupHeader(this);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcreateValueGroups(){\r\n\t\tvar level = this.level + 1;\r\n\t\tif(this.groupManager.allowedValues && this.groupManager.allowedValues[level]){\r\n\t\t\tthis.groupManager.allowedValues[level].forEach((value) => {\r\n\t\t\t\tthis._createGroup(value, level);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\taddBindings(){\r\n\t\tvar toggleElement;\r\n\t\t\r\n\t\tif(this.groupManager.table.options.groupToggleElement){\r\n\t\t\ttoggleElement = this.groupManager.table.options.groupToggleElement == \"arrow\" ? this.arrowElement : this.element;\r\n\t\t\t\r\n\t\t\ttoggleElement.addEventListener(\"click\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\tthis.toggleVisibility();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\t_createGroup(groupID, level){\r\n\t\tvar groupKey = level + \"_\" + groupID;\r\n\t\tvar group = new Group(this.groupManager, this, level, groupID, this.groupManager.groupIDLookups[level].field, this.groupManager.headerGenerator[level] || this.groupManager.headerGenerator[0], this.old ? this.old.groups[groupKey] : false);\r\n\t\t\r\n\t\tthis.groups[groupKey] = group;\r\n\t\tthis.groupList.push(group);\r\n\t}\r\n\t\r\n\t_addRowToGroup(row){\r\n\t\t\r\n\t\tvar level = this.level + 1;\r\n\t\t\r\n\t\tif(this.hasSubGroups){\r\n\t\t\tvar groupID = this.groupManager.groupIDLookups[level].func(row.getData()),\r\n\t\t\tgroupKey = level + \"_\" + groupID;\r\n\t\t\t\r\n\t\t\tif(this.groupManager.allowedValues && this.groupManager.allowedValues[level]){\r\n\t\t\t\tif(this.groups[groupKey]){\r\n\t\t\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(!this.groups[groupKey]){\r\n\t\t\t\t\tthis._createGroup(groupID, level);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_addRow(row){\r\n\t\tthis.rows.push(row);\r\n\t\trow.modules.group = this;\r\n\t}\r\n\t\r\n\tinsertRow(row, to, after){\r\n\t\tvar data = this.conformRowData({});\r\n\t\t\r\n\t\trow.updateData(data);\r\n\t\t\r\n\t\tvar toIndex = this.rows.indexOf(to);\r\n\t\t\r\n\t\tif(toIndex > -1){\r\n\t\t\tif(after){\r\n\t\t\t\tthis.rows.splice(toIndex+1, 0, row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.splice(toIndex, 0, row);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(after){\r\n\t\t\t\tthis.rows.push(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.unshift(row);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\trow.modules.group = this;\r\n\t\t\r\n\t\tthis.generateGroupHeaderContents();\r\n\t\t\r\n\t\tif(this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\tthis.groupManager.table.modules.columnCalcs.recalcGroup(this);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.updateGroupRows(true);\r\n\t}\r\n\t\r\n\tscrollHeader(left){\r\n\t\tif(this.arrowElement){\r\n\t\t\tthis.arrowElement.style.marginLeft = left;\r\n\t\t\t\r\n\t\t\tthis.groupList.forEach(function(child){\r\n\t\t\t\tchild.scrollHeader(left);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRowIndex(row){}\r\n\t\r\n\t//update row data to match grouping contraints\r\n\tconformRowData(data){\r\n\t\tif(this.field){\r\n\t\t\tdata[this.field] = this.key;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Data Conforming Error - Cannot conform row data to match new group as groupBy is a function\");\r\n\t\t}\r\n\t\t\r\n\t\tif(this.parent){\r\n\t\t\tdata = this.parent.conformRowData(data);\r\n\t\t}\r\n\t\t\r\n\t\treturn data;\r\n\t}\r\n\t\r\n\tremoveRow(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\t\tvar el = row.getElement();\r\n\t\t\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.rows.splice(index, 1);\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.groupManager.table.options.groupValues && !this.rows.length){\r\n\t\t\tif(this.parent){\r\n\t\t\t\tthis.parent.removeGroup(this);\r\n\t\t\t}else{\r\n\t\t\t\tthis.groupManager.removeGroup(this);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tif(el.parentNode){\r\n\t\t\t\tel.parentNode.removeChild(el);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.generateGroupHeaderContents();\r\n\t\t\t\r\n\t\t\tif(this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\t\tthis.groupManager.table.modules.columnCalcs.recalcGroup(this);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveGroup(group){\r\n\t\tvar groupKey = group.level + \"_\" + group.key,\r\n\t\tindex;\r\n\t\t\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tdelete this.groups[groupKey];\r\n\t\t\t\r\n\t\t\tindex = this.groupList.indexOf(group);\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.groupList.splice(index, 1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(!this.groupList.length){\r\n\t\t\t\tif(this.parent){\r\n\t\t\t\t\tthis.parent.removeGroup(this);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.groupManager.removeGroup(this);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetHeadersAndRows(noCalc){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\toutput.push(this);\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(this.visible){\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\t\toutput = output.concat(group.getHeadersAndRows(noCalc));\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tif(!noCalc && this.groupManager.table.options.columnCalcs != \"table\" && this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.modules.columnCalcs.hasTopCalcs()){\r\n\t\t\t\t\tif(this.calcs.top){\r\n\t\t\t\t\t\tthis.calcs.top.detachElement();\r\n\t\t\t\t\t\tthis.calcs.top.deleteCells();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows);\r\n\t\t\t\t\toutput.push(this.calcs.top);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\toutput = output.concat(this.rows);\r\n\t\t\t\t\r\n\t\t\t\tif(!noCalc && this.groupManager.table.options.columnCalcs != \"table\" && this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()){\r\n\t\t\t\t\tif(this.calcs.bottom){\r\n\t\t\t\t\t\tthis.calcs.bottom.detachElement();\r\n\t\t\t\t\t\tthis.calcs.bottom.deleteCells();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows);\r\n\t\t\t\t\toutput.push(this.calcs.bottom);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!this.groupList.length && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\t\t\r\n\t\t\t\tif(this.groupManager.table.modExists(\"columnCalcs\")){\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!noCalc && this.groupManager.table.modules.columnCalcs.hasTopCalcs()){\r\n\t\t\t\t\t\tif(this.calcs.top){\r\n\t\t\t\t\t\t\tthis.calcs.top.detachElement();\r\n\t\t\t\t\t\t\tthis.calcs.top.deleteCells();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.groupManager.table.options.groupClosedShowCalcs){\r\n\t\t\t\t\t\t\tthis.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows);\r\n\t\t\t\t\t\t\toutput.push(this.calcs.top);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!noCalc && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()){\r\n\t\t\t\t\t\tif(this.calcs.bottom){\r\n\t\t\t\t\t\t\tthis.calcs.bottom.detachElement();\r\n\t\t\t\t\t\t\tthis.calcs.bottom.deleteCells();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.groupManager.table.options.groupClosedShowCalcs){\r\n\t\t\t\t\t\t\tthis.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows);\r\n\t\t\t\t\t\t\toutput.push(this.calcs.bottom);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetData(visible, transform){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(!visible || (visible && this.visible)){\r\n\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\toutput.push(row.getData(transform || \"data\"));\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetRowCount(){\r\n\t\tvar count = 0;\r\n\t\t\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\tcount += group.getRowCount();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tcount = this.rows.length;\r\n\t\t}\r\n\t\treturn count;\r\n\t}\r\n\t\r\n\ttoggleVisibility(){\r\n\t\tif(this.visible){\r\n\t\t\tthis.hide();\r\n\t\t}else{\r\n\t\t\tthis.show();\r\n\t\t}\r\n\t}\r\n\t\r\n\thide(){\r\n\t\tthis.visible = false;\r\n\t\t\r\n\t\tif(this.groupManager.table.rowManager.getRenderMode() == \"classic\" && !this.groupManager.table.options.pagination){\r\n\t\t\t\r\n\t\t\tthis.element.classList.remove(\"tabulator-group-visible\");\r\n\t\t\t\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar rows = group.getHeadersAndRows();\r\n\t\t\t\t\t\r\n\t\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\t\trow.detachElement();\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());\r\n\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth();\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.table.externalEvents.dispatch(\"groupVisibilityChanged\", this.getComponent(), false);\r\n\t}\r\n\t\r\n\tshow(){\r\n\t\tthis.visible = true;\r\n\t\t\r\n\t\tif(this.groupManager.table.rowManager.getRenderMode() == \"classic\" && !this.groupManager.table.options.pagination){\r\n\t\t\t\r\n\t\t\tthis.element.classList.add(\"tabulator-group-visible\");\r\n\t\t\t\r\n\t\t\tvar prev = this.generateElement();\r\n\t\t\t\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\t\tvar rows = group.getHeadersAndRows();\r\n\t\t\t\t\t\r\n\t\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\t\tprev.parentNode.insertBefore(rowEl, prev.nextSibling);\r\n\t\t\t\t\t\trow.initialize();\r\n\t\t\t\t\t\tprev = rowEl;\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\tprev.parentNode.insertBefore(rowEl, prev.nextSibling);\r\n\t\t\t\t\trow.initialize();\r\n\t\t\t\t\tprev = rowEl;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());\r\n\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth();\r\n\t\t}else{\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.table.externalEvents.dispatch(\"groupVisibilityChanged\", this.getComponent(), true);\r\n\t}\r\n\t\r\n\t_visSet(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tif(typeof this.visible == \"function\"){\r\n\t\t\t\r\n\t\t\tthis.rows.forEach(function(row){\r\n\t\t\t\tdata.push(row.getData());\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.visible = this.visible(this.key, this.getRowCount(), data, this.getComponent());\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRowGroup(row){\r\n\t\tvar match = false;\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\tvar result = group.getRowGroup(row);\r\n\t\t\t\t\r\n\t\t\t\tif(result){\r\n\t\t\t\t\tmatch = result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tif(this.rows.find(function(item){\r\n\t\t\t\treturn item === row;\r\n\t\t\t})){\r\n\t\t\t\tmatch = this;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn match;\r\n\t}\r\n\t\r\n\tgetSubGroups(component){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.groupList.forEach(function(child){\r\n\t\t\toutput.push(component ? child.getComponent() : child);\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetRows(compoment){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\toutput.push(compoment ? row.getComponent() : row);\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgenerateGroupHeaderContents(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\tdata.push(row.getData());\r\n\t\t});\r\n\t\t\r\n\t\tthis.elementContents = this.generator(this.key, this.getRowCount(), data, this.getComponent());\r\n\t\t\r\n\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\r\n\t\tif(typeof this.elementContents === \"string\"){\r\n\t\t\tthis.element.innerHTML = this.elementContents;\r\n\t\t}else{\r\n\t\t\tthis.element.appendChild(this.elementContents);\r\n\t\t}\r\n\t\t\r\n\t\tthis.element.insertBefore(this.arrowElement, this.element.firstChild);\r\n\t}\r\n\t\r\n\tgetPath(path = []) {\r\n\t\tpath.unshift(this.key);\r\n\t\tif(this.parent) {\r\n\t\t\tthis.parent.getPath(path);\r\n\t\t}\r\n\t\treturn path;\r\n\t}\r\n\t\r\n\t////////////// Standard Row Functions //////////////\r\n\t\r\n\tgetElement(){\r\n\t\treturn this.elementContents ? this.element : this.generateElement();\r\n\t}\r\n\t\r\n\tgenerateElement(){\r\n\t\tthis.addBindings = false;\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(this.visible){\r\n\t\t\tthis.element.classList.add(\"tabulator-group-visible\");\r\n\t\t}else{\r\n\t\t\tthis.element.classList.remove(\"tabulator-group-visible\");\r\n\t\t}\r\n\t\t\r\n\t\tfor(var i = 0; i < this.element.childNodes.length; ++i){\r\n\t\t\tthis.element.childNodes[i].parentNode.removeChild(this.element.childNodes[i]);\r\n\t\t}\r\n\t\t\r\n\t\tthis.generateGroupHeaderContents();\r\n\t\t\r\n\t\t// this.addBindings();\r\n\t\t\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\tdetachElement(){\r\n\t\tif (this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//normalize the height of elements in the row\r\n\tnormalizeHeight(){\r\n\t\tthis.setHeight(this.element.clientHeight);\r\n\t}\r\n\t\r\n\tinitialize(force){\r\n\t\tif(!this.initialized || force){\r\n\t\t\tthis.normalizeHeight();\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitialize(){\r\n\t\tthis.initialized = false;\r\n\t\tthis.height = 0;\r\n\t\t\r\n\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\tthis.initialize(true);\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetHeight(height){\r\n\t\tif(this.height != height){\r\n\t\t\tthis.height = height;\r\n\t\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return rows outer height\r\n\tgetHeight(){\r\n\t\treturn this.outerHeight;\r\n\t}\r\n\t\r\n\tgetGroup(){\r\n\t\treturn this;\r\n\t}\r\n\t\r\n\treinitializeHeight(){}\r\n\t\r\n\tcalcHeight(){}\r\n\t\r\n\tsetCellHeight(){}\r\n\t\r\n\tclearCellHeight(){}\r\n\t\r\n\tdeinitializeHeight(){}\r\n\t\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new GroupComponent(this);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n\r\nexport default Group;","import Module from '../../core/Module.js';\r\n\r\nimport GroupComponent from './GroupComponent.js';\r\nimport Group from './Group.js';\r\n\r\nclass GroupRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.groupIDLookups = false; //enable table grouping and set field to group by\r\n\t\tthis.startOpen = [function(){return false;}]; //starting state of group\r\n\t\tthis.headerGenerator = [function(){return \"\";}];\r\n\t\tthis.groupList = []; //ordered list of groups\r\n\t\tthis.allowedValues = false;\r\n\t\tthis.groups = {}; //hold row groups\r\n\t\tthis.displayIndex = 0; //index in display pipeline\r\n\r\n\t\tthis.displayHandler = this.getRows.bind(this);\r\n\r\n\t\t//register table options\r\n\t\tthis.registerTableOption(\"groupBy\", false); //enable table grouping and set field to group by\r\n\t\tthis.registerTableOption(\"groupStartOpen\", true); //starting state of group\r\n\t\tthis.registerTableOption(\"groupValues\", false);\r\n\t\tthis.registerTableOption(\"groupUpdateOnCellEdit\", false);\r\n\t\tthis.registerTableOption(\"groupHeader\", false); //header generation function\r\n\t\tthis.registerTableOption(\"groupHeaderPrint\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderClipboard\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderHtmlOutput\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderDownload\", null);\r\n\t\tthis.registerTableOption(\"groupToggleElement\", \"arrow\");\r\n\t\tthis.registerTableOption(\"groupClosedShowCalcs\", false);\r\n\r\n\t\t//register table functions\r\n\t\tthis.registerTableFunction(\"setGroupBy\", this.setGroupBy.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupValues\", this.setGroupValues.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupStartOpen\", this.setGroupStartOpen.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupHeader\", this.setGroupHeader.bind(this));\r\n\t\tthis.registerTableFunction(\"getGroups\", this.userGetGroups.bind(this));\r\n\t\tthis.registerTableFunction(\"getGroupedData\", this.userGetGroupedData.bind(this));\r\n\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"getGroup\", this.rowGetGroup.bind(this));\r\n\t}\r\n\r\n\t//initialize group configuration\r\n\tinitialize(){\r\n\t\tif(this.table.options.groupBy){\r\n\r\n\t\t\tif(this.table.options.groupUpdateOnCellEdit){\r\n\t\t\t\tthis.subscribe(\"cell-value-updated\", this.cellUpdated.bind(this));\r\n\t\t\t\tthis.subscribe(\"row-data-changed\", this.reassignRowToGroup.bind(this), 0);\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"table-built\", this.configureGroupSetup.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"row-deleting\", this.rowDeleting.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHeaders.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.wipe.bind(this));\r\n\t\t\tthis.subscribe(\"rows-added\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"row-moving\", this.rowMoving.bind(this));\r\n\t\t\tthis.subscribe(\"row-adding-index\", this.rowAddingIndex.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"rows-sample\", this.rowSample.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"render-virtual-fill\", this.virtualRenderFill.bind(this));\r\n\r\n\t\t\tthis.registerDisplayHandler(this.displayHandler, 20);\r\n\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\r\n\tconfigureGroupSetup(){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tvar groupBy = this.table.options.groupBy,\r\n\t\t\tstartOpen = this.table.options.groupStartOpen,\r\n\t\t\tgroupHeader = this.table.options.groupHeader;\r\n\r\n\t\t\tthis.allowedValues = this.table.options.groupValues;\r\n\r\n\t\t\tif(Array.isArray(groupBy) && Array.isArray(groupHeader) && groupBy.length > groupHeader.length){\r\n\t\t\t\tconsole.warn(\"Error creating group headers, groupHeader array is shorter than groupBy array\");\r\n\t\t\t}\r\n\r\n\t\t\tthis.headerGenerator = [function(){return \"\";}];\r\n\t\t\tthis.startOpen = [function(){return false;}]; //starting state of group\r\n\r\n\t\t\tthis.langBind(\"groups|item\", (langValue, lang) => {\r\n\t\t\t\tthis.headerGenerator[0] = (value, count, data) => { //header layout function\r\n\t\t\t\t\treturn (typeof value === \"undefined\" ? \"\" : value) + \"(\" + count + \" \" + ((count === 1) ? langValue : lang.groups.items) + \")\";\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tthis.groupIDLookups = [];\r\n\r\n\t\t\tif(Array.isArray(groupBy) || groupBy){\r\n\t\t\t\tif(this.table.modExists(\"columnCalcs\") && this.table.options.columnCalcs != \"table\" && this.table.options.columnCalcs != \"both\"){\r\n\t\t\t\t\tthis.table.modules.columnCalcs.removeCalcs();\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.modExists(\"columnCalcs\") && this.table.options.columnCalcs != \"group\"){\r\n\r\n\t\t\t\t\tvar cols = this.table.columnManager.getRealColumns();\r\n\r\n\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\tif(col.definition.topCalc){\r\n\t\t\t\t\t\t\tthis.table.modules.columnCalcs.initializeTopRow();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(col.definition.bottomCalc){\r\n\t\t\t\t\t\t\tthis.table.modules.columnCalcs.initializeBottomRow();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(!Array.isArray(groupBy)){\r\n\t\t\t\tgroupBy = [groupBy];\r\n\t\t\t}\r\n\r\n\t\t\tgroupBy.forEach((group, i) => {\r\n\t\t\t\tvar lookupFunc, column;\r\n\r\n\t\t\t\tif(typeof group == \"function\"){\r\n\t\t\t\t\tlookupFunc = group;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolumn = this.table.columnManager.getColumnByField(group);\r\n\r\n\t\t\t\t\tif(column){\r\n\t\t\t\t\t\tlookupFunc = function(data){\r\n\t\t\t\t\t\t\treturn column.getFieldValue(data);\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tlookupFunc = function(data){\r\n\t\t\t\t\t\t\treturn data[group];\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.groupIDLookups.push({\r\n\t\t\t\t\tfield: typeof group === \"function\" ? false : group,\r\n\t\t\t\t\tfunc:lookupFunc,\r\n\t\t\t\t\tvalues:this.allowedValues ? this.allowedValues[i] : false,\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t\tif(startOpen){\r\n\t\t\t\tif(!Array.isArray(startOpen)){\r\n\t\t\t\t\tstartOpen = [startOpen];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstartOpen.forEach((level) => {\r\n\t\t\t\t\tlevel = typeof level == \"function\" ? level : function(){return true;};\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.startOpen = startOpen;\r\n\t\t\t}\r\n\r\n\t\t\tif(groupHeader){\r\n\t\t\t\tthis.headerGenerator = Array.isArray(groupHeader) ? groupHeader : [groupHeader];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trowSample(rows, prevValue){\r\n\t\tvar group = this.getGroups(false)[0];\r\n\r\n\t\tprevValue.push(group.getRows(false)[0]);\r\n\r\n\t\treturn prevValue;\r\n\t}\r\n\r\n\tvirtualRenderFill(){\r\n\t\tvar el = this.table.rowManager.tableElement;\r\n\t\tvar rows = this.table.rowManager.getVisibleRows();\r\n\r\n\t\trows = rows.filter((row) => {\r\n\t\t\treturn row.type !== \"group\";\r\n\t\t});\r\n\r\n\t\tel.style.minWidth = !rows.length ? this.table.columnManager.getWidth() + \"px\" : \"\";\r\n\r\n\t\t// if(this.table.options.groupBy){\r\n\t\t// \tif(this.layoutMode() != \"fitDataFill\" && rowsCount == this.table.modules.groupRows.countGroups()){\r\n\t\t// \t\tel.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t// \t}\r\n\t\t// }\r\n\t}\r\n\r\n\trowAddingIndex(row, index, top){\r\n\t\tthis.assignRowToGroup(row);\r\n\r\n\t\tvar groupRows = row.modules.group.rows;\r\n\r\n\t\tif(groupRows.length > 1){\r\n\t\t\tif(!index || (index && groupRows.indexOf(index) == -1)){\r\n\t\t\t\tif(top){\r\n\t\t\t\t\tif(groupRows[0] !== row){\r\n\t\t\t\t\t\tindex = groupRows[0];\r\n\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(groupRows[groupRows.length -1] !== row){\r\n\t\t\t\t\t\tindex = groupRows[groupRows.length -1];\r\n\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn index;\r\n\t}\r\n\r\n\ttrackChanges(){\r\n\t\tthis.dispatch(\"group-changed\");\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tsetGroupBy(groups){\r\n\t\tthis.table.options.groupBy = groups;\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.initialize();\r\n\t\t}else{\r\n\t\t\tthis.configureGroupSetup();\r\n\t\t}\r\n\r\n\t\tthis.refreshData();\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\tsetGroupValues(groupValues){\r\n\t\tthis.table.options.groupValues = groupValues;\r\n\t\tthis.configureGroupSetup();\r\n\t\tthis.refreshData();\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\tsetGroupStartOpen(values){\r\n\t\tthis.table.options.groupStartOpen = values;\r\n\t\tthis.configureGroupSetup();\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\r\n\t\t\tthis.trackChanges();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Grouping Update - cant refresh view, no groups have been set\");\r\n\t\t}\r\n\t}\r\n\r\n\tsetGroupHeader(values){\r\n\t\tthis.table.options.groupHeader = values;\r\n\t\tthis.configureGroupSetup();\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\r\n\t\t\tthis.trackChanges();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Grouping Update - cant refresh view, no groups have been set\");\r\n\t\t}\r\n\t}\r\n\r\n\tuserGetGroups(values){\r\n\t\treturn this.getGroups(true);\r\n\t}\r\n\r\n\t// get grouped table data in the same format as getData()\r\n\tuserGetGroupedData(){\r\n\t\treturn this.table.options.groupBy ?\r\n\t\tthis.getGroupedData() : this.getData()\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////////\r\n\t///////// Component Functions /////////\r\n\t///////////////////////////////////////\r\n\r\n\trowGetGroup(row){\r\n\t\treturn row.modules.group ? row.modules.group.getComponent() : false;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\trowMoving(from, to, after){\r\n\t\tif(!after && to instanceof Group){\r\n\t\t\tto = this.table.rowManager.prevDisplayRow(from) || to;\r\n\t\t}\r\n\r\n\t\tvar toGroup = to instanceof Group ? to : to.modules.group;\r\n\t\tvar fromGroup = from instanceof Group ? from : from.modules.group;\r\n\r\n\t\tif(toGroup === fromGroup){\r\n\t\t\tthis.table.rowManager.moveRowInArray(toGroup.rows, from, to, after);\r\n\t\t}else{\r\n\t\t\tif(fromGroup){\r\n\t\t\t\tfromGroup.removeRow(from);\r\n\t\t\t}\r\n\r\n\t\t\ttoGroup.insertRow(from, to, after);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trowDeleting(row){\r\n\t\t//remove from group\r\n\t\tif(row.modules.group){\r\n\t\t\trow.modules.group.removeRow(row);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trowsUpdated(row){\r\n\t\tthis.updateGroupRows(true);\r\n\t}\r\n\r\n\tcellUpdated(cell){\r\n\t\tthis.reassignRowToGroup(cell.row);\r\n\t}\r\n\r\n\r\n\tsetDisplayIndex(index){\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\r\n\tgetDisplayIndex(){\r\n\t\treturn this.displayIndex;\r\n\t}\r\n\r\n\t//return appropriate rows with group headers\r\n\tgetRows(rows){\r\n\t\tif(this.table.options.groupBy && this.groupIDLookups.length){\r\n\r\n\t\t\tthis.dispatchExternal(\"dataGrouping\");\r\n\r\n\t\t\tthis.generateGroups(rows);\r\n\r\n\t\t\tif(this.subscribedExternal(\"dataGrouped\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataGrouped\", this.getGroups(true));\r\n\t\t\t}\r\n\r\n\t\t\treturn this.updateGroupRows();\r\n\r\n\t\t}else{\r\n\t\t\treturn rows.slice(0);\r\n\t\t}\r\n\t}\r\n\r\n\tgetGroups(component){\r\n\t\tvar groupComponents = [];\r\n\r\n\t\tthis.groupList.forEach(function(group){\r\n\t\t\tgroupComponents.push(component ? group.getComponent() : group);\r\n\t\t});\r\n\r\n\t\treturn groupComponents;\r\n\t}\r\n\r\n\tgetChildGroups(group){\r\n\t\tvar groupComponents = [];\r\n\r\n\t\tif(!group){\r\n\t\t\tgroup = this;\r\n\t\t}\r\n\r\n\t\tgroup.groupList.forEach((child) => {\r\n\t\t\tif(child.groupList.length){\r\n\t\t\t\tgroupComponents = groupComponents.concat(this.getChildGroups(child));\r\n\t\t\t}else{\r\n\t\t\t\tgroupComponents.push(child);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn groupComponents;\r\n\t}\r\n\r\n\twipe(){\r\n\t\tthis.groupList.forEach(function(group){\r\n\t\t\tgroup.wipe();\r\n\t\t});\r\n\t}\r\n\r\n\tpullGroupListData(groupList) {\r\n\t\tvar groupListData = [];\r\n\r\n\t\tgroupList.forEach((group) => {\r\n\t\t\tvar groupHeader = {};\r\n\t\t\tgroupHeader.level = 0;\r\n\t\t\tgroupHeader.rowCount = 0;\r\n\t\t\tgroupHeader.headerContent = \"\";\r\n\t\t\tvar childData = [];\r\n\r\n\t\t\tif (group.hasSubGroups) {\r\n\t\t\t\tchildData = this.pullGroupListData(group.groupList);\r\n\r\n\t\t\t\tgroupHeader.level = group.level;\r\n\t\t\t\tgroupHeader.rowCount = childData.length - group.groupList.length; // data length minus number of sub-headers\r\n\t\t\t\tgroupHeader.headerContent = group.generator(group.key, groupHeader.rowCount, group.rows, group);\r\n\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\t\t\t\tgroupListData = groupListData.concat(childData);\r\n\t\t\t}\r\n\r\n\t\t\telse {\r\n\t\t\t\tgroupHeader.level = group.level;\r\n\t\t\t\tgroupHeader.headerContent = group.generator(group.key, group.rows.length, group.rows, group);\r\n\t\t\t\tgroupHeader.rowCount = group.getRows().length;\r\n\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\r\n\t\t\t\tgroup.getRows().forEach((row) => {\r\n\t\t\t\t\tgroupListData.push(row.getData(\"data\"));\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn groupListData\r\n\t}\r\n\r\n\tgetGroupedData(){\r\n\r\n\t\treturn this.pullGroupListData(this.groupList);\r\n\t}\r\n\r\n\tgetRowGroup(row){\r\n\t\tvar match = false;\r\n\r\n\t\tif(this.options(\"dataTree\")){\r\n\t\t\trow = this.table.modules.dataTree.getTreeParentRoot(row);\r\n\t\t}\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\tvar result = group.getRowGroup(row);\r\n\r\n\t\t\tif(result){\r\n\t\t\t\tmatch = result;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tcountGroups(){\r\n\t\treturn this.groupList.length;\r\n\t}\r\n\r\n\tgenerateGroups(rows){\r\n\t\tvar oldGroups = this.groups;\r\n\r\n\t\tthis.groups = {};\r\n\t\tthis.groupList = [];\r\n\r\n\t\tif(this.allowedValues && this.allowedValues[0]){\r\n\t\t\tthis.allowedValues[0].forEach((value) => {\r\n\t\t\t\tthis.createGroup(value, 0, oldGroups);\r\n\t\t\t});\r\n\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.assignRowToExistingGroup(row, oldGroups);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.assignRowToGroup(row, oldGroups);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tcreateGroup(groupID, level, oldGroups){\r\n\t\tvar groupKey = level + \"_\" + groupID,\r\n\t\tgroup;\r\n\r\n\t\toldGroups = oldGroups || [];\r\n\r\n\t\tgroup = new Group(this, false, level, groupID, this.groupIDLookups[0].field, this.headerGenerator[0], oldGroups[groupKey]);\r\n\r\n\t\tthis.groups[groupKey] = group;\r\n\t\tthis.groupList.push(group);\r\n\t}\r\n\r\n\tassignRowToExistingGroup(row, oldGroups){\r\n\t\tvar groupID = this.groupIDLookups[0].func(row.getData()),\r\n\t\tgroupKey = \"0_\" + groupID;\r\n\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t}\r\n\t}\r\n\r\n\tassignRowToGroup(row, oldGroups){\r\n\t\tvar groupID = this.groupIDLookups[0].func(row.getData()),\r\n\t\tnewGroupNeeded = !this.groups[\"0_\" + groupID];\r\n\r\n\t\tif(newGroupNeeded){\r\n\t\t\tthis.createGroup(groupID, 0, oldGroups);\r\n\t\t}\r\n\r\n\t\tthis.groups[\"0_\" + groupID].addRow(row);\r\n\r\n\t\treturn !newGroupNeeded;\r\n\t}\r\n\r\n\treassignRowToGroup(row){\r\n\t\tif(row.type === \"row\"){\r\n\t\t\tvar oldRowGroup = row.modules.group,\r\n\t\t\toldGroupPath = oldRowGroup.getPath(),\r\n\t\t\tnewGroupPath = this.getExpectedPath(row),\r\n\t\t\tsamePath = true;\r\n\r\n\t\t\t// figure out if new group path is the same as old group path\r\n\t\t\tvar samePath = (oldGroupPath.length == newGroupPath.length) && oldGroupPath.every((element, index) => {\r\n\t\t\t\treturn element === newGroupPath[index];\r\n\t\t\t});\r\n\r\n\t\t\t// refresh if they new path and old path aren't the same (aka the row's groupings have changed)\r\n\t\t\tif(!samePath) {\r\n\t\t\t\toldRowGroup.removeRow(row);\r\n\t\t\t\tthis.assignRowToGroup(row, this.groups);\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgetExpectedPath(row) {\r\n\t\tvar groupPath = [], rowData = row.getData();\r\n\r\n\t\tthis.groupIDLookups.forEach((groupId) => {\r\n\t\t\tgroupPath.push(groupId.func(rowData));\r\n\t\t});\r\n\r\n\t\treturn groupPath;\r\n\t}\r\n\r\n\tupdateGroupRows(force){\r\n\t\tvar output = [],\r\n\t\toldRowCount;\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\toutput = output.concat(group.getHeadersAndRows());\r\n\t\t});\r\n\r\n\t\tif(force){\r\n\t\t\tthis.refreshData(true, this.displayHandler);\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tscrollHeaders(left){\r\n\t\tif(this.table.options.renderHorizontal === \"virtual\"){\r\n\t\t\tleft -= this.table.columnManager.renderer.vDomPadLeft;\r\n\t\t}\r\n\r\n\t\tleft = left + \"px\";\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\tgroup.scrollHeader(left);\r\n\t\t});\r\n\t}\r\n\r\n\tremoveGroup(group){\r\n\t\tvar groupKey = group.level + \"_\" + group.key,\r\n\t\tindex;\r\n\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tdelete this.groups[groupKey];\r\n\r\n\t\t\tindex = this.groupList.indexOf(group);\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.groupList.splice(index, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nGroupRows.moduleName = \"groupRows\";\r\n\r\nexport default GroupRows;","export default {\r\n\tcellEdit: function(action){\r\n\t\taction.component.setValueProcessData(action.data.oldValue);\r\n\t\taction.component.cellRendered();\r\n\t},\r\n\r\n\trowAdd: function(action){\r\n\t\taction.component.deleteActual();\r\n\t},\r\n\r\n\trowDelete: function(action){\r\n\t\tvar newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index);\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tthis.table.modules.groupRows.updateGroupRows(true);\r\n\t\t}\r\n\r\n\t\tthis._rebindRow(action.component, newRow);\r\n\t},\r\n\r\n\trowMove: function(action){\r\n\t\tthis.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posFrom], !action.data.after);\r\n\t\tthis.table.rowManager.redraw();\r\n\t},\r\n};","export default {\r\n\tcellEdit: function(action){\r\n\t\taction.component.setValueProcessData(action.data.newValue);\r\n\t\taction.component.cellRendered();\r\n\t},\r\n\r\n\trowAdd: function(action){\r\n\t\tvar newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index);\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tthis.table.modules.groupRows.updateGroupRows(true);\r\n\t\t}\r\n\r\n\t\tthis._rebindRow(action.component, newRow);\r\n\t},\r\n\r\n\trowDelete:function(action){\r\n\t\taction.component.deleteActual();\r\n\t},\r\n\r\n\trowMove: function(action){\r\n\t\tthis.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posTo], action.data.after);\r\n\t\tthis.table.rowManager.redraw();\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\nimport Row from '../../core/row/Row.js';\r\nimport Cell from '../../core/cell/Cell.js';\r\n\r\nimport defaultUndoers from './defaults/undoers.js';\r\nimport defaultRedoers from './defaults/redoers.js';\r\n\r\nclass History extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.history = [];\r\n\t\tthis.index = -1;\r\n\r\n\t\tthis.registerTableOption(\"history\", false); //enable edit history\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.history){\r\n\t\t\tthis.subscribe(\"cell-value-updated\", this.cellUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"cell-delete\", this.clearComponentHistory.bind(this));\r\n\t\t\tthis.subscribe(\"row-delete\", this.rowDeleted.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.clear.bind(this));\r\n\t\t\tthis.subscribe(\"row-added\", this.rowAdded.bind(this));\r\n\t\t\tthis.subscribe(\"row-move\", this.rowMoved.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"undo\", this.undo.bind(this));\r\n\t\tthis.registerTableFunction(\"redo\", this.redo.bind(this));\r\n\t\tthis.registerTableFunction(\"getHistoryUndoSize\", this.getHistoryUndoSize.bind(this));\r\n\t\tthis.registerTableFunction(\"getHistoryRedoSize\", this.getHistoryRedoSize.bind(this));\r\n\t\tthis.registerTableFunction(\"clearHistory\", this.clear.bind(this));\r\n\t}\r\n\r\n\trowMoved(from, to, after){\r\n\t\tthis.action(\"rowMove\", from, {posFrom:this.table.rowManager.getRowPosition(from), posTo:this.table.rowManager.getRowPosition(to), to:to, after:after});\r\n\t}\r\n\r\n\trowAdded(row, data, pos, index){\r\n\t\tthis.action(\"rowAdd\", row, {data:data, pos:pos, index:index});\r\n\t}\r\n\r\n\trowDeleted(row){\r\n\t\tvar index, rows;\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\r\n\t\t\trows = row.getComponent().getGroup().rows\r\n\t\t\tindex = rows.indexOf(row);\r\n\r\n\t\t\tif(index){\r\n\t\t\t\tindex = rows[index-1];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tindex = row.table.rowManager.getRowIndex(row);\r\n\r\n\t\t\tif(index){\r\n\t\t\t\tindex = row.table.rowManager.rows[index-1];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.action(\"rowDelete\", row, {data:row.getData(), pos:!index, index:index});\r\n\t}\r\n\r\n\tcellUpdated(cell){\r\n\t\tthis.action(\"cellEdit\", cell, {oldValue:cell.oldValue, newValue:cell.value});\r\n\t}\r\n\r\n\tclear(){\r\n\t\tthis.history = [];\r\n\t\tthis.index = -1;\r\n\t}\r\n\r\n\taction(type, component, data){\r\n\t\tthis.history = this.history.slice(0, this.index + 1);\r\n\r\n\t\tthis.history.push({\r\n\t\t\ttype:type,\r\n\t\t\tcomponent:component,\r\n\t\t\tdata:data,\r\n\t\t});\r\n\r\n\t\tthis.index ++;\r\n\t}\r\n\r\n\tgetHistoryUndoSize(){\r\n\t\treturn this.index + 1;\r\n\t}\r\n\r\n\tgetHistoryRedoSize(){\r\n\t\treturn this.history.length - (this.index + 1);\r\n\t}\r\n\r\n\tclearComponentHistory(component){\r\n\t\tvar index = this.history.findIndex(function(item){\r\n\t\t\treturn item.component === component;\r\n\t\t});\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.history.splice(index, 1);\r\n\t\t\tif(index <= this.index){\r\n\t\t\t\tthis.index--;\r\n\t\t\t}\r\n\r\n\t\t\tthis.clearComponentHistory(component);\r\n\t\t}\r\n\t}\r\n\r\n\tundo(){\r\n\t\tif(this.index > -1){\r\n\t\t\tlet action = this.history[this.index];\r\n\r\n\t\t\tHistory.undoers[action.type].call(this, action);\r\n\r\n\t\t\tthis.index--;\r\n\r\n\t\t\tthis.dispatchExternal(\"historyUndo\", action.type, action.component.getComponent(), action.data);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"History Undo Error - No more history to undo\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tredo(){\r\n\t\tif(this.history.length-1 > this.index){\r\n\r\n\t\t\tthis.index++;\r\n\r\n\t\t\tlet action = this.history[this.index];\r\n\r\n\t\t\tHistory.redoers[action.type].call(this, action);\r\n\r\n\t\t\tthis.dispatchExternal(\"historyRedo\", action.type, action.component.getComponent(), action.data);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"History Redo Error - No more history to redo\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//rebind rows to new element after deletion\r\n\t_rebindRow(oldRow, newRow){\r\n\t\tthis.history.forEach(function(action){\r\n\t\t\tif(action.component instanceof Row){\r\n\t\t\t\tif(action.component === oldRow){\r\n\t\t\t\t\taction.component = newRow;\r\n\t\t\t\t}\r\n\t\t\t}else if(action.component instanceof Cell){\r\n\t\t\t\tif(action.component.row === oldRow){\r\n\t\t\t\t\tvar field = action.component.column.getField();\r\n\r\n\t\t\t\t\tif(field){\r\n\t\t\t\t\t\taction.component = newRow.getCell(field);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n\r\nHistory.moduleName = \"history\";\r\n\r\n//load defaults\r\nHistory.undoers = defaultUndoers;\r\nHistory.redoers = defaultRedoers;\r\n\r\nexport default History;","import Module from '../../core/Module.js';\r\nimport Column from '../../core/column/Column.js';\r\n\r\nclass HtmlTableImport extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.fieldIndex = [];\r\n\t\tthis.hasIndex = false;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.tableElementCheck();\r\n\t}\r\n\r\n\ttableElementCheck(){\r\n\t\tif(this.table.originalElement && this.table.originalElement.tagName === \"TABLE\"){\r\n\t\t\tif(this.table.originalElement.childNodes.length){\r\n\t\t\t\tthis.parseTable();\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Unable to parse data from empty table tag, Tabulator should be initialized on a div tag unless importing data from a table element.\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tparseTable(){\r\n\t\tvar element = this.table.originalElement,\r\n\t\toptions = this.table.options,\r\n\t\tcolumns = options.columns,\r\n\t\theaders = element.getElementsByTagName(\"th\"),\r\n\t\trows = element.getElementsByTagName(\"tbody\")[0],\r\n\t\tdata = [],\r\n\t\tnewTable;\r\n\r\n\t\tthis.hasIndex = false;\r\n\r\n\t\tthis.dispatchExternal(\"htmlImporting\");\r\n\r\n\t\trows = rows ? rows.getElementsByTagName(\"tr\") : [];\r\n\r\n\t\t//check for Tabulator inline options\r\n\t\tthis._extractOptions(element, options);\r\n\r\n\t\tif(headers.length){\r\n\t\t\tthis._extractHeaders(headers, rows);\r\n\t\t}else{\r\n\t\t\tthis._generateBlankHeaders(headers, rows);\r\n\t\t}\r\n\r\n\t\t//iterate through table rows and build data set\r\n\t\tfor(var index = 0; index < rows.length; index++){\r\n\t\t\tvar row = rows[index],\r\n\t\t\tcells = row.getElementsByTagName(\"td\"),\r\n\t\t\titem = {};\r\n\r\n\t\t\t//create index if the dont exist in table\r\n\t\t\tif(!this.hasIndex){\r\n\t\t\t\titem[options.index] = index;\r\n\t\t\t}\r\n\r\n\t\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\t\tvar cell = cells[i];\r\n\t\t\t\tif(typeof this.fieldIndex[i] !== \"undefined\"){\r\n\t\t\t\t\titem[this.fieldIndex[i]] = cell.innerHTML;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//add row data to item\r\n\t\t\tdata.push(item);\r\n\t\t}\r\n\r\n\t\toptions.data = data;\r\n\r\n\t\tthis.dispatchExternal(\"htmlImported\");\r\n\t}\r\n\r\n\t//extract tabulator attribute options\r\n\t_extractOptions(element, options, defaultOptions){\r\n\t\tvar attributes = element.attributes;\r\n\t\tvar optionsArr = defaultOptions ? Object.keys(defaultOptions) : Object.keys(options);\r\n\t\tvar optionsList = {};\r\n\r\n\t\toptionsArr.forEach((item) => {\r\n\t\t\toptionsList[item.toLowerCase()] = item;\r\n\t\t});\r\n\r\n\t\tfor(var index in attributes){\r\n\t\t\tvar attrib = attributes[index];\r\n\t\t\tvar name;\r\n\r\n\t\t\tif(attrib && typeof attrib == \"object\" && attrib.name && attrib.name.indexOf(\"tabulator-\") === 0){\r\n\t\t\t\tname = attrib.name.replace(\"tabulator-\", \"\");\r\n\r\n\t\t\t\tif(typeof optionsList[name] !== \"undefined\"){\r\n\t\t\t\t\toptions[optionsList[name]] = this._attribValue(attrib.value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//get value of attribute\r\n\t_attribValue(value){\r\n\t\tif(value === \"true\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif(value === \"false\"){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\t//find column if it has already been defined\r\n\t_findCol(title){\r\n\t\tvar match = this.table.options.columns.find((column) => {\r\n\t\t\treturn column.title === title;\r\n\t\t});\r\n\r\n\t\treturn match || false;\r\n\t}\r\n\r\n\t//extract column from headers\r\n\t_extractHeaders(headers, rows){\r\n\t\tfor(var index = 0; index < headers.length; index++){\r\n\t\t\tvar header = headers[index],\r\n\t\t\texists = false,\r\n\t\t\tcol = this._findCol(header.textContent),\r\n\t\t\twidth, attributes;\r\n\r\n\t\t\tif(col){\r\n\t\t\t\texists = true;\r\n\t\t\t}else{\r\n\t\t\t\tcol = {title:header.textContent.trim()};\r\n\t\t\t}\r\n\r\n\t\t\tif(!col.field) {\r\n\t\t\t\tcol.field = header.textContent.trim().toLowerCase().replace(\" \", \"_\");\r\n\t\t\t}\r\n\r\n\t\t\twidth = header.getAttribute(\"width\");\r\n\r\n\t\t\tif(width && !col.width)\t{\r\n\t\t\t\tcol.width = width;\r\n\t\t\t}\r\n\r\n\t\t\t//check for Tabulator inline options\r\n\t\t\tthis._extractOptions(header, col, this.table.columnManager.optionsList.registeredDefaults);\r\n\r\n\t\t\tthis.fieldIndex[index] = col.field;\r\n\r\n\t\t\tif(col.field == this.table.options.index){\r\n\t\t\t\tthis.hasIndex = true;\r\n\t\t\t}\r\n\r\n\t\t\tif(!exists){\r\n\t\t\t\tthis.table.options.columns.push(col);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\r\n\t//generate blank headers\r\n\t_generateBlankHeaders(headers, rows){\r\n\t\tfor(var index = 0; index < headers.length; index++){\r\n\t\t\tvar header = headers[index],\r\n\t\t\tcol = {title:\"\", field:\"col\" + index};\r\n\r\n\t\t\tthis.fieldIndex[index] = col.field;\r\n\r\n\t\t\tvar width = header.getAttribute(\"width\");\r\n\r\n\t\t\tif(width){\r\n\t\t\t\tcol.width = width;\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.options.columns.push(col);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nHtmlTableImport.moduleName = \"htmlTableImport\";\r\n\r\nexport default HtmlTableImport;","function csvImporter(input){\r\n var data = [],\r\n row = 0, \r\n col = 0,\r\n inQuote = false;\r\n \r\n //Iterate over each character\r\n for (let index = 0; index < input.length; index++) {\r\n let char = input[index], \r\n nextChar = input[index+1]; \r\n \r\n //Initialize empty row\r\n if(!data[row]){\r\n data[row] = [];\r\n }\r\n\r\n //Initialize empty column\r\n if(!data[row][col]){\r\n data[row][col] = \"\";\r\n }\r\n \r\n //Handle quotation mark inside string\r\n if (char == '\"' && inQuote && nextChar == '\"') { \r\n data[row][col] += char; \r\n index++;\r\n continue; \r\n }\r\n \r\n //Begin / End Quote\r\n if (char == '\"') { \r\n inQuote = !inQuote;\r\n continue;\r\n }\r\n \r\n //Next column (if not in quote)\r\n if (char == ',' && !inQuote) { \r\n col++;\r\n continue; \r\n }\r\n \r\n //New row if new line and not in quote (CRLF) \r\n if (char == '\\r' && nextChar == '\\n' && !inQuote) { \r\n col = 0; \r\n row++; \r\n index++; \r\n continue; \r\n }\r\n \r\n //New row if new line and not in quote (CR or LF) \r\n if ((char == '\\r' || char == '\\n') && !inQuote) { \r\n col = 0;\r\n row++;\r\n continue; \r\n }\r\n\r\n //Normal Character, append to column\r\n data[row][col] += char;\r\n }\r\n\r\n return data;\r\n}\r\n\r\nexport default csvImporter;","export default function(input){\r\n try {\r\n return JSON.parse(input);\r\n } catch(e) {\r\n console.warn(\"JSON Import Error - File contents is invalid JSON\", e);\r\n return Promise.reject();\r\n }\r\n}","import csv from './importers/csv.js';\r\nimport json from './importers/json.js';\r\n\r\nexport default {\r\n\tcsv:csv,\r\n\tjson:json,\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultImporters from './defaults/importers.js';\r\n\r\nclass Import extends Module{\r\n \r\n constructor(table){\r\n super(table);\r\n \r\n this.registerTableOption(\"importFormat\");\r\n this.registerTableOption(\"importReader\", \"text\");\r\n }\r\n \r\n initialize(){\r\n this.registerTableFunction(\"import\", this.importFromFile.bind(this));\r\n\r\n if(this.table.options.importFormat){\r\n this.subscribe(\"data-loading\", this.loadDataCheck.bind(this), 10);\r\n this.subscribe(\"data-load\", this.loadData.bind(this), 10);\r\n }\r\n }\r\n\r\n loadDataCheck(data){\r\n return typeof data === \"string\";\r\n }\r\n\r\n loadData(data, params, config, silent, previousData){\r\n return this.importData(this.lookupImporter(), data)\r\n .then(this.structureData.bind(this))\r\n .catch((err) => {\r\n console.error(\"Import Error:\", err || \"Unable to import data\")\r\n return Promise.reject(err);\r\n })\r\n }\r\n\r\n lookupImporter(importFormat){\r\n var importer;\r\n \r\n if(!importFormat){\r\n importFormat = this.table.options.importFormat;\r\n }\r\n \r\n if(typeof importFormat === \"string\"){\r\n importer = Import.importers[importFormat];\r\n }else{\r\n importer = importFormat;\r\n }\r\n\r\n if(!importer){\r\n console.error(\"Import Error - Importer not found:\", importFormat);\r\n }\r\n \r\n return importer;\r\n }\r\n \r\n importFromFile(importFormat, extension){\r\n var importer = this.lookupImporter(importFormat);\r\n \r\n if(importer){\r\n return this.pickFile(extension)\r\n .then(this.importData.bind(this, importer))\r\n .then(this.structureData.bind(this))\r\n .then(this.setData.bind(this))\r\n .catch((err) => {\r\n console.error(\"Import Error:\", err || \"Unable to import file\")\r\n return Promise.reject(err);\r\n })\r\n }\r\n }\r\n \r\n pickFile(extensions){\r\n return new Promise((resolve, reject) => {\r\n var input = document.createElement(\"input\");\r\n input.type = \"file\";\r\n input.accept = extensions;\r\n \r\n input.addEventListener(\"change\", (e) => {\r\n var file = input.files[0],\r\n reader = new FileReader(),\r\n data;\r\n \r\n switch(this.table.options.importReader){\r\n case \"buffer\":\r\n reader.readAsArrayBuffer(file);\r\n break;\r\n\r\n case \"binary\":\r\n reader.readAsBinaryString(file);\r\n break;\r\n\r\n case \"url\":\r\n reader.readAsDataURL(file);\r\n break;\r\n\r\n case \"text\":\r\n default:\r\n reader.readAsText(file);\r\n }\r\n \r\n reader.onload = (e) => {\r\n resolve(reader.result)\r\n };\r\n \r\n reader.onerror = (e) => {\r\n console.warn(\"File Load Error - Unable to read file\");\r\n reject();\r\n };\r\n });\r\n \r\n input.click();\r\n });\r\n }\r\n \r\n importData(importer, fileContents){\r\n var data = importer.call(this.table, fileContents);\r\n \r\n if(data instanceof Promise){\r\n return data;\r\n }else{\r\n return data ? Promise.resolve(data) : Promise.reject();\r\n }\r\n }\r\n\r\n structureData(parsedData){\r\n var data = [];\r\n \r\n if(Array.isArray(parsedData) && parsedData.length && Array.isArray(parsedData[0])){\r\n if(this.table.options.autoColumns){\r\n data = this.structureArrayToObject(parsedData);\r\n }else{\r\n data = this.structureArrayToColumns(parsedData);\r\n }\r\n\r\n return data;\r\n }else{\r\n return parsedData;\r\n }\r\n }\r\n\r\n structureArrayToObject(parsedData){\r\n var columns = parsedData.shift();\r\n\r\n var data = parsedData.map((values) => {\r\n var row = {};\r\n\r\n columns.forEach((key, i) => {\r\n row[key] = values[i];\r\n })\r\n\r\n return row;\r\n })\r\n\r\n return data;\r\n }\r\n\r\n structureArrayToColumns(parsedData){\r\n var data = [],\r\n columns = this.table.getColumns();\r\n\r\n //remove first row if it is the column names\r\n if(columns[0] && parsedData[0][0]){\r\n if(columns[0].getDefinition().title === parsedData[0][0]){\r\n parsedData.shift();\r\n }\r\n }\r\n \r\n //convert row arrays to objects\r\n parsedData.forEach((rowData) => {\r\n var row = {};\r\n\r\n rowData.forEach((value, index) => {\r\n var column = columns[index];\r\n\r\n if(column){\r\n row[column.getField()] = value;\r\n }\r\n })\r\n\r\n data.push(row);\r\n });\r\n\r\n return data;\r\n }\r\n \r\n setData(data){\r\n return this.table.setData(data);\r\n }\r\n}\r\n\r\nImport.moduleName = \"import\";\r\n\r\n//load defaults\r\nImport.importers = defaultImporters;\r\n\r\nexport default Import;","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport Cell from '../../core/cell/Cell';\r\nimport Column from '../../core/column/Column';\r\n\r\nclass Interaction extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.eventMap = {\r\n\t\t\t//row events\r\n\t\t\trowClick:\"row-click\",\r\n\t\t\trowDblClick:\"row-dblclick\",\r\n\t\t\trowContext:\"row-contextmenu\",\r\n\t\t\trowMouseEnter:\"row-mouseenter\",\r\n\t\t\trowMouseLeave:\"row-mouseleave\",\r\n\t\t\trowMouseOver:\"row-mouseover\",\r\n\t\t\trowMouseOut:\"row-mouseout\",\r\n\t\t\trowMouseMove:\"row-mousemove\",\r\n\t\t\trowTap:\"row\",\r\n\t\t\trowDblTap:\"row\",\r\n\t\t\trowTapHold:\"row\",\r\n\r\n\t\t\t//cell events\r\n\t\t\tcellClick:\"cell-click\",\r\n\t\t\tcellDblClick:\"cell-dblclick\",\r\n\t\t\tcellContext:\"cell-contextmenu\",\r\n\t\t\tcellMouseEnter:\"cell-mouseenter\",\r\n\t\t\tcellMouseLeave:\"cell-mouseleave\",\r\n\t\t\tcellMouseOver:\"cell-mouseover\",\r\n\t\t\tcellMouseOut:\"cell-mouseout\",\r\n\t\t\tcellMouseMove:\"cell-mousemove\",\r\n\t\t\tcellTap:\"cell\",\r\n\t\t\tcellDblTap:\"cell\",\r\n\t\t\tcellTapHold:\"cell\",\r\n\r\n\t\t\t//column header events\r\n\t\t\theaderClick:\"column-click\",\r\n\t\t\theaderDblClick:\"column-dblclick\",\r\n\t\t\theaderContext:\"column-contextmenu\",\r\n\t\t\theaderMouseEnter:\"column-mouseenter\",\r\n\t\t\theaderMouseLeave:\"column-mouseleave\",\r\n\t\t\theaderMouseOver:\"column-mouseover\",\r\n\t\t\theaderMouseOut:\"column-mouseout\",\r\n\t\t\theaderMouseMove:\"column-mousemove\",\r\n\t\t\theaderTap:\"column\",\r\n\t\t\theaderDblTap:\"column\",\r\n\t\t\theaderTapHold:\"column\",\r\n\r\n\t\t\t//group header\r\n\t\t\tgroupClick:\"group-click\",\r\n\t\t\tgroupDblClick:\"group-dblclick\",\r\n\t\t\tgroupContext:\"group-contextmenu\",\r\n\t\t\tgroupMouseEnter:\"group-mouseenter\",\r\n\t\t\tgroupMouseLeave:\"group-mouseleave\",\r\n\t\t\tgroupMouseOver:\"group-mouseover\",\r\n\t\t\tgroupMouseOut:\"group-mouseout\",\r\n\t\t\tgroupMouseMove:\"group-mousemove\",\r\n\t\t\tgroupTap:\"group\",\r\n\t\t\tgroupDblTap:\"group\",\r\n\t\t\tgroupTapHold:\"group\",\r\n\t\t}\r\n\r\n\t\tthis.subscribers = {};\r\n\r\n\t\tthis.touchSubscribers = {};\r\n\r\n\t\tthis.columnSubscribers = {};\r\n\r\n\t\tthis.touchWatchers = {\r\n\t\t\trow:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tcell:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tcolumn:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tgroup:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.registerColumnOption(\"headerClick\");\r\n\t\tthis.registerColumnOption(\"headerDblClick\");\r\n\t\tthis.registerColumnOption(\"headerContext\");\r\n\t\tthis.registerColumnOption(\"headerMouseEnter\");\r\n\t\tthis.registerColumnOption(\"headerMouseLeave\");\r\n\t\tthis.registerColumnOption(\"headerMouseOver\");\r\n\t\tthis.registerColumnOption(\"headerMouseOut\");\r\n\t\tthis.registerColumnOption(\"headerMouseMove\");\r\n\t\tthis.registerColumnOption(\"headerTap\");\r\n\t\tthis.registerColumnOption(\"headerDblTap\");\r\n\t\tthis.registerColumnOption(\"headerTapHold\");\r\n\r\n\t\tthis.registerColumnOption(\"cellClick\");\r\n\t\tthis.registerColumnOption(\"cellDblClick\");\r\n\t\tthis.registerColumnOption(\"cellContext\");\r\n\t\tthis.registerColumnOption(\"cellMouseEnter\");\r\n\t\tthis.registerColumnOption(\"cellMouseLeave\");\r\n\t\tthis.registerColumnOption(\"cellMouseOver\");\r\n\t\tthis.registerColumnOption(\"cellMouseOut\");\r\n\t\tthis.registerColumnOption(\"cellMouseMove\");\r\n\t\tthis.registerColumnOption(\"cellTap\");\r\n\t\tthis.registerColumnOption(\"cellDblTap\");\r\n\t\tthis.registerColumnOption(\"cellTapHold\");\r\n\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.initializeExternalEvents();\r\n\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this))\r\n\t\tthis.subscribe(\"cell-dblclick\", this.cellContentsSelectionFixer.bind(this))\r\n\t}\r\n\r\n\tcellContentsSelectionFixer(e, cell){\r\n\t\tif(this.table.modExists(\"edit\")){\r\n\t\t\tif (this.table.modules.edit.currentCell === this){\r\n\t\t\t\treturn; //prevent instant selection of editor content\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\ttry{\r\n\t\t\tif (document.selection) { // IE\r\n\t\t\t\tvar range = document.body.createTextRange();\r\n\t\t\t\trange.moveToElementText(this.element);\r\n\t\t\t\trange.select();\r\n\t\t\t} else if (window.getSelection) {\r\n\t\t\t\tvar range = document.createRange();\r\n\t\t\t\trange.selectNode(this.element);\r\n\t\t\t\twindow.getSelection().removeAllRanges();\r\n\t\t\t\twindow.getSelection().addRange(range);\r\n\t\t\t}\r\n\t\t}catch(e){}\r\n\t}\r\n\r\n\tinitializeExternalEvents(){\r\n\t\tfor(let key in this.eventMap){\r\n\t\t\tthis.subscriptionChangeExternal(key, this.subscriptionChanged.bind(this, key))\r\n\t\t}\r\n\t}\r\n\r\n\tsubscriptionChanged(key, added){\r\n\t\tvar index;\r\n\r\n\t\tif(added){\r\n\t\t\tif(!this.subscribers[key]){\r\n\t\t\t\tif(this.eventMap[key].includes(\"-\")){\r\n\t\t\t\t\tthis.subscribers[key] = this.handle.bind(this, key);\r\n\t\t\t\t\tthis.subscribe(this.eventMap[key], this.subscribers[key]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.subscribeTouchEvents(key);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.eventMap[key].includes(\"-\")){\r\n\t\t\t\tif(this.subscribers[key] && !this.columnSubscribers[key] && !this.subscribedExternal(key)){\r\n\t\t\t\t\tthis.unsubscribe(this.eventMap[key], this.subscribers[key]);\r\n\t\t\t\t\tdelete this.subscribers[key];\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.unsubscribeTouchEvents(key);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tsubscribeTouchEvents(key){\r\n\t\tvar type = this.eventMap[key];\r\n\r\n\t\tif(!this.touchSubscribers[type + \"-touchstart\"]){\r\n\t\t\tthis.touchSubscribers[type + \"-touchstart\"] = this.handleTouch.bind(this, type, \"start\");\r\n\t\t\tthis.touchSubscribers[type + \"-touchend\"] = this.handleTouch.bind(this, type, \"end\");\r\n\r\n\t\t\tthis.subscribe(type + \"-touchstart\", this.touchSubscribers[type + \"-touchstart\"]);\r\n\t\t\tthis.subscribe(type + \"-touchend\", this.touchSubscribers[type + \"-touchend\"]);\r\n\t\t}\r\n\r\n\t\tthis.subscribers[key] = true;\r\n\t}\r\n\r\n\tunsubscribeTouchEvents(key){\r\n\t\tvar notouch = true,\r\n\t\ttype = this.eventMap[key];\r\n\r\n\t\tif(this.subscribers[key] && !this.subscribedExternal(key)){\r\n\t\t\tdelete this.subscribers[key];\r\n\r\n\t\t\tfor(let i in this.eventMap){\r\n\t\t\t\tif(this.eventMap[i] === type){\r\n\t\t\t\t\tif(this.subscribers[i]){\r\n\t\t\t\t\t\tnotouch = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(notouch){\r\n\t\t\t\tthis.unsubscribe(type + \"-touchstart\", this.touchSubscribers[type + \"-touchstart\"]);\r\n\t\t\t\tthis.unsubscribe(type + \"-touchend\", this.touchSubscribers[type + \"-touchend\"]);\r\n\r\n\t\t\t\tdelete this.touchSubscribers[type + \"-touchstart\"];\r\n\t\t\t\tdelete this.touchSubscribers[type + \"-touchend\"];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.definition;\r\n\r\n\t\tfor(let key in this.eventMap){\r\n\t\t\tif(def[key]){\r\n\t\t\t\tthis.subscriptionChanged(key, true);\r\n\r\n\t\t\t\tif(!this.columnSubscribers[key]){\r\n\t\t\t\t\tthis.columnSubscribers[key] = [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.columnSubscribers[key].push(column);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\thandle(action, e, component){\r\n\t\tthis.dispatchEvent(action, e, component);\r\n\t}\r\n\r\n\thandleTouch(type, action, e, component){\r\n\t\tvar watchers = this.touchWatchers[type];\r\n\r\n\t\tif(type === \"column\"){\r\n\t\t\ttype = \"header\";\r\n\t\t}\r\n\r\n\t\tswitch(action){\r\n\t\t\tcase \"start\":\r\n\t\t\twatchers.tap = true;\r\n\r\n\t\t\tclearTimeout(watchers.tapHold);\r\n\r\n\t\t\twatchers.tapHold = setTimeout(() => {\r\n\t\t\t\tclearTimeout(watchers.tapHold);\r\n\t\t\t\twatchers.tapHold = null;\r\n\r\n\t\t\t\twatchers.tap = null;\r\n\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\twatchers.tapDbl = null;\r\n\r\n\t\t\t\tthis.dispatchEvent(type + \"TapHold\", e, component);\r\n\t\t\t}, 1000);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"end\":\r\n\t\t\tif(watchers.tap){\r\n\r\n\t\t\t\twatchers.tap = null;\r\n\t\t\t\tthis.dispatchEvent(type + \"Tap\", e, component);\r\n\t\t\t}\r\n\r\n\t\t\tif(watchers.tapDbl){\r\n\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\twatchers.tapDbl = null;\r\n\r\n\t\t\t\tthis.dispatchEvent(type + \"DblTap\", e, component);\r\n\t\t\t}else{\r\n\t\t\t\twatchers.tapDbl = setTimeout(() => {\r\n\t\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\t\twatchers.tapDbl = null;\r\n\t\t\t\t}, 300);\r\n\t\t\t}\r\n\r\n\t\t\tclearTimeout(watchers.tapHold);\r\n\t\t\twatchers.tapHold = null;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tdispatchEvent(action, e, component){\r\n\t\tvar componentObj = component.getComponent(),\r\n\t\tcallback;\r\n\r\n\t\tif(this.columnSubscribers[action]){\r\n\r\n\t\t\tif(component instanceof Cell){\r\n\t\t\t\tcallback = component.column.definition[action];\r\n\t\t\t}else if(component instanceof Column){\r\n\t\t\t\tcallback = component.definition[action];\r\n\t\t\t}\r\n\r\n\t\t\tif(callback){\r\n\t\t\t\tcallback(e, componentObj);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(action, e, componentObj);\r\n\t}\r\n}\r\n\r\nInteraction.moduleName = \"interaction\";\r\n\r\nexport default Interaction;","export default {\r\n\tnavPrev:\"shift + 9\",\r\n\tnavNext:9,\r\n\tnavUp:38,\r\n\tnavDown:40,\r\n\tscrollPageUp:33,\r\n\tscrollPageDown:34,\r\n\tscrollToStart:36,\r\n\tscrollToEnd:35,\r\n\tundo:[\"ctrl + 90\", \"meta + 90\"],\r\n\tredo:[\"ctrl + 89\", \"meta + 89\"],\r\n\tcopyToClipboard:[\"ctrl + 67\", \"meta + 89\"],\r\n};","export default {\r\n\tkeyBlock:function(e){\r\n\t\te.stopPropagation();\r\n\t\te.preventDefault();\r\n\t},\r\n\tscrollPageUp:function(e){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tnewPos = rowManager.scrollTop - rowManager.element.clientHeight,\r\n\t\tscrollMax = rowManager.element.scrollHeight;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\tif(newPos >= 0){\r\n\t\t\t\trowManager.element.scrollTop = newPos;\r\n\t\t\t}else{\r\n\t\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[0]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tscrollPageDown:function(e){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tnewPos = rowManager.scrollTop + rowManager.element.clientHeight,\r\n\t\tscrollMax = rowManager.element.scrollHeight;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\tif(newPos <= scrollMax){\r\n\t\t\t\trowManager.element.scrollTop = newPos;\r\n\t\t\t}else{\r\n\t\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\r\n\t},\r\n\tscrollToStart:function(e){\r\n\t\tvar rowManager = this.table.rowManager;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[0]);\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tscrollToEnd:function(e){\r\n\t\tvar rowManager = this.table.rowManager;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]);\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tnavPrev:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-prev\", e);\r\n\t},\r\n\r\n\tnavNext:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-next\", e);\r\n\t},\r\n\r\n\tnavLeft:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-left\", e);\r\n\t},\r\n\r\n\tnavRight:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-right\", e);\r\n\t},\r\n\r\n\tnavUp:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-up\", e);\r\n\t},\r\n\r\n\tnavDown:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-down\", e);\r\n\t},\r\n\r\n\tundo:function(e){\r\n\t\tvar cell = false;\r\n\t\tif(this.table.options.history && this.table.modExists(\"history\") && this.table.modExists(\"edit\")){\r\n\r\n\t\t\tcell = this.table.modules.edit.currentCell;\r\n\r\n\t\t\tif(!cell){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tthis.table.modules.history.undo();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tredo:function(e){\r\n\t\tvar cell = false;\r\n\t\tif(this.table.options.history && this.table.modExists(\"history\") && this.table.modExists(\"edit\")){\r\n\r\n\t\t\tcell = this.table.modules.edit.currentCell;\r\n\r\n\t\t\tif(!cell){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tthis.table.modules.history.redo();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tcopyToClipboard:function(e){\r\n\t\tif(!this.table.modules.edit.currentCell){\r\n\t\t\tif(this.table.modExists(\"clipboard\", true)){\r\n\t\t\t\tthis.table.modules.clipboard.copy(false, true);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultBindings from './defaults/bindings.js';\r\nimport defaultActions from './defaults/actions.js';\r\n\r\nclass Keybindings extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.watchKeys = null;\r\n\t\tthis.pressedKeys = null;\r\n\t\tthis.keyupBinding = false;\r\n\t\tthis.keydownBinding = false;\r\n\r\n\t\tthis.registerTableOption(\"keybindings\", {}); //array for keybindings\r\n\t\tthis.registerTableOption(\"tabEndNewRow\", false); //create new row when tab to end of table\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tvar bindings = this.table.options.keybindings,\r\n\t\tmergedBindings = {};\r\n\r\n\t\tthis.watchKeys = {};\r\n\t\tthis.pressedKeys = [];\r\n\r\n\t\tif(bindings !== false){\r\n\t\t\tObject.assign(mergedBindings, Keybindings.bindings)\r\n\t\t\tObject.assign(mergedBindings, bindings)\r\n\r\n\t\t\tthis.mapBindings(mergedBindings);\r\n\t\t\tthis.bindEvents();\r\n\t\t}\r\n\r\n\t\tthis.subscribe(\"table-destroy\", this.clearBindings.bind(this));\r\n\t}\r\n\r\n\tmapBindings(bindings){\r\n\t\tfor(let key in bindings){\r\n\t\t\tif(Keybindings.actions[key]){\r\n\t\t\t\tif(bindings[key]){\r\n\t\t\t\t\tif(typeof bindings[key] !== \"object\"){\r\n\t\t\t\t\t\tbindings[key] = [bindings[key]];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbindings[key].forEach((binding) => {\r\n\t\t\t\t\t\tvar bindingList = Array.isArray(binding) ? binding : [binding];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tbindingList.forEach((item) => {\r\n\t\t\t\t\t\t\tthis.mapBinding(key, item);\r\n\t\t\t\t\t\t});\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Key Binding Error - no such action:\", key);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmapBinding(action, symbolsList){\r\n\t\tvar binding = {\r\n\t\t\taction: Keybindings.actions[action],\r\n\t\t\tkeys: [],\r\n\t\t\tctrl: false,\r\n\t\t\tshift: false,\r\n\t\t\tmeta: false,\r\n\t\t};\r\n\r\n\t\tvar symbols = symbolsList.toString().toLowerCase().split(\" \").join(\"\").split(\"+\");\r\n\r\n\t\tsymbols.forEach((symbol) => {\r\n\t\t\tswitch(symbol){\r\n\t\t\t\tcase \"ctrl\":\r\n\t\t\t\tbinding.ctrl = true;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"shift\":\r\n\t\t\t\tbinding.shift = true;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"meta\":\r\n\t\t\t\tbinding.meta = true;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\tsymbol = isNaN(symbol) ? symbol.toUpperCase().charCodeAt(0) : parseInt(symbol);\r\n\t\t\t\tbinding.keys.push(symbol);\r\n\r\n\t\t\t\tif(!this.watchKeys[symbol]){\r\n\t\t\t\t\tthis.watchKeys[symbol] = [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.watchKeys[symbol].push(binding);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tbindEvents(){\r\n\t\tvar self = this;\r\n\r\n\t\tthis.keyupBinding = function(e){\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tvar bindings = self.watchKeys[code];\r\n\r\n\t\t\tif(bindings){\r\n\r\n\t\t\t\tself.pressedKeys.push(code);\r\n\r\n\t\t\t\tbindings.forEach(function(binding){\r\n\t\t\t\t\tself.checkBinding(e, binding);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.keydownBinding = function(e){\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tvar bindings = self.watchKeys[code];\r\n\r\n\t\t\tif(bindings){\r\n\r\n\t\t\t\tvar index = self.pressedKeys.indexOf(code);\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tself.pressedKeys.splice(index, 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.table.element.addEventListener(\"keydown\", this.keyupBinding);\r\n\r\n\t\tthis.table.element.addEventListener(\"keyup\", this.keydownBinding);\r\n\t}\r\n\r\n\tclearBindings(){\r\n\t\tif(this.keyupBinding){\r\n\t\t\tthis.table.element.removeEventListener(\"keydown\", this.keyupBinding);\r\n\t\t}\r\n\r\n\t\tif(this.keydownBinding){\r\n\t\t\tthis.table.element.removeEventListener(\"keyup\", this.keydownBinding);\r\n\t\t}\r\n\t}\r\n\r\n\tcheckBinding(e, binding){\r\n\t\tvar match = true;\r\n\r\n\t\tif(e.ctrlKey == binding.ctrl && e.shiftKey == binding.shift && e.metaKey == binding.meta){\r\n\t\t\tbinding.keys.forEach((key) => {\r\n\t\t\t\tvar index = this.pressedKeys.indexOf(key);\r\n\r\n\t\t\t\tif(index == -1){\r\n\t\t\t\t\tmatch = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tbinding.action.call(this, e);\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\nKeybindings.moduleName = \"keybindings\";\r\n\r\n//load defaults\r\nKeybindings.bindings = defaultBindings;\r\nKeybindings.actions = defaultActions;\r\n\r\nexport default Keybindings;","import Module from '../../core/Module.js';\r\n\r\nclass Menu extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.menuContainer = null;\r\n\t\tthis.nestedMenuBlock = false;\r\n\t\t\r\n\t\tthis.currentComponent = null;\r\n\t\tthis.rootPopup = null;\r\n\t\t\r\n\t\tthis.columnSubscribers = {};\r\n\t\t\r\n\t\tthis.registerTableOption(\"menuContainer\", undefined); //deprecated\r\n\r\n\t\tthis.registerTableOption(\"rowContextMenu\", false);\r\n\t\tthis.registerTableOption(\"rowClickMenu\", false);\r\n\t\tthis.registerTableOption(\"groupContextMenu\", false);\r\n\t\tthis.registerTableOption(\"groupClickMenu\", false);\r\n\t\t\r\n\t\tthis.registerColumnOption(\"headerContextMenu\");\r\n\t\tthis.registerColumnOption(\"headerClickMenu\");\r\n\t\tthis.registerColumnOption(\"headerMenu\");\r\n\t\tthis.registerColumnOption(\"headerMenuIcon\");\r\n\t\tthis.registerColumnOption(\"contextMenu\");\r\n\t\tthis.registerColumnOption(\"clickMenu\");\r\n\t\t\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.deprecationCheck();\r\n\t\tthis.initializeRowWatchers();\r\n\t\tthis.initializeGroupWatchers();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\r\n\tdeprecationCheck(){\r\n\t\tif(typeof this.table.options.menuContainer !== \"undefined\"){\r\n\t\t\tconsole.warn(\"Use of the menuContainer option is now deprecated. Please use the popupContainer option instead\");\r\n\r\n\t\t\tthis.table.options.popupContainer = this.table.options.menuContainer;\r\n\t\t}\r\n\t}\t\r\n\t\r\n\tinitializeRowWatchers(){\r\n\t\tif(this.table.options.rowContextMenu){\r\n\t\t\tthis.subscribe(\"row-contextmenu\", this.loadMenuEvent.bind(this, this.table.options.rowContextMenu));\r\n\t\t\tthis.table.on(\"rowTapHold\", this.loadMenuEvent.bind(this, this.table.options.rowContextMenu));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.rowClickMenu){\r\n\t\t\tthis.subscribe(\"row-click\", this.loadMenuEvent.bind(this, this.table.options.rowClickMenu));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeGroupWatchers(){\r\n\t\tif(this.table.options.groupContextMenu){\r\n\t\t\tthis.subscribe(\"group-contextmenu\", this.loadMenuEvent.bind(this, this.table.options.groupContextMenu));\r\n\t\t\tthis.table.on(\"groupTapHold\", this.loadMenuEvent.bind(this, this.table.options.groupContextMenu));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.groupClickMenu){\r\n\t\t\tthis.subscribe(\"group-click\", this.loadMenuEvent.bind(this, this.table.options.groupClickMenu));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar options = [\"headerContextMenu\", \"headerClickMenu\"],\r\n\t\tdef = column.definition;\r\n\t\t\r\n\t\t//handle column events\r\n\t\tif(def.headerContextMenu && !this.columnSubscribers.headerContextMenu){\r\n\t\t\tthis.columnSubscribers.headerContextMenu = this.loadMenuTableColumnEvent.bind(this, \"headerContextMenu\");\r\n\t\t\tthis.subscribe(\"column-contextmenu\", this.columnSubscribers.headerContextMenu);\r\n\t\t\tthis.table.on(\"headerTapHold\", this.loadMenuTableColumnEvent.bind(this, \"headerContextMenu\"))\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerClickMenu && !this.columnSubscribers.headerClickMenu){\r\n\t\t\tthis.columnSubscribers.headerClickMenu = this.loadMenuTableColumnEvent.bind(this, \"headerClickMenu\");\r\n\t\t\tthis.subscribe(\"column-click\", this.columnSubscribers.headerClickMenu);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerMenu){\r\n\t\t\tthis.initializeColumnHeaderMenu(column);\r\n\t\t}\r\n\t\t\r\n\t\t//handle cell events\r\n\t\tif(def.contextMenu && !this.columnSubscribers.contextMenu){\r\n\t\t\tthis.columnSubscribers.contextMenu = this.loadMenuTableCellEvent.bind(this, \"contextMenu\");\r\n\t\t\tthis.subscribe(\"cell-contextmenu\", this.columnSubscribers.contextMenu);\r\n\t\t\tthis.table.on(\"cellTapHold\", this.loadMenuTableCellEvent.bind(this, \"contextMenu\"))\r\n\t\t}\r\n\t\t\r\n\t\tif(def.clickMenu && !this.columnSubscribers.clickMenu){\r\n\t\t\tthis.columnSubscribers.clickMenu = this.loadMenuTableCellEvent.bind(this, \"clickMenu\");\r\n\t\t\tthis.subscribe(\"cell-click\", this.columnSubscribers.clickMenu);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumnHeaderMenu(column){\r\n\t\tvar icon = column.definition.headerMenuIcon,\r\n\t\theaderMenuEl;\r\n\t\t\r\n\t\theaderMenuEl = document.createElement(\"span\");\r\n\t\theaderMenuEl.classList.add(\"tabulator-header-popup-button\");\r\n\r\n\t\tif(icon){\r\n\t\t\tif(typeof icon === \"function\"){\r\n\t\t\t\ticon = icon(column.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tif(icon instanceof HTMLElement){\r\n\t\t\t\theaderMenuEl.appendChild(icon);\r\n\t\t\t}else{\r\n\t\t\t\theaderMenuEl.innerHTML = icon;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\theaderMenuEl.innerHTML = \"⋮\";\r\n\t\t}\r\n\t\t\r\n\t\theaderMenuEl.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tthis.loadMenuEvent(column.definition.headerMenu, e, column);\r\n\t\t});\r\n\t\t\r\n\t\tcolumn.titleElement.insertBefore(headerMenuEl, column.titleElement.firstChild);\r\n\t}\r\n\t\r\n\tloadMenuTableCellEvent(option, e, cell){\r\n\t\tif(cell._cell){\r\n\t\t\tcell = cell._cell;\r\n\t\t}\r\n\t\t\r\n\t\tif(cell.column.definition[option]){\r\n\t\t\tthis.loadMenuEvent(cell.column.definition[option], e, cell);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadMenuTableColumnEvent(option, e, column){\r\n\t\tif(column._column){\r\n\t\t\tcolumn = column._column;\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition[option]){\r\n\t\t\tthis.loadMenuEvent(column.definition[option], e, column);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadMenuEvent(menu, e, component){\r\n\t\tif(component._group){\r\n\t\t\tcomponent = component._group;\r\n\t\t}else if(component._row){\r\n\t\t\tcomponent = component._row;\r\n\t\t}\r\n\t\t\r\n\t\tmenu = typeof menu == \"function\" ? menu.call(this.table, e, component.getComponent()) : menu;\r\n\t\t\r\n\t\tthis.loadMenu(e, component, menu);\r\n\t}\r\n\t\r\n\tloadMenu(e, component, menu, parentEl, parentPopup){\r\n\t\tvar touch = !(e instanceof MouseEvent),\t\t\r\n\t\tmenuEl = document.createElement(\"div\"),\r\n\t\tpopup;\r\n\t\t\r\n\t\tmenuEl.classList.add(\"tabulator-menu\");\r\n\t\t\r\n\t\tif(!touch){\r\n\t\t\te.preventDefault();\r\n\t\t}\r\n\t\t\r\n\t\t//abort if no menu set\r\n\t\tif(!menu || !menu.length){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif(!parentEl){\r\n\t\t\tif(this.nestedMenuBlock){\r\n\t\t\t\t//abort if child menu already open\r\n\t\t\t\tif(this.rootPopup){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.nestedMenuBlock = setTimeout(() => {\r\n\t\t\t\t\tthis.nestedMenuBlock = false;\r\n\t\t\t\t}, 100)\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.rootPopup){\r\n\t\t\t\tthis.rootPopup.hide();\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.rootPopup = popup = this.popup(menuEl);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tpopup = parentPopup.child(menuEl);\r\n\t\t}\r\n\t\t\r\n\t\tmenu.forEach((item) => {\r\n\t\t\tvar itemEl = document.createElement(\"div\"),\r\n\t\t\tlabel = item.label,\r\n\t\t\tdisabled = item.disabled;\r\n\t\t\t\r\n\t\t\tif(item.separator){\r\n\t\t\t\titemEl.classList.add(\"tabulator-menu-separator\");\r\n\t\t\t}else{\r\n\t\t\t\titemEl.classList.add(\"tabulator-menu-item\");\r\n\t\t\t\t\r\n\t\t\t\tif(typeof label == \"function\"){\r\n\t\t\t\t\tlabel = label.call(this.table, component.getComponent());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(label instanceof Node){\r\n\t\t\t\t\titemEl.appendChild(label);\r\n\t\t\t\t}else{\r\n\t\t\t\t\titemEl.innerHTML = label;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(typeof disabled == \"function\"){\r\n\t\t\t\t\tdisabled = disabled.call(this.table, component.getComponent());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(disabled){\r\n\t\t\t\t\titemEl.classList.add(\"tabulator-menu-item-disabled\");\r\n\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(item.menu && item.menu.length){\r\n\t\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\tthis.loadMenu(e, component, item.menu, itemEl, popup);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(item.action){\r\n\t\t\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\t\t\titem.action(e, component.getComponent());\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(item.menu && item.menu.length){\r\n\t\t\t\t\titemEl.classList.add(\"tabulator-menu-item-submenu\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmenuEl.appendChild(itemEl);\r\n\t\t});\r\n\t\t\r\n\t\tmenuEl.addEventListener(\"click\", (e) => {\r\n\t\t\tthis.rootPopup.hide();\r\n\t\t});\r\n\t\t\r\n\t\tpopup.show(parentEl || e);\r\n\t\t\r\n\t\tif(popup === this.rootPopup){\r\n\t\t\tthis.rootPopup.hideOnBlur(() => {\r\n\t\t\t\tthis.rootPopup = null;\r\n\t\t\t\t\r\n\t\t\t\tif(this.currentComponent){\r\n\t\t\t\t\tthis.dispatchExternal(\"menuClosed\", this.currentComponent.getComponent());\r\n\t\t\t\t\tthis.currentComponent = null;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.currentComponent = component;\r\n\r\n\t\t\tthis.dispatchExternal(\"menuOpened\", component.getComponent())\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMenu.moduleName = \"menu\";\r\n\r\nexport default Menu;\r\n","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nclass MoveColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.placeholderElement = this.createPlaceholderElement();\r\n\t\tthis.hoverElement = false; //floating column header element\r\n\t\tthis.checkTimeout = false; //click check timeout holder\r\n\t\tthis.checkPeriod = 250; //period to wait on mousedown to consider this a move and not a click\r\n\t\tthis.moving = false; //currently moving column\r\n\t\tthis.toCol = false; //destination column\r\n\t\tthis.toColAfter = false; //position of moving column relative to the desitnation column\r\n\t\tthis.startX = 0; //starting position within header element\r\n\t\tthis.autoScrollMargin = 40; //auto scroll on edge when within margin\r\n\t\tthis.autoScrollStep = 5; //auto scroll distance in pixels\r\n\t\tthis.autoScrollTimeout = false; //auto scroll timeout\r\n\t\tthis.touchMove = false;\r\n\t\t\r\n\t\tthis.moveHover = this.moveHover.bind(this);\r\n\t\tthis.endMove = this.endMove.bind(this);\r\n\t\t\r\n\t\tthis.registerTableOption(\"movableColumns\", false); //enable movable columns\r\n\t}\r\n\t\r\n\tcreatePlaceholderElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-col\");\r\n\t\tel.classList.add(\"tabulator-col-placeholder\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.movableColumns){\r\n\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar self = this,\r\n\t\tconfig = {},\r\n\t\tcolEl;\r\n\t\t\r\n\t\tif(!column.modules.frozen && !column.isGroup){\r\n\t\t\tcolEl = column.getElement();\r\n\t\t\t\r\n\t\t\tconfig.mousemove = function(e){\r\n\t\t\t\tif(column.parent === self.moving.parent){\r\n\t\t\t\t\tif((((self.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(colEl).left) + self.table.columnManager.element.scrollLeft) > (column.getWidth() / 2)){\r\n\t\t\t\t\t\tif(self.toCol !== column || !self.toColAfter){\r\n\t\t\t\t\t\t\tcolEl.parentNode.insertBefore(self.placeholderElement, colEl.nextSibling);\r\n\t\t\t\t\t\t\tself.moveColumn(column, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(self.toCol !== column || self.toColAfter){\r\n\t\t\t\t\t\t\tcolEl.parentNode.insertBefore(self.placeholderElement, colEl);\r\n\t\t\t\t\t\t\tself.moveColumn(column, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}.bind(self);\r\n\t\t\t\r\n\t\t\tcolEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tself.touchMove = false;\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, column);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tcolEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tself.bindTouchEvents(column);\r\n\t\t}\r\n\t\t\r\n\t\tcolumn.modules.moveColumn = config;\r\n\t}\r\n\t\r\n\tbindTouchEvents(column){\r\n\t\tvar colEl = column.getElement(),\r\n\t\tstartXMove = false, //shifting center position of the cell\r\n\t\tdir = false,\r\n\t\tcurrentCol, nextCol, prevCol, nextColWidth, prevColWidth, nextColWidthLast, prevColWidthLast;\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchstart\", (e) => {\r\n\t\t\tthis.checkTimeout = setTimeout(() => {\r\n\t\t\t\tthis.touchMove = true;\r\n\t\t\t\tcurrentCol = column;\r\n\t\t\t\tnextCol = column.nextColumn();\r\n\t\t\t\tnextColWidth = nextCol ? nextCol.getWidth()/2 : 0;\r\n\t\t\t\tprevCol = column.prevColumn();\r\n\t\t\t\tprevColWidth = prevCol ? prevCol.getWidth()/2 : 0;\r\n\t\t\t\tnextColWidthLast = 0;\r\n\t\t\t\tprevColWidthLast = 0;\r\n\t\t\t\tstartXMove = false;\r\n\t\t\t\t\r\n\t\t\t\tthis.startMove(e, column);\r\n\t\t\t}, this.checkPeriod);\r\n\t\t}, {passive: true});\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchmove\", (e) => {\r\n\t\t\tvar halfCol, diff, moveToCol;\r\n\t\t\t\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.moveHover(e);\r\n\t\t\t\t\r\n\t\t\t\tif(!startXMove){\r\n\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tdiff = e.touches[0].pageX - startXMove;\r\n\t\t\t\t\r\n\t\t\t\tif(diff > 0){\r\n\t\t\t\t\tif(nextCol && diff - nextColWidthLast > nextColWidth){\r\n\t\t\t\t\t\tmoveToCol = nextCol;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(moveToCol !== column){\r\n\t\t\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t\t\t\tmoveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement().nextSibling);\r\n\t\t\t\t\t\t\tthis.moveColumn(moveToCol, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(prevCol && -diff - prevColWidthLast > prevColWidth){\r\n\t\t\t\t\t\tmoveToCol = prevCol;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(moveToCol !== column){\r\n\t\t\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t\t\t\tmoveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement());\r\n\t\t\t\t\t\t\tthis.moveColumn(moveToCol, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(moveToCol){\r\n\t\t\t\t\tcurrentCol = moveToCol;\r\n\t\t\t\t\tnextCol = moveToCol.nextColumn();\r\n\t\t\t\t\tnextColWidthLast = nextColWidth;\r\n\t\t\t\t\tnextColWidth = nextCol ? nextCol.getWidth() / 2 : 0;\r\n\t\t\t\t\tprevCol = moveToCol.prevColumn();\r\n\t\t\t\t\tprevColWidthLast = prevColWidth;\r\n\t\t\t\t\tprevColWidth = prevCol ? prevCol.getWidth() / 2 : 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}, {passive: true});\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchend\", (e) => {\r\n\t\t\tif(this.checkTimeout){\r\n\t\t\t\tclearTimeout(this.checkTimeout);\r\n\t\t\t}\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.endMove(e);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tstartMove(e, column){\r\n\t\tvar element = column.getElement(),\r\n\t\theaderElement = this.table.columnManager.getElement(),\r\n\t\theadersElement = this.table.columnManager.getHeadersElement();\r\n\t\t\r\n\t\tthis.moving = column;\r\n\t\tthis.startX = (this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(element).left;\r\n\t\t\r\n\t\tthis.table.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\t//create placeholder\r\n\t\tthis.placeholderElement.style.width = column.getWidth() + \"px\";\r\n\t\tthis.placeholderElement.style.height = column.getHeight() + \"px\";\r\n\t\t\r\n\t\telement.parentNode.insertBefore(this.placeholderElement, element);\r\n\t\telement.parentNode.removeChild(element);\r\n\t\t\r\n\t\t//create hover element\r\n\t\tthis.hoverElement = element.cloneNode(true);\r\n\t\tthis.hoverElement.classList.add(\"tabulator-moving\");\r\n\t\t\r\n\t\tthis.table.columnManager.getElement().appendChild(this.hoverElement);\r\n\t\t\r\n\t\tthis.hoverElement.style.left = \"0\";\r\n\t\tthis.hoverElement.style.bottom = (headerElement.clientHeight - headersElement.offsetHeight) + \"px\";\r\n\t\t\r\n\t\tif(!this.touchMove){\r\n\t\t\tthis._bindMouseMove();\r\n\t\t\t\r\n\t\t\tdocument.body.addEventListener(\"mousemove\", this.moveHover);\r\n\t\t\tdocument.body.addEventListener(\"mouseup\", this.endMove);\r\n\t\t}\r\n\t\t\r\n\t\tthis.moveHover(e);\r\n\t}\r\n\t\r\n\t_bindMouseMove(){\r\n\t\tthis.table.columnManager.columnsByIndex.forEach(function(column){\r\n\t\t\tif(column.modules.moveColumn.mousemove){\r\n\t\t\t\tcolumn.getElement().addEventListener(\"mousemove\", column.modules.moveColumn.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t_unbindMouseMove(){\r\n\t\tthis.table.columnManager.columnsByIndex.forEach(function(column){\r\n\t\t\tif(column.modules.moveColumn.mousemove){\r\n\t\t\t\tcolumn.getElement().removeEventListener(\"mousemove\", column.modules.moveColumn.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tmoveColumn(column, after){\r\n\t\tvar movingCells = this.moving.getCells();\r\n\t\t\r\n\t\tthis.toCol = column;\r\n\t\tthis.toColAfter = after;\r\n\t\t\r\n\t\tif(after){\r\n\t\t\tcolumn.getCells().forEach(function(cell, i){\r\n\t\t\t\tvar cellEl = cell.getElement(true);\r\n\t\t\t\t\r\n\t\t\t\tif(cellEl.parentNode && movingCells[i]){\r\n\t\t\t\t\tcellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl.nextSibling);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tcolumn.getCells().forEach(function(cell, i){\r\n\t\t\t\tvar cellEl = cell.getElement(true);\r\n\t\t\t\t\r\n\t\t\t\tif(cellEl.parentNode && movingCells[i]){\r\n\t\t\t\t\tcellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tendMove(e){\r\n\t\tif(e.which === 1 || this.touchMove){\r\n\t\t\tthis._unbindMouseMove();\r\n\t\t\t\r\n\t\t\tthis.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling);\r\n\t\t\tthis.placeholderElement.parentNode.removeChild(this.placeholderElement);\r\n\t\t\tthis.hoverElement.parentNode.removeChild(this.hoverElement);\r\n\t\t\t\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-block-select\");\r\n\t\t\t\r\n\t\t\tif(this.toCol){\r\n\t\t\t\tthis.table.columnManager.moveColumnActual(this.moving, this.toCol, this.toColAfter);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.moving = false;\r\n\t\t\tthis.toCol = false;\r\n\t\t\tthis.toColAfter = false;\r\n\t\t\t\r\n\t\t\tif(!this.touchMove){\r\n\t\t\t\tdocument.body.removeEventListener(\"mousemove\", this.moveHover);\r\n\t\t\t\tdocument.body.removeEventListener(\"mouseup\", this.endMove);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveHover(e){\r\n\t\tvar columnHolder = this.table.columnManager.getElement(),\r\n\t\tscrollLeft = columnHolder.scrollLeft,\r\n\t\txPos = ((this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(columnHolder).left) + scrollLeft,\r\n\t\tscrollPos;\r\n\t\t\r\n\t\tthis.hoverElement.style.left = (xPos - this.startX) + \"px\";\r\n\t\t\r\n\t\tif(xPos - scrollLeft < this.autoScrollMargin){\r\n\t\t\tif(!this.autoScrollTimeout){\r\n\t\t\t\tthis.autoScrollTimeout = setTimeout(() => {\r\n\t\t\t\t\tscrollPos = Math.max(0,scrollLeft-5);\r\n\t\t\t\t\tthis.table.rowManager.getElement().scrollLeft = scrollPos;\r\n\t\t\t\t\tthis.autoScrollTimeout = false;\r\n\t\t\t\t}, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(scrollLeft + columnHolder.clientWidth - xPos < this.autoScrollMargin){\r\n\t\t\tif(!this.autoScrollTimeout){\r\n\t\t\t\tthis.autoScrollTimeout = setTimeout(() => {\r\n\t\t\t\t\tscrollPos = Math.min(columnHolder.clientWidth, scrollLeft+5);\r\n\t\t\t\t\tthis.table.rowManager.getElement().scrollLeft = scrollPos;\r\n\t\t\t\t\tthis.autoScrollTimeout = false;\r\n\t\t\t\t}, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMoveColumns.moduleName = \"moveColumn\";\r\n\r\nexport default MoveColumns;\r\n","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nclass MoveRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.placeholderElement = this.createPlaceholderElement();\r\n\t\tthis.hoverElement = false; //floating row header element\r\n\t\tthis.checkTimeout = false; //click check timeout holder\r\n\t\tthis.checkPeriod = 150; //period to wait on mousedown to consider this a move and not a click\r\n\t\tthis.moving = false; //currently moving row\r\n\t\tthis.toRow = false; //destination row\r\n\t\tthis.toRowAfter = false; //position of moving row relative to the desitnation row\r\n\t\tthis.hasHandle = false; //row has handle instead of fully movable row\r\n\t\tthis.startY = 0; //starting Y position within header element\r\n\t\tthis.startX = 0; //starting X position within header element\r\n\r\n\t\tthis.moveHover = this.moveHover.bind(this);\r\n\t\tthis.endMove = this.endMove.bind(this);\r\n\t\tthis.tableRowDropEvent = false;\r\n\r\n\t\tthis.touchMove = false;\r\n\r\n\t\tthis.connection = false;\r\n\t\tthis.connectionSelectorsTables = false;\r\n\t\tthis.connectionSelectorsElements = false;\r\n\t\tthis.connectionElements = [];\r\n\t\tthis.connections = [];\r\n\r\n\t\tthis.connectedTable = false;\r\n\t\tthis.connectedRow = false;\r\n\r\n\t\tthis.registerTableOption(\"movableRows\", false); //enable movable rows\r\n\t\tthis.registerTableOption(\"movableRowsConnectedTables\", false); //tables for movable rows to be connected to\r\n\t\tthis.registerTableOption(\"movableRowsConnectedElements\", false); //other elements for movable rows to be connected to\r\n\t\tthis.registerTableOption(\"movableRowsSender\", false);\r\n\t\tthis.registerTableOption(\"movableRowsReceiver\", \"insert\");\r\n\r\n\t\tthis.registerColumnOption(\"rowHandle\");\r\n\t}\r\n\r\n\tcreatePlaceholderElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-row\");\r\n\t\tel.classList.add(\"tabulator-row-placeholder\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.movableRows){\r\n\t\t\tthis.connectionSelectorsTables = this.table.options.movableRowsConnectedTables;\r\n\t\t\tthis.connectionSelectorsElements = this.table.options.movableRowsConnectedElements;\r\n\r\n\t\t\tthis.connection = this.connectionSelectorsTables || this.connectionSelectorsElements;\r\n\r\n\t\t\tthis.subscribe(\"cell-init\", this.initializeCell.bind(this));\r\n\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeGroupHeader(group){\r\n\t\tvar self = this,\r\n\t\tconfig = {},\r\n\t\trowEl;\r\n\r\n\t\t//inter table drag drop\r\n\t\tconfig.mouseup = function(e){\r\n\t\t\tself.tableRowDrop(e, row);\r\n\t\t}.bind(self);\r\n\r\n\t\t//same table drag drop\r\n\t\tconfig.mousemove = function(e){\r\n\t\t\tif(((e.pageY - Helpers.elOffset(group.element).top) + self.table.rowManager.element.scrollTop) > (group.getHeight() / 2)){\r\n\t\t\t\tif(self.toRow !== group || !self.toRowAfter){\r\n\t\t\t\t\tvar rowEl = group.getElement();\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);\r\n\t\t\t\t\tself.moveRow(group, true);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(self.toRow !== group || self.toRowAfter){\r\n\t\t\t\t\tvar rowEl = group.getElement();\r\n\t\t\t\t\tif(rowEl.previousSibling){\r\n\t\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl);\r\n\t\t\t\t\t\tself.moveRow(group, false);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.bind(self);\r\n\r\n\t\tgroup.modules.moveRow = config;\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\tconfig = {},\r\n\t\trowEl;\r\n\r\n\t\t//inter table drag drop\r\n\t\tconfig.mouseup = function(e){\r\n\t\t\tself.tableRowDrop(e, row);\r\n\t\t}.bind(self);\r\n\r\n\t\t//same table drag drop\r\n\t\tconfig.mousemove = function(e){\r\n\t\t\tvar rowEl = row.getElement();\r\n\r\n\t\t\tif(((e.pageY - Helpers.elOffset(rowEl).top) + self.table.rowManager.element.scrollTop) > (row.getHeight() / 2)){\r\n\t\t\t\tif(self.toRow !== row || !self.toRowAfter){\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);\r\n\t\t\t\t\tself.moveRow(row, true);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(self.toRow !== row || self.toRowAfter){\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl);\r\n\t\t\t\t\tself.moveRow(row, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.bind(self);\r\n\r\n\r\n\t\tif(!this.hasHandle){\r\n\r\n\t\t\trowEl = row.getElement();\r\n\r\n\t\t\trowEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, row);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trowEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.bindTouchEvents(row, row.getElement());\r\n\t\t}\r\n\r\n\t\trow.modules.moveRow = config;\r\n\t}\r\n\r\n\tinitializeColumn(column){\r\n\t\tif(column.definition.rowHandle && this.table.options.movableRows !== false){\r\n\t\t\tthis.hasHandle = true;\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeCell(cell){\r\n\t\tif(cell.column.definition.rowHandle && this.table.options.movableRows !== false){\r\n\t\t\tvar self = this,\r\n\t\t\tcellEl = cell.getElement(true);\r\n\r\n\t\t\tcellEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, cell.row);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tcellEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.bindTouchEvents(cell.row, cellEl);\r\n\t\t}\r\n\t}\r\n\r\n\tbindTouchEvents(row, element){\r\n\t\tvar startYMove = false, //shifting center position of the cell\r\n\t\tdir = false,\r\n\t\tcurrentRow, nextRow, prevRow, nextRowHeight, prevRowHeight, nextRowHeightLast, prevRowHeightLast;\r\n\r\n\t\telement.addEventListener(\"touchstart\", (e) => {\r\n\t\t\tthis.checkTimeout = setTimeout(() => {\r\n\t\t\t\tthis.touchMove = true;\r\n\t\t\t\tcurrentRow = row;\r\n\t\t\t\tnextRow = row.nextRow();\r\n\t\t\t\tnextRowHeight = nextRow ? nextRow.getHeight()/2 : 0;\r\n\t\t\t\tprevRow = row.prevRow();\r\n\t\t\t\tprevRowHeight = prevRow ? prevRow.getHeight()/2 : 0;\r\n\t\t\t\tnextRowHeightLast = 0;\r\n\t\t\t\tprevRowHeightLast = 0;\r\n\t\t\t\tstartYMove = false;\r\n\r\n\t\t\t\tthis.startMove(e, row);\r\n\t\t\t}, this.checkPeriod);\r\n\t\t}, {passive: true});\r\n\t\tthis.moving, this.toRow, this.toRowAfter\r\n\t\telement.addEventListener(\"touchmove\", (e) => {\r\n\r\n\t\t\tvar halfCol, diff, moveToRow;\r\n\r\n\t\t\tif(this.moving){\r\n\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\tthis.moveHover(e);\r\n\r\n\t\t\t\tif(!startYMove){\r\n\t\t\t\t\tstartYMove = e.touches[0].pageY;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdiff = e.touches[0].pageY - startYMove;\r\n\r\n\t\t\t\tif(diff > 0){\r\n\t\t\t\t\tif(nextRow && diff - nextRowHeightLast > nextRowHeight){\r\n\t\t\t\t\t\tmoveToRow = nextRow;\r\n\r\n\t\t\t\t\t\tif(moveToRow !== row){\r\n\t\t\t\t\t\t\tstartYMove = e.touches[0].pageY\r\n\t\t\t\t\t\t\tmoveToRow.getElement().parentNode.insertBefore(this.placeholderElement, moveToRow.getElement().nextSibling);\r\n\t\t\t\t\t\t\tthis.moveRow(moveToRow, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(prevRow && -diff - prevRowHeightLast > prevRowHeight){\r\n\t\t\t\t\t\tmoveToRow = prevRow;\r\n\r\n\t\t\t\t\t\tif(moveToRow !== row){\r\n\t\t\t\t\t\t\tstartYMove = e.touches[0].pageY;\r\n\t\t\t\t\t\t\tmoveToRow.getElement().parentNode.insertBefore(this.placeholderElement, moveToRow.getElement());\r\n\t\t\t\t\t\t\tthis.moveRow(moveToRow, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(moveToRow){\r\n\t\t\t\t\tcurrentRow = moveToRow;\r\n\t\t\t\t\tnextRow = moveToRow.nextRow();\r\n\t\t\t\t\tnextRowHeightLast = nextRowHeight;\r\n\t\t\t\t\tnextRowHeight = nextRow ? nextRow.getHeight() / 2 : 0;\r\n\t\t\t\t\tprevRow = moveToRow.prevRow();\r\n\t\t\t\t\tprevRowHeightLast = prevRowHeight;\r\n\t\t\t\t\tprevRowHeight = prevRow ? prevRow.getHeight() / 2 : 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\telement.addEventListener(\"touchend\", (e) => {\r\n\t\t\tif(this.checkTimeout){\r\n\t\t\t\tclearTimeout(this.checkTimeout);\r\n\t\t\t}\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.endMove(e);\r\n\t\t\t\tthis.touchMove = false;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t_bindMouseMove(){\r\n\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\tif((row.type === \"row\" || row.type === \"group\") && row.modules.moveRow && row.modules.moveRow.mousemove){\r\n\t\t\t\trow.getElement().addEventListener(\"mousemove\", row.modules.moveRow.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t_unbindMouseMove(){\r\n\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\tif((row.type === \"row\" || row.type === \"group\") && row.modules.moveRow && row.modules.moveRow.mousemove){\r\n\t\t\t\trow.getElement().removeEventListener(\"mousemove\", row.modules.moveRow.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tstartMove(e, row){\r\n\t\tvar element = row.getElement();\r\n\r\n\t\tthis.setStartPosition(e, row);\r\n\r\n\t\tthis.moving = row;\r\n\r\n\t\tthis.table.element.classList.add(\"tabulator-block-select\");\r\n\r\n\t\t//create placeholder\r\n\t\tthis.placeholderElement.style.width = row.getWidth() + \"px\";\r\n\t\tthis.placeholderElement.style.height = row.getHeight() + \"px\";\r\n\r\n\t\tif(!this.connection){\r\n\t\t\telement.parentNode.insertBefore(this.placeholderElement, element);\r\n\t\t\telement.parentNode.removeChild(element);\r\n\t\t}else{\r\n\t\t\tthis.table.element.classList.add(\"tabulator-movingrow-sending\");\r\n\t\t\tthis.connectToTables(row);\r\n\t\t}\r\n\r\n\t\t//create hover element\r\n\t\tthis.hoverElement = element.cloneNode(true);\r\n\t\tthis.hoverElement.classList.add(\"tabulator-moving\");\r\n\r\n\t\tif(this.connection){\r\n\t\t\tdocument.body.appendChild(this.hoverElement);\r\n\t\t\tthis.hoverElement.style.left = \"0\";\r\n\t\t\tthis.hoverElement.style.top = \"0\";\r\n\t\t\tthis.hoverElement.style.width = this.table.element.clientWidth + \"px\";\r\n\t\t\tthis.hoverElement.style.whiteSpace = \"nowrap\";\r\n\t\t\tthis.hoverElement.style.overflow = \"hidden\";\r\n\t\t\tthis.hoverElement.style.pointerEvents = \"none\";\r\n\t\t}else{\r\n\t\t\tthis.table.rowManager.getTableElement().appendChild(this.hoverElement);\r\n\r\n\t\t\tthis.hoverElement.style.left = \"0\";\r\n\t\t\tthis.hoverElement.style.top = \"0\";\r\n\r\n\t\t\tthis._bindMouseMove();\r\n\t\t}\r\n\r\n\t\tdocument.body.addEventListener(\"mousemove\", this.moveHover);\r\n\t\tdocument.body.addEventListener(\"mouseup\", this.endMove);\r\n\r\n\t\tthis.dispatchExternal(\"rowMoving\", row.getComponent());\r\n\r\n\t\tthis.moveHover(e);\r\n\t}\r\n\r\n\tsetStartPosition(e, row){\r\n\t\tvar pageX = this.touchMove ? e.touches[0].pageX : e.pageX,\r\n\t\tpageY = this.touchMove ? e.touches[0].pageY : e.pageY,\r\n\t\telement, position;\r\n\r\n\t\telement = row.getElement();\r\n\t\tif(this.connection){\r\n\t\t\tposition = element.getBoundingClientRect();\r\n\r\n\t\t\tthis.startX = position.left - pageX + window.pageXOffset;\r\n\t\t\tthis.startY = position.top - pageY + window.pageYOffset;\r\n\t\t}else{\r\n\t\t\tthis.startY = (pageY - element.getBoundingClientRect().top);\r\n\t\t}\r\n\t}\r\n\r\n\tendMove(e){\r\n\t\tif(!e || e.which === 1 || this.touchMove){\r\n\t\t\tthis._unbindMouseMove();\r\n\r\n\t\t\tif(!this.connection){\r\n\t\t\t\tthis.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling);\r\n\t\t\t\tthis.placeholderElement.parentNode.removeChild(this.placeholderElement);\r\n\t\t\t}\r\n\r\n\t\t\tthis.hoverElement.parentNode.removeChild(this.hoverElement);\r\n\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-block-select\");\r\n\r\n\t\t\tif(this.toRow){\r\n\t\t\t\tthis.table.rowManager.moveRow(this.moving, this.toRow, this.toRowAfter);\r\n\t\t\t}else{\r\n\t\t\t\tthis.dispatchExternal(\"rowMoveCancelled\", this.moving.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tthis.moving = false;\r\n\t\t\tthis.toRow = false;\r\n\t\t\tthis.toRowAfter = false;\r\n\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", this.moveHover);\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", this.endMove);\r\n\r\n\t\t\tif(this.connection){\r\n\t\t\t\tthis.table.element.classList.remove(\"tabulator-movingrow-sending\");\r\n\t\t\t\tthis.disconnectFromTables();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmoveRow(row, after){\r\n\t\tthis.toRow = row;\r\n\t\tthis.toRowAfter = after;\r\n\t}\r\n\r\n\tmoveHover(e){\r\n\t\tif(this.connection){\r\n\t\t\tthis.moveHoverConnections.call(this, e);\r\n\t\t}else{\r\n\t\t\tthis.moveHoverTable.call(this, e);\r\n\t\t}\r\n\t}\r\n\r\n\tmoveHoverTable(e){\r\n\t\tvar rowHolder = this.table.rowManager.getElement(),\r\n\t\tscrollTop = rowHolder.scrollTop,\r\n\t\tyPos = ((this.touchMove ? e.touches[0].pageY : e.pageY) - rowHolder.getBoundingClientRect().top) + scrollTop,\r\n\t\tscrollPos;\r\n\r\n\t\tthis.hoverElement.style.top = (yPos - this.startY) + \"px\";\r\n\t}\r\n\r\n\tmoveHoverConnections(e){\r\n\t\tthis.hoverElement.style.left = (this.startX + (this.touchMove ? e.touches[0].pageX : e.pageX)) + \"px\";\r\n\t\tthis.hoverElement.style.top = (this.startY + (this.touchMove ? e.touches[0].pageY : e.pageY)) + \"px\";\r\n\t}\r\n\r\n\telementRowDrop(e, element, row){\r\n\t\tthis.dispatchExternal(\"movableRowsElementDrop\", e, element, row ? row.getComponent() : false);\r\n\t}\r\n\r\n\t//establish connection with other tables\r\n\tconnectToTables(row){\r\n\t\tvar connectionTables;\r\n\r\n\t\tif(this.connectionSelectorsTables){\r\n\t\t\tconnectionTables = this.commsConnections(this.connectionSelectorsTables);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSendingStart\", connectionTables);\r\n\r\n\t\t\tthis.commsSend(this.connectionSelectorsTables, \"moveRow\", \"connect\", {\r\n\t\t\t\trow:row,\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.connectionSelectorsElements){\r\n\r\n\t\t\tthis.connectionElements = [];\r\n\r\n\t\t\tif(!Array.isArray(this.connectionSelectorsElements)){\r\n\t\t\t\tthis.connectionSelectorsElements = [this.connectionSelectorsElements];\r\n\t\t\t}\r\n\r\n\t\t\tthis.connectionSelectorsElements.forEach((query) => {\r\n\t\t\t\tif(typeof query === \"string\"){\r\n\t\t\t\t\tthis.connectionElements = this.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(query)));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.connectionElements.push(query);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.connectionElements.forEach((element) => {\r\n\t\t\t\tvar dropEvent = (e) => {\r\n\t\t\t\t\tthis.elementRowDrop(e, element, this.moving);\r\n\t\t\t\t};\r\n\r\n\t\t\t\telement.addEventListener(\"mouseup\", dropEvent);\r\n\t\t\t\telement.tabulatorElementDropEvent = dropEvent;\r\n\r\n\t\t\t\telement.classList.add(\"tabulator-movingrow-receiving\");\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t//disconnect from other tables\r\n\tdisconnectFromTables(){\r\n\t\tvar connectionTables;\r\n\r\n\t\tif(this.connectionSelectorsTables){\r\n\t\t\tconnectionTables = this.commsConnections(this.connectionSelectorsTables);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSendingStop\", connectionTables);\r\n\r\n\t\t\tthis.commsSend(this.connectionSelectorsTables, \"moveRow\", \"disconnect\");\r\n\t\t}\r\n\r\n\t\tthis.connectionElements.forEach((element) => {\r\n\t\t\telement.classList.remove(\"tabulator-movingrow-receiving\");\r\n\t\t\telement.removeEventListener(\"mouseup\", element.tabulatorElementDropEvent);\r\n\t\t\tdelete element.tabulatorElementDropEvent;\r\n\t\t});\r\n\t}\r\n\r\n\t//accept incomming connection\r\n\tconnect(table, row){\r\n\t\tif(!this.connectedTable){\r\n\t\t\tthis.connectedTable = table;\r\n\t\t\tthis.connectedRow = row;\r\n\r\n\t\t\tthis.table.element.classList.add(\"tabulator-movingrow-receiving\");\r\n\r\n\t\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\t\tif(row.type === \"row\" && row.modules.moveRow && row.modules.moveRow.mouseup){\r\n\t\t\t\t\trow.getElement().addEventListener(\"mouseup\", row.modules.moveRow.mouseup);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.tableRowDropEvent = this.tableRowDrop.bind(this);\r\n\r\n\t\t\tthis.table.element.addEventListener(\"mouseup\", this.tableRowDropEvent);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivingStart\", row, table);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Row Error - Table cannot accept connection, already connected to table:\", this.connectedTable);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//close incomming connection\r\n\tdisconnect(table){\r\n\t\tif(table === this.connectedTable){\r\n\t\t\tthis.connectedTable = false;\r\n\t\t\tthis.connectedRow = false;\r\n\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-movingrow-receiving\");\r\n\r\n\t\t\tthis.table.rowManager.getDisplayRows().forEach((row) =>{\r\n\t\t\t\tif(row.type === \"row\" && row.modules.moveRow && row.modules.moveRow.mouseup){\r\n\t\t\t\t\trow.getElement().removeEventListener(\"mouseup\", row.modules.moveRow.mouseup);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.table.element.removeEventListener(\"mouseup\", this.tableRowDropEvent);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivingStop\", table);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Row Error - trying to disconnect from non connected table\")\r\n\t\t}\r\n\t}\r\n\r\n\tdropComplete(table, row, success){\r\n\t\tvar sender = false;\r\n\r\n\t\tif(success){\r\n\r\n\t\t\tswitch(typeof this.table.options.movableRowsSender){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tsender = this.senders[this.table.options.movableRowsSender];\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tsender = this.table.options.movableRowsSender;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(sender){\r\n\t\t\t\tsender.call(this, this.moving.getComponent(), row ? row.getComponent() : undefined, table)\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.options.movableRowsSender){\r\n\t\t\t\t\tconsole.warn(\"Mover Row Error - no matching sender found:\", this.table.options.movableRowsSender);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSent\", this.moving.getComponent(), row ? row.getComponent() : undefined, table);\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"movableRowsSentFailed\", this.moving.getComponent(), row ? row.getComponent() : undefined, table);\r\n\t\t}\r\n\r\n\t\tthis.endMove();\r\n\t}\r\n\r\n\ttableRowDrop(e, row){\r\n\t\tvar receiver = false,\r\n\t\tsuccess = false;\r\n\r\n\t\te.stopImmediatePropagation();\r\n\r\n\t\tswitch(typeof this.table.options.movableRowsReceiver){\r\n\t\t\tcase \"string\":\r\n\t\t\treceiver = this.receivers[this.table.options.movableRowsReceiver];\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\treceiver = this.table.options.movableRowsReceiver;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(receiver){\r\n\t\t\tsuccess = receiver.call(this, this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable)\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Mover Row Error - no matching receiver found:\", this.table.options.movableRowsReceiver)\r\n\t\t}\r\n\r\n\t\tif(success){\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceived\", this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivedFailed\", this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);\r\n\t\t}\r\n\r\n\t\tthis.commsSend(this.connectedTable, \"moveRow\", \"dropcomplete\", {\r\n\t\t\trow:row,\r\n\t\t\tsuccess:success,\r\n\t\t});\r\n\t}\r\n\r\n\tcommsReceived(table, action, data){\r\n\t\tswitch(action){\r\n\t\t\tcase \"connect\":\r\n\t\t\treturn this.connect(table, data.row);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"disconnect\":\r\n\t\t\treturn this.disconnect(table);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"dropcomplete\":\r\n\t\t\treturn this.dropComplete(table, data.row, data.success);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMoveRows.prototype.receivers = {\r\n\tinsert:function(fromRow, toRow, fromTable){\r\n\t\tthis.table.addRow(fromRow.getData(), undefined, toRow);\r\n\t\treturn true;\r\n\t},\r\n\r\n\tadd:function(fromRow, toRow, fromTable){\r\n\t\tthis.table.addRow(fromRow.getData());\r\n\t\treturn true;\r\n\t},\r\n\r\n\tupdate:function(fromRow, toRow, fromTable){\r\n\t\tif(toRow){\r\n\t\t\ttoRow.update(fromRow.getData());\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n\r\n\treplace:function(fromRow, toRow, fromTable){\r\n\t\tif(toRow){\r\n\t\t\tthis.table.addRow(fromRow.getData(), undefined, toRow);\r\n\t\t\ttoRow.delete();\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n};\r\n\r\nMoveRows.prototype.senders = {\r\n\tdelete:function(fromRow, toRow, toTable){\r\n\t\tfromRow.delete();\r\n\t}\r\n};\r\n\r\nMoveRows.moduleName = \"moveRow\";\r\n\r\nexport default MoveRows;","export default {};","import Module from '../../core/Module.js';\r\n\r\nimport defaultMutators from './defaults/mutators.js';\r\n\r\nclass Mutator extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.allowedTypes = [\"\", \"data\", \"edit\", \"clipboard\"]; //list of muatation types\r\n\t\tthis.enabled = true;\r\n\r\n\t\tthis.registerColumnOption(\"mutator\");\r\n\t\tthis.registerColumnOption(\"mutatorParams\");\r\n\t\tthis.registerColumnOption(\"mutatorData\");\r\n\t\tthis.registerColumnOption(\"mutatorDataParams\");\r\n\t\tthis.registerColumnOption(\"mutatorEdit\");\r\n\t\tthis.registerColumnOption(\"mutatorEditParams\");\r\n\t\tthis.registerColumnOption(\"mutatorClipboard\");\r\n\t\tthis.registerColumnOption(\"mutatorClipboardParams\");\r\n\t\tthis.registerColumnOption(\"mutateLink\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-value-changing\", this.transformCell.bind(this));\r\n\t\tthis.subscribe(\"cell-value-changed\", this.mutateLink.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"row-data-init-before\", this.rowDataChanged.bind(this));\r\n\t\tthis.subscribe(\"row-data-changing\", this.rowDataChanged.bind(this));\r\n\t}\r\n\r\n\trowDataChanged(row, tempData, updatedData){\r\n\t\treturn this.transformRow(tempData, \"data\", updatedData);\r\n\t}\r\n\r\n\t//initialize column mutator\r\n\tinitializeColumn(column){\r\n\t\tvar match = false,\r\n\t\tconfig = {};\r\n\r\n\t\tthis.allowedTypes.forEach((type) => {\r\n\t\t\tvar key = \"mutator\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\t\tmutator;\r\n\r\n\t\t\tif(column.definition[key]){\r\n\t\t\t\tmutator = this.lookupMutator(column.definition[key]);\r\n\r\n\t\t\t\tif(mutator){\r\n\t\t\t\t\tmatch = true;\r\n\r\n\t\t\t\t\tconfig[key] = {\r\n\t\t\t\t\t\tmutator:mutator,\r\n\t\t\t\t\t\tparams: column.definition[key + \"Params\"] || {},\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(match){\r\n\t\t\tcolumn.modules.mutate = config;\r\n\t\t}\r\n\t}\r\n\r\n\tlookupMutator(value){\r\n\t\tvar mutator = false;\r\n\r\n\t\t//set column mutator\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(Mutator.mutators[value]){\r\n\t\t\t\tmutator = Mutator.mutators[value];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Mutator Error - No such mutator found, ignoring: \", value);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tmutator = value;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn mutator;\r\n\t}\r\n\r\n\t//apply mutator to row\r\n\ttransformRow(data, type, updatedData){\r\n\t\tvar key = \"mutator\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\tvalue;\r\n\r\n\t\tif(this.enabled){\r\n\r\n\t\t\tthis.table.columnManager.traverse((column) => {\r\n\t\t\t\tvar mutator, params, component;\r\n\r\n\t\t\t\tif(column.modules.mutate){\r\n\t\t\t\t\tmutator = column.modules.mutate[key] || column.modules.mutate.mutator || false;\r\n\r\n\t\t\t\t\tif(mutator){\r\n\t\t\t\t\t\tvalue = column.getFieldValue(typeof updatedData !== \"undefined\" ? updatedData : data);\r\n\r\n\t\t\t\t\t\tif(type == \"data\" || typeof value !== \"undefined\"){\r\n\t\t\t\t\t\t\tcomponent = column.getComponent();\r\n\t\t\t\t\t\t\tparams = typeof mutator.params === \"function\" ? mutator.params(value, data, type, component) : mutator.params;\r\n\t\t\t\t\t\t\tcolumn.setFieldValue(data, mutator.mutator(value, data, type, params, component));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//apply mutator to new cell value\r\n\ttransformCell(cell, value){\r\n\t\tif(cell.column.modules.mutate){\r\n\t\t\tvar mutator = cell.column.modules.mutate.mutatorEdit || cell.column.modules.mutate.mutator || false,\r\n\t\t\ttempData = {};\r\n\r\n\t\t\tif(mutator){\r\n\t\t\t\ttempData = Object.assign(tempData, cell.row.getData());\r\n\t\t\t\tcell.column.setFieldValue(tempData, value);\r\n\t\t\t\treturn mutator.mutator(value, tempData, \"edit\", mutator.params, cell.getComponent());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\tmutateLink(cell){\r\n\t\tvar links = cell.column.definition.mutateLink;\r\n\r\n\t\tif(links){\r\n\t\t\tif(!Array.isArray(links)){\r\n\t\t\t\tlinks = [links];\r\n\t\t\t}\r\n\r\n\t\t\tlinks.forEach((link) => {\r\n\t\t\t\tvar linkCell = cell.row.getCell(link);\r\n\r\n\t\t\t\tif(linkCell){\r\n\t\t\t\t\tlinkCell.setValue(linkCell.getValue(), true, true);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tenable(){\r\n\t\tthis.enabled = true;\r\n\t}\r\n\r\n\tdisable(){\r\n\t\tthis.enabled = false;\r\n\t}\r\n}\r\n\r\nMutator.moduleName = \"mutator\";\r\n\r\n//load defaults\r\nMutator.mutators = defaultMutators;\r\n\r\nexport default Mutator;","export default function(pageSize, currentRow, currentPage, totalRows, totalPages){\r\n\tvar el = document.createElement(\"span\"),\r\n\tshowingEl = document.createElement(\"span\"),\r\n\tvalueEl = document.createElement(\"span\"),\r\n\tofEl = document.createElement(\"span\"),\r\n\ttotalEl = document.createElement(\"span\"),\r\n\trowsEl = document.createElement(\"span\");\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|showing\", (value) => {\r\n\t\tshowingEl.innerHTML = value;\r\n\t});\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|of\", (value) => {\r\n\t\tofEl.innerHTML = value;\r\n\t});\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|rows\", (value) => {\r\n\t\trowsEl.innerHTML = value;\r\n\t});\r\n\r\n\tif(totalRows){\r\n\t\tvalueEl.innerHTML = \" \" + currentRow + \"-\" + Math.min((currentRow + pageSize - 1), totalRows) + \" \";\r\n\t\t\r\n\t\ttotalEl.innerHTML = \" \" + totalRows + \" \";\r\n\t\t\r\n\t\tel.appendChild(showingEl);\r\n\t\tel.appendChild(valueEl);\r\n\t\tel.appendChild(ofEl);\r\n\t\tel.appendChild(totalEl);\r\n\t\tel.appendChild(rowsEl);\r\n\t}else{\r\n\t\tvalueEl.innerHTML = \" 0 \";\r\n\r\n\t\tel.appendChild(showingEl);\r\n\t\tel.appendChild(valueEl);\r\n\t\tel.appendChild(rowsEl);\r\n\t}\r\n\t\r\n\treturn el;\r\n};","export default function(pageSize, currentRow, currentPage, totalRows, totalPages){\r\n\r\n var el = document.createElement(\"span\"),\r\n\tshowingEl = document.createElement(\"span\"),\r\n\tvalueEl = document.createElement(\"span\"),\r\n\tofEl = document.createElement(\"span\"),\r\n\ttotalEl = document.createElement(\"span\"),\r\n\trowsEl = document.createElement(\"span\");\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|showing\", (value) => {\r\n\t\tshowingEl.innerHTML = value;\r\n\t});\r\n\t\r\n\tvalueEl.innerHTML = \" \" + currentPage + \" \";\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|of\", (value) => {\r\n\t\tofEl.innerHTML = value;\r\n\t});\r\n\t\r\n\ttotalEl.innerHTML = \" \" + totalPages + \" \";\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|pages\", (value) => {\r\n\t\trowsEl.innerHTML = value;\r\n\t});\r\n\t\r\n\tel.appendChild(showingEl);\r\n\tel.appendChild(valueEl);\r\n\tel.appendChild(ofEl);\r\n\tel.appendChild(totalEl);\r\n\tel.appendChild(rowsEl);\r\n\t\r\n\treturn el;\r\n};","import rows from './pageCounters/rows.js';\r\nimport pages from './pageCounters/pages.js';\r\n\r\n\r\nexport default {\r\n\trows:rows,\r\n\tpages:pages,\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultPageCounters from './defaults/pageCounters.js';\r\n\r\nclass Page extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.mode = \"local\";\r\n\t\tthis.progressiveLoad = false;\r\n\t\t\r\n\t\tthis.element = null;\r\n\t\tthis.pageCounterElement = null;\r\n\t\tthis.pageCounter = null;\r\n\t\t\r\n\t\tthis.size = 0;\r\n\t\tthis.page = 1;\r\n\t\tthis.count = 5;\r\n\t\tthis.max = 1;\r\n\r\n\t\tthis.remoteRowCountEstimate = null;\r\n\t\t\r\n\t\tthis.displayIndex = 0; //index in display pipeline\r\n\t\t\r\n\t\tthis.initialLoad = true;\r\n\t\tthis.dataChanging = false; //flag to check if data is being changed by this module\r\n\t\t\r\n\t\tthis.pageSizes = [];\r\n\t\t\r\n\t\tthis.registerTableOption(\"pagination\", false); //set pagination type\r\n\t\tthis.registerTableOption(\"paginationMode\", \"local\"); //local or remote pagination\r\n\t\tthis.registerTableOption(\"paginationSize\", false); //set number of rows to a page\r\n\t\tthis.registerTableOption(\"paginationInitialPage\", 1); //initial page to show on load\r\n\t\tthis.registerTableOption(\"paginationCounter\", false); // set pagination counter\r\n\t\tthis.registerTableOption(\"paginationCounterElement\", false); // set pagination counter\r\n\t\tthis.registerTableOption(\"paginationButtonCount\", 5); // set count of page button\r\n\t\tthis.registerTableOption(\"paginationSizeSelector\", false); //add pagination size selector element\r\n\t\tthis.registerTableOption(\"paginationElement\", false); //element to hold pagination numbers\r\n\t\t// this.registerTableOption(\"paginationDataSent\", {}); //pagination data sent to the server\r\n\t\t// this.registerTableOption(\"paginationDataReceived\", {}); //pagination data received from the server\r\n\t\tthis.registerTableOption(\"paginationAddRow\", \"page\"); //add rows on table or page\r\n\t\t\r\n\t\tthis.registerTableOption(\"progressiveLoad\", false); //progressive loading\r\n\t\tthis.registerTableOption(\"progressiveLoadDelay\", 0); //delay between requests\r\n\t\tthis.registerTableOption(\"progressiveLoadScrollMargin\", 0); //margin before scroll begins\r\n\t\t\r\n\t\tthis.registerTableFunction(\"setMaxPage\", this.setMaxPage.bind(this));\r\n\t\tthis.registerTableFunction(\"setPage\", this.setPage.bind(this));\r\n\t\tthis.registerTableFunction(\"setPageToRow\", this.userSetPageToRow.bind(this));\r\n\t\tthis.registerTableFunction(\"setPageSize\", this.userSetPageSize.bind(this));\r\n\t\tthis.registerTableFunction(\"getPageSize\", this.getPageSize.bind(this));\r\n\t\tthis.registerTableFunction(\"previousPage\", this.previousPage.bind(this));\r\n\t\tthis.registerTableFunction(\"nextPage\", this.nextPage.bind(this));\r\n\t\tthis.registerTableFunction(\"getPage\", this.getPage.bind(this));\r\n\t\tthis.registerTableFunction(\"getPageMax\", this.getPageMax.bind(this));\r\n\t\t\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"pageTo\", this.setPageToRow.bind(this));\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"row-added\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"data-processed\", this.initialLoadComplete.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.calculatePageSizes.bind(this));\r\n\t\t\tthis.subscribe(\"footer-redraw\", this.footerRedraw.bind(this));\r\n\r\n\t\t\tif(this.table.options.paginationAddRow == \"page\"){\r\n\t\t\t\tthis.subscribe(\"row-adding-position\", this.rowAddingPosition.bind(this));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.options.paginationMode === \"remote\"){\r\n\t\t\t\tthis.subscribe(\"data-params\", this.remotePageParams.bind(this));\r\n\t\t\t\tthis.subscribe(\"data-loaded\", this._parseRemoteData.bind(this));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.options.progressiveLoad){\r\n\t\t\t\tconsole.error(\"Progressive Load Error - Pagination and progressive load cannot be used at the same time\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.registerDisplayHandler(this.restOnRenderBefore.bind(this), 40);\r\n\t\t\tthis.registerDisplayHandler(this.getRows.bind(this), 50);\r\n\t\t\t\r\n\t\t\tthis.createElements();\r\n\t\t\tthis.initializePageCounter();\r\n\t\t\tthis.initializePaginator();\r\n\t\t}else if(this.table.options.progressiveLoad){\r\n\t\t\tthis.subscribe(\"data-params\", this.remotePageParams.bind(this));\r\n\t\t\tthis.subscribe(\"data-loaded\", this._parseRemoteData.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.calculatePageSizes.bind(this));\r\n\t\t\tthis.subscribe(\"data-processed\", this.initialLoadComplete.bind(this));\r\n\t\t\t\r\n\t\t\tthis.initializeProgressive(this.table.options.progressiveLoad)\r\n\t\t\t\r\n\t\t\tif(this.table.options.progressiveLoad === \"scroll\"){\r\n\t\t\t\tthis.subscribe(\"scroll-vertical\", this.scrollVertical.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trowAddingPosition(row, top){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tdispRows = rowManager.getDisplayRows(),\r\n\t\tindex;\r\n\t\t\r\n\t\tif(top){\r\n\t\t\tif(dispRows.length){\r\n\t\t\t\tindex = dispRows[0];\r\n\t\t\t}else{\r\n\t\t\t\tif(rowManager.activeRows.length){\r\n\t\t\t\t\tindex = rowManager.activeRows[rowManager.activeRows.length-1];\r\n\t\t\t\t\ttop = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(dispRows.length){\r\n\t\t\t\tindex = dispRows[dispRows.length - 1];\r\n\t\t\t\ttop = dispRows.length < this.size ? false : true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn {index, top}\r\n\t}\r\n\t\r\n\tcalculatePageSizes(){\r\n\t\tvar testElRow, testElCell;\r\n\t\t\r\n\t\tif(this.table.options.paginationSize){\r\n\t\t\tthis.size = this.table.options.paginationSize;\r\n\t\t}else{\r\n\t\t\ttestElRow = document.createElement(\"div\");\r\n\t\t\ttestElRow.classList.add(\"tabulator-row\");\r\n\t\t\ttestElRow.style.visibility = \"hidden\";\r\n\t\t\t\r\n\t\t\ttestElCell = document.createElement(\"div\");\r\n\t\t\ttestElCell.classList.add(\"tabulator-cell\");\r\n\t\t\ttestElCell.innerHTML = \"Page Row Test\";\r\n\t\t\t\r\n\t\t\ttestElRow.appendChild(testElCell);\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.getTableElement().appendChild(testElRow);\r\n\t\t\t\r\n\t\t\tthis.size = Math.floor(this.table.rowManager.getElement().clientHeight / testElRow.offsetHeight);\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.getTableElement().removeChild(testElRow);\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(\"pageSizeChanged\", this.size);\r\n\t\t\r\n\t\tthis.generatePageSizeSelectList();\r\n\t}\r\n\t\r\n\tinitialLoadComplete(){\r\n\t\tthis.initialLoad = false;\r\n\t}\r\n\t\r\n\tremotePageParams(data, config, silent, params){\r\n\t\tif(!this.initialLoad){\r\n\t\t\tif((this.progressiveLoad && !silent) || (!this.progressiveLoad && !this.dataChanging)){\r\n\t\t\t\tthis.reset(true);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//configure request params\r\n\t\tparams.page = this.page;\r\n\t\t\r\n\t\t//set page size if defined\r\n\t\tif(this.size){\r\n\t\t\tparams.size = this.size;\r\n\t\t}\r\n\t\t\r\n\t\treturn params;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\tuserSetPageToRow(row){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\trow = this.rowManager.findRow(row);\r\n\t\t\t\r\n\t\t\tif(row){\r\n\t\t\t\treturn this.setPageToRow(row)\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn Promise.reject();\r\n\t}\r\n\t\r\n\tuserSetPageSize(size){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\tthis.setPageSize(size);\r\n\t\t\treturn this.setPage(1);\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tscrollVertical(top, dir){\r\n\t\tvar element, diff, margin;\r\n\t\tif(!dir && !this.table.dataLoader.loading){\r\n\t\t\telement = this.table.rowManager.getElement();\r\n\t\t\tdiff = element.scrollHeight - element.clientHeight - top;\r\n\t\t\tmargin = this.table.options.progressiveLoadScrollMargin || (element.clientHeight * 2);\r\n\t\t\t\r\n\t\t\tif(diff < margin){\r\n\t\t\t\tthis.nextPage()\r\n\t\t\t\t.catch(() => {}); //consume the exception thrown when on the last page\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trestOnRenderBefore(rows, renderInPosition){\r\n\t\tif(!renderInPosition){\r\n\t\t\tif(this.mode === \"local\"){\r\n\t\t\t\tthis.reset();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\trowsUpdated(){\r\n\t\tthis.refreshData(true, \"all\");\r\n\t}\r\n\t\r\n\tcreateElements(){\r\n\t\tvar button;\r\n\t\t\r\n\t\tthis.element = document.createElement(\"span\");\r\n\t\tthis.element.classList.add(\"tabulator-paginator\");\r\n\t\t\r\n\t\tthis.pagesElement = document.createElement(\"span\");\r\n\t\tthis.pagesElement.classList.add(\"tabulator-pages\");\r\n\t\t\r\n\t\tbutton = document.createElement(\"button\");\r\n\t\tbutton.classList.add(\"tabulator-page\");\r\n\t\tbutton.setAttribute(\"type\", \"button\");\r\n\t\tbutton.setAttribute(\"role\", \"button\");\r\n\t\tbutton.setAttribute(\"aria-label\", \"\");\r\n\t\tbutton.setAttribute(\"title\", \"\");\r\n\t\t\r\n\t\tthis.firstBut = button.cloneNode(true);\r\n\t\tthis.firstBut.setAttribute(\"data-page\", \"first\");\r\n\t\t\r\n\t\tthis.prevBut = button.cloneNode(true);\r\n\t\tthis.prevBut.setAttribute(\"data-page\", \"prev\");\r\n\t\t\r\n\t\tthis.nextBut = button.cloneNode(true);\r\n\t\tthis.nextBut.setAttribute(\"data-page\", \"next\");\r\n\t\t\r\n\t\tthis.lastBut = button.cloneNode(true);\r\n\t\tthis.lastBut.setAttribute(\"data-page\", \"last\");\r\n\t\t\r\n\t\tif(this.table.options.paginationSizeSelector){\r\n\t\t\tthis.pageSizeSelect = document.createElement(\"select\");\r\n\t\t\tthis.pageSizeSelect.classList.add(\"tabulator-page-size\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tgeneratePageSizeSelectList(){\r\n\t\tvar pageSizes = [];\r\n\t\t\r\n\t\tif(this.pageSizeSelect){\r\n\t\t\t\r\n\t\t\tif(Array.isArray(this.table.options.paginationSizeSelector)){\r\n\t\t\t\tpageSizes = this.table.options.paginationSizeSelector;\r\n\t\t\t\tthis.pageSizes = pageSizes;\r\n\t\t\t\t\r\n\t\t\t\tif(this.pageSizes.indexOf(this.size) == -1){\r\n\t\t\t\t\tpageSizes.unshift(this.size);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t\r\n\t\t\t\tif(this.pageSizes.indexOf(this.size) == -1){\r\n\t\t\t\t\tpageSizes = [];\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (let i = 1; i < 5; i++){\r\n\t\t\t\t\t\tpageSizes.push(this.size * i);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.pageSizes = pageSizes;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tpageSizes = this.pageSizes;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\twhile(this.pageSizeSelect.firstChild) this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);\r\n\t\t\t\r\n\t\t\tpageSizes.forEach((item) => {\r\n\t\t\t\tvar itemEl = document.createElement(\"option\");\r\n\t\t\t\titemEl.value = item;\r\n\t\t\t\t\r\n\t\t\t\tif(item === true){\r\n\t\t\t\t\tthis.langBind(\"pagination|all\", function(value){\r\n\t\t\t\t\t\titemEl.innerHTML = value;\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\titemEl.innerHTML = item;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tthis.pageSizeSelect.appendChild(itemEl);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.pageSizeSelect.value = this.size;\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializePageCounter(){\r\n\t\tvar counter = this.table.options.paginationCounter,\r\n\t\tpageCounter = null;\r\n\t\t\r\n\t\tif(counter){\r\n\t\t\tif(typeof counter === \"function\"){\r\n\t\t\t\tpageCounter = counter;\r\n\t\t\t}else{\r\n\t\t\t\tpageCounter = Page.pageCounters[counter];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(pageCounter){\r\n\t\t\t\tthis.pageCounter = pageCounter;\r\n\t\t\t\t\r\n\t\t\t\tthis.pageCounterElement = document.createElement(\"span\");\r\n\t\t\t\tthis.pageCounterElement.classList.add(\"tabulator-page-counter\");\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Pagination Error - No such page counter found: \", counter);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//setup pagination\r\n\tinitializePaginator(hidden){\r\n\t\tvar pageSelectLabel, paginationCounterHolder;\r\n\t\t\r\n\t\tif(!hidden){\r\n\t\t\t//build pagination element\r\n\t\t\t\r\n\t\t\t//bind localizations\r\n\t\t\tthis.langBind(\"pagination|first\", (value) => {\r\n\t\t\t\tthis.firstBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|first_title\", (value) => {\r\n\t\t\t\tthis.firstBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.firstBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|prev\", (value) => {\r\n\t\t\t\tthis.prevBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|prev_title\", (value) => {\r\n\t\t\t\tthis.prevBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.prevBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|next\", (value) => {\r\n\t\t\t\tthis.nextBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|next_title\", (value) => {\r\n\t\t\t\tthis.nextBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.nextBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|last\", (value) => {\r\n\t\t\t\tthis.lastBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|last_title\", (value) => {\r\n\t\t\t\tthis.lastBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.lastBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t//click bindings\r\n\t\t\tthis.firstBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.setPage(1)\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.prevBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.previousPage()\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.nextBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.nextPage()\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.lastBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.setPage(this.max)\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(this.table.options.paginationElement){\r\n\t\t\t\tthis.element = this.table.options.paginationElement;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.pageSizeSelect){\r\n\t\t\t\tpageSelectLabel = document.createElement(\"label\");\r\n\t\t\t\t\r\n\t\t\t\tthis.langBind(\"pagination|page_size\", (value) => {\r\n\t\t\t\t\tthis.pageSizeSelect.setAttribute(\"aria-label\", value);\r\n\t\t\t\t\tthis.pageSizeSelect.setAttribute(\"title\", value);\r\n\t\t\t\t\tpageSelectLabel.innerHTML = value;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.element.appendChild(pageSelectLabel);\r\n\t\t\t\tthis.element.appendChild(this.pageSizeSelect);\r\n\t\t\t\t\r\n\t\t\t\tthis.pageSizeSelect.addEventListener(\"change\", (e) => {\r\n\t\t\t\t\tthis.setPageSize(this.pageSizeSelect.value == \"true\" ? true : this.pageSizeSelect.value);\r\n\t\t\t\t\tthis.setPage(1)\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//append to DOM\r\n\t\t\tthis.element.appendChild(this.firstBut);\r\n\t\t\tthis.element.appendChild(this.prevBut);\r\n\t\t\tthis.element.appendChild(this.pagesElement);\r\n\t\t\tthis.element.appendChild(this.nextBut);\r\n\t\t\tthis.element.appendChild(this.lastBut);\r\n\t\t\t\r\n\t\t\tif(!this.table.options.paginationElement && !hidden){\r\n\t\t\t\tif(this.table.options.paginationCounter){\r\n\r\n\t\t\t\t\tpaginationCounterHolder \r\n\r\n\t\t\t\t\tif(this.table.options.paginationCounterElement){\r\n\t\t\t\t\t\tif(this.table.options.paginationCounterElement instanceof HTMLElement){\r\n\t\t\t\t\t\t\tthis.table.options.paginationCounterElement.appendChild(this.pageCounterElement);\r\n\t\t\t\t\t\t}else if(typeof this.table.options.paginationCounterElement === \"string\"){\r\n\t\t\t\t\t\t\tpaginationCounterHolder = document.querySelector(this.table.options.paginationCounterElement);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(paginationCounterHolder){\r\n\t\t\t\t\t\t\t\tpaginationCounterHolder.appendChild(this.pageCounterElement);\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Pagination Error - Unable to find element matching paginationCounterElement selector:\", this.table.options.paginationCounterElement);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.footerAppend(this.pageCounterElement);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.footerAppend(this.element);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.page = this.table.options.paginationInitialPage;\r\n\t\t\tthis.count = this.table.options.paginationButtonCount;\r\n\t\t}\r\n\t\t\r\n\t\t//set default values\r\n\t\tthis.mode = this.table.options.paginationMode;\r\n\t}\r\n\t\r\n\tinitializeProgressive(mode){\r\n\t\tthis.initializePaginator(true);\r\n\t\tthis.mode = \"progressive_\" + mode;\r\n\t\tthis.progressiveLoad = true;\r\n\t}\r\n\t\r\n\ttrackChanges(){\r\n\t\tthis.dispatch(\"page-changed\");\r\n\t}\r\n\t\r\n\tsetDisplayIndex(index){\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\t\r\n\tgetDisplayIndex(){\r\n\t\treturn this.displayIndex;\r\n\t}\r\n\t\r\n\t//calculate maximum page from number of rows\r\n\tsetMaxRows(rowCount){\r\n\t\tif(!rowCount){\r\n\t\t\tthis.max = 1;\r\n\t\t}else{\r\n\t\t\tthis.max = this.size === true ? 1 : Math.ceil(rowCount/this.size);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.page > this.max){\r\n\t\t\tthis.page = this.max;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//reset to first page without triggering action\r\n\treset(force){\r\n\t\tif(!this.initialLoad){\r\n\t\t\tif(this.mode == \"local\" || force){\r\n\t\t\t\tthis.page = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set the maximum page\r\n\tsetMaxPage(max){\r\n\t\t\r\n\t\tmax = parseInt(max);\r\n\t\t\r\n\t\tthis.max = max || 1;\r\n\t\t\r\n\t\tif(this.page > this.max){\r\n\t\t\tthis.page = this.max;\r\n\t\t\tthis.trigger();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set current page number\r\n\tsetPage(page){\r\n\t\tswitch(page){\r\n\t\t\tcase \"first\":\r\n\t\t\treturn this.setPage(1);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"prev\":\r\n\t\t\treturn this.previousPage();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"next\":\r\n\t\t\treturn this.nextPage();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"last\":\r\n\t\t\treturn this.setPage(this.max);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\tpage = parseInt(page);\r\n\t\t\r\n\t\tif((page > 0 && page <= this.max) || this.mode !== \"local\"){\r\n\t\t\tthis.page = page;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Requested page is out of range of 1 - \" + this.max + \":\", page);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetPageToRow(row){\r\n\t\tvar rows = this.table.rowManager.getDisplayRows(this.displayIndex - 1);\r\n\t\tvar index = rows.indexOf(row);\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tvar page = this.size === true ? 1 : Math.ceil((index + 1) / this.size);\r\n\t\t\t\r\n\t\t\treturn this.setPage(page)\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Requested row is not visible\");\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetPageSize(size){\r\n\t\tif(size !== true){\r\n\t\t\tsize = parseInt(size);\r\n\t\t}\r\n\r\n\t\tif(size > 0){\r\n\t\t\tthis.size = size;\r\n\t\t\tthis.dispatchExternal(\"pageSizeChanged\", size);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.pageSizeSelect){\r\n\t\t\t// this.pageSizeSelect.value = size;\r\n\t\t\tthis.generatePageSizeSelectList();\r\n\t\t}\r\n\t\t\r\n\t\tthis.trackChanges();\r\n\t}\r\n\t\r\n\t_setPageCounter(totalRows, size, currentRow){\r\n\t\tvar content;\r\n\t\t\r\n\t\tif(this.pageCounter){\r\n\r\n\t\t\tif(this.mode === \"remote\"){\r\n\t\t\t\tsize = this.size;\r\n\t\t\t\tcurrentRow = ((this.page - 1) * this.size) + 1;\r\n\t\t\t\ttotalRows = this.remoteRowCountEstimate;\r\n\t\t\t}\r\n\r\n\t\t\tcontent = this.pageCounter.call(this, size, currentRow, this.page, totalRows, this.max);\r\n\t\t\t\r\n\t\t\tswitch(typeof content){\r\n\t\t\t\tcase \"object\":\r\n\t\t\t\tif(content instanceof Node){\r\n\t\t\t\t\t\r\n\t\t\t\t\t//clear previous cell contents\r\n\t\t\t\t\twhile(this.pageCounterElement.firstChild) this.pageCounterElement.removeChild(this.pageCounterElement.firstChild);\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.pageCounterElement.appendChild(content);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.pageCounterElement.innerHTML = \"\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(content != null){\r\n\t\t\t\t\t\tconsole.warn(\"Page Counter Error - Page Counter has returned a type of object, the only valid page counter object return is an instance of Node, the page counter returned:\", content);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"undefined\":\r\n\t\t\t\tcase \"null\":\r\n\t\t\t\tthis.pageCounterElement.innerHTML = \"\";\r\n\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\tthis.pageCounterElement.innerHTML = content;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//setup the pagination buttons\r\n\t_setPageButtons(){\r\n\t\tlet leftSize = Math.floor((this.count-1) / 2);\r\n\t\tlet rightSize = Math.ceil((this.count-1) / 2);\r\n\t\tlet min = this.max - this.page + leftSize + 1 < this.count ? this.max-this.count+1: Math.max(this.page-leftSize,1);\r\n\t\tlet max = this.page <= rightSize? Math.min(this.count, this.max) :Math.min(this.page+rightSize, this.max);\r\n\t\t\r\n\t\twhile(this.pagesElement.firstChild) this.pagesElement.removeChild(this.pagesElement.firstChild);\r\n\t\t\r\n\t\tif(this.page == 1){\r\n\t\t\tthis.firstBut.disabled = true;\r\n\t\t\tthis.prevBut.disabled = true;\r\n\t\t}else{\r\n\t\t\tthis.firstBut.disabled = false;\r\n\t\t\tthis.prevBut.disabled = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.page == this.max){\r\n\t\t\tthis.lastBut.disabled = true;\r\n\t\t\tthis.nextBut.disabled = true;\r\n\t\t}else{\r\n\t\t\tthis.lastBut.disabled = false;\r\n\t\t\tthis.nextBut.disabled = false;\r\n\t\t}\r\n\t\t\r\n\t\tfor(let i = min; i <= max; i++){\r\n\t\t\tif(i>0 && i <= this.max){\r\n\t\t\t\tthis.pagesElement.appendChild(this._generatePageButton(i));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.footerRedraw();\r\n\t}\r\n\t\r\n\t_generatePageButton(page){\r\n\t\tvar button = document.createElement(\"button\");\r\n\t\t\r\n\t\tbutton.classList.add(\"tabulator-page\");\r\n\t\tif(page == this.page){\r\n\t\t\tbutton.classList.add(\"active\");\r\n\t\t}\r\n\t\t\r\n\t\tbutton.setAttribute(\"type\", \"button\");\r\n\t\tbutton.setAttribute(\"role\", \"button\");\r\n\t\t\r\n\t\tthis.langBind(\"pagination|page_title\", (value) => {\r\n\t\t\tbutton.setAttribute(\"aria-label\", value + \" \" + page);\r\n\t\t\tbutton.setAttribute(\"title\", value + \" \" + page);\r\n\t\t});\r\n\t\t\r\n\t\tbutton.setAttribute(\"data-page\", page);\r\n\t\tbutton.textContent = page;\r\n\t\t\r\n\t\tbutton.addEventListener(\"click\", (e) => {\r\n\t\t\tthis.setPage(page)\r\n\t\t});\r\n\t\t\r\n\t\treturn button;\r\n\t}\r\n\t\r\n\t//previous page\r\n\tpreviousPage(){\r\n\t\tif(this.page > 1){\r\n\t\t\tthis.page--;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger()\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Previous page would be less than page 1:\", 0);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//next page\r\n\tnextPage(){\r\n\t\tif(this.page < this.max){\r\n\t\t\tthis.page++;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger();\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tif(!this.progressiveLoad){\r\n\t\t\t\tconsole.warn(\"Pagination Error - Next page would be greater than maximum page of \" + this.max + \":\", this.max + 1);\r\n\t\t\t}\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return current page number\r\n\tgetPage(){\r\n\t\treturn this.page;\r\n\t}\r\n\t\r\n\t//return max page number\r\n\tgetPageMax(){\r\n\t\treturn this.max;\r\n\t}\r\n\t\r\n\tgetPageSize(size){\r\n\t\treturn this.size;\r\n\t}\r\n\t\r\n\tgetMode(){\r\n\t\treturn this.mode;\r\n\t}\r\n\t\r\n\t//return appropriate rows for current page\r\n\tgetRows(data){\r\n\t\tvar actualRowPageSize = 0,\r\n\t\toutput, start, end, actualStartRow;\r\n\r\n\t\tvar actualRows = data.filter((row) => {\r\n\t\t\treturn row.type === \"row\";\r\n\t\t});\r\n\t\t\r\n\t\tif(this.mode == \"local\"){\r\n\t\t\toutput = [];\r\n\t\t\t\r\n\t\t\tthis.setMaxRows(data.length);\r\n\t\t\t\r\n\t\t\tif(this.size === true){\r\n\t\t\t\tstart = 0;\r\n\t\t\t\tend = data.length;\r\n\t\t\t}else{\r\n\t\t\t\tstart = this.size * (this.page - 1);\r\n\t\t\t\tend = start + parseInt(this.size);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._setPageButtons();\r\n\t\t\t\r\n\t\t\tfor(let i = start; i < end; i++){\r\n\t\t\t\tlet row = data[i];\r\n\r\n\t\t\t\tif(row){\r\n\t\t\t\t\toutput.push(row);\r\n\r\n\t\t\t\t\tif(row.type === \"row\"){\r\n\t\t\t\t\t\tif(!actualStartRow){\r\n\t\t\t\t\t\t\tactualStartRow = row;\r\n\t\t\t\t\t\t}\t\r\n\r\n\t\t\t\t\t\tactualRowPageSize++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._setPageCounter(actualRows.length, actualRowPageSize, actualStartRow ? (actualRows.indexOf(actualStartRow) + 1) : 0);\r\n\t\t\t\r\n\t\t\treturn output;\r\n\t\t}else{\r\n\t\t\tthis._setPageButtons();\r\n\t\t\tthis._setPageCounter(actualRows.length);\r\n\t\t\t\r\n\t\t\treturn data.slice(0);\r\n\t\t}\r\n\t}\r\n\t\r\n\ttrigger(){\r\n\t\tvar left;\r\n\t\t\r\n\t\tswitch(this.mode){\r\n\t\t\tcase \"local\":\r\n\t\t\tleft = this.table.rowManager.scrollLeft;\r\n\t\t\t\r\n\t\t\tthis.refreshData();\r\n\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"pageLoaded\", this.getPage());\r\n\t\t\t\r\n\t\t\treturn Promise.resolve();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"remote\":\r\n\t\t\tthis.dataChanging = true;\r\n\t\t\treturn this.reloadData(null)\r\n\t\t\t.finally(() => {\r\n\t\t\t\tthis.dataChanging = false;\r\n\t\t\t})\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"progressive_load\":\r\n\t\t\tcase \"progressive_scroll\":\r\n\t\t\treturn this.reloadData(null, true);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\tconsole.warn(\"Pagination Error - no such pagination mode:\", this.mode);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_parseRemoteData(data){\r\n\t\tvar left, data, margin;\r\n\t\t\r\n\t\tif(typeof data.last_page === \"undefined\"){\r\n\t\t\tconsole.warn(\"Remote Pagination Error - Server response missing '\" + (this.options(\"dataReceiveParams\").last_page || \"last_page\") + \"' property\");\r\n\t\t}\r\n\t\t\r\n\t\tif(data.data){\r\n\t\t\tthis.max = parseInt(data.last_page) || 1;\r\n\r\n\t\t\tthis.remoteRowCountEstimate = typeof data.last_row !== \"undefined\" ? data.last_row : (data.last_page * this.size - (this.page == data.last_page ? (this.size - data.data.length) : 0));\r\n\t\t\t\r\n\t\t\tif(this.progressiveLoad){\r\n\t\t\t\tswitch(this.mode){\r\n\t\t\t\t\tcase \"progressive_load\":\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.page == 1){\r\n\t\t\t\t\t\tthis.table.rowManager.setData(data.data, false, this.page == 1)\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.table.rowManager.addRows(data.data);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.page < this.max){\r\n\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\tthis.nextPage();\r\n\t\t\t\t\t\t}, this.table.options.progressiveLoadDelay);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"progressive_scroll\":\r\n\t\t\t\t\tdata = this.page === 1 ? data.data : this.table.rowManager.getData().concat(data.data);\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.table.rowManager.setData(data, this.page !== 1, this.page == 1);\r\n\t\t\t\t\t\r\n\t\t\t\t\tmargin = this.table.options.progressiveLoadScrollMargin || (this.table.rowManager.element.clientHeight * 2);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.table.rowManager.element.scrollHeight <= (this.table.rowManager.element.clientHeight + margin)){\r\n\t\t\t\t\t\tif(this.page < this.max){\r\n\t\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\t\tthis.nextPage();\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\t// left = this.table.rowManager.scrollLeft;\r\n\t\t\t\tthis.dispatchExternal(\"pageLoaded\", this.getPage());\r\n\t\t\t\t// this.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\t// this.table.columnManager.scrollHorizontal(left);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Remote Pagination Error - Server response missing '\" + (this.options(\"dataReceiveParams\").data || \"data\") + \"' property\");\r\n\t\t}\r\n\t\t\r\n\t\treturn data.data;\r\n\t}\r\n\t\r\n\t//handle the footer element being redrawn\r\n\tfooterRedraw(){\r\n\t\tvar footer = this.table.footerManager.containerElement;\r\n\r\n\t\tif((Math.ceil(footer.clientWidth) - footer.scrollWidth) < 0){\r\n\t\t\tthis.pagesElement.style.display = 'none';\r\n\t\t}else{\r\n\t\t\tthis.pagesElement.style.display = '';\r\n\t\t\t\r\n\t\t\tif((Math.ceil(footer.clientWidth) - footer.scrollWidth) < 0){\r\n\t\t\t\tthis.pagesElement.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nPage.moduleName = \"page\";\r\n\r\n//load defaults\r\nPage.pageCounters = defaultPageCounters;\r\n\r\nexport default Page;","// read peristence information from storage\r\nexport default {\r\n\tlocal:function(id, type){\r\n\t\tvar data = localStorage.getItem(id + \"-\" + type);\r\n\r\n\t\treturn data ? JSON.parse(data) : false;\r\n\t},\r\n\tcookie:function(id, type){\r\n\t\tvar cookie = document.cookie,\r\n\t\tkey = id + \"-\" + type,\r\n\t\tcookiePos = cookie.indexOf(key + \"=\"),\r\n\t\tend, data;\r\n\r\n\t\t//if cookie exists, decode and load column data into tabulator\r\n\t\tif(cookiePos > -1){\r\n\t\t\tcookie = cookie.slice(cookiePos);\r\n\r\n\t\t\tend = cookie.indexOf(\";\");\r\n\r\n\t\t\tif(end > -1){\r\n\t\t\t\tcookie = cookie.slice(0, end);\r\n\t\t\t}\r\n\r\n\t\t\tdata = cookie.replace(key + \"=\", \"\");\r\n\t\t}\r\n\r\n\t\treturn data ? JSON.parse(data) : false;\r\n\t}\r\n};\r\n","//write persistence information to storage\r\nexport default {\r\n\tlocal:function(id, type, data){\r\n\t\tlocalStorage.setItem(id + \"-\" + type, JSON.stringify(data));\r\n\t},\r\n\tcookie:function(id, type, data){\r\n\t\tvar expireDate = new Date();\r\n\r\n\t\texpireDate.setDate(expireDate.getDate() + 10000);\r\n\r\n\t\tdocument.cookie = id + \"-\" + type + \"=\" + JSON.stringify(data) + \"; expires=\" + expireDate.toUTCString();\r\n\t}\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultReaders from './defaults/readers.js';\r\nimport defaultWriters from './defaults/writers.js';\r\n\r\nclass Persistence extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.mode = \"\";\r\n\t\tthis.id = \"\";\r\n\t\t// this.persistProps = [\"field\", \"width\", \"visible\"];\r\n\t\tthis.defWatcherBlock = false;\r\n\t\tthis.config = {};\r\n\t\tthis.readFunc = false;\r\n\t\tthis.writeFunc = false;\r\n\r\n\t\tthis.registerTableOption(\"persistence\", false);\r\n\t\tthis.registerTableOption(\"persistenceID\", \"\"); //key for persistent storage\r\n\t\tthis.registerTableOption(\"persistenceMode\", true); //mode for storing persistence information\r\n\t\tthis.registerTableOption(\"persistenceReaderFunc\", false); //function for handling persistence data reading\r\n\t\tthis.registerTableOption(\"persistenceWriterFunc\", false); //function for handling persistence data writing\r\n\t}\r\n\r\n\t// Test for whether localStorage is available for use.\r\n\tlocalStorageTest() {\r\n\t\tvar testKey = \"_tabulator_test\";\r\n\r\n\t\ttry {\r\n\t\t\twindow.localStorage.setItem( testKey, testKey);\r\n\t\t\twindow.localStorage.removeItem( testKey );\r\n\t\t\treturn true;\r\n\t\t} catch(e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//setup parameters\r\n\tinitialize(){\r\n\t\tif(this.table.options.persistence){\r\n\t\t\t//determine persistent layout storage type\r\n\t\t\tvar mode = this.table.options.persistenceMode,\r\n\t\t\tid = this.table.options.persistenceID,\r\n\t\t\tretreivedData;\r\n\r\n\t\t\tthis.mode = mode !== true ? mode : (this.localStorageTest() ? \"local\" : \"cookie\");\r\n\r\n\t\t\tif(this.table.options.persistenceReaderFunc){\r\n\t\t\t\tif(typeof this.table.options.persistenceReaderFunc === \"function\"){\r\n\t\t\t\t\tthis.readFunc = this.table.options.persistenceReaderFunc;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(Persistence.readers[this.table.options.persistenceReaderFunc]){\r\n\t\t\t\t\t\tthis.readFunc = Persistence.readers[this.table.options.persistenceReaderFunc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Persistence Read Error - invalid reader set\", this.table.options.persistenceReaderFunc);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(Persistence.readers[this.mode]){\r\n\t\t\t\t\tthis.readFunc = Persistence.readers[this.mode];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Persistence Read Error - invalid reader set\", this.mode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.options.persistenceWriterFunc){\r\n\t\t\t\tif(typeof this.table.options.persistenceWriterFunc === \"function\"){\r\n\t\t\t\t\tthis.writeFunc = this.table.options.persistenceWriterFunc;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(Persistence.writers[this.table.options.persistenceWriterFunc]){\r\n\t\t\t\t\t\tthis.writeFunc = Persistence.writers[this.table.options.persistenceWriterFunc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Persistence Write Error - invalid reader set\", this.table.options.persistenceWriterFunc);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(Persistence.writers[this.mode]){\r\n\t\t\t\t\tthis.writeFunc = Persistence.writers[this.mode];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Persistence Write Error - invalid writer set\", this.mode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//set storage tag\r\n\t\t\tthis.id = \"tabulator-\" + (id || (this.table.element.getAttribute(\"id\") || \"\"));\r\n\r\n\t\t\tthis.config = {\r\n\t\t\t\tsort:this.table.options.persistence === true || this.table.options.persistence.sort,\r\n\t\t\t\tfilter:this.table.options.persistence === true || this.table.options.persistence.filter,\r\n\t\t\t\tgroup:this.table.options.persistence === true || this.table.options.persistence.group,\r\n\t\t\t\tpage:this.table.options.persistence === true || this.table.options.persistence.page,\r\n\t\t\t\tcolumns:this.table.options.persistence === true ? [\"title\", \"width\", \"visible\"] : this.table.options.persistence.columns,\r\n\t\t\t};\r\n\r\n\t\t\t//load pagination data if needed\r\n\t\t\tif(this.config.page){\r\n\t\t\t\tretreivedData = this.retreiveData(\"page\");\r\n\r\n\t\t\t\tif(retreivedData){\r\n\t\t\t\t\tif(typeof retreivedData.paginationSize !== \"undefined\" && (this.config.page === true || this.config.page.size)){\r\n\t\t\t\t\t\tthis.table.options.paginationSize = retreivedData.paginationSize;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(typeof retreivedData.paginationInitialPage !== \"undefined\" && (this.config.page === true || this.config.page.page)){\r\n\t\t\t\t\t\tthis.table.options.paginationInitialPage = retreivedData.paginationInitialPage;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//load group data if needed\r\n\t\t\tif(this.config.group){\r\n\t\t\t\tretreivedData = this.retreiveData(\"group\");\r\n\r\n\t\t\t\tif(retreivedData){\r\n\t\t\t\t\tif(typeof retreivedData.groupBy !== \"undefined\" && (this.config.group === true || this.config.group.groupBy)){\r\n\t\t\t\t\t\tthis.table.options.groupBy = retreivedData.groupBy;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(typeof retreivedData.groupStartOpen !== \"undefined\" && (this.config.group === true || this.config.group.groupStartOpen)){\r\n\t\t\t\t\t\tthis.table.options.groupStartOpen = retreivedData.groupStartOpen;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(typeof retreivedData.groupHeader !== \"undefined\" && (this.config.group === true || this.config.group.groupHeader)){\r\n\t\t\t\t\t\tthis.table.options.groupHeader = retreivedData.groupHeader;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.columns){\r\n\t\t\t\tthis.table.options.columns = this.load(\"columns\", this.table.options.columns);\r\n\t\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t\t\tthis.subscribe(\"column-show\", this.save.bind(this, \"columns\"));\r\n\t\t\t\tthis.subscribe(\"column-hide\", this.save.bind(this, \"columns\"));\r\n\t\t\t\tthis.subscribe(\"column-moved\", this.save.bind(this, \"columns\"));\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"table-built\", this.tableBuilt.bind(this), 0);\r\n\r\n\t\t\tthis.subscribe(\"table-redraw\", this.tableRedraw.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"filter-changed\", this.eventSave.bind(this, \"filter\"));\r\n\t\t\tthis.subscribe(\"sort-changed\", this.eventSave.bind(this, \"sort\"));\r\n\t\t\tthis.subscribe(\"group-changed\", this.eventSave.bind(this, \"group\"));\r\n\t\t\tthis.subscribe(\"page-changed\", this.eventSave.bind(this, \"page\"));\r\n\t\t\tthis.subscribe(\"column-resized\", this.eventSave.bind(this, \"columns\"));\r\n\t\t\tthis.subscribe(\"layout-refreshed\", this.eventSave.bind(this, \"columns\"));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"getColumnLayout\", this.getColumnLayout.bind(this));\r\n\t\tthis.registerTableFunction(\"setColumnLayout\", this.setColumnLayout.bind(this));\r\n\t}\r\n\r\n\teventSave(type){\r\n\t\tif(this.config[type]){\r\n\t\t\tthis.save(type);\r\n\t\t}\r\n\t}\r\n\r\n\ttableBuilt(){\r\n\t\tvar options = this.table.options,\r\n\t\tsorters, filters;\r\n\r\n\t\tif(this.config.sort){\r\n\t\t\tsorters = this.load(\"sort\");\r\n\r\n\t\t\tif(!sorters === false){\r\n\t\t\t\tthis.table.options.initialSort = sorters;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this.config.filter){\r\n\t\t\tfilters = this.load(\"filter\");\r\n\r\n\t\t\tif(!filters === false){\r\n\t\t\t\tthis.table.options.initialFilter = filters;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tif(force && this.config.columns){\r\n\t\t\tthis.save(\"columns\");\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tgetColumnLayout(){\r\n\t\treturn this.parseColumns(this.table.columnManager.getColumns());\r\n\t}\r\n\r\n\tsetColumnLayout(layout){\r\n\t\tthis.table.columnManager.setColumns(this.mergeDefinition(this.table.options.columns, layout))\r\n\t\treturn true;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tinitializeColumn(column){\r\n\t\tvar def, keys;\r\n\r\n\t\tif(this.config.columns){\r\n\t\t\tthis.defWatcherBlock = true;\r\n\r\n\t\t\tdef = column.getDefinition();\r\n\r\n\t\t\tkeys = this.config.columns === true ? Object.keys(def) : this.config.columns;\r\n\r\n\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\tvar props = Object.getOwnPropertyDescriptor(def, key);\r\n\t\t\t\tvar value = def[key];\r\n\t\t\t\tif(props){\r\n\t\t\t\t\tObject.defineProperty(def, key, {\r\n\t\t\t\t\t\tset: function(newValue){\r\n\t\t\t\t\t\t\tvalue = newValue;\r\n\r\n\t\t\t\t\t\t\tif(!this.defWatcherBlock){\r\n\t\t\t\t\t\t\t\tthis.save(\"columns\");\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif(props.set){\r\n\t\t\t\t\t\t\t\tprops.set(newValue);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tget:function(){\r\n\t\t\t\t\t\t\tif(props.get){\r\n\t\t\t\t\t\t\t\tprops.get();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.defWatcherBlock = false;\r\n\t\t}\r\n\t}\r\n\r\n\t//load saved definitions\r\n\tload(type, current){\r\n\t\tvar data = this.retreiveData(type);\r\n\r\n\t\tif(current){\r\n\t\t\tdata = data ? this.mergeDefinition(current, data) : current;\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//retreive data from memory\r\n\tretreiveData(type){\r\n\t\treturn this.readFunc ? this.readFunc(this.id, type) : false;\r\n\t}\r\n\r\n\t//merge old and new column definitions\r\n\tmergeDefinition(oldCols, newCols){\r\n\t\tvar output = [];\r\n\r\n\t\tnewCols = newCols || [];\r\n\r\n\t\tnewCols.forEach((column, to) => {\r\n\t\t\tvar from = this._findColumn(oldCols, column),\r\n\t\t\tkeys;\r\n\r\n\t\t\tif(from){\r\n\t\t\t\tif(this.config.columns === true || this.config.columns == undefined){\r\n\t\t\t\t\tkeys = Object.keys(from);\r\n\t\t\t\t\tkeys.push(\"width\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tkeys = this.config.columns;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\t\tif(key !== \"columns\" && typeof column[key] !== \"undefined\"){\r\n\t\t\t\t\t\tfrom[key] = column[key];\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(from.columns){\r\n\t\t\t\t\tfrom.columns = this.mergeDefinition(from.columns, column.columns);\r\n\t\t\t\t}\r\n\r\n\t\t\t\toutput.push(from);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\toldCols.forEach((column, i) => {\r\n\t\t\tvar from = this._findColumn(newCols, column);\r\n\r\n\t\t\tif (!from) {\r\n\t\t\t\tif(output.length>i){\r\n\t\t\t\t\toutput.splice(i, 0, column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\toutput.push(column);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//find matching columns\r\n\t_findColumn(columns, subject){\r\n\t\tvar type = subject.columns ? \"group\" : (subject.field ? \"field\" : \"object\");\r\n\r\n\t\treturn columns.find(function(col){\r\n\t\t\tswitch(type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\treturn col.title === subject.title && col.columns.length === subject.columns.length;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"field\":\r\n\t\t\t\treturn col.field === subject.field;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"object\":\r\n\t\t\t\treturn col === subject;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//save data\r\n\tsave(type){\r\n\t\tvar data = {};\r\n\r\n\t\tswitch(type){\r\n\t\t\tcase \"columns\":\r\n\t\t\tdata = this.parseColumns(this.table.columnManager.getColumns())\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"filter\":\r\n\t\t\tdata = this.table.modules.filter.getFilters();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"sort\":\r\n\t\t\tdata = this.validateSorters(this.table.modules.sort.getSort());\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\tdata = this.getGroupConfig();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"page\":\r\n\t\t\tdata = this.getPageConfig();\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(this.writeFunc){\r\n\t\t\tthis.writeFunc(this.id, type, data);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t//ensure sorters contain no function data\r\n\tvalidateSorters(data){\r\n\t\tdata.forEach(function(item){\r\n\t\t\titem.column = item.field;\r\n\t\t\tdelete item.field;\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tgetGroupConfig(){\r\n\t\tvar data = {};\r\n\r\n\t\tif(this.config.group){\r\n\t\t\tif(this.config.group === true || this.config.group.groupBy){\r\n\t\t\t\tdata.groupBy = this.table.options.groupBy;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.group === true || this.config.group.groupStartOpen){\r\n\t\t\t\tdata.groupStartOpen = this.table.options.groupStartOpen;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.group === true || this.config.group.groupHeader){\r\n\t\t\t\tdata.groupHeader = this.table.options.groupHeader;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tgetPageConfig(){\r\n\t\tvar data = {};\r\n\r\n\t\tif(this.config.page){\r\n\t\t\tif(this.config.page === true || this.config.page.size){\r\n\t\t\t\tdata.paginationSize = this.table.modules.page.getPageSize();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.page === true || this.config.page.page){\r\n\t\t\t\tdata.paginationInitialPage = this.table.modules.page.getPage();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\r\n\t//parse columns for data to store\r\n\tparseColumns(columns){\r\n\t\tvar definitions = [],\r\n\t\texcludedKeys = [\"headerContextMenu\", \"headerMenu\", \"contextMenu\", \"clickMenu\"];\r\n\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\tvar defStore = {},\r\n\t\t\tcolDef = column.getDefinition(),\r\n\t\t\tkeys;\r\n\r\n\t\t\tif(column.isGroup){\r\n\t\t\t\tdefStore.title = colDef.title;\r\n\t\t\t\tdefStore.columns = this.parseColumns(column.getColumns());\r\n\t\t\t}else{\r\n\t\t\t\tdefStore.field = column.getField();\r\n\r\n\t\t\t\tif(this.config.columns === true || this.config.columns == undefined){\r\n\t\t\t\t\tkeys = Object.keys(colDef);\r\n\t\t\t\t\tkeys.push(\"width\");\r\n\t\t\t\t\tkeys.push(\"visible\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tkeys = this.config.columns;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\t\tswitch(key){\r\n\t\t\t\t\t\tcase \"width\":\r\n\t\t\t\t\t\tdefStore.width = column.getWidth();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"visible\":\r\n\t\t\t\t\t\tdefStore.visible = column.visible;\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tif(typeof colDef[key] !== \"function\" && excludedKeys.indexOf(key) === -1){\r\n\t\t\t\t\t\t\tdefStore[key] = colDef[key];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tdefinitions.push(defStore);\r\n\t\t});\r\n\r\n\t\treturn definitions;\r\n\t}\r\n}\r\n\r\nPersistence.moduleName = \"persistence\";\r\n\r\nPersistence.moduleInitOrder = -10;\r\n\r\n//load defaults\r\nPersistence.readers = defaultReaders;\r\nPersistence.writers = defaultWriters;\r\n\r\nexport default Persistence;","import Module from '../../core/Module.js';\r\n\r\nclass Popup extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.columnSubscribers = {};\r\n\t\t\r\n\t\tthis.registerTableOption(\"rowContextPopup\", false);\r\n\t\tthis.registerTableOption(\"rowClickPopup\", false);\r\n\t\tthis.registerTableOption(\"groupContextPopup\", false);\r\n\t\tthis.registerTableOption(\"groupClickPopup\", false);\r\n\t\t\r\n\t\tthis.registerColumnOption(\"headerContextPopup\");\r\n\t\tthis.registerColumnOption(\"headerClickPopup\");\r\n\t\tthis.registerColumnOption(\"headerPopup\");\r\n\t\tthis.registerColumnOption(\"headerPopupIcon\");\r\n\t\tthis.registerColumnOption(\"contextPopup\");\r\n\t\tthis.registerColumnOption(\"clickPopup\");\r\n\t\t\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.initializeRowWatchers();\r\n\t\tthis.initializeGroupWatchers();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\t\r\n\tinitializeRowWatchers(){\r\n\t\tif(this.table.options.rowContextPopup){\r\n\t\t\tthis.subscribe(\"row-contextmenu\", this.loadPopupEvent.bind(this, this.table.options.rowContextPopup));\r\n\t\t\tthis.table.on(\"rowTapHold\", this.loadPopupEvent.bind(this, this.table.options.rowContextPopup));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.rowClickPopup){\r\n\t\t\tthis.subscribe(\"row-click\", this.loadPopupEvent.bind(this, this.table.options.rowClickPopup));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeGroupWatchers(){\r\n\t\tif(this.table.options.groupContextPopup){\r\n\t\t\tthis.subscribe(\"group-contextmenu\", this.loadPopupEvent.bind(this, this.table.options.groupContextPopup));\r\n\t\t\tthis.table.on(\"groupTapHold\", this.loadPopupEvent.bind(this, this.table.options.groupContextPopup));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.groupClickPopup){\r\n\t\t\tthis.subscribe(\"group-click\", this.loadPopupEvent.bind(this, this.table.options.groupClickPopup));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar options = [\"headerContextPopup\", \"headerClickPopup\"],\r\n\t\tdef = column.definition;\r\n\t\t\r\n\t\t//handle column events\r\n\t\tif(def.headerContextPopup && !this.columnSubscribers.headerContextPopup){\r\n\t\t\tthis.columnSubscribers.headerContextPopup = this.loadPopupTableColumnEvent.bind(this, \"headerContextPopup\");\r\n\t\t\tthis.subscribe(\"column-contextmenu\", this.columnSubscribers.headerContextPopup);\r\n\t\t\tthis.table.on(\"headerTapHold\", this.loadPopupTableColumnEvent.bind(this, \"headerContextPopup\"))\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerClickPopup && !this.columnSubscribers.headerClickPopup){\r\n\t\t\tthis.columnSubscribers.headerClickPopup = this.loadPopupTableColumnEvent.bind(this, \"headerClickPopup\");\r\n\t\t\tthis.subscribe(\"column-click\", this.columnSubscribers.headerClickPopup);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerPopup){\r\n\t\t\tthis.initializeColumnHeaderPopup(column);\r\n\t\t}\r\n\t\t\r\n\t\t//handle cell events\r\n\t\tif(def.contextPopup && !this.columnSubscribers.contextPopup){\r\n\t\t\tthis.columnSubscribers.contextPopup = this.loadPopupTableCellEvent.bind(this, \"contextPopup\");\r\n\t\t\tthis.subscribe(\"cell-contextmenu\", this.columnSubscribers.contextPopup);\r\n\t\t\tthis.table.on(\"cellTapHold\", this.loadPopupTableCellEvent.bind(this, \"contextPopup\"))\r\n\t\t}\r\n\t\t\r\n\t\tif(def.clickPopup && !this.columnSubscribers.clickPopup){\r\n\t\t\tthis.columnSubscribers.clickPopup = this.loadPopupTableCellEvent.bind(this, \"clickPopup\");\r\n\t\t\tthis.subscribe(\"cell-click\", this.columnSubscribers.clickPopup);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumnHeaderPopup(column){\r\n\t\tvar icon = column.definition.headerPopupIcon,\r\n\t\theaderPopupEl;\r\n\t\t\r\n\t\theaderPopupEl = document.createElement(\"span\");\r\n\t\theaderPopupEl.classList.add(\"tabulator-header-popup-button\");\r\n\r\n\t\tif(icon){\r\n\t\t\tif(typeof icon === \"function\"){\r\n\t\t\t\ticon = icon(column.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tif(icon instanceof HTMLElement){\r\n\t\t\t\theaderPopupEl.appendChild(icon);\r\n\t\t\t}else{\r\n\t\t\t\theaderPopupEl.innerHTML = icon;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\theaderPopupEl.innerHTML = \"⋮\";\r\n\t\t}\r\n\t\t\r\n\t\theaderPopupEl.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tthis.loadPopupEvent(column.definition.headerPopup, e, column);\r\n\t\t});\r\n\t\t\r\n\t\tcolumn.titleElement.insertBefore(headerPopupEl, column.titleElement.firstChild);\r\n\t}\r\n\t\r\n\tloadPopupTableCellEvent(option, e, cell){\r\n\t\tif(cell._cell){\r\n\t\t\tcell = cell._cell;\r\n\t\t}\r\n\t\t\r\n\t\tif(cell.column.definition[option]){\r\n\t\t\tthis.loadPopupEvent(cell.column.definition[option], e, cell);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadPopupTableColumnEvent(option, e, column){\r\n\t\tif(column._column){\r\n\t\t\tcolumn = column._column;\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition[option]){\r\n\t\t\tthis.loadPopupEvent(column.definition[option], e, column);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadPopupEvent(contents, e, component){\r\n\t\tvar renderedCallback;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\trenderedCallback = callback;\r\n\t\t}\r\n\t\t\r\n\t\tif(component._group){\r\n\t\t\tcomponent = component._group;\r\n\t\t}else if(component._row){\r\n\t\t\tcomponent = component._row;\r\n\t\t}\r\n\t\t\r\n\t\tcontents = typeof contents == \"function\" ? contents.call(this.table, e, component.getComponent(), onRendered) : contents;\r\n\t\t\r\n\t\tthis.loadPopup(e, component, contents, renderedCallback);\r\n\t}\r\n\t\r\n\tloadPopup(e, component, contents, renderedCallback){\r\n\t\tvar touch = !(e instanceof MouseEvent),\r\n\t\tcontentsEl, popup;\r\n\t\t\r\n\t\tif(contents instanceof HTMLElement){\r\n\t\t\tcontentsEl = contents;\r\n\t\t}else{\r\n\t\t\tcontentsEl = document.createElement(\"div\");\r\n\t\t\tcontentsEl.innerHTML = contents;\r\n\t\t}\r\n\t\t\r\n\t\tcontentsEl.classList.add(\"tabulator-popup\");\r\n\r\n\t\tcontentsEl.addEventListener(\"click\", (e) =>{\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tif(!touch){\r\n\t\t\te.preventDefault();\r\n\t\t}\r\n\t\t\r\n\t\tpopup = this.popup(contentsEl);\r\n\r\n\t\tif(typeof renderedCallback === \"function\"){\r\n\t\t\tpopup.renderCallback(renderedCallback);\r\n\t\t}\r\n\t\t\r\n\t\tpopup.show(e).hideOnBlur(() => {\r\n\t\t\tthis.dispatchExternal(\"popupClosed\", component.getComponent());\r\n\t\t});\r\n\r\n\r\n\r\n\t\tthis.dispatchExternal(\"popupOpened\", component.getComponent())\r\n\t}\r\n}\r\n\r\nPopup.moduleName = \"popup\";\r\n\r\nexport default Popup;\r\n","import Module from '../../core/Module.js';\r\n\r\nclass Print extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.element = false;\r\n\t\tthis.manualBlock = false;\r\n\r\n\t\tthis.registerTableOption(\"printAsHtml\", false); //enable print as html\r\n\t\tthis.registerTableOption(\"printFormatter\", false); //printing page formatter\r\n\t\tthis.registerTableOption(\"printHeader\", false); //page header contents\r\n\t\tthis.registerTableOption(\"printFooter\", false); //page footer contents\r\n\t\tthis.registerTableOption(\"printStyled\", true); //enable print as html styling\r\n\t\tthis.registerTableOption(\"printRowRange\", \"visible\"); //restrict print to visible rows only\r\n\t\tthis.registerTableOption(\"printConfig\", {}); //print config options\r\n\r\n\t\tthis.registerColumnOption(\"print\");\r\n\t\tthis.registerColumnOption(\"titlePrint\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.printAsHtml){\r\n\t\t\twindow.addEventListener(\"beforeprint\", this.replaceTable.bind(this));\r\n\t\t\twindow.addEventListener(\"afterprint\", this.cleanup.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"print\", this.printFullscreen.bind(this));\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\treplaceTable(){\r\n\t\tif(!this.manualBlock){\r\n\t\t\tthis.element = document.createElement(\"div\");\r\n\t\t\tthis.element.classList.add(\"tabulator-print-table\");\r\n\r\n\t\t\tthis.element.appendChild(this.table.modules.export.genereateTable(this.table.options.printConfig, this.table.options.printStyled, this.table.options.printRowRange, \"print\"));\r\n\r\n\t\t\tthis.table.element.style.display = \"none\";\r\n\r\n\t\t\tthis.table.element.parentNode.insertBefore(this.element, this.table.element);\r\n\t\t}\r\n\t}\r\n\r\n\tcleanup(){\r\n\t\tdocument.body.classList.remove(\"tabulator-print-fullscreen-hide\");\r\n\r\n\t\tif(this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\tthis.table.element.style.display = \"\";\r\n\t\t}\r\n\t}\r\n\r\n\tprintFullscreen(visible, style, config){\r\n\t\tvar scrollX = window.scrollX,\r\n\t\tscrollY = window.scrollY,\r\n\t\theaderEl = document.createElement(\"div\"),\r\n\t\tfooterEl = document.createElement(\"div\"),\r\n\t\ttableEl = this.table.modules.export.genereateTable(typeof config != \"undefined\" ? config : this.table.options.printConfig, typeof style != \"undefined\" ? style : this.table.options.printStyled, visible || this.table.options.printRowRange, \"print\"),\r\n\t\theaderContent, footerContent;\r\n\r\n\t\tthis.manualBlock = true;\r\n\r\n\t\tthis.element = document.createElement(\"div\");\r\n\t\tthis.element.classList.add(\"tabulator-print-fullscreen\");\r\n\r\n\t\tif(this.table.options.printHeader){\r\n\t\t\theaderEl.classList.add(\"tabulator-print-header\");\r\n\r\n\t\t\theaderContent = typeof this.table.options.printHeader == \"function\" ? this.table.options.printHeader.call(this.table) : this.table.options.printHeader;\r\n\r\n\t\t\tif(typeof headerContent == \"string\"){\r\n\t\t\t\theaderEl.innerHTML = headerContent;\r\n\t\t\t}else{\r\n\t\t\t\theaderEl.appendChild(headerContent);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element.appendChild(headerEl);\r\n\t\t}\r\n\r\n\t\tthis.element.appendChild(tableEl);\r\n\r\n\t\tif(this.table.options.printFooter){\r\n\t\t\tfooterEl.classList.add(\"tabulator-print-footer\");\r\n\r\n\t\t\tfooterContent = typeof this.table.options.printFooter == \"function\" ? this.table.options.printFooter.call(this.table) : this.table.options.printFooter;\r\n\r\n\r\n\t\t\tif(typeof footerContent == \"string\"){\r\n\t\t\t\tfooterEl.innerHTML = footerContent;\r\n\t\t\t}else{\r\n\t\t\t\tfooterEl.appendChild(footerContent);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element.appendChild(footerEl);\r\n\t\t}\r\n\r\n\t\tdocument.body.classList.add(\"tabulator-print-fullscreen-hide\");\r\n\t\tdocument.body.appendChild(this.element);\r\n\r\n\t\tif(this.table.options.printFormatter){\r\n\t\t\tthis.table.options.printFormatter(this.element, tableEl);\r\n\t\t}\r\n\r\n\t\twindow.print();\r\n\r\n\t\tthis.cleanup();\r\n\r\n\t\twindow.scrollTo(scrollX, scrollY);\r\n\r\n\t\tthis.manualBlock = false;\r\n\t}\r\n}\r\n\r\nPrint.moduleName = \"print\";\r\n\r\nexport default Print;","import Module from '../../core/Module.js';\r\n\r\nclass ReactiveData extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.data = false;\r\n\t\tthis.blocked = false; //block reactivity while performing update\r\n\t\tthis.origFuncs = {}; // hold original data array functions to allow replacement after data is done with\r\n\t\tthis.currentVersion = 0;\r\n\r\n\t\tthis.registerTableOption(\"reactiveData\", false); //enable data reactivity\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.reactiveData){\r\n\t\t\tthis.subscribe(\"cell-value-save-before\", this.block.bind(this));\r\n\t\t\tthis.subscribe(\"cell-value-save-after\", this.unblock.bind(this));\r\n\t\t\tthis.subscribe(\"row-data-save-before\", this.block.bind(this));\r\n\t\t\tthis.subscribe(\"row-data-save-after\", this.unblock.bind(this));\r\n\t\t\tthis.subscribe(\"row-data-init-after\", this.watchRow.bind(this));\r\n\t\t\tthis.subscribe(\"data-processing\", this.watchData.bind(this));\r\n\t\t\tthis.subscribe(\"table-destroy\", this.unwatchData.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\twatchData(data){\r\n\t\tvar self = this,\r\n\t\tpushFunc, version;\r\n\r\n\t\tthis.currentVersion ++;\r\n\r\n\t\tversion = this.currentVersion;\r\n\r\n\t\tthis.unwatchData();\r\n\r\n\t\tthis.data = data;\r\n\r\n\t\t//override array push function\r\n\t\tthis.origFuncs.push = data.push;\r\n\r\n\t\tObject.defineProperty(this.data, \"push\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments);\r\n\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\targs.forEach((arg) => {\r\n\t\t\t\t\t\tself.table.rowManager.addRowActual(arg, false);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.origFuncs.push.apply(data, arguments);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t//override array unshift function\r\n\t\tthis.origFuncs.unshift = data.unshift;\r\n\r\n\t\tObject.defineProperty(this.data, \"unshift\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments);\r\n\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\targs.forEach((arg) => {\r\n\t\t\t\t\t\tself.table.rowManager.addRowActual(arg, true);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.origFuncs.unshift.apply(data, arguments);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\t//override array shift function\r\n\t\tthis.origFuncs.shift = data.shift;\r\n\r\n\t\tObject.defineProperty(this.data, \"shift\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar row;\r\n\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tif(self.data.length){\r\n\t\t\t\t\t\trow = self.table.rowManager.getRowFromDataObject(self.data[0]);\r\n\r\n\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\trow.deleteActual();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.origFuncs.shift.call(data);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t//override array pop function\r\n\t\tthis.origFuncs.pop = data.pop;\r\n\r\n\t\tObject.defineProperty(this.data, \"pop\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar row;\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tif(self.data.length){\r\n\t\t\t\t\t\trow = self.table.rowManager.getRowFromDataObject(self.data[self.data.length - 1]);\r\n\r\n\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\trow.deleteActual();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn self.origFuncs.pop.call(data);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\t//override array splice function\r\n\t\tthis.origFuncs.splice = data.splice;\r\n\r\n\t\tObject.defineProperty(this.data, \"splice\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments),\r\n\t\t\t\tstart = args[0] < 0 ? data.length + args[0] : args[0],\r\n\t\t\t\tend = args[1],\r\n\t\t\t\tnewRows = args[2] ? args.slice(2) : false,\r\n\t\t\t\tstartRow;\r\n\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\r\n\t\t\t\t\t//add new rows\r\n\t\t\t\t\tif(newRows){\r\n\t\t\t\t\t\tstartRow = data[start] ? self.table.rowManager.getRowFromDataObject(data[start]) : false;\r\n\r\n\t\t\t\t\t\tif(startRow){\r\n\t\t\t\t\t\t\tnewRows.forEach((rowData) => {\r\n\t\t\t\t\t\t\t\tself.table.rowManager.addRowActual(rowData, true, startRow, true);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnewRows = newRows.slice().reverse();\r\n\r\n\t\t\t\t\t\t\tnewRows.forEach((rowData) => {\r\n\t\t\t\t\t\t\t\tself.table.rowManager.addRowActual(rowData, true, false, true);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//delete removed rows\r\n\t\t\t\t\tif(end !== 0){\r\n\t\t\t\t\t\tvar oldRows = data.slice(start, typeof args[1] === \"undefined\" ? args[1] : start + end);\r\n\r\n\t\t\t\t\t\toldRows.forEach((rowData, i) => {\r\n\t\t\t\t\t\t\tvar row = self.table.rowManager.getRowFromDataObject(rowData);\r\n\r\n\t\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\t\trow.deleteActual(i !== oldRows.length - 1);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(newRows || end !== 0){\r\n\t\t\t\t\t\tself.table.rowManager.reRenderInPosition();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.origFuncs.splice.apply(data, arguments);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tunwatchData(){\r\n\t\tif(this.data !== false){\r\n\t\t\tfor(var key in this.origFuncs){\r\n\t\t\t\tObject.defineProperty(this.data, key, {\r\n\t\t\t\t\tenumerable: true,\r\n\t\t\t\t\tconfigurable:true,\r\n\t\t\t\t\twritable:true,\r\n\t\t\t\t\tvalue: this.origFuncs.key,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\twatchRow(row){\r\n\t\tvar data = row.getData();\r\n\r\n\t\tthis.blocked = true;\r\n\r\n\t\tfor(var key in data){\r\n\t\t\tthis.watchKey(row, data, key);\r\n\t\t}\r\n\r\n\t\tif(this.table.options.dataTree){\r\n\t\t\tthis.watchTreeChildren(row);\r\n\t\t}\r\n\r\n\t\tthis.blocked = false;\r\n\t}\r\n\r\n\twatchTreeChildren (row){\r\n\t\tvar childField = row.getData()[this.table.options.dataTreeChildField],\r\n\t\torigFuncs = {};\r\n\r\n\t\tfunction rebuildTree(){\r\n\t\t\tthis.table.modules.dataTree.initializeRow(row);\r\n\t\t\tthis.table.modules.dataTree.layoutRow(row);\r\n\t\t\tthis.table.rowManager.refreshActiveData(\"tree\", false, true);\r\n\t\t}\r\n\r\n\t\tif(childField){\r\n\r\n\t\t\torigFuncs.push = childField.push;\r\n\r\n\t\t\tObject.defineProperty(childField, \"push\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tvar result = origFuncs.push.apply(childField, arguments);\r\n\r\n\t\t\t\t\trebuildTree();\r\n\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\torigFuncs.unshift = childField.unshift;\r\n\r\n\t\t\tObject.defineProperty(childField, \"unshift\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tvar result = origFuncs.unshift.apply(childField, arguments);\r\n\r\n\t\t\t\t\trebuildTree();\r\n\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\torigFuncs.shift = childField.shift;\r\n\r\n\t\t\tObject.defineProperty(childField, \"shift\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tvar result = origFuncs.shift.call(childField);\r\n\r\n\t\t\t\t\trebuildTree();\r\n\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\torigFuncs.pop = childField.pop;\r\n\r\n\t\t\tObject.defineProperty(childField, \"pop\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tvar result = origFuncs.pop.call(childField);\r\n\r\n\t\t\t\t\trebuildTree();\r\n\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\torigFuncs.splice = childField.splice;\r\n\r\n\t\t\tObject.defineProperty(childField, \"splice\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tvar result = origFuncs.splice.apply(childField, arguments);\r\n\r\n\t\t\t\t\trebuildTree();\r\n\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\twatchKey(row, data, key){\r\n\t\tvar props = Object.getOwnPropertyDescriptor(data, key),\r\n\t\tvalue = data[key],\r\n\t\tversion = this.currentVersion;\r\n\r\n\t\tObject.defineProperty(data, key, {\r\n\t\t\tset: (newValue) => {\r\n\t\t\t\tvalue = newValue;\r\n\t\t\t\tif(!this.blocked && version === this.currentVersion){\r\n\t\t\t\t\tvar update = {};\r\n\t\t\t\t\tupdate[key] = newValue;\r\n\t\t\t\t\trow.updateData(update);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(props.set){\r\n\t\t\t\t\tprops.set(newValue);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tget:() => {\r\n\r\n\t\t\t\tif(props.get){\r\n\t\t\t\t\tprops.get();\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn value;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tunwatchRow(row){\r\n\t\tvar data = row.getData();\r\n\r\n\t\tfor(var key in data){\r\n\t\t\tObject.defineProperty(data, key, {\r\n\t\t\t\tvalue:data[key],\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tblock(){\r\n\t\tthis.blocked = true;\r\n\t}\r\n\r\n\tunblock(){\r\n\t\tthis.blocked = false;\r\n\t}\r\n}\r\n\r\nReactiveData.moduleName = \"reactiveData\";\r\n\r\nexport default ReactiveData;\r\n\r\n\r\n\r\n","import Module from '../../core/Module.js';\r\n\r\nclass ResizeColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.startColumn = false;\r\n\t\tthis.startX = false;\r\n\t\tthis.startWidth = false;\r\n\t\tthis.latestX = false;\r\n\t\tthis.handle = null;\r\n\t\tthis.initialNextColumn = null;\r\n\t\tthis.nextColumn = null;\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.registerColumnOption(\"resizable\", true);\r\n\t\tthis.registerTableOption(\"resizableColumnFit\", false);\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-rendered\", this.layoutColumnHeader.bind(this));\r\n\t}\r\n\t\r\n\tinitializeEventWatchers(){\r\n\t\tif(!this.initialized){\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-rendered\", this.layoutCellHandles.bind(this));\r\n\t\t\tthis.subscribe(\"cell-delete\", this.deInitializeComponent.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-height\", this.resizeHandle.bind(this));\r\n\t\t\tthis.subscribe(\"column-moved\", this.columnLayoutUpdated.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-hide\", this.deInitializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"column-show\", this.columnLayoutUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"column-width\", this.columnWidthUpdated.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-delete\", this.deInitializeComponent.bind(this));\r\n\t\t\tthis.subscribe(\"column-height\", this.resizeHandle.bind(this));\r\n\t\t\t\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\tlayoutCellHandles(cell){\r\n\t\tif(cell.row.type === \"row\"){\r\n\t\t\tthis.deInitializeComponent(cell);\r\n\t\t\tthis.initializeColumn(\"cell\", cell, cell.column, cell.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tlayoutColumnHeader(column){\r\n\t\tif(column.definition.resizable){\r\n\t\t\tthis.initializeEventWatchers();\r\n\t\t\tthis.deInitializeComponent(column);\r\n\t\t\tthis.initializeColumn(\"header\", column, column, column.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolumnLayoutUpdated(column){\r\n\t\tvar prev = column.prevColumn();\r\n\t\t\r\n\t\tthis.reinitializeColumn(column);\r\n\t\t\r\n\t\tif(prev){\r\n\t\t\tthis.reinitializeColumn(prev);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolumnWidthUpdated(column){\r\n\t\tif(column.modules.frozen){\r\n\t\t\tif(this.table.modules.frozenColumns.leftColumns.includes(column)){\r\n\t\t\t\tthis.table.modules.frozenColumns.leftColumns.forEach((col) => {\r\n\t\t\t\t\tthis.reinitializeColumn(col);\r\n\t\t\t\t});\r\n\t\t\t}else if(this.table.modules.frozenColumns.rightColumns.includes(column)){\r\n\t\t\t\tthis.table.modules.frozenColumns.rightColumns.forEach((col) => {\r\n\t\t\t\t\tthis.reinitializeColumn(col);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeColumn(column){\r\n\t\tvar frozenOffset = column.modules.frozen ? (column.modules.frozen.marginValue + column.getWidth() + \"px\") : false;\r\n\t\t;\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tif(cell.modules.resize && cell.modules.resize.handleEl){\r\n\t\t\t\tif(frozenOffset){\r\n\t\t\t\t\tcell.modules.resize.handleEl.style.left = frozenOffset;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcell.element.after(cell.modules.resize.handleEl);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(column.modules.resize && column.modules.resize.handleEl){\r\n\t\t\tif(frozenOffset){\r\n\t\t\t\tcolumn.modules.resize.handleEl.style.left = frozenOffset;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.element.after(column.modules.resize.handleEl);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(type, component, column, element){\r\n\t\tvar self = this,\r\n\t\tvariableHeight = false,\r\n\t\tmode = column.definition.resizable,\r\n\t\tconfig = {},\r\n\t\tnearestColumn = column.getLastColumn();\r\n\t\t\r\n\t\t//set column resize mode\r\n\t\tif(type === \"header\"){\r\n\t\t\tvariableHeight = column.definition.formatter == \"textarea\" || column.definition.variableHeight;\r\n\t\t\tconfig = {variableHeight:variableHeight};\r\n\t\t}\r\n\t\t\r\n\t\tif((mode === true || mode == type) && this._checkResizability(nearestColumn)){\r\n\t\t\t\r\n\t\t\tvar handle = document.createElement('span');\r\n\t\t\thandle.className = \"tabulator-col-resize-handle\";\r\n\t\t\t\r\n\t\t\thandle.addEventListener(\"click\", function(e){\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tvar handleDown = function(e){\r\n\t\t\t\tself.startColumn = column;\r\n\t\t\t\tself.initialNextColumn = self.nextColumn = nearestColumn.nextColumn();\r\n\t\t\t\tself._mouseDown(e, nearestColumn, handle);\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\thandle.addEventListener(\"mousedown\", handleDown);\r\n\t\t\thandle.addEventListener(\"touchstart\", handleDown, {passive: true});\r\n\t\t\t\r\n\t\t\t//resize column on double click\r\n\t\t\thandle.addEventListener(\"dblclick\", (e) => {\r\n\t\t\t\tvar oldWidth = nearestColumn.getWidth();\r\n\t\t\t\t\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tnearestColumn.reinitializeWidth(true);\r\n\t\t\t\t\r\n\t\t\t\tif(oldWidth !== nearestColumn.getWidth()){\r\n\t\t\t\t\tself.dispatch(\"column-resized\", nearestColumn);\r\n\t\t\t\t\tself.table.externalEvents.dispatch(\"columnResized\", nearestColumn.getComponent());\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(column.modules.frozen){\r\n\t\t\t\thandle.style.position = \"absolute\";\r\n\t\t\t\thandle.style.left = column.modules.frozen.marginValue + column.getWidth() + \"px\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconfig.handleEl = handle;\r\n\t\t\t\r\n\t\t\tif(element.parentNode){\r\n\t\t\t\telement.after(handle);\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcomponent.modules.resize = config;\r\n\t}\r\n\t\r\n\tdeInitializeColumn(column){\r\n\t\tthis.deInitializeComponent(column);\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tthis.deInitializeComponent(cell);\r\n\t\t});\r\n\t}\r\n\t\r\n\tdeInitializeComponent(component){\r\n\t\tvar handleEl;\r\n\t\t\r\n\t\tif(component.modules.resize){\r\n\t\t\thandleEl = component.modules.resize.handleEl;\r\n\t\t\t\r\n\t\t\tif(handleEl && handleEl.parentElement){\r\n\t\t\t\thandleEl.parentElement.removeChild(handleEl);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tresizeHandle(component, height){\r\n\t\tif(component.modules.resize && component.modules.resize.handleEl){\r\n\t\t\tcomponent.modules.resize.handleEl.style.height = height;\r\n\t\t}\r\n\t}\r\n\t\r\n\t_checkResizability(column){\r\n\t\treturn column.definition.resizable;\r\n\t}\r\n\t\r\n\t_mouseDown(e, column, handle){\r\n\t\tvar self = this;\r\n\t\t\r\n\t\tself.table.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\tfunction mouseMove(e){\r\n\t\t\tvar x = typeof e.screenX === \"undefined\" ? e.touches[0].screenX : e.screenX,\r\n\t\t\tstartDiff = x - self.startX,\r\n\t\t\tmoveDiff = x - self.latestX,\r\n\t\t\tblockedBefore, blockedAfter;\r\n\t\t\t\r\n\t\t\tself.latestX = x;\r\n\t\t\t\r\n\t\t\tif(self.table.rtl){\r\n\t\t\t\tstartDiff = -startDiff;\r\n\t\t\t\tmoveDiff = -moveDiff;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tblockedBefore = column.width == column.minWidth || column.width == column.maxWidth;\r\n\t\t\t\r\n\t\t\tcolumn.setWidth(self.startWidth + startDiff);\r\n\t\t\t\r\n\t\t\tblockedAfter = column.width == column.minWidth || column.width == column.maxWidth;\r\n\t\t\t\r\n\t\t\tif(moveDiff < 0){\r\n\t\t\t\tself.nextColumn = self.initialNextColumn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(self.table.options.resizableColumnFit && self.nextColumn && !(blockedBefore && blockedAfter)){\r\n\t\t\t\tlet colWidth = self.nextColumn.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tif(moveDiff > 0){\r\n\t\t\t\t\tif(colWidth <= self.nextColumn.minWidth){\r\n\t\t\t\t\t\tself.nextColumn = self.nextColumn.nextColumn();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(self.nextColumn){\r\n\t\t\t\t\tself.nextColumn.setWidth(self.nextColumn.getWidth() - moveDiff);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tself.table.columnManager.renderer.rerenderColumns(true);\r\n\t\t\t\r\n\t\t\tif(!self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight){\r\n\t\t\t\tcolumn.checkCellHeights();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfunction mouseUp(e){\r\n\t\t\t\r\n\t\t\t//block editor from taking action while resizing is taking place\r\n\t\t\tif(self.startColumn.modules.edit){\r\n\t\t\t\tself.startColumn.modules.edit.blocked = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight){\r\n\t\t\t\tcolumn.checkCellHeights();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", mouseUp);\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", mouseMove);\r\n\t\t\t\r\n\t\t\thandle.removeEventListener(\"touchmove\", mouseMove);\r\n\t\t\thandle.removeEventListener(\"touchend\", mouseUp);\r\n\t\t\t\r\n\t\t\tself.table.element.classList.remove(\"tabulator-block-select\");\r\n\t\t\t\r\n\t\t\tif(self.startWidth !== column.getWidth()){\r\n\t\t\t\tself.dispatch(\"column-resized\", column);\r\n\t\t\t\tself.table.externalEvents.dispatch(\"columnResized\", column.getComponent());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\te.stopPropagation(); //prevent resize from interfereing with movable columns\r\n\t\t\r\n\t\t//block editor from taking action while resizing is taking place\r\n\t\tif(self.startColumn.modules.edit){\r\n\t\t\tself.startColumn.modules.edit.blocked = true;\r\n\t\t}\r\n\t\t\r\n\t\tself.startX = typeof e.screenX === \"undefined\" ? e.touches[0].screenX : e.screenX;\r\n\t\tself.latestX = self.startX;\r\n\t\tself.startWidth = column.getWidth();\r\n\t\t\r\n\t\tdocument.body.addEventListener(\"mousemove\", mouseMove);\r\n\t\tdocument.body.addEventListener(\"mouseup\", mouseUp);\r\n\t\thandle.addEventListener(\"touchmove\", mouseMove, {passive: true});\r\n\t\thandle.addEventListener(\"touchend\", mouseUp);\r\n\t}\r\n}\r\n\r\nResizeColumns.moduleName = \"resizeColumns\";\r\n\r\nexport default ResizeColumns;","import Module from '../../core/Module.js';\r\n\r\nclass ResizeRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.startColumn = false;\r\n\t\tthis.startY = false;\r\n\t\tthis.startHeight = false;\r\n\t\tthis.handle = null;\r\n\t\tthis.prevHandle = null;\r\n\r\n\t\tthis.registerTableOption(\"resizableRows\", false); //resizable rows\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.resizableRows){\r\n\t\t\tthis.subscribe(\"row-layout-after\", this.initializeRow.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\trowEl = row.getElement();\r\n\r\n\t\tvar handle = document.createElement('div');\r\n\t\thandle.className = \"tabulator-row-resize-handle\";\r\n\r\n\t\tvar prevHandle = document.createElement('div');\r\n\t\tprevHandle.className = \"tabulator-row-resize-handle prev\";\r\n\r\n\t\thandle.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tvar handleDown = function(e){\r\n\t\t\tself.startRow = row;\r\n\t\t\tself._mouseDown(e, row, handle);\r\n\t\t};\r\n\r\n\t\thandle.addEventListener(\"mousedown\", handleDown);\r\n\t\thandle.addEventListener(\"touchstart\", handleDown, {passive: true});\r\n\r\n\t\tprevHandle.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tvar prevHandleDown = function(e){\r\n\t\t\tvar prevRow = self.table.rowManager.prevDisplayRow(row);\r\n\r\n\t\t\tif(prevRow){\r\n\t\t\t\tself.startRow = prevRow;\r\n\t\t\t\tself._mouseDown(e, prevRow, prevHandle);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tprevHandle.addEventListener(\"mousedown\",prevHandleDown);\r\n\t\tprevHandle.addEventListener(\"touchstart\",prevHandleDown, {passive: true});\r\n\r\n\t\trowEl.appendChild(handle);\r\n\t\trowEl.appendChild(prevHandle);\r\n\t}\r\n\r\n\t_mouseDown(e, row, handle){\r\n\t\tvar self = this;\r\n\r\n\t\tself.table.element.classList.add(\"tabulator-block-select\");\r\n\r\n\t\tfunction mouseMove(e){\r\n\t\t\trow.setHeight(self.startHeight + ((typeof e.screenY === \"undefined\" ? e.touches[0].screenY : e.screenY) - self.startY));\r\n\t\t}\r\n\r\n\t\tfunction mouseUp(e){\r\n\r\n\t\t\t// //block editor from taking action while resizing is taking place\r\n\t\t\t// if(self.startColumn.modules.edit){\r\n\t\t\t// \tself.startColumn.modules.edit.blocked = false;\r\n\t\t\t// }\r\n\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", mouseMove);\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", mouseMove);\r\n\r\n\t\t\thandle.removeEventListener(\"touchmove\", mouseMove);\r\n\t\t\thandle.removeEventListener(\"touchend\", mouseUp);\r\n\r\n\t\t\tself.table.element.classList.remove(\"tabulator-block-select\");\r\n\r\n\t\t\tself.dispatchExternal(\"rowResized\", row.getComponent());\r\n\t\t}\r\n\r\n\t\te.stopPropagation(); //prevent resize from interfereing with movable columns\r\n\r\n\t\t//block editor from taking action while resizing is taking place\r\n\t\t// if(self.startColumn.modules.edit){\r\n\t\t// \tself.startColumn.modules.edit.blocked = true;\r\n\t\t// }\r\n\r\n\t\tself.startY = typeof e.screenY === \"undefined\" ? e.touches[0].screenY : e.screenY;\r\n\t\tself.startHeight = row.getHeight();\r\n\r\n\t\tdocument.body.addEventListener(\"mousemove\", mouseMove);\r\n\t\tdocument.body.addEventListener(\"mouseup\", mouseUp);\r\n\r\n\t\thandle.addEventListener(\"touchmove\", mouseMove, {passive: true});\r\n\t\thandle.addEventListener(\"touchend\", mouseUp);\r\n\t}\r\n}\r\n\r\nResizeRows.moduleName = \"resizeRows\";\r\n\r\nexport default ResizeRows;","import Module from '../../core/Module.js';\r\n\r\nclass ResizeTable extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.binding = false;\r\n\t\tthis.observer = false;\r\n\t\tthis.containerObserver = false;\r\n\r\n\t\tthis.tableHeight = 0;\r\n\t\tthis.tableWidth = 0;\r\n\t\tthis.containerHeight = 0;\r\n\t\tthis.containerWidth = 0;\r\n\r\n\t\tthis.autoResize = false;\r\n\r\n\t\tthis.registerTableOption(\"autoResize\", true); //auto resize table\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.autoResize){\r\n\t\t\tvar table = this.table,\r\n\t\t\ttableStyle;\r\n\r\n\t\t\tthis.tableHeight = table.element.clientHeight;\r\n\t\t\tthis.tableWidth = table.element.clientWidth;\r\n\r\n\t\t\tif(table.element.parentNode){\r\n\t\t\t\tthis.containerHeight = table.element.parentNode.clientHeight;\r\n\t\t\t\tthis.containerWidth = table.element.parentNode.clientWidth;\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof ResizeObserver !== \"undefined\" && table.rowManager.getRenderMode() === \"virtual\"){\r\n\r\n\t\t\t\tthis.autoResize = true;\r\n\r\n\t\t\t\tthis.observer = new ResizeObserver((entry) => {\r\n\t\t\t\t\tif(!table.browserMobile || (table.browserMobile &&!table.modules.edit.currentCell)){\r\n\r\n\t\t\t\t\t\tvar nodeHeight = Math.floor(entry[0].contentRect.height);\r\n\t\t\t\t\t\tvar nodeWidth = Math.floor(entry[0].contentRect.width);\r\n\r\n\t\t\t\t\t\tif(this.tableHeight != nodeHeight || this.tableWidth != nodeWidth){\r\n\t\t\t\t\t\t\tthis.tableHeight = nodeHeight;\r\n\t\t\t\t\t\t\tthis.tableWidth = nodeWidth;\r\n\r\n\t\t\t\t\t\t\tif(table.element.parentNode){\r\n\t\t\t\t\t\t\t\tthis.containerHeight = table.element.parentNode.clientHeight;\r\n\t\t\t\t\t\t\t\tthis.containerWidth = table.element.parentNode.clientWidth;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tthis.table.columnManager.renderer.rerenderColumns(true);\r\n\r\n\t\t\t\t\t\t\ttable.redraw();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.observer.observe(table.element);\r\n\r\n\t\t\t\ttableStyle = window.getComputedStyle(table.element);\r\n\r\n\t\t\t\tif(this.table.element.parentNode && !this.table.rowManager.fixedHeight && (tableStyle.getPropertyValue(\"max-height\") || tableStyle.getPropertyValue(\"min-height\"))){\r\n\r\n\t\t\t\t\tthis.containerObserver = new ResizeObserver((entry) => {\r\n\t\t\t\t\t\tif(!table.browserMobile || (table.browserMobile &&!table.modules.edit.currentCell)){\r\n\r\n\t\t\t\t\t\t\tvar nodeHeight = Math.floor(entry[0].contentRect.height);\r\n\t\t\t\t\t\t\tvar nodeWidth = Math.floor(entry[0].contentRect.width);\r\n\r\n\t\t\t\t\t\t\tif(this.containerHeight != nodeHeight || this.containerWidth != nodeWidth){\r\n\t\t\t\t\t\t\t\tthis.containerHeight = nodeHeight;\r\n\t\t\t\t\t\t\t\tthis.containerWidth = nodeWidth;\r\n\t\t\t\t\t\t\t\tthis.tableHeight = table.element.clientHeight;\r\n\t\t\t\t\t\t\t\tthis.tableWidth = table.element.clientWidth;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\ttable.columnManager.renderer.rerenderColumns(true);\r\n\r\n\t\t\t\t\t\t\ttable.redraw();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tthis.containerObserver.observe(this.table.element.parentNode);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.subscribe(\"table-resize\", this.tableResized.bind(this));\r\n\r\n\t\t\t}else{\r\n\t\t\t\tthis.binding = function(){\r\n\t\t\t\t\tif(!table.browserMobile || (table.browserMobile && !table.modules.edit.currentCell)){\r\n\r\n\t\t\t\t\t\ttable.columnManager.renderer.rerenderColumns(true);\r\n\r\n\t\t\t\t\t\ttable.redraw();\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\r\n\t\t\t\twindow.addEventListener(\"resize\", this.binding);\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"table-destroy\", this.clearBindings.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\ttableResized(){\r\n\t\tthis.table.rowManager.redraw();\r\n\t}\r\n\r\n\tclearBindings(){\r\n\t\tif(this.binding){\r\n\t\t\twindow.removeEventListener(\"resize\", this.binding);\r\n\t\t}\r\n\r\n\t\tif(this.observer){\r\n\t\t\tthis.observer.unobserve(this.table.element);\r\n\t\t}\r\n\r\n\t\tif(this.containerObserver){\r\n\t\t\tthis.containerObserver.unobserve(this.table.element.parentNode);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nResizeTable.moduleName = \"resizeTable\";\r\n\r\nexport default ResizeTable;","import Module from '../../core/Module.js';\r\n\r\nclass ResponsiveLayout extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.columns = [];\r\n\t\tthis.hiddenColumns = [];\r\n\t\tthis.mode = \"\";\r\n\t\tthis.index = 0;\r\n\t\tthis.collapseFormatter = [];\r\n\t\tthis.collapseStartOpen = true;\r\n\t\tthis.collapseHandleColumn = false;\r\n\r\n\t\tthis.registerTableOption(\"responsiveLayout\", false); //responsive layout flags\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseStartOpen\", true); //start showing collapsed data\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseUseFormatters\", true); //responsive layout collapse formatter\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseFormatter\", false); //responsive layout collapse formatter\r\n\r\n\t\tthis.registerColumnOption(\"responsive\");\r\n\t}\r\n\r\n\t//generate responsive columns list\r\n\tinitialize(){\r\n\t\tvar self = this,\r\n\t\tcolumns = [];\r\n\r\n\t\tif(this.table.options.responsiveLayout){\r\n\t\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"column-show\", this.updateColumnVisibility.bind(this));\r\n\t\t\tthis.subscribe(\"column-hide\", this.updateColumnVisibility.bind(this));\r\n\t\t\tthis.subscribe(\"columns-loaded\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-moved\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-add\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-delete\", this.initializeResponsivity.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"table-redrawing\", this.tableRedraw.bind(this));\r\n\r\n\t\t\tif(this.table.options.responsiveLayout === \"collapse\"){\r\n\t\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\t\tthis.subscribe(\"row-layout\", this.layoutRow.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tif([\"fitColumns\", \"fitDataStretch\"].indexOf(this.layoutMode()) === -1){\r\n\t\t\tif(!force){\r\n\t\t\t\tthis.update();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeResponsivity(){\r\n\t\tvar columns = [];\r\n\r\n\t\tthis.mode = this.table.options.responsiveLayout;\r\n\t\tthis.collapseFormatter = this.table.options.responsiveLayoutCollapseFormatter || this.formatCollapsedData;\r\n\t\tthis.collapseStartOpen = this.table.options.responsiveLayoutCollapseStartOpen;\r\n\t\tthis.hiddenColumns = [];\r\n\r\n\t\t//determine level of responsivity for each column\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column, i) => {\r\n\t\t\tif(column.modules.responsive){\r\n\t\t\t\tif(column.modules.responsive.order && column.modules.responsive.visible){\r\n\t\t\t\t\tcolumn.modules.responsive.index = i;\r\n\t\t\t\t\tcolumns.push(column);\r\n\r\n\t\t\t\t\tif(!column.visible && this.mode === \"collapse\"){\r\n\t\t\t\t\t\tthis.hiddenColumns.push(column);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t//sort list by responsivity\r\n\t\tcolumns = columns.reverse();\r\n\t\tcolumns = columns.sort((a, b) => {\r\n\t\t\tvar diff = b.modules.responsive.order - a.modules.responsive.order;\r\n\t\t\treturn diff || (b.modules.responsive.index - a.modules.responsive.index);\r\n\t\t});\r\n\r\n\t\tthis.columns = columns;\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tthis.generateCollapsedContent();\r\n\t\t}\r\n\r\n\t\t//assign collapse column\r\n\t\tfor (let col of this.table.columnManager.columnsByIndex){\r\n\t\t\tif(col.definition.formatter == \"responsiveCollapse\"){\r\n\t\t\t\tthis.collapseHandleColumn = col;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this.collapseHandleColumn){\r\n\t\t\tif(this.hiddenColumns.length){\r\n\t\t\t\tthis.collapseHandleColumn.show();\r\n\t\t\t}else{\r\n\t\t\t\tthis.collapseHandleColumn.hide();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//define layout information\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.getDefinition();\r\n\r\n\t\tcolumn.modules.responsive = {order: typeof def.responsive === \"undefined\" ? 1 : def.responsive, visible:def.visible === false ? false : true};\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar el;\r\n\r\n\t\tif(row.type !== \"calc\"){\r\n\t\t\tel = document.createElement(\"div\");\r\n\t\t\tel.classList.add(\"tabulator-responsive-collapse\");\r\n\r\n\t\t\trow.modules.responsiveLayout = {\r\n\t\t\t\telement:el,\r\n\t\t\t\topen:this.collapseStartOpen,\r\n\t\t\t};\r\n\r\n\t\t\tif(!this.collapseStartOpen){\r\n\t\t\t\tel.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tlayoutRow(row){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tif(row.modules.responsiveLayout){\r\n\t\t\trowEl.appendChild(row.modules.responsiveLayout.element);\r\n\t\t\tthis.generateCollapsedRowContent(row);\r\n\t\t}\r\n\t}\r\n\r\n\t//update column visibility\r\n\tupdateColumnVisibility(column, responsiveToggle){\r\n\t\tif(!responsiveToggle && column.modules.responsive){\r\n\t\t\tcolumn.modules.responsive.visible = column.visible;\r\n\t\t\tthis.initializeResponsivity();\r\n\t\t}\r\n\t}\r\n\r\n\thideColumn(column){\r\n\t\tvar colCount = this.hiddenColumns.length;\r\n\r\n\t\tcolumn.hide(false, true);\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tthis.hiddenColumns.unshift(column);\r\n\t\t\tthis.generateCollapsedContent();\r\n\r\n\t\t\tif(this.collapseHandleColumn && !colCount){\r\n\t\t\t\tthis.collapseHandleColumn.show();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tshowColumn(column){\r\n\t\tvar index;\r\n\r\n\t\tcolumn.show(false, true);\r\n\t\t//set column width to prevent calculation loops on uninitialized columns\r\n\t\tcolumn.setWidth(column.getWidth());\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tindex = this.hiddenColumns.indexOf(column);\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.hiddenColumns.splice(index, 1);\r\n\t\t\t}\r\n\r\n\t\t\tthis.generateCollapsedContent();\r\n\r\n\t\t\tif(this.collapseHandleColumn && !this.hiddenColumns.length){\r\n\t\t\t\tthis.collapseHandleColumn.hide();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//redraw columns to fit space\r\n\tupdate(){\r\n\t\tvar self = this,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\r\n\t\t\tlet width = self.table.modules.layout.getMode() == \"fitColumns\" ? self.table.columnManager.getFlexBaseWidth() : self.table.columnManager.getWidth();\r\n\r\n\t\t\tlet diff = (self.table.options.headerVisible ? self.table.columnManager.element.clientWidth : self.table.element.clientWidth) - width;\r\n\r\n\t\t\tif(diff < 0){\r\n\t\t\t\t//table is too wide\r\n\t\t\t\tlet column = self.columns[self.index];\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tself.hideColumn(column);\r\n\t\t\t\t\tself.index ++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\r\n\t\t\t\t//table has spare space\r\n\t\t\t\tlet column = self.columns[self.index -1];\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tif(diff > 0){\r\n\t\t\t\t\t\tif(diff >= column.getWidth()){\r\n\t\t\t\t\t\t\tself.showColumn(column);\r\n\t\t\t\t\t\t\tself.index --;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tworking = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tworking = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(!self.table.rowManager.activeRowsCount){\r\n\t\t\t\tself.table.rowManager.renderEmptyScroll();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateCollapsedContent(){\r\n\t\tvar self = this,\r\n\t\trows = this.table.rowManager.getDisplayRows();\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\tself.generateCollapsedRowContent(row);\r\n\t\t});\r\n\t}\r\n\r\n\tgenerateCollapsedRowContent(row){\r\n\t\tvar el, contents;\r\n\r\n\t\tif(row.modules.responsiveLayout){\r\n\t\t\tel = row.modules.responsiveLayout.element;\r\n\r\n\t\t\twhile(el.firstChild) el.removeChild(el.firstChild);\r\n\r\n\t\t\tcontents = this.collapseFormatter(this.generateCollapsedRowData(row));\r\n\t\t\tif(contents){\r\n\t\t\t\tel.appendChild(contents);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateCollapsedRowData(row){\r\n\t\tvar self = this,\r\n\t\tdata = row.getData(),\r\n\t\toutput = [],\r\n\t\tmockCellComponent;\r\n\r\n\t\tthis.hiddenColumns.forEach(function(column){\r\n\t\t\tvar value = column.getFieldValue(data);\r\n\r\n\t\t\tif(column.definition.title && column.field){\r\n\t\t\t\tif(column.modules.format && self.table.options.responsiveLayoutCollapseUseFormatters){\r\n\r\n\t\t\t\t\tmockCellComponent = {\r\n\t\t\t\t\t\tvalue:false,\r\n\t\t\t\t\t\tdata:{},\r\n\t\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetData:function(){\r\n\t\t\t\t\t\t\treturn data;\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\t\treturn document.createElement(\"div\");\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\t\treturn row.getComponent();\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tfunction onRendered(callback){\r\n\t\t\t\t\t\tcallback();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\toutput.push({\r\n\t\t\t\t\t\tfield: column.field,\r\n\t\t\t\t\t\ttitle: column.definition.title,\r\n\t\t\t\t\t\tvalue: column.modules.format.formatter.call(self.table.modules.format, mockCellComponent, column.modules.format.params, onRendered)\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\toutput.push({\r\n\t\t\t\t\t\tfield: column.field,\r\n\t\t\t\t\t\ttitle: column.definition.title,\r\n\t\t\t\t\t\tvalue: value\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tformatCollapsedData(data){\r\n\t\tvar list = document.createElement(\"table\");\r\n\r\n\t\tdata.forEach(function(item){\r\n\t\t\tvar row = document.createElement(\"tr\");\r\n\t\t\tvar titleData = document.createElement(\"td\");\r\n\t\t\tvar valueData = document.createElement(\"td\");\r\n\t\t\tvar node_content;\r\n\r\n\t\t\tvar titleHighlight = document.createElement(\"strong\");\r\n\t\t\ttitleData.appendChild(titleHighlight);\r\n\t\t\tthis.langBind(\"columns|\" + item.field, function(text){\r\n\t\t\t\ttitleHighlight.innerHTML = text || item.title;\r\n\t\t\t});\r\n\r\n\t\t\tif(item.value instanceof Node){\r\n\t\t\t\tnode_content = document.createElement(\"div\");\r\n\t\t\t\tnode_content.appendChild(item.value);\r\n\t\t\t\tvalueData.appendChild(node_content);\r\n\t\t\t}else{\r\n\t\t\t\tvalueData.innerHTML = item.value;\r\n\t\t\t}\r\n\r\n\t\t\trow.appendChild(titleData);\r\n\t\t\trow.appendChild(valueData);\r\n\t\t\tlist.appendChild(row);\r\n\t\t}, this);\r\n\r\n\t\treturn Object.keys(data).length ? list : \"\";\r\n\t}\r\n}\r\n\r\nResponsiveLayout.moduleName = \"responsiveLayout\";\r\n\r\nexport default ResponsiveLayout;","import Module from '../../core/Module.js';\r\n\r\nclass SelectRow extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.selecting = false; //flag selecting in progress\r\n\t\tthis.lastClickedRow = false; //last clicked row\r\n\t\tthis.selectPrev = []; //hold previously selected element for drag drop selection\r\n\t\tthis.selectedRows = []; //hold selected rows\r\n\t\tthis.headerCheckboxElement = null; // hold header select element\r\n\t\t\r\n\t\tthis.registerTableOption(\"selectable\", \"highlight\"); //highlight rows on hover\r\n\t\tthis.registerTableOption(\"selectableRangeMode\", \"drag\"); //highlight rows on hover\r\n\t\tthis.registerTableOption(\"selectableRollingSelection\", true); //roll selection once maximum number of selectable rows is reached\r\n\t\tthis.registerTableOption(\"selectablePersistence\", true); // maintain selection when table view is updated\r\n\t\tthis.registerTableOption(\"selectableCheck\", function(data, row){return true;}); //check wheather row is selectable\r\n\t\t\r\n\t\tthis.registerTableFunction(\"selectRow\", this.selectRows.bind(this));\r\n\t\tthis.registerTableFunction(\"deselectRow\", this.deselectRows.bind(this));\r\n\t\tthis.registerTableFunction(\"toggleSelectRow\", this.toggleRow.bind(this));\r\n\t\tthis.registerTableFunction(\"getSelectedRows\", this.getSelectedRows.bind(this));\r\n\t\tthis.registerTableFunction(\"getSelectedData\", this.getSelectedData.bind(this));\r\n\t\t\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"select\", this.selectRows.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"deselect\", this.deselectRows.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"toggleSelect\", this.toggleRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isSelected\", this.isRowSelected.bind(this));\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.selectable !== false){\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleting\", this.rowDeleted.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.clearSelectionData.bind(this));\r\n\t\t\tthis.subscribe(\"rows-retrieve\", this.rowRetrieve.bind(this));\r\n\t\t\t\r\n\t\t\tif(this.table.options.selectable && !this.table.options.selectablePersistence){\r\n\t\t\t\tthis.subscribe(\"data-refreshing\", this.deselectRows.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trowRetrieve(type, prevValue){\r\n\t\treturn type === \"selected\" ? this.selectedRows : prevValue;\r\n\t}\r\n\t\r\n\trowDeleted(row){\r\n\t\tthis._deselectRow(row, true);\r\n\t}\r\n\t\r\n\tclearSelectionData(silent){\r\n\t\tthis.selecting = false;\r\n\t\tthis.lastClickedRow = false;\r\n\t\tthis.selectPrev = [];\r\n\t\tthis.selectedRows = [];\r\n\t\t\r\n\t\tif(silent !== true){\r\n\t\t\tthis._rowSelectionChanged();\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\telement = row.getElement();\r\n\t\t\r\n\t\t// trigger end of row selection\r\n\t\tvar endSelect = function(){\r\n\t\t\t\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tself.selecting = false;\r\n\t\t\t}, 50);\r\n\t\t\t\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", endSelect);\r\n\t\t};\r\n\t\t\r\n\t\trow.modules.select = {selected:false};\r\n\t\t\r\n\t\t//set row selection class\r\n\t\tif(self.table.options.selectableCheck.call(this.table, row.getComponent())){\r\n\t\t\telement.classList.add(\"tabulator-selectable\");\r\n\t\t\telement.classList.remove(\"tabulator-unselectable\");\r\n\t\t\t\r\n\t\t\tif(self.table.options.selectable && self.table.options.selectable != \"highlight\"){\r\n\t\t\t\tif(self.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\telement.addEventListener(\"click\", this.handleComplexRowClick.bind(this, row));\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.addEventListener(\"click\", function(e){\r\n\t\t\t\t\t\tif(!self.table.modExists(\"edit\") || !self.table.modules.edit.getCurrentCell()){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!self.selecting){\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\t\t\tif(e.shiftKey){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.selecting = true;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.selectPrev = [];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tdocument.body.addEventListener(\"mouseup\", endSelect);\r\n\t\t\t\t\t\t\tdocument.body.addEventListener(\"keyup\", endSelect);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mouseenter\", function(e){\r\n\t\t\t\t\t\tif(self.selecting){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(self.selectPrev[1] == row){\r\n\t\t\t\t\t\t\t\tself.toggleRow(self.selectPrev[0]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mouseout\", function(e){\r\n\t\t\t\t\t\tif(self.selecting){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\tself.selectPrev.unshift(row);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\telement.classList.add(\"tabulator-unselectable\");\r\n\t\t\telement.classList.remove(\"tabulator-selectable\");\r\n\t\t}\r\n\t}\r\n\t\r\n\thandleComplexRowClick(row, e){\r\n\t\tif(e.shiftKey){\r\n\t\t\tthis.table._clearSelection();\r\n\t\t\tthis.lastClickedRow = this.lastClickedRow || row;\r\n\t\t\t\r\n\t\t\tvar lastClickedRowIdx = this.table.rowManager.getDisplayRowIndex(this.lastClickedRow);\r\n\t\t\tvar rowIdx = this.table.rowManager.getDisplayRowIndex(row);\r\n\t\t\t\r\n\t\t\tvar fromRowIdx = lastClickedRowIdx <= rowIdx ? lastClickedRowIdx : rowIdx;\r\n\t\t\tvar toRowIdx = lastClickedRowIdx >= rowIdx ? lastClickedRowIdx : rowIdx;\r\n\t\t\t\r\n\t\t\tvar rows = this.table.rowManager.getDisplayRows().slice(0);\r\n\t\t\tvar toggledRows = rows.splice(fromRowIdx, toRowIdx - fromRowIdx + 1);\r\n\t\t\t\r\n\t\t\tif(e.ctrlKey || e.metaKey){\r\n\t\t\t\ttoggledRows.forEach((toggledRow)=>{\r\n\t\t\t\t\tif(toggledRow !== this.lastClickedRow){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.table.options.selectable !== true && !this.isRowSelected(row)){\r\n\t\t\t\t\t\t\tif(this.selectedRows.length < this.table.options.selectable){\r\n\t\t\t\t\t\t\t\tthis.toggleRow(toggledRow);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.toggleRow(toggledRow);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tthis.lastClickedRow = row;\r\n\t\t\t}else{\r\n\t\t\t\tthis.deselectRows(undefined, true);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.selectable !== true){\r\n\t\t\t\t\tif(toggledRows.length > this.table.options.selectable){\r\n\t\t\t\t\t\ttoggledRows = toggledRows.slice(0, this.table.options.selectable)\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.selectRows(toggledRows);\r\n\t\t\t}\r\n\t\t\tthis.table._clearSelection();\r\n\t\t}\r\n\t\telse if(e.ctrlKey || e.metaKey){\r\n\t\t\tthis.toggleRow(row);\r\n\t\t\tthis.lastClickedRow = row;\r\n\t\t}else{\r\n\t\t\tthis.deselectRows(undefined, true);\r\n\t\t\tthis.selectRows(row);\r\n\t\t\tthis.lastClickedRow = row;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//toggle row selection\r\n\ttoggleRow(row){\r\n\t\tif(this.table.options.selectableCheck.call(this.table, row.getComponent())){\r\n\t\t\tif(row.modules.select && row.modules.select.selected){\r\n\t\t\t\tthis._deselectRow(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis._selectRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//select a number of rows\r\n\tselectRows(rows){\r\n\t\tvar rowMatch;\r\n\t\t\r\n\t\tswitch(typeof rows){\r\n\t\t\tcase \"undefined\":\r\n\t\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis._rowSelectionChanged();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"string\":\r\n\t\t\t\r\n\t\t\trowMatch = this.table.rowManager.findRow(rows);\r\n\t\t\t\r\n\t\t\tif(rowMatch){\r\n\t\t\t\tthis._selectRow(rowMatch, true, true);\r\n\t\t\t}else{\r\n\t\t\t\tthis.table.rowManager.getRows(rows).forEach((row) => {\r\n\t\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._rowSelectionChanged();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\tif(Array.isArray(rows)){\r\n\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis._rowSelectionChanged();\r\n\t\t\t}else{\r\n\t\t\t\tthis._selectRow(rows, false, true);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//select an individual row\r\n\t_selectRow(rowInfo, silent, force){\r\n\t\tvar index;\r\n\t\t\r\n\t\t//handle max row count\r\n\t\tif(!isNaN(this.table.options.selectable) && this.table.options.selectable !== true && !force){\r\n\t\t\tif(this.selectedRows.length >= this.table.options.selectable){\r\n\t\t\t\tif(this.table.options.selectableRollingSelection){\r\n\t\t\t\t\tthis._deselectRow(this.selectedRows[0]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tvar row = this.table.rowManager.findRow(rowInfo);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\tif(this.selectedRows.indexOf(row) == -1){\r\n\t\t\t\trow.getElement().classList.add(\"tabulator-selected\");\r\n\t\t\t\tif(!row.modules.select){\r\n\t\t\t\t\trow.modules.select = {};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\trow.modules.select.selected = true;\r\n\t\t\t\tif(row.modules.select.checkboxEl){\r\n\t\t\t\t\trow.modules.select.checkboxEl.checked = true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.selectedRows.push(row);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.dataTreeSelectPropagate){\r\n\t\t\t\t\tthis.childRowSelection(row, true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatchExternal(\"rowSelected\", row.getComponent());\r\n\t\t\t\t\r\n\t\t\t\tthis._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Selection Error - No such row found, ignoring selection:\" + rowInfo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tisRowSelected(row){\r\n\t\treturn this.selectedRows.indexOf(row) !== -1;\r\n\t}\r\n\t\r\n\t//deselect a number of rows\r\n\tdeselectRows(rows, silent){\r\n\t\tvar self = this,\r\n\t\trowCount;\r\n\t\t\r\n\t\tif(typeof rows == \"undefined\"){\r\n\t\t\t\r\n\t\t\trowCount = self.selectedRows.length;\r\n\t\t\t\r\n\t\t\tfor(let i = 0; i < rowCount; i++){\r\n\t\t\t\tself._deselectRow(self.selectedRows[0], true);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(rowCount){\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tif(Array.isArray(rows)){\r\n\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\tself._deselectRow(row, true);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}else{\r\n\t\t\t\tself._deselectRow(rows, silent);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//deselect an individual row\r\n\t_deselectRow(rowInfo, silent){\r\n\t\tvar self = this,\r\n\t\trow = self.table.rowManager.findRow(rowInfo),\r\n\t\tindex;\r\n\t\t\r\n\t\tif(row){\r\n\t\t\tindex = self.selectedRows.findIndex(function(selectedRow){\r\n\t\t\t\treturn selectedRow == row;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\t\r\n\t\t\t\trow.getElement().classList.remove(\"tabulator-selected\");\r\n\t\t\t\tif(!row.modules.select){\r\n\t\t\t\t\trow.modules.select = {};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\trow.modules.select.selected = false;\r\n\t\t\t\tif(row.modules.select.checkboxEl){\r\n\t\t\t\t\trow.modules.select.checkboxEl.checked = false;\r\n\t\t\t\t}\r\n\t\t\t\tself.selectedRows.splice(index, 1);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.dataTreeSelectPropagate){\r\n\t\t\t\t\tthis.childRowSelection(row, false);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatchExternal(\"rowDeselected\", row.getComponent());\r\n\t\t\t\t\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Deselection Error - No such row found, ignoring selection:\" + rowInfo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetSelectedData(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tthis.selectedRows.forEach(function(row){\r\n\t\t\tdata.push(row.getData());\r\n\t\t});\r\n\t\t\r\n\t\treturn data;\r\n\t}\r\n\t\r\n\tgetSelectedRows(){\r\n\t\t\r\n\t\tvar rows = [];\r\n\t\t\r\n\t\tthis.selectedRows.forEach(function(row){\r\n\t\t\trows.push(row.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t_rowSelectionChanged(silent){\r\n\t\tif(this.headerCheckboxElement){\r\n\t\t\tif(this.selectedRows.length === 0){\r\n\t\t\t\tthis.headerCheckboxElement.checked = false;\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = false;\r\n\t\t\t} else if(this.table.rowManager.rows.length === this.selectedRows.length){\r\n\t\t\t\tthis.headerCheckboxElement.checked = true;\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = false;\r\n\t\t\t} else {\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = true;\r\n\t\t\t\tthis.headerCheckboxElement.checked = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(!silent){\r\n\t\t\tthis.dispatchExternal(\"rowSelectionChanged\", this.getSelectedData(), this.getSelectedRows());\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterRowSelectCheckbox (row, element) {\r\n\t\tif(!row._row.modules.select){\r\n\t\t\trow._row.modules.select = {};\r\n\t\t}\r\n\t\t\r\n\t\trow._row.modules.select.checkboxEl = element;\r\n\t}\r\n\t\r\n\tregisterHeaderSelectCheckbox (element) {\r\n\t\tthis.headerCheckboxElement = element;\r\n\t}\r\n\t\r\n\tchildRowSelection(row, select){\r\n\t\tvar children = this.table.modules.dataTree.getChildren(row, true);\r\n\t\t\r\n\t\tif(select){\r\n\t\t\tfor(let child of children){\r\n\t\t\t\tthis._selectRow(child, true);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tfor(let child of children){\r\n\t\t\t\tthis._deselectRow(child, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nSelectRow.moduleName = \"selectRow\";\r\n\r\nexport default SelectRow;","//sort numbers\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar decimal = params.decimalSeparator;\r\n\tvar thousand = params.thousandSeparator;\r\n\tvar emptyAlign = 0;\r\n\r\n\ta = String(a);\r\n\tb = String(b);\r\n\r\n\tif(thousand){\r\n\t\ta = a.split(thousand).join(\"\");\r\n\t\tb = b.split(thousand).join(\"\");\r\n\t}\r\n\r\n\tif(decimal){\r\n\t\ta = a.split(decimal).join(\".\");\r\n\t\tb = b.split(decimal).join(\".\");\r\n\t}\r\n\r\n\ta = parseFloat(a);\r\n\tb = parseFloat(b);\r\n\r\n\t//handle non numeric values\r\n\tif(isNaN(a)){\r\n\t\temptyAlign = isNaN(b) ? 0 : -1;\r\n\t}else if(isNaN(b)){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\t\t//compare valid values\r\n\t\treturn a - b;\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n};","//sort strings\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar emptyAlign = 0;\r\n\tvar locale;\r\n\r\n\t//handle empty values\r\n\tif(!a){\r\n\t\temptyAlign = !b ? 0 : -1;\r\n\t}else if(!b){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\t\t//compare valid values\r\n\t\tswitch(typeof params.locale){\r\n\t\t\tcase \"boolean\":\r\n\t\t\tif(params.locale){\r\n\t\t\t\tlocale = this.langLocale();\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\tcase \"string\":\r\n\t\t\tlocale = params.locale;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn String(a).toLowerCase().localeCompare(String(b).toLowerCase(), locale);\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n};","//sort datetime\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar format = params.format || \"dd/MM/yyyy HH:mm:ss\",\r\n\talignEmptyValues = params.alignEmptyValues,\r\n\temptyAlign = 0;\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tif(DT.isDateTime(a)){\r\n\t\t\t a = a;\r\n\t\t}else if(format === \"iso\"){\r\n\t\t\t a = DT.fromISO(String(a));\r\n\t\t}else{\r\n\t\t\t a = DT.fromFormat(String(a), format);\r\n\t\t}\r\n\r\n\t\tif(DT.isDateTime(b)){\r\n\t\t\t b = b;\r\n\t\t}else if(format === \"iso\"){\r\n\t\t\t b = DT.fromISO(String(b));\r\n\t\t}else{\r\n\t\t\t b = DT.fromFormat(String(b), format);\r\n\t\t}\r\n\r\n\t\tif(!a.isValid){\r\n\t\t\temptyAlign = !b.isValid ? 0 : -1;\r\n\t\t}else if(!b.isValid){\r\n\t\t\temptyAlign = 1;\r\n\t\t}else{\r\n\t\t\t//compare valid values\r\n\t\t\treturn a - b;\r\n\t\t}\r\n\r\n\t\t//fix empty values in position\r\n\t\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\t\temptyAlign *= -1;\r\n\t\t}\r\n\r\n\t\treturn emptyAlign;\r\n\r\n\t}else{\r\n\t\tconsole.error(\"Sort Error - 'datetime' sorter is dependant on luxon.js\");\r\n\t}\r\n};","import datetime from './datetime.js';\r\n\r\n//sort date\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tif(!params.format){\r\n\t\tparams.format = \"dd/MM/yyyy\";\r\n\t}\r\n\r\n\treturn datetime.call(this, a, b, aRow, bRow, column, dir, params);\r\n};","import datetime from './datetime.js';\r\n\r\n//sort times\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tif(!params.format){\r\n\t\tparams.format = \"HH:mm\";\r\n\t}\r\n\r\n\treturn datetime.call(this, a, b, aRow, bRow, column, dir, params);\r\n};","//sort booleans\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar el1 = a === true || a === \"true\" || a === \"True\" || a === 1 ? 1 : 0;\r\n\tvar el2 = b === true || b === \"true\" || b === \"True\" || b === 1 ? 1 : 0;\r\n\r\n\treturn el1 - el2;\r\n};","//sort if element contains any data\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar el1 = 0;\r\n\tvar el2 = 0;\r\n\tvar type = params.type || \"length\";\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar emptyAlign = 0;\r\n\r\n\tfunction calc(value){\r\n\r\n\t\tswitch(type){\r\n\t\t\tcase \"length\":\r\n\t\t\treturn value.length;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"sum\":\r\n\t\t\treturn value.reduce(function(c, d){\r\n\t\t\t\treturn c + d;\r\n\t\t\t});\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"max\":\r\n\t\t\treturn Math.max.apply(null, value) ;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"min\":\r\n\t\t\treturn Math.min.apply(null, value) ;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"avg\":\r\n\t\t\treturn value.reduce(function(c, d){\r\n\t\t\t\treturn c + d;\r\n\t\t\t}) / value.length;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\t//handle non array values\r\n\tif(!Array.isArray(a)){\r\n\t\talignEmptyValues = !Array.isArray(b) ? 0 : -1;\r\n\t}else if(!Array.isArray(b)){\r\n\t\talignEmptyValues = 1;\r\n\t}else{\r\n\r\n\t\t//compare valid values\r\n\t\tel1 = a ? calc(a) : 0;\r\n\t\tel2 = b ? calc(b) : 0;\r\n\r\n\t\treturn el1 - el2;\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n};","//sort if element contains any data\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar el1 = typeof a == \"undefined\" ? 0 : 1;\r\n\tvar el2 = typeof b == \"undefined\" ? 0 : 1;\r\n\r\n\treturn el1 - el2;\r\n};","//sort alpha numeric strings\r\nexport default function(as, bs, aRow, bRow, column, dir, params){\r\n\tvar a, b, a1, b1, i= 0, L, rx = /(\\d+)|(\\D+)/g, rd = /\\d/;\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar emptyAlign = 0;\r\n\r\n\t//handle empty values\r\n\tif(!as && as!== 0){\r\n\t\temptyAlign = !bs && bs!== 0 ? 0 : -1;\r\n\t}else if(!bs && bs!== 0){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\r\n\t\tif(isFinite(as) && isFinite(bs)) return as - bs;\r\n\t\ta = String(as).toLowerCase();\r\n\t\tb = String(bs).toLowerCase();\r\n\t\tif(a === b) return 0;\r\n\t\tif(!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1;\r\n\t\ta = a.match(rx);\r\n\t\tb = b.match(rx);\r\n\t\tL = a.length > b.length ? b.length : a.length;\r\n\t\twhile(i < L){\r\n\t\t\ta1= a[i];\r\n\t\t\tb1= b[i++];\r\n\t\t\tif(a1 !== b1){\r\n\t\t\t\tif(isFinite(a1) && isFinite(b1)){\r\n\t\t\t\t\tif(a1.charAt(0) === \"0\") a1 = \".\" + a1;\r\n\t\t\t\t\tif(b1.charAt(0) === \"0\") b1 = \".\" + b1;\r\n\t\t\t\t\treturn a1 - b1;\r\n\t\t\t\t}\r\n\t\t\t\telse return a1 > b1 ? 1 : -1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn a.length > b.length;\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n};","import number from './sorters/number.js';\r\nimport string from './sorters/string.js';\r\nimport date from './sorters/date.js';\r\nimport time from './sorters/time.js';\r\nimport datetime from './sorters/datetime.js';\r\nimport boolean from './sorters/boolean.js';\r\nimport array from './sorters/array.js';\r\nimport exists from './sorters/exists.js';\r\nimport alphanum from './sorters/alphanum.js';\r\n\r\nexport default {\r\n\tnumber:number,\r\n\tstring:string,\r\n\tdate:date,\r\n\ttime:time,\r\n\tdatetime:datetime,\r\n\tboolean:boolean,\r\n\tarray:array,\r\n\texists:exists,\r\n\talphanum:alphanum\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultSorters from './defaults/sorters.js';\r\n\r\nclass Sort extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t \tthis.sortList = []; //holder current sort\r\n\t \tthis.changed = false; //has the sort changed since last render\r\n\r\n\t \tthis.registerTableOption(\"sortMode\", \"local\"); //local or remote sorting\r\n\r\n\t \tthis.registerTableOption(\"initialSort\", false); //initial sorting criteria\r\n\t \tthis.registerTableOption(\"columnHeaderSortMulti\", true); //multiple or single column sorting\r\n\t \tthis.registerTableOption(\"sortOrderReverse\", false); //reverse internal sort ordering\r\n\t \tthis.registerTableOption(\"headerSortElement\", \"
\"); //header sort element\r\n\r\n\t \tthis.registerColumnOption(\"sorter\");\r\n\t \tthis.registerColumnOption(\"sorterParams\");\r\n\r\n\t \tthis.registerColumnOption(\"headerSort\", true);\r\n\t \tthis.registerColumnOption(\"headerSortStartingDir\");\r\n\t \tthis.registerColumnOption(\"headerSortTristate\");\r\n\r\n\t }\r\n\r\n\t initialize(){\r\n\t \tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t \tthis.subscribe(\"table-built\", this.tableBuilt.bind(this));\r\n\t \tthis.registerDataHandler(this.sort.bind(this), 20);\r\n\r\n\t \tthis.registerTableFunction(\"setSort\", this.userSetSort.bind(this));\r\n\t \tthis.registerTableFunction(\"getSorters\", this.getSort.bind(this));\r\n\t \tthis.registerTableFunction(\"clearSort\", this.clearSort.bind(this));\r\n\r\n\t \tif(this.table.options.sortMode === \"remote\"){\r\n\t \t\tthis.subscribe(\"data-params\", this.remoteSortParams.bind(this));\r\n\t \t}\r\n\t }\r\n\r\n\t tableBuilt(){\r\n\t \tif(this.table.options.initialSort){\r\n\t \t\tthis.setSort(this.table.options.initialSort);\r\n\t \t}\r\n\t }\r\n\r\n\t remoteSortParams(data, config, silent, params){\r\n\t \tvar sorters = this.getSort();\r\n\r\n\t \tsorters.forEach((item) => {\r\n\t \t\tdelete item.column;\r\n\t \t});\r\n\r\n\t \tparams.sort = sorters;\r\n\r\n\t \treturn params;\r\n\t }\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tuserSetSort(sortList, dir){\r\n\t\tthis.setSort(sortList, dir);\r\n\t\t// this.table.rowManager.sorterRefresh();\r\n\t\tthis.refreshSort();\r\n\t}\r\n\r\n\tclearSort(){\r\n\t\tthis.clear();\r\n\t\t// this.table.rowManager.sorterRefresh();\r\n\t\tthis.refreshSort();\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\t//initialize column header for sorting\r\n\tinitializeColumn(column){\r\n\t\tvar sorter = false,\r\n\t\tcolEl,\r\n\t\tarrowEl;\r\n\r\n\t\tswitch(typeof column.definition.sorter){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(Sort.sorters[column.definition.sorter]){\r\n\t\t\t\tsorter = Sort.sorters[column.definition.sorter];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Sort Error - No such sorter found: \", column.definition.sorter);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tsorter = column.definition.sorter;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcolumn.modules.sort = {\r\n\t\t\tsorter:sorter, dir:\"none\",\r\n\t\t\tparams:column.definition.sorterParams || {},\r\n\t\t\tstartingDir:column.definition.headerSortStartingDir || \"asc\",\r\n\t\t\ttristate: column.definition.headerSortTristate,\r\n\t\t};\r\n\r\n\t\tif(column.definition.headerSort !== false){\r\n\r\n\t\t\tcolEl = column.getElement();\r\n\r\n\t\t\tcolEl.classList.add(\"tabulator-sortable\");\r\n\r\n\r\n\t\t\tarrowEl = document.createElement(\"div\");\r\n\t\t\tarrowEl.classList.add(\"tabulator-col-sorter\");\r\n\r\n\t\t\tif(typeof this.table.options.headerSortElement == \"object\"){\r\n\t\t\t\tarrowEl.appendChild(this.table.options.headerSortElement);\r\n\t\t\t}else{\r\n\t\t\t\tarrowEl.innerHTML = this.table.options.headerSortElement;\r\n\t\t\t}\r\n\r\n\t\t\t//create sorter arrow\r\n\t\t\tcolumn.titleHolderElement.appendChild(arrowEl);\r\n\r\n\t\t\tcolumn.modules.sort.element = arrowEl;\r\n\r\n\t\t\t//sort on click\r\n\t\t\tcolEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\tvar dir = \"\",\r\n\t\t\t\tsorters=[],\r\n\t\t\t\tmatch = false;\r\n\r\n\t\t\t\tif(column.modules.sort){\r\n\t\t\t\t\tif(column.modules.sort.tristate){\r\n\t\t\t\t\t\tif(column.modules.sort.dir == \"none\"){\r\n\t\t\t\t\t\t\tdir = column.modules.sort.startingDir;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(column.modules.sort.dir == column.modules.sort.startingDir){\r\n\t\t\t\t\t\t\t\tdir = column.modules.sort.dir == \"asc\" ? \"desc\" : \"asc\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tdir = \"none\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tswitch(column.modules.sort.dir){\r\n\t\t\t\t\t\t\tcase \"asc\":\r\n\t\t\t\t\t\t\tdir = \"desc\";\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase \"desc\":\r\n\t\t\t\t\t\t\tdir = \"asc\";\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tdir = column.modules.sort.startingDir;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\tif (this.table.options.columnHeaderSortMulti && (e.shiftKey || e.ctrlKey)) {\r\n\t\t\t\t\t\tsorters = this.getSort();\r\n\r\n\t\t\t\t\t\tmatch = sorters.findIndex((sorter) => {\r\n\t\t\t\t\t\t\treturn sorter.field === column.getField();\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\tif(match > -1){\r\n\t\t\t\t\t\t\tsorters[match].dir = dir;\r\n\r\n\t\t\t\t\t\t\tif(match != sorters.length -1){\r\n\t\t\t\t\t\t\t\tmatch = sorters.splice(match, 1)[0];\r\n\t\t\t\t\t\t\t\tif(dir != \"none\"){\r\n\t\t\t\t\t\t\t\t\tsorters.push(match);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(dir != \"none\"){\r\n\t\t\t\t\t\t\t\tsorters.push({column:column, dir:dir});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t//add to existing sort\r\n\t\t\t\t\t\tthis.setSort(sorters);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(dir == \"none\"){\r\n\t\t\t\t\t\t\tthis.clear();\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t//sort by column only\r\n\t\t\t\t\t\t\tthis.setSort(column, dir);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// this.table.rowManager.sorterRefresh(!this.sortList.length);\r\n\t\t\t\t\tthis.refreshSort();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\trefreshSort(){\r\n\t\tif(this.table.options.sortMode === \"remote\"){\r\n\t\t\tthis.reloadData(null, false, false);\r\n\t\t}else{\r\n\t\t\tthis.refreshData(true);\r\n\t\t}\r\n\r\n\t\t//TODO - Persist left position of row manager\r\n\t\t// left = this.scrollLeft;\r\n\t\t// this.scrollHorizontal(left);\r\n\t}\r\n\r\n\t//check if the sorters have changed since last use\r\n\thasChanged(){\r\n\t\tvar changed = this.changed;\r\n\t\tthis.changed = false;\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t//return current sorters\r\n\tgetSort(){\r\n\t\tvar self = this,\r\n\t\tsorters = [];\r\n\r\n\t\tself.sortList.forEach(function(item){\r\n\t\t\tif(item.column){\r\n\t\t\t\tsorters.push({column:item.column.getComponent(), field:item.column.getField(), dir:item.dir});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn sorters;\r\n\t}\r\n\r\n\t//change sort list and trigger sort\r\n\tsetSort(sortList, dir){\r\n\t\tvar self = this,\r\n\t\tnewSortList = [];\r\n\r\n\t\tif(!Array.isArray(sortList)){\r\n\t\t\tsortList = [{column: sortList, dir:dir}];\r\n\t\t}\r\n\r\n\t\tsortList.forEach(function(item){\r\n\t\t\tvar column;\r\n\r\n\t\t\tcolumn = self.table.columnManager.findColumn(item.column);\r\n\r\n\t\t\tif(column){\r\n\t\t\t\titem.column = column;\r\n\t\t\t\tnewSortList.push(item);\r\n\t\t\t\tself.changed = true;\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Sort Warning - Sort field does not exist and is being ignored: \", item.column);\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t\tself.sortList = newSortList;\r\n\r\n\t\tthis.dispatch(\"sort-changed\");\r\n\t}\r\n\r\n\t//clear sorters\r\n\tclear(){\r\n\t\tthis.setSort([]);\r\n\t}\r\n\r\n\t//find appropriate sorter for column\r\n\tfindSorter(column){\r\n\t\tvar row = this.table.rowManager.activeRows[0],\r\n\t\tsorter = \"string\",\r\n\t\tfield, value;\r\n\r\n\t\tif(row){\r\n\t\t\trow = row.getData();\r\n\t\t\tfield = column.getField();\r\n\r\n\t\t\tif(field){\r\n\r\n\t\t\t\tvalue = column.getFieldValue(row);\r\n\r\n\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\tsorter = \"boolean\";\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\tif(!isNaN(value) && value !== \"\"){\r\n\t\t\t\t\t\tsorter = \"number\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)){\r\n\t\t\t\t\t\t\tsorter = \"alphanum\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Sort.sorters[sorter];\r\n\t}\r\n\r\n\t//work through sort list sorting data\r\n\tsort(data){\r\n\t\tvar self = this,\r\n\t\tsortList = this.table.options.sortOrderReverse ? self.sortList.slice().reverse() : self.sortList,\r\n\t\tsortListActual = [],\r\n\t\trowComponents = [],\r\n\t\tlastSort;\r\n\r\n\t\tif(this.subscribedExternal(\"dataSorting\")){\r\n\t\t\tthis.dispatchExternal(\"dataSorting\", self.getSort());\r\n\t\t}\r\n\r\n\t\tself.clearColumnHeaders();\r\n\r\n\t\tif(this.table.options.sortMode !== \"remote\"){\r\n\r\n\t\t\t//build list of valid sorters and trigger column specific callbacks before sort begins\r\n\t\t\tsortList.forEach(function(item, i){\r\n\t\t\t\tvar sortObj = item.column.modules.sort;\r\n\r\n\t\t\t\tif(item.column && sortObj){\r\n\r\n\t\t\t\t\t//if no sorter has been defined, take a guess\r\n\t\t\t\t\tif(!sortObj.sorter){\r\n\t\t\t\t\t\tsortObj.sorter = self.findSorter(item.column);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\titem.params = typeof sortObj.params === \"function\" ? sortObj.params(item.column.getComponent(), item.dir) : sortObj.params;\r\n\r\n\t\t\t\t\tsortListActual.push(item);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tself.setColumnHeader(item.column, item.dir);\r\n\t\t\t});\r\n\r\n\t\t\t//sort data\r\n\t\t\tif (sortListActual.length) {\r\n\t\t\t\tself._sortItems(data, sortListActual);\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tsortList.forEach(function(item, i){\r\n\t\t\t\tself.setColumnHeader(item.column, item.dir);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.subscribedExternal(\"dataSorted\")){\r\n\t\t\tdata.forEach((row) => {\r\n\t\t\t\trowComponents.push(row.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatchExternal(\"dataSorted\", self.getSort(), rowComponents);\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//clear sort arrows on columns\r\n\tclearColumnHeaders(){\r\n\t\tthis.table.columnManager.getRealColumns().forEach(function(column){\r\n\t\t\tif(column.modules.sort){\r\n\t\t\t\tcolumn.modules.sort.dir = \"none\";\r\n\t\t\t\tcolumn.getElement().setAttribute(\"aria-sort\", \"none\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//set the column header sort direction\r\n\tsetColumnHeader(column, dir){\r\n\t\tcolumn.modules.sort.dir = dir;\r\n\t\tcolumn.getElement().setAttribute(\"aria-sort\", dir);\r\n\t}\r\n\r\n\t//sort each item in sort list\r\n\t_sortItems(data, sortList){\r\n\t\tvar sorterCount = sortList.length - 1;\r\n\r\n\t\tdata.sort((a, b) => {\r\n\t\t\tvar result;\r\n\r\n\t\t\tfor(var i = sorterCount; i>= 0; i--){\r\n\t\t\t\tlet sortItem = sortList[i];\r\n\r\n\t\t\t\tresult = this._sortRow(a, b, sortItem.column, sortItem.dir, sortItem.params);\r\n\r\n\t\t\t\tif(result !== 0){\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn result;\r\n\t\t});\r\n\t}\r\n\r\n\t//process individual rows for a sort function on active data\r\n\t_sortRow(a, b, column, dir, params){\r\n\t\tvar el1Comp, el2Comp, colComp;\r\n\r\n\t\t//switch elements depending on search direction\r\n\t\tvar el1 = dir == \"asc\" ? a : b;\r\n\t\tvar el2 = dir == \"asc\" ? b : a;\r\n\r\n\t\ta = column.getFieldValue(el1.getData());\r\n\t\tb = column.getFieldValue(el2.getData());\r\n\r\n\t\ta = typeof a !== \"undefined\" ? a : \"\";\r\n\t\tb = typeof b !== \"undefined\" ? b : \"\";\r\n\r\n\t\tel1Comp = el1.getComponent();\r\n\t\tel2Comp = el2.getComponent();\r\n\r\n\t\treturn column.modules.sort.sorter.call(this, a, b, el1Comp, el2Comp, column.getComponent(), dir, params);\r\n\t}\r\n}\r\n\r\nSort.moduleName = \"sort\";\r\n\r\n//load defaults\r\nSort.sorters = defaultSorters;\r\n\r\nexport default Sort;","import Module from '../../core/Module.js';\r\nimport Cell from '../../core/cell/Cell.js';\r\n\r\nclass Tooltip extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.tooltipSubscriber = null,\r\n\t\tthis.headerSubscriber = null,\r\n\t\t\r\n\t\tthis.timeout = null;\r\n\t\tthis.popupInstance = null;\r\n\t\t\r\n\t\tthis.registerTableOption(\"tooltipGenerationMode\", undefined); //deprecated\r\n\t\tthis.registerTableOption(\"tooltipDelay\", 300); \r\n\t\t\r\n\t\tthis.registerColumnOption(\"tooltip\");\r\n\t\tthis.registerColumnOption(\"headerTooltip\");\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.deprecationCheck();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\t\r\n\tdeprecationCheck(){\r\n\t\tif(typeof this.table.options.tooltipGenerationMode !== \"undefined\"){\r\n\t\t\tconsole.warn(\"Use of the tooltipGenerationMode option is now deprecated. This option is no longer needed as tooltips are always generated on hover now\");\r\n\t\t}\r\n\t}\t\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tif(column.definition.headerTooltip && !this.headerSubscriber){\r\n\t\t\tthis.headerSubscriber = true;\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-mousemove\", this.mousemoveCheck.bind(this, \"headerTooltip\"));\r\n\t\t\tthis.subscribe(\"column-mouseout\", this.mouseoutCheck.bind(this, \"headerTooltip\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition.tooltip && !this.tooltipSubscriber){\r\n\t\t\tthis.tooltipSubscriber = true;\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-mousemove\", this.mousemoveCheck.bind(this, \"tooltip\"));\r\n\t\t\tthis.subscribe(\"cell-mouseout\", this.mouseoutCheck.bind(this, \"tooltip\"));\r\n\t\t}\r\n\t}\r\n\t\r\n\tmousemoveCheck(action, e, component){\r\n\t\tvar tooltip = action === \"tooltip\" ? component.column.definition.tooltip : component.definition.headerTooltip;\r\n\t\t\r\n\t\tif(tooltip){\r\n\t\t\tthis.clearPopup();\r\n\t\t\tthis.timeout = setTimeout(this.loadTooltip.bind(this, e, component, tooltip), this.table.options.tooltipDelay);\r\n\t\t}\r\n\t}\r\n\r\n\tmouseoutCheck(action, e, component){\r\n\t\tif(!this.popupInstance){\r\n\t\t\tthis.clearPopup();\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearPopup(action, e, component){\r\n\t\tclearTimeout(this.timeout);\r\n\t\tthis.timeout = null;\r\n\t\t\r\n\t\tif(this.popupInstance){\r\n\t\t\tthis.popupInstance.hide();\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadTooltip(e, component, tooltip){\r\n\t\tvar contentsEl, renderedCallback, coords;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\trenderedCallback = callback;\r\n\t\t}\r\n\t\t\r\n\t\tif(typeof tooltip === \"function\"){\r\n\t\t\ttooltip = tooltip(e, component.getComponent(), onRendered);\r\n\t\t}\r\n\t\t\r\n\t\tif(tooltip instanceof HTMLElement){\r\n\t\t\tcontentsEl = tooltip;\r\n\t\t}else{\r\n\t\t\tcontentsEl = document.createElement(\"div\");\r\n\t\t\t\r\n\t\t\tif(tooltip === true){\r\n\t\t\t\tif(component instanceof Cell){\r\n\t\t\t\t\ttooltip = component.value;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(component.definition.field){\r\n\t\t\t\t\t\tthis.langBind(\"columns|\" + component.definition.field, (value) => {\r\n\t\t\t\t\t\t\tcontentsEl.innerHTML = tooltip = value || component.definition.title;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\ttooltip = component.definition.title;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcontentsEl.innerHTML = tooltip;\r\n\t\t}\r\n\t\t\r\n\t\tif(tooltip || tooltip === 0 || tooltip === \"0\" || tooltip === false){\r\n\t\t\tcontentsEl.classList.add(\"tabulator-tooltip\");\r\n\r\n\t\t\tcontentsEl.addEventListener(\"mousemove\", e => e.preventDefault())\r\n\t\t\t\r\n\t\t\tthis.popupInstance = this.popup(contentsEl);\r\n\t\t\t\r\n\t\t\tif(typeof renderedCallback === \"function\"){\r\n\t\t\t\tthis.popupInstance.renderCallback(renderedCallback);\r\n\t\t\t}\r\n\r\n\t\t\tcoords = this.popupInstance.containerEventCoords(e);\r\n\t\t\t\r\n\t\t\tthis.popupInstance.show(coords.x + 15, coords.y + 15).hideOnBlur(() => {\r\n\t\t\t\tthis.dispatchExternal(\"TooltipClosed\", component.getComponent());\r\n\t\t\t\tthis.popupInstance = null;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"TooltipOpened\", component.getComponent());\r\n\t\t}\r\n\t}\r\n}\r\n\r\nTooltip.moduleName = \"tooltip\";\r\n\r\nexport default Tooltip;\r\n","export default {\r\n\t//is integer\r\n\tinteger: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvalue = Number(value);\r\n\t\treturn typeof value === 'number' && isFinite(value) && Math.floor(value) === value;\r\n\t},\r\n\r\n\t//is float\r\n\tfloat: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvalue = Number(value);\r\n\t\treturn typeof value === 'number' && isFinite(value) && value % 1 !== 0;\r\n\t},\r\n\r\n\t//must be a number\r\n\tnumeric: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn !isNaN(value);\r\n\t},\r\n\r\n\t//must be a string\r\n\tstring: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn isNaN(value);\r\n\t},\r\n\r\n\t//maximum value\r\n\tmax: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn parseFloat(value) <= parameters;\r\n\t},\r\n\r\n\t//minimum value\r\n\tmin: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn parseFloat(value) >= parameters;\r\n\t},\r\n\r\n\t//starts with value\r\n\tstarts: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).toLowerCase().startsWith(String(parameters).toLowerCase());\r\n\t},\r\n\r\n\t//ends with value\r\n\tends: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).toLowerCase().endsWith(String(parameters).toLowerCase());\r\n\t},\r\n\r\n\r\n\t//minimum string length\r\n\tminLength: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).length >= parameters;\r\n\t},\r\n\r\n\t//maximum string length\r\n\tmaxLength: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).length <= parameters;\r\n\t},\r\n\r\n\t//in provided value list\r\n\tin: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif(typeof parameters == \"string\"){\r\n\t\t\tparameters = parameters.split(\"|\");\r\n\t\t}\r\n\r\n\t\treturn value === \"\" || parameters.indexOf(value) > -1;\r\n\t},\r\n\r\n\t//must match provided regex\r\n\tregex: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar reg = new RegExp(parameters);\r\n\r\n\t\treturn reg.test(value);\r\n\t},\r\n\r\n\t//value must be unique in this column\r\n\tunique: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar unique = true;\r\n\r\n\t\tvar cellData = cell.getData();\r\n\t\tvar column = cell.getColumn()._getSelf();\r\n\r\n\t\tthis.table.rowManager.rows.forEach(function(row){\r\n\t\t\tvar data = row.getData();\r\n\r\n\t\t\tif(data !== cellData){\r\n\t\t\t\tif(value == column.getFieldValue(data)){\r\n\t\t\t\t\tunique = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn unique;\r\n\t},\r\n\r\n\t//must have a value\r\n\trequired:function(cell, value, parameters){\r\n\t\treturn value !== \"\" && value !== null && typeof value !== \"undefined\";\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultValidators from './defaults/validators.js';\r\n\r\nclass Validate extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.invalidCells = [];\r\n\t\t\r\n\t\tthis.registerTableOption(\"validationMode\", \"blocking\");\r\n\t\t\r\n\t\tthis.registerColumnOption(\"validator\");\r\n\t\t\r\n\t\tthis.registerTableFunction(\"getInvalidCells\", this.getInvalidCells.bind(this));\r\n\t\tthis.registerTableFunction(\"clearCellValidation\", this.userClearCellValidation.bind(this));\r\n\t\tthis.registerTableFunction(\"validate\", this.userValidate.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"cell\", \"isValid\", this.cellIsValid.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"clearValidation\", this.clearValidation.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"validate\", this.cellValidate.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"column\", \"validate\", this.columnValidate.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"validate\", this.rowValidate.bind(this));\r\n\t}\r\n\t\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-delete\", this.clearValidation.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumnCheck.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"edit-success\", this.editValidate.bind(this));\r\n\t\tthis.subscribe(\"edit-editor-clear\", this.editorClear.bind(this));\r\n\t\tthis.subscribe(\"edit-edited-clear\", this.editedClear.bind(this));\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Event Handling //////////\r\n\t///////////////////////////////////\r\n\t\r\n\teditValidate(cell, value, previousValue){\r\n\t\tvar valid = this.table.options.validationMode !== \"manual\" ? this.validate(cell.column.modules.validate, cell, value) : true;\r\n\t\t\r\n\t\t// allow time for editor to make render changes then style cell\r\n\t\tif(valid !== true){\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tcell.getElement().classList.add(\"tabulator-validation-fail\");\r\n\t\t\t\tthis.dispatchExternal(\"validationFailed\", cell.getComponent(), value, valid);\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\treturn valid;\r\n\t}\r\n\t\r\n\teditorClear(cell, cancelled){\r\n\t\tif(cancelled){\r\n\t\t\tif(cell.column.modules.validate){\r\n\t\t\t\tthis.cellValidate(cell);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t}\r\n\t\r\n\teditedClear(cell){\r\n\t\tif(cell.modules.validate){\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t////////// Cell Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\tcellIsValid(cell){\r\n\t\treturn cell.modules.validate ? (cell.modules.validate.invalid || true) : true;\r\n\t}\r\n\t\r\n\tcellValidate(cell){\r\n\t\treturn this.validate(cell.column.modules.validate, cell, cell.getValue());\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Column Functions ////////\r\n\t///////////////////////////////////\r\n\t\r\n\tcolumnValidate(column){\r\n\t\tvar invalid = [];\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tif(this.cellValidate(cell) !== true){\r\n\t\t\t\tinvalid.push(cell.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn invalid.length ? invalid : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t////////// Row Functions //////////\r\n\t///////////////////////////////////\r\n\t\r\n\trowValidate(row){\r\n\t\tvar invalid = [];\r\n\t\t\r\n\t\trow.cells.forEach((cell) => {\r\n\t\t\tif(this.cellValidate(cell) !== true){\r\n\t\t\t\tinvalid.push(cell.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn invalid.length ? invalid : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\t\r\n\tuserClearCellValidation(cells){\r\n\t\tif(!cells){\r\n\t\t\tcells = this.getInvalidCells();\r\n\t\t}\r\n\t\t\r\n\t\tif(!Array.isArray(cells)){\r\n\t\t\tcells = [cells];\r\n\t\t}\r\n\t\t\r\n\t\tcells.forEach((cell) => {\r\n\t\t\tthis.clearValidation(cell._getSelf());\r\n\t\t});\r\n\t}\r\n\t\r\n\tuserValidate(cells){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\t//clear row data\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\trow = row.getComponent();\r\n\t\t\t\r\n\t\t\tvar valid = row.validate();\r\n\t\t\t\r\n\t\t\tif(valid !== true){\r\n\t\t\t\toutput = output.concat(valid);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn output.length ? output : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tinitializeColumnCheck(column){\r\n\t\tif(typeof column.definition.validator !== \"undefined\"){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//validate\r\n\tinitializeColumn(column){\r\n\t\tvar self = this,\r\n\t\tconfig = [],\r\n\t\tvalidator;\r\n\t\t\r\n\t\tif(column.definition.validator){\r\n\t\t\t\r\n\t\t\tif(Array.isArray(column.definition.validator)){\r\n\t\t\t\tcolumn.definition.validator.forEach((item) => {\r\n\t\t\t\t\tvalidator = self._extractValidator(item);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(validator){\r\n\t\t\t\t\t\tconfig.push(validator);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tvalidator = this._extractValidator(column.definition.validator);\r\n\t\t\t\t\r\n\t\t\t\tif(validator){\r\n\t\t\t\t\tconfig.push(validator);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.validate = config.length ? config : false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t_extractValidator(value){\r\n\t\tvar type, params, pos;\r\n\t\t\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\tpos = value.indexOf(':');\r\n\t\t\t\r\n\t\t\tif(pos > -1){\r\n\t\t\t\ttype = value.substring(0,pos);\r\n\t\t\t\tparams = value.substring(pos+1);\r\n\t\t\t}else{\r\n\t\t\t\ttype = value;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn this._buildValidator(type, params);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"function\":\r\n\t\t\treturn this._buildValidator(value);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"object\":\r\n\t\t\treturn this._buildValidator(value.type, value.parameters);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t\r\n\t_buildValidator(type, params){\r\n\t\t\r\n\t\tvar func = typeof type == \"function\" ? type : Validate.validators[type];\r\n\t\t\r\n\t\tif(!func){\r\n\t\t\tconsole.warn(\"Validator Setup Error - No matching validator found:\", type);\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn {\r\n\t\t\t\ttype:typeof type == \"function\" ? \"function\" : type,\r\n\t\t\t\tfunc:func,\r\n\t\t\t\tparams:params,\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n\t\r\n\tvalidate(validators, cell, value){\r\n\t\tvar self = this,\r\n\t\tfailedValidators = [],\r\n\t\tinvalidIndex = this.invalidCells.indexOf(cell);\r\n\t\t\r\n\t\tif(validators){\r\n\t\t\tvalidators.forEach((item) => {\r\n\t\t\t\tif(!item.func.call(self, cell.getComponent(), value, item.params)){\r\n\t\t\t\t\tfailedValidators.push({\r\n\t\t\t\t\t\ttype:item.type,\r\n\t\t\t\t\t\tparameters:item.params\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tif(!cell.modules.validate){\r\n\t\t\tcell.modules.validate = {};\r\n\t\t}\r\n\t\t\r\n\t\tif(!failedValidators.length){\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t\t\t\r\n\t\t\tif(invalidIndex > -1){\r\n\t\t\t\tthis.invalidCells.splice(invalidIndex, 1);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcell.modules.validate.invalid = failedValidators;\r\n\t\t\t\r\n\t\t\tif(this.table.options.validationMode !== \"manual\"){\r\n\t\t\t\tcell.getElement().classList.add(\"tabulator-validation-fail\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(invalidIndex == -1){\r\n\t\t\t\tthis.invalidCells.push(cell);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn failedValidators.length ? failedValidators : true;\r\n\t}\r\n\t\r\n\tgetInvalidCells(){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.invalidCells.forEach((cell) => {\r\n\t\t\toutput.push(cell.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tclearValidation(cell){\r\n\t\tvar invalidIndex;\r\n\t\t\r\n\t\tif(cell.modules.validate && cell.modules.validate.invalid){\r\n\t\t\t\r\n\t\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t\t\r\n\t\t\tinvalidIndex = this.invalidCells.indexOf(cell);\r\n\t\t\t\r\n\t\t\tif(invalidIndex > -1){\r\n\t\t\t\tthis.invalidCells.splice(invalidIndex, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nValidate.moduleName = \"validate\";\r\n\r\n//load defaults\r\nValidate.validators = defaultValidators;\r\n\r\nexport default Validate;\r\n","//tabulator with all modules installed\r\nimport {default as Tabulator} from './Tabulator.js';\r\nimport * as modules from '../core/modules/optional.js';\r\nimport ModuleBinder from './tools/ModuleBinder.js';\r\n\r\nclass TabulatorFull extends Tabulator {};\r\n\r\n//bind modules and static functionality\r\nnew ModuleBinder(TabulatorFull, modules);\r\n\r\nexport default TabulatorFull;"],"names":["debugEventsExternal","debugEventsInternal","debugInvalidOptions","debugInitialization","height","minHeight","maxHeight","columnHeaderVertAlign","popupContainer","columns","columnDefaults","data","autoColumns","autoColumnsDefinitions","nestedFieldSeparator","footerElement","index","textDirection","addRowPos","headerVisible","renderVertical","renderHorizontal","renderVerticalBuffer","scrollToRowPosition","scrollToRowIfVisible","scrollToColumnPosition","scrollToColumnIfVisible","rowFormatter","rowFormatterPrint","rowFormatterClipboard","rowFormatterHtmlOutput","rowHeight","placeholder","dataLoader","dataLoaderLoading","dataLoaderError","dataLoaderErrorTimeout","dataSendParams","dataReceiveParams","CoreFeature","table","silent","columnsChanged","load","undefined","modules","localize","getText","arguments","bind","getLocale","comms","getConnections","send","layout","getMode","eventBus","subscribe","unsubscribe","key","subscribed","subscriptionChange","dispatch","chain","confirm","externalEvents","options","value","module","ColumnComponent","column","_column","type","Proxy","get","target","name","receiver","componentFunctionBinder","handle","getElement","getDefinition","getField","getTitleDownload","cells","forEach","cell","push","getComponent","visible","isGroup","show","hide","output","length","parent","Column","columnManager","scrollToColumn","to","after","toColumn","findColumn","moveColumn","console","warn","nextCol","nextColumn","prevCol","prevColumn","updates","updateDefinition","getWidth","width","result","reinitializeWidth","setWidth","renderer","rerenderColumns","CellComponent","_cell","getValue","getOldValue","initialValue","row","getData","mutate","setValue","setValueActual","checkHeight","Cell","element","oldValue","minWidth","component","loaded","build","generateElement","_configureCell","getFieldValue","document","createElement","className","setAttribute","field","vertAligns","top","bottom","middle","hozAligns","left","right","center","style","textAlign","hozAlign","vertAlign","display","alignItems","justifyContent","definition","cssClass","classNames","split","classList","add","val","innerHTML","Node","firstChild","removeChild","appendChild","containerOnly","layoutElement","force","changed","setValueProcessData","cellRendered","cellEdited","call","dispatchExternal","subscribedExternal","rowManager","setFieldValue","_generateContents","widthStyled","offsetWidth","minWidthStyled","maxWidth","maxWidthStyled","reinitializeHeight","heightStyled","offsetHeight","redrawBlock","parentNode","deleteCell","calcs","getCellIndex","def","contentElement","titleHolderElement","titleElement","groupElement","createGroupElement","fieldStructure","titleDownload","titleFormatterRendered","mapDefinitions","setField","maxInitialWidth","widthFixed","i","newCol","attachColumn","checkColumnVisibility","registerColumnField","_initialize","bindModuleColumns","el","defaults","optionsList","generate","defaultOptionList","Object","keys","indexOf","title","_getNestedData","_getFlatData","_setNestedData","_setFlatData","registerColumnPosition","reRegisterPosition","headerVertical","_bindEvents","_buildColumnHeaderContent","_buildGroupHeader","_buildColumnHeader","dblTap","tapHold","tap","headerClick","addEventListener","e","headerDblClick","headerContext","headerTap","passive","headerDblTap","clearTimeout","setTimeout","headerTapHold","classeNames","setMinWidth","parseInt","setMaxWidth","headerHozAlign","_buildColumnHeaderTitle","editableTitle","stopPropagation","focus","langBind","text","_formatColumnHeaderTitle","contents","dataObj","structure","columnRendered","alignment","parentHeight","getGroupElement","clientHeight","getHeadersElement","paddingTop","verticalAlign","clearVerticalAlign","formatter","rowNumColumn","getFirstColumn","getLastColumn","getTopColumn","updateBranches","colDefs","responsiveToggle","verticalAlignHeaders","matchChildWidths","childWidth","child","splice","setWidthActual","isNaN","Math","floor","clientWidth","max","min","rows","heightInitialized","offsetParent","clearCellHeight","calcHeight","setCellHeight","ceil","getBoundingClientRect","Promise","resolve","reject","cellCount","deregisterColumn","findColumnIndex","_nextVisibleColumn","getColumnByIndex","_prevVisibleColumn","fitToData","clearWidth","setTo","assign","addColumn","then","error","defaultOptions","Helpers","box","window","pageYOffset","documentElement","clientTop","pageXOffset","clientLeft","obj","clone","list","objectProto","__proto__","arrayProto","Array","isArray","subject","match","copy","findIndex","item","unshift","deepClone","OptionsList","msgType","registeredDefaults","option","userOptions","hasOwnProperty","Renderer","elementVertical","elementHorizontal","tableElement","verticalFillMode","callback","update","blockRedraw","dir","includingBuffer","getDisplayRows","rowEl","remove","clearRows","clearColumns","renderRows","renderColumns","rerenderRows","position","ifVisible","rowIndex","offset","elVisible","elOffset","scrollToRowNearestTop","scrollToRow","scrollHeight","scrollTop","offsetTop","BaiscHorizontal","VirtualDomHorizontal","leftCol","rightCol","scrollLeft","vDomScrollPosLeft","vDomScrollPosRight","vDomPadLeft","vDomPadRight","fitDataColAvg","windowBuffer","visibleRows","initialized","isFitData","compatibilityCheck","layoutCheck","vertScrollListen","frozen","ok","find","col","startsWith","clearVisRowCache","dataChange","scroll","buffer","columnsByIndex","old","cols","colPos","clear","calcWindowBuffer","config","leftPos","rightPos","fitDataCheck","vdomHoz","paddingLeft","paddingRight","reinitChanged","reinitializeRows","initializeRow","reinitializeRow","change","collsWidth","colEnd","generateCells","layoutRefresh","getVisibleRows","diff","abs","addColRight","removeColLeft","addColLeft","removeColRight","start","end","changes","getCell","fitDataColActualWidthCheck","prepend","ex","message","newWidth","widthDiff","colPositionAdjust","ColumnManager","blockHozScrollEvent","headersElement","columnsByField","defaultColumnOptions","initializeRenderer","createHeadersElement","createHeaderElement","insertBefore","scrollHorizontal","renderClass","renderers","RendererVirtualDomHorizontal","RendererBasicHorizontal","initialize","hozAdjust","scrollWidth","marginLeft","scrollColumns","definitions","sorter","setColumns","_addColumn","_reIndexColumns","redraw","before","nextToColumn","colEl","topColumn","parentIndex","nextEl","nextSibling","getHeight","adjustTableSize","_getSelf","HTMLElement","root","matches","fieldRoot","active","structured","from","moveColumnActual","reinitialize","_moveColumnInArray","getComponents","updateRows","fromIndex","toIndex","concat","adjust","offsetLeft","generateCell","totalWidth","fixedWidth","colWidth","layoutMode","resetScroll","footerManager","RowComponent","_row","transform","getCells","getRowPosition","moveToRow","updateData","normalizeHeight","nextRow","prevRow","Row","manualHeight","outerHeight","created","setData","create","deleteCells","renderRowCells","rerenderRowCells","children","resizableRows","setHeight","clearHeight","updatedData","tempData","newRowData","JSON","parse","attrname","getColumnsByFieldRoot","findCell","nextDisplayRow","prevDisplayRow","toRow","findRow","moveRowActual","refreshActiveData","deleteActual","getRowIndex","detatchModules","deleteRow","group","BaiscVertical","visibility","onlyGroupHeaders","styleRow","rowTop","VirtualDomVertical","vDomRowHeight","vDomTop","vDomBottom","vDomScrollPosTop","vDomScrollPosBottom","vDomTopPad","vDomBottomPad","vDomMaxRenderChain","vDomWindowBuffer","vDomWindowMinTotalRows","vDomWindowMinMarginRows","vDomTopNewRows","vDomBottomNewRows","paddingBottom","_virtualRenderFill","topRow","topOffset","deinitializeHeight","topDiff","bottomDiff","margin","_addTopRow","vDomScrollHeight","_removeBottomRow","_addBottomRow","_removeTopRow","topEdge","bottomEdge","topFound","bottomRow","slice","forceMove","holder","topPad","rowsHeight","heightOccupied","topPadHeight","rowsCount","containerHeight","fillableSpace","addedRows","paddingAdjust","_quickNormalizeRowHeight","removableRows","RowManager","createHolderElement","createTableElement","heightFixer","placeholderContents","firstRender","renderMode","fixedHeight","activeRowsPipeline","activeRows","activeRowsCount","displayRows","displayRowsCount","redrawBlockRestoreConfig","redrawBlockRenderInPosition","dataPipeline","displayPipeline","initializePlaceholder","leftDir","topDir","_positionPlaceholder","scrollRows","renderInPosition","pagination","_setDataActual","reRenderInPosition","generateColumnsFromRowData","_wipeElements","wipe","allIndex","activeIndex","setActiveRows","displayRowIterator","displayIndex","regenerateRowNumbers","_showPlaceholder","pos","addRowActual","findAddRowPos","reverse","addRow","_clearPlaceholder","chainResult","moveRowInArray","findRowIndex","rowOnly","getDisplayRowIndex","getRows","handler","priority","sort","a","b","skipStage","stage","cascadeOrder","refreshPipelines","renderTable","layoutColumnsOnNewData","resetDisplayRows","setDisplayRows","viewable","RendererVirtualDomVertical","RendererBasicVertical","_clearTable","renderEmptyScroll","initialHeight","otherHeight","external","resize","tableWidth","browser","event","createEvent","initEvent","dispatchEvent","Event","FooterManager","containerElement","createContainerElement","initializeElement","querySelector","activate","deactivate","InteractionManager","abortClasses","previousTargets","listeners","componentMap","pseudoTrackers","subscriber","pseudoTracking","buildListenerMap","bindSubscriptionWatchers","listenerMap","listener","components","pseudoMouseEnter","pseudoMouseLeave","leaveList","linkedKeys","filter","links","includes","values","comp","subscriptionChanged","clearWatchers","added","bindPseudoEvents","updateEventListeners","track","removeEventListener","path","composedPath","targets","findTargets","bindComponents","triggerEvents","abort","elTargets","targetMatches","previousTarget","closest","ComponentFunctionBinder","bindings","funcName","DataLoader","requestOrder","loading","params","replace","requestNo","alertLoader","mapParams","response","objectInvert","rowData","clearAlert","alertError","map","shouldLoad","alertManager","alert","langText","ExternalEventBus","debug","events","subscriptionNotifiers","_debugDispatch","_dispatch","_notifiySubscriptionChange","notifiers","args","shift","callResult","apply","log","InternalEventBus","_debugChain","_chain","_debugConfirm","_confirm","fallback","confirmed","TableRegistry","tables","query","results","querySelectorAll","matchElement","Tabulator","lookupTable","Popup","container","_lookupContainer","reversedX","childPopup","blurable","blurCallback","renderedCallback","blurEvent","escEvent","_escapeCheck","_checkContainerIsParent","body","touch","MouseEvent","x","touches","pageX","y","pageY","parentOffset","containerOffset","origin","parentEl","coords","elementPositionCoords","containerEventCoords","_fitToScreen","keyCode","Module","_handler","register","func","initGuard","registerDataPipelineHandler","registerDisplayPipelineHandler","append","menuEl","menuContainer","content","reinitializeColumnWidths","responsiveLayout","modExists","colsWidth","gap","lastCol","responsive","flexWidth","flexGrowUnits","flexColWidth","flexColumns","fixedShrinkColumns","flexShrinkUnits","overflowWidth","gapFill","calcWidth","scaleColumns","freeSpace","shrinkCols","oversizeCols","oversizeSpace","remainingSpace","nextColWidth","remainingFlexGrowUnits","changeUnits","undersizeCols","calcGrow","widthGrow","calcShrink","widthShrink","fitData","fitDataFill","fitDataGeneral","fitDataTable","fitDataStretch","fitColumns","Layout","mode","registerTableOption","registerColumnOption","modes","moduleName","defaultModes","Localize","locale","lang","langList","langs","headerFilterPlaceholder","setHeaderFilterPlaceholder","installLang","setLocale","registerTableFunction","getLang","headerFilters","_setLangProp","desiredLocale","traverseLang","trans","prop","navigator","language","toLowerCase","prefix","_executeBindings","pathArray","_getLangElement","level","rootPath","binding","defaultLangs","Comms","receive","selectors","connections","connection","con","action","tableComms","commsReceived","ModuleBinder","tabulator","bindStaticFuctionality","bindModules","coreModules","moduleBindings","extendModule","property","source","registerModule","mod","registerModuleBinding","findTable","prototype","orderedStartMods","orderedEndMods","unOrderedMods","moduleCore","modulesCore","moduleInitOrder","modulesRegular","core","mods","Alert","_createAlertElement","msgElement","_createMsgElement","_typeClass","interactionMonitor","browserSlow","browserMobile","rtl","originalElement","initializeCoreSystems","_create","_clearObjectPointers","_mapDeprecatedFunctionality","InteractionMonitor","getSelection","empty","removeAllRanges","selection","_rtlCheck","_buildElement","_initializeTable","_loadInitialData","getComputedStyle","direction","reactiveData","newElement","tagName","attributes","replaceChild","_detectBrowser","deregister","ua","userAgent","vendor","opera","test","msg","stack","line","Error","trim","restoreRedraw","blockActiveLoad","clearData","getDataCount","responses","addRows","newRows","getRowFromPosition","foundRows","fromRow","getDefinitionTree","fromColumn","plugin","required","Accessor","allowedTypes","initializeColumn","transformRow","charAt","toUpperCase","accessor","lookupAccessor","accessors","rowComponent","traverse","colCompnent","defautlAccessors","method","generateParamsList","serializeParams","encoded","encodeURIComponent","join","url","contentType","urlGenerator","ajaxContentType","contentTypeFormatters","headers","Accept","location","credentials","fetch","json","status","statusText","stringify","form","FormData","Ajax","loaderPromise","ajaxRequestFunc","defaultLoaderPromise","ajaxURLGenerator","defaultURLGenerator","ajaxURL","setUrl","setDefaultConfig","ajaxConfig","getUrl","requestDataCheck","requestParams","requestData","ajaxParams","previousData","generateConfig","sendRequest","defaultConfig","ajaxRequesting","ajaxResponse","defaultContentTypeFormatters","updateOrAddData","insert","addData","clipboard","headerFindSuccess","columnMap","Clipboard","pasteParser","pasteAction","customSelection","rowRange","blocked","clipboardCopyRowRange","plain","html","preventDefault","clipboardCopyFormatter","generateExportList","clipboardCopyConfig","clipboardCopyStyled","genereateHTMLTable","generatePlainContent","clipboardData","originalEvent","reset","paste","setPasteParser","clipboardPasteParser","setPasteAction","clipboardPasteAction","getKey","range","internal","sel","textRange","createRange","selectNodeContents","toString","addRange","createTextRange","moveToElementText","select","execCommand","pasteActions","parser","pasteParsers","checkPaseOrigin","getPasteData","mutateData","mutator","valid","edit","currentCell","defaultPasteActions","defaultPasteParsers","CalcComponent","calcParams","precision","reduce","sum","Number","toFixed","parseFloat","String","ColumnCalcs","topCalcs","botCalcs","genColumn","topElement","botElement","botRow","topInitialized","botInitialized","cellValueChanged","initializeColumnCheck","rowsUpdated","recalcActiveRows","recalcActiveRowsRefresh","tableRedraw","getResults","userRecalc","recalc","groupBy","recalcRowGroup","dataTreeStartExpanded","dataTree","recalcAll","topCalc","bottomCalc","columnCalcs","topCalcParams","botCalcParams","bottomCalcParams","calculations","initializeTopRow","botCalc","initializeBottomRow","footerRemove","footerPrepend","rowsToData","generateRow","frozenColumns","recalcGroup","groupRows","getRowGroup","groups","getChildGroups","generateRowData","dataTreeChildColumnCalcs","open","getFilteredTreeChildren","disable","enable","format","getFormatter","paramKey","getGroups","getGroupResults","groupObj","subGroups","getSubGroups","subGroupResults","subgroup","defaultCalculations","DataTree","indent","collapseEl","expandEl","branchEl","elementField","startOpen","registerComponentFunction","collapseRow","expandRow","toggleRow","getTreeParent","getRowChildren","addTreeChildRow","isRowExpanded","dummyEl","dataTreeChildField","dataTreeChildIndent","dataTreeBranchElement","dataTreeCollapseElement","tabIndex","dataTreeExpandElement","layoutRow","rowDelete","rowDataChanged","columnMoving","initializeElementField","tableRedrawing","registerDisplayHandler","reinitializeRowChildren","firstCol","getFirstVisibleColumn","dataTreeElementColumn","getTreeChildren","redrawNeeded","refreshData","childArray","controlEl","generateControlElement","cloneNode","marginRight","getPropertyValue","oldControl","getChildren","allChildren","generateChildren","dataTreeFilter","dataTreeSort","subChildren","sub","childData","childRow","getTreeParentRoot","childIndex","findChildIndex","recurse","setFileContents","delimiter","fileContents","depth","bom","header","autoTableParams","rowGroupStyles","fontStyle","fontSize","cellPadding","fillColor","rowCalcStyles","jsPDFParams","jsPDF","orientation","unit","parseRow","styles","colSpan","rowSpan","doc","jspdf","autoTable","didDrawPage","head","documentProcessing","self","sheetName","workbook","XLSX","utils","book_new","tableFeatures","SheetNames","Sheets","generateSheet","merges","worksheet","s","c","r","j","Date","sheet_add_aoa","encode_range","sheetOnly","sheets","sheet","commsSend","intercept","s2ab","buf","ArrayBuffer","view","Uint8Array","charCodeAt","write","bookType","bookSST","csv","jsonLines","pdf","xlsx","Download","blob","download","downloadToTab","filename","interceptCallback","downloadFunc","buildLink","mime","triggerDownload","downloaders","downloadConfig","downloadRowRange","groupHeader","groupHeaderDownload","_group","getRowCount","newTab","Blob","downloadReady","URL","createObjectURL","msSaveOrOpenBlob","click","defaultDownloaders","maskInput","mask","maskLetter","maskLetterChar","maskNumber","maskNumberChar","maskWildcard","maskWildcardChar","fillSymbols","symbol","char","maskAutoFill","onRendered","success","cancel","editorParams","cellValue","input","search","padding","boxSizing","elementAttributes","getAttribute","preventScroll","selectContents","onChange","vertNav","verticalNavigation","count","whiteSpace","getRow","heightNow","selectionStart","stopImmediatePropagation","step","blurFunc","Edit","editor","_initializeParams","displayItems","currentItems","focusedItem","_createInputElement","listEl","_createListElement","initialValues","isFilter","filterTimeout","filtered","typing","popup","listIteration","actions","_deprecationCheck","_initializeValue","_onRendered","listItemFormatter","sortValuesList","searchFunc","searchingPlaceholder","defaultValue","multiselect","headerFilterInitialListGen","cellEl","clickStop","_preventBlur","_inputKeyDown","attribs","clearable","autocomplete","cursor","caretColor","_bindInputEvents","valueKeys","valueCheck","placeholderLoading","placeholderEmpty","filterDelay","emptyValue","freetext","filterFunc","filterRemote","allowEmpty","listOnEmpty","valuesLookup","valuesURL","_inputFocus","_inputClick","_inputBlur","_inputSearch","_inputKeyUp","rebuildOptionsList","_filterList","_clearChoices","_keyUp","_keyDown","_keySide","_keyEnter","_keyEsc","_keyHomeEnd","_keySelectLetter","_keyAutoCompLetter","_focusItem","_chooseItem","_cancel","_scrollToValue","_filter","character","fromCharCode","filterTerm","label","scrollIntoView","behavior","block","inline","_generateOptions","_sortOptions","_buildList","_showList","isInteger","_filterOptions","itteration","_ajaxRequest","_uniqueColumnValues","valuesLookupField","_addPlaceholder","responseValues","_parseList","_clearList","term","urlBuilder","getColumnByField","getColumn","inputValues","entries","_parseListItem","_parseListGroup","itemParams","selected","original","_defaultSortFunction","_sortGroup","as","bs","a1","b1","L","rx","rd","emptyAlign","isFinite","_defaultFilterFunc","_filterItem","_buildItem","itemFormatter","_groupClick","_itemClick","_styleItem","startVis","isVisible","_setListWidth","hideOnBlur","_resolveValue","blur","List","maxStars","getElementsByTagName","size","stars","starsHolder","star","createElementNS","starChange","buildStar","starHolder","nextStar","changeValue","overflow","textOverflow","percent","bar","mouseDrag","mouseDragWidth","updateValue","calcVal","round","backgroundColor","screenX","tristate","indetermValue","indeterminateValue","indetermState","trueValueSet","falseValueSet","marginTop","indeterminate","checked","trueValue","checkedValue","falseValue","textarea","number","progress","tickCross","mouseClick","recursionBlock","invalidEdit","editedCells","editors","getEditedCells","clearCellEdited","navigatePrev","navigateNext","navigateLeft","navigateRight","navigateUp","navigateDown","cellisEdited","clearEdited","editCell","cellCancelEdit","bindEditor","columnDeleteCheck","rowDeleteCheck","cancelEdit","keybindingNavigateNext","newRow","edited","nextCell","findNextEditableCell","getIndex","findPrevEditableCell","allowEdit","check","prevCell","editable","clearEditor","variableHeight","cellEditCancelled","contains","button","forceEdit","focusCellNoEvent","getRenderMode","leftEdge","rightEdge","leftMargin","rightMargin","rendered","cellEditor","validationMode","focusScrollAdjust","cellClick","cellEditing","editIndex","defaultEditors","ExportRow","ExportColumn","Export","cloneTableStyle","colVisProp","getHtml","columnHeaders","headersToExportRows","generateColumnGroupHeaders","bodyToExportRows","rowLookup","genereateTableElement","selectRow","selectedRows","columnGroups","colData","processColumnGroup","maxDepth","groupData","subGroup","subGroupData","columnVisCheck","headerDepth","exportRows","parseColumnGroup","rowGroups","exportCols","headerEl","bodyEl","lookupTableStyles","setup","treeElementField","mapElementStyles","genereateHeaderElement","genereateGroupElement","genereateCalcElement","genereateRowElement","evenRow","oddRow","calcRow","firstRow","firstGroup","getElementsByClassName","styleCells","firstCell","lastCell","generator","cellWrapper","formatCells","formatExportValue","align","htmlOutputConfig","props","lookup","fromStyle","filterVal","rowVal","filterParams","RegExp","keywords","separator","keyword","matchAll","endsWith","Filter","filterList","headerFilterColumns","prevHeaderFilterChangeCheck","tableInitialized","searchRows","searchData","userSetFilter","userRefreshFilter","userAddFilter","getFilters","userSetHeaderFilterFocus","userGetHeaderFilterValue","userSetHeaderFilterValue","getHeaderFilters","userRemoveFilter","userClearFilter","userClearHeaderFilter","setHeaderFilterFocus","reloadHeaderFilter","getHeaderFilterValue","setHeaderFilterValue","initializeColumnHeaderFilter","hideHeaderFilterElements","showHeaderFilterElements","tableBuilt","filterMode","remoteFilterParams","registerDataHandler","initialFilter","setFilter","initialHeaderFilter","refreshFilter","addFilter","removeFilter","all","clearFilter","clearHeaderFilter","headerFilter","setHeaderFilterColumnPlaceholder","filterType","tagType","attrType","filterChangeCheck","prevSuccess","emptyFunc","headerFilterFunc","filters","headerFilterFuncParams","fieldVal","colVal","trackChanges","generateHeaderFilterElement","filterElement","editorElement","typingTimer","searchTrigger","headerElement","headerFilterEmptyCheck","headerFilterParams","headerPos","headerFilterLiveFilterDelay","hasAttribute","headerFilterLiveFilter","reloadData","findFilter","findSubFilters","ajax","filtersToArray","searchType","filterRecurse","rowList","activeRowComponents","filterRow","subFilter","defaultFilters","formatterParams","emptyToSpace","sanitizeHTML","floatVal","sign","integer","decimal","rgx","decimalSym","thousandSym","thousand","negativeSign","symbolAfter","urlPrefix","labelTraverse","labelField","urlField","src","urlSuffix","truthy","allowTruthy","tick","tickElement","cross","crossElement","DT","DateTime","luxon","inputFormat","outputFormat","invalid","invalidPlaceholder","newDatetime","isDateTime","fromISO","fromFormat","isValid","timezone","setZone","toFormat","suffix","humanize","date","now","toHuman","starActive","starInactive","colors","color","percentValue","legendAlign","legend","legendColor","barEl","barContainer","legendEl","holderEl","toggleList","isOpen","checkbox","selectableRangeMode","toggleSelect","handleComplexRowClick","isSelected","registerRowSelectCheckbox","deselectRow","registerHeaderSelectCheckbox","plaintext","money","link","image","datetime","datetimediff","traffic","buttonTick","buttonCross","rownum","responsiveCollapse","rowSelection","Format","formatValue","formatHeader","lookupFormatter","formatterPrint","print","formatterClipboard","formatterHtmlOutput","htmlOutput","formatters","mockCell","titleFormatter","titleFormatterParams","entityMap","defaultFormatters","FrozenColumns","leftColumns","rightColumns","rightPadding","initializationMode","layoutCell","reinitializeColumns","blockLayout","unblockLayout","edge","frozenCheck","calcMargins","layoutColumnPosition","layoutCalcRows","_calcSpace","layoutGroupCalcs","groupList","allCells","leftParents","marginValue","getColGroupParentElement","otherRows","deinitialize","getTableElement","FrozenRows","freezeRow","unfreezeRow","isRowFrozen","detachRow","styleRows","GroupComponent","groupManager","toggleVisibility","Group","oldGroup","hasSubGroups","groupIDLookups","_addRowToGroup","_addRow","elementContents","arrowElement","createElements","addBindings","createValueGroups","arrow","movableRows","moveRow","initializeGroupHeader","allowedValues","_createGroup","toggleElement","groupToggleElement","groupID","groupKey","headerGenerator","conformRowData","generateGroupHeaderContents","updateGroupRows","scrollHeader","groupValues","removeGroup","noCalc","_visSet","getHeadersAndRows","hasTopCalcs","detachElement","generateTopRow","hasBottomCalcs","generateBottomRow","groupClosedShowCalcs","getDisplayIndex","checkClassicModeGroupHeaderWidth","prev","compoment","getPath","childNodes","GroupRows","displayHandler","setGroupBy","setGroupValues","setGroupStartOpen","setGroupHeader","userGetGroups","userGetGroupedData","rowGetGroup","groupUpdateOnCellEdit","cellUpdated","reassignRowToGroup","configureGroupSetup","rowDeleting","scrollHeaders","rowMoving","rowAddingIndex","rowSample","virtualRenderFill","groupStartOpen","langValue","items","removeCalcs","getRealColumns","lookupFunc","prevValue","assignRowToGroup","getGroupedData","toGroup","fromGroup","removeRow","insertRow","generateGroups","groupComponents","groupListData","rowCount","headerContent","pullGroupListData","oldGroups","createGroup","assignRowToExistingGroup","newGroupNeeded","oldRowGroup","oldGroupPath","newGroupPath","getExpectedPath","samePath","every","groupPath","groupId","cellEdit","rowAdd","_rebindRow","rowMove","posFrom","newValue","posTo","History","history","clearComponentHistory","rowDeleted","rowAdded","rowMoved","undo","redo","getHistoryUndoSize","getHistoryRedoSize","getGroup","undoers","redoers","oldRow","defaultUndoers","defaultRedoers","HtmlTableImport","fieldIndex","hasIndex","tableElementCheck","parseTable","_extractOptions","_extractHeaders","_generateBlankHeaders","optionsArr","attrib","_attribValue","exists","_findCol","textContent","csvImporter","inQuote","nextChar","Import","importFromFile","importFormat","loadDataCheck","loadData","importData","lookupImporter","structureData","err","importer","importers","extension","pickFile","extensions","accept","file","files","reader","FileReader","importReader","readAsArrayBuffer","readAsBinaryString","readAsDataURL","readAsText","onload","onerror","parsedData","structureArrayToObject","structureArrayToColumns","getColumns","defaultImporters","Interaction","eventMap","rowClick","rowDblClick","rowContext","rowMouseEnter","rowMouseLeave","rowMouseOver","rowMouseOut","rowMouseMove","rowTap","rowDblTap","rowTapHold","cellDblClick","cellContext","cellMouseEnter","cellMouseLeave","cellMouseOver","cellMouseOut","cellMouseMove","cellTap","cellDblTap","cellTapHold","headerMouseEnter","headerMouseLeave","headerMouseOver","headerMouseOut","headerMouseMove","groupClick","groupDblClick","groupContext","groupMouseEnter","groupMouseLeave","groupMouseOver","groupMouseOut","groupMouseMove","groupTap","groupDblTap","groupTapHold","subscribers","touchSubscribers","columnSubscribers","touchWatchers","tapDbl","initializeExternalEvents","cellContentsSelectionFixer","selectNode","subscriptionChangeExternal","subscribeTouchEvents","unsubscribeTouchEvents","handleTouch","notouch","watchers","componentObj","navPrev","navNext","navUp","navDown","scrollPageUp","scrollPageDown","scrollToStart","scrollToEnd","copyToClipboard","keyBlock","newPos","scrollMax","navLeft","navRight","Keybindings","watchKeys","pressedKeys","keyupBinding","keydownBinding","keybindings","mergedBindings","mapBindings","bindEvents","clearBindings","bindingList","mapBinding","symbolsList","ctrl","meta","symbols","code","checkBinding","ctrlKey","shiftKey","metaKey","defaultBindings","defaultActions","Menu","nestedMenuBlock","currentComponent","rootPopup","deprecationCheck","initializeRowWatchers","initializeGroupWatchers","rowContextMenu","loadMenuEvent","on","rowClickMenu","groupContextMenu","groupClickMenu","headerContextMenu","loadMenuTableColumnEvent","headerClickMenu","headerMenu","initializeColumnHeaderMenu","contextMenu","loadMenuTableCellEvent","clickMenu","icon","headerMenuIcon","headerMenuEl","menu","loadMenu","parentPopup","itemEl","disabled","MoveColumns","placeholderElement","createPlaceholderElement","hoverElement","checkTimeout","checkPeriod","moving","toCol","toColAfter","startX","autoScrollMargin","autoScrollStep","autoScrollTimeout","touchMove","moveHover","endMove","movableColumns","mousemove","which","startMove","bindTouchEvents","startXMove","prevColWidth","nextColWidthLast","prevColWidthLast","moveToCol","_bindMouseMove","movingCells","_unbindMouseMove","columnHolder","xPos","scrollPos","MoveRows","toRowAfter","hasHandle","startY","tableRowDropEvent","connectionSelectorsTables","connectionSelectorsElements","connectionElements","connectedTable","connectedRow","movableRowsConnectedTables","movableRowsConnectedElements","initializeCell","mouseup","tableRowDrop","previousSibling","rowHandle","startYMove","nextRowHeight","prevRowHeight","nextRowHeightLast","prevRowHeightLast","setStartPosition","connectToTables","pointerEvents","disconnectFromTables","moveHoverConnections","moveHoverTable","rowHolder","yPos","connectionTables","commsConnections","dropEvent","elementRowDrop","tabulatorElementDropEvent","sender","movableRowsSender","senders","movableRowsReceiver","receivers","connect","disconnect","dropComplete","fromTable","toTable","Mutator","enabled","transformCell","mutateLink","lookupMutator","mutators","mutatorEdit","linkCell","defaultMutators","pageSize","currentRow","currentPage","totalRows","totalPages","showingEl","valueEl","ofEl","totalEl","rowsEl","pages","Page","progressiveLoad","pageCounterElement","pageCounter","page","remoteRowCountEstimate","initialLoad","dataChanging","pageSizes","setMaxPage","setPage","userSetPageToRow","userSetPageSize","getPageSize","previousPage","nextPage","getPage","getPageMax","setPageToRow","initialLoadComplete","calculatePageSizes","footerRedraw","paginationAddRow","rowAddingPosition","paginationMode","remotePageParams","_parseRemoteData","restOnRenderBefore","initializePageCounter","initializePaginator","initializeProgressive","scrollVertical","dispRows","testElRow","testElCell","paginationSize","generatePageSizeSelectList","setPageSize","progressiveLoadScrollMargin","pagesElement","firstBut","prevBut","nextBut","lastBut","paginationSizeSelector","pageSizeSelect","counter","paginationCounter","pageCounters","hidden","pageSelectLabel","paginationCounterHolder","paginationElement","paginationCounterElement","footerAppend","paginationInitialPage","paginationButtonCount","trigger","leftSize","rightSize","_generatePageButton","actualRowPageSize","actualStartRow","actualRows","setMaxRows","_setPageButtons","_setPageCounter","last_page","last_row","progressiveLoadDelay","footer","defaultPageCounters","local","id","localStorage","getItem","cookie","cookiePos","setItem","expireDate","setDate","getDate","toUTCString","Persistence","defWatcherBlock","readFunc","writeFunc","testKey","removeItem","persistence","persistenceMode","persistenceID","retreivedData","localStorageTest","persistenceReaderFunc","readers","persistenceWriterFunc","writers","retreiveData","save","eventSave","getColumnLayout","setColumnLayout","sorters","initialSort","parseColumns","mergeDefinition","getOwnPropertyDescriptor","defineProperty","set","current","oldCols","newCols","_findColumn","validateSorters","getSort","getGroupConfig","getPageConfig","excludedKeys","defStore","colDef","defaultReaders","defaultWriters","rowContextPopup","loadPopupEvent","rowClickPopup","groupContextPopup","groupClickPopup","headerContextPopup","loadPopupTableColumnEvent","headerClickPopup","headerPopup","initializeColumnHeaderPopup","contextPopup","loadPopupTableCellEvent","clickPopup","headerPopupIcon","headerPopupEl","loadPopup","contentsEl","renderCallback","Print","manualBlock","printAsHtml","replaceTable","cleanup","printFullscreen","genereateTable","printConfig","printStyled","printRowRange","scrollX","scrollY","footerEl","tableEl","footerContent","printHeader","printFooter","printFormatter","scrollTo","ReactiveData","origFuncs","currentVersion","unblock","watchRow","watchData","unwatchData","version","enumerable","configurable","arg","getRowFromDataObject","pop","startRow","oldRows","writable","watchKey","watchTreeChildren","childField","rebuildTree","ResizeColumns","startColumn","startWidth","latestX","initialNextColumn","layoutColumnHeader","layoutCellHandles","deInitializeComponent","resizeHandle","columnLayoutUpdated","deInitializeColumn","columnWidthUpdated","resizable","initializeEventWatchers","reinitializeColumn","frozenOffset","handleEl","nearestColumn","_checkResizability","handleDown","_mouseDown","oldWidth","parentElement","mouseMove","startDiff","moveDiff","blockedBefore","blockedAfter","resizableColumnFit","checkCellHeights","mouseUp","ResizeRows","startHeight","prevHandle","prevHandleDown","screenY","ResizeTable","observer","containerObserver","tableHeight","containerWidth","autoResize","tableStyle","ResizeObserver","entry","nodeHeight","contentRect","nodeWidth","observe","tableResized","unobserve","ResponsiveLayout","hiddenColumns","collapseFormatter","collapseStartOpen","collapseHandleColumn","updateColumnVisibility","initializeResponsivity","responsiveLayoutCollapseFormatter","formatCollapsedData","responsiveLayoutCollapseStartOpen","order","generateCollapsedContent","generateCollapsedRowContent","colCount","working","getFlexBaseWidth","hideColumn","showColumn","generateCollapsedRowData","mockCellComponent","responsiveLayoutCollapseUseFormatters","titleData","valueData","node_content","titleHighlight","SelectRow","selecting","lastClickedRow","selectPrev","headerCheckboxElement","selectRows","deselectRows","getSelectedRows","getSelectedData","isRowSelected","selectable","clearSelectionData","rowRetrieve","selectablePersistence","_deselectRow","_rowSelectionChanged","endSelect","selectableCheck","getCurrentCell","_clearSelection","lastClickedRowIdx","rowIdx","fromRowIdx","toRowIdx","toggledRows","toggledRow","_selectRow","rowMatch","rowInfo","selectableRollingSelection","checkboxEl","dataTreeSelectPropagate","childRowSelection","selectedRow","aRow","bRow","alignEmptyValues","decimalSeparator","thousandSeparator","langLocale","localeCompare","el1","el2","calc","d","string","time","boolean","array","alphanum","Sort","sortList","userSetSort","clearSort","sortMode","remoteSortParams","setSort","refreshSort","arrowEl","sorterParams","startingDir","headerSortStartingDir","headerSortTristate","headerSort","headerSortElement","columnHeaderSortMulti","newSortList","sortOrderReverse","sortListActual","rowComponents","clearColumnHeaders","sortObj","findSorter","setColumnHeader","_sortItems","sorterCount","sortItem","_sortRow","el1Comp","el2Comp","defaultSorters","Tooltip","tooltipSubscriber","headerSubscriber","timeout","popupInstance","tooltipGenerationMode","headerTooltip","mousemoveCheck","mouseoutCheck","tooltip","clearPopup","loadTooltip","tooltipDelay","parameters","numeric","starts","ends","minLength","maxLength","regex","reg","unique","cellData","Validate","invalidCells","getInvalidCells","userClearCellValidation","userValidate","cellIsValid","clearValidation","cellValidate","columnValidate","rowValidate","editValidate","editorClear","editedClear","previousValue","validate","cancelled","validator","_extractValidator","substring","_buildValidator","validators","failedValidators","invalidIndex","defaultValidators","TabulatorFull"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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B,EAAgCz+E,OAAhC;;;;"} \ No newline at end of file +{"version":3,"file":"tabulator.js","sources":["../../src/js/core/defaults/options.js","../../src/js/core/CoreFeature.js","../../src/js/core/column/ColumnComponent.js","../../src/js/core/column/defaults/options.js","../../src/js/core/cell/CellComponent.js","../../src/js/core/cell/Cell.js","../../src/js/core/column/Column.js","../../src/js/core/tools/Helpers.js","../../src/js/core/tools/OptionsList.js","../../src/js/core/rendering/Renderer.js","../../src/js/core/rendering/renderers/BasicHorizontal.js","../../src/js/core/rendering/renderers/VirtualDomHorizontal.js","../../src/js/core/ColumnManager.js","../../src/js/core/row/RowComponent.js","../../src/js/core/row/Row.js","../../src/js/core/rendering/renderers/BasicVertical.js","../../src/js/core/rendering/renderers/VirtualDomVertical.js","../../src/js/core/RowManager.js","../../src/js/core/FooterManager.js","../../src/js/core/tools/InteractionMonitor.js","../../src/js/core/tools/ComponentFunctionBinder.js","../../src/js/core/tools/DataLoader.js","../../src/js/core/tools/ExternalEventBus.js","../../src/js/core/tools/InternalEventBus.js","../../src/js/core/tools/TableRegistry.js","../../src/js/core/tools/Popup.js","../../src/js/core/Module.js","../../src/js/modules/Layout/defaults/modes/fitData.js","../../src/js/modules/Layout/defaults/modes/fitDataGeneral.js","../../src/js/modules/Layout/defaults/modes/fitDataStretch.js","../../src/js/modules/Layout/defaults/modes/fitColumns.js","../../src/js/modules/Layout/defaults/modes.js","../../src/js/modules/Layout/Layout.js","../../src/js/modules/Localize/defaults/langs.js","../../src/js/modules/Localize/Localize.js","../../src/js/modules/Comms/Comms.js","../../src/js/core/tools/ModuleBinder.js","../../src/js/core/tools/Alert.js","../../src/js/core/Tabulator.js","../../src/js/modules/Accessor/defaults/accessors.js","../../src/js/modules/Accessor/Accessor.js","../../src/js/modules/Ajax/defaults/config.js","../../src/js/modules/Ajax/defaults/urlGenerator.js","../../src/js/modules/Ajax/defaults/loaderPromise.js","../../src/js/modules/Ajax/defaults/contentTypeFormatters.js","../../src/js/modules/Ajax/Ajax.js","../../src/js/modules/Clipboard/defaults/pasteActions.js","../../src/js/modules/Clipboard/defaults/pasteParsers.js","../../src/js/modules/Clipboard/Clipboard.js","../../src/js/modules/ColumnCalcs/CalcComponent.js","../../src/js/modules/ColumnCalcs/defaults/calculations.js","../../src/js/modules/ColumnCalcs/ColumnCalcs.js","../../src/js/modules/DataTree/DataTree.js","../../src/js/modules/Download/defaults/downloaders/csv.js","../../src/js/modules/Download/defaults/downloaders/json.js","../../src/js/modules/Download/defaults/downloaders/pdf.js","../../src/js/modules/Download/defaults/downloaders/xlsx.js","../../src/js/modules/Download/defaults/downloaders/html.js","../../src/js/modules/Download/defaults/downloaders/jsonLines.js","../../src/js/modules/Download/defaults/downloaders.js","../../src/js/modules/Download/Download.js","../../src/js/modules/Edit/inputMask.js","../../src/js/modules/Edit/defaults/editors/input.js","../../src/js/modules/Edit/defaults/editors/textarea.js","../../src/js/modules/Edit/defaults/editors/number.js","../../src/js/modules/Edit/defaults/editors/range.js","../../src/js/modules/Edit/List.js","../../src/js/modules/Edit/defaults/editors/select.js","../../src/js/modules/Edit/defaults/editors/list.js","../../src/js/modules/Edit/defaults/editors/autocomplete.js","../../src/js/modules/Edit/defaults/editors/star.js","../../src/js/modules/Edit/defaults/editors/progress.js","../../src/js/modules/Edit/defaults/editors/tickCross.js","../../src/js/modules/Edit/defaults/editors.js","../../src/js/modules/Edit/Edit.js","../../src/js/modules/Export/ExportRow.js","../../src/js/modules/Export/ExportColumn.js","../../src/js/modules/Export/Export.js","../../src/js/modules/Filter/defaults/filters.js","../../src/js/modules/Filter/Filter.js","../../src/js/modules/Format/defaults/formatters/plaintext.js","../../src/js/modules/Format/defaults/formatters/html.js","../../src/js/modules/Format/defaults/formatters/textarea.js","../../src/js/modules/Format/defaults/formatters/money.js","../../src/js/modules/Format/defaults/formatters/link.js","../../src/js/modules/Format/defaults/formatters/image.js","../../src/js/modules/Format/defaults/formatters/tickCross.js","../../src/js/modules/Format/defaults/formatters/datetime.js","../../src/js/modules/Format/defaults/formatters/datetimediff.js","../../src/js/modules/Format/defaults/formatters/lookup.js","../../src/js/modules/Format/defaults/formatters/star.js","../../src/js/modules/Format/defaults/formatters/traffic.js","../../src/js/modules/Format/defaults/formatters/progress.js","../../src/js/modules/Format/defaults/formatters/color.js","../../src/js/modules/Format/defaults/formatters/buttonTick.js","../../src/js/modules/Format/defaults/formatters/buttonCross.js","../../src/js/modules/Format/defaults/formatters/rownum.js","../../src/js/modules/Format/defaults/formatters/handle.js","../../src/js/modules/Format/defaults/formatters/responsiveCollapse.js","../../src/js/modules/Format/defaults/formatters/rowSelection.js","../../src/js/modules/Format/defaults/formatters.js","../../src/js/modules/Format/Format.js","../../src/js/modules/FrozenColumns/FrozenColumns.js","../../src/js/modules/FrozenRows/FrozenRows.js","../../src/js/modules/GroupRows/GroupComponent.js","../../src/js/modules/GroupRows/Group.js","../../src/js/modules/GroupRows/GroupRows.js","../../src/js/modules/History/defaults/undoers.js","../../src/js/modules/History/defaults/redoers.js","../../src/js/modules/History/History.js","../../src/js/modules/HtmlTableImport/HtmlTableImport.js","../../src/js/modules/Import/defaults/importers/csv.js","../../src/js/modules/Import/defaults/importers/json.js","../../src/js/modules/Import/defaults/importers.js","../../src/js/modules/Import/Import.js","../../src/js/modules/Interaction/Interaction.js","../../src/js/modules/Keybindings/defaults/bindings.js","../../src/js/modules/Keybindings/defaults/actions.js","../../src/js/modules/Keybindings/Keybindings.js","../../src/js/modules/Menu/Menu.js","../../src/js/modules/MoveColumns/MoveColumns.js","../../src/js/modules/MoveRows/MoveRows.js","../../src/js/modules/Mutator/defaults/mutators.js","../../src/js/modules/Mutator/Mutator.js","../../src/js/modules/Page/defaults/pageCounters/rows.js","../../src/js/modules/Page/defaults/pageCounters/pages.js","../../src/js/modules/Page/defaults/pageCounters.js","../../src/js/modules/Page/Page.js","../../src/js/modules/Persistence/defaults/readers.js","../../src/js/modules/Persistence/defaults/writers.js","../../src/js/modules/Persistence/Persistence.js","../../src/js/modules/Popup/Popup.js","../../src/js/modules/Print/Print.js","../../src/js/modules/ReactiveData/ReactiveData.js","../../src/js/modules/ResizeColumns/ResizeColumns.js","../../src/js/modules/ResizeRows/ResizeRows.js","../../src/js/modules/ResizeTable/ResizeTable.js","../../src/js/modules/ResponsiveLayout/ResponsiveLayout.js","../../src/js/modules/SelectRow/SelectRow.js","../../src/js/modules/Sort/defaults/sorters/number.js","../../src/js/modules/Sort/defaults/sorters/string.js","../../src/js/modules/Sort/defaults/sorters/datetime.js","../../src/js/modules/Sort/defaults/sorters/date.js","../../src/js/modules/Sort/defaults/sorters/time.js","../../src/js/modules/Sort/defaults/sorters/boolean.js","../../src/js/modules/Sort/defaults/sorters/array.js","../../src/js/modules/Sort/defaults/sorters/exists.js","../../src/js/modules/Sort/defaults/sorters/alphanum.js","../../src/js/modules/Sort/defaults/sorters.js","../../src/js/modules/Sort/Sort.js","../../src/js/modules/Tooltip/Tooltip.js","../../src/js/modules/Validate/defaults/validators.js","../../src/js/modules/Validate/Validate.js","../../src/js/core/TabulatorFull.js"],"sourcesContent":["export default {\r\n\r\n\tdebugEventsExternal:false, //flag to console log events\r\n\tdebugEventsInternal:false, //flag to console log events\r\n\tdebugInvalidOptions:true, //allow toggling of invalid option warnings\r\n\tdebugInitialization:true, //allow toggling of invalid option warnings\r\n\r\n\theight:false, //height of tabulator\r\n\tminHeight:false, //minimum height of tabulator\r\n\tmaxHeight:false, //maximum height of tabulator\r\n\r\n\tcolumnHeaderVertAlign:\"top\", //vertical alignment of column headers\r\n\r\n\tpopupContainer:false,\r\n\r\n\tcolumns:[],//store for colum header info\r\n\tcolumnDefaults:{}, //store column default props\r\n\r\n\tdata:false, //default starting data\r\n\r\n\tautoColumns:false, //build columns from data row structure\r\n\tautoColumnsDefinitions:false,\r\n\r\n\tnestedFieldSeparator:\".\", //separator for nested data\r\n\r\n\tfooterElement:false, //hold footer element\r\n\r\n\tindex:\"id\", //filed for row index\r\n\r\n\ttextDirection:\"auto\",\r\n\r\n\taddRowPos:\"bottom\", //position to insert blank rows, top|bottom\r\n\r\n\theaderVisible:true, //hide header\r\n\r\n\trenderVertical:\"virtual\",\r\n\trenderHorizontal:\"basic\",\r\n\trenderVerticalBuffer:0, // set virtual DOM buffer size\r\n\r\n\tscrollToRowPosition:\"top\",\r\n\tscrollToRowIfVisible:true,\r\n\r\n\tscrollToColumnPosition:\"left\",\r\n\tscrollToColumnIfVisible:true,\r\n\r\n\trowFormatter:false,\r\n\trowFormatterPrint:null,\r\n\trowFormatterClipboard:null,\r\n\trowFormatterHtmlOutput:null,\r\n\r\n\trowHeight:null,\r\n\r\n\tplaceholder:false,\r\n\r\n\tdataLoader:true,\r\n\tdataLoaderLoading:false,\r\n\tdataLoaderError:false,\r\n\tdataLoaderErrorTimeout:3000,\r\n\r\n\tdataSendParams:{},\r\n\r\n\tdataReceiveParams:{},\r\n}\r\n","export default class CoreFeature{\r\n\r\n\tconstructor(table){\r\n\t\tthis.table = table;\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t/////////////// DataLoad /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\treloadData(data, silent, columnsChanged){\r\n\t\treturn this.table.dataLoader.load(data, undefined, undefined, undefined, silent, columnsChanged);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t///////////// Localization ///////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tlangText(){\r\n\t\treturn this.table.modules.localize.getText(...arguments);\r\n\t}\r\n\r\n\tlangBind(){\r\n\t\treturn this.table.modules.localize.bind(...arguments);\r\n\t}\r\n\r\n\tlangLocale(){\r\n\t\treturn this.table.modules.localize.getLocale(...arguments);\r\n\t}\r\n\r\n\r\n\t//////////////////////////////////////////\r\n\t////////// Inter Table Comms /////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tcommsConnections(){\r\n\t\treturn this.table.modules.comms.getConnections(...arguments);\r\n\t}\r\n\r\n\tcommsSend(){\r\n\t\treturn this.table.modules.comms.send(...arguments);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t//////////////// Layout /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tlayoutMode(){\r\n\t\treturn this.table.modules.layout.getMode();\r\n\t}\r\n\r\n\tlayoutRefresh(){\r\n\t\treturn this.table.modules.layout.layout();\r\n\t}\r\n\r\n\r\n\t//////////////////////////////////////////\r\n\t/////////////// Event Bus ////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tsubscribe(){\r\n\t\treturn this.table.eventBus.subscribe(...arguments);\r\n\t}\r\n\r\n\tunsubscribe(){\r\n\t\treturn this.table.eventBus.unsubscribe(...arguments);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.table.eventBus.subscribed(key);\r\n\t}\r\n\r\n\tsubscriptionChange(){\r\n\t\treturn this.table.eventBus.subscriptionChange(...arguments);\r\n\t}\r\n\r\n\tdispatch(){\r\n\t\treturn this.table.eventBus.dispatch(...arguments);\r\n\t}\r\n\r\n\tchain(){\r\n\t\treturn this.table.eventBus.chain(...arguments);\r\n\t}\r\n\r\n\tconfirm(){\r\n\t\treturn this.table.eventBus.confirm(...arguments);\r\n\t}\r\n\r\n\tdispatchExternal(){\r\n\t\treturn this.table.externalEvents.dispatch(...arguments);\r\n\t}\r\n\r\n\tsubscribedExternal(key){\r\n\t\treturn this.table.externalEvents.subscribed(key);\r\n\t}\r\n\r\n\tsubscriptionChangeExternal(){\r\n\t\treturn this.table.externalEvents.subscriptionChange(...arguments);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t//////////////// Options /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\toptions(key){\r\n\t\treturn this.table.options[key];\r\n\t}\r\n\r\n\tsetOption(key, value){\r\n\t\tif(typeof value !== \"undefined\"){\r\n\t\t\tthis.table.options[key] = value;\r\n\t\t}\r\n\r\n\t\treturn this.table.options[key];\r\n\t}\r\n\r\n\r\n\t//////////////////////////////////////////\r\n\t//////////////// Modules /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tmodule(key){\r\n\t\treturn this.table.module(key);\r\n\t}\r\n}","import Column from './Column.js';\r\n\r\n//public column object\r\nexport default class ColumnComponent {\r\n\tconstructor (column){\r\n\t\tthis._column = column;\r\n\t\tthis.type = \"ColumnComponent\";\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._column.table.componentFunctionBinder.handle(\"column\", target._column, name)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._column.getElement();\r\n\t}\r\n\r\n\tgetDefinition(){\r\n\t\treturn this._column.getDefinition();\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._column.getField();\r\n\t}\r\n\r\n\tgetTitleDownload() {\r\n\t\treturn this._column.getTitleDownload();\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._column.cells.forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tisVisible(){\r\n\t\treturn this._column.visible;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tif(this._column.isGroup){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\tcolumn.show();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis._column.show();\r\n\t\t}\r\n\t}\r\n\r\n\thide(){\r\n\t\tif(this._column.isGroup){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\tcolumn.hide();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis._column.hide();\r\n\t\t}\r\n\t}\r\n\r\n\ttoggle(){\r\n\t\tif(this._column.visible){\r\n\t\t\tthis.hide();\r\n\t\t}else{\r\n\t\t\tthis.show();\r\n\t\t}\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn this._column.delete();\r\n\t}\r\n\r\n\tgetSubColumns(){\r\n\t\tvar output = [];\r\n\r\n\t\tif(this._column.columns.length){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\toutput.push(column.getComponent());\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetParentColumn(){\r\n\t\treturn this._column.parent instanceof Column ? this._column.parent.getComponent() : false;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._column;\r\n\t}\r\n\r\n\tscrollTo(){\r\n\t\treturn this._column.table.columnManager.scrollToColumn(this._column);\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._column.table;\r\n\t}\r\n\r\n\tmove(to, after){\r\n\t\tvar toColumn = this._column.table.columnManager.findColumn(to);\r\n\r\n\t\tif(toColumn){\r\n\t\t\tthis._column.table.columnManager.moveColumn(this._column, toColumn, after)\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching column found:\", toColumn);\r\n\t\t}\r\n\t}\r\n\r\n\tgetNextColumn(){\r\n\t\tvar nextCol = this._column.nextColumn();\r\n\r\n\t\treturn nextCol ? nextCol.getComponent() : false;\r\n\t}\r\n\r\n\tgetPrevColumn(){\r\n\t\tvar prevCol = this._column.prevColumn();\r\n\r\n\t\treturn prevCol ? prevCol.getComponent() : false;\r\n\t}\r\n\r\n\tupdateDefinition(updates){\r\n\t\treturn this._column.updateDefinition(updates);\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\treturn this._column.getWidth();\r\n\t}\r\n\r\n\tsetWidth(width){\r\n\t\tvar result;\r\n\r\n\t\tif(width === true){\r\n\t\t\tresult = this._column.reinitializeWidth(true);\r\n\t\t}else{\r\n\t\t\tresult = this._column.setWidth(width);\r\n\t\t}\r\n\r\n\t\tthis._column.table.columnManager.renderer.rerenderColumns(true);\r\n\r\n\t\treturn result;\r\n\t}\r\n}","export default {\r\n\t\"title\": undefined,\r\n\t\"field\": undefined,\r\n\t\"columns\": undefined,\r\n\t\"visible\": undefined,\r\n\t\"hozAlign\": undefined,\r\n\t\"vertAlign\": undefined,\r\n\t\"width\": undefined,\r\n\t\"minWidth\": 40,\r\n\t\"maxWidth\": undefined,\r\n\t\"maxInitialWidth\": undefined,\r\n\t\"cssClass\": undefined,\r\n\t\"variableHeight\": undefined,\r\n\t\"headerVertical\": undefined,\r\n\t\"headerHozAlign\": undefined,\r\n\t\"editableTitle\": undefined,\r\n}","//public cell object\r\nexport default class CellComponent {\r\n\r\n\tconstructor (cell){\r\n\t\tthis._cell = cell;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._cell.table.componentFunctionBinder.handle(\"cell\", target._cell, name)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\tgetValue(){\r\n\t\treturn this._cell.getValue();\r\n\t}\r\n\r\n\tgetOldValue(){\r\n\t\treturn this._cell.getOldValue();\r\n\t}\r\n\r\n\tgetInitialValue(){\r\n\t\treturn this._cell.initialValue;\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._cell.getElement();\r\n\t}\r\n\r\n\tgetRow(){\r\n\t\treturn this._cell.row.getComponent();\r\n\t}\r\n\r\n\tgetData(){\r\n\t\treturn this._cell.row.getData();\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._cell.column.getField();\r\n\t}\r\n\r\n\tgetColumn(){\r\n\t\treturn this._cell.column.getComponent();\r\n\t}\r\n\r\n\tsetValue(value, mutate){\r\n\t\tif(typeof mutate == \"undefined\"){\r\n\t\t\tmutate = true;\r\n\t\t}\r\n\r\n\t\tthis._cell.setValue(value, mutate);\r\n\t}\r\n\r\n\trestoreOldValue(){\r\n\t\tthis._cell.setValueActual(this._cell.getOldValue());\r\n\t}\r\n\r\n\trestoreInitialValue(){\r\n\t\tthis._cell.setValueActual(this._cell.initialValue);\r\n\t}\r\n\r\n\tcheckHeight(){\r\n\t\tthis._cell.checkHeight();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._cell.table;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._cell;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport CellComponent from './CellComponent.js';\r\n\r\nexport default class Cell extends CoreFeature{\r\n\tconstructor(column, row){\r\n\t\tsuper(column.table);\r\n\r\n\t\tthis.table = column.table;\r\n\t\tthis.column = column;\r\n\t\tthis.row = row;\r\n\t\tthis.element = null;\r\n\t\tthis.value = null;\r\n\t\tthis.initialValue;\r\n\t\tthis.oldValue = null;\r\n\t\tthis.modules = {};\r\n\r\n\t\tthis.height = null;\r\n\t\tthis.width = null;\r\n\t\tthis.minWidth = null;\r\n\r\n\t\tthis.component = null;\r\n\r\n\t\tthis.loaded = false; //track if the cell has been added to the DOM yet\r\n\r\n\t\tthis.build();\r\n\t}\r\n\r\n\t//////////////// Setup Functions /////////////////\r\n\t//generate element\r\n\tbuild(){\r\n\t\tthis.generateElement();\r\n\r\n\t\tthis.setWidth();\r\n\r\n\t\tthis._configureCell();\r\n\r\n\t\tthis.setValueActual(this.column.getFieldValue(this.row.data));\r\n\r\n\t\tthis.initialValue = this.value;\r\n\t}\r\n\r\n\tgenerateElement(){\r\n\t\tthis.element = document.createElement('div');\r\n\t\tthis.element.className = \"tabulator-cell\";\r\n\t\tthis.element.setAttribute(\"role\", \"gridcell\");\r\n\t\tthis.element = this.element;\r\n\t}\r\n\r\n\t_configureCell(){\r\n\t\tvar element = this.element,\r\n\t\tfield = this.column.getField(),\r\n\t\tvertAligns = {\r\n\t\t\ttop:\"flex-start\",\r\n\t\t\tbottom:\"flex-end\",\r\n\t\t\tmiddle:\"center\",\r\n\t\t},\r\n\t\thozAligns = {\r\n\t\t\tleft:\"flex-start\",\r\n\t\t\tright:\"flex-end\",\r\n\t\t\tcenter:\"center\",\r\n\t\t};\r\n\r\n\t\t//set text alignment\r\n\t\telement.style.textAlign = this.column.hozAlign;\r\n\r\n\t\tif(this.column.vertAlign){\r\n\t\t\telement.style.display = \"inline-flex\";\r\n\r\n\t\t\telement.style.alignItems = vertAligns[this.column.vertAlign] || \"\";\r\n\r\n\t\t\tif(this.column.hozAlign){\r\n\t\t\t\telement.style.justifyContent = hozAligns[this.column.hozAlign] || \"\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(field){\r\n\t\t\telement.setAttribute(\"tabulator-field\", field);\r\n\t\t}\r\n\r\n\t\t//add class to cell if needed\r\n\t\tif(this.column.definition.cssClass){\r\n\t\t\tvar classNames = this.column.definition.cssClass.split(\" \")\r\n\t\t\tclassNames.forEach((className) => {\r\n\t\t\t\telement.classList.add(className)\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"cell-init\", this);\r\n\r\n\t\t//hide cell if not visible\r\n\t\tif(!this.column.visible){\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\t//generate cell contents\r\n\t_generateContents(){\r\n\t\tvar val;\r\n\r\n\t\tval = this.chain(\"cell-format\", this, null, () => {\r\n\t\t\treturn this.element.innerHTML = this.value;\r\n\t\t});\r\n\r\n\t\tswitch(typeof val){\r\n\t\t\tcase \"object\":\r\n\t\t\tif(val instanceof Node){\r\n\r\n\t\t\t\t//clear previous cell contents\r\n\t\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\r\n\t\t\t\tthis.element.appendChild(val);\r\n\t\t\t}else{\r\n\t\t\t\tthis.element.innerHTML = \"\";\r\n\r\n\t\t\t\tif(val != null){\r\n\t\t\t\t\tconsole.warn(\"Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:\", val);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\tcase \"undefined\":\r\n\t\t\tthis.element.innerHTML = \"\";\r\n\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\tthis.element.innerHTML = val;\r\n\t\t}\r\n\t}\r\n\r\n\tcellRendered(){\r\n\t\tthis.dispatch(\"cell-rendered\", this);\r\n\t}\r\n\r\n\t//////////////////// Getters ////////////////////\r\n\tgetElement(containerOnly){\r\n\t\tif(!this.loaded){\r\n\t\t\tthis.loaded = true;\r\n\t\t\tif(!containerOnly){\r\n\t\t\t\tthis.layoutElement();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\tgetValue(){\r\n\t\treturn this.value;\r\n\t}\r\n\r\n\tgetOldValue(){\r\n\t\treturn this.oldValue;\r\n\t}\r\n\r\n\t//////////////////// Actions ////////////////////\r\n\tsetValue(value, mutate, force){\r\n\t\tvar changed = this.setValueProcessData(value, mutate, force);\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.dispatch(\"cell-value-updated\", this);\r\n\r\n\t\t\tthis.cellRendered();\r\n\r\n\t\t\tif(this.column.definition.cellEdited){\r\n\t\t\t\tthis.column.definition.cellEdited.call(this.table, this.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"cellEdited\", this.getComponent());\r\n\r\n\t\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tsetValueProcessData(value, mutate, force){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(this.value !== value || force){\r\n\r\n\t\t\tchanged = true;\r\n\r\n\t\t\tif(mutate){\r\n\t\t\t\tvalue = this.chain(\"cell-value-changing\", [this, value], null, value);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.setValueActual(value);\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.dispatch(\"cell-value-changed\", this);\r\n\t\t}\r\n\r\n\t\treturn changed;\r\n\t}\r\n\r\n\tsetValueActual(value){\r\n\t\tthis.oldValue = this.value;\r\n\r\n\t\tthis.value = value;\r\n\r\n\t\tthis.dispatch(\"cell-value-save-before\", this);\r\n\r\n\t\tthis.column.setFieldValue(this.row.data, value);\r\n\r\n\t\tthis.dispatch(\"cell-value-save-after\", this);\r\n\r\n\t\tif(this.loaded){\r\n\t\t\tthis.layoutElement();\r\n\t\t}\r\n\t}\r\n\r\n\tlayoutElement(){\r\n\t\tthis._generateContents();\r\n\r\n\t\tthis.dispatch(\"cell-layout\", this);\r\n\t}\r\n\r\n\tsetWidth(){\r\n\t\tthis.width = this.column.width;\r\n\t\tthis.element.style.width = this.column.widthStyled;\r\n\t}\r\n\r\n\tclearWidth(){\r\n\t\tthis.width = \"\";\r\n\t\tthis.element.style.width = \"\";\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\treturn this.width || this.element.offsetWidth;\r\n\t}\r\n\r\n\tsetMinWidth(){\r\n\t\tthis.minWidth = this.column.minWidth;\r\n\t\tthis.element.style.minWidth = this.column.minWidthStyled;\r\n\t}\r\n\r\n\tsetMaxWidth(){\r\n\t\tthis.maxWidth = this.column.maxWidth;\r\n\t\tthis.element.style.maxWidth = this.column.maxWidthStyled;\r\n\t}\r\n\r\n\tcheckHeight(){\r\n\t\t// var height = this.element.css(\"height\");\r\n\t\tthis.row.reinitializeHeight();\r\n\t}\r\n\r\n\tclearHeight(){\r\n\t\tthis.element.style.height = \"\";\r\n\t\tthis.height = null;\r\n\r\n\t\tthis.dispatch(\"cell-height\", this, \"\");\r\n\t}\r\n\r\n\tsetHeight(){\r\n\t\tthis.height = this.row.height;\r\n\t\tthis.element.style.height = this.row.heightStyled;\r\n\r\n\t\tthis.dispatch(\"cell-height\", this, this.row.heightStyled);\r\n\t}\r\n\r\n\tgetHeight(){\r\n\t\treturn this.height || this.element.offsetHeight;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tthis.element.style.display = this.column.vertAlign ? \"inline-flex\" : \"\";\r\n\t}\r\n\r\n\thide(){\r\n\t\tthis.element.style.display = \"none\";\r\n\t}\r\n\r\n\tdelete(){\r\n\t\tthis.dispatch(\"cell-delete\", this);\r\n\r\n\t\tif(!this.table.rowManager.redrawBlock && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\r\n\t\tthis.element = false;\r\n\t\tthis.column.deleteCell(this);\r\n\t\tthis.row.deleteCell(this);\r\n\t\tthis.calcs = {};\r\n\t}\r\n\r\n\tgetIndex(){\r\n\t\treturn this.row.getCellIndex(this);\r\n\t}\r\n\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new CellComponent(this);\r\n\t\t}\r\n\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n","import CoreFeature from '../CoreFeature.js';\r\nimport ColumnComponent from './ColumnComponent.js';\r\nimport defaultOptions from './defaults/options.js';\r\n\r\nimport Cell from '../cell/Cell.js';\r\n\r\nclass Column extends CoreFeature{\r\n\r\n\tconstructor(def, parent){\r\n\t\tsuper(parent.table);\r\n\r\n\t\tthis.definition = def; //column definition\r\n\t\tthis.parent = parent; //hold parent object\r\n\t\tthis.type = \"column\"; //type of element\r\n\t\tthis.columns = []; //child columns\r\n\t\tthis.cells = []; //cells bound to this column\r\n\t\tthis.element = this.createElement(); //column header element\r\n\t\tthis.contentElement = false;\r\n\t\tthis.titleHolderElement = false;\r\n\t\tthis.titleElement = false;\r\n\t\tthis.groupElement = this.createGroupElement(); //column group holder element\r\n\t\tthis.isGroup = false;\r\n\t\tthis.hozAlign = \"\"; //horizontal text alignment\r\n\t\tthis.vertAlign = \"\"; //vert text alignment\r\n\r\n\t\t//multi dimensional filed handling\r\n\t\tthis.field =\"\";\r\n\t\tthis.fieldStructure = \"\";\r\n\t\tthis.getFieldValue = \"\";\r\n\t\tthis.setFieldValue = \"\";\r\n\r\n\t\tthis.titleDownload = null;\r\n\t\tthis.titleFormatterRendered = false;\r\n\r\n\t\tthis.mapDefinitions();\r\n\r\n\t\tthis.setField(this.definition.field);\r\n\r\n\t\tthis.modules = {}; //hold module variables;\r\n\r\n\t\tthis.width = null; //column width\r\n\t\tthis.widthStyled = \"\"; //column width prestyled to improve render efficiency\r\n\t\tthis.maxWidth = null; //column maximum width\r\n\t\tthis.maxWidthStyled = \"\"; //column maximum prestyled to improve render efficiency\r\n\t\tthis.maxInitialWidth = null;\r\n\t\tthis.minWidth = null; //column minimum width\r\n\t\tthis.minWidthStyled = \"\"; //column minimum prestyled to improve render efficiency\r\n\t\tthis.widthFixed = false; //user has specified a width for this column\r\n\r\n\t\tthis.visible = true; //default visible state\r\n\r\n\t\tthis.component = null;\r\n\r\n\t\t//initialize column\r\n\t\tif(this.definition.columns){\r\n\r\n\t\t\tthis.isGroup = true;\r\n\r\n\t\t\tthis.definition.columns.forEach((def, i) => {\r\n\t\t\t\tvar newCol = new Column(def, this);\r\n\t\t\t\tthis.attachColumn(newCol);\r\n\t\t\t});\r\n\r\n\t\t\tthis.checkColumnVisibility();\r\n\t\t}else{\r\n\t\t\tparent.registerColumnField(this);\r\n\t\t}\r\n\r\n\t\tthis._initialize();\r\n\r\n\t\tthis.bindModuleColumns();\r\n\t}\r\n\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-col\");\r\n\t\tel.setAttribute(\"role\", \"columnheader\");\r\n\t\tel.setAttribute(\"aria-sort\", \"none\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tcreateGroupElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-col-group-cols\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tmapDefinitions(){\r\n\t\tvar defaults = this.table.options.columnDefaults;\r\n\r\n\t\t//map columnDefaults onto column definitions\r\n\t\tif(defaults){\r\n\t\t\tfor(let key in defaults){\r\n\t\t\t\tif(typeof this.definition[key] === \"undefined\"){\r\n\t\t\t\t\tthis.definition[key] = defaults[key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.definition = this.table.columnManager.optionsList.generate(Column.defaultOptionList, this.definition)\r\n\t}\r\n\r\n\tcheckDefinition(){\r\n\t\tObject.keys(this.definition).forEach((key) => {\r\n\t\t\tif(Column.defaultOptionList.indexOf(key) === -1){\r\n\t\t\t\tconsole.warn(\"Invalid column definition option in '\" + (this.field || this.definition.title) + \"' column:\", key)\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tsetField(field){\r\n\t\tthis.field = field;\r\n\t\tthis.fieldStructure = field ? (this.table.options.nestedFieldSeparator ? field.split(this.table.options.nestedFieldSeparator) : [field]) : [];\r\n\t\tthis.getFieldValue = this.fieldStructure.length > 1 ? this._getNestedData : this._getFlatData;\r\n\t\tthis.setFieldValue = this.fieldStructure.length > 1 ? this._setNestedData : this._setFlatData;\r\n\t}\r\n\r\n\t//register column position with column manager\r\n\tregisterColumnPosition(column){\r\n\t\tthis.parent.registerColumnPosition(column);\r\n\t}\r\n\r\n\t//register column position with column manager\r\n\tregisterColumnField(column){\r\n\t\tthis.parent.registerColumnField(column);\r\n\t}\r\n\r\n\t//trigger position registration\r\n\treRegisterPosition(){\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tcolumn.reRegisterPosition();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.registerColumnPosition(this);\r\n\t\t}\r\n\t}\r\n\r\n\t_mapDepricatedFunctionality(){\r\n\t\t//all previously deprecated functionality removed in the 5.0 release\r\n\t}\r\n\r\n\t//build header element\r\n\t_initialize(){\r\n\t\tvar def = this.definition;\r\n\r\n\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\r\n\t\tif(def.headerVertical){\r\n\t\t\tthis.element.classList.add(\"tabulator-col-vertical\");\r\n\r\n\t\t\tif(def.headerVertical === \"flip\"){\r\n\t\t\t\tthis.element.classList.add(\"tabulator-col-vertical-flip\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.contentElement = this._buildColumnHeaderContent();\r\n\r\n\t\tthis.element.appendChild(this.contentElement);\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis._buildGroupHeader();\r\n\t\t}else{\r\n\t\t\tthis._buildColumnHeader();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-init\", this);\r\n\t}\r\n\r\n\t//build header element for header\r\n\t_buildColumnHeader(){\r\n\t\tvar def = this.definition,\r\n\t\ttable = this.table;\r\n\r\n\t\tthis.dispatch(\"column-layout\", this);\r\n\r\n\t\t//set column visibility\r\n\t\tif(typeof def.visible != \"undefined\"){\r\n\t\t\tif(def.visible){\r\n\t\t\t\tthis.show(true);\r\n\t\t\t}else{\r\n\t\t\t\tthis.hide(true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//asign additional css classes to column header\r\n\t\tif(def.cssClass){\r\n\t\t\tvar classeNames = def.cssClass.split(\" \");\r\n\t\t\tclasseNames.forEach((className) => {\r\n\t\t\t\tthis.element.classList.add(className);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(def.field){\r\n\t\t\tthis.element.setAttribute(\"tabulator-field\", def.field);\r\n\t\t}\r\n\r\n\t\t//set min width if present\r\n\t\tthis.setMinWidth(parseInt(def.minWidth));\r\n\r\n\t\tif (def.maxInitialWidth) {\r\n\t\t\tthis.maxInitialWidth = parseInt(def.maxInitialWidth);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.maxWidth){\r\n\t\t\tthis.setMaxWidth(parseInt(def.maxWidth));\r\n\t\t}\r\n\r\n\t\tthis.reinitializeWidth();\r\n\r\n\t\t//set orizontal text alignment\r\n\t\tthis.hozAlign = this.definition.hozAlign;\r\n\t\tthis.vertAlign = this.definition.vertAlign;\r\n\r\n\t\tthis.titleElement.style.textAlign = this.definition.headerHozAlign;\r\n\t}\r\n\r\n\t_buildColumnHeaderContent(){\r\n\t\tvar def = this.definition,\r\n\t\ttable = this.table;\r\n\r\n\t\tvar contentElement = document.createElement(\"div\");\r\n\t\tcontentElement.classList.add(\"tabulator-col-content\");\r\n\r\n\t\tthis.titleHolderElement = document.createElement(\"div\");\r\n\t\tthis.titleHolderElement.classList.add(\"tabulator-col-title-holder\");\r\n\r\n\t\tcontentElement.appendChild(this.titleHolderElement);\r\n\r\n\t\tthis.titleElement = this._buildColumnHeaderTitle();\r\n\r\n\t\tthis.titleHolderElement.appendChild(this.titleElement);\r\n\r\n\t\treturn contentElement;\r\n\t}\r\n\r\n\t//build title element of column\r\n\t_buildColumnHeaderTitle(){\r\n\t\tvar def = this.definition,\r\n\t\ttitle;\r\n\r\n\t\tvar titleHolderElement = document.createElement(\"div\");\r\n\t\ttitleHolderElement.classList.add(\"tabulator-col-title\");\r\n\r\n\t\tif(def.editableTitle){\r\n\t\t\tvar titleElement = document.createElement(\"input\");\r\n\t\t\ttitleElement.classList.add(\"tabulator-title-editor\");\r\n\r\n\t\t\ttitleElement.addEventListener(\"click\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\ttitleElement.focus();\r\n\t\t\t});\r\n\r\n\t\t\ttitleElement.addEventListener(\"change\", () => {\r\n\t\t\t\tdef.title = titleElement.value;\r\n\t\t\t\tthis.dispatchExternal(\"columnTitleChanged\", this.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\ttitleHolderElement.appendChild(titleElement);\r\n\r\n\t\t\tif(def.field){\r\n\t\t\t\tthis.langBind(\"columns|\" + def.field, (text) => {\r\n\t\t\t\t\ttitleElement.value = text || (def.title || \" \");\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\ttitleElement.value = def.title || \" \";\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tif(def.field){\r\n\t\t\t\tthis.langBind(\"columns|\" + def.field, (text) => {\r\n\t\t\t\t\tthis._formatColumnHeaderTitle(titleHolderElement, text || (def.title || \" \"));\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tthis._formatColumnHeaderTitle(titleHolderElement, def.title || \" \");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn titleHolderElement;\r\n\t}\r\n\r\n\t_formatColumnHeaderTitle(el, title){\r\n\t\tvar contents = this.chain(\"column-format\", [this, title, el], null, () => {\r\n\t\t\treturn title;\r\n\t\t});\r\n\r\n\t\tswitch(typeof contents){\r\n\t\t\tcase \"object\":\r\n\t\t\tif(contents instanceof Node){\r\n\t\t\t\tel.appendChild(contents);\r\n\t\t\t}else{\r\n\t\t\t\tel.innerHTML = \"\";\r\n\t\t\t\tconsole.warn(\"Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:\", contents);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\tcase \"undefined\":\r\n\t\t\tel.innerHTML = \"\";\r\n\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\tel.innerHTML = contents;\r\n\t\t}\r\n\t}\r\n\r\n\t//build header element for column group\r\n\t_buildGroupHeader(){\r\n\t\tthis.element.classList.add(\"tabulator-col-group\");\r\n\t\tthis.element.setAttribute(\"role\", \"columngroup\");\r\n\t\tthis.element.setAttribute(\"aria-title\", this.definition.title);\r\n\r\n\t\t//asign additional css classes to column header\r\n\t\tif(this.definition.cssClass){\r\n\t\t\tvar classeNames = this.definition.cssClass.split(\" \");\r\n\t\t\tclasseNames.forEach((className) => {\r\n\t\t\t\tthis.element.classList.add(className);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.titleElement.style.textAlign = this.definition.headerHozAlign;\r\n\r\n\t\tthis.element.appendChild(this.groupElement);\r\n\t}\r\n\r\n\t//flat field lookup\r\n\t_getFlatData(data){\r\n\t\treturn data[this.field];\r\n\t}\r\n\r\n\t//nested field lookup\r\n\t_getNestedData(data){\r\n\t\tvar dataObj = data,\r\n\t\tstructure = this.fieldStructure,\r\n\t\tlength = structure.length,\r\n\t\toutput;\r\n\r\n\t\tfor(let i = 0; i < length; i++){\r\n\r\n\t\t\tdataObj = dataObj[structure[i]];\r\n\r\n\t\t\toutput = dataObj;\r\n\r\n\t\t\tif(!dataObj){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//flat field set\r\n\t_setFlatData(data, value){\r\n\t\tif(this.field){\r\n\t\t\tdata[this.field] = value;\r\n\t\t}\r\n\t}\r\n\r\n\t//nested field set\r\n\t_setNestedData(data, value){\r\n\t\tvar dataObj = data,\r\n\t\tstructure = this.fieldStructure,\r\n\t\tlength = structure.length;\r\n\r\n\t\tfor(let i = 0; i < length; i++){\r\n\r\n\t\t\tif(i == length -1){\r\n\t\t\t\tdataObj[structure[i]] = value;\r\n\t\t\t}else{\r\n\t\t\t\tif(!dataObj[structure[i]]){\r\n\t\t\t\t\tif(typeof value !== \"undefined\"){\r\n\t\t\t\t\t\tdataObj[structure[i]] = {};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdataObj = dataObj[structure[i]];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//attach column to this group\r\n\tattachColumn(column){\r\n\t\tif(this.groupElement){\r\n\t\t\tthis.columns.push(column);\r\n\t\t\tthis.groupElement.appendChild(column.getElement());\r\n\r\n\t\t\tcolumn.columnRendered();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Warning - Column being attached to another column instead of column group\");\r\n\t\t}\r\n\t}\r\n\r\n\t//vertically align header in column\r\n\tverticalAlign(alignment, height){\r\n\r\n\t\t//calculate height of column header and group holder element\r\n\t\tvar parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : (height || this.parent.getHeadersElement().clientHeight);\r\n\t\t// var parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : this.parent.getHeadersElement().clientHeight;\r\n\r\n\t\tthis.element.style.height = parentHeight + \"px\";\r\n\r\n\t\tthis.dispatch(\"column-height\", this, this.element.style.height);\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.groupElement.style.minHeight = (parentHeight - this.contentElement.offsetHeight) + \"px\";\r\n\t\t}\r\n\r\n\t\t//vertically align cell contents\r\n\t\tif(!this.isGroup && alignment !== \"top\"){\r\n\t\t\tif(alignment === \"bottom\"){\r\n\t\t\t\tthis.element.style.paddingTop = (this.element.clientHeight - this.contentElement.offsetHeight) + \"px\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.element.style.paddingTop = ((this.element.clientHeight - this.contentElement.offsetHeight) / 2) + \"px\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.verticalAlign(alignment);\r\n\t\t});\r\n\t}\r\n\r\n\t//clear vertical alignmenet\r\n\tclearVerticalAlign(){\r\n\t\tthis.element.style.paddingTop = \"\";\r\n\t\tthis.element.style.height = \"\";\r\n\t\tthis.element.style.minHeight = \"\";\r\n\t\tthis.groupElement.style.minHeight = \"\";\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.clearVerticalAlign();\r\n\t\t});\r\n\r\n\t\tthis.dispatch(\"column-height\", this, \"\");\r\n\t}\r\n\r\n\tbindModuleColumns (){\r\n\t\t//check if rownum formatter is being used on a column\r\n\t\tif(this.definition.formatter == \"rownum\"){\r\n\t\t\tthis.table.rowManager.rowNumColumn = this;\r\n\t\t}\r\n\t}\r\n\r\n\t//// Retreive Column Information ////\r\n\t//return column header element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\t//return colunm group element\r\n\tgetGroupElement(){\r\n\t\treturn this.groupElement;\r\n\t}\r\n\r\n\t//return field name\r\n\tgetField(){\r\n\t\treturn this.field;\r\n\t}\r\n\r\n\tgetTitleDownload() {\r\n\t\treturn this.titleDownload;\r\n\t}\r\n\r\n\t//return the first column in a group\r\n\tgetFirstColumn(){\r\n\t\tif(!this.isGroup){\r\n\t\t\treturn this;\r\n\t\t}else{\r\n\t\t\tif(this.columns.length){\r\n\t\t\t\treturn this.columns[0].getFirstColumn();\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//return the last column in a group\r\n\tgetLastColumn(){\r\n\t\tif(!this.isGroup){\r\n\t\t\treturn this;\r\n\t\t}else{\r\n\t\t\tif(this.columns.length){\r\n\t\t\t\treturn this.columns[this.columns.length -1].getLastColumn();\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//return all columns in a group\r\n\tgetColumns(){\r\n\t\treturn this.columns;\r\n\t}\r\n\r\n\t//return all columns in a group\r\n\tgetCells(){\r\n\t\treturn this.cells;\r\n\t}\r\n\r\n\t//retreive the top column in a group of columns\r\n\tgetTopColumn(){\r\n\t\tif(this.parent.isGroup){\r\n\t\t\treturn this.parent.getTopColumn();\r\n\t\t}else{\r\n\t\t\treturn this;\r\n\t\t}\r\n\t}\r\n\r\n\t//return column definition object\r\n\tgetDefinition(updateBranches){\r\n\t\tvar colDefs = [];\r\n\r\n\t\tif(this.isGroup && updateBranches){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tcolDefs.push(column.getDefinition(true));\r\n\t\t\t});\r\n\r\n\t\t\tthis.definition.columns = colDefs;\r\n\t\t}\r\n\r\n\t\treturn this.definition;\r\n\t}\r\n\r\n\t//////////////////// Actions ////////////////////\r\n\tcheckColumnVisibility(){\r\n\t\tvar visible = false;\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvisible = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(visible){\r\n\t\t\tthis.show();\r\n\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), false);\r\n\t\t}else{\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\t//show column\r\n\tshow(silent, responsiveToggle){\r\n\t\tif(!this.visible){\r\n\t\t\tthis.visible = true;\r\n\r\n\t\t\tthis.element.style.display = \"\";\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.checkColumnVisibility();\r\n\t\t\t}\r\n\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.show();\r\n\t\t\t});\r\n\r\n\t\t\tif(!this.isGroup && this.width === null){\r\n\t\t\t\tthis.reinitializeWidth();\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.columnManager.verticalAlignHeaders();\r\n\r\n\t\t\tthis.dispatch(\"column-show\", this, responsiveToggle);\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), true);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\r\n\t\t\tif(!this.silent){\r\n\t\t\t\tthis.table.columnManager.renderer.rerenderColumns();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//hide column\r\n\thide(silent, responsiveToggle){\r\n\t\tif(this.visible){\r\n\t\t\tthis.visible = false;\r\n\r\n\t\t\tthis.element.style.display = \"none\";\r\n\r\n\t\t\tthis.table.columnManager.verticalAlignHeaders();\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.checkColumnVisibility();\r\n\t\t\t}\r\n\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.hide();\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatch(\"column-hide\", this, responsiveToggle);\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), false);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\r\n\t\t\tif(!this.silent){\r\n\t\t\t\tthis.table.columnManager.renderer.rerenderColumns();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmatchChildWidths(){\r\n\t\tvar childWidth = 0;\r\n\r\n\t\tif(this.contentElement && this.columns.length){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tif(column.visible){\r\n\t\t\t\t\tchildWidth += column.getWidth();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.contentElement.style.maxWidth = (childWidth - 1) + \"px\";\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tremoveChild(child){\r\n\t\tvar index = this.columns.indexOf(child);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.columns.splice(index, 1);\r\n\t\t}\r\n\r\n\t\tif(!this.columns.length){\r\n\t\t\tthis.delete();\r\n\t\t}\r\n\t}\r\n\r\n\tsetWidth(width){\r\n\t\tthis.widthFixed = true;\r\n\t\tthis.setWidthActual(width);\r\n\t}\r\n\r\n\tsetWidthActual(width){\r\n\t\tif(isNaN(width)){\r\n\t\t\twidth = Math.floor((this.table.element.clientWidth/100) * parseInt(width));\r\n\t\t}\r\n\r\n\t\twidth = Math.max(this.minWidth, width);\r\n\r\n\t\tif(this.maxWidth){\r\n\t\t\twidth = Math.min(this.maxWidth, width);\r\n\t\t}\r\n\r\n\t\tthis.width = width;\r\n\t\tthis.widthStyled = width ? width + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.width = this.widthStyled;\r\n\r\n\t\tif(!this.isGroup){\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.setWidth();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.parent.isGroup){\r\n\t\t\tthis.parent.matchChildWidths();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-width\", this);\r\n\t}\r\n\r\n\tcheckCellHeights(){\r\n\t\tvar rows = [];\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tif(cell.row.heightInitialized){\r\n\t\t\t\tif(cell.row.getElement().offsetParent !== null){\r\n\t\t\t\t\trows.push(cell.row);\r\n\t\t\t\t\tcell.row.clearCellHeight();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcell.row.heightInitialized = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\trow.calcHeight();\r\n\t\t});\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\trow.setCellHeight();\r\n\t\t});\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\tvar width = 0;\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tif(column.visible){\r\n\t\t\t\t\twidth += column.getWidth();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\twidth = this.width;\r\n\t\t}\r\n\r\n\t\treturn width;\r\n\t}\r\n\r\n\tgetHeight(){\r\n\t\treturn Math.ceil(this.element.getBoundingClientRect().height);\r\n\t}\r\n\r\n\tsetMinWidth(minWidth){\r\n\t\tthis.minWidth = minWidth;\r\n\t\tthis.minWidthStyled = minWidth ? minWidth + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.minWidth = this.minWidthStyled;\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setMinWidth();\r\n\t\t});\r\n\t}\r\n\r\n\tsetMaxWidth(maxWidth){\r\n\t\tthis.maxWidth = maxWidth;\r\n\t\tthis.maxWidthStyled = maxWidth ? maxWidth + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.maxWidth = this.maxWidthStyled;\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setMaxWidth();\r\n\t\t});\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar index;\r\n\r\n\t\t\tif(this.isGroup){\r\n\t\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\t\tcolumn.delete();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatch(\"column-delete\", this);\r\n\r\n\t\t\tvar cellCount = this.cells.length;\r\n\r\n\t\t\tfor(let i = 0; i < cellCount; i++){\r\n\t\t\t\tthis.cells[0].delete();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.element.parentNode){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element = false;\r\n\t\t\tthis.contentElement = false;\r\n\t\t\tthis.titleElement = false;\r\n\t\t\tthis.groupElement = false;\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.removeChild(this);\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.columnManager.deregisterColumn(this);\r\n\r\n\t\t\tthis.table.columnManager.renderer.rerenderColumns(true);\r\n\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\r\n\tcolumnRendered(){\r\n\t\tif(this.titleFormatterRendered){\r\n\t\t\tthis.titleFormatterRendered();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-rendered\", this);\r\n\t}\r\n\r\n\t//////////////// Cell Management /////////////////\r\n\t//generate cell for this column\r\n\tgenerateCell(row){\r\n\t\tvar cell = new Cell(this, row);\r\n\r\n\t\tthis.cells.push(cell);\r\n\r\n\t\treturn cell;\r\n\t}\r\n\r\n\tnextColumn(){\r\n\t\tvar index = this.table.columnManager.findColumnIndex(this);\r\n\t\treturn index > -1 ? this._nextVisibleColumn(index + 1) : false;\r\n\t}\r\n\r\n\t_nextVisibleColumn(index){\r\n\t\tvar column = this.table.columnManager.getColumnByIndex(index);\r\n\t\treturn !column || column.visible ? column : this._nextVisibleColumn(index + 1);\r\n\t}\r\n\r\n\tprevColumn(){\r\n\t\tvar index = this.table.columnManager.findColumnIndex(this);\r\n\t\treturn index > -1 ? this._prevVisibleColumn(index - 1) : false;\r\n\t}\r\n\r\n\t_prevVisibleColumn(index){\r\n\t\tvar column = this.table.columnManager.getColumnByIndex(index);\r\n\t\treturn !column || column.visible ? column : this._prevVisibleColumn(index - 1);\r\n\t}\r\n\r\n\treinitializeWidth(force){\r\n\t\tthis.widthFixed = false;\r\n\r\n\t\t//set width if present\r\n\t\tif(typeof this.definition.width !== \"undefined\" && !force){\r\n\t\t\t// maxInitialWidth ignored here as width specified\r\n\t\t\tthis.setWidth(this.definition.width);\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-width-fit-before\", this);\r\n\r\n\t\tthis.fitToData(force);\r\n\r\n\t\tthis.dispatch(\"column-width-fit-after\", this);\r\n\t}\r\n\r\n\t//set column width to maximum cell width for non group columns\r\n\tfitToData(force){\r\n\t\tif(this.isGroup){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(!this.widthFixed){\r\n\t\t\tthis.element.style.width = \"\";\r\n\r\n\t\t\tthis.cells.forEach((cell) => {\r\n\t\t\t\tcell.clearWidth();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tvar maxWidth = this.element.offsetWidth;\r\n\r\n\t\tif(!this.width || !this.widthFixed){\r\n\t\t\tthis.cells.forEach((cell) => {\r\n\t\t\t\tvar width = cell.getWidth();\r\n\r\n\t\t\t\tif(width > maxWidth){\r\n\t\t\t\t\tmaxWidth = width;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(maxWidth){\r\n\t\t\t\tvar setTo = maxWidth + 1;\r\n\t\t\t\tif (this.maxInitialWidth && !force) {\r\n\t\t\t\t\tsetTo = Math.min(setTo, this.maxInitialWidth);\r\n\t\t\t\t}\r\n\t\t\t\tthis.setWidthActual(setTo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdateDefinition(updates){\r\n\t\tvar definition;\r\n\r\n\t\tif(!this.isGroup){\r\n\t\t\tif(!this.parent.isGroup){\r\n\t\t\t\tdefinition = Object.assign({}, this.getDefinition());\r\n\t\t\t\tdefinition = Object.assign(definition, updates);\r\n\r\n\t\t\t\treturn this.table.columnManager.addColumn(definition, false, this)\r\n\t\t\t\t.then((column) => {\r\n\r\n\t\t\t\t\tif(definition.field == this.field){\r\n\t\t\t\t\t\tthis.field = false; //cleair field name to prevent deletion of duplicate column from arrays\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn this.delete()\r\n\t\t\t\t\t.then(() => {\r\n\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Column Update Error - The updateDefinition function is only available on ungrouped columns\");\r\n\t\t\t\treturn Promise.reject(\"Column Update Error - The updateDefinition function is only available on columns, not column groups\");\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Column Update Error - The updateDefinition function is only available on ungrouped columns\");\r\n\t\t\treturn Promise.reject(\"Column Update Error - The updateDefinition function is only available on columns, not column groups\");\r\n\t\t}\r\n\t}\r\n\r\n\tdeleteCell(cell){\r\n\t\tvar index = this.cells.indexOf(cell);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.cells.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new ColumnComponent(this);\r\n\t\t}\r\n\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n\r\nColumn.defaultOptionList = defaultOptions;\r\n\r\nexport default Column;\r\n","export default class Helpers{\r\n\r\n\tstatic elVisible(el){\r\n\t\treturn !(el.offsetWidth <= 0 && el.offsetHeight <= 0);\r\n\t}\r\n\r\n\tstatic elOffset(el){\r\n\t\tvar box = el.getBoundingClientRect();\r\n\r\n\t\treturn {\r\n\t\t\ttop: box.top + window.pageYOffset - document.documentElement.clientTop,\r\n\t\t\tleft: box.left + window.pageXOffset - document.documentElement.clientLeft\r\n\t\t};\r\n\t}\r\n\r\n\tstatic deepClone(obj, clone, list = []){\r\n\t\tvar objectProto = {}.__proto__,\r\n\t\tarrayProto = [].__proto__;\r\n\r\n\t\tif (!clone){\r\n\t\t\tclone = Object.assign(Array.isArray(obj) ? [] : {}, obj);\r\n\t\t}\r\n\r\n\t\tfor(var i in obj) {\r\n\t\t\tlet subject = obj[i],\r\n\t\t\tmatch, copy;\r\n\r\n\t\t\tif(subject != null && typeof subject === \"object\" && (subject.__proto__ === objectProto || subject.__proto__ === arrayProto)){\r\n\t\t\t\tmatch = list.findIndex((item) => {\r\n\t\t\t\t\treturn item.subject === subject;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(match > -1){\r\n\t\t\t\t\tclone[i] = list[match].copy;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcopy = Object.assign(Array.isArray(subject) ? [] : {}, subject);\r\n\r\n\t\t\t\t\tlist.unshift({subject, copy});\r\n\r\n\t\t\t\t\tclone[i] = this.deepClone(subject, copy, list);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn clone;\r\n\t}\r\n}","export default class OptionsList {\r\n\tconstructor(table, msgType, defaults = {}){\r\n\t\tthis.table = table;\r\n\t\tthis.msgType = msgType;\r\n\t\tthis.registeredDefaults = Object.assign({}, defaults)\r\n\t}\r\n\r\n\tregister(option, value){\r\n\t\tthis.registeredDefaults[option] = value;\r\n\t}\r\n\r\n\tgenerate(defaultOptions, userOptions = {}){\r\n\t\tvar output = Object.assign({}, this.registeredDefaults);\r\n\r\n\t\tObject.assign(output, defaultOptions);\r\n\r\n\t\tif(userOptions.debugInvalidOptions !== false || this.table.options.debugInvalidOptions){\r\n\t\t\tfor (var key in userOptions){\r\n\t\t\t\tif(!output.hasOwnProperty(key)){\r\n\t\t\t\t\tconsole.warn(\"Invalid \" + this.msgType + \" option:\", key)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (var key in output){\r\n\t\t\tif(key in userOptions){\r\n\t\t\t\toutput[key] = userOptions[key];\r\n\t\t\t}else{\r\n\t\t\t\tif(Array.isArray(output[key])){\r\n\t\t\t\t\toutput[key] = Object.assign([], output[key]);\r\n\t\t\t\t}else if(typeof output[key] === \"object\" && output[key] !== null){\r\n\t\t\t\t\toutput[key] = Object.assign({}, output[key]);\r\n\t\t\t\t}else if (typeof output[key] === \"undefined\"){\r\n\t\t\t\t\tdelete output[key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from '../tools/Helpers.js';\r\n\r\nexport default class Renderer extends CoreFeature{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.elementVertical = table.rowManager.element;\r\n\t\tthis.elementHorizontal = table.columnManager.element;\r\n\t\tthis.tableElement = table.rowManager.tableElement;\r\n\r\n\t\tthis.verticalFillMode = \"fit\"; // used by row manager to determin how to size the render area (\"fit\" - fits container to the contents, \"fill\" - fills the contianer without resizing it)\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t/////// Internal Bindings /////////\r\n\t///////////////////////////////////\r\n\r\n\tinitialize(){\r\n\t\t//initialize core functionality\r\n\t}\r\n\r\n\tclearRows(){\r\n\t\t//clear down existing rows layout\r\n\t}\r\n\r\n\tclearColumns(){\r\n\t\t//clear down existing columns layout\r\n\t}\r\n\r\n\r\n\treinitializeColumnWidths(columns){\r\n\t\t//resize columns to fit data\r\n\t}\r\n\r\n\r\n\trenderRows(){\r\n\t\t//render rows from a clean slate\r\n\t}\r\n\r\n\trenderColumns(){\r\n\t\t//render columns from a clean slate\r\n\t}\r\n\r\n\trerenderRows(callback){\r\n\t\t// rerender rows and keep position\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\t}\r\n\r\n\trerenderColumns(update, blockRedraw){\r\n\t\t//rerender columns\r\n\t}\r\n\r\n\trenderRowCells(row){\r\n\t\t//render the cells in a row\r\n\t}\r\n\r\n\trerenderRowCells(row, force){\r\n\t\t//rerender the cells in a row\r\n\t}\r\n\r\n\tscrollColumns(left, dir){\r\n\t\t//handle horizontal scrolling\r\n\t}\r\n\r\n\tscrollRows(top, dir){\r\n\t\t//handle vertical scolling\r\n\t}\r\n\r\n\tresize(){\r\n\t\t//container has rezied, carry out any needed recalculations (DO NOT RERENDER IN THIS FUNCTION)\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\t//scroll to a specific row\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\t//determine weather the row is nearest the top or bottom of the table, retur true for top or false for bottom\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\t//return the visible rows\r\n\t\treturn [];\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t//////// Helper Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\trows(){\r\n\t\treturn this.table.rowManager.getDisplayRows();\r\n\t}\r\n\r\n\tstyleRow(row, index){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tif(index % 2){\r\n\t\t\trowEl.classList.add(\"tabulator-row-even\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-odd\");\r\n\t\t}else{\r\n\t\t\trowEl.classList.add(\"tabulator-row-odd\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-even\");\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t/////// External Triggers /////////\r\n\t/////// (DO NOT OVERRIDE) /////////\r\n\t///////////////////////////////////\r\n\r\n\tclear(){\r\n\t\t//clear down existing layout\r\n\t\tthis.clearRows();\r\n\t\tthis.clearColumns();\r\n\t}\r\n\r\n\trender(){\r\n\t\t//render from a clean slate\r\n\t\tthis.renderRows();\r\n\t\tthis.renderColumns();\r\n\t}\r\n\r\n\trerender(callback){\r\n\t\t// rerender and keep position\r\n\t\tthis.rerenderRows();\r\n\t\tthis.rerenderColumns();\r\n\t}\r\n\r\n\tscrollToRowPosition(row, position, ifVisible){\r\n\t\tvar rowIndex = this.rows().indexOf(row),\r\n\t\trowEl = row.getElement(),\r\n\t\toffset = 0;\r\n\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tif(rowIndex > -1){\r\n\r\n\t\t\t\tif(typeof ifVisible === \"undefined\"){\r\n\t\t\t\t\tifVisible = this.table.options.scrollToRowIfVisible;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//check row visibility\r\n\t\t\t\tif(!ifVisible){\r\n\t\t\t\t\tif(Helpers.elVisible(rowEl)){\r\n\t\t\t\t\t\toffset = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(offset > 0 && offset < this.elementVertical.clientHeight - rowEl.offsetHeight){\r\n\t\t\t\t\t\t\tresolve();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(typeof position === \"undefined\"){\r\n\t\t\t\t\tposition = this.table.options.scrollToRowPosition;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(position === \"nearest\"){\r\n\t\t\t\t\tposition = this.scrollToRowNearestTop(row) ? \"top\" : \"bottom\"\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//scroll to row\r\n\t\t\t\tthis.scrollToRow(row);\r\n\r\n\t\t\t\t//align to correct position\r\n\t\t\t\tswitch(position){\r\n\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\tcase \"center\":\r\n\r\n\t\t\t\t\tif(this.elementVertical.scrollHeight - this.elementVertical.scrollTop == this.elementVertical.clientHeight){\r\n\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop + (rowEl.offsetTop - this.elementVertical.scrollTop) - ((this.elementVertical.scrollHeight - rowEl.offsetTop) / 2);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - (this.elementVertical.clientHeight / 2);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"bottom\":\r\n\r\n\t\t\t\t\tif(this.elementVertical.scrollHeight - this.elementVertical.scrollTop == this.elementVertical.clientHeight){\r\n\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - (this.elementVertical.scrollHeight - rowEl.offsetTop) + rowEl.offsetHeight;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - this.elementVertical.clientHeight + rowEl.offsetHeight;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"top\":\r\n\t\t\t\t\tthis.elementVertical.scrollTop = rowEl.offsetTop;\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tresolve();\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - Row not visible\");\r\n\t\t\t\treject(\"Scroll Error - Row not visible\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class BaiscHorizontal extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t}\r\n\r\n\trenderRowCells(row){\r\n\t\trow.cells.forEach((cell) => {\r\n\t\t\trow.element.appendChild(cell.getElement());\r\n\t\t\tcell.cellRendered();\r\n\t\t});\r\n\t}\r\n\r\n\treinitializeColumnWidths(columns){\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t});\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class VirtualDomHorizontal extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.leftCol = 0;\r\n\t\tthis.rightCol = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = 0;\r\n\t\tthis.vDomScrollPosRight = 0;\r\n\t\t\r\n\t\tthis.vDomPadLeft = 0;\r\n\t\tthis.vDomPadRight = 0;\r\n\t\t\r\n\t\tthis.fitDataColAvg = 0;\r\n\t\t\r\n\t\tthis.windowBuffer = 200; //pixel margin to make column visible before it is shown on screen\r\n\t\t\r\n\t\tthis.visibleRows = null;\r\n\r\n\t\tthis.initialized = false;\r\n\t\tthis.isFitData = false;\r\n\t\t\r\n\t\tthis.columns = [];\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.compatibilityCheck();\r\n\t\tthis.layoutCheck();\r\n\t\tthis.vertScrollListen();\r\n\t}\r\n\t\r\n\tcompatibilityCheck(){\r\n\t\tvar columns = this.options(\"columns\"),\r\n\t\tfrozen = false,\r\n\t\tok = true;\r\n\t\t\r\n\t\tif(this.options(\"layout\") == \"fitDataTable\"){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with fitDataTable layout mode\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.options(\"responsiveLayout\")){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with responsive columns\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.options(\"rtl\")){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not currently compatible with RTL text direction\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(columns){\r\n\t\t\tfrozen = columns.find((col) => {\r\n\t\t\t\treturn col.frozen;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(frozen){\r\n\t\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with frozen columns\");\r\n\t\t\t\tok = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// if(!ok){\r\n\t\t// \toptions.virtualDomHoz = false;\r\n\t\t// }\r\n\t\t\r\n\t\treturn ok;\r\n\t}\r\n\t\r\n\tlayoutCheck(){\r\n\t\tthis.isFitData = this.options(\"layout\").startsWith('fitData');\r\n\t}\r\n\r\n\tvertScrollListen(){\r\n\t\tthis.subscribe(\"scroll-vertical\", this.clearVisRowCache.bind(this));\r\n\t\tthis.subscribe(\"data-refreshed\", this.clearVisRowCache.bind(this));\r\n\t}\r\n\r\n\tclearVisRowCache(){\r\n\t\tthis.visibleRows = null;\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t///////// Public Functions ///////////\r\n\t//////////////////////////////////////\r\n\t\r\n\trenderColumns(row, force){\r\n\t\tthis.dataChange();\r\n\t}\r\n\r\n\t\r\n\tscrollColumns(left, dir){\r\n\t\tif(this.scrollLeft != left){\r\n\t\t\tthis.scrollLeft = left;\r\n\t\t\t\r\n\t\t\tthis.scroll(left - (this.vDomScrollPosLeft + this.windowBuffer));\r\n\t\t}\r\n\t}\r\n\t\r\n\tcalcWindowBuffer(){\r\n\t\tvar buffer = this.elementVertical.clientWidth;\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvar width = column.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tif(width > buffer){\r\n\t\t\t\t\tbuffer = width;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.windowBuffer = buffer * 2;\r\n\t}\r\n\t\r\n\trerenderColumns(update, blockRedraw){\t\t\r\n\t\tvar old = {\r\n\t\t\tcols:this.columns,\r\n\t\t\tleftCol:this.leftCol,\r\n\t\t\trightCol:this.rightCol,\r\n\t\t},\r\n\t\tcolPos = 0;\r\n\t\t\r\n\t\t\r\n\t\tif(update && !this.initialized){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tthis.clear();\r\n\t\t\r\n\t\tthis.calcWindowBuffer();\r\n\t\t\r\n\t\tthis.scrollLeft = this.elementVertical.scrollLeft;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = this.scrollLeft - this.windowBuffer;\r\n\t\tthis.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.windowBuffer;\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tvar config = {};\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvar width = column.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tconfig.leftPos = colPos;\r\n\t\t\t\tconfig.rightPos = colPos + width;\r\n\t\t\t\t\r\n\t\t\t\tconfig.width = width;\r\n\t\t\t\t\r\n\t\t\t\tif (this.isFitData) {\r\n\t\t\t\t\tconfig.fitDataCheck = column.modules.vdomHoz ? column.modules.vdomHoz.fitDataCheck : true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif((colPos + width > this.vDomScrollPosLeft) && (colPos < this.vDomScrollPosRight)){\r\n\t\t\t\t\t//column is visible\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.leftCol == -1){\r\n\t\t\t\t\t\tthis.leftCol = this.columns.length;\r\n\t\t\t\t\t\tthis.vDomPadLeft = colPos;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.rightCol = this.columns.length;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t// column is hidden\r\n\t\t\t\t\tif(this.leftCol !== -1){\r\n\t\t\t\t\t\tthis.vDomPadRight += width;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.columns.push(column);\r\n\t\t\t\t\r\n\t\t\t\tcolumn.modules.vdomHoz = config;\r\n\t\t\t\t\r\n\t\t\t\tcolPos += width;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t\r\n\t\tthis.initialized = true;\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tif(!update || this.reinitChanged(old)){\r\n\t\t\t\tthis.reinitializeRows();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.elementVertical.scrollLeft = this.scrollLeft;\r\n\t}\r\n\t\r\n\trenderRowCells(row){\r\n\t\tif(this.initialized){\r\n\t\t\tthis.initializeRow(row);\r\n\t\t}else{\r\n\t\t\trow.cells.forEach((cell) => {\r\n\t\t\t\trow.element.appendChild(cell.getElement());\r\n\t\t\t\tcell.cellRendered();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\trerenderRowCells(row, force){\r\n\t\tthis.reinitializeRow(row, force);\r\n\t}\r\n\t\r\n\treinitializeColumnWidths(columns){\r\n\t\tfor(let i = this.leftCol; i <= this.rightCol; i++){\r\n\t\t\tthis.columns[i].reinitializeWidth();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t//////// Internal Rendering //////////\r\n\t//////////////////////////////////////\r\n\t\r\n\tdeinitialize(){\r\n\t\tthis.initialized = false;\r\n\t}\r\n\t\r\n\tclear(){\r\n\t\tthis.columns = [];\r\n\t\t\r\n\t\tthis.leftCol = -1;\r\n\t\tthis.rightCol = 0;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = 0;\r\n\t\tthis.vDomScrollPosRight = 0;\r\n\t\tthis.vDomPadLeft = 0;\r\n\t\tthis.vDomPadRight = 0;\r\n\t}\r\n\t\r\n\tdataChange(){\r\n\t\tvar change = false,\r\n\t\tcollsWidth = 0,\r\n\t\tcolEnd = 0,\r\n\t\tgroup, row, rowEl;\r\n\t\t\r\n\t\tif(this.isFitData){\r\n\t\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\t\tif(!column.definition.width && column.visible){\r\n\t\t\t\t\tchange = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(change){\r\n\t\t\t\tif(change && this.table.rowManager.getDisplayRows().length){\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.windowBuffer;\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar row = this.chain(\"rows-sample\", [1], [], () => {\r\n\t\t\t\t\t\treturn this.table.rowManager.getDisplayRows();\r\n\t\t\t\t\t})[0];\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trowEl = row.getElement();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trow.generateCells();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.tableElement.appendChild(rowEl);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor(var colEnd = 0; colEnd < row.cells.length; colEnd++){\r\n\t\t\t\t\t\t\tlet cell = row.cells[colEnd];\r\n\t\t\t\t\t\t\trowEl.appendChild(cell.getElement());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcell.column.reinitializeWidth();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcollsWidth += cell.column.getWidth();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// if(collsWidth > this.vDomScrollPosRight){\r\n\t\t\t\t\t\t\t// \tbreak;\r\n\t\t\t\t\t\t\t// }\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// this.fitDataColAvg = Math.floor(collsWidth / (colEnd + 1));\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// for(colEnd; colEnd < this.table.columnManager.columnsByIndex.length; colEnd++){\r\n\t\t\t\t\t\t// \tthis.table.columnManager.columnsByIndex[colEnd].setWidth(this.fitDataColAvg);\r\n\t\t\t\t\t\t// }\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.rerenderColumns(false, true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.options(\"layout\") === \"fitColumns\"){\r\n\t\t\t\tthis.layoutRefresh();\r\n\t\t\t\tthis.rerenderColumns(false, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitChanged(old){\r\n\t\tvar match = true;\r\n\t\t\r\n\t\tif(old.cols.length !== this.columns.length || old.leftCol !== this.leftCol || old.rightCol !== this.rightCol){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\told.cols.forEach((col, i) => {\r\n\t\t\tif(col !== this.columns[i]){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn !match;\r\n\t}\r\n\t\r\n\treinitializeRows(){\r\n\t\tvar rows = this.getVisibleRows();\r\n\t\trows.forEach((row) => {\r\n\t\t\tthis.reinitializeRow(row, true);\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetVisibleRows(){\r\n\t\tif (!this.visibleRows){\r\n\t\t\tthis.visibleRows = this.table.rowManager.getVisibleRows();\r\n\t\t}\r\n\r\n\t\treturn this.visibleRows;\t\r\n\t}\r\n\t\r\n\tscroll(diff){\r\n\t\tthis.vDomScrollPosLeft += diff;\r\n\t\tthis.vDomScrollPosRight += diff;\r\n\r\n\t\tif(Math.abs(diff) > (this.windowBuffer / 2)){\r\n\t\t\tthis.rerenderColumns();\r\n\t\t}else{\r\n\t\t\tif(diff > 0){\r\n\t\t\t\t//scroll right\r\n\t\t\t\tthis.addColRight();\r\n\t\t\t\tthis.removeColLeft();\r\n\t\t\t}else{\r\n\t\t\t\t//scroll left\r\n\t\t\t\tthis.addColLeft();\r\n\t\t\t\tthis.removeColRight();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolPositionAdjust (start, end, diff){\r\n\t\tfor(let i = start; i < end; i++){\r\n\t\t\tlet column = this.columns[i];\r\n\t\t\t\r\n\t\t\tcolumn.modules.vdomHoz.leftPos += diff;\r\n\t\t\tcolumn.modules.vdomHoz.rightPos += diff;\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColRight(){\r\n\t\tvar changes = false;\r\n\t\t\r\n\t\twhile(true){\r\n\t\t\t\r\n\t\t\tlet column = this.columns[this.rightCol + 1];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.leftPos <= this.vDomScrollPosRight){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\trow.getElement().appendChild(cell.getElement());\r\n\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.fitDataColActualWidthCheck(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.rightCol++; // Don't move this below the >= check below\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.rightCol >= (this.columns.length - 1)){\r\n\t\t\t\t\t\tthis.vDomPadRight = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomPadRight -= column.getWidth();\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColLeft(){\r\n\t\tvar changes = false;\r\n\t\t\r\n\t\twhile(true){\r\n\t\t\tlet column = this.columns[this.leftCol - 1];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.rightPos >= this.vDomScrollPosLeft){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\trow.getElement().prepend(cell.getElement());\r\n\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.leftCol--; // don't move this below the <= check below\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.leftCol <= 0){ // replicating logic in addColRight\r\n\t\t\t\t\t\tthis.vDomPadLeft = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomPadLeft -= column.getWidth();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tlet diff = this.fitDataColActualWidthCheck(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(diff){\r\n\t\t\t\t\t\tthis.scrollLeft = this.elementVertical.scrollLeft = this.elementVertical.scrollLeft + diff;\r\n\t\t\t\t\t\tthis.vDomPadRight -= diff;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveColRight(){\r\n\t\tvar changes = false;\r\n\t\t\r\n\t\twhile(true){\r\n\t\t\tlet column = this.columns[this.rightCol];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.leftPos > this.vDomScrollPosRight){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\trow.getElement().removeChild(cell.getElement());\r\n\t\t\t\t\t\t\t} catch (ex) {\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Could not removeColRight\", ex.message)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.vDomPadRight += column.getWidth();\r\n\t\t\t\t\tthis.rightCol --;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveColLeft(){\r\n\t\tvar changes = false;\r\n\t\t\r\n\t\twhile(true){\r\n\t\t\tlet column = this.columns[this.leftCol];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.rightPos < this.vDomScrollPosLeft){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\t\t\t\t\t\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\trow.getElement().removeChild(cell.getElement());\r\n\t\t\t\t\t\t\t} catch (ex) {\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Could not removeColLeft\", ex.message)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.vDomPadLeft += column.getWidth();\r\n\t\t\t\t\tthis.leftCol ++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\tfitDataColActualWidthCheck(column){\r\n\t\tvar newWidth, widthDiff;\r\n\t\t\r\n\t\tif(column.modules.vdomHoz.fitDataCheck){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t\t\r\n\t\t\tnewWidth = column.getWidth();\r\n\t\t\twidthDiff = newWidth - column.modules.vdomHoz.width;\r\n\t\t\t\r\n\t\t\tif(widthDiff){\r\n\t\t\t\tcolumn.modules.vdomHoz.rightPos += widthDiff;\r\n\t\t\t\tcolumn.modules.vdomHoz.width = newWidth;\r\n\t\t\t\tthis.colPositionAdjust(this.columns.indexOf(column) + 1, this.columns.length, widthDiff);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.vdomHoz.fitDataCheck = false;\r\n\t\t}\r\n\t\t\r\n\t\treturn widthDiff;\r\n\t}\r\n\t\r\n\tinitializeRow(row){\r\n\t\tif(row.type !== \"group\"){\r\n\t\t\trow.modules.vdomHoz = {\r\n\t\t\t\tleftCol:this.leftCol,\r\n\t\t\t\trightCol:this.rightCol,\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tfor(let i = this.leftCol; i <= this.rightCol; i++){\r\n\t\t\t\tlet column = this.columns[i];\r\n\t\t\t\t\r\n\t\t\t\tif(column && column.visible){\r\n\t\t\t\t\tlet cell = row.getCell(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\trow.getElement().appendChild(cell.getElement());\r\n\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeRow(row, force){\r\n\t\tif(row.type !== \"group\"){\r\n\t\t\tif(force || !row.modules.vdomHoz || row.modules.vdomHoz.leftCol !== this.leftCol || row.modules.vdomHoz.rightCol !== this.rightCol){\r\n\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\twhile(rowEl.firstChild) rowEl.removeChild(rowEl.firstChild);\r\n\t\t\t\t\r\n\t\t\t\tthis.initializeRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Column from './column/Column.js';\r\nimport ColumnComponent from './column/ColumnComponent.js';\r\nimport Helpers from './tools/Helpers.js';\r\nimport OptionsList from './tools/OptionsList.js';\r\n\r\nimport RendererBasicHorizontal from './rendering/renderers/BasicHorizontal.js';\r\nimport RendererVirtualDomHorizontal from './rendering/renderers/VirtualDomHorizontal.js';\r\n\r\nimport defaultColumnOptions from './column/defaults/options.js';\r\n\r\nexport default class ColumnManager extends CoreFeature {\r\n\r\n\tconstructor (table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.blockHozScrollEvent = false;\r\n\t\tthis.headersElement = null;\r\n\t\tthis.element = null ; //containing element\r\n\t\tthis.columns = []; // column definition object\r\n\t\tthis.columnsByIndex = []; //columns by index\r\n\t\tthis.columnsByField = {}; //columns by field\r\n\t\tthis.scrollLeft = 0;\r\n\t\tthis.optionsList = new OptionsList(this.table, \"column definition\", defaultColumnOptions);\r\n\r\n\t\tthis.renderer = null;\r\n\t}\r\n\r\n\t////////////// Setup Functions /////////////////\r\n\r\n\tinitialize(){\r\n\t\tthis.initializeRenderer();\r\n\r\n\t\tthis.headersElement = this.createHeadersElement();\r\n\t\tthis.element = this.createHeaderElement();\r\n\r\n\t\tthis.element.insertBefore(this.headersElement, this.element.firstChild);\r\n\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t}\r\n\r\n\tinitializeRenderer(){\r\n\t\tvar renderClass;\r\n\r\n\t\tvar renderers = {\r\n\t\t\t\"virtual\": RendererVirtualDomHorizontal,\r\n\t\t\t\"basic\": RendererBasicHorizontal,\r\n\t\t};\r\n\r\n\t\tif(typeof this.table.options.renderHorizontal === \"string\"){\r\n\t\t\trenderClass = renderers[this.table.options.renderHorizontal];\r\n\t\t}else{\r\n\t\t\trenderClass = this.table.options.renderHorizontal;\r\n\t\t}\r\n\r\n\t\tif(renderClass){\r\n\t\t\tthis.renderer = new renderClass(this.table, this.element, this.tableElement);\r\n\t\t\tthis.renderer.initialize();\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Unable to find matching renderer:\", table.options.renderHorizontal);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tcreateHeadersElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-headers\");\r\n\t\tel.setAttribute(\"role\", \"row\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tcreateHeaderElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-header\");\r\n\t\tel.setAttribute(\"role\", \"rowgroup\");\r\n\r\n\t\tif(!this.table.options.headerVisible){\r\n\t\t\tel.classList.add(\"tabulator-header-hidden\");\r\n\t\t}\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\t//return containing element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\t//return header containing element\r\n\tgetHeadersElement(){\r\n\t\treturn this.headersElement;\r\n\t}\r\n\r\n\t//scroll horizontally to match table body\r\n\tscrollHorizontal(left){\r\n\t\tvar hozAdjust = 0,\r\n\t\tscrollWidth = this.element.scrollWidth - this.table.element.clientWidth;\r\n\r\n\t\t// this.tempScrollBlock();\r\n\t\tthis.element.scrollLeft = left;\r\n\r\n\t\t//adjust for vertical scrollbar moving table when present\r\n\t\tif(left > scrollWidth){\r\n\t\t\thozAdjust = left - scrollWidth;\r\n\t\t\tthis.element.style.marginLeft = (-(hozAdjust)) + \"px\";\r\n\t\t}else{\r\n\t\t\tthis.element.style.marginLeft = 0;\r\n\t\t}\r\n\r\n\t\tthis.scrollLeft = left;\r\n\r\n\t\tthis.renderer.scrollColumns(left);\r\n\t}\r\n\r\n\t///////////// Column Setup Functions /////////////\r\n\tgenerateColumnsFromRowData(data){\r\n\t\tvar cols = [],\r\n\t\tdefinitions = this.table.options.autoColumnsDefinitions,\r\n\t\trow, sorter;\r\n\r\n\t\tif(data && data.length){\r\n\r\n\t\t\trow = data[0];\r\n\r\n\t\t\tfor(var key in row){\r\n\t\t\t\tlet col = {\r\n\t\t\t\t\tfield:key,\r\n\t\t\t\t\ttitle:key,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tlet value = row[key];\r\n\r\n\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\tsorter = \"boolean\";\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\tif(Array.isArray(value)){\r\n\t\t\t\t\t\tsorter = \"array\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\tif(!isNaN(value) && value !== \"\"){\r\n\t\t\t\t\t\tsorter = \"number\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)){\r\n\t\t\t\t\t\t\tsorter = \"alphanum\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcol.sorter = sorter;\r\n\r\n\t\t\t\tcols.push(col);\r\n\t\t\t}\r\n\r\n\t\t\tif(definitions){\r\n\r\n\t\t\t\tswitch(typeof definitions){\r\n\t\t\t\t\tcase \"function\":\r\n\t\t\t\t\tthis.table.options.columns = definitions.call(this.table, cols);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\tif(Array.isArray(definitions)){\r\n\t\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\t\tvar match = definitions.find((def) => {\r\n\t\t\t\t\t\t\t\treturn def.field === col.field;\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\tif(match){\r\n\t\t\t\t\t\t\t\tObject.assign(col, match);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\t\tif(definitions[col.field]){\r\n\t\t\t\t\t\t\t\tObject.assign(col, definitions[col.field]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.table.options.columns = cols;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.table.options.columns = cols;\r\n\t\t\t}\r\n\r\n\t\t\tthis.setColumns(this.table.options.columns);\r\n\t\t}\r\n\t}\r\n\r\n\tsetColumns(cols, row){\r\n\t\twhile(this.headersElement.firstChild) this.headersElement.removeChild(this.headersElement.firstChild);\r\n\r\n\t\tthis.columns = [];\r\n\t\tthis.columnsByIndex = [];\r\n\t\tthis.columnsByField = {};\r\n\r\n\t\tthis.dispatch(\"columns-loading\");\r\n\r\n\t\tcols.forEach((def, i) => {\r\n\t\t\tthis._addColumn(def);\r\n\t\t});\r\n\r\n\t\tthis._reIndexColumns();\r\n\r\n\t\tthis.dispatch(\"columns-loaded\");\r\n\r\n\t\tthis.renderer.rerenderColumns(false, true);\r\n\r\n\t\tthis.redraw(true);\r\n\t}\r\n\r\n\t_addColumn(definition, before, nextToColumn){\r\n\t\tvar column = new Column(definition, this),\r\n\t\tcolEl = column.getElement(),\r\n\t\tindex = nextToColumn ? this.findColumnIndex(nextToColumn) : nextToColumn;\r\n\r\n\t\tif(nextToColumn && index > -1){\r\n\t\t\tvar topColumn = nextToColumn.getTopColumn()\r\n\t\t\tvar parentIndex = this.columns.indexOf(topColumn);\r\n\t\t\tvar nextEl = topColumn.getElement();\r\n\r\n\t\t\tif(before){\r\n\t\t\t\tthis.columns.splice(parentIndex, 0, column);\r\n\t\t\t\tnextEl.parentNode.insertBefore(colEl, nextEl);\r\n\t\t\t}else{\r\n\t\t\t\tthis.columns.splice(parentIndex + 1, 0, column);\r\n\t\t\t\tnextEl.parentNode.insertBefore(colEl, nextEl.nextSibling);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(before){\r\n\t\t\t\tthis.columns.unshift(column);\r\n\t\t\t\tthis.headersElement.insertBefore(column.getElement(), this.headersElement.firstChild);\r\n\t\t\t}else{\r\n\t\t\t\tthis.columns.push(column);\r\n\t\t\t\tthis.headersElement.appendChild(column.getElement());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcolumn.columnRendered();\r\n\r\n\t\treturn column;\r\n\t}\r\n\r\n\tregisterColumnField(col){\r\n\t\tif(col.definition.field){\r\n\t\t\tthis.columnsByField[col.definition.field] = col;\r\n\t\t}\r\n\t}\r\n\r\n\tregisterColumnPosition(col){\r\n\t\tthis.columnsByIndex.push(col);\r\n\t}\r\n\r\n\t_reIndexColumns(){\r\n\t\tthis.columnsByIndex = [];\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.reRegisterPosition();\r\n\t\t});\r\n\t}\r\n\r\n\t//ensure column headers take up the correct amount of space in column groups\r\n\tverticalAlignHeaders(){\r\n\t\tvar minHeight = 0;\r\n\r\n\t\tthis.columns.forEach((column) => {\r\n\t\t\tvar height;\r\n\r\n\t\t\tcolumn.clearVerticalAlign();\r\n\r\n\t\t\theight = column.getHeight();\r\n\r\n\t\t\tif(height > minHeight){\r\n\t\t\t\tminHeight = height;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.columns.forEach((column) => {\r\n\t\t\tcolumn.verticalAlign(this.table.options.columnHeaderVertAlign, minHeight);\r\n\t\t});\r\n\r\n\t\tthis.table.rowManager.adjustTableSize();\r\n\t}\r\n\r\n\t//////////////// Column Details /////////////////\r\n\tfindColumn(subject){\r\n\t\tif(typeof subject == \"object\"){\r\n\r\n\t\t\tif(subject instanceof Column){\r\n\t\t\t\t//subject is column element\r\n\t\t\t\treturn subject;\r\n\t\t\t}else if(subject instanceof ColumnComponent){\r\n\t\t\t\t//subject is public column component\r\n\t\t\t\treturn subject._getSelf() || false;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\t\t\t\t//subject is a HTML element of the column header\r\n\t\t\t\tlet match = this.columns.find((column) => {\r\n\t\t\t\t\treturn column.element === subject;\r\n\t\t\t\t});\r\n\r\n\t\t\t\treturn match || false;\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the field name of the column\r\n\t\t\treturn this.columnsByField[subject] || false;\r\n\t\t}\r\n\r\n\t\t//catch all for any other type of input\r\n\t\treturn false;\r\n\t}\r\n\r\n\tgetColumnByField(field){\r\n\t\treturn this.columnsByField[field];\r\n\t}\r\n\r\n\tgetColumnsByFieldRoot(root){\r\n\t\tvar matches = [];\r\n\r\n\t\tObject.keys(this.columnsByField).forEach((field) => {\r\n\t\t\tvar fieldRoot = field.split(\".\")[0];\r\n\t\t\tif(fieldRoot === root){\r\n\t\t\t\tmatches.push(this.columnsByField[field]);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn matches;\r\n\t}\r\n\r\n\tgetColumnByIndex(index){\r\n\t\treturn this.columnsByIndex[index];\r\n\t}\r\n\r\n\tgetFirstVisibleColumn(index){\r\n\t\tvar index = this.columnsByIndex.findIndex((col) => {\r\n\t\t\treturn col.visible;\r\n\t\t});\r\n\r\n\t\treturn index > -1 ? this.columnsByIndex[index] : false;\r\n\t}\r\n\r\n\tgetColumns(){\r\n\t\treturn this.columns;\r\n\t}\r\n\r\n\tfindColumnIndex(column){\r\n\t\treturn this.columnsByIndex.findIndex((col) => {\r\n\t\t\treturn column === col;\r\n\t\t});\r\n\t}\r\n\r\n\t//return all columns that are not groups\r\n\tgetRealColumns(){\r\n\t\treturn this.columnsByIndex;\r\n\t}\r\n\r\n\t//travers across columns and call action\r\n\ttraverse(callback){\r\n\t\tthis.columnsByIndex.forEach((column,i) =>{\r\n\t\t\tcallback(column, i);\r\n\t\t});\r\n\t}\r\n\r\n\t//get defintions of actual columns\r\n\tgetDefinitions(active){\r\n\t\tvar output = [];\r\n\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tif(!active || (active && column.visible)){\r\n\t\t\t\toutput.push(column.getDefinition());\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//get full nested definition tree\r\n\tgetDefinitionTree(){\r\n\t\tvar output = [];\r\n\r\n\t\tthis.columns.forEach((column) => {\r\n\t\t\toutput.push(column.getDefinition(true));\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetComponents(structured){\r\n\t\tvar output = [],\r\n\t\tcolumns = structured ? this.columns : this.columnsByIndex;\r\n\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\toutput.push(column.getComponent());\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\tvar width = 0;\r\n\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tif(column.visible){\r\n\t\t\t\twidth += column.getWidth();\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn width;\r\n\t}\r\n\r\n\tmoveColumn(from, to, after){\r\n\t\tthis.moveColumnActual(from, to, after);\r\n\r\n\t\tto.element.parentNode.insertBefore(from.element, to.element);\r\n\r\n\t\tif(after){\r\n\t\t\tto.element.parentNode.insertBefore(to.element, from.element);\r\n\t\t}\r\n\r\n\t\tthis.verticalAlignHeaders();\r\n\r\n\t\tthis.table.rowManager.reinitialize();\r\n\t}\r\n\r\n\tmoveColumnActual(from, to, after){\r\n\t\tif(from.parent.isGroup){\r\n\t\t\tthis._moveColumnInArray(from.parent.columns, from, to, after);\r\n\t\t}else{\r\n\t\t\tthis._moveColumnInArray(this.columns, from, to, after);\r\n\t\t}\r\n\r\n\t\tthis._moveColumnInArray(this.columnsByIndex, from, to, after, true);\r\n\r\n\t\tthis.renderer.rerenderColumns(true);\r\n\r\n\t\tthis.dispatch(\"column-moved\", from, to, after);\r\n\r\n\t\tif(this.subscribedExternal(\"columnMoved\")){\r\n\t\t\tthis.dispatchExternal(\"columnMoved\", from.getComponent(), this.table.columnManager.getComponents());\r\n\t\t}\r\n\t}\r\n\r\n\t_moveColumnInArray(columns, from, to, after, updateRows){\r\n\t\tvar\tfromIndex = columns.indexOf(from),\r\n\t\ttoIndex, rows = [];\r\n\r\n\t\tif (fromIndex > -1) {\r\n\r\n\t\t\tcolumns.splice(fromIndex, 1);\r\n\r\n\t\t\ttoIndex = columns.indexOf(to);\r\n\r\n\t\t\tif (toIndex > -1) {\r\n\r\n\t\t\t\tif(after){\r\n\t\t\t\t\ttoIndex = toIndex+1;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\ttoIndex = fromIndex;\r\n\t\t\t}\r\n\r\n\t\t\tcolumns.splice(toIndex, 0, from);\r\n\r\n\t\t\tif(updateRows){\r\n\r\n\t\t\t\trows = this.chain(\"column-moving-rows\", [from, to, after], null, []) || [];\r\n\r\n\t\t\t\trows = rows.concat(this.table.rowManager.rows);\r\n\r\n\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\tif(row.cells.length){\r\n\t\t\t\t\t\tvar cell = row.cells.splice(fromIndex, 1)[0];\r\n\t\t\t\t\t\trow.cells.splice(toIndex, 0, cell);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tscrollToColumn(column, position, ifVisible){\r\n\t\tvar left = 0,\r\n\t\toffset = 0,\r\n\t\tadjust = 0,\r\n\t\tcolEl = column.getElement();\r\n\r\n\t\treturn new Promise((resolve, reject) => {\r\n\r\n\t\t\tif(typeof position === \"undefined\"){\r\n\t\t\t\tposition = this.table.options.scrollToColumnPosition;\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof ifVisible === \"undefined\"){\r\n\t\t\t\tifVisible = this.table.options.scrollToColumnIfVisible;\r\n\t\t\t}\r\n\r\n\t\t\tif(column.visible){\r\n\r\n\t\t\t\t//align to correct position\r\n\t\t\t\tswitch(position){\r\n\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\tcase \"center\":\r\n\t\t\t\t\tadjust = -this.element.clientWidth / 2;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"right\":\r\n\t\t\t\t\tadjust = colEl.clientWidth - this.headersElement.clientWidth;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//check column visibility\r\n\t\t\t\tif(!ifVisible){\r\n\r\n\t\t\t\t\toffset = colEl.offsetLeft;\r\n\r\n\t\t\t\t\tif(offset > 0 && offset + colEl.offsetWidth < this.element.clientWidth){\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//calculate scroll position\r\n\t\t\t\tleft = colEl.offsetLeft + adjust;\r\n\r\n\t\t\t\tleft = Math.max(Math.min(left, this.table.rowManager.element.scrollWidth - this.table.rowManager.element.clientWidth),0);\r\n\r\n\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\tthis.scrollHorizontal(left);\r\n\r\n\t\t\t\tresolve();\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - Column not visible\");\r\n\t\t\t\treject(\"Scroll Error - Column not visible\");\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t}\r\n\r\n\t//////////////// Cell Management /////////////////\r\n\tgenerateCells(row){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tcells.push(column.generateCell(row));\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\t//////////////// Column Management /////////////////\r\n\tgetFlexBaseWidth(){\r\n\t\tvar totalWidth = this.table.element.clientWidth, //table element width\r\n\t\tfixedWidth = 0;\r\n\r\n\t\t//adjust for vertical scrollbar if present\r\n\t\tif(this.table.rowManager.element.scrollHeight > this.table.rowManager.element.clientHeight){\r\n\t\t\ttotalWidth -= this.table.rowManager.element.offsetWidth - this.table.rowManager.element.clientWidth;\r\n\t\t}\r\n\r\n\t\tthis.columnsByIndex.forEach(function(column){\r\n\t\t\tvar width, minWidth, colWidth;\r\n\r\n\t\t\tif(column.visible){\r\n\r\n\t\t\t\twidth = column.definition.width || 0;\r\n\r\n\t\t\t\tminWidth = parseInt(column.minWidth);\r\n\r\n\t\t\t\tif(typeof(width) == \"string\"){\r\n\t\t\t\t\tif(width.indexOf(\"%\") > -1){\r\n\t\t\t\t\t\tcolWidth = (totalWidth / 100) * parseInt(width) ;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tcolWidth = parseInt(width);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolWidth = width;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfixedWidth += colWidth > minWidth ? colWidth : minWidth;\r\n\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn fixedWidth;\r\n\t}\r\n\r\n\taddColumn(definition, before, nextToColumn){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar column = this._addColumn(definition, before, nextToColumn);\r\n\r\n\t\t\tthis._reIndexColumns();\r\n\r\n\t\t\tthis.dispatch(\"column-add\", definition, before, nextToColumn);\r\n\r\n\t\t\tif(this.layoutMode() != \"fitColumns\"){\r\n\t\t\t\tcolumn.reinitializeWidth();\r\n\t\t\t}\r\n\r\n\t\t\tthis.redraw(true);\r\n\r\n\t\t\tthis.table.rowManager.reinitialize();\r\n\r\n\t\t\tthis.renderer.rerenderColumns();\r\n\r\n\t\t\tresolve(column);\r\n\t\t});\r\n\t}\r\n\r\n\t//remove column from system\r\n\tderegisterColumn(column){\r\n\t\tvar field = column.getField(),\r\n\t\tindex;\r\n\r\n\t\t//remove from field list\r\n\t\tif(field){\r\n\t\t\tdelete this.columnsByField[field];\r\n\t\t}\r\n\r\n\t\t//remove from index list\r\n\t\tindex = this.columnsByIndex.indexOf(column);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.columnsByIndex.splice(index, 1);\r\n\t\t}\r\n\r\n\t\t//remove from column list\r\n\t\tindex = this.columns.indexOf(column);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.columns.splice(index, 1);\r\n\t\t}\r\n\r\n\t\tthis.verticalAlignHeaders();\r\n\r\n\t\tthis.redraw();\r\n\t}\r\n\r\n\t//redraw columns\r\n\tredraw(force){\r\n\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\tthis.verticalAlignHeaders();\r\n\t\t}\r\n\r\n\t\tif(force){\r\n\t\t\tthis.table.rowManager.resetScroll();\r\n\t\t\tthis.table.rowManager.reinitialize();\r\n\t\t}\r\n\r\n\t\tif(!this.confirm(\"table-redrawing\", force)){\r\n\t\t\tthis.layoutRefresh();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"table-redraw\", force);\r\n\r\n\t\tthis.table.footerManager.redraw();\r\n\t}\r\n}","//public row object\r\nexport default class RowComponent {\r\n\r\n\tconstructor (row){\r\n\t\tthis._row = row;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._row.table.componentFunctionBinder.handle(\"row\", target._row, name)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\tgetData(transform){\r\n\t\treturn this._row.getData(transform);\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._row.getElement();\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._row.getCells().forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tgetCell(column){\r\n\t\tvar cell = this._row.getCell(column);\r\n\t\treturn cell ? cell.getComponent() : false;\r\n\t}\r\n\r\n\tgetIndex(){\r\n\t\treturn this._row.getData(\"data\")[this._row.table.options.index];\r\n\t}\r\n\r\n\tgetPosition(active){\r\n\t\treturn this._row.table.rowManager.getRowPosition(this._row, active);\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn this._row.delete();\r\n\t}\r\n\r\n\tscrollTo(){\r\n\t\treturn this._row.table.rowManager.scrollToRow(this._row);\r\n\t}\r\n\r\n\tmove(to, after){\r\n\t\tthis._row.moveToRow(to, after);\r\n\t}\r\n\r\n\tupdate(data){\r\n\t\treturn this._row.updateData(data);\r\n\t}\r\n\r\n\tnormalizeHeight(){\r\n\t\tthis._row.normalizeHeight(true);\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._row;\r\n\t}\r\n\r\n\treformat(){\r\n\t\treturn this._row.reinitialize();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._row.table;\r\n\t}\r\n\r\n\tgetNextRow(){\r\n\t\tvar row = this._row.nextRow();\r\n\t\treturn row ? row.getComponent() : row;\r\n\t}\r\n\r\n\tgetPrevRow(){\r\n\t\tvar row = this._row.prevRow();\r\n\t\treturn row ? row.getComponent() : row;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport RowComponent from './RowComponent.js';\r\nimport Helpers from '../tools/Helpers.js';\r\n\r\nexport default class Row extends CoreFeature{\r\n\tconstructor (data, parent, type = \"row\"){\r\n\t\tsuper(parent.table);\r\n\t\t\r\n\t\tthis.parent = parent;\r\n\t\tthis.data = {};\r\n\t\tthis.type = type; //type of element\r\n\t\tthis.element = false;\r\n\t\tthis.modules = {}; //hold module variables;\r\n\t\tthis.cells = [];\r\n\t\tthis.height = 0; //hold element height\r\n\t\tthis.heightStyled = \"\"; //hold element height prestyled to improve render efficiency\r\n\t\tthis.manualHeight = false; //user has manually set row height\r\n\t\tthis.outerHeight = 0; //hold elements outer height\r\n\t\tthis.initialized = false; //element has been rendered\r\n\t\tthis.heightInitialized = false; //element has resized cells to fit\r\n\t\t\r\n\t\tthis.component = null;\r\n\t\t\r\n\t\tthis.created = false;\r\n\t\t\r\n\t\tthis.setData(data);\r\n\t}\r\n\t\r\n\tcreate(){\r\n\t\tif(!this.created){\r\n\t\t\tthis.created = true;\r\n\t\t\tthis.generateElement();\r\n\t\t}\r\n\t}\r\n\t\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-row\");\r\n\t\tel.setAttribute(\"role\", \"row\");\r\n\t\t\r\n\t\tthis.element = el;\r\n\t}\r\n\t\r\n\tgetElement(){\r\n\t\tthis.create();\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\tdetachElement(){\r\n\t\tif (this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgenerateElement(){\r\n\t\tthis.createElement();\r\n\t\tthis.dispatch(\"row-init\", this);\r\n\t}\r\n\t\r\n\tgenerateCells(){\r\n\t\tthis.cells = this.table.columnManager.generateCells(this);\r\n\t}\r\n\t\r\n\t//functions to setup on first render\r\n\tinitialize(force){\r\n\t\tthis.create();\r\n\t\t\r\n\t\tif(!this.initialized || force){\r\n\t\t\t\r\n\t\t\tthis.deleteCells();\r\n\t\t\t\r\n\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout-before\", this);\r\n\t\t\t\r\n\t\t\tthis.generateCells();\r\n\t\t\t\r\n\t\t\tthis.initialized = true;\r\n\t\t\t\r\n\t\t\tthis.table.columnManager.renderer.renderRowCells(this);\r\n\t\t\t\r\n\t\t\tif(force){\r\n\t\t\t\tthis.normalizeHeight();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout\", this);\r\n\t\t\t\r\n\t\t\tif(this.table.options.rowFormatter){\r\n\t\t\t\tthis.table.options.rowFormatter(this.getComponent());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout-after\", this);\r\n\t\t}else{\r\n\t\t\tthis.table.columnManager.renderer.rerenderRowCells(this);\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeHeight(){\r\n\t\tthis.heightInitialized = false;\r\n\t\t\r\n\t\tif(this.element && this.element.offsetParent !== null){\r\n\t\t\tthis.normalizeHeight(true);\r\n\t\t}\r\n\t}\r\n\r\n\tdeinitialize(){\r\n\t\tthis.initialized = false;\r\n\t}\r\n\t\r\n\tdeinitializeHeight(){\r\n\t\tthis.heightInitialized = false;\r\n\t}\r\n\t\r\n\treinitialize(children){\r\n\t\tthis.initialized = false;\r\n\t\tthis.heightInitialized = false;\r\n\t\t\r\n\t\tif(!this.manualHeight){\r\n\t\t\tthis.height = 0;\r\n\t\t\tthis.heightStyled = \"\";\r\n\t\t}\r\n\t\t\r\n\t\tif(this.element && this.element.offsetParent !== null){\r\n\t\t\tthis.initialize(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatch(\"row-relayout\", this);\r\n\t}\r\n\t\r\n\t//get heights when doing bulk row style calcs in virtual DOM\r\n\tcalcHeight(force){\r\n\t\tvar maxHeight = 0,\r\n\t\tminHeight;\r\n\t\t\r\n\t\tif(this.table.options.rowHeight){\r\n\t\t\tthis.height = this.table.options.rowHeight;\r\n\t\t}else{\r\n\t\t\tminHeight = this.table.options.resizableRows ? this.element.clientHeight : 0;\r\n\t\t\t\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tvar height = cell.getHeight();\r\n\t\t\t\tif(height > maxHeight){\r\n\t\t\t\t\tmaxHeight = height;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(force){\r\n\t\t\t\tthis.height = Math.max(maxHeight, minHeight);\r\n\t\t\t}else{\r\n\t\t\t\tthis.height = this.manualHeight ? this.height : Math.max(maxHeight, minHeight);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.heightStyled = this.height ? this.height + \"px\" : \"\";\r\n\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t}\r\n\t\r\n\t//set of cells\r\n\tsetCellHeight(){\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setHeight();\r\n\t\t});\r\n\t\t\r\n\t\tthis.heightInitialized = true;\r\n\t}\r\n\t\r\n\tclearCellHeight(){\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.clearHeight();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//normalize the height of elements in the row\r\n\tnormalizeHeight(force){\r\n\t\tif(force && !this.table.options.rowHeight){\r\n\t\t\tthis.clearCellHeight();\r\n\t\t}\r\n\t\t\r\n\t\tthis.calcHeight(force);\r\n\t\t\r\n\t\tthis.setCellHeight();\r\n\t}\r\n\t\r\n\t//set height of rows\r\n\tsetHeight(height, force){\r\n\t\tif(this.height != height || force){\r\n\t\t\t\r\n\t\t\tthis.manualHeight = true;\r\n\t\t\t\r\n\t\t\tthis.height = height;\r\n\t\t\tthis.heightStyled = height ? height + \"px\" : \"\";\r\n\t\t\t\r\n\t\t\tthis.setCellHeight();\r\n\t\t\t\r\n\t\t\t// this.outerHeight = this.element.outerHeight();\r\n\t\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return rows outer height\r\n\tgetHeight(){\r\n\t\treturn this.outerHeight;\r\n\t}\r\n\t\r\n\t//return rows outer Width\r\n\tgetWidth(){\r\n\t\treturn this.element.offsetWidth;\r\n\t}\r\n\t\r\n\t//////////////// Cell Management /////////////////\r\n\tdeleteCell(cell){\r\n\t\tvar index = this.cells.indexOf(cell);\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.cells.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////// Data Management /////////////////\r\n\tsetData(data){\r\n\t\tthis.data = this.chain(\"row-data-init-before\", [this, data], undefined, data);\r\n\t\t\r\n\t\tthis.dispatch(\"row-data-init-after\", this);\r\n\t}\r\n\t\r\n\t//update the rows data\r\n\tupdateData(updatedData){\r\n\t\tvar visible = this.element && Helpers.elVisible(this.element),\r\n\t\ttempData = {},\r\n\t\tnewRowData;\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\r\n\t\t\tif(typeof updatedData === \"string\"){\r\n\t\t\t\tupdatedData = JSON.parse(updatedData);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-save-before\", this);\r\n\t\t\t\r\n\t\t\tif(this.subscribed(\"row-data-changing\")){\r\n\t\t\t\ttempData = Object.assign(tempData, this.data);\r\n\t\t\t\ttempData = Object.assign(tempData, updatedData);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tnewRowData = this.chain(\"row-data-changing\", [this, tempData, updatedData], null, updatedData);\r\n\t\t\t\r\n\t\t\t//set data\r\n\t\t\tfor (var attrname in newRowData) {\r\n\t\t\t\tthis.data[attrname] = newRowData[attrname];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-save-after\", this);\r\n\t\t\t\r\n\t\t\t//update affected cells only\r\n\t\t\tfor (var attrname in updatedData) {\r\n\t\t\t\t\r\n\t\t\t\tlet columns = this.table.columnManager.getColumnsByFieldRoot(attrname);\r\n\t\t\t\t\r\n\t\t\t\tcolumns.forEach((column) => {\r\n\t\t\t\t\tlet cell = this.getCell(column.getField());\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(cell){\r\n\t\t\t\t\t\tlet value = column.getFieldValue(newRowData);\r\n\t\t\t\t\t\tif(cell.getValue() != value){\r\n\t\t\t\t\t\t\tcell.setValueProcessData(value);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(visible){\r\n\t\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Partial reinitialization if visible\r\n\t\t\tif(visible){\r\n\t\t\t\tthis.normalizeHeight(true);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.rowFormatter){\r\n\t\t\t\t\tthis.table.options.rowFormatter(this.getComponent());\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.initialized = false;\r\n\t\t\t\tthis.height = 0;\r\n\t\t\t\tthis.heightStyled = \"\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-changed\", this, visible, updatedData);\r\n\t\t\t\r\n\t\t\t//this.reinitialize();\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"rowUpdated\", this.getComponent());\r\n\t\t\t\r\n\t\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetData(transform){\r\n\t\tif(transform){\r\n\t\t\treturn this.chain(\"row-data-retrieve\", [this, transform], null, this.data);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.data;\r\n\t}\r\n\t\r\n\tgetCell(column){\r\n\t\tvar match = false;\r\n\t\t\r\n\t\tcolumn = this.table.columnManager.findColumn(column);\r\n\t\t\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.generateCells();\r\n\t\t}\r\n\t\t\r\n\t\tmatch = this.cells.find(function(cell){\r\n\t\t\treturn cell.column === column;\r\n\t\t});\r\n\t\t\r\n\t\treturn match;\r\n\t}\r\n\t\r\n\tgetCellIndex(findCell){\r\n\t\treturn this.cells.findIndex(function(cell){\r\n\t\t\treturn cell === findCell;\r\n\t\t});\r\n\t}\r\n\t\r\n\tfindCell(subject){\r\n\t\treturn this.cells.find((cell) => {\r\n\t\t\treturn cell.element === subject;\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetCells(){\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.generateCells();\r\n\t\t}\r\n\t\t\r\n\t\treturn this.cells;\r\n\t}\r\n\t\r\n\tnextRow(){\r\n\t\tvar row = this.table.rowManager.nextDisplayRow(this, true);\r\n\t\treturn row || false;\r\n\t}\r\n\t\r\n\tprevRow(){\r\n\t\tvar row = this.table.rowManager.prevDisplayRow(this, true);\r\n\t\treturn row || false;\r\n\t}\r\n\t\r\n\tmoveToRow(to, before){\r\n\t\tvar toRow = this.table.rowManager.findRow(to);\r\n\t\t\r\n\t\tif(toRow){\r\n\t\t\tthis.table.rowManager.moveRowActual(this, toRow, !before);\r\n\t\t\tthis.table.rowManager.refreshActiveData(\"display\", false, true);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching row found:\", to);\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////// Actions /////////////////////\r\n\tdelete(){\r\n\t\tthis.dispatch(\"row-delete\", this);\r\n\t\t\r\n\t\tthis.deleteActual();\r\n\t\t\r\n\t\treturn Promise.resolve();\r\n\t}\r\n\t\r\n\tdeleteActual(blockRedraw){\r\n\t\tvar index = this.table.rowManager.getRowIndex(this);\r\n\t\t\r\n\t\tthis.detatchModules();\r\n\t\t\r\n\t\tthis.table.rowManager.deleteRow(this, blockRedraw);\r\n\t\t\r\n\t\tthis.deleteCells();\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.heightInitialized = false;\r\n\t\tthis.element = false;\r\n\t\t\r\n\t\tthis.dispatch(\"row-deleted\", this);\r\n\t}\r\n\t\r\n\tdetatchModules(){\r\n\t\tthis.dispatch(\"row-deleting\", this);\r\n\t}\r\n\t\r\n\tdeleteCells(){\r\n\t\tvar cellCount = this.cells.length;\r\n\t\t\r\n\t\tfor(let i = 0; i < cellCount; i++){\r\n\t\t\tthis.cells[0].delete();\r\n\t\t}\r\n\t}\r\n\t\r\n\twipe(){\r\n\t\tthis.detatchModules();\r\n\t\tthis.deleteCells();\r\n\t\t\r\n\t\tif(this.element){\r\n\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\t\r\n\t\t\tif(this.element.parentNode){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.element = false;\r\n\t\tthis.modules = {};\r\n\t}\r\n\t\r\n\tgetGroup(){\r\n\t\treturn this.modules.group || false;\r\n\t}\r\n\t\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new RowComponent(this);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.component;\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class BaiscVertical extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.verticalFillMode = \"fill\";\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t}\r\n\r\n\tclearRows(){\r\n\t\tvar element = this.tableElement;\r\n\r\n\t\t// element.children.detach();\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\telement.scrollTop = 0;\r\n\t\telement.scrollLeft = 0;\r\n\r\n\t\telement.style.minWidth = \"\";\r\n\t\telement.style.minHeight = \"\";\r\n\t\telement.style.display = \"\";\r\n\t\telement.style.visibility = \"\";\r\n\t}\r\n\r\n\trenderRows(){\r\n\t\tvar element = this.tableElement,\r\n\t\tonlyGroupHeaders = true;\r\n\r\n\t\tthis.rows().forEach((row, index) => {\r\n\t\t\tthis.styleRow(row, index);\r\n\t\t\telement.appendChild(row.getElement());\r\n\t\t\trow.initialize(true);\r\n\r\n\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\tonlyGroupHeaders = false;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(onlyGroupHeaders){\r\n\t\t\telement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t}else{\r\n\t\t\telement.style.minWidth = \"\";\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trerenderRows(callback){\r\n\t\tthis.clearRows();\r\n\t\tthis.renderRows();\r\n\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\tvar rowTop = Helpers.elOffset(row.getElement()).top;\r\n\r\n\t\treturn !(Math.abs(this.elementVertical.scrollTop - rowTop) > Math.abs(this.elementVertical.scrollTop + this.elementVertical.clientHeight - rowTop));\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tthis.elementVertical.scrollTop = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top + this.elementVertical.scrollTop;\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\treturn this.rows();\r\n\t}\r\n\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class VirtualDomVertical extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.verticalFillMode = \"fill\";\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.vDomRowHeight = 20; //approximation of row heights for padding\r\n\r\n\t\tthis.vDomTop = 0; //hold position for first rendered row in the virtual DOM\r\n\t\tthis.vDomBottom = 0; //hold possition for last rendered row in the virtual DOM\r\n\r\n\t\tthis.vDomScrollPosTop = 0; //last scroll position of the vDom top;\r\n\t\tthis.vDomScrollPosBottom = 0; //last scroll position of the vDom bottom;\r\n\r\n\t\tthis.vDomTopPad = 0; //hold value of padding for top of virtual DOM\r\n\t\tthis.vDomBottomPad = 0; //hold value of padding for bottom of virtual DOM\r\n\r\n\t\tthis.vDomMaxRenderChain = 90; //the maximum number of dom elements that can be rendered in 1 go\r\n\r\n\t\tthis.vDomWindowBuffer = 0; //window row buffer before removing elements, to smooth scrolling\r\n\r\n\t\tthis.vDomWindowMinTotalRows = 20; //minimum number of rows to be generated in virtual dom (prevent buffering issues on tables with tall rows)\r\n\t\tthis.vDomWindowMinMarginRows = 5; //minimum number of rows to be generated in virtual dom margin\r\n\r\n\t\tthis.vDomTopNewRows = []; //rows to normalize after appending to optimize render speed\r\n\t\tthis.vDomBottomNewRows = []; //rows to normalize after appending to optimize render speed\r\n\t}\r\n\r\n\t//////////////////////////////////////\r\n\t///////// Public Functions ///////////\r\n\t//////////////////////////////////////\r\n\r\n\tclearRows(){\r\n\t\tvar element = this.tableElement;\r\n\r\n\t\t// element.children.detach();\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\telement.style.paddingTop = \"\";\r\n\t\telement.style.paddingBottom = \"\";\r\n\t\t// element.style.minWidth = \"\";\r\n\t\telement.style.minHeight = \"\";\r\n\t\telement.style.display = \"\";\r\n\t\telement.style.visibility = \"\";\r\n\r\n\t\tthis.elementVertical.scrollTop = 0;\r\n\t\tthis.elementVertical.scrollLeft = 0;\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.vDomTop = 0;\r\n\t\tthis.vDomBottom = 0;\r\n\t\tthis.vDomTopPad = 0;\r\n\t\tthis.vDomBottomPad = 0;\r\n\t\tthis.vDomScrollPosTop = 0;\r\n\t\tthis.vDomScrollPosBottom = 0;\r\n\t}\r\n\r\n\trenderRows(){\r\n\t\tthis._virtualRenderFill();\r\n\t}\r\n\r\n\trerenderRows(callback){\r\n\t\tvar scrollTop = this.elementVertical.scrollTop;\r\n\t\tvar topRow = false;\r\n\t\tvar topOffset = false;\r\n\r\n\t\tvar left = this.table.rowManager.scrollLeft;\r\n\r\n\t\tvar rows = this.rows();\r\n\r\n\t\tfor(var i = this.vDomTop; i <= this.vDomBottom; i++){\r\n\r\n\t\t\tif(rows[i]){\r\n\t\t\t\tvar diff = scrollTop - rows[i].getElement().offsetTop;\r\n\r\n\t\t\t\tif(topOffset === false || Math.abs(diff) < topOffset){\r\n\t\t\t\t\ttopOffset = diff;\r\n\t\t\t\t\ttopRow = i;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\trows.forEach((row) => {\r\n\t\t\trow.deinitializeHeight();\r\n\t\t});\r\n\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\r\n\t\tthis._virtualRenderFill((topRow === false ? this.rows.length - 1 : topRow), true, topOffset || 0);\r\n\r\n\t\tthis.scrollColumns(left);\r\n\t}\r\n\r\n\tscrollColumns(left){\r\n\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t}\r\n\r\n\tscrollRows(top, dir){\r\n\t\tvar topDiff = top - this.vDomScrollPosTop;\r\n\t\tvar bottomDiff = top - this.vDomScrollPosBottom;\r\n\t\tvar margin = this.vDomWindowBuffer * 2;\r\n\t\tvar rows = this.rows();\r\n\r\n\t\tthis.scrollTop = top;\r\n\r\n\t\tif(-topDiff > margin || bottomDiff > margin){\r\n\t\t\t//if big scroll redraw table;\r\n\t\t\tvar left = this.table.rowManager.scrollLeft;\r\n\t\t\tthis._virtualRenderFill(Math.floor((this.elementVertical.scrollTop / this.elementVertical.scrollHeight) * rows.length));\r\n\t\t\tthis.scrollColumns(left);\r\n\t\t}else{\r\n\r\n\t\t\tif(dir){\r\n\t\t\t\t//scrolling up\r\n\t\t\t\tif(topDiff < 0){\r\n\t\t\t\t\tthis._addTopRow(rows, -topDiff);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(bottomDiff < 0){\r\n\t\t\t\t\t//hide bottom row if needed\r\n\t\t\t\t\tif(this.vDomScrollHeight - this.scrollTop > this.vDomWindowBuffer){\r\n\t\t\t\t\t\tthis._removeBottomRow(rows, -bottomDiff);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomScrollPosBottom = this.scrollTop;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\r\n\t\t\t\tif(bottomDiff >= 0){\r\n\t\t\t\t\tthis._addBottomRow(rows, bottomDiff);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//scrolling down\r\n\t\t\t\tif(topDiff >= 0){\r\n\t\t\t\t\t//hide top row if needed\r\n\t\t\t\t\tif(this.scrollTop > this.vDomWindowBuffer){\r\n\t\t\t\t\t\tthis._removeTopRow(rows, topDiff);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomScrollPosTop = this.scrollTop;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tresize(){\r\n\t\tthis.vDomWindowBuffer = this.table.options.renderVerticalBuffer || this.elementVertical.clientHeight;\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\tvar rowIndex = this.rows().indexOf(row);\r\n\r\n\t\treturn !(Math.abs(this.vDomTop - rowIndex) > Math.abs(this.vDomBottom - rowIndex));\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\tvar index = this.rows().indexOf(row);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis._virtualRenderFill(index, true);\r\n\t\t}\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\tvar topEdge = this.elementVertical.scrollTop,\r\n\t\tbottomEdge = this.elementVertical.clientHeight + topEdge,\r\n\t\ttopFound = false,\r\n\t\ttopRow = 0,\r\n\t\tbottomRow = 0,\r\n\t\trows = this.rows();\r\n\r\n\t\tif(includingBuffer){\r\n\t\t\ttopRow = this.vDomTop;\r\n\t\t\tbottomRow = this.vDomBottom;\r\n\t\t}else{\r\n\t\t\tfor(var i = this.vDomTop; i <= this.vDomBottom; i++){\r\n\t\t\t\tif(rows[i]){\r\n\t\t\t\t\tif(!topFound){\r\n\t\t\t\t\t\tif((topEdge - rows[i].getElement().offsetTop) >= 0){\r\n\t\t\t\t\t\t\ttopRow = i;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\ttopFound = true;\r\n\r\n\t\t\t\t\t\t\tif(bottomEdge - rows[i].getElement().offsetTop >= 0){\r\n\t\t\t\t\t\t\t\tbottomRow = i;\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(bottomEdge - rows[i].getElement().offsetTop >= 0){\r\n\t\t\t\t\t\t\tbottomRow = i;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn rows.slice(topRow, bottomRow + 1);\r\n\t}\r\n\r\n\t//////////////////////////////////////\r\n\t//////// Internal Rendering //////////\r\n\t//////////////////////////////////////\r\n\r\n\t//full virtual render\r\n\t_virtualRenderFill(position, forceMove, offset){\r\n\t\tvar\telement = this.tableElement,\r\n\t\tholder = this.elementVertical,\r\n\t\ttopPad = 0,\r\n\t\trowsHeight = 0,\r\n\t\theightOccupied = 0,\r\n\t\ttopPadHeight = 0,\r\n\t\ti = 0,\r\n\t\trows = this.rows(),\r\n\t\trowsCount = rows.length,\r\n\t\tcontainerHeight = this.elementVertical.clientHeight;\r\n\r\n\t\tposition = position || 0;\r\n\r\n\t\toffset = offset || 0;\r\n\r\n\t\tif(!position){\r\n\t\t\tthis.clear();\r\n\t\t}else{\r\n\t\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\t\t//check if position is too close to bottom of table\r\n\t\t\theightOccupied = (rowsCount - position + 1) * this.vDomRowHeight;\r\n\r\n\t\t\tif(heightOccupied < containerHeight){\r\n\t\t\t\tposition -= Math.ceil((containerHeight - heightOccupied) / this.vDomRowHeight);\r\n\t\t\t\tif(position < 0){\r\n\t\t\t\t\tposition = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//calculate initial pad\r\n\t\t\ttopPad = Math.min(Math.max(Math.floor(this.vDomWindowBuffer / this.vDomRowHeight), this.vDomWindowMinMarginRows), position);\r\n\t\t\tposition -= topPad;\r\n\t\t}\r\n\r\n\t\tif(rowsCount && Helpers.elVisible(this.elementVertical)){\r\n\t\t\tthis.vDomTop = position;\r\n\r\n\t\t\tthis.vDomBottom = position -1;\r\n\r\n\t\t\twhile ((rowsHeight <= containerHeight + this.vDomWindowBuffer || i < this.vDomWindowMinTotalRows) && this.vDomBottom < rowsCount -1){\r\n\t\t\t\tvar index = this.vDomBottom + 1,\r\n\t\t\t\trow = rows[index],\r\n\t\t\t\trowHeight = 0;\r\n\r\n\t\t\t\tthis.styleRow(row, index);\r\n\r\n\t\t\t\telement.appendChild(row.getElement());\r\n\r\n\t\t\t\trow.initialize();\r\n\r\n\t\t\t\tif(!row.heightInitialized){\r\n\t\t\t\t\trow.normalizeHeight(true);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowHeight = row.getHeight();\r\n\r\n\t\t\t\tif(i < topPad){\r\n\t\t\t\t\ttopPadHeight += rowHeight;\r\n\t\t\t\t}else{\r\n\t\t\t\t\trowsHeight += rowHeight;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.vDomBottom ++;\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\r\n\t\t\tif(!position){\r\n\t\t\t\tthis.vDomTopPad = 0;\r\n\t\t\t\t//adjust rowheight to match average of rendered elements\r\n\t\t\t\tthis.vDomRowHeight = Math.floor((rowsHeight + topPadHeight) / i);\r\n\t\t\t\tthis.vDomBottomPad = this.vDomRowHeight * (rowsCount - this.vDomBottom -1);\r\n\r\n\t\t\t\tthis.vDomScrollHeight = topPadHeight + rowsHeight + this.vDomBottomPad - containerHeight;\r\n\t\t\t}else{\r\n\t\t\t\tthis.vDomTopPad = !forceMove ? this.scrollTop - topPadHeight : (this.vDomRowHeight * this.vDomTop) + offset;\r\n\t\t\t\tthis.vDomBottomPad = this.vDomBottom == rowsCount-1 ? 0 : Math.max(this.vDomScrollHeight - this.vDomTopPad - rowsHeight - topPadHeight, 0);\r\n\t\t\t}\r\n\r\n\t\t\telement.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\telement.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\r\n\t\t\tif(forceMove){\r\n\t\t\t\tthis.scrollTop = this.vDomTopPad + (topPadHeight) + offset - (this.elementVertical.scrollWidth > this.elementVertical.clientWidth ? this.elementVertical.offsetHeight - containerHeight : 0);\r\n\t\t\t}\r\n\r\n\t\t\tthis.scrollTop = Math.min(this.scrollTop, this.elementVertical.scrollHeight - containerHeight);\r\n\r\n\t\t\t//adjust for horizontal scrollbar if present (and not at top of table)\r\n\t\t\tif(this.elementVertical.scrollWidth > this.elementVertical.offsetWidth && forceMove){\r\n\t\t\t\tthis.scrollTop += this.elementVertical.offsetHeight - containerHeight;\r\n\t\t\t}\r\n\r\n\t\t\tthis.vDomScrollPosTop = this.scrollTop;\r\n\t\t\tthis.vDomScrollPosBottom = this.scrollTop;\r\n\r\n\t\t\tholder.scrollTop = this.scrollTop;\r\n\r\n\t\t\tthis.dispatch(\"render-virtual-fill\");\r\n\t\t}\r\n\t}\r\n\r\n\t_addTopRow(rows, fillableSpace){\r\n\t\tvar table = this.tableElement,\r\n\t\taddedRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\tindex = this.vDomTop -1,\r\n\t\ti = 0;\r\n\r\n\t\twhile(true){\r\n\t\t\tif(this.vDomTop){\r\n\t\t\t\tlet row = rows[index],\r\n\t\t\t\trowHeight, initialized;\r\n\r\n\t\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\t\t\t\t\tinitialized = row.initialized;\r\n\r\n\t\t\t\t\tif(fillableSpace >= rowHeight){\r\n\r\n\t\t\t\t\t\tthis.styleRow(row, index);\r\n\t\t\t\t\t\ttable.insertBefore(row.getElement(), table.firstChild);\r\n\r\n\t\t\t\t\t\tif(!row.initialized || !row.heightInitialized){\r\n\t\t\t\t\t\t\taddedRows.push(row);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\trow.initialize();\r\n\r\n\t\t\t\t\t\tif(!initialized){\r\n\t\t\t\t\t\t\trowHeight = row.getElement().offsetHeight;\r\n\r\n\t\t\t\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\t\tthis.vDomTop--;\r\n\t\t\t\t\t\tindex--;\r\n\t\t\t\t\t\ti++;\r\n\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of addedRows){\r\n\t\t\trow.clearCellHeight();\r\n\t\t}\r\n\r\n\t\tthis._quickNormalizeRowHeight(addedRows);\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomTopPad -= paddingAdjust;\r\n\r\n\t\t\tif(this.vDomTopPad < 0){\r\n\t\t\t\tthis.vDomTopPad = index * this.vDomRowHeight;\r\n\t\t\t}\r\n\r\n\t\t\tif(index < 1){\r\n\t\t\t\tthis.vDomTopPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\ttable.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\tthis.vDomScrollPosTop -= paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_removeTopRow(rows, fillableSpace){\r\n\t\tvar removableRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\ti = 0;\r\n\r\n\t\twhile(true){\r\n\t\t\tlet row = rows[this.vDomTop],\r\n\t\t\trowHeight, diff;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\t\t\t\t\tthis.vDomTop++;\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tremovableRows.push(row);\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of removableRows){\r\n\t\t\tlet rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomTopPad += paddingAdjust;\r\n\t\t\tthis.tableElement.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\tthis.vDomScrollPosTop += this.vDomTop ? paddingAdjust : paddingAdjust + this.vDomWindowBuffer;\r\n\t\t}\r\n\t}\r\n\r\n\t_addBottomRow(rows, fillableSpace){\r\n\t\tvar table = this.tableElement,\r\n\t\taddedRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\tindex = this.vDomBottom + 1,\r\n\t\ti = 0;\r\n\r\n\t\twhile(true){\r\n\t\t\tlet row = rows[index],\r\n\t\t\trowHeight, initialized;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\t\t\t\tinitialized = row.initialized;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\r\n\t\t\t\t\tthis.styleRow(row, index);\r\n\t\t\t\t\ttable.appendChild(row.getElement());\r\n\r\n\t\t\t\t\tif(!row.initialized || !row.heightInitialized){\r\n\t\t\t\t\t\taddedRows.push(row);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\trow.initialize();\r\n\r\n\t\t\t\t\tif(!initialized){\r\n\t\t\t\t\t\trowHeight = row.getElement().offsetHeight;\r\n\r\n\t\t\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tthis.vDomBottom++;\r\n\t\t\t\t\tindex++;\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of addedRows){\r\n\t\t\trow.clearCellHeight();\r\n\t\t}\r\n\r\n\t\tthis._quickNormalizeRowHeight(addedRows);\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomBottomPad -= paddingAdjust;\r\n\r\n\t\t\tif(this.vDomBottomPad < 0 || index == rows.length -1){\r\n\t\t\t\tthis.vDomBottomPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\ttable.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\t\t\tthis.vDomScrollPosBottom += paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_removeBottomRow(rows, fillableSpace){\r\n\t\tvar removableRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\ti = 0;\r\n\r\n\t\twhile(true){\r\n\t\t\tlet row = rows[this.vDomBottom],\r\n\t\t\trowHeight, diff;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\t\t\t\t\tthis.vDomBottom --;\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tremovableRows.push(row);\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of removableRows){\r\n\t\t\tlet rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomBottomPad += paddingAdjust;\r\n\r\n\t\t\tif(this.vDomBottomPad < 0){\r\n\t\t\t\tthis.vDomBottomPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\tthis.tableElement.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\t\t\tthis.vDomScrollPosBottom -= paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_quickNormalizeRowHeight(rows){\r\n\t\tfor(let row of rows){\r\n\t\t\trow.calcHeight();\r\n\t\t}\r\n\r\n\t\tfor(let row of rows){\r\n\t\t\trow.setCellHeight();\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Row from './row/Row.js';\r\nimport RowComponent from './row/RowComponent.js';\r\nimport Helpers from './tools/Helpers.js';\r\n\r\nimport RendererBasicVertical from './rendering/renderers/BasicVertical.js';\r\nimport RendererVirtualDomVertical from './rendering/renderers/VirtualDomVertical.js';\r\n\r\nexport default class RowManager extends CoreFeature{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.element = this.createHolderElement(); //containing element\r\n\t\tthis.tableElement = this.createTableElement(); //table element\r\n\t\tthis.heightFixer = this.createTableElement(); //table element\r\n\t\tthis.placeholder = null; //placeholder element\r\n\t\tthis.placeholderContents = null; //placeholder element\r\n\t\t\r\n\t\tthis.firstRender = false; //handle first render\r\n\t\tthis.renderMode = \"virtual\"; //current rendering mode\r\n\t\tthis.fixedHeight = false; //current rendering mode\r\n\t\t\r\n\t\tthis.rows = []; //hold row data objects\r\n\t\tthis.activeRowsPipeline = []; //hold calculation of active rows\r\n\t\tthis.activeRows = []; //rows currently available to on display in the table\r\n\t\tthis.activeRowsCount = 0; //count of active rows\r\n\t\t\r\n\t\tthis.displayRows = []; //rows currently on display in the table\r\n\t\tthis.displayRowsCount = 0; //count of display rows\r\n\t\t\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.rowNumColumn = false; //hold column component for row number column\r\n\t\t\r\n\t\tthis.redrawBlock = false; //prevent redraws to allow multiple data manipulations before continuing\r\n\t\tthis.redrawBlockRestoreConfig = false; //store latest redraw function calls for when redraw is needed\r\n\t\tthis.redrawBlockRenderInPosition = false; //store latest redraw function calls for when redraw is needed\r\n\t\t\r\n\t\tthis.dataPipeline = []; //hold data pipeline tasks\r\n\t\tthis.displayPipeline = []; //hold data display pipeline tasks\r\n\t\t\r\n\t\tthis.renderer = null;\r\n\t}\r\n\t\r\n\t//////////////// Setup Functions /////////////////\r\n\t\r\n\tcreateHolderElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-tableholder\");\r\n\t\tel.setAttribute(\"tabindex\", 0);\r\n\t\t// el.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tcreateTableElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-table\");\r\n\t\tel.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tinitializePlaceholder(){\r\n\t\t//configure placeholder element\r\n\t\tif(typeof this.table.options.placeholder == \"string\"){\r\n\t\t\tlet el = document.createElement(\"div\");\r\n\t\t\tel.classList.add(\"tabulator-placeholder\");\r\n\t\t\t\r\n\t\t\tlet contents = document.createElement(\"div\");\r\n\t\t\tcontents.classList.add(\"tabulator-placeholder-contents\");\r\n\t\t\tcontents.innerHTML = this.table.options.placeholder;\r\n\t\t\t\r\n\t\t\tel.appendChild(contents);\r\n\t\t\t\r\n\t\t\tthis.placeholderContents = contents;\r\n\t\t\tthis.placeholder = el;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return containing element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\t//return table element\r\n\tgetTableElement(){\r\n\t\treturn this.tableElement;\r\n\t}\r\n\t\r\n\t//return position of row in table\r\n\tgetRowPosition(row, active){\r\n\t\tif(active){\r\n\t\t\treturn this.activeRows.indexOf(row);\r\n\t\t}else{\r\n\t\t\treturn this.rows.indexOf(row);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.initializePlaceholder()\r\n\t\tthis.initializeRenderer();\r\n\t\t\r\n\t\t//initialize manager\r\n\t\tthis.element.appendChild(this.tableElement);\r\n\t\t\r\n\t\tthis.firstRender = true;\r\n\t\t\r\n\t\t//scroll header along with table body\r\n\t\tthis.element.addEventListener(\"scroll\", () => {\r\n\t\t\tvar left = this.element.scrollLeft,\r\n\t\t\tleftDir = this.scrollLeft > left,\r\n\t\t\ttop = this.element.scrollTop,\r\n\t\t\ttopDir = this.scrollTop > top;\r\n\t\t\t\r\n\t\t\t//handle horizontal scrolling\r\n\t\t\tif(this.scrollLeft != left){\r\n\t\t\t\tthis.scrollLeft = left;\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"scroll-horizontal\", left, leftDir);\r\n\t\t\t\tthis.dispatchExternal(\"scrollHorizontal\", left, leftDir);\r\n\r\n\t\t\t\tthis._positionPlaceholder();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//handle vertical scrolling\r\n\t\t\tif(this.scrollTop != top){\r\n\t\t\t\tthis.scrollTop = top;\r\n\t\t\t\t\r\n\t\t\t\tthis.renderer.scrollRows(top, topDir);\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"scroll-vertical\", top, topDir);\r\n\t\t\t\tthis.dispatchExternal(\"scrollVertical\", top, topDir);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t////////////////// Row Manipulation //////////////////\r\n\tfindRow(subject){\r\n\t\tif(typeof subject == \"object\"){\r\n\t\t\tif(subject instanceof Row){\r\n\t\t\t\t//subject is row element\r\n\t\t\t\treturn subject;\r\n\t\t\t}else if(subject instanceof RowComponent){\r\n\t\t\t\t//subject is public row component\r\n\t\t\t\treturn subject._getSelf() || false;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\t\t\t\t//subject is a HTML element of the row\r\n\t\t\t\tlet match = this.rows.find((row) => {\r\n\t\t\t\t\treturn row.getElement() === subject;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\treturn match || false;\r\n\t\t\t}\r\n\t\t}else if(typeof subject == \"undefined\" || subject === null){\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the index of the row\r\n\t\t\tlet match = this.rows.find((row) => {\r\n\t\t\t\treturn row.data[this.table.options.index] == subject;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\treturn match || false;\r\n\t\t}\r\n\t\t\r\n\t\t//catch all for any other type of input\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tgetRowFromDataObject(data){\r\n\t\tvar match = this.rows.find((row) => {\r\n\t\t\treturn row.data === data;\r\n\t\t});\r\n\t\t\r\n\t\treturn match || false;\r\n\t}\r\n\t\r\n\tgetRowFromPosition(position, active){\r\n\t\tif(active){\r\n\t\t\treturn this.activeRows[position];\r\n\t\t}else{\r\n\t\t\treturn this.rows[position];\r\n\t\t}\r\n\t}\r\n\t\r\n\tscrollToRow(row, position, ifVisible){\r\n\t\treturn this.renderer.scrollToRowPosition(row, position, ifVisible);\r\n\t}\r\n\t\r\n\t////////////////// Data Handling //////////////////\r\n\tsetData(data, renderInPosition, columnsChanged){\r\n\t\treturn new Promise((resolve, reject)=>{\r\n\t\t\tif(renderInPosition && this.getDisplayRows().length){\r\n\t\t\t\tif(this.table.options.pagination){\r\n\t\t\t\t\tthis._setDataActual(data, true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.reRenderInPosition(() => {\r\n\t\t\t\t\t\tthis._setDataActual(data);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.options.autoColumns && columnsChanged && this.table.initialized){\r\n\t\t\t\t\tthis.table.columnManager.generateColumnsFromRowData(data);\r\n\t\t\t\t}\r\n\t\t\t\tthis.resetScroll();\r\n\t\t\t\t\r\n\t\t\t\tthis._setDataActual(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\t\r\n\t_setDataActual(data, renderInPosition){\r\n\t\tthis.dispatchExternal(\"dataProcessing\", data);\r\n\t\t\r\n\t\tthis._wipeElements();\r\n\t\t\r\n\t\tif(Array.isArray(data)){\r\n\t\t\tthis.dispatch(\"data-processing\", data);\r\n\t\t\t\r\n\t\t\tdata.forEach((def, i) => {\r\n\t\t\t\tif(def && typeof def === \"object\"){\r\n\t\t\t\t\tvar row = new Row(def, this);\r\n\t\t\t\t\tthis.rows.push(row);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Data Loading Warning - Invalid row data detected and ignored, expecting object but received:\", def);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.refreshActiveData(false, false, renderInPosition);\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"data-processed\", data);\r\n\t\t\tthis.dispatchExternal(\"dataProcessed\", data);\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Data Loading Error - Unable to process data due to invalid data type \\nExpecting: array \\nReceived: \", typeof data, \"\\nData: \", data);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_wipeElements(){\r\n\t\tthis.dispatch(\"rows-wipe\");\r\n\t\t\r\n\t\tthis.rows.forEach((row) => {\r\n\t\t\trow.wipe();\r\n\t\t});\r\n\t\t\r\n\t\tthis.rows = [];\r\n\t\tthis.activeRows = [];\r\n\t\tthis.activeRowsPipeline = [];\r\n\t\tthis.activeRowsCount = 0;\r\n\t\tthis.displayRows = [];\r\n\t\tthis.displayRowsCount = 0;\r\n\t\t\r\n\t\tthis.adjustTableSize();\r\n\t}\r\n\t\r\n\tdeleteRow(row, blockRedraw){\r\n\t\tvar allIndex = this.rows.indexOf(row),\r\n\t\tactiveIndex = this.activeRows.indexOf(row);\r\n\t\t\r\n\t\tif(activeIndex > -1){\r\n\t\t\tthis.activeRows.splice(activeIndex, 1);\r\n\t\t}\r\n\t\t\r\n\t\tif(allIndex > -1){\r\n\t\t\tthis.rows.splice(allIndex, 1);\r\n\t\t}\r\n\t\t\r\n\t\tthis.setActiveRows(this.activeRows);\r\n\t\t\r\n\t\tthis.displayRowIterator((rows) => {\r\n\t\t\tvar displayIndex = rows.indexOf(row);\r\n\t\t\t\r\n\t\t\tif(displayIndex > -1){\r\n\t\t\t\trows.splice(displayIndex, 1);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t}\r\n\t\t\r\n\t\tthis.regenerateRowNumbers();\r\n\t\t\r\n\t\tthis.dispatchExternal(\"rowDeleted\", row.getComponent());\r\n\t\t\r\n\t\tif(!this.displayRowsCount){\r\n\t\t\tthis._showPlaceholder();\r\n\t\t}\r\n\t\t\r\n\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\tthis.dispatchExternal(\"dataChanged\", this.getData());\r\n\t\t}\r\n\t}\r\n\t\r\n\taddRow(data, pos, index, blockRedraw){\r\n\t\tvar row = this.addRowActual(data, pos, index, blockRedraw);\r\n\t\treturn row;\r\n\t}\r\n\t\r\n\t//add multiple rows\r\n\taddRows(data, pos, index){\r\n\t\tvar length = 0,\r\n\t\trows = [];\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tpos = this.findAddRowPos(pos);\r\n\t\t\t\r\n\t\t\tif(!Array.isArray(data)){\r\n\t\t\t\tdata = [data];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tlength = data.length - 1;\r\n\t\t\t\r\n\t\t\tif((typeof index == \"undefined\" && pos) || (typeof index !== \"undefined\" && !pos)){\r\n\t\t\t\tdata.reverse();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdata.forEach((item, i) => {\r\n\t\t\t\tvar row = this.addRow(item, pos, index, true);\r\n\t\t\t\trows.push(row);\r\n\t\t\t\tthis.dispatch(\"row-added\", row, data, pos, index);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.refreshActiveData(false, false, true);\r\n\t\t\t\r\n\t\t\tthis.regenerateRowNumbers();\r\n\t\t\t\r\n\t\t\tif(rows.length){\r\n\t\t\t\tthis._clearPlaceholder();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve(rows);\r\n\t\t});\r\n\t}\r\n\t\r\n\tfindAddRowPos(pos){\r\n\t\tif(typeof pos === \"undefined\"){\r\n\t\t\tpos = this.table.options.addRowPos;\r\n\t\t}\r\n\t\t\r\n\t\tif(pos === \"pos\"){\r\n\t\t\tpos = true;\r\n\t\t}\r\n\t\t\r\n\t\tif(pos === \"bottom\"){\r\n\t\t\tpos = false;\r\n\t\t}\r\n\t\t\r\n\t\treturn pos;\r\n\t}\r\n\t\r\n\taddRowActual(data, pos, index, blockRedraw){\r\n\t\tvar row = data instanceof Row ? data : new Row(data || {}, this),\r\n\t\ttop = this.findAddRowPos(pos),\r\n\t\tallIndex = -1,\r\n\t\tactiveIndex, chainResult;\r\n\t\t\r\n\t\tif(!index){\r\n\t\t\tchainResult = this.chain(\"row-adding-position\", [row, top], null, {index, top});\r\n\t\t\t\r\n\t\t\tindex = chainResult.index;\r\n\t\t\ttop = chainResult.top;\r\n\t\t}\r\n\t\t\r\n\t\tif(typeof index !== \"undefined\"){\r\n\t\t\tindex = this.findRow(index);\r\n\t\t}\r\n\t\t\r\n\t\tindex = this.chain(\"row-adding-index\", [row, index, top], null, index);\r\n\t\t\r\n\t\tif(index){\r\n\t\t\tallIndex = this.rows.indexOf(index);\r\n\t\t}\r\n\t\t\r\n\t\tif(index && allIndex > -1){\r\n\t\t\tactiveIndex = this.activeRows.indexOf(index);\r\n\t\t\t\r\n\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\tvar displayIndex = rows.indexOf(index);\r\n\t\t\t\t\r\n\t\t\t\tif(displayIndex > -1){\r\n\t\t\t\t\trows.splice((top ? displayIndex : displayIndex + 1), 0, row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(activeIndex > -1){\r\n\t\t\t\tthis.activeRows.splice((top ? activeIndex : activeIndex + 1), 0, row);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.rows.splice((top ? allIndex : allIndex + 1), 0, row);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tif(top){\r\n\t\t\t\t\r\n\t\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\t\trows.unshift(row);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.activeRows.unshift(row);\r\n\t\t\t\tthis.rows.unshift(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\t\trows.push(row);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.activeRows.push(row);\r\n\t\t\t\tthis.rows.push(row);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.setActiveRows(this.activeRows);\r\n\t\t\r\n\t\tthis.dispatchExternal(\"rowAdded\", row.getComponent());\r\n\t\t\r\n\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t}\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t}\r\n\t\t\r\n\t\treturn row;\r\n\t}\r\n\t\r\n\tmoveRow(from, to, after){\r\n\t\tthis.dispatch(\"row-move\", from, to, after);\r\n\t\t\r\n\t\tthis.moveRowActual(from, to, after);\r\n\t\t\r\n\t\tthis.regenerateRowNumbers();\r\n\t\t\r\n\t\tthis.dispatch(\"row-moved\", from, to, after);\r\n\t\tthis.dispatchExternal(\"rowMoved\", from.getComponent());\r\n\t}\r\n\t\r\n\tmoveRowActual(from, to, after){\r\n\t\tthis.moveRowInArray(this.rows, from, to, after);\r\n\t\tthis.moveRowInArray(this.activeRows, from, to, after);\r\n\t\t\r\n\t\tthis.displayRowIterator((rows) => {\r\n\t\t\tthis.moveRowInArray(rows, from, to, after);\r\n\t\t});\r\n\t\t\r\n\t\tthis.dispatch(\"row-moving\", from, to, after);\r\n\t}\r\n\t\r\n\tmoveRowInArray(rows, from, to, after){\r\n\t\tvar\tfromIndex, toIndex, start, end;\r\n\t\t\r\n\t\tif(from !== to){\r\n\t\t\t\r\n\t\t\tfromIndex = rows.indexOf(from);\r\n\t\t\t\r\n\t\t\tif (fromIndex > -1) {\r\n\t\t\t\t\r\n\t\t\t\trows.splice(fromIndex, 1);\r\n\t\t\t\t\r\n\t\t\t\ttoIndex = rows.indexOf(to);\r\n\t\t\t\t\r\n\t\t\t\tif (toIndex > -1) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(after){\r\n\t\t\t\t\t\trows.splice(toIndex+1, 0, from);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trows.splice(toIndex, 0, from);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\trows.splice(fromIndex, 0, from);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//restyle rows\r\n\t\t\tif(rows === this.getDisplayRows()){\r\n\t\t\t\t\r\n\t\t\t\tstart = fromIndex < toIndex ? fromIndex : toIndex;\r\n\t\t\t\tend = toIndex > fromIndex ? toIndex : fromIndex +1;\r\n\t\t\t\t\r\n\t\t\t\tfor(let i = start; i <= end; i++){\r\n\t\t\t\t\tif(rows[i]){\r\n\t\t\t\t\t\tthis.styleRow(rows[i], i);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearData(){\r\n\t\tthis.setData([]);\r\n\t}\r\n\t\r\n\tgetRowIndex(row){\r\n\t\treturn this.findRowIndex(row, this.rows);\r\n\t}\r\n\t\r\n\tgetDisplayRowIndex(row){\r\n\t\tvar index = this.getDisplayRows().indexOf(row);\r\n\t\treturn index > -1 ? index : false;\r\n\t}\r\n\t\r\n\tnextDisplayRow(row, rowOnly){\r\n\t\tvar index = this.getDisplayRowIndex(row),\r\n\t\tnextRow = false;\r\n\t\t\r\n\t\t\r\n\t\tif(index !== false && index < this.displayRowsCount -1){\r\n\t\t\tnextRow = this.getDisplayRows()[index+1];\r\n\t\t}\r\n\t\t\r\n\t\tif(nextRow && (!(nextRow instanceof Row) || nextRow.type != \"row\")){\r\n\t\t\treturn this.nextDisplayRow(nextRow, rowOnly);\r\n\t\t}\r\n\t\t\r\n\t\treturn nextRow;\r\n\t}\r\n\t\r\n\tprevDisplayRow(row, rowOnly){\r\n\t\tvar index = this.getDisplayRowIndex(row),\r\n\t\tprevRow = false;\r\n\t\t\r\n\t\tif(index){\r\n\t\t\tprevRow = this.getDisplayRows()[index-1];\r\n\t\t}\r\n\t\t\r\n\t\tif(rowOnly && prevRow && (!(prevRow instanceof Row) || prevRow.type != \"row\")){\r\n\t\t\treturn this.prevDisplayRow(prevRow, rowOnly);\r\n\t\t}\r\n\t\t\r\n\t\treturn prevRow;\r\n\t}\r\n\t\r\n\tfindRowIndex(row, list){\r\n\t\tvar rowIndex;\r\n\t\t\r\n\t\trow = this.findRow(row);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\trowIndex = list.indexOf(row);\r\n\t\t\t\r\n\t\t\tif(rowIndex > -1){\r\n\t\t\t\treturn rowIndex;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tgetData(active, transform){\r\n\t\tvar output = [],\r\n\t\trows = this.getRows(active);\r\n\t\t\r\n\t\trows.forEach(function(row){\r\n\t\t\tif(row.type == \"row\"){\r\n\t\t\t\toutput.push(row.getData(transform || \"data\"));\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetComponents(active){\r\n\t\tvar\toutput = [],\r\n\t\trows = this.getRows(active);\r\n\t\t\r\n\t\trows.forEach(function(row){\r\n\t\t\toutput.push(row.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetDataCount(active){\r\n\t\tvar rows = this.getRows(active);\r\n\t\t\r\n\t\treturn rows.length;\r\n\t}\r\n\t\r\n\tscrollHorizontal(left){\r\n\t\tthis.scrollLeft = left;\r\n\t\tthis.element.scrollLeft = left;\r\n\t\t\r\n\t\tthis.dispatch(\"scroll-horizontal\", left);\r\n\t}\r\n\t\r\n\tregisterDataPipelineHandler(handler, priority){\r\n\t\tif(typeof priority !== \"undefined\"){\r\n\t\t\tthis.dataPipeline.push({handler, priority})\r\n\t\t\tthis.dataPipeline.sort((a, b) => {\r\n\t\t\t\treturn a.priority - b.priority;\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Data pipeline handlers must have a priority in order to be registered\")\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterDisplayPipelineHandler(handler, priority){\r\n\t\tif(typeof priority !== \"undefined\"){\r\n\t\t\tthis.displayPipeline.push({handler, priority})\r\n\t\t\tthis.displayPipeline.sort((a, b) => {\r\n\t\t\t\treturn a.priority - b.priority;\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Display pipeline handlers must have a priority in order to be registered\")\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set active data set\r\n\trefreshActiveData(handler, skipStage, renderInPosition){\r\n\t\tvar table = this.table,\r\n\t\tstage = \"\",\r\n\t\tindex = 0,\r\n\t\tcascadeOrder = [\"all\", \"dataPipeline\", \"display\", \"displayPipeline\", \"end\"],\r\n\t\tdisplayIndex;\r\n\t\t\r\n\t\t\r\n\t\tif(typeof handler === \"function\"){\r\n\t\t\tindex = this.dataPipeline.findIndex((item) => {\r\n\t\t\t\treturn item.handler === handler;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tstage = \"dataPipeline\";\r\n\t\t\t\t\r\n\t\t\t\tif(skipStage){\r\n\t\t\t\t\tif(index == this.dataPipeline.length - 1){\r\n\t\t\t\t\t\tstage = \"display\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tindex = this.displayPipeline.findIndex((item) => {\r\n\t\t\t\t\treturn item.handler === handler;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tstage = \"displayPipeline\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(skipStage){\r\n\t\t\t\t\t\tif(index == this.displayPipeline.length - 1){\r\n\t\t\t\t\t\t\tstage = \"end\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.error(\"Unable to refresh data, invalid handler provided\", handler)\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tstage = handler || \"all\";\r\n\t\t\tindex = 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.redrawBlock){\r\n\t\t\tif(!this.redrawBlockRestoreConfig || (this.redrawBlockRestoreConfig && ((this.redrawBlockRestoreConfig.stage === stage && index < this.redrawBlockRestoreConfig.index) || (cascadeOrder.indexOf(stage) < cascadeOrder.indexOf(this.redrawBlockRestoreConfig.stage))))){\r\n\t\t\t\tthis.redrawBlockRestoreConfig = {\r\n\t\t\t\t\thandler: handler,\r\n\t\t\t\t\tskipStage: skipStage,\r\n\t\t\t\t\trenderInPosition: renderInPosition,\r\n\t\t\t\t\tstage:stage,\r\n\t\t\t\t\tindex:index,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn;\r\n\t\t}else{\r\n\t\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\t\tif(renderInPosition){\r\n\t\t\t\t\tthis.reRenderInPosition(this.refreshPipelines.bind(this, handler, stage, index, renderInPosition));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!handler){\r\n\t\t\t\t\t\tthis.table.columnManager.renderer.renderColumns();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.renderTable();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(table.options.layoutColumnsOnNewData){\r\n\t\t\t\t\t\tthis.table.columnManager.redraw(true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"data-refreshed\");\r\n\t\t}\r\n\t}\r\n\t\r\n\trefreshPipelines(handler, stage, index, renderInPosition){\r\n\t\tthis.dispatch(\"data-refreshing\");\r\n\t\t\r\n\t\tif(!handler){\r\n\t\t\tthis.activeRowsPipeline[0] = this.rows.slice(0);\r\n\t\t}\r\n\t\t\r\n\t\t//cascade through data refresh stages\r\n\t\tswitch(stage){\r\n\t\t\tcase \"all\":\r\n\t\t\t//handle case where alldata needs refreshing\r\n\t\t\t\r\n\t\t\tcase \"dataPipeline\":\r\n\t\t\t\r\n\t\t\tfor(let i = index; i < this.dataPipeline.length; i++){\r\n\t\t\t\tlet result = this.dataPipeline[i].handler(this.activeRowsPipeline[i].slice(0));\r\n\t\t\t\t\r\n\t\t\t\tthis.activeRowsPipeline[i + 1] = result || this.activeRowsPipeline[i].slice(0);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.setActiveRows(this.activeRowsPipeline[this.dataPipeline.length]);\r\n\t\t\t\r\n\t\t\tthis.regenerateRowNumbers();\r\n\t\t\t\r\n\t\t\tcase \"display\":\r\n\t\t\tindex = 0;\r\n\t\t\tthis.resetDisplayRows();\r\n\t\t\t\r\n\t\t\tcase \"displayPipeline\":\r\n\t\t\tfor(let i = index; i < this.displayPipeline.length; i++){\r\n\t\t\t\tlet result = this.displayPipeline[i].handler((i ? this.getDisplayRows(i - 1) : this.activeRows).slice(0), renderInPosition);\r\n\t\t\t\t\r\n\t\t\t\tthis.setDisplayRows(result || this.getDisplayRows(i - 1).slice(0), i);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase \"end\":\r\n\t\t\t//case to handle scenario when trying to skip past end stage\r\n\t\t}\r\n\t}\r\n\t\r\n\t//regenerate row numbers for row number formatter if in use\r\n\tregenerateRowNumbers(){\r\n\t\tif(this.rowNumColumn){\r\n\t\t\tthis.activeRows.forEach((row) => {\r\n\t\t\t\tvar cell = row.getCell(this.rowNumColumn);\r\n\t\t\t\t\r\n\t\t\t\tif(cell){\r\n\t\t\t\t\tcell._generateContents();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetActiveRows(activeRows){\r\n\t\tthis.activeRows = activeRows;\r\n\t\tthis.activeRowsCount = this.activeRows.length;\r\n\t}\r\n\t\r\n\t//reset display rows array\r\n\tresetDisplayRows(){\r\n\t\tthis.displayRows = [];\r\n\t\t\r\n\t\tthis.displayRows.push(this.activeRows.slice(0));\r\n\t\t\r\n\t\tthis.displayRowsCount = this.displayRows[0].length;\r\n\t}\r\n\t\r\n\tgetNextDisplayIndex(){\r\n\t\treturn this.displayRows.length;\r\n\t}\r\n\t\r\n\t//set display row pipeline data\r\n\tsetDisplayRows(displayRows, index){\r\n\t\t\r\n\t\tvar output = true;\r\n\t\t\r\n\t\tif(index && typeof this.displayRows[index] != \"undefined\"){\r\n\t\t\tthis.displayRows[index] = displayRows;\r\n\t\t\toutput = true;\r\n\t\t}else{\r\n\t\t\tthis.displayRows.push(displayRows)\r\n\t\t\toutput = index = this.displayRows.length -1;\r\n\t\t}\r\n\t\t\r\n\t\tif(index == this.displayRows.length -1){\r\n\t\t\tthis.displayRowsCount = this.displayRows[this.displayRows.length -1].length;\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetDisplayRows(index){\r\n\t\tif(typeof index == \"undefined\"){\r\n\t\t\treturn this.displayRows.length ? this.displayRows[this.displayRows.length -1] : [];\r\n\t\t}else{\r\n\t\t\treturn this.displayRows[index] || [];\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetVisibleRows(chain, viewable){\r\n\t\tvar rows = Object.assign([], this.renderer.visibleRows(!viewable));\r\n\t\t\r\n\t\tif(chain){\r\n\t\t\trows = this.chain(\"rows-visible\", [viewable], rows, rows);\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t//repeat action accross display rows\r\n\tdisplayRowIterator(callback){\r\n\t\tthis.activeRowsPipeline.forEach(callback);\r\n\t\tthis.displayRows.forEach(callback);\r\n\t\t\r\n\t\tthis.displayRowsCount = this.displayRows[this.displayRows.length -1].length;\r\n\t}\r\n\t\r\n\t//return only actual rows (not group headers etc)\r\n\tgetRows(type){\r\n\t\tvar rows;\r\n\t\t\r\n\t\tswitch(type){\r\n\t\t\tcase \"active\":\r\n\t\t\trows = this.activeRows;\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"display\":\r\n\t\t\trows = this.table.rowManager.getDisplayRows();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"visible\":\r\n\t\t\trows = this.getVisibleRows(false, true);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\trows = this.chain(\"rows-retrieve\", type, null, this.rows) || this.rows;\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t///////////////// Table Rendering /////////////////\r\n\t//trigger rerender of table in current position\r\n\treRenderInPosition(callback){\r\n\t\tif(this.redrawBlock){\r\n\t\t\tif(callback){\r\n\t\t\t\tcallback();\r\n\t\t\t}else{\r\n\t\t\t\tthis.redrawBlockRenderInPosition = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"renderStarted\");\r\n\t\t\tthis.renderer.rerenderRows(callback);\r\n\t\t\tthis.dispatchExternal(\"renderComplete\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeRenderer(){\r\n\t\tvar renderClass;\r\n\t\t\r\n\t\tvar renderers = {\r\n\t\t\t\"virtual\": RendererVirtualDomVertical,\r\n\t\t\t\"basic\": RendererBasicVertical,\r\n\t\t};\r\n\t\t\r\n\t\tif(typeof this.table.options.renderVertical === \"string\"){\r\n\t\t\trenderClass = renderers[this.table.options.renderVertical];\r\n\t\t}else{\r\n\t\t\trenderClass = this.table.options.renderVertical;\r\n\t\t}\r\n\t\t\r\n\t\tif(renderClass){\r\n\t\t\tthis.renderer = new renderClass(this.table, this.element, this.tableElement);\r\n\t\t\tthis.renderer.initialize();\r\n\t\t\t\r\n\t\t\tif((this.table.element.clientHeight || this.table.options.height)){\r\n\t\t\t\tthis.fixedHeight = true;\r\n\t\t\t}else{\r\n\t\t\t\tthis.fixedHeight = false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Unable to find matching renderer:\", table.options.renderVertical);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRenderMode(){\r\n\t\treturn this.renderMode;\r\n\t}\r\n\t\r\n\trenderTable(){\r\n\t\tthis.dispatchExternal(\"renderStarted\");\r\n\t\t\r\n\t\tthis.element.scrollTop = 0;\r\n\t\t\r\n\t\tthis._clearTable();\r\n\t\t\r\n\t\tif(this.displayRowsCount){\r\n\t\t\tthis.renderer.renderRows();\r\n\t\t\t\r\n\t\t\tif(this.firstRender){\r\n\t\t\t\tthis.firstRender = false;\r\n\t\t\t\tthis.layoutRefresh();\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.renderEmptyScroll();\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.fixedHeight){\r\n\t\t\tthis.adjustTableSize();\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatch(\"table-layout\");\r\n\t\t\r\n\t\tif(!this.displayRowsCount){\r\n\t\t\tthis._showPlaceholder();\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatchExternal(\"renderComplete\");\r\n\t}\r\n\t\r\n\t//show scrollbars on empty table div\r\n\trenderEmptyScroll(){\r\n\t\tif(this.placeholder){\r\n\t\t\tthis.tableElement.style.display = \"none\";\r\n\t\t}else{\r\n\t\t\tthis.tableElement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t\t// this.tableElement.style.minHeight = \"1px\";\r\n\t\t\t// this.tableElement.style.visibility = \"hidden\";\r\n\t\t}\r\n\t}\r\n\t\r\n\t_clearTable(){\r\n\t\tvar element = this.tableElement;\r\n\t\t\r\n\t\tthis._clearPlaceholder();\r\n\t\t\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.renderer.clearRows();\r\n\t}\r\n\t\r\n\t_showPlaceholder(){\r\n\t\tif(this.placeholder){\r\n\t\t\tthis.placeholder.setAttribute(\"tabulator-render-mode\", this.renderMode);\r\n\t\t\t\r\n\t\t\tthis.getElement().appendChild(this.placeholder);\r\n\t\t\tthis._positionPlaceholder();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_clearPlaceholder(){\r\n\t\tif(this.placeholder && this.placeholder.parentNode){\r\n\t\t\tthis.placeholder.parentNode.removeChild(this.placeholder);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_positionPlaceholder(){\r\n\t\tif(this.placeholder && this.placeholder.parentNode){\r\n\t\t\tthis.placeholder.style.width = this.table.columnManager.getWidth() + \"px\";\r\n\t\t\tthis.placeholderContents.style.width = this.table.rowManager.element.clientWidth + \"px\";\r\n\t\t\tthis.placeholderContents.style.marginLeft = this.scrollLeft + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tstyleRow(row, index){\r\n\t\tvar rowEl = row.getElement();\r\n\t\t\r\n\t\tif(index % 2){\r\n\t\t\trowEl.classList.add(\"tabulator-row-even\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-odd\");\r\n\t\t}else{\r\n\t\t\trowEl.classList.add(\"tabulator-row-odd\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-even\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t//normalize height of active rows\r\n\tnormalizeHeight(){\r\n\t\tthis.activeRows.forEach(function(row){\r\n\t\t\trow.normalizeHeight();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//adjust the height of the table holder to fit in the Tabulator element\r\n\tadjustTableSize(){\r\n\t\tvar initialHeight = this.element.clientHeight,\r\n\t\tmodExists;\r\n\t\t\r\n\t\tif(this.renderer.verticalFillMode === \"fill\"){\r\n\t\t\tlet otherHeight = Math.floor(this.table.columnManager.getElement().getBoundingClientRect().height + (this.table.footerManager && this.table.footerManager.active && !this.table.footerManager.external ? this.table.footerManager.getElement().getBoundingClientRect().height : 0));\r\n\t\t\t\r\n\t\t\tif(this.fixedHeight){\r\n\t\t\t\tthis.element.style.minHeight = \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t\tthis.element.style.height = \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t\tthis.element.style.maxHeight = \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.element.style.height = \"\";\r\n\t\t\t\tthis.element.style.height = (this.table.element.clientHeight - otherHeight) + \"px\";\r\n\t\t\t\tthis.element.scrollTop = this.scrollTop;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.renderer.resize();\r\n\t\t\t\r\n\t\t\t//check if the table has changed size when dealing with variable height tables\r\n\t\t\tif(!this.fixedHeight && initialHeight != this.element.clientHeight){\r\n\t\t\t\tif(this.subscribed(\"table-resize\")){\r\n\t\t\t\t\tthis.dispatch(\"table-resize\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.redraw();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis._positionPlaceholder();\r\n\t}\r\n\t\r\n\t//renitialize all rows\r\n\treinitialize(){\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\trow.reinitialize(true);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//prevent table from being redrawn\r\n\tblockRedraw (){\r\n\t\tthis.redrawBlock = true;\r\n\t\tthis.redrawBlockRestoreConfig = false;\r\n\t}\r\n\t\r\n\t//restore table redrawing\r\n\trestoreRedraw (){\r\n\t\tthis.redrawBlock = false;\r\n\t\t\r\n\t\tif(this.redrawBlockRestoreConfig){\r\n\t\t\tthis.refreshActiveData(this.redrawBlockRestoreConfig.handler, this.redrawBlockRestoreConfig.skipStage, this.redrawBlockRestoreConfig.renderInPosition)\r\n\t\t\t\r\n\t\t\tthis.redrawBlockRestoreConfig = false;\r\n\t\t}else{\r\n\t\t\tif(this.redrawBlockRenderInPosition){\r\n\t\t\t\tthis.reRenderInPosition();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.redrawBlockRenderInPosition = false;\r\n\t}\r\n\t\r\n\t//redraw table\r\n\tredraw (force){\r\n\t\tvar pos = 0,\r\n\t\tleft = this.scrollLeft;\r\n\t\t\r\n\t\tthis.adjustTableSize();\r\n\t\t\r\n\t\tthis.table.tableWidth = this.table.element.clientWidth;\r\n\t\t\r\n\t\tif(!force){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t\tthis.scrollHorizontal(left);\r\n\t\t}else{\r\n\t\t\tthis.renderTable();\r\n\t\t}\r\n\t}\r\n\t\r\n\tresetScroll(){\r\n\t\tthis.element.scrollLeft = 0;\r\n\t\tthis.element.scrollTop = 0;\r\n\t\t\r\n\t\tif(this.table.browser === \"ie\"){\r\n\t\t\tvar event = document.createEvent(\"Event\");\r\n\t\t\tevent.initEvent(\"scroll\", false, true);\r\n\t\t\tthis.element.dispatchEvent(event);\r\n\t\t}else{\r\n\t\t\tthis.element.dispatchEvent(new Event('scroll'));\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\n\r\nexport default class FooterManager extends CoreFeature{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.active = false;\r\n\t\tthis.element = this.createElement(); //containing element\r\n\t\tthis.containerElement = this.createContainerElement(); //containing element\r\n\t\tthis.external = false;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.initializeElement();\r\n\t}\r\n\r\n\tcreateElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-footer\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\t\r\n\tcreateContainerElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-footer-contents\");\r\n\r\n\t\tthis.element.appendChild(el);\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitializeElement(){\r\n\t\tif(this.table.options.footerElement){\r\n\r\n\t\t\tswitch(typeof this.table.options.footerElement){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tif(this.table.options.footerElement[0] === \"<\"){\r\n\t\t\t\t\tthis.containerElement.innerHTML = this.table.options.footerElement;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.external = true;\r\n\t\t\t\t\tthis.containerElement = document.querySelector(this.table.options.footerElement);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\tthis.element = this.table.options.footerElement;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\tappend(element){\r\n\t\tthis.activate();\r\n\r\n\t\tthis.containerElement.appendChild(element);\r\n\t\tthis.table.rowManager.adjustTableSize();\r\n\t}\r\n\r\n\tprepend(element){\r\n\t\tthis.activate();\r\n\r\n\t\tthis.element.insertBefore(element, this.element.firstChild);\r\n\t\tthis.table.rowManager.adjustTableSize();\r\n\t}\r\n\r\n\tremove(element){\r\n\t\telement.parentNode.removeChild(element);\r\n\t\tthis.deactivate();\r\n\t}\r\n\r\n\tdeactivate(force){\r\n\t\tif(!this.element.firstChild || force){\r\n\t\t\tif(!this.external){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\t\t\tthis.active = false;\r\n\t\t}\r\n\t}\r\n\r\n\tactivate(){\r\n\t\tif(!this.active){\r\n\t\t\tthis.active = true;\r\n\t\t\tif(!this.external){\r\n\t\t\t\tthis.table.element.appendChild(this.getElement());\r\n\t\t\t\tthis.table.element.style.display = '';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tredraw(){\r\n\t\tthis.dispatch(\"footer-redraw\")\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from './Helpers.js';\r\nimport Row from '../row/Row.js';\r\n\r\nexport default class InteractionManager extends CoreFeature {\r\n\t\r\n\tconstructor (table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.el = null;\r\n\t\t\r\n\t\tthis.abortClasses = [\"tabulator-headers\", \"tabulator-table\"];\r\n\t\t\r\n\t\tthis.previousTargets = {};\r\n\t\t\r\n\t\tthis.listeners = [\r\n\t\t\t\"click\",\r\n\t\t\t\"dblclick\",\r\n\t\t\t\"contextmenu\",\r\n\t\t\t\"mouseenter\",\r\n\t\t\t\"mouseleave\",\r\n\t\t\t\"mouseover\",\r\n\t\t\t\"mouseout\",\r\n\t\t\t\"mousemove\",\r\n\t\t\t\"touchstart\",\r\n\t\t\t\"touchend\",\r\n\t\t];\r\n\t\t\r\n\t\tthis.componentMap = {\r\n\t\t\t\"tabulator-cell\":\"cell\",\r\n\t\t\t\"tabulator-row\":\"row\",\r\n\t\t\t\"tabulator-group\":\"group\",\r\n\t\t\t\"tabulator-col\":\"column\",\r\n\t\t};\r\n\t\t\r\n\t\tthis.pseudoTrackers = {\r\n\t\t\t\"row\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"cell\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"group\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"column\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t}\r\n\t\t\r\n\t\tthis.pseudoTracking = false;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.el = this.table.element;\r\n\t\t\r\n\t\tthis.buildListenerMap();\r\n\t\tthis.bindSubscriptionWatchers();\r\n\t}\r\n\t\r\n\tbuildListenerMap(){\r\n\t\tvar listenerMap = {};\r\n\t\t\r\n\t\tthis.listeners.forEach((listener) => {\r\n\t\t\tlistenerMap[listener] = {\r\n\t\t\t\thandler:null,\r\n\t\t\t\tcomponents:[],\r\n\t\t\t}\r\n\t\t})\r\n\t\t\r\n\t\tthis.listeners = listenerMap;\r\n\t}\r\n\t\r\n\tbindPseudoEvents(){\r\n\t\tObject.keys(this.pseudoTrackers).forEach((key) => {\r\n\t\t\tthis.pseudoTrackers[key].subscriber = this.pseudoMouseEnter.bind(this, key);\r\n\t\t\tthis.subscribe(key + \"-mouseover\", this.pseudoTrackers[key].subscriber);\r\n\t\t});\r\n\t\t\r\n\t\tthis.pseudoTracking = true;\r\n\t}\r\n\t\r\n\tpseudoMouseEnter(key, e, target){\r\n\t\tif(this.pseudoTrackers[key].target !== target){\r\n\t\t\t\r\n\t\t\tif(this.pseudoTrackers[key].target){\r\n\t\t\t\tthis.dispatch(key + \"-mouseleave\", e, this.pseudoTrackers[key].target);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.pseudoMouseLeave(key, e);\r\n\t\t\t\r\n\t\t\tthis.pseudoTrackers[key].target = target;\r\n\t\t\t\r\n\t\t\tthis.dispatch(key + \"-mouseenter\", e, target);\r\n\t\t}\r\n\t}\r\n\t\r\n\tpseudoMouseLeave(key, e){\r\n\t\tvar leaveList = Object.keys(this.pseudoTrackers),\r\n\t\tlinkedKeys = {\r\n\t\t\t\"row\":[\"cell\"],\r\n\t\t\t\"cell\":[\"row\"],\r\n\t\t};\r\n\t\t\r\n\t\tleaveList = leaveList.filter((item) => {\r\n\t\t\tvar links = linkedKeys[key];\r\n\t\t\treturn item !== key && (!links || (links && !links.includes(item)));\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\tleaveList.forEach((key) => {\r\n\t\t\tvar target = this.pseudoTrackers[key].target;\r\n\t\t\t\r\n\t\t\tif(this.pseudoTrackers[key].target){\r\n\t\t\t\tthis.dispatch(key + \"-mouseleave\", e, target);\r\n\t\t\t\t\r\n\t\t\t\tthis.pseudoTrackers[key].target = null;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t\r\n\tbindSubscriptionWatchers(){\r\n\t\tvar listeners = Object.keys(this.listeners),\r\n\t\tcomponents = Object.values(this.componentMap);\r\n\t\t\r\n\t\tfor(let comp of components){\r\n\t\t\tfor(let listener of listeners){\r\n\t\t\t\tlet key = comp + \"-\" + listener;\r\n\t\t\t\t\r\n\t\t\t\tthis.subscriptionChange(key, this.subscriptionChanged.bind(this, comp, listener));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.subscribe(\"table-destroy\", this.clearWatchers.bind(this))\r\n\t}\r\n\t\r\n\tsubscriptionChanged(component, key, added){\r\n\t\tvar listener = this.listeners[key].components,\r\n\t\tindex = listener.indexOf(component),\r\n\t\tchanged = false;\r\n\t\t\r\n\t\tif(added){\r\n\t\t\tif(index === -1){\r\n\t\t\t\tlistener.push(component);\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!this.subscribed(component + \"-\" + key)){\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tlistener.splice(index, 1);\r\n\t\t\t\t\tchanged = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif((key === \"mouseenter\" || key === \"mouseleave\") && !this.pseudoTracking){\r\n\t\t\tthis.bindPseudoEvents();\r\n\t\t}\r\n\t\t\r\n\t\tif(changed){\r\n\t\t\tthis.updateEventListeners();\r\n\t\t}\r\n\t}\r\n\t\r\n\tupdateEventListeners(){\r\n\t\tfor(let key in this.listeners){\r\n\t\t\tlet listener = this.listeners[key];\r\n\t\t\t\r\n\t\t\tif(listener.components.length){\r\n\t\t\t\tif(!listener.handler){\r\n\t\t\t\t\tlistener.handler = this.track.bind(this, key);\r\n\t\t\t\t\tthis.el.addEventListener(key, listener.handler)\r\n\t\t\t\t\t// this.el.addEventListener(key, listener.handler, {passive: true})\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(listener.handler){\r\n\t\t\t\t\tthis.el.removeEventListener(key, listener.handler)\r\n\t\t\t\t\tlistener.handler = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\ttrack(type, e){\r\n\t\tvar path = (e.composedPath && e.composedPath()) || e.path;\r\n\t\t\r\n\t\tvar targets = this.findTargets(path);\r\n\t\ttargets = this.bindComponents(type, targets);\r\n\t\t\r\n\t\tthis.triggerEvents(type, e, targets);\r\n\t\t\r\n\t\tif(this.pseudoTracking && (type == \"mouseover\" || type == \"mouseleave\") && !Object.keys(targets).length){\r\n\t\t\tthis.pseudoMouseLeave(\"none\", e);\r\n\t\t}\r\n\t}\r\n\t\r\n\tfindTargets(path){\r\n\t\tvar targets = {};\r\n\t\t\r\n\t\tlet componentMap = Object.keys(this.componentMap);\r\n\t\t\r\n\t\tfor (let el of path) {\r\n\t\t\tlet classList = el.classList ? [...el.classList] : [];\r\n\t\t\t\r\n\t\t\tlet abort = classList.filter((item) => {\r\n\t\t\t\treturn this.abortClasses.includes(item);\r\n\t\t\t})\r\n\t\t\t\r\n\t\t\tif(abort.length){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tlet elTargets = classList.filter((item) => {\r\n\t\t\t\treturn componentMap.includes(item);\r\n\t\t\t})\r\n\t\t\t\r\n\t\t\tfor (let target of elTargets) {\r\n\t\t\t\ttargets[this.componentMap[target]] = el;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(targets.group && targets.group === targets.row){\r\n\t\t\tdelete targets.row;\r\n\t\t}\r\n\t\t\r\n\t\treturn targets;\r\n\t}\r\n\t\r\n\tbindComponents(type, targets){\r\n\t\t//ensure row component is looked up before cell\r\n\t\tvar keys = Object.keys(targets).reverse(),\r\n\t\tlistener = this.listeners[type],\r\n\t\ttargetMatches = {};\r\n\t\t\r\n\t\tfor(let key of keys){\r\n\t\t\tlet component;\r\n\t\t\tlet target = targets[key];\r\n\t\t\tlet previousTarget = this.previousTargets[key];\r\n\t\t\t\r\n\t\t\tif(previousTarget && previousTarget.target === target){\r\n\t\t\t\tcomponent = previousTarget.component;\r\n\t\t\t}else{\r\n\t\t\t\tswitch(key){\r\n\t\t\t\t\tcase \"row\":\r\n\t\t\t\t\tcase \"group\":\r\n\t\t\t\t\tif(listener.components.includes(\"row\") || listener.components.includes(\"cell\") || listener.components.includes(\"group\")){\r\n\t\t\t\t\t\tlet rows = this.table.rowManager.getVisibleRows(true);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcomponent = rows.find((row) => {\r\n\t\t\t\t\t\t\treturn row.getElement() === target;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(targets[\"row\"] && targets[\"row\"].parentNode && targets[\"row\"].parentNode.closest(\".tabulator-row\")){\r\n\t\t\t\t\t\t\ttargets[key] = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"column\":\r\n\t\t\t\t\tif(listener.components.includes(\"column\")){\r\n\t\t\t\t\t\tcomponent = this.table.columnManager.findColumn(target);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"cell\":\r\n\t\t\t\t\tif(listener.components.includes(\"cell\")){\r\n\t\t\t\t\t\tif(targets[\"row\"] instanceof Row){\r\n\t\t\t\t\t\t\tcomponent = targets[\"row\"].findCell(target);\r\n\t\t\t\t\t\t}else{\t\r\n\t\t\t\t\t\t\tif(targets[\"row\"]){\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?\")\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(component){\r\n\t\t\t\ttargets[key] = component;\r\n\t\t\t\ttargetMatches[key] = {\r\n\t\t\t\t\ttarget:target,\r\n\t\t\t\t\tcomponent:component,\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.previousTargets = targetMatches;\r\n\t\t\r\n\t\treturn targets;\r\n\t}\r\n\t\r\n\ttriggerEvents(type, e, targets){\r\n\t\tvar listener = this.listeners[type];\r\n\t\t\r\n\t\tfor(let key in targets){\r\n\t\t\tif(targets[key] && listener.components.includes(key)){\r\n\t\t\t\tthis.dispatch(key + \"-\" + type, e, targets[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearWatchers(){\r\n\t\tfor(let key in this.listeners){\r\n\t\t\tlet listener = this.listeners[key];\r\n\t\t\t\r\n\t\t\tif(listener.handler){\r\n\t\t\t\tthis.el.removeEventListener(key, listener.handler)\r\n\t\t\t\tlistener.handler = null;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}","export default class ComponentFunctionBinder{\r\n\r\n\tconstructor(table){\r\n\t\tthis.table = table;\r\n\r\n\t\tthis.bindings = {};\r\n\t}\r\n\r\n\tbind(type, funcName, handler){\r\n\t\tif(!this.bindings[type]){\r\n\t\t\tthis.bindings[type] = {};\r\n\t\t}\r\n\r\n\t\tif(this.bindings[type][funcName]){\r\n\t\t\tconsole.warn(\"Unable to bind component handler, a matching function name is already bound\", type, funcName, handler)\r\n\t\t}else{\r\n\t\t\tthis.bindings[type][funcName] = handler;\r\n\t\t}\r\n\t}\r\n\r\n\thandle(type, component, name){\r\n\t\tif(this.bindings[type] && this.bindings[type][name] && typeof this.bindings[type][name].bind === 'function'){\r\n\t\t\treturn this.bindings[type][name].bind(null, component);\r\n\t\t}else{\r\n\t\t\tif(name !== \"then\" && typeof name === \"string\" && !name.startsWith(\"_\")){\r\n\t\t\t\t\tconsole.error(\"The \" + type + \" component does not have a \" + name + \" function, have you checked that you have the correct Tabulator module installed?\")\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n","import CoreFeature from '../CoreFeature.js';\r\n\r\nexport default class DataLoader extends CoreFeature{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.requestOrder = 0; //prevent requests coming out of sequence if overridden by another load request\r\n\t\tthis.loading = false;\r\n\t}\r\n\r\n\tinitialize(){}\r\n\r\n\tload(data, params, config, replace, silent, columnsChanged){\r\n\t\tvar requestNo = ++this.requestOrder;\r\n\r\n\t\tthis.dispatchExternal(\"dataLoading\", data);\r\n\r\n\t\t//parse json data to array\r\n\t\tif (data && (data.indexOf(\"{\") == 0 || data.indexOf(\"[\") == 0)){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\r\n\t\tif(this.confirm(\"data-loading\", [data, params, config, silent])){\r\n\t\t\tthis.loading = true;\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.alertLoader();\r\n\t\t\t}\r\n\r\n\t\t\t//get params for request\r\n\t\t\tparams = this.chain(\"data-params\", [data, config, silent], params || {}, params || {});\r\n\r\n\t\t\tparams = this.mapParams(params, this.table.options.dataSendParams);\r\n\r\n\t\t\tvar result = this.chain(\"data-load\", [data, params, config, silent], false, Promise.resolve([]));\r\n\t\t\t\r\n\t\t\treturn result.then((response) => {\r\n\t\t\t\tif(!Array.isArray(response) && typeof response == \"object\"){\r\n\t\t\t\t\tresponse = this.mapParams(response, this.objectInvert(this.table.options.dataReceiveParams));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar rowData = this.chain(\"data-loaded\", response, null, response);\r\n\r\n\t\t\t\tif(requestNo == this.requestOrder){\r\n\t\t\t\t\tthis.clearAlert();\r\n\r\n\t\t\t\t\tif(rowData !== false){\r\n\t\t\t\t\t\tthis.dispatchExternal(\"dataLoaded\", rowData);\r\n\t\t\t\t\t\tthis.table.rowManager.setData(rowData, replace, typeof columnsChanged === \"undefined\" ? !replace : columnsChanged);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made\");\r\n\t\t\t\t}\r\n\t\t\t}).catch((error) => {\r\n\t\t\t\tconsole.error(\"Data Load Error: \", error);\r\n\t\t\t\tthis.dispatchExternal(\"dataLoadError\", error);\r\n\r\n\t\t\t\tif(!silent){\r\n\t\t\t\t\tthis.alertError();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tthis.clearAlert();\r\n\t\t\t\t}, this.table.options.dataLoaderErrorTimeout);\r\n\t\t\t})\r\n\t\t\t.finally(() => {\r\n\t\t\t\tthis.loading = false;\r\n\t\t\t})\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"dataLoaded\", data);\r\n\r\n\t\t\tif(!data){\r\n\t\t\t\tdata = [];\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.rowManager.setData(data, replace, typeof columnsChanged === \"undefined\" ? !replace : columnsChanged);\r\n\t\t\treturn Promise.resolve();\r\n\t\t}\r\n\t}\r\n\r\n\tmapParams(params, map){\r\n\t\tvar output = {};\r\n\r\n\t\tfor(let key in params){\r\n\t\t\toutput[map.hasOwnProperty(key) ? map[key] : key] = params[key];\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tobjectInvert(obj){\r\n\t\tvar output = {};\r\n\r\n\t\tfor(let key in obj){\r\n\t\t\toutput[obj[key]] = key;\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tblockActiveLoad(){\r\n\t\tthis.requestOrder++;\r\n\t}\r\n\r\n\talertLoader(){\r\n\t\tvar shouldLoad = typeof this.table.options.dataLoader === \"function\" ? this.table.options.dataLoader() : this.table.options.dataLoader;\r\n\r\n\t\tif(shouldLoad){\r\n\t\t\tthis.table.alertManager.alert(this.table.options.dataLoaderLoading || this.langText(\"data|loading\"));\r\n\t\t}\r\n\t}\r\n\r\n\talertError(){\r\n\t\tthis.table.alertManager.alert(this.table.options.dataLoaderError || this.langText(\"data|error\"), \"error\");\r\n\t}\r\n\r\n\tclearAlert(){\r\n\t\tthis.table.alertManager.clear();\r\n\t}\r\n}","export default class ExternalEventBus {\r\n\r\n\tconstructor(table, optionsList, debug){\r\n\t\tthis.table = table;\r\n\t\tthis.events = {};\r\n\t\tthis.optionsList = optionsList || {};\r\n\t\tthis.subscriptionNotifiers = {};\r\n\r\n\t\tthis.dispatch = debug ? this._debugDispatch.bind(this) : this._dispatch.bind(this);\r\n\t\tthis.debug = debug;\r\n\t}\r\n\r\n\tsubscriptionChange(key, callback){\r\n\t\tif(!this.subscriptionNotifiers[key]){\r\n\t\t\tthis.subscriptionNotifiers[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.subscriptionNotifiers[key].push(callback);\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis._notifiySubscriptionChange(key, true);\r\n\t\t}\r\n\t}\r\n\r\n\tsubscribe(key, callback){\r\n\t\tif(!this.events[key]){\r\n\t\t\tthis.events[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.events[key].push(callback);\r\n\r\n\t\tthis._notifiySubscriptionChange(key, true);\r\n\t}\r\n\r\n\tunsubscribe(key, callback){\r\n\t\tvar index;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tif(callback){\r\n\t\t\t\tindex = this.events[key].findIndex((item) => {\r\n\t\t\t\t\treturn item === callback;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tthis.events[key].splice(index, 1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Cannot remove event, no matching event found:\", key, callback);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tdelete this.events[key];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cannot remove event, no events set on:\", key);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._notifiySubscriptionChange(key, false);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.events[key] && this.events[key].length;\r\n\t}\r\n\r\n\t_notifiySubscriptionChange(key, subscribed){\r\n\t\tvar notifiers = this.subscriptionNotifiers[key];\r\n\r\n\t\tif(notifiers){\r\n\t\t\tnotifiers.forEach((callback)=>{\r\n\t\t\t\tcallback(subscribed);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_dispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args.shift(),\r\n\t\tresult;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tthis.events[key].forEach((callback, i) => {\r\n\t\t\t\tlet callResult = callback.apply(this.table, args);\r\n\r\n\t\t\t\tif(!i){\r\n\t\t\t\t\tresult = callResult;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\t_debugDispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"ExternalEvent:\" + args[0];\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._dispatch(...arguments)\r\n\t}\r\n}","export default class InternalEventBus {\r\n\r\n\tconstructor(debug){\r\n\t\tthis.events = {};\r\n\t\tthis.subscriptionNotifiers = {};\r\n\r\n\t\tthis.dispatch = debug ? this._debugDispatch.bind(this) : this._dispatch.bind(this);\r\n\t\tthis.chain = debug ? this._debugChain.bind(this) : this._chain.bind(this);\r\n\t\tthis.confirm = debug ? this._debugConfirm.bind(this) : this._confirm.bind(this);\r\n\t\tthis.debug = debug;\r\n\t}\r\n\r\n\tsubscriptionChange(key, callback){\r\n\t\tif(!this.subscriptionNotifiers[key]){\r\n\t\t\tthis.subscriptionNotifiers[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.subscriptionNotifiers[key].push(callback);\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis._notifiySubscriptionChange(key, true);\r\n\t\t}\r\n\t}\r\n\r\n\tsubscribe(key, callback, priority = 10000){\r\n\t\tif(!this.events[key]){\r\n\t\t\tthis.events[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.events[key].push({callback, priority});\r\n\r\n\t\tthis.events[key].sort((a, b) => {\r\n\t\t\treturn a.priority - b.priority;\r\n\t\t});\r\n\r\n\t\tthis._notifiySubscriptionChange(key, true);\r\n\t}\r\n\r\n\tunsubscribe(key, callback){\r\n\t\tvar index;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tif(callback){\r\n\t\t\t\tindex = this.events[key].findIndex((item) => {\r\n\t\t\t\t\treturn item.callback === callback;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tthis.events[key].splice(index, 1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Cannot remove event, no matching event found:\", key, callback);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cannot remove event, no events set on:\", key);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._notifiySubscriptionChange(key, false);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.events[key] && this.events[key].length;\r\n\t}\r\n\r\n\t_chain(key, args, initialValue, fallback){\r\n\t\tvar value = initialValue;\r\n\r\n\t\tif(!Array.isArray(args)){\r\n\t\t\targs = [args];\r\n\t\t}\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis.events[key].forEach((subscriber, i) => {\r\n\t\t\t\tvalue = subscriber.callback.apply(this, args.concat([value]));\r\n\t\t\t});\r\n\r\n\t\t\treturn value;\r\n\t\t}else{\r\n\t\t\treturn typeof fallback === \"function\" ? fallback() : fallback;\r\n\t\t}\r\n\t}\r\n\r\n\t_confirm(key, args){\r\n\t\tvar confirmed = false;\r\n\r\n\t\tif(!Array.isArray(args)){\r\n\t\t\targs = [args];\r\n\t\t}\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis.events[key].forEach((subscriber, i) => {\r\n\t\t\t\tif(subscriber.callback.apply(this, args)){\r\n\t\t\t\t\tconfirmed = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn confirmed;\r\n\t}\r\n\r\n\t_notifiySubscriptionChange(key, subscribed){\r\n\t\tvar notifiers = this.subscriptionNotifiers[key];\r\n\r\n\t\tif(notifiers){\r\n\t\t\tnotifiers.forEach((callback)=>{\r\n\t\t\t\tcallback(subscribed);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_dispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args.shift();\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tthis.events[key].forEach((subscriber) => {\r\n\t\t\t\tlet callResult = subscriber.callback.apply(this, args);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_debugDispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._dispatch(...arguments);\r\n\t}\r\n\r\n\t_debugChain(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._chain(...arguments);\r\n\t}\r\n\r\n\t_debugConfirm(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._confirm(...arguments);\r\n\t}\r\n}","import Tabulator from '../Tabulator.js';\r\n\r\nclass TableRegistry {\r\n\r\n\tstatic register(table){\r\n\t\tTableRegistry.tables.push(table);\r\n\t}\r\n\r\n\tstatic deregister(table){\r\n\t\tvar index = TableRegistry.tables.indexOf(table);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tTableRegistry.tables.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\tstatic lookupTable(query, silent){\r\n\t\tvar results = [],\r\n\t\tmatches, match;\r\n\r\n\t\tif(typeof query === \"string\"){\r\n\t\t\tmatches = document.querySelectorAll(query);\r\n\r\n\t\t\tif(matches.length){\r\n\t\t\t\tfor(var i = 0; i < matches.length; i++){\r\n\t\t\t\t\tmatch = TableRegistry.matchElement(matches[i]);\r\n\r\n\t\t\t\t\tif(match){\r\n\t\t\t\t\t\tresults.push(match);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}else if((typeof HTMLElement !== \"undefined\" && query instanceof HTMLElement) || query instanceof Tabulator){\r\n\t\t\tmatch = TableRegistry.matchElement(query);\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tresults.push(match);\r\n\t\t\t}\r\n\t\t}else if(Array.isArray(query)){\r\n\t\t\tquery.forEach(function(item){\r\n\t\t\t\tresults = results.concat(TableRegistry.lookupTable(item));\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Table Connection Error - Invalid Selector\", query);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\tstatic matchElement(element){\r\n\t\treturn TableRegistry.tables.find(function(table){\r\n\t\t\treturn element instanceof Tabulator ? table === element : table.element === element;\r\n\t\t});\r\n\t}\r\n}\r\n\r\nTableRegistry.tables = [];\r\n\r\nexport default TableRegistry;","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from './Helpers.js';\r\n\r\nexport default class Popup extends CoreFeature{\r\n constructor(table, element, parent){\r\n super(table);\r\n \r\n this.element = element;\r\n this.container = this._lookupContainer();\r\n \r\n this.parent = parent;\r\n \r\n this.reversedX = false;\r\n this.childPopup = null;\r\n this.blurable = false;\r\n this.blurCallback = null;\r\n this.renderedCallback = null;\r\n \r\n this.visible = false;\r\n \r\n this.element.classList.add(\"tabulator-popup-container\");\r\n \r\n this.blurEvent = this.hide.bind(this, false);\r\n this.escEvent = this._escapeCheck.bind(this);\r\n\r\n this.destroyBinding = this.hide.bind(this, true);\r\n }\r\n \r\n _lookupContainer(){\r\n var container = this.table.options.popupContainer;\r\n \r\n if(typeof container === \"string\"){\r\n container = document.querySelector(container);\r\n \r\n if(!container){\r\n console.warn(\"Menu Error - no container element found matching selector:\", this.table.options.popupContainer , \"(defaulting to document body)\");\r\n }\r\n }else if (container === true){\r\n container = this.table.element;\r\n }\r\n \r\n if(container && !this._checkContainerIsParent(container)){\r\n container = false;\r\n console.warn(\"Menu Error - container element does not contain this table:\", this.table.options.popupContainer , \"(defaulting to document body)\");\r\n }\r\n \r\n if(!container){\r\n container = document.body;\r\n }\r\n \r\n return container;\r\n }\r\n \r\n _checkContainerIsParent(container, element = this.table.element){\r\n if(container === element){\r\n return true;\r\n }else{\r\n return element.parentNode ? this._checkContainerIsParent(container, element.parentNode) : false;\r\n }\r\n }\r\n \r\n renderCallback(callback){\r\n this.renderedCallback = callback;\r\n }\r\n \r\n containerEventCoords(e){\r\n var touch = !(e instanceof MouseEvent);\r\n \r\n var x = touch ? e.touches[0].pageX : e.pageX;\r\n var y = touch ? e.touches[0].pageY : e.pageY;\r\n \r\n if(this.container !== document.body){\r\n let parentOffset = Helpers.elOffset(this.container);\r\n \r\n x -= parentOffset.left;\r\n y -= parentOffset.top;\r\n }\r\n \r\n return {x, y};\r\n }\r\n \r\n elementPositionCoords(element, position = \"right\"){\r\n var offset = Helpers.elOffset(element),\r\n containerOffset, x, y;\r\n \r\n if(this.container !== document.body){\r\n containerOffset = Helpers.elOffset(this.container);\r\n \r\n offset.left -= containerOffset.left;\r\n offset.top -= containerOffset.top;\r\n }\r\n \r\n switch(position){\r\n case \"right\":\r\n x = offset.left + element.offsetWidth;\r\n y = offset.top - 1;\r\n break;\r\n \r\n case \"bottom\":\r\n x = offset.left;\r\n y = offset.top + element.offsetHeight;\r\n break;\r\n }\r\n \r\n return {x, y, offset};\r\n }\r\n \r\n show(origin, position){\r\n var x, y, parentEl, parentOffset, containerOffset, coords;\r\n \r\n if(origin instanceof HTMLElement){\r\n parentEl = origin;\r\n coords = this.elementPositionCoords(origin, position);\r\n \r\n parentOffset = coords.offset;\r\n x = coords.x;\r\n y = coords.y;\r\n \r\n }else if(typeof origin === \"number\"){\r\n parentOffset = {top:0, left:0};\r\n x = origin;\r\n y = position;\r\n }else{\r\n coords = this.containerEventCoords(origin);\r\n \r\n x = coords.x;\r\n y = coords.y;\r\n \r\n this.reversedX = false;\r\n }\r\n \r\n this.element.style.top = y + \"px\";\r\n this.element.style.left = x + \"px\";\r\n \r\n this.container.appendChild(this.element);\r\n \r\n if(typeof this.renderedCallback === \"function\"){\r\n this.renderedCallback();\r\n }\r\n \r\n this._fitToScreen(x, y, parentEl, parentOffset, position);\r\n \r\n this.visible = true;\r\n\r\n this.subscribe(\"table-destroy\", this.destroyBinding);\r\n \r\n return this;\r\n }\r\n \r\n _fitToScreen(x, y, parentEl, parentOffset, position){\r\n var scrollTop = this.container === document.body ? document.documentElement.scrollTop : this.container.scrollTop;\r\n\r\n //move menu to start on right edge if it is too close to the edge of the screen\r\n if((x + this.element.offsetWidth) >= this.container.offsetWidth || this.reversedX){\r\n this.element.style.left = \"\";\r\n \r\n if(parentEl){\r\n this.element.style.right = (this.container.offsetWidth - parentOffset.left) + \"px\";\r\n }else{\r\n this.element.style.right = (this.container.offsetWidth - x) + \"px\";\r\n }\r\n \r\n this.reversedX = true;\r\n }\r\n\r\n //move menu to start on bottom edge if it is too close to the edge of the screen\r\n if((y + this.element.offsetHeight) > Math.max(this.container.offsetHeight, scrollTop ? this.container.scrollHeight : 0)) {\r\n if(parentEl){\r\n switch(position){\r\n case \"bottom\":\r\n this.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight - parentEl.offsetHeight - 1) + \"px\";\r\n break;\r\n\r\n default:\r\n this.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight + parentEl.offsetHeight + 1) + \"px\";\r\n }\r\n \r\n }else{\r\n this.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight) + \"px\";\r\n }\r\n }\r\n }\r\n \r\n isVisible(){\r\n return this.visible;\r\n }\r\n \r\n hideOnBlur(callback){\r\n this.blurable = true;\r\n \r\n if(this.visible){\r\n setTimeout(() => {\r\n this.table.rowManager.element.addEventListener(\"scroll\", this.blurEvent);\r\n this.subscribe(\"cell-editing\", this.blurEvent);\r\n document.body.addEventListener(\"click\", this.blurEvent);\r\n document.body.addEventListener(\"contextmenu\", this.blurEvent);\r\n window.addEventListener(\"resize\", this.blurEvent);\r\n document.body.addEventListener(\"keydown\", this.escEvent);\r\n }, 100);\r\n \r\n this.blurCallback = callback;\r\n }\r\n \r\n return this;\r\n }\r\n \r\n _escapeCheck(e){\r\n if(e.keyCode == 27){\r\n this.hide();\r\n }\r\n }\r\n \r\n hide(silent = false){\r\n if(this.visible){\r\n if(this.blurable){\r\n document.body.removeEventListener(\"keydown\", this.escEvent);\r\n document.body.removeEventListener(\"click\", this.blurEvent);\r\n document.body.removeEventListener(\"contextmenu\", this.blurEvent);\r\n window.removeEventListener(\"resize\", this.blurEvent);\r\n this.table.rowManager.element.removeEventListener(\"scroll\", this.blurEvent);\r\n this.unsubscribe(\"cell-editing\", this.blurEvent);\r\n }\r\n \r\n if(this.childPopup){\r\n this.childPopup.hide();\r\n }\r\n \r\n if(this.parent){\r\n this.parent.childPopup = null;\r\n }\r\n \r\n if(this.element.parentNode){\r\n this.element.parentNode.removeChild(this.element);\r\n }\r\n\r\n this.visible = false;\r\n\r\n if(this.blurCallback && !silent){\r\n this.blurCallback();\r\n }\r\n\r\n this.unsubscribe(\"table-destroy\", this.destroyBinding);\r\n }\r\n \r\n return this;\r\n }\r\n \r\n child(element){\r\n if(this.childPopup){\r\n this.childPopup.hide();\r\n }\r\n \r\n this.childPopup = new Popup(this.table, element, this);\r\n \r\n return this.childPopup;\r\n }\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Popup from './tools/Popup.js';\r\n\r\nclass Module extends CoreFeature{\r\n\r\n\tconstructor(table, name){\r\n\t\tsuper(table);\r\n\r\n\t\tthis._handler = null;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\t// setup module when table is initialized, to be overriden in module\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t////// Options Registration ///////\r\n\t///////////////////////////////////\r\n\r\n\tregisterTableOption(key, value){\r\n\t\tthis.table.optionsList.register(key, value);\r\n\t}\r\n\r\n\tregisterColumnOption(key, value){\r\n\t\tthis.table.columnManager.optionsList.register(key, value);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t/// Public Function Registration ///\r\n\t///////////////////////////////////\r\n\r\n\tregisterTableFunction(name, func){\r\n\t\tif(typeof this.table[name] === \"undefined\"){\r\n\t\t\tthis.table[name] = (...args) => {\r\n\t\t\t\tthis.table.initGuard(name);\r\n\r\n\t\t\t\treturn func(...args);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Unable to bind table function, name already in use\", name)\r\n\t\t}\r\n\t}\r\n\r\n\tregisterComponentFunction(component, func, handler){\r\n\t\treturn this.table.componentFunctionBinder.bind(component, func, handler);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t////////// Data Pipeline //////////\r\n\t///////////////////////////////////\r\n\r\n\tregisterDataHandler(handler, priority){\r\n\t\tthis.table.rowManager.registerDataPipelineHandler(handler, priority)\r\n\t\tthis._handler = handler;\r\n\t}\r\n\r\n\tregisterDisplayHandler(handler, priority){\r\n\t\tthis.table.rowManager.registerDisplayPipelineHandler(handler, priority)\r\n\t\tthis._handler = handler;\r\n\t}\r\n\r\n\trefreshData(renderInPosition, handler){\r\n\t\tif(!handler){\r\n\t\t\thandler = this._handler;\r\n\t\t}\r\n\r\n\t\tif(handler){\r\n\t\t\tthis.table.rowManager.refreshActiveData(handler, false, renderInPosition);\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t//////// Footer Management ////////\r\n\t///////////////////////////////////\r\n\r\n\tfooterAppend(element){\r\n\t\treturn this.table.footerManager.append(element)\r\n\t}\r\n\r\n\tfooterPrepend(element){\r\n\t\treturn this.table.footerManager.prepend(element)\r\n\t}\r\n\r\n\tfooterRemove(element){\r\n\t\treturn this.table.footerManager.remove(element)\r\n\t} \r\n\r\n\t///////////////////////////////////\r\n\t//////// Popups Management ////////\r\n\t///////////////////////////////////\r\n\t\r\n\tpopup(menuEl, menuContainer){\r\n\t\treturn new Popup(this.table, menuEl, menuContainer);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t//////// Alert Management ////////\r\n\t///////////////////////////////////\r\n\r\n\talert(content, type){\r\n\t\treturn this.table.alertManager.alert(content, type);\r\n\t}\r\n\r\n\tclearAlert(){\r\n\t\treturn this.table.alertManager.clear();\r\n\t}\r\n\t\r\n}\r\n\r\nexport default Module;","//resize columns to fit data they contain\r\nexport default function(columns){\r\n\tthis.table.columnManager.renderer.reinitializeColumnWidths(columns);\r\n\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n};","//resize columns to fit data they contain and stretch row to fill table, also used for fitDataTable\r\nexport default function(columns){\r\n\tcolumns.forEach(function(column){\r\n\t\tcolumn.reinitializeWidth();\r\n\t});\r\n\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n};","//resize columns to fit data the contain and stretch last column to fill table\r\nexport default function(columns){\r\n\tvar colsWidth = 0,\r\n\ttableWidth = this.table.rowManager.element.clientWidth,\r\n\tgap = 0,\r\n\tlastCol = false;\r\n\r\n\tcolumns.forEach((column, i) => {\r\n\t\tif(!column.widthFixed){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t}\r\n\r\n\t\tif(this.table.options.responsiveLayout ? column.modules.responsive.visible : column.visible){\r\n\t\t\tlastCol = column;\r\n\t\t}\r\n\r\n\t\tif(column.visible){\r\n\t\t\tcolsWidth += column.getWidth();\r\n\t\t}\r\n\t});\r\n\r\n\tif(lastCol){\r\n\t\tgap = tableWidth - colsWidth + lastCol.getWidth();\r\n\r\n\t\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\t\tlastCol.setWidth(0);\r\n\t\t\tthis.table.modules.responsiveLayout.update();\r\n\t\t}\r\n\r\n\t\tif(gap > 0){\r\n\t\t\tlastCol.setWidth(gap);\r\n\t\t}else{\r\n\t\t\tlastCol.reinitializeWidth();\r\n\t\t}\r\n\t}else{\r\n\t\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\t\tthis.table.modules.responsiveLayout.update();\r\n\t\t}\r\n\t}\r\n};","//resize columns to fit\r\nexport default function(columns){\r\n\tvar totalWidth = this.table.element.clientWidth; //table element width\r\n\tvar fixedWidth = 0; //total width of columns with a defined width\r\n\tvar flexWidth = 0; //total width available to flexible columns\r\n\tvar flexGrowUnits = 0; //total number of widthGrow blocks accross all columns\r\n\tvar flexColWidth = 0; //desired width of flexible columns\r\n\tvar flexColumns = []; //array of flexible width columns\r\n\tvar fixedShrinkColumns = []; //array of fixed width columns that can shrink\r\n\tvar flexShrinkUnits = 0; //total number of widthShrink blocks accross all columns\r\n\tvar overflowWidth = 0; //horizontal overflow width\r\n\tvar gapFill=0; //number of pixels to be added to final column to close and half pixel gaps\r\n\r\n\tfunction calcWidth(width){\r\n\t\tvar colWidth;\r\n\r\n\t\tif(typeof(width) == \"string\"){\r\n\t\t\tif(width.indexOf(\"%\") > -1){\r\n\t\t\t\tcolWidth = (totalWidth / 100) * parseInt(width);\r\n\t\t\t}else{\r\n\t\t\t\tcolWidth = parseInt(width);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcolWidth = width;\r\n\t\t}\r\n\r\n\t\treturn colWidth;\r\n\t}\r\n\r\n\t//ensure columns resize to take up the correct amount of space\r\n\tfunction scaleColumns(columns, freeSpace, colWidth, shrinkCols){\r\n\r\n\t\tvar oversizeCols = [],\r\n\t\toversizeSpace = 0,\r\n\t\tremainingSpace = 0,\r\n\t\tnextColWidth = 0,\r\n\t\tremainingFlexGrowUnits = flexGrowUnits,\r\n\t\tgap = 0,\r\n\t\tchangeUnits = 0,\r\n\t\tundersizeCols = [];\r\n\r\n\t\tfunction calcGrow(col){\r\n\t\t\treturn (colWidth * (col.column.definition.widthGrow || 1));\r\n\t\t}\r\n\r\n\t\tfunction calcShrink(col){\r\n\t\t\treturn (calcWidth(col.width) - (colWidth * (col.column.definition.widthShrink || 0)))\r\n\t\t}\r\n\r\n\t\tcolumns.forEach(function(col, i){\r\n\t\t\tvar width = shrinkCols ? calcShrink(col) : calcGrow(col);\r\n\t\t\tif(col.column.minWidth >= width){\r\n\t\t\t\toversizeCols.push(col);\r\n\t\t\t}else{\r\n\t\t\t\tif(col.column.maxWidth && col.column.maxWidth < width){\r\n\t\t\t\t\tcol.width = col.column.maxWidth;\r\n\t\t\t\t\tfreeSpace -= col.column.maxWidth;\r\n\r\n\t\t\t\t\tremainingFlexGrowUnits -= shrinkCols ? (col.column.definition.widthShrink || 1) : (col.column.definition.widthGrow || 1);\r\n\r\n\t\t\t\t\tif(remainingFlexGrowUnits){\r\n\t\t\t\t\t\tcolWidth = Math.floor(freeSpace/remainingFlexGrowUnits);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tundersizeCols.push(col);\r\n\t\t\t\t\tchangeUnits += shrinkCols ? (col.column.definition.widthShrink || 1) : (col.column.definition.widthGrow || 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(oversizeCols.length){\r\n\t\t\toversizeCols.forEach(function(col){\r\n\t\t\t\toversizeSpace += shrinkCols ? col.width - col.column.minWidth : col.column.minWidth;\r\n\t\t\t\tcol.width = col.column.minWidth;\r\n\t\t\t});\r\n\r\n\t\t\tremainingSpace = freeSpace - oversizeSpace;\r\n\r\n\t\t\tnextColWidth = changeUnits ? Math.floor(remainingSpace/changeUnits) : remainingSpace;\r\n\r\n\t\t\tgap = remainingSpace - (nextColWidth * changeUnits);\r\n\r\n\t\t\tgap += scaleColumns(undersizeCols, remainingSpace, nextColWidth, shrinkCols);\r\n\t\t}else{\r\n\t\t\tgap = changeUnits ? freeSpace - (Math.floor(freeSpace/changeUnits) * changeUnits) : freeSpace;\r\n\r\n\t\t\tundersizeCols.forEach(function(column){\r\n\t\t\t\tcolumn.width = shrinkCols ? calcShrink(column) : calcGrow(column);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn gap;\r\n\t}\r\n\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n\r\n\t//adjust for vertical scrollbar if present\r\n\tif(this.table.rowManager.element.scrollHeight > this.table.rowManager.element.clientHeight){\r\n\t\ttotalWidth -= this.table.rowManager.element.offsetWidth - this.table.rowManager.element.clientWidth;\r\n\t}\r\n\r\n\tcolumns.forEach(function(column){\r\n\t\tvar width, minWidth, colWidth;\r\n\r\n\t\tif(column.visible){\r\n\r\n\t\t\twidth = column.definition.width;\r\n\t\t\tminWidth = parseInt(column.minWidth);\r\n\r\n\t\t\tif(width){\r\n\r\n\t\t\t\tcolWidth = calcWidth(width);\r\n\r\n\t\t\t\tfixedWidth += colWidth > minWidth ? colWidth : minWidth;\r\n\r\n\t\t\t\tif(column.definition.widthShrink){\r\n\t\t\t\t\tfixedShrinkColumns.push({\r\n\t\t\t\t\t\tcolumn:column,\r\n\t\t\t\t\t\twidth:colWidth > minWidth ? colWidth : minWidth\r\n\t\t\t\t\t});\r\n\t\t\t\t\tflexShrinkUnits += column.definition.widthShrink;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tflexColumns.push({\r\n\t\t\t\t\tcolumn:column,\r\n\t\t\t\t\twidth:0,\r\n\t\t\t\t});\r\n\t\t\t\tflexGrowUnits += column.definition.widthGrow || 1;\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\t//calculate available space\r\n\tflexWidth = totalWidth - fixedWidth;\r\n\r\n\t//calculate correct column size\r\n\tflexColWidth = Math.floor(flexWidth / flexGrowUnits)\r\n\r\n\t//generate column widths\r\n\tvar gapFill = scaleColumns(flexColumns, flexWidth, flexColWidth, false);\r\n\r\n\t//increase width of last column to account for rounding errors\r\n\tif(flexColumns.length && gapFill > 0){\r\n\t\tflexColumns[flexColumns.length-1].width += + gapFill;\r\n\t}\r\n\r\n\t//caculate space for columns to be shrunk into\r\n\tflexColumns.forEach(function(col){\r\n\t\tflexWidth -= col.width;\r\n\t});\r\n\r\n\toverflowWidth = Math.abs(gapFill) + flexWidth;\r\n\r\n\t//shrink oversize columns if there is no available space\r\n\tif(overflowWidth > 0 && flexShrinkUnits){\r\n\t\tgapFill = scaleColumns(fixedShrinkColumns, overflowWidth, Math.floor(overflowWidth / flexShrinkUnits), true);\r\n\t}\r\n\r\n\t//decrease width of last column to account for rounding errors\r\n\tif(fixedShrinkColumns.length){\r\n\t\tfixedShrinkColumns[fixedShrinkColumns.length-1].width -= gapFill;\r\n\t}\r\n\r\n\tflexColumns.forEach(function(col){\r\n\t\tcol.column.setWidth(col.width);\r\n\t});\r\n\r\n\tfixedShrinkColumns.forEach(function(col){\r\n\t\tcol.column.setWidth(col.width);\r\n\t});\r\n};","import fitData from './modes/fitData.js';\r\nimport fitDataGeneral from './modes/fitDataGeneral.js';\r\nimport fitDataStretch from './modes/fitDataStretch.js';\r\nimport fitColumns from './modes/fitColumns.js';\r\n\r\nexport default {\r\n\tfitData:fitData,\r\n\tfitDataFill:fitDataGeneral,\r\n\tfitDataTable:fitDataGeneral,\r\n\tfitDataStretch:fitDataStretch,\r\n\tfitColumns:fitColumns ,\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultModes from './defaults/modes.js';\r\n\r\nclass Layout extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table, \"layout\");\r\n\r\n\t\tthis.mode = null;\r\n\r\n\t\tthis.registerTableOption(\"layout\", \"fitData\"); //layout type\r\n\t\tthis.registerTableOption(\"layoutColumnsOnNewData\", false); //update column widths on setData\r\n\r\n\t\tthis.registerColumnOption(\"widthGrow\");\r\n\t\tthis.registerColumnOption(\"widthShrink\");\r\n\t}\r\n\r\n\t//initialize layout system\r\n\tinitialize(){\r\n\t\tvar layout = this.table.options.layout;\r\n\r\n\t\tif(Layout.modes[layout]){\r\n\t\t\tthis.mode = layout;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Layout Error - invalid mode set, defaulting to 'fitData' : \" + layout);\r\n\t\t\tthis.mode = 'fitData';\r\n\t\t}\r\n\r\n\t\tthis.table.element.setAttribute(\"tabulator-layout\", this.mode);\r\n\t}\r\n\r\n\tgetMode(){\r\n\t\treturn this.mode;\r\n\t}\r\n\r\n\t//trigger table layout\r\n\tlayout(){\r\n\t\tthis.dispatch(\"layout-refreshing\")\r\n\t\tLayout.modes[this.mode].call(this, this.table.columnManager.columnsByIndex);\r\n\r\n\t\tthis.dispatch(\"layout-refreshed\")\r\n\t}\r\n}\r\n\r\nLayout.moduleName = \"layout\";\r\n\r\n//load defaults\r\nLayout.modes = defaultModes;\r\n\r\nexport default Layout;","export default {\r\n\t\"default\":{ //hold default locale text\r\n\t\t\"groups\":{\r\n\t\t\t\"item\":\"item\",\r\n\t\t\t\"items\":\"items\",\r\n\t\t},\r\n\t\t\"columns\":{\r\n\t\t},\r\n\t\t\"data\":{\r\n\t\t\t\"loading\":\"Loading\",\r\n\t\t\t\"error\":\"Error\",\r\n\t\t},\r\n\t\t\"pagination\":{\r\n\t\t\t\"page_size\":\"Page Size\",\r\n\t\t\t\"page_title\":\"Show Page\",\r\n\t\t\t\"first\":\"First\",\r\n\t\t\t\"first_title\":\"First Page\",\r\n\t\t\t\"last\":\"Last\",\r\n\t\t\t\"last_title\":\"Last Page\",\r\n\t\t\t\"prev\":\"Prev\",\r\n\t\t\t\"prev_title\":\"Prev Page\",\r\n\t\t\t\"next\":\"Next\",\r\n\t\t\t\"next_title\":\"Next Page\",\r\n\t\t\t\"all\":\"All\",\r\n\t\t\t\"counter\":{\r\n\t\t\t\t\"showing\": \"Showing\",\r\n\t\t\t\t\"of\": \"of\",\r\n\t\t\t\t\"rows\": \"rows\",\r\n\t\t\t\t\"pages\": \"pages\",\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"headerFilters\":{\r\n\t\t\t\"default\":\"filter column...\",\r\n\t\t\t\"columns\":{}\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defaultLangs from './defaults/langs.js';\r\n\r\nclass Localize extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.locale = \"default\"; //current locale\r\n\t\tthis.lang = false; //current language\r\n\t\tthis.bindings = {}; //update events to call when locale is changed\r\n\t\tthis.langList = {};\r\n\r\n\t\tthis.registerTableOption(\"locale\", false); //current system language\r\n\t\tthis.registerTableOption(\"langs\", {});\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.langList = Helpers.deepClone(Localize.langs);\r\n\r\n\t\tif(this.table.options.columnDefaults.headerFilterPlaceholder !== false){\r\n\t\t\tthis.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder);\r\n\t\t}\r\n\r\n\t\tfor(let locale in this.table.options.langs){\r\n\t\t\tthis.installLang(locale, this.table.options.langs[locale]);\r\n\t\t}\r\n\r\n\t\tthis.setLocale(this.table.options.locale);\r\n\r\n\t\tthis.registerTableFunction(\"setLocale\", this.setLocale.bind(this));\r\n\t\tthis.registerTableFunction(\"getLocale\", this.getLocale.bind(this));\r\n\t\tthis.registerTableFunction(\"getLang\", this.getLang.bind(this));\r\n\t}\r\n\r\n\t//set header placehoder\r\n\tsetHeaderFilterPlaceholder(placeholder){\r\n\t\tthis.langList.default.headerFilters.default = placeholder;\r\n\t}\r\n\r\n\t//set header filter placeholder by column\r\n\tsetHeaderFilterColumnPlaceholder(column, placeholder){\r\n\t\tthis.langList.default.headerFilters.columns[column] = placeholder;\r\n\r\n\t\tif(this.lang && !this.lang.headerFilters.columns[column]){\r\n\t\t\tthis.lang.headerFilters.columns[column] = placeholder;\r\n\t\t}\r\n\t}\r\n\r\n\t//setup a lang description object\r\n\tinstallLang(locale, lang){\r\n\t\tif(this.langList[locale]){\r\n\t\t\tthis._setLangProp(this.langList[locale], lang);\r\n\t\t}else{\r\n\t\t\tthis.langList[locale] = lang;\r\n\t\t}\r\n\t}\r\n\r\n\t_setLangProp(lang, values){\r\n\t\tfor(let key in values){\r\n\t\t\tif(lang[key] && typeof lang[key] == \"object\"){\r\n\t\t\t\tthis._setLangProp(lang[key], values[key])\r\n\t\t\t}else{\r\n\t\t\t\tlang[key] = values[key];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//set current locale\r\n\tsetLocale(desiredLocale){\r\n\t\tdesiredLocale = desiredLocale || \"default\";\r\n\r\n\t\t//fill in any matching languge values\r\n\t\tfunction traverseLang(trans, path){\r\n\t\t\tfor(var prop in trans){\r\n\t\t\t\tif(typeof trans[prop] == \"object\"){\r\n\t\t\t\t\tif(!path[prop]){\r\n\t\t\t\t\t\tpath[prop] = {};\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttraverseLang(trans[prop], path[prop]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tpath[prop] = trans[prop];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//determing correct locale to load\r\n\t\tif(desiredLocale === true && navigator.language){\r\n\t\t\t//get local from system\r\n\t\t\tdesiredLocale = navigator.language.toLowerCase();\r\n\t\t}\r\n\r\n\t\tif(desiredLocale){\r\n\t\t\t//if locale is not set, check for matching top level locale else use default\r\n\t\t\tif(!this.langList[desiredLocale]){\r\n\t\t\t\tlet prefix = desiredLocale.split(\"-\")[0];\r\n\r\n\t\t\t\tif(this.langList[prefix]){\r\n\t\t\t\t\tconsole.warn(\"Localization Error - Exact matching locale not found, using closest match: \", desiredLocale, prefix);\r\n\t\t\t\t\tdesiredLocale = prefix;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Localization Error - Matching locale not found, using default: \", desiredLocale);\r\n\t\t\t\t\tdesiredLocale = \"default\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.locale = desiredLocale;\r\n\r\n\t\t//load default lang template\r\n\t\tthis.lang = Helpers.deepClone(this.langList.default || {});\r\n\r\n\t\tif(desiredLocale != \"default\"){\r\n\t\t\ttraverseLang(this.langList[desiredLocale], this.lang);\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(\"localized\", this.locale, this.lang);\r\n\r\n\t\tthis._executeBindings();\r\n\t}\r\n\r\n\t//get current locale\r\n\tgetLocale(locale){\r\n\t\treturn this.locale;\r\n\t}\r\n\r\n\t//get lang object for given local or current if none provided\r\n\tgetLang(locale){\r\n\t\treturn locale ? this.langList[locale] : this.lang;\r\n\t}\r\n\r\n\t//get text for current locale\r\n\tgetText(path, value){\r\n\t\tvar path = value ? path + \"|\" + value : path,\r\n\t\tpathArray = path.split(\"|\"),\r\n\t\ttext = this._getLangElement(pathArray, this.locale);\r\n\r\n\t\t// if(text === false){\r\n\t\t// \tconsole.warn(\"Localization Error - Matching localized text not found for given path: \", path);\r\n\t\t// }\r\n\r\n\t\treturn text || \"\";\r\n\t}\r\n\r\n\t//traverse langs object and find localized copy\r\n\t_getLangElement(path, locale){\r\n\t\tvar root = this.lang;\r\n\r\n\t\tpath.forEach(function(level){\r\n\t\t\tvar rootPath;\r\n\r\n\t\t\tif(root){\r\n\t\t\t\trootPath = root[level];\r\n\r\n\t\t\t\tif(typeof rootPath != \"undefined\"){\r\n\t\t\t\t\troot = rootPath;\r\n\t\t\t\t}else{\r\n\t\t\t\t\troot = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn root;\r\n\t}\r\n\r\n\t//set update binding\r\n\tbind(path, callback){\r\n\t\tif(!this.bindings[path]){\r\n\t\t\tthis.bindings[path] = [];\r\n\t\t}\r\n\r\n\t\tthis.bindings[path].push(callback);\r\n\r\n\t\tcallback(this.getText(path), this.lang);\r\n\t}\r\n\r\n\t//itterate through bindings and trigger updates\r\n\t_executeBindings(){\r\n\t\tfor(let path in this.bindings){\r\n\t\t\tthis.bindings[path].forEach((binding) => {\r\n\t\t\t\tbinding(this.getText(path), this.lang);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n}\r\n\r\nLocalize.moduleName = \"localize\";\r\n\r\n//load defaults\r\nLocalize.langs = defaultLangs;\r\n\r\nexport default Localize;","import Module from '../../core/Module.js';\r\nimport TableRegistry from '../../core/tools/TableRegistry.js';\r\n\r\nclass Comms extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"tableComms\", this.receive.bind(this));\r\n\t}\r\n\r\n\tgetConnections(selectors){\r\n\t\tvar connections = [],\r\n\t\tconnection;\r\n\r\n\t\tconnection = TableRegistry.lookupTable(selectors);\r\n\r\n\t\tconnection.forEach((con) =>{\r\n\t\t\tif(this.table !== con){\r\n\t\t\t\tconnections.push(con);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn connections;\r\n\t}\r\n\r\n\tsend(selectors, module, action, data){\r\n\t\tvar connections = this.getConnections(selectors);\r\n\r\n\t\tconnections.forEach((connection) => {\r\n\t\t\tconnection.tableComms(this.table.element, module, action, data);\r\n\t\t});\r\n\r\n\t\tif(!connections.length && selectors){\r\n\t\t\tconsole.warn(\"Table Connection Error - No tables matching selector found\", selectors);\r\n\t\t}\r\n\t}\r\n\r\n\treceive(table, module, action, data){\r\n\t\tif(this.table.modExists(module)){\r\n\t\t\treturn this.table.modules[module].commsReceived(table, action, data);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Inter-table Comms Error - no such module:\", module);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nComms.moduleName = \"comms\";\r\n\r\nexport default Comms;","import * as coreModules from '../modules/core.js';\r\nimport TableRegistry from './TableRegistry.js';\r\n\r\nexport default class ModuleBinder {\r\n\t\r\n\tconstructor(tabulator, modules){\r\n\t\tthis.bindStaticFuctionality(tabulator);\r\n\t\tthis.bindModules(tabulator, coreModules, true);\r\n\t\t\r\n\t\tif(modules){\r\n\t\t\tthis.bindModules(tabulator, modules);\r\n\t\t}\r\n\t}\r\n\t\r\n\tbindStaticFuctionality(tabulator){\r\n\t\ttabulator.moduleBindings = {};\r\n\t\t\r\n\t\ttabulator.extendModule = function(name, property, values){\r\n\t\t\tif(tabulator.moduleBindings[name]){\r\n\t\t\t\tvar source = tabulator.moduleBindings[name][property];\r\n\t\t\t\t\r\n\t\t\t\tif(source){\r\n\t\t\t\t\tif(typeof values == \"object\"){\r\n\t\t\t\t\t\tfor(let key in values){\r\n\t\t\t\t\t\t\tsource[key] = values[key];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Module Error - Invalid value type, it must be an object\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Module Error - property does not exist:\", property);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Module Error - module does not exist:\", name);\r\n\t\t\t}\r\n\t\t};\r\n\t\t\r\n\t\ttabulator.registerModule = function(modules){\r\n\t\t\tif(!Array.isArray(modules)){\r\n\t\t\t\tmodules = [modules];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmodules.forEach((mod) => {\r\n\t\t\t\ttabulator.registerModuleBinding(mod)\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\ttabulator.registerModuleBinding = function(mod){\r\n\t\t\ttabulator.moduleBindings[mod.moduleName] = mod;\r\n\t\t};\r\n\t\t\r\n\t\ttabulator.findTable = function(query){\r\n\t\t\tvar results = TableRegistry.lookupTable(query, true);\r\n\t\t\treturn Array.isArray(results) && !results.length ? false : results;\r\n\t\t}\r\n\t\t\r\n\t\t//ensure that module are bound to instantiated function\r\n\t\ttabulator.prototype.bindModules = function(){\r\n\t\t\tvar orderedStartMods = [],\r\n\t\t\torderedEndMods = [],\r\n\t\t\tunOrderedMods = [];\r\n\t\t\t\r\n\t\t\tthis.modules = {};\r\n\t\t\t\r\n\t\t\tfor(var name in tabulator.moduleBindings){\r\n\t\t\t\tlet mod = tabulator.moduleBindings[name];\r\n\t\t\t\tlet module = new mod(this);\r\n\t\t\t\t\r\n\t\t\t\tthis.modules[name] = module;\r\n\t\t\t\t\r\n\t\t\t\tif(mod.prototype.moduleCore){\r\n\t\t\t\t\tthis.modulesCore.push(module);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(mod.moduleInitOrder){\r\n\t\t\t\t\t\tif(mod.moduleInitOrder < 0){\r\n\t\t\t\t\t\t\torderedStartMods.push(module);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\torderedEndMods.push(module);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tunOrderedMods.push(module);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\torderedStartMods.sort((a, b) => a.moduleInitOrder > b.moduleInitOrder ? 1 : -1);\r\n\t\t\torderedEndMods.sort((a, b) => a.moduleInitOrder > b.moduleInitOrder ? 1 : -1);\r\n\t\t\t\r\n\t\t\tthis.modulesRegular = orderedStartMods.concat(unOrderedMods.concat(orderedEndMods));\r\n\t\t}\r\n\t}\r\n\t\r\n\tbindModules(tabulator, modules, core){\r\n\t\tvar mods = Object.values(modules);\r\n\t\t\r\n\t\tif(core){\r\n\t\t\tmods.forEach((mod) => {\r\n\t\t\t\tmod.prototype.moduleCore = true;\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\ttabulator.registerModule(mods);\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from './Helpers.js';\r\n\r\nexport default class Alert extends CoreFeature{\r\n constructor(table){\r\n super(table);\r\n \r\n this.element = this._createAlertElement();\r\n this.msgElement = this._createMsgElement();\r\n this.type = null;\r\n \r\n this.element.appendChild(this.msgElement);\r\n }\r\n \r\n _createAlertElement(){\r\n var el = document.createElement(\"div\");\r\n el.classList.add(\"tabulator-alert\");\r\n return el;\r\n }\r\n \r\n _createMsgElement(){\r\n var el = document.createElement(\"div\");\r\n el.classList.add(\"tabulator-alert-msg\");\r\n el.setAttribute(\"role\", \"alert\");\r\n return el;\r\n }\r\n \r\n _typeClass(){\r\n return \"tabulator-alert-state-\" + this.type;\r\n }\r\n \r\n alert(content, type = \"msg\"){\r\n if(content){\r\n this.clear();\r\n \r\n this.type = type;\r\n \r\n while(this.msgElement.firstChild) this.msgElement.removeChild(this.msgElement.firstChild);\r\n \r\n this.msgElement.classList.add(this._typeClass());\r\n \r\n if(typeof content === \"function\"){\r\n content = content();\r\n }\r\n \r\n if(content instanceof HTMLElement){\r\n this.msgElement.appendChild(content);\r\n }else{\r\n this.msgElement.innerHTML = content;\r\n }\r\n \r\n this.table.element.appendChild(this.element);\r\n }\r\n }\r\n \r\n clear(){\r\n if(this.element.parentNode){\r\n this.element.parentNode.removeChild(this.element);\r\n }\r\n \r\n this.msgElement.classList.remove(this._typeClass());\r\n }\r\n}","'use strict';\r\n\r\nimport defaultOptions from './defaults/options.js';\r\n\r\nimport ColumnManager from './ColumnManager.js';\r\nimport RowManager from './RowManager.js';\r\nimport FooterManager from './FooterManager.js';\r\n\r\nimport InteractionMonitor from './tools/InteractionMonitor.js';\r\nimport ComponentFunctionBinder from './tools/ComponentFunctionBinder.js';\r\nimport DataLoader from './tools/DataLoader.js';\r\n\r\nimport ExternalEventBus from './tools/ExternalEventBus.js';\r\nimport InternalEventBus from './tools/InternalEventBus.js';\r\n\r\nimport TableRegistry from './tools/TableRegistry.js';\r\nimport ModuleBinder from './tools/ModuleBinder.js';\r\n\r\nimport OptionsList from './tools/OptionsList.js';\r\n\r\nimport Alert from './tools/Alert.js';\r\n\r\nclass Tabulator {\r\n\t\r\n\tconstructor(element, options){\r\n\t\t\r\n\t\tthis.options = {};\r\n\t\t\r\n\t\tthis.columnManager = null; // hold Column Manager\r\n\t\tthis.rowManager = null; //hold Row Manager\r\n\t\tthis.footerManager = null; //holder Footer Manager\r\n\t\tthis.alertManager = null; //hold Alert Manager\r\n\t\tthis.vdomHoz = null; //holder horizontal virtual dom\r\n\t\tthis.externalEvents = null; //handle external event messaging\r\n\t\tthis.eventBus = null; //handle internal event messaging\r\n\t\tthis.interactionMonitor = false; //track user interaction\r\n\t\tthis.browser = \"\"; //hold current browser type\r\n\t\tthis.browserSlow = false; //handle reduced functionality for slower browsers\r\n\t\tthis.browserMobile = false; //check if running on mobile, prevent resize cancelling edit on keyboard appearance\r\n\t\tthis.rtl = false; //check if the table is in RTL mode\r\n\t\tthis.originalElement = null; //hold original table element if it has been replaced\r\n\t\t\r\n\t\tthis.componentFunctionBinder = new ComponentFunctionBinder(this); //bind component functions\r\n\t\tthis.dataLoader = false; //bind component functions\r\n\t\t\r\n\t\tthis.modules = {}; //hold all modules bound to this table\r\n\t\tthis.modulesCore = []; //hold core modules bound to this table (for initialization purposes)\r\n\t\tthis.modulesRegular = []; //hold regular modules bound to this table (for initialization purposes)\r\n\t\t\r\n\t\tthis.optionsList = new OptionsList(this, \"table constructor\");\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\t\r\n\t\tif(this.initializeElement(element)){\r\n\t\t\t\r\n\t\t\tthis.initializeCoreSystems(options);\r\n\t\t\t\r\n\t\t\t//delay table creation to allow event bindings immediately after the constructor\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tthis._create();\r\n\t\t\t})\r\n\t\t}\r\n\t\t\r\n\t\tTableRegistry.register(this); //register table for inter-device communication\r\n\t}\r\n\t\r\n\tinitializeElement(element){\r\n\t\tif(typeof HTMLElement !== \"undefined\" && element instanceof HTMLElement){\r\n\t\t\tthis.element = element;\r\n\t\t\treturn true;\r\n\t\t}else if(typeof element === \"string\"){\r\n\t\t\tthis.element = document.querySelector(element);\r\n\t\t\t\r\n\t\t\tif(this.element){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Tabulator Creation Error - no element found matching selector: \", element);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Tabulator Creation Error - Invalid element provided:\", element);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeCoreSystems(options){\r\n\t\tthis.columnManager = new ColumnManager(this);\r\n\t\tthis.rowManager = new RowManager(this);\r\n\t\tthis.footerManager = new FooterManager(this);\r\n\t\tthis.dataLoader = new DataLoader(this);\r\n\t\tthis.alertManager = new Alert(this);\r\n\t\t\r\n\t\tthis.bindModules();\r\n\t\t\r\n\t\tthis.options = this.optionsList.generate(Tabulator.defaultOptions, options)\r\n\t\t\r\n\t\tthis._clearObjectPointers();\r\n\t\t\r\n\t\tthis._mapDeprecatedFunctionality();\r\n\t\t\r\n\t\tthis.externalEvents = new ExternalEventBus(this, this.options, this.options.debugEventsExternal);\r\n\t\tthis.eventBus = new InternalEventBus(this.options.debugEventsInternal);\r\n\t\t\r\n\t\tthis.interactionMonitor = new InteractionMonitor(this);\r\n\t\t\r\n\t\tthis.dataLoader.initialize();\r\n\t\t// this.columnManager.initialize();\r\n\t\t// this.rowManager.initialize();\r\n\t\tthis.footerManager.initialize();\r\n\t}\r\n\t\r\n\t//convert deprecated functionality to new functions\r\n\t_mapDeprecatedFunctionality(){\r\n\t\t//all previously deprecated functionality removed in the 5.0 release\r\n\t}\r\n\t\r\n\t_clearSelection(){\r\n\t\t\r\n\t\tthis.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\tif (window.getSelection) {\r\n\t\t\tif (window.getSelection().empty) { // Chrome\r\n\t\t\t\twindow.getSelection().empty();\r\n\t\t\t} else if (window.getSelection().removeAllRanges) { // Firefox\r\n\t\t\t\twindow.getSelection().removeAllRanges();\r\n\t\t\t}\r\n\t\t} else if (document.selection) { // IE?\r\n\t\t\tdocument.selection.empty();\r\n\t\t}\r\n\t\t\r\n\t\tthis.element.classList.remove(\"tabulator-block-select\");\r\n\t}\r\n\t\r\n\t//create table\r\n\t_create(){\r\n\t\tthis.externalEvents.dispatch(\"tableBuilding\");\r\n\t\tthis.eventBus.dispatch(\"table-building\");\r\n\t\t\r\n\t\tthis._rtlCheck();\r\n\t\t\r\n\t\tthis._buildElement();\r\n\t\t\r\n\t\tthis._initializeTable();\r\n\t\t\r\n\t\tthis._loadInitialData();\r\n\t\t\r\n\t\tthis.initialized = true;\r\n\t\t\r\n\t\tthis.externalEvents.dispatch(\"tableBuilt\");\r\n\t}\r\n\t\r\n\t_rtlCheck(){\r\n\t\tvar style = window.getComputedStyle(this.element);\r\n\t\t\r\n\t\tswitch(this.options.textDirection){\r\n\t\t\tcase\"auto\":\r\n\t\t\tif(style.direction !== \"rtl\"){\r\n\t\t\t\tbreak;\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tcase \"rtl\":\r\n\t\t\tthis.element.classList.add(\"tabulator-rtl\");\r\n\t\t\tthis.rtl = true;\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"ltr\":\r\n\t\t\tthis.element.classList.add(\"tabulator-ltr\");\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\tthis.rtl = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//clear pointers to objects in default config object\r\n\t_clearObjectPointers(){\r\n\t\tthis.options.columns = this.options.columns.slice(0);\r\n\t\t\r\n\t\tif(Array.isArray(this.options.data) && !this.options.reactiveData){\r\n\t\t\tthis.options.data = this.options.data.slice(0);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//build tabulator element\r\n\t_buildElement(){\r\n\t\tvar element = this.element,\r\n\t\toptions = this.options,\r\n\t\tnewElement;\r\n\t\t\r\n\t\tif(element.tagName === \"TABLE\"){\r\n\t\t\tthis.originalElement = this.element;\r\n\t\t\tnewElement = document.createElement(\"div\");\r\n\t\t\t\r\n\t\t\t//transfer attributes to new element\r\n\t\t\tvar attributes = element.attributes;\r\n\t\t\t\r\n\t\t\t// loop through attributes and apply them on div\r\n\t\t\tfor(var i in attributes){\r\n\t\t\t\tif(typeof attributes[i] == \"object\"){\r\n\t\t\t\t\tnewElement.setAttribute(attributes[i].name, attributes[i].value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// replace table with div element\r\n\t\t\telement.parentNode.replaceChild(newElement, element);\r\n\t\t\t\r\n\t\t\tthis.element = element = newElement;\r\n\t\t}\r\n\t\t\r\n\t\telement.classList.add(\"tabulator\");\r\n\t\telement.setAttribute(\"role\", \"grid\");\r\n\t\t\r\n\t\t//empty element\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\t\r\n\t\t//set table height\r\n\t\tif(options.height){\r\n\t\t\toptions.height = isNaN(options.height) ? options.height : options.height + \"px\";\r\n\t\t\telement.style.height = options.height;\r\n\t\t}\r\n\t\t\r\n\t\t//set table min height\r\n\t\tif(options.minHeight !== false){\r\n\t\t\toptions.minHeight = isNaN(options.minHeight) ? options.minHeight : options.minHeight + \"px\";\r\n\t\t\telement.style.minHeight = options.minHeight;\r\n\t\t}\r\n\t\t\r\n\t\t//set table maxHeight\r\n\t\tif(options.maxHeight !== false){\r\n\t\t\toptions.maxHeight = isNaN(options.maxHeight) ? options.maxHeight : options.maxHeight + \"px\";\r\n\t\t\telement.style.maxHeight = options.maxHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//initialize core systems and modules\r\n\t_initializeTable(){\r\n\t\tvar element = this.element,\r\n\t\toptions = this.options;\r\n\t\t\r\n\t\tthis.interactionMonitor.initialize();\r\n\t\t\r\n\t\tthis.columnManager.initialize();\r\n\t\tthis.rowManager.initialize();\r\n\t\t\r\n\t\tthis._detectBrowser();\r\n\t\t\r\n\t\t//initialize core modules\r\n\t\tthis.modulesCore.forEach((mod) => {\r\n\t\t\tmod.initialize();\r\n\t\t})\r\n\t\t\r\n\t\t//build table elements\r\n\t\telement.appendChild(this.columnManager.getElement());\r\n\t\telement.appendChild(this.rowManager.getElement());\r\n\t\t\r\n\t\tif(options.footerElement){\r\n\t\t\tthis.footerManager.activate();\r\n\t\t}\r\n\t\t\r\n\t\tif(options.autoColumns && options.data){\r\n\t\t\t\r\n\t\t\tthis.columnManager.generateColumnsFromRowData(this.options.data);\r\n\t\t}\r\n\t\t\r\n\t\t//initialize regular modules\r\n\t\tthis.modulesRegular.forEach((mod) => {\r\n\t\t\tmod.initialize();\r\n\t\t});\r\n\t\t\r\n\t\tthis.columnManager.setColumns(options.columns);\r\n\t\t\r\n\t\tthis.eventBus.dispatch(\"table-built\");\r\n\t}\r\n\t\r\n\t_loadInitialData(){\r\n\t\tthis.dataLoader.load(this.options.data);\r\n\t}\r\n\t\r\n\t//deconstructor\r\n\tdestroy(){\r\n\t\tvar element = this.element;\r\n\t\t\r\n\t\tTableRegistry.deregister(this); //deregister table from inter-device communication\r\n\t\t\r\n\t\tthis.eventBus.dispatch(\"table-destroy\");\r\n\t\t\r\n\t\t//clear row data\r\n\t\tthis.rowManager.rows.forEach(function(row){\r\n\t\t\trow.wipe();\r\n\t\t});\r\n\t\t\r\n\t\tthis.rowManager.rows = [];\r\n\t\tthis.rowManager.activeRows = [];\r\n\t\tthis.rowManager.displayRows = [];\r\n\t\t\r\n\t\t//clear DOM\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\telement.classList.remove(\"tabulator\");\r\n\t}\r\n\t\r\n\t_detectBrowser(){\r\n\t\tvar ua = navigator.userAgent||navigator.vendor||window.opera;\r\n\t\t\r\n\t\tif(ua.indexOf(\"Trident\") > -1){\r\n\t\t\tthis.browser = \"ie\";\r\n\t\t\tthis.browserSlow = true;\r\n\t\t}else if(ua.indexOf(\"Edge\") > -1){\r\n\t\t\tthis.browser = \"edge\";\r\n\t\t\tthis.browserSlow = true;\r\n\t\t}else if(ua.indexOf(\"Firefox\") > -1){\r\n\t\t\tthis.browser = \"firefox\";\r\n\t\t\tthis.browserSlow = false;\r\n\t\t}else{\r\n\t\t\tthis.browser = \"other\";\r\n\t\t\tthis.browserSlow = false;\r\n\t\t}\r\n\t\t\r\n\t\tthis.browserMobile = /(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ua)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(ua.slice(0,4));\r\n\t}\r\n\t\r\n\tinitGuard(func, msg){\r\n\t\tvar stack, line;\r\n\t\t\r\n\t\tif(this.options.debugInitialization && !this.initialized){\r\n\t\t\tif(!func){\r\n\t\t\t\tstack = new Error().stack.split(\"\\n\");\r\n\t\t\t\t\r\n\t\t\t\tline = stack[0] == \"Error\" ? stack[2] : stack[1];\r\n\t\t\t\t\r\n\t\t\t\tif(line[0] == \" \"){\r\n\t\t\t\t\tfunc = line.trim().split(\" \")[1].split(\".\")[1];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfunc = line.trim().split(\"@\")[0];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconsole.warn(\"Table Not Initialized - Calling the \" + func + \" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function.\" + (msg ? \" \" + msg : \"\"));\r\n\t\t}\r\n\t\t\r\n\t\treturn this.initialized;\r\n\t}\r\n\t\r\n\t////////////////// Data Handling //////////////////\r\n\t//block table redrawing\r\n\tblockRedraw(){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.rowManager.blockRedraw();\r\n\t}\r\n\t\r\n\t//restore table redrawing\r\n\trestoreRedraw(){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.rowManager.restoreRedraw();\r\n\t}\r\n\t\r\n\t//load data\r\n\tsetData(data, params, config){\r\n\t\tthis.initGuard(false, \"To set initial data please use the 'data' property in the table constructor.\");\r\n\t\t\r\n\t\treturn this.dataLoader.load(data, params, config, false);\r\n\t}\r\n\t\r\n\t//clear data\r\n\tclearData(){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tthis.dataLoader.blockActiveLoad();\r\n\t\tthis.rowManager.clearData();\r\n\t}\r\n\t\r\n\t//get table data array\r\n\tgetData(active){\r\n\t\treturn this.rowManager.getData(active);\r\n\t}\r\n\t\r\n\t//get table data array count\r\n\tgetDataCount(active){\r\n\t\treturn this.rowManager.getDataCount(active);\r\n\t}\r\n\t\r\n\t//replace data, keeping table in position with same sort\r\n\treplaceData(data, params, config){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.dataLoader.load(data, params, config, true, true);\r\n\t}\r\n\t\r\n\t//update table data\r\n\tupdateData(data){\r\n\t\tvar responses = 0;\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data){\r\n\t\t\t\tdata.forEach((item) => {\r\n\t\t\t\t\tvar row = this.rowManager.findRow(item[this.options.index]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(row){\r\n\t\t\t\t\t\tresponses++;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trow.updateData(item)\r\n\t\t\t\t\t\t.then(()=>{\r\n\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\tresolve();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\taddData(data, pos, index){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data){\r\n\t\t\t\tthis.rowManager.addRows(data, pos, index)\r\n\t\t\t\t.then((rows) => {\r\n\t\t\t\t\tvar output = [];\r\n\t\t\t\t\t\r\n\t\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\t\toutput.push(row.getComponent());\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tresolve(output);\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//update table data\r\n\tupdateOrAddData(data){\r\n\t\tvar rows = [],\r\n\t\tresponses = 0;\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data){\r\n\t\t\t\tdata.forEach((item) => {\r\n\t\t\t\t\tvar row = this.rowManager.findRow(item[this.options.index]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tresponses++;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(row){\r\n\t\t\t\t\t\trow.updateData(item)\r\n\t\t\t\t\t\t.then(()=>{\r\n\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\trows.push(row.getComponent());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\tresolve(rows);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.rowManager.addRows(item)\r\n\t\t\t\t\t\t.then((newRows)=>{\r\n\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\trows.push(newRows[0].getComponent());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\tresolve(rows);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//get row object\r\n\tgetRow(index){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching row found:\", index);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//get row object\r\n\tgetRowFromPosition(position, active){\r\n\t\tvar row = this.rowManager.getRowFromPosition(position, active);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching row found:\", position);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//delete row from table\r\n\tdeleteRow(index){\r\n\t\tvar foundRows = [];\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(!Array.isArray(index)){\r\n\t\t\tindex = [index];\r\n\t\t}\r\n\t\t\r\n\t\t//find matching rows\r\n\t\tfor(let item of index){\r\n\t\t\tlet row = this.rowManager.findRow(item, true);\r\n\t\t\t\r\n\t\t\tif(row){\r\n\t\t\t\tfoundRows.push(row);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Delete Error - No matching row found:\", item);\r\n\t\t\t\treturn Promise.reject(\"Delete Error - No matching row found\")\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//sort rows into correct order to ensure smooth delete from table\r\n\t\tfoundRows.sort((a, b) => {\r\n\t\t\treturn this.rowManager.rows.indexOf(a) > this.rowManager.rows.indexOf(b) ? 1 : -1;\r\n\t\t});\r\n\t\t\r\n\t\t//delete rows\r\n\t\tfoundRows.forEach((row) =>{\r\n\t\t\trow.delete()\r\n\t\t});\r\n\t\t\r\n\t\tthis.rowManager.reRenderInPosition();\r\n\t\t\r\n\t\treturn Promise.resolve();\r\n\t}\r\n\t\r\n\t//add row to table\r\n\taddRow(data, pos, index){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.rowManager.addRows(data, pos, index)\r\n\t\t.then((rows)=>{\r\n\t\t\treturn rows[0].getComponent();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//update a row if it exitsts otherwise create it\r\n\tupdateOrAddRow(index, data){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.updateData(data)\r\n\t\t\t.then(()=>{\r\n\t\t\t\treturn row.getComponent();\r\n\t\t\t})\r\n\t\t}else{\r\n\t\t\treturn this.rowManager.addRows(data)\r\n\t\t\t.then((rows)=>{\r\n\t\t\t\treturn rows[0].getComponent();\r\n\t\t\t})\r\n\t\t}\r\n\t}\r\n\t\r\n\t//update row data\r\n\tupdateRow(index, data){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.updateData(data)\r\n\t\t\t.then(()=>{\r\n\t\t\t\treturn Promise.resolve(row.getComponent());\r\n\t\t\t})\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Update Error - No matching row found:\", index);\r\n\t\t\treturn Promise.reject(\"Update Error - No matching row found\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t//scroll to row in DOM\r\n\tscrollToRow(index, position, ifVisible){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn this.rowManager.scrollToRow(row, position, ifVisible)\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Scroll Error - No matching row found:\", index);\r\n\t\t\treturn Promise.reject(\"Scroll Error - No matching row found\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveRow(from, to, after){\r\n\t\tvar fromRow = this.rowManager.findRow(from);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(fromRow){\r\n\t\t\tfromRow.moveToRow(to, after);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching row found:\", from);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRows(active){\r\n\t\treturn this.rowManager.getComponents(active);\t\r\n\t}\r\n\t\r\n\t//get position of row in table\r\n\tgetRowPosition(index, active){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn this.rowManager.getRowPosition(row, active);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Position Error - No matching row found:\", index);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t/////////////// Column Functions ///////////////\r\n\tsetColumns(definition){\r\n\t\tthis.initGuard(false, \"To set initial columns please use the 'columns' property in the table constructor\");\r\n\t\t\r\n\t\tthis.columnManager.setColumns(definition);\r\n\t}\r\n\t\r\n\tgetColumns(structured){\r\n\t\treturn this.columnManager.getComponents(structured);\r\n\t}\r\n\t\r\n\tgetColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetColumnDefinitions(){\r\n\t\treturn this.columnManager.getDefinitionTree();\r\n\t}\r\n\t\r\n\tshowColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tcolumn.show();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Show Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\thideColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field); \r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tcolumn.hide();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Hide Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\ttoggleColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tif(column.visible){\r\n\t\t\t\tcolumn.hide();\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.show();\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Visibility Toggle Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColumn(definition, before, field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.columnManager.addColumn(definition, before, column)\r\n\t\t.then((column) => {\r\n\t\t\treturn column.getComponent();\r\n\t\t});\r\n\t}\r\n\t\r\n\tdeleteColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.delete();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Delete Error - No matching column found:\", field);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tupdateColumnDefinition(field, definition){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.updateDefinition(definition)\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Update Error - No matching column found:\", field);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveColumn(from, to, after){\r\n\t\tvar fromColumn = this.columnManager.findColumn(from),\r\n\t\ttoColumn = this.columnManager.findColumn(to);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(fromColumn){\r\n\t\t\tif(toColumn){\r\n\t\t\t\tthis.columnManager.moveColumn(fromColumn, toColumn, after)\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Move Error - No matching column found:\", toColumn);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching column found:\", from);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//scroll to column in DOM\r\n\tscrollToColumn(field, position, ifVisible){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\treturn this.columnManager.scrollToColumn(column, position, ifVisible)\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - No matching column found:\", field);\r\n\t\t\t\treturn Promise.reject(\"Scroll Error - No matching column found\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//////////// General Public Functions ////////////\r\n\t//redraw list without updating data\r\n\tredraw(force){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.columnManager.redraw(force);\r\n\t\tthis.rowManager.redraw(force);\r\n\t}\r\n\t\r\n\tsetHeight(height){\r\n\t\tthis.options.height = isNaN(height) ? height : height + \"px\";\r\n\t\tthis.element.style.height = this.options.height;\r\n\t\tthis.rowManager.initializeRenderer();\r\n\t\tthis.rowManager.redraw();\r\n\t}\r\n\t\r\n\t//////////////////// Event Bus ///////////////////\r\n\t\r\n\ton(key, callback){\r\n\t\tthis.externalEvents.subscribe(key, callback);\r\n\t}\r\n\t\r\n\toff(key, callback){\r\n\t\tthis.externalEvents.unsubscribe(key, callback);\r\n\t}\r\n\t\r\n\tdispatchEvent(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args.shift();\r\n\t\t\r\n\t\tthis.externalEvents.dispatch(...arguments)\r\n\t}\r\n\r\n\t//////////////////// Alerts ///////////////////\r\n\r\n\talert(contents, type){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.alertManager.alert(contents, type);\r\n\t}\r\n\r\n\tclearAlert(){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.alertManager.clear();\r\n\t}\r\n\t\r\n\t////////////// Extension Management //////////////\r\n\tmodExists(plugin, required){\r\n\t\tif(this.modules[plugin]){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tif(required){\r\n\t\t\t\tconsole.error(\"Tabulator Module Not Installed: \" + plugin);\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tmodule(key){\r\n\t\tvar mod = this.modules[key];\r\n\t\t\r\n\t\tif(!mod){\r\n\t\t\tconsole.error(\"Tabulator module not installed: \" + key);\r\n\t\t}\r\n\t\t\r\n\t\treturn mod;\r\n\t}\r\n}\r\n\r\n//default setup options\r\nTabulator.defaultOptions = defaultOptions;\r\n\r\n//bind modules and static functionality\r\nnew ModuleBinder(Tabulator);\r\n\r\nexport default Tabulator;\r\n","export default {}","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defautlAccessors from './defaults/accessors.js';\r\n\r\nclass Accessor extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.allowedTypes = [\"\", \"data\", \"download\", \"clipboard\", \"print\", \"htmlOutput\"] //list of accessor types\r\n\r\n\t\tthis.registerColumnOption(\"accessor\");\r\n\t\tthis.registerColumnOption(\"accessorParams\");\r\n\t\tthis.registerColumnOption(\"accessorData\");\r\n\t\tthis.registerColumnOption(\"accessorDataParams\");\r\n\t\tthis.registerColumnOption(\"accessorDownload\");\r\n\t\tthis.registerColumnOption(\"accessorDownloadParams\");\r\n\t\tthis.registerColumnOption(\"accessorClipboard\");\r\n\t\tthis.registerColumnOption(\"accessorClipboardParams\");\r\n\t\tthis.registerColumnOption(\"accessorPrint\");\r\n\t\tthis.registerColumnOption(\"accessorPrintParams\");\r\n\t\tthis.registerColumnOption(\"accessorHtmlOutput\");\r\n\t\tthis.registerColumnOption(\"accessorHtmlOutputParams\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"row-data-retrieve\", this.transformRow.bind(this));\r\n\t}\r\n\r\n\t//initialize column accessor\r\n\tinitializeColumn(column){\r\n\t\tvar match = false,\r\n\t\tconfig = {};\r\n\r\n\t\tthis.allowedTypes.forEach((type) => {\r\n\t\t\tvar key = \"accessor\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\t\taccessor;\r\n\r\n\t\t\tif(column.definition[key]){\r\n\t\t\t\taccessor = this.lookupAccessor(column.definition[key]);\r\n\r\n\t\t\t\tif(accessor){\r\n\t\t\t\t\tmatch = true;\r\n\r\n\t\t\t\t\tconfig[key] = {\r\n\t\t\t\t\t\taccessor:accessor,\r\n\t\t\t\t\t\tparams: column.definition[key + \"Params\"] || {},\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(match){\r\n\t\t\tcolumn.modules.accessor = config;\r\n\t\t}\r\n\t}\r\n\r\n\tlookupAccessor(value){\r\n\t\tvar accessor = false;\r\n\r\n\t\t//set column accessor\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(Accessor.accessors[value]){\r\n\t\t\t\taccessor = Accessor.accessors[value]\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Accessor Error - No such accessor found, ignoring: \", value);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\taccessor = value;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn accessor;\r\n\t}\r\n\r\n\t//apply accessor to row\r\n\ttransformRow(row, type){\r\n\t\tvar key = \"accessor\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\trowComponent = row.getComponent();\r\n\r\n\t\t//clone data object with deep copy to isolate internal data from returned result\r\n\t\tvar data = Helpers.deepClone(row.data || {});\r\n\r\n\t\tthis.table.columnManager.traverse(function(column){\r\n\t\t\tvar value, accessor, params, colCompnent;\r\n\r\n\t\t\tif(column.modules.accessor){\r\n\r\n\t\t\t\taccessor = column.modules.accessor[key] || column.modules.accessor.accessor || false;\r\n\r\n\t\t\t\tif(accessor){\r\n\t\t\t\t\tvalue = column.getFieldValue(data);\r\n\r\n\t\t\t\t\tif(value != \"undefined\"){\r\n\t\t\t\t\t\tcolCompnent = column.getComponent();\r\n\t\t\t\t\t\tparams = typeof accessor.params === \"function\" ? accessor.params(value, data, type, colCompnent, rowComponent) : accessor.params;\r\n\t\t\t\t\t\tcolumn.setFieldValue(data, accessor.accessor(value, data, type, params, colCompnent, rowComponent));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n}\r\n\r\n//load defaults\r\nAccessor.moduleName = \"accessor\";\r\nAccessor.accessors = defautlAccessors;\r\n\r\nexport default Accessor;","export default {\r\n\tmethod: \"GET\",\r\n};","function generateParamsList(data, prefix){\r\n\tvar output = [];\r\n\r\n\tprefix = prefix || \"\";\r\n\r\n\tif(Array.isArray(data)){\r\n\t\tdata.forEach((item, i) => {\r\n\t\t\toutput = output.concat(generateParamsList(item, prefix ? prefix + \"[\" + i + \"]\" : i));\r\n\t\t});\r\n\t}else if (typeof data === \"object\"){\r\n\t\tfor (var key in data){\r\n\t\t\toutput = output.concat(generateParamsList(data[key], prefix ? prefix + \"[\" + key + \"]\" : key));\r\n\t\t}\r\n\t}else{\r\n\t\toutput.push({key:prefix, value:data});\r\n\t}\r\n\r\n\treturn output;\r\n}\r\n\r\nfunction serializeParams(params){\r\n\tvar output = generateParamsList(params),\r\n\tencoded = [];\r\n\r\n\toutput.forEach(function(item){\r\n\t\tencoded.push(encodeURIComponent(item.key) + \"=\" + encodeURIComponent(item.value));\r\n\t});\r\n\r\n\treturn encoded.join(\"&\");\r\n}\r\n\r\nexport default function(url, config, params){\r\n\tif(url){\r\n\t\tif(params && Object.keys(params).length){\r\n\t\t\tif(!config.method || config.method.toLowerCase() == \"get\"){\r\n\t\t\t\tconfig.method = \"get\";\r\n\r\n\t\t\t\turl += (url.includes(\"?\") ? \"&\" : \"?\") + serializeParams(params);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn url;\r\n};","export default function(url, config, params){\r\n\tvar contentType;\r\n\r\n\treturn new Promise((resolve, reject) => {\r\n\t\t//set url\r\n\t\turl = this.urlGenerator.call(this.table, url, config, params);\r\n\r\n\t\t//set body content if not GET request\r\n\t\tif(config.method.toUpperCase() != \"GET\"){\r\n\t\t\tcontentType = typeof this.table.options.ajaxContentType === \"object\" ? this.table.options.ajaxContentType : this.contentTypeFormatters[this.table.options.ajaxContentType];\r\n\t\t\tif(contentType){\r\n\r\n\t\t\t\tfor(var key in contentType.headers){\r\n\t\t\t\t\tif(!config.headers){\r\n\t\t\t\t\t\tconfig.headers = {};\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(typeof config.headers[key] === \"undefined\"){\r\n\t\t\t\t\t\tconfig.headers[key] = contentType.headers[key];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconfig.body = contentType.body.call(this, url, config, params);\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Ajax Error - Invalid ajaxContentType value:\", this.table.options.ajaxContentType);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(url){\r\n\t\t\t//configure headers\r\n\t\t\tif(typeof config.headers === \"undefined\"){\r\n\t\t\t\tconfig.headers = {};\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.headers.Accept === \"undefined\"){\r\n\t\t\t\tconfig.headers.Accept = \"application/json\";\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.headers[\"X-Requested-With\"] === \"undefined\"){\r\n\t\t\t\tconfig.headers[\"X-Requested-With\"] = \"XMLHttpRequest\";\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.mode === \"undefined\"){\r\n\t\t\t\tconfig.mode = \"cors\";\r\n\t\t\t}\r\n\r\n\t\t\tif(config.mode == \"cors\"){\r\n\t\t\t\tif(typeof config.headers[\"Origin\"] === \"undefined\"){\r\n\t\t\t\t\tconfig.headers[\"Origin\"] = window.location.origin;\r\n\t\t\t\t}\r\n \r\n\t\t\t\tif(typeof config.credentials === \"undefined\"){\r\n\t\t\t\t\tconfig.credentials = 'same-origin';\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(typeof config.credentials === \"undefined\"){\r\n\t\t\t\t\tconfig.credentials = 'include';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//send request\r\n\t\t\tfetch(url, config)\r\n\t\t\t.then((response)=>{\r\n\t\t\t\tif(response.ok) {\r\n\t\t\t\t\tresponse.json()\r\n\t\t\t\t\t.then((data)=>{\r\n\t\t\t\t\t\tresolve(data);\r\n\t\t\t\t\t}).catch((error)=>{\r\n\t\t\t\t\t\treject(error);\r\n\t\t\t\t\t\tconsole.warn(\"Ajax Load Error - Invalid JSON returned\", error);\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.error(\"Ajax Load Error - Connection Error: \" + response.status, response.statusText);\r\n\t\t\t\t\treject(response);\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.catch((error)=>{\r\n\t\t\t\tconsole.error(\"Ajax Load Error - Connection Error: \", error);\r\n\t\t\t\treject(error);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Ajax Load Error - No URL Set\");\r\n\t\t\tresolve([]);\r\n\t\t}\r\n\t});\r\n};","function generateParamsList(data, prefix){\r\n\tvar output = [];\r\n\r\n\tprefix = prefix || \"\";\r\n\r\n\tif(Array.isArray(data)){\r\n\t\tdata.forEach((item, i) => {\r\n\t\t\toutput = output.concat(generateParamsList(item, prefix ? prefix + \"[\" + i + \"]\" : i));\r\n\t\t});\r\n\t}else if (typeof data === \"object\"){\r\n\t\tfor (var key in data){\r\n\t\t\toutput = output.concat(generateParamsList(data[key], prefix ? prefix + \"[\" + key + \"]\" : key));\r\n\t\t}\r\n\t}else{\r\n\t\toutput.push({key:prefix, value:data});\r\n\t}\r\n\r\n\treturn output;\r\n}\r\n\r\nexport default {\r\n\t\"json\":{\r\n\t\theaders:{\r\n\t\t\t'Content-Type': 'application/json',\r\n\t\t},\r\n\t\tbody:function(url, config, params){\r\n\t\t\treturn JSON.stringify(params);\r\n\t\t},\r\n\t},\r\n\t\"form\":{\r\n\t\theaders:{\r\n\t\t},\r\n\t\tbody:function(url, config, params){\r\n\r\n\t\t\tvar output = generateParamsList(params),\r\n\t\t\tform = new FormData();\r\n\r\n\t\t\toutput.forEach(function(item){\r\n\t\t\t\tform.append(item.key, item.value);\r\n\t\t\t});\r\n\r\n\t\t\treturn form;\r\n\t\t},\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultConfig from './defaults/config.js';\r\nimport defaultURLGenerator from './defaults/urlGenerator.js';\r\nimport defaultLoaderPromise from './defaults/loaderPromise.js';\r\nimport defaultContentTypeFormatters from './defaults/contentTypeFormatters.js';\r\n\r\nclass Ajax extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.config = {}; //hold config object for ajax request\r\n\t\tthis.url = \"\"; //request URL\r\n\t\tthis.urlGenerator = false;\r\n\t\tthis.params = false; //request parameters\r\n\t\t\r\n\t\tthis.loaderPromise = false;\r\n\t\t\r\n\t\tthis.registerTableOption(\"ajaxURL\", false); //url for ajax loading\r\n\t\tthis.registerTableOption(\"ajaxURLGenerator\", false);\r\n\t\tthis.registerTableOption(\"ajaxParams\", {}); //params for ajax loading\r\n\t\tthis.registerTableOption(\"ajaxConfig\", \"get\"); //ajax request type\r\n\t\tthis.registerTableOption(\"ajaxContentType\", \"form\"); //ajax request type\r\n\t\tthis.registerTableOption(\"ajaxRequestFunc\", false); //promise function\r\n\t\t\r\n\t\tthis.registerTableOption(\"ajaxRequesting\", function(){});\r\n\t\tthis.registerTableOption(\"ajaxResponse\", false);\r\n\t\t\r\n\t\tthis.contentTypeFormatters = Ajax.contentTypeFormatters;\r\n\t}\r\n\t\r\n\t//initialize setup options\r\n\tinitialize(){\r\n\t\tthis.loaderPromise = this.table.options.ajaxRequestFunc || Ajax.defaultLoaderPromise;\r\n\t\tthis.urlGenerator = this.table.options.ajaxURLGenerator || Ajax.defaultURLGenerator;\r\n\t\t\r\n\t\tif(this.table.options.ajaxURL){\r\n\t\t\tthis.setUrl(this.table.options.ajaxURL);\r\n\t\t}\r\n\r\n\r\n\t\tthis.setDefaultConfig(this.table.options.ajaxConfig);\r\n\t\t\r\n\t\tthis.registerTableFunction(\"getAjaxUrl\", this.getUrl.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"data-loading\", this.requestDataCheck.bind(this));\r\n\t\tthis.subscribe(\"data-params\", this.requestParams.bind(this));\r\n\t\tthis.subscribe(\"data-load\", this.requestData.bind(this));\r\n\t}\r\n\t\r\n\trequestParams(data, config, silent, params){\r\n\t\tvar ajaxParams = this.table.options.ajaxParams;\r\n\t\t\r\n\t\tif(ajaxParams){\r\n\t\t\tif(typeof ajaxParams === \"function\"){\r\n\t\t\t\tajaxParams = ajaxParams.call(this.table);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tparams = Object.assign(params, ajaxParams);\r\n\t\t}\t\t\r\n\t\t\r\n\t\treturn params;\r\n\t}\r\n\t\r\n\trequestDataCheck(data, params, config, silent){\r\n\t\treturn !!((!data && this.url) || typeof data === \"string\");\r\n\t}\r\n\t\r\n\trequestData(url, params, config, silent, previousData){\r\n\t\tvar ajaxConfig;\r\n\t\t\r\n\t\tif(!previousData && this.requestDataCheck(url)){\r\n\t\t\tif(url){\r\n\t\t\t\tthis.setUrl(url);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tajaxConfig = this.generateConfig(config);\r\n\t\t\t\r\n\t\t\treturn this.sendRequest(this.url, params, ajaxConfig);\r\n\t\t}else{\r\n\t\t\treturn previousData;\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetDefaultConfig(config = {}){\r\n\t\tthis.config = Object.assign({}, Ajax.defaultConfig);\r\n\r\n\t\tif(typeof config == \"string\"){\r\n\t\t\tthis.config.method = config;\r\n\t\t}else{\r\n\t\t\tObject.assign(this.config, config);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//load config object\r\n\tgenerateConfig(config = {}){\r\n\t\tvar ajaxConfig = Object.assign({}, this.config)\r\n\t\t\r\n\t\tif(typeof config == \"string\"){\r\n\t\t\tajaxConfig.method = config;\r\n\t\t}else{\r\n\t\t\tObject.assign(ajaxConfig, config);\r\n\t\t}\r\n\t\t\r\n\t\treturn ajaxConfig;\r\n\t}\r\n\t\r\n\t//set request url\r\n\tsetUrl(url){\r\n\t\tthis.url = url;\r\n\t}\r\n\t\r\n\t//get request url\r\n\tgetUrl(){\r\n\t\treturn this.url;\r\n\t}\r\n\t\r\n\t//send ajax request\r\n\tsendRequest(url, params, config){\r\n\t\tif(this.table.options.ajaxRequesting.call(this.table, url, params) !== false){\r\n\t\t\treturn this.loaderPromise(url, config, params)\r\n\t\t\t.then((data)=>{\r\n\t\t\t\tif(this.table.options.ajaxResponse){\r\n\t\t\t\t\tdata = this.table.options.ajaxResponse.call(this.table, url, params, data);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn data;\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n}\r\n\r\nAjax.moduleName = \"ajax\";\r\n\r\n//load defaults\r\nAjax.defaultConfig = defaultConfig;\r\nAjax.defaultURLGenerator = defaultURLGenerator;\r\nAjax.defaultLoaderPromise = defaultLoaderPromise;\r\nAjax.contentTypeFormatters = defaultContentTypeFormatters;\r\n\r\nexport default Ajax;","export default {\r\n\treplace:function(rows){\r\n\t\treturn this.table.setData(rows);\r\n\t},\r\n\tupdate:function(rows){\r\n\t\treturn this.table.updateOrAddData(rows);\r\n\t},\r\n\tinsert:function(rows){\r\n\t\treturn this.table.addData(rows);\r\n\t},\r\n};","export default {\r\n\ttable:function(clipboard){\r\n\t\tvar data = [],\r\n\t\tsuccess = false,\r\n\t\theaderFindSuccess = true,\r\n\t\tcolumns = this.table.columnManager.columns,\r\n\t\tcolumnMap = [],\r\n\t\trows = [];\r\n\r\n\t\t//get data from clipboard into array of columns and rows.\r\n\t\tclipboard = clipboard.split(\"\\n\");\r\n\r\n\t\tclipboard.forEach(function(row){\r\n\t\t\tdata.push(row.split(\"\\t\"));\r\n\t\t});\r\n\r\n\t\tif(data.length && !(data.length === 1 && data[0].length < 2)){\r\n\t\t\tsuccess = true;\r\n\r\n\t\t\t//check if headers are present by title\r\n\t\t\tdata[0].forEach(function(value){\r\n\t\t\t\tvar column = columns.find(function(column){\r\n\t\t\t\t\treturn value && column.definition.title && value.trim() && column.definition.title.trim() === value.trim();\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tcolumnMap.push(column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\theaderFindSuccess = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t//check if column headers are present by field\r\n\t\t\tif(!headerFindSuccess){\r\n\t\t\t\theaderFindSuccess = true;\r\n\t\t\t\tcolumnMap = [];\r\n\r\n\t\t\t\tdata[0].forEach(function(value){\r\n\t\t\t\t\tvar column = columns.find(function(column){\r\n\t\t\t\t\t\treturn value && column.field && value.trim() && column.field.trim() === value.trim();\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(column){\r\n\t\t\t\t\t\tcolumnMap.push(column);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\theaderFindSuccess = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(!headerFindSuccess){\r\n\t\t\t\t\tcolumnMap = this.table.columnManager.columnsByIndex;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//remove header row if found\r\n\t\t\tif(headerFindSuccess){\r\n\t\t\t\tdata.shift();\r\n\t\t\t}\r\n\r\n\t\t\tdata.forEach(function(item){\r\n\t\t\t\tvar row = {};\r\n\r\n\t\t\t\titem.forEach(function(value, i){\r\n\t\t\t\t\tif(columnMap[i]){\r\n\t\t\t\t\t\trow[columnMap[i].field] = value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\trows.push(row);\r\n\t\t\t});\r\n\r\n\t\t\treturn rows;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultPasteActions from './defaults/pasteActions.js';\r\nimport defaultPasteParsers from './defaults/pasteParsers.js';\r\n\r\nclass Clipboard extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.mode = true;\r\n\t\tthis.pasteParser = function(){};\r\n\t\tthis.pasteAction = function(){};\r\n\t\tthis.customSelection = false;\r\n\t\tthis.rowRange = false;\r\n\t\tthis.blocked = true; //block copy actions not originating from this command\r\n\r\n\t\tthis.registerTableOption(\"clipboard\", false); //enable clipboard\r\n\t\tthis.registerTableOption(\"clipboardCopyStyled\", true); //formatted table data\r\n\t\tthis.registerTableOption(\"clipboardCopyConfig\", false); //clipboard config\r\n\t\tthis.registerTableOption(\"clipboardCopyFormatter\", false); //DEPRICATED - REMOVE in 5.0\r\n\t\tthis.registerTableOption(\"clipboardCopyRowRange\", \"active\"); //restrict clipboard to visible rows only\r\n\t\tthis.registerTableOption(\"clipboardPasteParser\", \"table\"); //convert pasted clipboard data to rows\r\n\t\tthis.registerTableOption(\"clipboardPasteAction\", \"insert\"); //how to insert pasted data into the table\r\n\r\n\t\tthis.registerColumnOption(\"clipboard\");\r\n\t\tthis.registerColumnOption(\"titleClipboard\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.mode = this.table.options.clipboard;\r\n\r\n\t\tthis.rowRange = this.table.options.clipboardCopyRowRange;\r\n\r\n\t\tif(this.mode === true || this.mode === \"copy\"){\r\n\t\t\tthis.table.element.addEventListener(\"copy\", (e) => {\r\n\t\t\t\tvar plain, html, list;\r\n\r\n\t\t\t\tif(!this.blocked){\r\n\t\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\t\tif(this.customSelection){\r\n\t\t\t\t\t\tplain = this.customSelection;\r\n\r\n\t\t\t\t\t\tif(this.table.options.clipboardCopyFormatter){\r\n\t\t\t\t\t\t\tplain = this.table.options.clipboardCopyFormatter(\"plain\", plain);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\r\n\t\t\t\t\t\tvar list = this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig, this.table.options.clipboardCopyStyled, this.rowRange, \"clipboard\");\r\n\r\n\t\t\t\t\t\thtml = this.table.modules.export.genereateHTMLTable(list);\r\n\t\t\t\t\t\tplain = html ? this.generatePlainContent(list) : \"\";\r\n\r\n\t\t\t\t\t\tif(this.table.options.clipboardCopyFormatter){\r\n\t\t\t\t\t\t\tplain = this.table.options.clipboardCopyFormatter(\"plain\", plain);\r\n\t\t\t\t\t\t\thtml = this.table.options.clipboardCopyFormatter(\"html\", html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (window.clipboardData && window.clipboardData.setData) {\r\n\t\t\t\t\t\twindow.clipboardData.setData('Text', plain);\r\n\t\t\t\t\t} else if (e.clipboardData && e.clipboardData.setData) {\r\n\t\t\t\t\t\te.clipboardData.setData('text/plain', plain);\r\n\t\t\t\t\t\tif(html){\r\n\t\t\t\t\t\t\te.clipboardData.setData('text/html', html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (e.originalEvent && e.originalEvent.clipboardData.setData) {\r\n\t\t\t\t\t\te.originalEvent.clipboardData.setData('text/plain', plain);\r\n\t\t\t\t\t\tif(html){\r\n\t\t\t\t\t\t\te.originalEvent.clipboardData.setData('text/html', html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.dispatchExternal(\"clipboardCopied\", plain, html);\r\n\r\n\t\t\t\t\tthis.reset();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.mode === true || this.mode === \"paste\"){\r\n\t\t\tthis.table.element.addEventListener(\"paste\", (e) => {\r\n\t\t\t\tthis.paste(e);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.setPasteParser(this.table.options.clipboardPasteParser);\r\n\t\tthis.setPasteAction(this.table.options.clipboardPasteAction);\r\n\r\n\t\tthis.registerTableFunction(\"copyToClipboard\", this.copy.bind(this));\r\n\t}\r\n\r\n\treset(){\r\n\t\tthis.blocked = true;\r\n\t\tthis.customSelection = false;\r\n\t}\r\n\r\n\tgeneratePlainContent (list) {\r\n\t\tvar output = [];\r\n\r\n\t\tlist.forEach((row) => {\r\n\t\t\tvar rowData = [];\r\n\r\n\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\tvar value = \"\";\r\n\r\n\t\t\t\tif(col){\r\n\r\n\t\t\t\t\tif(row.type === \"group\"){\r\n\t\t\t\t\t\tcol.value = col.component.getKey();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(col.value === null){\r\n\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\t\tvalue = JSON.stringify(col.value);\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tvalue = col.value;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowData.push(value);\r\n\t\t\t});\r\n\r\n\t\t\toutput.push(rowData.join(\"\\t\"));\r\n\t\t});\r\n\r\n\t\treturn output.join(\"\\n\");\r\n\t}\r\n\r\n\tcopy (range, internal) {\r\n\t\tvar range, sel, textRange;\r\n\t\tthis.blocked = false;\r\n\t\tthis.customSelection = false;\r\n\r\n\t\tif (this.mode === true || this.mode === \"copy\") {\r\n\r\n\t\t\tthis.rowRange = range || this.table.options.clipboardCopyRowRange;\r\n\r\n\t\t\tif (typeof window.getSelection != \"undefined\" && typeof document.createRange != \"undefined\") {\r\n\t\t\t\trange = document.createRange();\r\n\t\t\t\trange.selectNodeContents(this.table.element);\r\n\t\t\t\tsel = window.getSelection();\r\n\r\n\t\t\t\tif (sel.toString() && internal) {\r\n\t\t\t\t\tthis.customSelection = sel.toString();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tsel.removeAllRanges();\r\n\t\t\t\tsel.addRange(range);\r\n\t\t\t} else if (typeof document.selection != \"undefined\" && typeof document.body.createTextRange != \"undefined\") {\r\n\t\t\t\ttextRange = document.body.createTextRange();\r\n\t\t\t\ttextRange.moveToElementText(this.table.element);\r\n\t\t\t\ttextRange.select();\r\n\t\t\t}\r\n\r\n\t\t\tdocument.execCommand('copy');\r\n\r\n\t\t\tif (sel) {\r\n\t\t\t\tsel.removeAllRanges();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//PASTE EVENT HANDLING\r\n\tsetPasteAction(action){\r\n\r\n\t\tswitch(typeof action){\r\n\t\t\tcase \"string\":\r\n\t\t\tthis.pasteAction = Clipboard.pasteActions[action];\r\n\r\n\t\t\tif(!this.pasteAction){\r\n\t\t\t\tconsole.warn(\"Clipboard Error - No such paste action found:\", action);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tthis.pasteAction = action;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tsetPasteParser(parser){\r\n\t\tswitch(typeof parser){\r\n\t\t\tcase \"string\":\r\n\t\t\tthis.pasteParser = Clipboard.pasteParsers[parser];\r\n\r\n\t\t\tif(!this.pasteParser){\r\n\t\t\t\tconsole.warn(\"Clipboard Error - No such paste parser found:\", parser);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tthis.pasteParser = parser;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tpaste(e){\r\n\t\tvar data, rowData, rows;\r\n\r\n\t\tif(this.checkPaseOrigin(e)){\r\n\r\n\t\t\tdata = this.getPasteData(e);\r\n\r\n\t\t\trowData = this.pasteParser.call(this, data);\r\n\r\n\t\t\tif(rowData){\r\n\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\t\t\trowData = this.mutateData(rowData);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trows = this.pasteAction.call(this, rowData);\r\n\r\n\t\t\t\tthis.dispatchExternal(\"clipboardPasted\", data, rowData, rows);\r\n\t\t\t}else{\r\n\t\t\t\tthis.dispatchExternal(\"clipboardPasteError\", data);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmutateData(data){\r\n\t\tvar output = [];\r\n\r\n\t\tif(Array.isArray(data)){\r\n\t\t\tdata.forEach((row) => {\r\n\t\t\t\toutput.push(this.table.modules.mutator.transformRow(row, \"clipboard\"));\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\toutput = data;\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\r\n\tcheckPaseOrigin(e){\r\n\t\tvar valid = true;\r\n\r\n\t\tif(e.target.tagName != \"DIV\" || this.table.modules.edit.currentCell){\r\n\t\t\tvalid = false;\r\n\t\t}\r\n\r\n\t\treturn valid;\r\n\t}\r\n\r\n\tgetPasteData(e){\r\n\t\tvar data;\r\n\r\n\t\tif (window.clipboardData && window.clipboardData.getData) {\r\n\t\t\tdata = window.clipboardData.getData('Text');\r\n\t\t} else if (e.clipboardData && e.clipboardData.getData) {\r\n\t\t\tdata = e.clipboardData.getData('text/plain');\r\n\t\t} else if (e.originalEvent && e.originalEvent.clipboardData.getData) {\r\n\t\t\tdata = e.originalEvent.clipboardData.getData('text/plain');\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n}\r\n\r\nClipboard.moduleName = \"clipboard\";\r\n\r\n//load defaults\r\nClipboard.pasteActions = defaultPasteActions;\r\nClipboard.pasteParsers = defaultPasteParsers;\r\n\r\nexport default Clipboard;","class CalcComponent{\r\n\tconstructor (row){\r\n\t\tthis._row = row;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._row.table.componentFunctionBinder.handle(\"row\", target._row, name)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\tgetData(transform){\r\n\t\treturn this._row.getData(transform);\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._row.getElement();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._row.table;\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._row.getCells().forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tgetCell(column){\r\n\t\tvar cell = this._row.getCell(column);\r\n\t\treturn cell ? cell.getComponent() : false;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._row;\r\n\t}\r\n}\r\n\r\nexport default CalcComponent;","export default {\r\n\t\"avg\":function(values, data, calcParams){\r\n\t\tvar output = 0,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : 2\r\n\r\n\t\tif(values.length){\r\n\t\t\toutput = values.reduce(function(sum, value){\r\n\t\t\t\treturn Number(sum) + Number(value);\r\n\t\t\t});\r\n\r\n\t\t\toutput = output / values.length;\r\n\r\n\t\t\toutput = precision !== false ? output.toFixed(precision) : output;\r\n\t\t}\r\n\r\n\t\treturn parseFloat(output).toString();\r\n\t},\r\n\t\"max\":function(values, data, calcParams){\r\n\t\tvar output = null,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tvalues.forEach(function(value){\r\n\r\n\t\t\tvalue = Number(value);\r\n\r\n\t\t\tif(value > output || output === null){\r\n\t\t\t\toutput = value;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output !== null ? (precision !== false ? output.toFixed(precision) : output) : \"\";\r\n\t},\r\n\t\"min\":function(values, data, calcParams){\r\n\t\tvar output = null,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tvalues.forEach(function(value){\r\n\r\n\t\t\tvalue = Number(value);\r\n\r\n\t\t\tif(value < output || output === null){\r\n\t\t\t\toutput = value;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output !== null ? (precision !== false ? output.toFixed(precision) : output) : \"\";\r\n\t},\r\n\t\"sum\":function(values, data, calcParams){\r\n\t\tvar output = 0,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tif(values.length){\r\n\t\t\tvalues.forEach(function(value){\r\n\t\t\t\tvalue = Number(value);\r\n\r\n\t\t\t\toutput += !isNaN(value) ? Number(value) : 0;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn precision !== false ? output.toFixed(precision) : output;\r\n\t},\r\n\t\"concat\":function(values, data, calcParams){\r\n\t\tvar output = 0;\r\n\r\n\t\tif(values.length){\r\n\t\t\toutput = values.reduce(function(sum, value){\r\n\t\t\t\treturn String(sum) + String(value);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t},\r\n\t\"count\":function(values, data, calcParams){\r\n\t\tvar output = 0;\r\n\r\n\t\tif(values.length){\r\n\t\t\tvalues.forEach(function(value){\r\n\t\t\t\tif(value){\r\n\t\t\t\t\toutput ++;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport CalcComponent from './CalcComponent.js';\r\n\r\nimport Cell from '../../core/cell/Cell.js';\r\nimport Column from '../../core/column/Column.js';\r\nimport Row from '../../core/row/Row.js';\r\n\r\nimport defaultCalculations from './defaults/calculations.js';\r\n\r\nclass ColumnCalcs extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.topCalcs = [];\r\n\t\tthis.botCalcs = [];\r\n\t\tthis.genColumn = false;\r\n\t\tthis.topElement = this.createElement();\r\n\t\tthis.botElement = this.createElement();\r\n\t\tthis.topRow = false;\r\n\t\tthis.botRow = false;\r\n\t\tthis.topInitialized = false;\r\n\t\tthis.botInitialized = false;\r\n\r\n\t\tthis.registerTableOption(\"columnCalcs\", true);\r\n\r\n\t\tthis.registerColumnOption(\"topCalc\");\r\n\t\tthis.registerColumnOption(\"topCalcParams\");\r\n\t\tthis.registerColumnOption(\"topCalcFormatter\");\r\n\t\tthis.registerColumnOption(\"topCalcFormatterParams\");\r\n\t\tthis.registerColumnOption(\"bottomCalc\");\r\n\t\tthis.registerColumnOption(\"bottomCalcParams\");\r\n\t\tthis.registerColumnOption(\"bottomCalcFormatter\");\r\n\t\tthis.registerColumnOption(\"bottomCalcFormatterParams\");\r\n\t}\r\n\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tel.classList.add(\"tabulator-calcs-holder\");\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.genColumn = new Column({field:\"value\"}, this);\r\n\r\n\t\tthis.subscribe(\"cell-value-changed\", this.cellValueChanged.bind(this));\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumnCheck.bind(this));\r\n\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"row-added\", this.rowsUpdated.bind(this));\r\n\t\tthis.subscribe(\"column-moved\", this.recalcActiveRows.bind(this));\r\n\t\tthis.subscribe(\"column-add\", this.recalcActiveRows.bind(this));\r\n\t\tthis.subscribe(\"data-refreshed\", this.recalcActiveRowsRefresh.bind(this));\r\n\t\tthis.subscribe(\"table-redraw\", this.tableRedraw.bind(this));\r\n\t\tthis.subscribe(\"rows-visible\", this.visibleRows.bind(this));\r\n\r\n\t\tthis.registerTableFunction(\"getCalcResults\", this.getResults.bind(this));\r\n\t\tthis.registerTableFunction(\"recalc\", this.userRecalc.bind(this));\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\r\n\t\tif(force){\r\n\t\t\tthis.redraw();\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\tuserRecalc(){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tvisibleRows(viewable, rows){\r\n\t\tif(this.topRow){\r\n\t\t\trows.unshift(this.topRow);\r\n\t\t}\r\n\r\n\t\tif(this.botRow){\r\n\t\t\trows.push(this.botRow);\r\n\t\t}\r\n\t\r\n\t\treturn rows;\r\n\t}\r\n\r\n\trowsUpdated(row){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.recalcRowGroup(this);\r\n\t\t}else{\r\n\t\t\tthis.recalcActiveRows();\r\n\t\t}\r\n\t}\r\n\r\n\trecalcActiveRowsRefresh(){\r\n\t\tif(this.table.options.groupBy && this.table.options.dataTreeStartExpanded && this.table.options.dataTree){\r\n\t\t\tthis.recalcAll();\r\n\t\t}else{\r\n\t\t\tthis.recalcActiveRows();\r\n\t\t}\r\n\t}\r\n\r\n\trecalcActiveRows(){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\t}\r\n\r\n\tcellValueChanged(cell){\r\n\t\tif(cell.column.definition.topCalc || cell.column.definition.bottomCalc){\r\n\t\t\tif(this.table.options.groupBy){\r\n\t\t\t\tif(this.table.options.columnCalcs == \"table\" || this.table.options.columnCalcs == \"both\"){\r\n\t\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"table\"){\r\n\t\t\t\t\tthis.recalcRowGroup(cell.row);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeColumnCheck(column){\r\n\t\tif(column.definition.topCalc || column.definition.bottomCalc){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\r\n\t//initialize column calcs\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.definition\r\n\r\n\t\tvar config = {\r\n\t\t\ttopCalcParams:def.topCalcParams || {},\r\n\t\t\tbotCalcParams:def.bottomCalcParams || {},\r\n\t\t};\r\n\r\n\t\tif(def.topCalc){\r\n\r\n\t\t\tswitch(typeof def.topCalc){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tif(ColumnCalcs.calculations[def.topCalc]){\r\n\t\t\t\t\tconfig.topCalc = ColumnCalcs.calculations[def.topCalc]\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Column Calc Error - No such calculation found, ignoring: \", def.topCalc);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tconfig.topCalc = def.topCalc;\r\n\t\t\t\tbreak\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(config.topCalc){\r\n\t\t\t\tcolumn.modules.columnCalcs = config;\r\n\t\t\t\tthis.topCalcs.push(column);\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"group\"){\r\n\t\t\t\t\tthis.initializeTopRow();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tif(def.bottomCalc){\r\n\t\t\tswitch(typeof def.bottomCalc){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tif(ColumnCalcs.calculations[def.bottomCalc]){\r\n\t\t\t\t\tconfig.botCalc = ColumnCalcs.calculations[def.bottomCalc]\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Column Calc Error - No such calculation found, ignoring: \", def.bottomCalc);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tconfig.botCalc = def.bottomCalc;\r\n\t\t\t\tbreak\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(config.botCalc){\r\n\t\t\t\tcolumn.modules.columnCalcs = config;\r\n\t\t\t\tthis.botCalcs.push(column);\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"group\"){\r\n\t\t\t\t\tthis.initializeBottomRow();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t//dummy functions to handle being mock column manager\r\n\tregisterColumnField(){};\r\n\r\n\tremoveCalcs(){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(this.topInitialized){\r\n\t\t\tthis.topInitialized = false;\r\n\t\t\tthis.topElement.parentNode.removeChild(this.topElement);\r\n\t\t\tchanged = true;\r\n\t\t}\r\n\r\n\t\tif(this.botInitialized){\r\n\t\t\tthis.botInitialized = false;\r\n\t\t\tthis.footerRemove(this.botElement);\r\n\t\t\tchanged = true;\r\n\t\t}\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeTopRow(){\r\n\t\tif(!this.topInitialized){\r\n\t\t\tthis.table.columnManager.getElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling);\r\n\t\t\tthis.topInitialized = true;\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeBottomRow(){\r\n\t\tif(!this.botInitialized){\r\n\t\t\tthis.footerPrepend(this.botElement);\r\n\t\t\tthis.botInitialized = true;\r\n\t\t}\r\n\t}\r\n\r\n\tscrollHorizontal(left){\r\n\t\tif(this.botInitialized && this.botRow){\r\n\t\t\tthis.botRow.getElement().style.marginLeft = (-left) + \"px\";\r\n\t\t}\r\n\t}\r\n\r\n\trecalc(rows){\r\n\t\tvar data, row;\r\n\r\n\t\tif(this.topInitialized || this.botInitialized){\r\n\t\t\tdata = this.rowsToData(rows);\r\n\r\n\t\t\tif(this.topInitialized){\r\n\t\t\t\tif(this.topRow){\r\n\t\t\t\t\tthis.topRow.deleteCells();\r\n\t\t\t\t}\r\n\r\n\t\t\t\trow = this.generateRow(\"top\", this.rowsToData(rows))\r\n\t\t\t\tthis.topRow = row;\r\n\t\t\t\twhile(this.topElement.firstChild) this.topElement.removeChild(this.topElement.firstChild);\r\n\t\t\t\tthis.topElement.appendChild(row.getElement());\r\n\t\t\t\trow.initialize(true);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.botInitialized){\r\n\t\t\t\tif(this.botRow){\r\n\t\t\t\t\tthis.botRow.deleteCells();\r\n\t\t\t\t}\r\n\r\n\t\t\t\trow = this.generateRow(\"bottom\", this.rowsToData(rows))\r\n\t\t\t\tthis.botRow = row;\r\n\t\t\t\twhile(this.botElement.firstChild) this.botElement.removeChild(this.botElement.firstChild);\r\n\t\t\t\tthis.botElement.appendChild(row.getElement());\r\n\t\t\t\trow.initialize(true);\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\t//set resizable handles\r\n\t\t\tif(this.table.modExists(\"frozenColumns\")){\r\n\t\t\t\tthis.table.modules.frozenColumns.layout();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trecalcRowGroup(row){\r\n\t\tthis.recalcGroup(this.table.modules.groupRows.getRowGroup(row));\r\n\t}\r\n\r\n\trecalcAll(){\r\n\t\tif(this.topCalcs.length || this.botCalcs.length){\r\n\t\t\tif(this.table.options.columnCalcs !== \"group\"){\r\n\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.options.groupBy && this.table.options.columnCalcs !== \"table\"){\r\n\r\n\t\t\t\tvar groups = this.table.modules.groupRows.getChildGroups();\r\n\r\n\t\t\t\tgroups.forEach((group) => {\r\n\t\t\t\t\tthis.recalcGroup(group);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trecalcGroup(group){\r\n\t\tvar data, rowData;\r\n\r\n\t\tif(group){\r\n\t\t\tif(group.calcs){\r\n\t\t\t\tif(group.calcs.bottom){\r\n\t\t\t\t\tdata = this.rowsToData(group.rows);\r\n\t\t\t\t\trowData = this.generateRowData(\"bottom\", data);\r\n\r\n\t\t\t\t\tgroup.calcs.bottom.updateData(rowData);\r\n\t\t\t\t\tgroup.calcs.bottom.reinitialize();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(group.calcs.top){\r\n\t\t\t\t\tdata = this.rowsToData(group.rows);\r\n\t\t\t\t\trowData = this.generateRowData(\"top\", data);\r\n\r\n\t\t\t\t\tgroup.calcs.top.updateData(rowData);\r\n\t\t\t\t\tgroup.calcs.top.reinitialize();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//generate top stats row\r\n\tgenerateTopRow(rows){\r\n\t\treturn this.generateRow(\"top\", this.rowsToData(rows));\r\n\t}\r\n\t//generate bottom stats row\r\n\tgenerateBottomRow(rows){\r\n\t\treturn this.generateRow(\"bottom\", this.rowsToData(rows));\r\n\t}\r\n\r\n\trowsToData(rows){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\trows.forEach((row) => {\r\n\t\t\tdata.push(row.getData());\r\n\r\n\t\t\tif(this.table.options.dataTree && this.table.options.dataTreeChildColumnCalcs){\r\n\t\t\t\tif(row.modules.dataTree && row.modules.dataTree.open){\r\n\t\t\t\t\tvar children = this.rowsToData(this.table.modules.dataTree.getFilteredTreeChildren(row));\r\n\t\t\t\t\tdata = data.concat(children);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//generate stats row\r\n\tgenerateRow(pos, data){\r\n\t\tvar rowData = this.generateRowData(pos, data),\r\n\t\trow;\r\n\r\n\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\tthis.table.modules.mutator.disable();\r\n\t\t}\r\n\r\n\t\trow = new Row(rowData, this, \"calc\");\r\n\r\n\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\tthis.table.modules.mutator.enable();\r\n\t\t}\r\n\r\n\t\trow.getElement().classList.add(\"tabulator-calcs\", \"tabulator-calcs-\" + pos);\r\n\r\n\t\trow.component = false;\r\n\r\n\t\trow.getComponent = () => {\r\n\t\t\tif(!row.component){\r\n\t\t\t\trow.component = new CalcComponent(row);\r\n\t\t\t}\r\n\r\n\t\t\treturn row.component;\r\n\t\t};\r\n\r\n\t\trow.generateCells = () => {\r\n\r\n\t\t\tvar cells = [];\r\n\r\n\t\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\r\n\t\t\t\t\t//set field name of mock column\r\n\t\t\t\t\tthis.genColumn.setField(column.getField());\r\n\t\t\t\t\tthis.genColumn.hozAlign = column.hozAlign;\r\n\r\n\t\t\t\t\tif(column.definition[pos + \"CalcFormatter\"] && this.table.modExists(\"format\")){\r\n\t\t\t\t\t\tthis.genColumn.modules.format = {\r\n\t\t\t\t\t\t\tformatter: this.table.modules.format.getFormatter(column.definition[pos + \"CalcFormatter\"]),\r\n\t\t\t\t\t\t\tparams: column.definition[pos + \"CalcFormatterParams\"] || {},\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.genColumn.modules.format = {\r\n\t\t\t\t\t\t\tformatter: this.table.modules.format.getFormatter(\"plaintext\"),\r\n\t\t\t\t\t\t\tparams:{}\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//ensure css class defintion is replicated to calculation cell\r\n\t\t\t\t\tthis.genColumn.definition.cssClass = column.definition.cssClass;\r\n\r\n\t\t\t\t\t//generate cell and assign to correct column\r\n\t\t\t\t\tvar cell = new Cell(this.genColumn, row);\r\n\t\t\t\t\tcell.getElement();\r\n\t\t\t\t\tcell.column = column;\r\n\t\t\t\t\tcell.setWidth();\r\n\r\n\t\t\t\t\tcolumn.cells.push(cell);\r\n\t\t\t\t\tcells.push(cell);\r\n\r\n\t\t\t\t\tif(!column.visible){\r\n\t\t\t\t\t\tcell.hide();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\trow.cells = cells;\r\n\t\t};\r\n\r\n\t\treturn row;\r\n\t}\r\n\r\n\t//generate stats row\r\n\tgenerateRowData(pos, data){\r\n\t\tvar rowData = {},\r\n\t\tcalcs = pos == \"top\" ? this.topCalcs : this.botCalcs,\r\n\t\ttype = pos == \"top\" ? \"topCalc\" : \"botCalc\",\r\n\t\tparams, paramKey;\r\n\r\n\t\tcalcs.forEach(function(column){\r\n\t\t\tvar values = [];\r\n\r\n\t\t\tif(column.modules.columnCalcs && column.modules.columnCalcs[type]){\r\n\t\t\t\tdata.forEach(function(item){\r\n\t\t\t\t\tvalues.push(column.getFieldValue(item));\r\n\t\t\t\t});\r\n\r\n\t\t\t\tparamKey = type + \"Params\";\r\n\t\t\t\tparams = typeof column.modules.columnCalcs[paramKey] === \"function\" ? column.modules.columnCalcs[paramKey](values, data) : column.modules.columnCalcs[paramKey];\r\n\r\n\t\t\t\tcolumn.setFieldValue(rowData, column.modules.columnCalcs[type](values, data, params));\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowData;\r\n\t}\r\n\r\n\thasTopCalcs(){\r\n\t\treturn\t!!(this.topCalcs.length);\r\n\t}\r\n\r\n\thasBottomCalcs(){\r\n\t\treturn\t!!(this.botCalcs.length);\r\n\t}\r\n\r\n\t//handle table redraw\r\n\tredraw(){\r\n\t\tif(this.topRow){\r\n\t\t\tthis.topRow.normalizeHeight(true);\r\n\t\t}\r\n\t\tif(this.botRow){\r\n\t\t\tthis.botRow.normalizeHeight(true);\r\n\t\t}\r\n\t}\r\n\r\n\t//return the calculated\r\n\tgetResults(){\r\n\t\tvar results = {},\r\n\t\tgroups;\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tgroups = this.table.modules.groupRows.getGroups(true);\r\n\r\n\t\t\tgroups.forEach((group) => {\r\n\t\t\t\tresults[group.getKey()] = this.getGroupResults(group);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tresults = {\r\n\t\t\t\ttop: this.topRow ? this.topRow.getData() : {},\r\n\t\t\t\tbottom: this.botRow ? this.botRow.getData() : {},\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\t//get results from a group\r\n\tgetGroupResults(group){\r\n\t\tvar groupObj = group._getSelf(),\r\n\t\tsubGroups = group.getSubGroups(),\r\n\t\tsubGroupResults = {},\r\n\t\tresults = {};\r\n\r\n\t\tsubGroups.forEach((subgroup) => {\r\n\t\t\tsubGroupResults[subgroup.getKey()] = this.getGroupResults(subgroup);\r\n\t\t});\r\n\r\n\t\tresults = {\r\n\t\t\ttop: groupObj.calcs.top ? groupObj.calcs.top.getData() : {},\r\n\t\t\tbottom: groupObj.calcs.bottom ? groupObj.calcs.bottom.getData() : {},\r\n\t\t\tgroups: subGroupResults,\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n}\r\n\r\nColumnCalcs.moduleName = \"columnCalcs\";\r\n\r\n//load defaults\r\nColumnCalcs.calculations = defaultCalculations;\r\n\r\nexport default ColumnCalcs;","import Module from '../../core/Module.js';\r\n\r\nimport Row from '../../core/row/Row.js';\r\n\r\nclass DataTree extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.indent = 10;\r\n\t\tthis.field = \"\";\r\n\t\tthis.collapseEl = null;\r\n\t\tthis.expandEl = null;\r\n\t\tthis.branchEl = null;\r\n\t\tthis.elementField = false;\r\n\r\n\t\tthis.startOpen = function(){};\r\n\r\n\t\tthis.displayIndex = 0;\r\n\r\n\t\tthis.registerTableOption(\"dataTree\", false); //enable data tree\r\n\t\tthis.registerTableOption(\"dataTreeFilter\", true); //filter child rows\r\n\t\tthis.registerTableOption(\"dataTreeSort\", true); //sort child rows\r\n\t\tthis.registerTableOption(\"dataTreeElementColumn\", false);\r\n\t\tthis.registerTableOption(\"dataTreeBranchElement\", true);//show data tree branch element\r\n\t\tthis.registerTableOption(\"dataTreeChildIndent\", 9); //data tree child indent in px\r\n\t\tthis.registerTableOption(\"dataTreeChildField\", \"_children\");//data tre column field to look for child rows\r\n\t\tthis.registerTableOption(\"dataTreeCollapseElement\", false);//data tree row collapse element\r\n\t\tthis.registerTableOption(\"dataTreeExpandElement\", false);//data tree row expand element\r\n\t\tthis.registerTableOption(\"dataTreeStartExpanded\", false);\r\n\t\tthis.registerTableOption(\"dataTreeChildColumnCalcs\", false);//include visible data tree rows in column calculations\r\n\t\tthis.registerTableOption(\"dataTreeSelectPropagate\", false);//seleccting a parent row selects its children\r\n\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"treeCollapse\", this.collapseRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"treeExpand\", this.expandRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"treeToggle\", this.toggleRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"getTreeParent\", this.getTreeParent.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"getTreeChildren\", this.getRowChildren.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"addTreeChild\", this.addTreeChildRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isTreeExpanded\", this.isRowExpanded.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.dataTree){\r\n\t\t\tvar dummyEl = null,\r\n\t\t\toptions = this.table.options;\r\n\r\n\t\t\tthis.field = options.dataTreeChildField;\r\n\t\t\tthis.indent = options.dataTreeChildIndent;\r\n\r\n\t\t\tif(options.dataTreeBranchElement){\r\n\r\n\t\t\t\tif(options.dataTreeBranchElement === true){\r\n\t\t\t\t\tthis.branchEl = document.createElement(\"div\");\r\n\t\t\t\t\tthis.branchEl.classList.add(\"tabulator-data-tree-branch\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(typeof options.dataTreeBranchElement === \"string\"){\r\n\t\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\t\tdummyEl.innerHTML = options.dataTreeBranchElement;\r\n\t\t\t\t\t\tthis.branchEl = dummyEl.firstChild;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.branchEl = options.dataTreeBranchElement;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(options.dataTreeCollapseElement){\r\n\t\t\t\tif(typeof options.dataTreeCollapseElement === \"string\"){\r\n\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\tdummyEl.innerHTML = options.dataTreeCollapseElement;\r\n\t\t\t\t\tthis.collapseEl = dummyEl.firstChild;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.collapseEl = options.dataTreeCollapseElement;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.collapseEl = document.createElement(\"div\");\r\n\t\t\t\tthis.collapseEl.classList.add(\"tabulator-data-tree-control\");\r\n\t\t\t\tthis.collapseEl.tabIndex = 0;\r\n\t\t\t\tthis.collapseEl.innerHTML = \"
\";\r\n\t\t\t}\r\n\r\n\t\t\tif(options.dataTreeExpandElement){\r\n\t\t\t\tif(typeof options.dataTreeExpandElement === \"string\"){\r\n\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\tdummyEl.innerHTML = options.dataTreeExpandElement;\r\n\t\t\t\t\tthis.expandEl = dummyEl.firstChild;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.expandEl = options.dataTreeExpandElement;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.expandEl = document.createElement(\"div\");\r\n\t\t\t\tthis.expandEl.classList.add(\"tabulator-data-tree-control\");\r\n\t\t\t\tthis.expandEl.tabIndex = 0;\r\n\t\t\t\tthis.expandEl.innerHTML = \"
\";\r\n\t\t\t}\r\n\r\n\r\n\t\t\tswitch(typeof options.dataTreeStartExpanded){\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\tthis.startOpen = function(row, index){\r\n\t\t\t\t\treturn options.dataTreeStartExpanded;\r\n\t\t\t\t};\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tthis.startOpen = options.dataTreeStartExpanded;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\tthis.startOpen = function(row, index){\r\n\t\t\t\t\treturn options.dataTreeStartExpanded[index];\r\n\t\t\t\t};\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-layout-after\", this.layoutRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowDelete.bind(this),0);\r\n\t\t\tthis.subscribe(\"row-data-changed\", this.rowDataChanged.bind(this), 10);\r\n\t\t\tthis.subscribe(\"cell-value-updated\", this.cellValueChanged.bind(this));\r\n\t\t\tthis.subscribe(\"edit-cancelled\", this.cellValueChanged.bind(this));\r\n\t\t\tthis.subscribe(\"column-moving-rows\", this.columnMoving.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.initializeElementField.bind(this));\r\n\t\t\tthis.subscribe(\"table-redrawing\", this.tableRedrawing.bind(this));\r\n\r\n\t\t\tthis.registerDisplayHandler(this.getRows.bind(this), 30);\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedrawing(force){\r\n\t\tvar rows;\r\n\r\n\t\tif(force){\r\n\t\t\trows = this.table.rowManager.getRows();\r\n\t\t\t\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.reinitializeRowChildren(row);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeElementField(){\r\n\t\tvar firstCol = this.table.columnManager.getFirstVisibleColumn();\r\n\r\n\t\tthis.elementField = this.table.options.dataTreeElementColumn || (firstCol ? firstCol.field : false);\r\n\t}\r\n\t\r\n\tgetRowChildren(row){\r\n\t\treturn this.getTreeChildren(row, true);\r\n\t}\r\n\r\n\tcolumnMoving(){\r\n\t\tvar rows = [];\r\n\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\trows = rows.concat(this.getTreeChildren(row, false, true));\r\n\t\t});\r\n\r\n\t\treturn rows;\r\n\t}\r\n\r\n\trowDataChanged(row, visible, updatedData){\r\n\t\tif(this.redrawNeeded(updatedData)){\r\n\t\t\tthis.initializeRow(row);\r\n\r\n\t\t\tif(visible){\r\n\t\t\t\tthis.layoutRow(row);\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tcellValueChanged(cell){\r\n\t\tvar field = cell.column.getField();\r\n\r\n\t\tif(field === this.elementField){\r\n\t\t\tthis.layoutRow(cell.row);\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar childArray = row.getData()[this.field];\r\n\t\tvar isArray = Array.isArray(childArray);\r\n\r\n\t\tvar children = isArray || (!isArray && typeof childArray === \"object\" && childArray !== null);\r\n\r\n\t\tif(!children && row.modules.dataTree && row.modules.dataTree.branchEl){\r\n\t\t\trow.modules.dataTree.branchEl.parentNode.removeChild(row.modules.dataTree.branchEl);\r\n\t\t}\r\n\r\n\t\tif(!children && row.modules.dataTree && row.modules.dataTree.controlEl){\r\n\t\t\trow.modules.dataTree.controlEl.parentNode.removeChild(row.modules.dataTree.controlEl);\r\n\t\t}\r\n\r\n\t\trow.modules.dataTree = {\r\n\t\t\tindex: row.modules.dataTree ? row.modules.dataTree.index : 0,\r\n\t\t\topen: children ? (row.modules.dataTree ? row.modules.dataTree.open : this.startOpen(row.getComponent(), 0)) : false,\r\n\t\t\tcontrolEl: row.modules.dataTree && children ? row.modules.dataTree.controlEl : false,\r\n\t\t\tbranchEl: row.modules.dataTree && children ? row.modules.dataTree.branchEl : false,\r\n\t\t\tparent: row.modules.dataTree ? row.modules.dataTree.parent : false,\r\n\t\t\tchildren:children,\r\n\t\t};\r\n\t}\r\n\r\n\treinitializeRowChildren(row){\r\n\t\tvar children = this.getTreeChildren(row, false, true);\r\n\r\n\t\tchildren.forEach(function(child){\r\n\t\t\tchild.reinitialize(true);\r\n\t\t});\r\n\t}\r\n\r\n\tlayoutRow(row){\r\n\t\tvar cell = this.elementField ? row.getCell(this.elementField) : row.getCells()[0],\r\n\t\tel = cell.getElement(),\r\n\t\tconfig = row.modules.dataTree;\r\n\r\n\t\tif(config.branchEl){\r\n\t\t\tif(config.branchEl.parentNode){\r\n\t\t\t\tconfig.branchEl.parentNode.removeChild(config.branchEl);\r\n\t\t\t}\r\n\t\t\tconfig.branchEl = false;\r\n\t\t}\r\n\r\n\t\tif(config.controlEl){\r\n\t\t\tif(config.controlEl.parentNode){\r\n\t\t\t\tconfig.controlEl.parentNode.removeChild(config.controlEl);\r\n\t\t\t}\r\n\t\t\tconfig.controlEl = false;\r\n\t\t}\r\n\r\n\t\tthis.generateControlElement(row, el);\r\n\r\n\t\trow.getElement().classList.add(\"tabulator-tree-level-\" + config.index);\r\n\r\n\t\tif(config.index){\r\n\t\t\tif(this.branchEl){\r\n\t\t\t\tconfig.branchEl = this.branchEl.cloneNode(true);\r\n\t\t\t\tel.insertBefore(config.branchEl, el.firstChild);\r\n\r\n\t\t\t\tif(this.table.rtl){\r\n\t\t\t\t\tconfig.branchEl.style.marginRight = (((config.branchEl.offsetWidth + config.branchEl.style.marginLeft) * (config.index - 1)) + (config.index * this.indent)) + \"px\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconfig.branchEl.style.marginLeft = (((config.branchEl.offsetWidth + config.branchEl.style.marginRight) * (config.index - 1)) + (config.index * this.indent)) + \"px\";\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\r\n\t\t\t\tif(this.table.rtl){\r\n\t\t\t\t\tel.style.paddingRight = parseInt(window.getComputedStyle(el, null).getPropertyValue('padding-right')) + (config.index * this.indent) + \"px\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.style.paddingLeft = parseInt(window.getComputedStyle(el, null).getPropertyValue('padding-left')) + (config.index * this.indent) + \"px\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateControlElement(row, el){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\tel = el || row.getCells()[0].getElement(),\r\n\t\toldControl = config.controlEl;\r\n\r\n\t\tif(config.children !== false){\r\n\r\n\t\t\tif(config.open){\r\n\t\t\t\tconfig.controlEl = this.collapseEl.cloneNode(true);\r\n\t\t\t\tconfig.controlEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\tthis.collapseRow(row);\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconfig.controlEl = this.expandEl.cloneNode(true);\r\n\t\t\t\tconfig.controlEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\tthis.expandRow(row);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tconfig.controlEl.addEventListener(\"mousedown\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t});\r\n\r\n\t\t\tif(oldControl && oldControl.parentNode === el){\r\n\t\t\t\toldControl.parentNode.replaceChild(config.controlEl,oldControl);\r\n\t\t\t}else{\r\n\t\t\t\tel.insertBefore(config.controlEl, el.firstChild);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tsetDisplayIndex (index) {\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\r\n\tgetDisplayIndex () {\r\n\t\treturn this.displayIndex;\r\n\t}\r\n\r\n\tgetRows(rows){\r\n\t\tvar output = [];\r\n\r\n\t\trows.forEach((row, i) => {\r\n\t\t\tvar config, children;\r\n\r\n\t\t\toutput.push(row);\r\n\r\n\t\t\tif(row instanceof Row){\r\n\r\n\t\t\t\trow.create();\r\n\r\n\t\t\t\tconfig = row.modules.dataTree.children;\r\n\r\n\t\t\t\tif(!config.index && config.children !== false){\r\n\t\t\t\t\tchildren = this.getChildren(row);\r\n\r\n\t\t\t\t\tchildren.forEach((child) => {\r\n\t\t\t\t\t\tchild.create();\r\n\t\t\t\t\t\toutput.push(child);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetChildren(row, allChildren){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\tchildren = [],\r\n\t\toutput = [];\r\n\r\n\t\tif(config.children !== false && (config.open || allChildren)){\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"filter\") && this.table.options.dataTreeFilter){\r\n\t\t\t\tchildren = this.table.modules.filter.filter(config.children);\r\n\t\t\t}else{\r\n\t\t\t\tchildren = config.children;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"sort\") && this.table.options.dataTreeSort){\r\n\t\t\t\tthis.table.modules.sort.sort(children);\r\n\t\t\t}\r\n\r\n\t\t\tchildren.forEach((child) => {\r\n\t\t\t\toutput.push(child);\r\n\r\n\t\t\t\tvar subChildren = this.getChildren(child);\r\n\r\n\t\t\t\tsubChildren.forEach((sub) => {\r\n\t\t\t\t\toutput.push(sub);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgenerateChildren(row){\r\n\t\tvar children = [];\r\n\r\n\t\tvar childArray = row.getData()[this.field];\r\n\r\n\t\tif(!Array.isArray(childArray)){\r\n\t\t\tchildArray = [childArray];\r\n\t\t}\r\n\r\n\t\tchildArray.forEach((childData) => {\r\n\t\t\tvar childRow = new Row(childData || {}, this.table.rowManager);\r\n\r\n\t\t\tchildRow.create();\r\n\r\n\t\t\tchildRow.modules.dataTree.index = row.modules.dataTree.index + 1;\r\n\t\t\tchildRow.modules.dataTree.parent = row;\r\n\r\n\t\t\tif(childRow.modules.dataTree.children){\r\n\t\t\t\tchildRow.modules.dataTree.open = this.startOpen(childRow.getComponent(), childRow.modules.dataTree.index);\r\n\t\t\t}\r\n\t\t\tchildren.push(childRow);\r\n\t\t});\r\n\r\n\t\treturn children;\r\n\t}\r\n\r\n\texpandRow(row, silent){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tconfig.open = true;\r\n\r\n\t\t\trow.reinitialize();\r\n\r\n\t\t\tthis.refreshData(true);\r\n\r\n\t\t\tthis.dispatchExternal(\"dataTreeRowExpanded\", row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\t}\r\n\r\n\tcollapseRow(row){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tconfig.open = false;\r\n\r\n\t\t\trow.reinitialize();\r\n\r\n\t\t\tthis.refreshData(true);\r\n\r\n\t\t\tthis.dispatchExternal(\"dataTreeRowCollapsed\", row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\t}\r\n\r\n\ttoggleRow(row){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tif(config.open){\r\n\t\t\t\tthis.collapseRow(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.expandRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tisRowExpanded(row){\r\n\t\treturn row.modules.dataTree.open;\r\n\t}\r\n\r\n\tgetTreeParent(row){\r\n\t\treturn row.modules.dataTree.parent ? row.modules.dataTree.parent.getComponent() : false;\r\n\t}\r\n\r\n\tgetTreeParentRoot(row){\r\n\t\treturn row.modules.dataTree.parent ? this.getTreeParentRoot(row.modules.dataTree.parent) : row;\r\n\t}\r\n\r\n\tgetFilteredTreeChildren(row){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\toutput = [], children;\r\n\r\n\t\tif(config.children){\r\n\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"filter\") && this.table.options.dataTreeFilter){\r\n\t\t\t\tchildren = this.table.modules.filter.filter(config.children);\r\n\t\t\t}else{\r\n\t\t\t\tchildren = config.children;\r\n\t\t\t}\r\n\r\n\t\t\tchildren.forEach((childRow) => {\r\n\t\t\t\tif(childRow instanceof Row){\r\n\t\t\t\t\toutput.push(childRow);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\trowDelete(row){\r\n\t\tvar parent = row.modules.dataTree.parent,\r\n\t\tchildIndex;\r\n\r\n\t\tif(parent){\r\n\t\t\tchildIndex = this.findChildIndex(row, parent);\r\n\r\n\t\t\tif(childIndex !== false){\r\n\t\t\t\tparent.data[this.field].splice(childIndex, 1);\r\n\t\t\t}\r\n\r\n\t\t\tif(!parent.data[this.field].length){\r\n\t\t\t\tdelete parent.data[this.field];\r\n\t\t\t}\r\n\r\n\t\t\tthis.initializeRow(parent);\r\n\t\t\tthis.layoutRow(parent);\r\n\t\t}\r\n\r\n\t\tthis.refreshData(true);\r\n\t}\r\n\r\n\taddTreeChildRow(row, data, top, index){\r\n\t\tvar childIndex = false;\r\n\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\r\n\t\tif(!Array.isArray(row.data[this.field])){\r\n\t\t\trow.data[this.field] = [];\r\n\r\n\t\t\trow.modules.dataTree.open = this.startOpen(row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\r\n\t\tif(typeof index !== \"undefined\"){\r\n\t\t\tchildIndex = this.findChildIndex(index, row);\r\n\r\n\t\t\tif(childIndex !== false){\r\n\t\t\t\trow.data[this.field].splice((top ? childIndex : childIndex + 1), 0, data);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(childIndex === false){\r\n\t\t\tif(top){\r\n\t\t\t\trow.data[this.field].unshift(data);\r\n\t\t\t}else{\r\n\t\t\t\trow.data[this.field].push(data);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.initializeRow(row);\r\n\t\tthis.layoutRow(row);\r\n\r\n\t\tthis.refreshData(true);\r\n\t}\r\n\r\n\tfindChildIndex(subject, parent){\r\n\t\tvar match = false;\r\n\r\n\t\tif(typeof subject == \"object\"){\r\n\r\n\t\t\tif(subject instanceof Row){\r\n\t\t\t\t//subject is row element\r\n\t\t\t\tmatch = subject.data;\r\n\t\t\t}else if(subject instanceof RowComponent){\r\n\t\t\t\t//subject is public row component\r\n\t\t\t\tmatch = subject._getSelf().data;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\t\t\t\tif(parent.modules.dataTree){\r\n\t\t\t\t\tmatch = parent.modules.dataTree.children.find((childRow) => {\r\n\t\t\t\t\t\treturn childRow instanceof Row ? childRow.element === subject : false;\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(match){\r\n\t\t\t\t\t\tmatch = match.data;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}else if(typeof subject == \"undefined\" || subject === null){\r\n\t\t\tmatch = false\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the index of the row\r\n\t\t\tmatch = parent.data[this.field].find((row) => {\r\n\t\t\t\treturn row.data[this.table.options.index] == subject;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(match){\r\n\r\n\t\t\tif(Array.isArray(parent.data[this.field])){\r\n\t\t\t\tmatch = parent.data[this.field].indexOf(match);\r\n\t\t\t}\r\n\r\n\t\t\tif(match == -1){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//catch all for any other type of input\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tgetTreeChildren(row, component, recurse){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\toutput = [];\r\n\r\n\t\tif(config.children){\r\n\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tconfig.children.forEach((childRow) => {\r\n\t\t\t\tif(childRow instanceof Row){\r\n\t\t\t\t\toutput.push(component ? childRow.getComponent() : childRow);\r\n\r\n\t\t\t\t\tif(recurse){\r\n\t\t\t\t\t\toutput = output.concat(this.getTreeChildren(childRow, component, recurse));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetChildField(){\r\n\t\treturn this.field;\r\n\t}\r\n\r\n\tredrawNeeded(data){\r\n\t\treturn (this.field ? typeof data[this.field] !== \"undefined\" : false) || (this.elementField ? typeof data[this.elementField] !== \"undefined\" : false);\r\n\t}\r\n}\r\n\r\nDataTree.moduleName = \"dataTree\";\r\n\r\nexport default DataTree;","export default function(list, options, setFileContents){\r\n\tvar delimiter = options && options.delimiter ? options.delimiter : \",\",\r\n\tfileContents = [],\r\n\theaders = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tvar item = [];\r\n\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"group\":\r\n\t\t\tconsole.warn(\"Download Warning - CSV downloader cannot process row groups\");\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\tconsole.warn(\"Download Warning - CSV downloader cannot process column calculations\");\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"header\":\r\n\t\t\trow.columns.forEach((col, i) => {\r\n\t\t\t\tif(col && col.depth === 1){\r\n\t\t\t\t\theaders[i] = typeof col.value == \"undefined\" || col.value === null ? \"\" : ('\"' + String(col.value).split('\"').join('\"\"') + '\"');\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\trow.columns.forEach((col) => {\r\n\r\n\t\t\t\tif(col){\r\n\r\n\t\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\tcol.value = col.value !== null ? JSON.stringify(col.value) : \"\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\tcol.value = \"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\titem.push('\"' + String(col.value).split('\"').join('\"\"') + '\"');\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tfileContents.push(item.join(delimiter));\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(headers.length){\r\n\t\tfileContents.unshift(headers.join(delimiter));\r\n\t}\r\n\r\n\tfileContents = fileContents.join(\"\\n\");\r\n\r\n\tif(options.bom){\r\n\t\tfileContents = \"\\ufeff\" + fileContents;\r\n\t}\r\n\r\n\tsetFileContents(fileContents, \"text/csv\");\r\n};\r\n","export default function(list, options, setFileContents){\r\n\tvar fileContents = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tvar item = {};\r\n\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"header\":\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process row groups\");\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process column calculations\");\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\tif(col){\r\n\t\t\t\t\titem[col.component.getTitleDownload() || col.component.getField()] = col.value;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tfileContents.push(item);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tfileContents = JSON.stringify(fileContents, null, '\\t');\r\n\r\n\tsetFileContents(fileContents, \"application/json\");\r\n};","export default function(list, options, setFileContents){\r\n\tvar header = [],\r\n\tbody = [],\r\n\tautoTableParams = {},\r\n\trowGroupStyles = options.rowGroupStyles || {\r\n\t\tfontStyle: \"bold\",\r\n\t\tfontSize: 12,\r\n\t\tcellPadding: 6,\r\n\t\tfillColor: 220,\r\n\t},\r\n\trowCalcStyles = options.rowCalcStyles || {\r\n\t\tfontStyle: \"bold\",\r\n\t\tfontSize: 10,\r\n\t\tcellPadding: 4,\r\n\t\tfillColor: 232,\r\n\t},\r\n\tjsPDFParams = options.jsPDF || {},\r\n\ttitle = options && options.title ? options.title : \"\";\r\n\r\n\tif(!jsPDFParams.orientation){\r\n\t\tjsPDFParams.orientation = options.orientation || \"landscape\";\r\n\t}\r\n\r\n\tif(!jsPDFParams.unit){\r\n\t\tjsPDFParams.unit = \"pt\";\r\n\t}\r\n\r\n\t//parse row list\r\n\tlist.forEach((row) => {\r\n\t\tvar item = {};\r\n\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"header\":\r\n\t\t\theader.push(parseRow(row));\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\tbody.push(parseRow(row, rowGroupStyles));\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\tbody.push(parseRow(row, rowCalcStyles));\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\tbody.push(parseRow(row));\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tfunction parseRow(row, styles){\r\n\t\tvar rowData = [];\r\n\r\n\t\trow.columns.forEach((col) =>{\r\n\t\t\tvar cell;\r\n\r\n\t\t\tif(col){\r\n\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\tcol.value = col.value !== null ? JSON.stringify(col.value) : \"\";\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\tcol.value = \"\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcell = {\r\n\t\t\t\t\tcontent:col.value,\r\n\t\t\t\t\tcolSpan:col.width,\r\n\t\t\t\t\trowSpan:col.height,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tif(styles){\r\n\t\t\t\t\tcell.styles = styles;\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowData.push(cell);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowData;\r\n\t}\r\n\r\n\r\n\t//configure PDF\r\n\tvar doc = new jspdf.jsPDF(jsPDFParams); //set document to landscape, better for most tables\r\n\r\n\tif(options && options.autoTable){\r\n\t\tif(typeof options.autoTable === \"function\"){\r\n\t\t\tautoTableParams = options.autoTable(doc) || {};\r\n\t\t}else{\r\n\t\t\tautoTableParams = options.autoTable;\r\n\t\t}\r\n\t}\r\n\r\n\tif(title){\r\n\t\tautoTableParams.didDrawPage = function(data) {\r\n\t\t\tdoc.text(title, 40, 30);\r\n\t\t};\r\n\t}\r\n\r\n\tautoTableParams.head = header;\r\n\tautoTableParams.body = body;\r\n\r\n\tdoc.autoTable(autoTableParams);\r\n\r\n\tif(options && options.documentProcessing){\r\n\t\toptions.documentProcessing(doc);\r\n\t}\r\n\r\n\tsetFileContents(doc.output(\"arraybuffer\"), \"application/pdf\");\r\n};\r\n","import CoreFeature from '../../../../core/CoreFeature.js';\r\n\r\nexport default function(list, options, setFileContents){\r\n\tvar self = this,\r\n\tsheetName = options.sheetName || \"Sheet1\",\r\n\tworkbook = XLSX.utils.book_new(),\r\n\ttableFeatures = new CoreFeature(this),\r\n\toutput;\r\n\r\n\tworkbook.SheetNames = [];\r\n\tworkbook.Sheets = {};\r\n\r\n\tfunction generateSheet(){\r\n\t\tvar rows = [],\r\n\t\tmerges = [],\r\n\t\tworksheet = {},\r\n\t\trange = {s: {c:0, r:0}, e: {c:(list[0] ? list[0].columns.reduce((a, b) => a + (b && b.width ? b.width : 1), 0) : 0), r:list.length }};\r\n\r\n\t\t//parse row list\r\n\t\tlist.forEach((row, i) => {\r\n\t\t\tvar rowData = [];\r\n\r\n\t\t\trow.columns.forEach(function(col, j){\r\n\r\n\t\t\t\tif(col){\r\n\t\t\t\t\trowData.push(!(col.value instanceof Date) && typeof col.value === \"object\" ? JSON.stringify(col.value) : col.value);\r\n\r\n\t\t\t\t\tif(col.width > 1 || col.height > -1){\r\n\t\t\t\t\t\tif(col.height > 1 || col.width > 1){\r\n\t\t\t\t\t\t\tmerges.push({s:{r:i,c:j},e:{r:i + col.height - 1,c:j + col.width - 1}});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\trowData.push(\"\");\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trows.push(rowData);\r\n\t\t});\r\n\r\n\t\t//convert rows to worksheet\r\n\t\tXLSX.utils.sheet_add_aoa(worksheet, rows);\r\n\r\n\t\tworksheet['!ref'] = XLSX.utils.encode_range(range);\r\n\r\n\t\tif(merges.length){\r\n\t\t\tworksheet[\"!merges\"] = merges;\r\n\t\t}\r\n\r\n\t\treturn worksheet;\r\n\t}\r\n\r\n\tif(options.sheetOnly){\r\n\t\tsetFileContents(generateSheet());\r\n\t\treturn;\r\n\t}\r\n\r\n\tif(options.sheets){\r\n\t\tfor(var sheet in options.sheets){\r\n\r\n\t\t\tif(options.sheets[sheet] === true){\r\n\t\t\t\tworkbook.SheetNames.push(sheet);\r\n\t\t\t\tworkbook.Sheets[sheet] = generateSheet();\r\n\t\t\t}else{\r\n\r\n\t\t\t\tworkbook.SheetNames.push(sheet);\r\n\r\n\t\t\t\ttableFeatures.commsSend(options.sheets[sheet], \"download\", \"intercept\",{\r\n\t\t\t\t\ttype:\"xlsx\",\r\n\t\t\t\t\toptions:{sheetOnly:true},\r\n\t\t\t\t\tactive:self.active,\r\n\t\t\t\t\tintercept:function(data){\r\n\t\t\t\t\t\tworkbook.Sheets[sheet] = data;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tworkbook.SheetNames.push(sheetName);\r\n\t\tworkbook.Sheets[sheetName] = generateSheet();\r\n\t}\r\n\r\n\tif(options.documentProcessing){\r\n\t\tworkbook = options.documentProcessing(workbook);\r\n\t}\r\n\r\n\t//convert workbook to binary array\r\n\tfunction s2ab(s) {\r\n\t\tvar buf = new ArrayBuffer(s.length);\r\n\t\tvar view = new Uint8Array(buf);\r\n\t\tfor (var i=0; i!=s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;\r\n\t\t\treturn buf;\r\n\t}\r\n\r\n\toutput = XLSX.write(workbook, {bookType:'xlsx', bookSST:true, type: 'binary'});\r\n\r\n\tsetFileContents(s2ab(output), \"application/octet-stream\");\r\n};","export default function(list, options, setFileContents){\r\n\tif(this.modExists(\"export\", true)){\r\n\t\tsetFileContents(this.modules.export.genereateHTMLTable(list), \"text/html\");\r\n\t}\r\n};","export default function (list, options, setFileContents) {\r\n\tconst fileContents = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tconst item = {};\r\n\r\n\t\tswitch (row.type) {\r\n\t\t\tcase \"header\":\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process row groups\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process column calculations\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\t\tif (col) {\r\n\t\t\t\t\t\titem[col.component.getTitleDownload() || col.component.getField()] = col.value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tfileContents.push(JSON.stringify(item));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tsetFileContents(fileContents.join(\"\\n\"), \"application/x-ndjson\");\r\n};","import csv from './downloaders/csv.js';\r\nimport json from './downloaders/json.js';\r\nimport pdf from './downloaders/pdf.js';\r\nimport xlsx from './downloaders/xlsx.js';\r\nimport html from './downloaders/html.js';\r\nimport jsonLines from './downloaders/jsonLines.js';\r\n\r\nexport default {\r\n\tcsv:csv,\r\n\tjson:json,\r\n\tjsonLines:jsonLines,\r\n\tpdf:pdf,\r\n\txlsx:xlsx,\r\n\thtml:html,\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultDownloaders from './defaults/downloaders.js';\r\n\r\nclass Download extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.registerTableOption(\"downloadReady\", function(data, blob){return blob;}); //function to manipulate download data\r\n\t\tthis.registerTableOption(\"downloadConfig\", {}); //download config\r\n\t\tthis.registerTableOption(\"downloadRowRange\", \"active\"); //restrict download to active rows only\r\n\r\n\t\tthis.registerColumnOption(\"download\");\r\n\t\tthis.registerColumnOption(\"titleDownload\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"download\", this.download.bind(this));\r\n\t\tthis.registerTableFunction(\"downloadToTab\", this.downloadToTab.bind(this));\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tdownloadToTab(type, filename, options, active){\r\n\t\tthis.download(type, filename, options, active, true);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\t//trigger file download\r\n\tdownload(type, filename, options, range, interceptCallback){\r\n\t\tvar downloadFunc = false;\r\n\r\n\t\tfunction buildLink(data, mime){\r\n\t\t\tif(interceptCallback){\r\n\t\t\t\tif(interceptCallback === true){\r\n\t\t\t\t\tthis.triggerDownload(data, mime, type, filename, true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tinterceptCallback(data);\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tthis.triggerDownload(data, mime, type, filename);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(typeof type == \"function\"){\r\n\t\t\tdownloadFunc = type;\r\n\t\t}else{\r\n\t\t\tif(Download.downloaders[type]){\r\n\t\t\t\tdownloadFunc = Download.downloaders[type];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Download Error - No such download type found: \", type);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(downloadFunc){\r\n\t\t\tvar list = this.generateExportList(range);\r\n\r\n\t\t\tdownloadFunc.call(this.table, list , options || {}, buildLink.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateExportList(range){\r\n\t\tvar list = this.table.modules.export.generateExportList(this.table.options.downloadConfig, false, range || this.table.options.downloadRowRange, \"download\");\r\n\r\n\t\t//assign group header formatter\r\n\t\tvar groupHeader = this.table.options.groupHeaderDownload;\r\n\r\n\t\tif(groupHeader && !Array.isArray(groupHeader)){\r\n\t\t\tgroupHeader = [groupHeader];\r\n\t\t}\r\n\r\n\t\tlist.forEach((row) => {\r\n\t\t\tvar group;\r\n\r\n\t\t\tif(row.type === \"group\"){\r\n\t\t\t\tgroup = row.columns[0];\r\n\r\n\t\t\t\tif(groupHeader && groupHeader[row.indent]){\r\n\t\t\t\t\tgroup.value = groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn list;\r\n\t}\r\n\r\n\ttriggerDownload(data, mime, type, filename, newTab){\r\n\t\tvar element = document.createElement('a'),\r\n\t\tblob = new Blob([data],{type:mime}),\r\n\t\tfilename = filename || \"Tabulator.\" + (typeof type === \"function\" ? \"txt\" : type);\r\n\r\n\t\tblob = this.table.options.downloadReady(data, blob);\r\n\r\n\t\tif(blob){\r\n\r\n\t\t\tif(newTab){\r\n\t\t\t\twindow.open(window.URL.createObjectURL(blob));\r\n\t\t\t}else{\r\n\t\t\t\tif(navigator.msSaveOrOpenBlob){\r\n\t\t\t\t\tnavigator.msSaveOrOpenBlob(blob, filename);\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.setAttribute('href', window.URL.createObjectURL(blob));\r\n\r\n\t\t\t\t\t//set file title\r\n\t\t\t\t\telement.setAttribute('download', filename);\r\n\r\n\t\t\t\t\t//trigger download\r\n\t\t\t\t\telement.style.display = 'none';\r\n\t\t\t\t\tdocument.body.appendChild(element);\r\n\t\t\t\t\telement.click();\r\n\r\n\t\t\t\t\t//remove temporary link element\r\n\t\t\t\t\tdocument.body.removeChild(element);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"downloadComplete\");\r\n\t\t}\r\n\t}\r\n\r\n\tcommsReceived(table, action, data){\r\n\t\tswitch(action){\r\n\t\t\tcase \"intercept\":\r\n\t\t\tthis.download(data.type, \"\", data.options, data.active, data.intercept);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nDownload.moduleName = \"download\";\r\n\r\n//load defaults\r\nDownload.downloaders = defaultDownloaders;\r\n\r\nexport default Download;","export default function maskInput(el, options){\r\n\tvar mask = options.mask,\r\n\tmaskLetter = typeof options.maskLetterChar !== \"undefined\" ? options.maskLetterChar : \"A\",\r\n\tmaskNumber = typeof options.maskNumberChar !== \"undefined\" ? options.maskNumberChar : \"9\",\r\n\tmaskWildcard = typeof options.maskWildcardChar !== \"undefined\" ? options.maskWildcardChar : \"*\",\r\n\tsuccess = false;\r\n\r\n\tfunction fillSymbols(index){\r\n\t\tvar symbol = mask[index];\r\n\t\tif(typeof symbol !== \"undefined\" && symbol !== maskWildcard && symbol !== maskLetter && symbol !== maskNumber){\r\n\t\t\tel.value = el.value + \"\" + symbol;\r\n\t\t\tfillSymbols(index+1);\r\n\t\t}\r\n\t}\r\n\r\n\tel.addEventListener(\"keydown\", (e) => {\r\n\t\tvar index = el.value.length,\r\n\t\tchar = e.key;\r\n\r\n\t\tif(e.keyCode > 46){\r\n\t\t\tif(index >= mask.length){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tsuccess = false;\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\tswitch(mask[index]){\r\n\t\t\t\t\tcase maskLetter:\r\n\t\t\t\t\tif(char.toUpperCase() == char.toLowerCase()){\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\tsuccess = false;\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase maskNumber:\r\n\t\t\t\t\tif(isNaN(char)){\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\tsuccess = false;\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase maskWildcard:\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\tif(char !== mask[index]){\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\tsuccess = false;\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tsuccess = true;\r\n\t\t}\r\n\r\n\t\treturn;\r\n\t});\r\n\r\n\tel.addEventListener(\"keyup\", (e) => {\r\n\t\tif(e.keyCode > 46){\r\n\t\t\tif(options.maskAutoFill){\r\n\t\t\t\tfillSymbols(el.value.length);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\r\n\tif(!el.placeholder){\r\n\t\tel.placeholder = mask;\r\n\t}\r\n\r\n\tif(options.maskAutoFill){\r\n\t\tfillSymbols(el.value.length);\r\n\t}\r\n}","import maskInput from '../../inputMask.js';\r\n\r\n//input element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\t//create and style input\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", editorParams.search ? \"search\" : \"text\");\r\n\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = typeof cellValue !== \"undefined\" ? cellValue : \"\";\r\n\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\r\n\tfunction onChange(e){\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && input.value !== \"\") || input.value !== cellValue){\r\n\t\t\tif(success(input.value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t// case 9:\r\n\t\t\tcase 13:\r\n\t\t\tonChange(e);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\tcancel();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\te.stopPropagation();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(editorParams.mask){\r\n\t\tmaskInput(input, editorParams);\r\n\t}\r\n\r\n\treturn input;\r\n};","import maskInput from '../../inputMask.js';\r\n\r\n//resizable text area element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n var self = this,\r\n cellValue = cell.getValue(),\r\n vertNav = editorParams.verticalNavigation || \"hybrid\",\r\n value = String(cellValue !== null && typeof cellValue !== \"undefined\" ? cellValue : \"\"),\r\n count = (value.match(/(?:\\r\\n|\\r|\\n)/g) || []).length + 1,\r\n input = document.createElement(\"textarea\"),\r\n scrollHeight = 0;\r\n\r\n //create and style input\r\n input.style.display = \"block\";\r\n input.style.padding = \"2px\";\r\n input.style.height = \"100%\";\r\n input.style.width = \"100%\";\r\n input.style.boxSizing = \"border-box\";\r\n input.style.whiteSpace = \"pre-wrap\";\r\n input.style.resize = \"none\";\r\n\r\n if(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n for (let key in editorParams.elementAttributes){\r\n if(key.charAt(0) == \"+\"){\r\n key = key.slice(1);\r\n input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n }else{\r\n input.setAttribute(key, editorParams.elementAttributes[key]);\r\n }\r\n }\r\n }\r\n\r\n input.value = value;\r\n\r\n onRendered(function(){\r\n input.focus({preventScroll: true});\r\n input.style.height = \"100%\";\r\n\r\n input.scrollHeight;\r\n input.style.height = input.scrollHeight + \"px\";\r\n cell.getRow().normalizeHeight();\r\n\r\n if(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n });\r\n\r\n function onChange(e){\r\n\r\n if(((cellValue === null || typeof cellValue === \"undefined\") && input.value !== \"\") || input.value !== cellValue){\r\n\r\n if(success(input.value)){\r\n cellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n }\r\n\r\n setTimeout(function(){\r\n cell.getRow().normalizeHeight();\r\n },300)\r\n }else{\r\n cancel();\r\n }\r\n }\r\n\r\n //submit new value on blur or change\r\n input.addEventListener(\"change\", onChange);\r\n input.addEventListener(\"blur\", onChange);\r\n\r\n input.addEventListener(\"keyup\", function(){\r\n\r\n input.style.height = \"\";\r\n\r\n var heightNow = input.scrollHeight;\r\n\r\n input.style.height = heightNow + \"px\";\r\n\r\n if(heightNow != scrollHeight){\r\n scrollHeight = heightNow;\r\n cell.getRow().normalizeHeight();\r\n }\r\n });\r\n\r\n input.addEventListener(\"keydown\", function(e){\r\n\r\n switch(e.keyCode){\r\n case 27:\r\n cancel();\r\n break;\r\n\r\n case 38: //up arrow\r\n if(vertNav == \"editor\" || (vertNav == \"hybrid\" && input.selectionStart)){\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n }\r\n\r\n break;\r\n\r\n case 40: //down arrow\r\n if(vertNav == \"editor\" || (vertNav == \"hybrid\" && input.selectionStart !== input.value.length)){\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n }\r\n break;\r\n\r\n case 35:\r\n case 36:\r\n e.stopPropagation();\r\n break;\r\n }\r\n });\r\n\r\n if(editorParams.mask){\r\n maskInput(input, editorParams);\r\n }\r\n\r\n return input;\r\n};","import maskInput from '../../inputMask.js';\r\n\r\n//input element with type of number\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar cellValue = cell.getValue(),\r\n\tvertNav = editorParams.verticalNavigation || \"editor\",\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", \"number\");\r\n\r\n\tif(typeof editorParams.max != \"undefined\"){\r\n\t\tinput.setAttribute(\"max\", editorParams.max);\r\n\t}\r\n\r\n\tif(typeof editorParams.min != \"undefined\"){\r\n\t\tinput.setAttribute(\"min\", editorParams.min);\r\n\t}\r\n\r\n\tif(typeof editorParams.step != \"undefined\"){\r\n\t\tinput.setAttribute(\"step\", editorParams.step);\r\n\t}\r\n\r\n\t//create and style input\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\r\n\tvar blurFunc = function(e){\r\n\t\tonChange();\r\n\t};\r\n\r\n\tonRendered(function () {\r\n\t\t//submit new value on blur\r\n\t\tinput.removeEventListener(\"blur\", blurFunc);\r\n\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\r\n\t\t//submit new value on blur\r\n\t\tinput.addEventListener(\"blur\", blurFunc);\r\n\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\r\n\tfunction onChange(){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(!isNaN(value) && value !==\"\"){\r\n\t\t\tvalue = Number(value);\r\n\t\t}\r\n\r\n\t\tif(value !== cellValue){\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 13:\r\n\t\t\t// case 9:\r\n\t\t\tonChange();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\tcancel();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 38: //up arrow\r\n\t\t\tcase 40: //down arrow\r\n\t\t\tif(vertNav == \"editor\"){\r\n\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\te.stopPropagation();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(editorParams.mask){\r\n\t\tmaskInput(input, editorParams);\r\n\t}\r\n\r\n\treturn input;\r\n};","//input element with type of number\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", \"range\");\r\n\r\n\tif (typeof editorParams.max != \"undefined\") {\r\n\t\tinput.setAttribute(\"max\", editorParams.max);\r\n\t}\r\n\r\n\tif (typeof editorParams.min != \"undefined\") {\r\n\t\tinput.setAttribute(\"min\", editorParams.min);\r\n\t}\r\n\r\n\tif (typeof editorParams.step != \"undefined\") {\r\n\t\tinput.setAttribute(\"step\", editorParams.step);\r\n\t}\r\n\r\n\t//create and style input\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\r\n\tonRendered(function () {\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\t});\r\n\r\n\tfunction onChange(){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(!isNaN(value) && value !==\"\"){\r\n\t\t\tvalue = Number(value);\r\n\t\t}\r\n\r\n\t\tif(value != cellValue){\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur\r\n\tinput.addEventListener(\"blur\", function(e){\r\n\t\tonChange();\r\n\t});\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 13:\r\n\t\t\t// case 9:\r\n\t\t\tonChange();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\tcancel();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\treturn input;\r\n};","import maskInput from './inputMask.js';\r\nimport urlBuilder from '../Ajax/defaults/urlGenerator.js';\r\n\r\nexport default class Edit{\r\n constructor(editor, cell, onRendered, success, cancel, editorParams){\r\n this.edit = editor;\r\n this.table = editor.table;\r\n this.cell = cell;\r\n this.params = this._initializeParams(editorParams);\r\n \r\n this.data = [];\r\n this.displayItems = [];\r\n this.currentItems = [];\r\n this.focusedItem = null;\r\n \r\n this.input = this._createInputElement();\r\n this.listEl = this._createListElement();\r\n \r\n this.initialValues = null; \r\n \r\n this.isFilter = !cell._getSelf;\r\n \r\n this.filterTimeout = null;\r\n this.filtered = false;\r\n this.typing = false;\r\n \r\n this.values = []; \r\n this.popup = null; \r\n \r\n this.listIteration = 0;\r\n \r\n this.blurable = true;\r\n \r\n this.actions = {\r\n success:success,\r\n cancel:cancel\r\n }\r\n \r\n this._deprecationCheck();\r\n this._initializeValue();\r\n \r\n onRendered(this._onRendered.bind(this));\r\n }\r\n \r\n _deprecationCheck(){\r\n if(this.params.listItemFormatter){\r\n console.warn(\"The listItemFormatter editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n }\r\n \r\n if(this.params.sortValuesList){\r\n console.warn(\"The sortValuesList editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n }\r\n \r\n if(this.params.searchFunc){\r\n console.warn(\"The searchFunc editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n }\r\n \r\n if(this.params.searchingPlaceholder){\r\n console.warn(\"The searchingPlaceholder editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n }\r\n }\r\n \r\n _initializeValue(){\r\n var initialValue = this.cell.getValue();\r\n \r\n if(typeof initialValue === \"undefined\" && typeof this.params.defaultValue !== \"undefined\"){\r\n initialValue = this.params.defaultValue;\r\n }\r\n \r\n this.initialValues = this.params.multiselect ? initialValue : [initialValue];\r\n \r\n if(this.isFilter){\r\n this.input.value = this.initialValues ? this.initialValues.join(\",\") : \"\";\r\n this.headerFilterInitialListGen(); \r\n }\r\n }\r\n \r\n _onRendered(){\r\n var cellEl = this.cell.getElement();\r\n \r\n function clickStop(e){\r\n e.stopPropagation();\r\n }\r\n \r\n this.input.style.height = \"100%\";\r\n this.input.focus({preventScroll: true});\r\n \r\n \r\n cellEl.addEventListener(\"click\", clickStop);\r\n \r\n setTimeout(() => {\r\n cellEl.removeEventListener(\"click\", clickStop);\r\n }, 1000)\r\n }\r\n \r\n _createListElement(){\r\n var listEl = document.createElement(\"div\");\r\n listEl.classList.add(\"tabulator-edit-list\");\r\n \r\n listEl.addEventListener(\"mousedown\", this._preventBlur.bind(this));\r\n listEl.addEventListener(\"keydown\", this._inputKeyDown.bind(this))\r\n \r\n return listEl;\r\n }\r\n \r\n _setListWidth(){\r\n var element = this.isFilter ? this.input : this.cell.getElement();\r\n \r\n this.listEl.style.minWidth = element.offsetWidth + \"px\";\r\n \r\n if(this.params.maxWidth){\r\n if(this.params.maxWidth === true){\r\n this.listEl.style.maxWidth = element.offsetWidth + \"px\";\r\n }else if(typeof this.params.maxWidth === \"number\"){\r\n this.listEl.style.maxWidth = this.params.maxWidth + \"px\";\r\n }else{\r\n this.listEl.style.maxWidth = this.params.maxWidth;\r\n }\r\n }\r\n \r\n }\r\n \r\n _createInputElement(){\r\n var attribs = this.params.elementAttributes;\r\n var input = document.createElement(\"input\");\r\n \r\n input.setAttribute(\"type\", this.params.clearable ? \"search\" : \"text\");\r\n \r\n input.style.padding = \"4px\";\r\n input.style.width = \"100%\";\r\n input.style.boxSizing = \"border-box\";\r\n \r\n if(!this.params.autocomplete){\r\n input.style.cursor = \"default\";\r\n input.style.caretColor = \"transparent\";\r\n // input.readOnly = (this.edit.currentCell != false);\r\n }\r\n \r\n if(attribs && typeof attribs == \"object\"){\r\n for (let key in attribs){\r\n if(key.charAt(0) == \"+\"){\r\n key = key.slice(1);\r\n input.setAttribute(key, input.getAttribute(key) + attribs[\"+\" + key]);\r\n }else{\r\n input.setAttribute(key, attribs[key]);\r\n }\r\n }\r\n }\r\n \r\n if(this.params.mask){\r\n maskInput(input, this.params);\r\n }\r\n \r\n this._bindInputEvents(input);\r\n \r\n return input;\r\n }\r\n \r\n _initializeParams(params){\r\n var valueKeys = [\"values\", \"valuesURL\", \"valuesLookup\"],\r\n valueCheck;\r\n\r\n params = Object.assign({}, params);\r\n \r\n params.verticalNavigation = params.verticalNavigation || \"editor\";\r\n params.placeholderLoading = typeof params.placeholderLoading === \"undefined\" ? \"Searching ...\" : params.placeholderLoading;\r\n params.placeholderEmpty = typeof params.placeholderEmpty === \"undefined\" ? \"No Results Found\" : params.placeholderEmpty;\r\n params.filterDelay = typeof params.filterDelay === \"undefined\" ? 300 : params.filterDelay;\r\n \r\n params.emptyValue = Object.keys(params).includes(\"emptyValue\") ? params.emptyValue : \"\";\r\n\r\n valueCheck = Object.keys(params).filter(key => valueKeys.includes(key)).length;\r\n\r\n if(!valueCheck){\r\n console.warn(\"list editor config error - either the values, valuesURL, or valuesLookup option must be set\")\r\n }else if(valueCheck > 1){\r\n console.warn(\"list editor config error - only one of the values, valuesURL, or valuesLookup options can be set on the same editor\")\r\n }\r\n \r\n if(params.autocomplete){\r\n if(params.multiselect){\r\n params.multiselect = false;\r\n console.warn(\"list editor config error - multiselect option is not available when autocomplete is enabled\")\r\n }\r\n }else{\r\n if(params.freetext){\r\n params.freetext = false;\r\n console.warn(\"list editor config error - freetext option is only available when autocomplete is enabled\");\r\n }\r\n \r\n if(params.filterFunc){\r\n params.filterFunc = false;\r\n console.warn(\"list editor config error - filterFunc option is only available when autocomplete is enabled\");\r\n }\r\n \r\n if(params.filterRemote){\r\n params.filterRemote = false;\r\n console.warn(\"list editor config error - filterRemote option is only available when autocomplete is enabled\");\r\n }\r\n \r\n if(params.mask){\r\n params.mask = false;\r\n console.warn(\"list editor config error - mask option is only available when autocomplete is enabled\");\r\n }\r\n \r\n if(params.allowEmpty){\r\n params.allowEmpty = false;\r\n console.warn(\"list editor config error - allowEmpty option is only available when autocomplete is enabled\");\r\n }\r\n \r\n if(params.listOnEmpty){\r\n params.listOnEmpty = false;\r\n console.warn(\"list editor config error - listOnEmpty option is only available when autocomplete is enabled\");\r\n }\r\n }\r\n \r\n if(params.filterRemote && !(typeof params.valuesLookup === \"function\" || typeof params.valuesURL)){\r\n params.filterRemote = false;\r\n console.warn(\"list editor config error - filterRemote option should only be used when values list is populated from a remote source\");\r\n }\r\n return params;\r\n }\r\n //////////////////////////////////////\r\n ////////// Event Handling ////////////\r\n //////////////////////////////////////\r\n \r\n _bindInputEvents(input){\r\n input.addEventListener(\"focus\", this._inputFocus.bind(this))\r\n input.addEventListener(\"click\", this._inputClick.bind(this))\r\n input.addEventListener(\"blur\", this._inputBlur.bind(this))\r\n input.addEventListener(\"keydown\", this._inputKeyDown.bind(this))\r\n input.addEventListener(\"search\", this._inputSearch.bind(this))\r\n \r\n if(this.params.autocomplete){\r\n input.addEventListener(\"keyup\", this._inputKeyUp.bind(this))\r\n }\r\n }\r\n \r\n \r\n _inputFocus(e){\r\n this.rebuildOptionsList();\r\n }\r\n \r\n _filter(){\r\n if(this.params.filterRemote){\r\n clearTimeout(this.filterTimeout);\r\n \r\n this.filterTimeout = setTimeout(() => {\r\n this.rebuildOptionsList();\r\n }, this.params.filterDelay);\r\n }else{\r\n this._filterList();\r\n }\r\n }\r\n \r\n _inputClick(e){\r\n e.stopPropagation();\r\n }\r\n \r\n _inputBlur(e){\r\n if(this.blurable && this.popup){\r\n this.popup.hide();\r\n }\r\n }\r\n \r\n _inputSearch(){\r\n this._clearChoices();\r\n }\r\n \r\n _inputKeyDown(e){\r\n switch(e.keyCode){\r\n \r\n case 38: //up arrow\r\n this._keyUp(e);\r\n break\r\n \r\n case 40: //down arrow\r\n this._keyDown(e);\r\n break;\r\n \r\n case 37: //left arrow\r\n case 39: //right arrow\r\n this._keySide(e);\r\n break;\r\n \r\n case 13: //enter\r\n this._keyEnter();\r\n break;\r\n \r\n case 27: //escape\r\n this._keyEsc();\r\n break;\r\n \r\n case 36: //home\r\n case 35: //end\r\n this._keyHomeEnd(e);\r\n break;\r\n \r\n case 9: //tab\r\n break;\r\n \r\n default:\r\n this._keySelectLetter(e);\r\n }\r\n }\r\n \r\n _inputKeyUp(e){\r\n switch(e.keyCode){\r\n case 38: //up arrow\r\n case 37: //left arrow\r\n case 39: //up arrow\r\n case 40: //right arrow\r\n case 13: //enter\r\n case 27: //escape\r\n break;\r\n \r\n default:\r\n this._keyAutoCompLetter(e);\r\n }\r\n }\r\n \r\n _preventBlur(){\r\n this.blurable = false;\r\n \r\n setTimeout(function(){\r\n this.blurable = true;\r\n }, 10);\r\n }\r\n \r\n //////////////////////////////////////\r\n //////// Keyboard Navigation /////////\r\n //////////////////////////////////////\r\n \r\n _keyUp(e){\r\n var index = this.displayItems.indexOf(this.focusedItem);\r\n \r\n if(this.params.verticalNavigation == \"editor\" || (this.params.verticalNavigation == \"hybrid\" && index)){\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n e.preventDefault();\r\n \r\n if(index > 0){\r\n this._focusItem(this.displayItems[index - 1]);\r\n }\r\n }\r\n }\r\n \r\n _keyDown(e){\r\n var index = this.displayItems.indexOf(this.focusedItem);\r\n \r\n if(this.params.verticalNavigation == \"editor\" || (this.params.verticalNavigation == \"hybrid\" && index < this.displayItems.length - 1)){\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n e.preventDefault();\r\n \r\n if(index < this.displayItems.length - 1){\r\n if(index == -1){\r\n this._focusItem(this.displayItems[0]);\r\n }else{\r\n this._focusItem(this.displayItems[index + 1]);\r\n }\r\n }\r\n }\r\n }\r\n \r\n _keySide(e){\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n e.preventDefault();\r\n }\r\n \r\n _keyEnter(e){\r\n if(this.focusedItem){\r\n this._chooseItem(this.focusedItem);\r\n }else{\r\n this._cancel();\r\n }\r\n }\r\n \r\n _keyEsc(e){\r\n this._cancel();\r\n }\r\n \r\n _keyHomeEnd(e){\r\n if(this.params.autocomplete){\r\n //prevent table navigation while using input element\r\n e.stopImmediatePropagation();\r\n }\r\n }\r\n \r\n _keySelectLetter(e){\r\n if(!this.params.autocomplete){\r\n // if(this.edit.currentCell === false){\r\n e.preventDefault();\r\n // }\r\n \r\n if(e.keyCode >= 38 && e.keyCode <= 90){\r\n this._scrollToValue(e.keyCode);\r\n }\r\n }\r\n }\r\n \r\n _keyAutoCompLetter(e){\r\n this._filter();\r\n this.typing = true;\r\n }\r\n \r\n \r\n _scrollToValue(char){\r\n clearTimeout(this.filterTimeout);\r\n \r\n var character = String.fromCharCode(char).toLowerCase();\r\n this.filterTerm += character.toLowerCase();\r\n \r\n var match = this.displayItems.find((item) => {\r\n return typeof item.label !== \"undefined\" && item.label.toLowerCase().startsWith(this.filterTerm);\r\n });\r\n \r\n if(match){\r\n this._focusItem(match);\r\n }\r\n \r\n this.filterTimeout = setTimeout(() => {\r\n this.filterTerm = \"\";\r\n }, 800)\r\n }\r\n \r\n _focusItem(item){\r\n if(this.focusedItem && this.focusedItem.element){\r\n this.focusedItem.element.classList.remove(\"focused\");\r\n }\r\n \r\n this.focusedItem = item;\r\n \r\n if(item && item.element){\r\n item.element.classList.add(\"focused\");\r\n item.element.scrollIntoView({behavior: 'smooth', block: 'nearest', inline: 'start'});\r\n }\r\n }\r\n \r\n \r\n //////////////////////////////////////\r\n /////// Data List Generation /////////\r\n //////////////////////////////////////\r\n headerFilterInitialListGen(){\r\n this._generateOptions(true);\r\n }\r\n \r\n rebuildOptionsList(){\r\n this._generateOptions()\r\n .then(this._sortOptions.bind(this))\r\n .then(this._buildList.bind(this))\r\n .then(this._showList.bind(this))\r\n .catch((e) => {\r\n if(!Number.isInteger(e)){\r\n console.error(\"List generation error\", e);\r\n }\r\n })\r\n }\r\n \r\n _filterList(){\r\n this._buildList(this._filterOptions());\r\n this._showList();\r\n }\r\n \r\n _generateOptions(silent){\r\n var values = [];\r\n var itteration = ++ this.listIteration;\r\n \r\n this.filtered = false;\r\n \r\n if(this.params.values){\r\n values = this.params.values;\r\n }else if (this.params.valuesURL){\r\n values = this._ajaxRequest(this.params.valuesURL, this.input.value);\r\n }else{\r\n if(typeof this.params.valuesLookup === \"function\"){\r\n values = this.params.valuesLookup(this.cell, this.input.value);\r\n }else if(this.params.valuesLookup){\r\n values = this._uniqueColumnValues(this.params.valuesLookupField);\r\n }\r\n }\r\n \r\n if(values instanceof Promise){\r\n if(!silent){\r\n this._addPlaceholder(this.params.placeholderLoading);\r\n }\r\n \r\n return values.then()\r\n .then((responseValues) => {\r\n if(this.listIteration === itteration){\r\n return this._parseList(responseValues);\r\n }else{\r\n return Promise.reject(itteration);\r\n }\r\n });\r\n }else{\r\n return Promise.resolve(this._parseList(values))\r\n }\r\n }\r\n \r\n _addPlaceholder(contents){\r\n var placeholder = document.createElement(\"div\");\r\n \r\n if(typeof contents === \"function\"){\r\n contents = contents(cell.getComponent(), this.listEl);\r\n }\r\n \r\n if(contents){\r\n this._clearList();\r\n \r\n if(contents instanceof HTMLElement){\r\n placeholder = contents;\r\n }else{\r\n placeholder.classList.add(\"tabulator-edit-list-placeholder\")\r\n placeholder.innerHTML = contents;\r\n }\r\n \r\n this.listEl.appendChild(placeholder);\r\n \r\n this._showList();\r\n }\r\n }\r\n \r\n _ajaxRequest(url, term){\r\n var params = this.params.filterRemote ? {term:term} : {};\r\n url = urlBuilder(url, {}, params);\r\n \r\n return fetch(url)\r\n .then((response)=>{\r\n if(response.ok) {\r\n return response.json()\r\n .catch((error)=>{\r\n console.warn(\"List Ajax Load Error - Invalid JSON returned\", error);\r\n return Promise.reject(error);\r\n });\r\n }else{\r\n console.error(\"List Ajax Load Error - Connection Error: \" + response.status, response.statusText);\r\n return Promise.reject(response);\r\n }\r\n })\r\n .catch((error)=>{\r\n console.error(\"List Ajax Load Error - Connection Error: \", error);\r\n return Promise.reject(error);\r\n });\r\n }\r\n \r\n _uniqueColumnValues(field){\r\n var output = {},\r\n data = this.table.getData(this.params.valuesLookup),\r\n column;\r\n \r\n if(field){\r\n column = this.table.columnManager.getColumnByField(field);\r\n }else{\r\n column = this.cell.getColumn()._getSelf();\r\n }\r\n \r\n if(column){\r\n data.forEach((row) => {\r\n var val = column.getFieldValue(row);\r\n \r\n if(val !== null && typeof val !== \"undefined\" && val !== \"\"){\r\n output[val] = true;\r\n }\r\n });\r\n }else{\r\n console.warn(\"unable to find matching column to create select lookup list:\", field);\r\n output = [];\r\n }\r\n \r\n return Object.keys(output);\r\n }\r\n \r\n \r\n _parseList(inputValues){\r\n var data = [];\r\n \r\n if(!Array.isArray(inputValues)){\r\n inputValues = Object.entries(inputValues).map(([key, value]) => {\r\n return {\r\n label:value,\r\n value:key,\r\n };\r\n });\r\n }\r\n \r\n inputValues.forEach((value) => {\r\n if(typeof value !== \"object\"){\r\n value = {\r\n label:value,\r\n value:value,\r\n };\r\n }\r\n \r\n this._parseListItem(value, data, 0);\r\n });\r\n \r\n this.data = data;\r\n \r\n return data; \r\n }\r\n \r\n _parseListItem(option, data, level){\r\n var item = {};\r\n \r\n if(option.options){\r\n item = this._parseListGroup(option, level + 1);\r\n }else{\r\n item = {\r\n label:option.label,\r\n value:option.value,\r\n itemParams:option.itemParams,\r\n elementAttributes: option.elementAttributes,\r\n element:false,\r\n selected:false,\r\n visible:true,\r\n level:level,\r\n original:option,\r\n };\r\n \r\n if(this.initialValues && this.initialValues.indexOf(option.value) > -1){\r\n this._chooseItem(item, true);\r\n }\r\n }\r\n \r\n data.push(item);\r\n }\r\n \r\n _parseListGroup(option, level){\r\n var item = {\r\n label:option.label,\r\n group:true,\r\n itemParams:option.itemParams,\r\n elementAttributes:option.elementAttributes,\r\n element:false,\r\n visible:true,\r\n level:level,\r\n options:[],\r\n original:option,\r\n };\r\n \r\n option.options.forEach((child) => {\r\n this._parseListItem(child, item.options, level);\r\n });\r\n \r\n return item;\r\n }\r\n \r\n _sortOptions(options){\r\n var sorter;\r\n \r\n if(this.params.sort){\r\n sorter = typeof this.params.sort === \"function\" ? this.params.sort : this._defaultSortFunction.bind(this);\r\n \r\n this._sortGroup(sorter, options);\r\n }\r\n \r\n return options;\r\n }\r\n \r\n _sortGroup(sorter, options){\r\n options.sort((a,b) => {\r\n return sorter(a.label, b.label, a.value, b.value, a.original, b.original);\r\n });\r\n \r\n options.forEach((option) => {\r\n if(option.group){\r\n this._sortGroup(sorter, option.options);\r\n }\r\n })\r\n }\r\n \r\n _defaultSortFunction(as, bs){\r\n var a, b, a1, b1, i= 0, L, rx = /(\\d+)|(\\D+)/g, rd = /\\d/;\r\n var emptyAlign = 0;\r\n \r\n if(this.params.sort === \"desc\"){\r\n [as, bs] = [bs, as];\r\n }\r\n \r\n //handle empty values\r\n if(!as && as!== 0){\r\n emptyAlign = !bs && bs!== 0 ? 0 : -1;\r\n }else if(!bs && bs!== 0){\r\n emptyAlign = 1;\r\n }else{\r\n if(isFinite(as) && isFinite(bs)) return as - bs;\r\n a = String(as).toLowerCase();\r\n b = String(bs).toLowerCase();\r\n if(a === b) return 0;\r\n if(!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1;\r\n a = a.match(rx);\r\n b = b.match(rx);\r\n L = a.length > b.length ? b.length : a.length;\r\n while(i < L){\r\n a1= a[i];\r\n b1= b[i++];\r\n if(a1 !== b1){\r\n if(isFinite(a1) && isFinite(b1)){\r\n if(a1.charAt(0) === \"0\") a1 = \".\" + a1;\r\n if(b1.charAt(0) === \"0\") b1 = \".\" + b1;\r\n return a1 - b1;\r\n }\r\n else return a1 > b1 ? 1 : -1;\r\n }\r\n }\r\n \r\n return a.length > b.length;\r\n }\r\n \r\n return emptyAlign;\r\n }\r\n \r\n _filterOptions(){\r\n var filterFunc = this.params.filterFunc || this._defaultFilterFunc;\r\n var term = this.input.value;\r\n var results = [];\r\n \r\n if(term){\r\n this.filtered = true;\r\n \r\n this.data.forEach((item) => {\r\n this._filterItem(filterFunc, term, item);\r\n });\r\n }else{\r\n this.filtered = false;\r\n }\r\n \r\n return this.data;\r\n }\r\n \r\n _filterItem(func, term, item){\r\n var matches = false;\r\n \r\n if(!item.group){\r\n item.visible = func(term, item.label, item.value, item.original);\r\n }else{\r\n item.options.forEach((option) => {\r\n if(this._filterItem(func, term, option)){\r\n matches = true;\r\n }\r\n });\r\n \r\n item.visible = matches;\r\n }\r\n \r\n return item.visible;\r\n }\r\n \r\n _defaultFilterFunc(term, label, value, item){\r\n var term = String(term).toLowerCase();\r\n \r\n if(label !== null || typeof label !== \"undefined\"){\r\n if(String(label).toLowerCase().indexOf(term) > -1 || String(value).toLowerCase(term).indexOf() > -1){\r\n return true;\r\n }\r\n }\r\n \r\n return false;\r\n }\r\n \r\n //////////////////////////////////////\r\n /////////// Display List /////////////\r\n //////////////////////////////////////\r\n \r\n _clearList(){\r\n while(this.listEl.firstChild) this.listEl.removeChild(this.listEl.firstChild);\r\n \r\n this.displayItems = [];\r\n }\r\n \r\n _buildList(data){\r\n this._clearList();\r\n \r\n data.forEach((option) => {\r\n this._buildItem(option);\r\n });\r\n \r\n if(!this.displayItems.length){\r\n this._addPlaceholder(this.params.placeholderEmpty);\r\n } \r\n }\r\n \r\n _buildItem(item){\r\n var el = item.element,\r\n contents;\r\n \r\n if(!this.filtered || item.visible){\r\n \r\n if(!el){\r\n el = document.createElement(\"div\");\r\n el.tabIndex = 0;\r\n \r\n contents = this.params.itemFormatter ? this.params.itemFormatter(item.label, item.value, item.original, el) : item.label;\r\n \r\n if(contents instanceof HTMLElement){\r\n el.appendChild(contents)\r\n }else{\r\n el.innerHTML = contents;\r\n }\r\n \r\n if(item.group){\r\n el.classList.add(\"tabulator-edit-list-group\");\r\n }else{\r\n el.classList.add(\"tabulator-edit-list-item\");\r\n }\r\n \r\n el.classList.add(\"tabulator-edit-list-group-level-\" + item.level);\r\n \r\n if(item.elementAttributes && typeof item.elementAttributes == \"object\"){\r\n for (let key in item.elementAttributes){\r\n if(key.charAt(0) == \"+\"){\r\n key = key.slice(1);\r\n el.setAttribute(key, this.input.getAttribute(key) + item.elementAttributes[\"+\" + key]);\r\n }else{\r\n el.setAttribute(key, item.elementAttributes[key]);\r\n }\r\n }\r\n }\r\n \r\n if(item.group){\r\n el.addEventListener(\"click\", this._groupClick.bind(this, item));\r\n }else{\r\n el.addEventListener(\"click\", this._itemClick.bind(this, item));\r\n }\r\n \r\n el.addEventListener(\"mousedown\", this._preventBlur.bind(this));\r\n \r\n item.element = el;\r\n }\r\n \r\n this._styleItem(item);\r\n \r\n this.listEl.appendChild(el);\r\n \r\n if(item.group){\r\n item.options.forEach((option) => {\r\n this._buildItem(option);\r\n });\r\n }else{\r\n this.displayItems.push(item);\r\n }\r\n }\r\n }\r\n \r\n _showList(){\r\n var startVis = this.popup && this.popup.isVisible();\r\n \r\n if(this.input.parentNode){\r\n if(this.params.autocomplete && this.input.value === \"\" && !this.params.listOnEmpty){\r\n if(this.popup){\r\n this.popup.hide(true);\r\n return;\r\n }\r\n }\r\n \r\n this._setListWidth();\r\n \r\n if(!this.popup){\r\n this.popup = this.edit.popup(this.listEl);\r\n }\r\n \r\n this.popup.show(this.cell.getElement(), \"bottom\")\r\n \r\n if(!startVis){\r\n this.popup.hideOnBlur(this._resolveValue.bind(this, true));\r\n }\r\n }\r\n }\r\n \r\n _styleItem(item){\r\n if(item && item.element){\r\n if(item.selected){\r\n item.element.classList.add(\"active\");\r\n }else{\r\n item.element.classList.remove(\"active\");\r\n }\r\n }\r\n }\r\n \r\n //////////////////////////////////////\r\n ///////// User Interaction ///////////\r\n //////////////////////////////////////\r\n \r\n _itemClick(item, e){\r\n e.stopPropagation();\r\n \r\n this._chooseItem(item);\r\n }\r\n \r\n _groupClick(item, e){\r\n e.stopPropagation();\r\n }\r\n \r\n \r\n //////////////////////////////////////\r\n ////// Current Item Management ///////\r\n //////////////////////////////////////\r\n \r\n _cancel(){\r\n this.popup.hide(true);\r\n this.actions.cancel();\r\n }\r\n \r\n _clearChoices(){\r\n this.typing = true;\r\n \r\n this.currentItems.forEach((item) => {\r\n item.selected = false;\r\n this._styleItem(item);\r\n });\r\n \r\n this.currentItems = [];\r\n \r\n this.focusedItem = null;\r\n }\r\n \r\n _chooseItem(item, silent){\r\n var index;\r\n \r\n this.typing = false;\r\n \r\n if(this.params.multiselect){\r\n index = this.currentItems.indexOf(item);\r\n \r\n if(index > -1){\r\n this.currentItems.splice(index, 1);\r\n item.selected = false;\r\n }else{\r\n this.currentItems.push(item);\r\n item.selected = true;\r\n }\r\n \r\n this.input.value = this.currentItems.map(item => item.label).join(\",\");\r\n \r\n this._styleItem(item);\r\n \r\n }else{\r\n this.currentItems = [item];\r\n item.selected = true;\r\n \r\n this.input.value = item.label;\r\n \r\n this._styleItem(item);\r\n \r\n if(!silent){\r\n this._resolveValue();\r\n }\r\n }\r\n \r\n this._focusItem(item);\r\n }\r\n \r\n _resolveValue(blur){\r\n var output, initialValue;\r\n \r\n this.popup.hide(true);\r\n \r\n if(this.params.multiselect){\r\n output = this.currentItems.map(item => item.value);\r\n }else{\r\n if(blur && this.params.autocomplete && this.typing){\r\n if(this.params.freetext || (this.params.allowEmpty && this.input.value === \"\")){\r\n output = this.input.value;\r\n }else{\r\n this.actions.cancel();\r\n return;\r\n }\r\n }else{\r\n if(this.currentItems[0]){\r\n output = this.currentItems[0].value;\r\n }else{\r\n initialValue = this.initialValues[0];\r\n \r\n if(initialValue === null || typeof initialValue === \"undefined\" || initialValue === \"\"){\r\n output = initialValue;\r\n }else{\r\n output = this.params.emptyValue;\r\n }\r\n }\r\n \r\n }\r\n }\r\n \r\n if(output === \"\"){\r\n output = this.params.emptyValue;\r\n }\r\n \r\n this.actions.success(output);\r\n \r\n if(this.isFilter){\r\n this.initialValues = output && !Array.isArray[output] ? [output] : output;\r\n }\r\n }\r\n \r\n}\r\n","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\r\n\t console.warn(\"The select editor has been deprecated, please use the new list editor\");\r\n\r\n var list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n return list.input;\r\n}","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n var list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n return list.input;\r\n}","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\r\n\tconsole.warn(\"The autocomplete editor has been deprecated, please use the new list editor with the 'autocomplete' editorParam\");\r\n\r\n\teditorParams.autocomplete = true;\r\n\r\n var list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n return list.input;\r\n}","//star rating\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar self = this,\r\n\telement = cell.getElement(),\r\n\tvalue = cell.getValue(),\r\n\tmaxStars = element.getElementsByTagName(\"svg\").length || 5,\r\n\tsize = element.getElementsByTagName(\"svg\")[0] ? element.getElementsByTagName(\"svg\")[0].getAttribute(\"width\") : 14,\r\n\tstars = [],\r\n\tstarsHolder = document.createElement(\"div\"),\r\n\tstar = document.createElementNS('http://www.w3.org/2000/svg', \"svg\");\r\n\r\n\r\n\t//change star type\r\n\tfunction starChange(val){\r\n\t\tstars.forEach(function(star, i){\r\n\t\t\tif(i < val){\r\n\t\t\t\tif(self.table.browser == \"ie\"){\r\n\t\t\t\t\tstar.setAttribute(\"class\", \"tabulator-star-active\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tstar.classList.replace(\"tabulator-star-inactive\", \"tabulator-star-active\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstar.innerHTML = '';\r\n\t\t\t}else{\r\n\t\t\t\tif(self.table.browser == \"ie\"){\r\n\t\t\t\t\tstar.setAttribute(\"class\", \"tabulator-star-inactive\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tstar.classList.replace(\"tabulator-star-active\", \"tabulator-star-inactive\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstar.innerHTML = '';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//build stars\r\n\tfunction buildStar(i){\r\n\r\n\t\tvar starHolder = document.createElement(\"span\");\r\n\t\tvar nextStar = star.cloneNode(true);\r\n\r\n\t\tstars.push(nextStar);\r\n\r\n\t\tstarHolder.addEventListener(\"mouseenter\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\tstarChange(i);\r\n\t\t});\r\n\r\n\t\tstarHolder.addEventListener(\"mousemove\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t});\r\n\r\n\t\tstarHolder.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\tsuccess(i);\r\n\t\t\telement.blur();\r\n\t\t});\r\n\r\n\t\tstarHolder.appendChild(nextStar);\r\n\t\tstarsHolder.appendChild(starHolder);\r\n\r\n\t}\r\n\r\n\t//handle keyboard navigation value change\r\n\tfunction changeValue(val){\r\n\t\tvalue = val;\r\n\t\tstarChange(val);\r\n\t}\r\n\r\n\t//style cell\r\n\telement.style.whiteSpace = \"nowrap\";\r\n\telement.style.overflow = \"hidden\";\r\n\telement.style.textOverflow = \"ellipsis\";\r\n\r\n\t//style holding element\r\n\tstarsHolder.style.verticalAlign = \"middle\";\r\n\tstarsHolder.style.display = \"inline-block\";\r\n\tstarsHolder.style.padding = \"4px\";\r\n\r\n\t//style star\r\n\tstar.setAttribute(\"width\", size);\r\n\tstar.setAttribute(\"height\", size);\r\n\tstar.setAttribute(\"viewBox\", \"0 0 512 512\");\r\n\tstar.setAttribute(\"xml:space\", \"preserve\");\r\n\tstar.style.padding = \"0 1px\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tstarsHolder.setAttribute(key, starsHolder.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tstarsHolder.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//create correct number of stars\r\n\tfor(var i=1;i<= maxStars;i++){\r\n\t\tbuildStar(i);\r\n\t}\r\n\r\n\t//ensure value does not exceed number of stars\r\n\tvalue = Math.min(parseInt(value), maxStars);\r\n\r\n\t// set initial styling of stars\r\n\tstarChange(value);\r\n\r\n\tstarsHolder.addEventListener(\"mousemove\", function(e){\r\n\t\tstarChange(0);\r\n\t});\r\n\r\n\tstarsHolder.addEventListener(\"click\", function(e){\r\n\t\tsuccess(0);\r\n\t});\r\n\r\n\telement.addEventListener(\"blur\", function(e){\r\n\t\tcancel();\r\n\t});\r\n\r\n\t//allow key based navigation\r\n\telement.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 39: //right arrow\r\n\t\t\tchangeValue(value + 1);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 37: //left arrow\r\n\t\t\tchangeValue(value - 1);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 13: //enter\r\n\t\t\tsuccess(value);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 27: //escape\r\n\t\t\tcancel();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\treturn starsHolder;\r\n};","//draggable progress bar\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar element = cell.getElement(),\r\n\tmax = typeof editorParams.max === \"undefined\" ? ((element.getElementsByTagName(\"div\")[0] && element.getElementsByTagName(\"div\")[0].getAttribute(\"max\")) || 100) : editorParams.max,\r\n\tmin = typeof editorParams.min === \"undefined\" ? ((element.getElementsByTagName(\"div\")[0] && element.getElementsByTagName(\"div\")[0].getAttribute(\"min\")) || 0) : editorParams.min,\r\n\tpercent = (max - min) / 100,\r\n\tvalue = cell.getValue() || 0,\r\n\thandle = document.createElement(\"div\"),\r\n\tbar = document.createElement(\"div\"),\r\n\tmouseDrag, mouseDragWidth;\r\n\r\n\t//set new value\r\n\tfunction updateValue(){\r\n\t\tvar style = window.getComputedStyle(element, null);\r\n\r\n\t\tvar calcVal = (percent * Math.round(bar.offsetWidth / ((element.clientWidth - parseInt(style.getPropertyValue(\"padding-left\")) - parseInt(style.getPropertyValue(\"padding-right\")))/100))) + min;\r\n\t\tsuccess(calcVal);\r\n\t\telement.setAttribute(\"aria-valuenow\", calcVal);\r\n\t\telement.setAttribute(\"aria-label\", value);\r\n\t}\r\n\r\n\t//style handle\r\n\thandle.style.position = \"absolute\";\r\n\thandle.style.right = \"0\";\r\n\thandle.style.top = \"0\";\r\n\thandle.style.bottom = \"0\";\r\n\thandle.style.width = \"5px\";\r\n\thandle.classList.add(\"tabulator-progress-handle\");\r\n\r\n\t//style bar\r\n\tbar.style.display = \"inline-block\";\r\n\tbar.style.position = \"relative\";\r\n\t// bar.style.top = \"8px\";\r\n\t// bar.style.bottom = \"8px\";\r\n\t// bar.style.left = \"4px\";\r\n\t// bar.style.marginRight = \"4px\";\r\n\tbar.style.height = \"100%\";\r\n\tbar.style.backgroundColor = \"#488CE9\";\r\n\tbar.style.maxWidth = \"100%\";\r\n\tbar.style.minWidth = \"0%\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tbar.setAttribute(key, bar.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tbar.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//style cell\r\n\telement.style.padding = \"4px 4px\";\r\n\r\n\t//make sure value is in range\r\n\tvalue = Math.min(parseFloat(value), max);\r\n\tvalue = Math.max(parseFloat(value), min);\r\n\r\n\t//workout percentage\r\n\tvalue = Math.round((value - min) / percent);\r\n\t// bar.style.right = value + \"%\";\r\n\tbar.style.width = value + \"%\";\r\n\r\n\telement.setAttribute(\"aria-valuemin\", min);\r\n\telement.setAttribute(\"aria-valuemax\", max);\r\n\r\n\tbar.appendChild(handle);\r\n\r\n\thandle.addEventListener(\"mousedown\", function(e){\r\n\t\tmouseDrag = e.screenX;\r\n\t\tmouseDragWidth = bar.offsetWidth;\r\n\t});\r\n\r\n\thandle.addEventListener(\"mouseover\", function(){\r\n\t\thandle.style.cursor = \"ew-resize\";\r\n\t});\r\n\r\n\telement.addEventListener(\"mousemove\", function(e){\r\n\t\tif(mouseDrag){\r\n\t\t\tbar.style.width = (mouseDragWidth + e.screenX - mouseDrag) + \"px\";\r\n\t\t}\r\n\t});\r\n\r\n\telement.addEventListener(\"mouseup\", function(e){\r\n\t\tif(mouseDrag){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\r\n\t\t\tmouseDrag = false;\r\n\t\t\tmouseDragWidth = false;\r\n\r\n\t\t\tupdateValue();\r\n\t\t}\r\n\t});\r\n\r\n\t//allow key based navigation\r\n\telement.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 39: //right arrow\r\n\t\t\te.preventDefault();\r\n\t\t\tbar.style.width = (bar.clientWidth + element.clientWidth/100) + \"px\";\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 37: //left arrow\r\n\t\t\te.preventDefault();\r\n\t\t\tbar.style.width = (bar.clientWidth - element.clientWidth/100) + \"px\";\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 9: //tab\r\n\t\t\tcase 13: //enter\r\n\t\t\tupdateValue();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 27: //escape\r\n\t\t\tcancel();\r\n\t\t\tbreak;\r\n\r\n\t\t}\r\n\t});\r\n\r\n\telement.addEventListener(\"blur\", function(){\r\n\t\tcancel();\r\n\t});\r\n\r\n\treturn bar;\r\n};","//checkbox\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar value = cell.getValue(),\r\n\tinput = document.createElement(\"input\"),\r\n\ttristate = editorParams.tristate,\r\n\tindetermValue = typeof editorParams.indeterminateValue === \"undefined\" ? null : editorParams.indeterminateValue,\r\n\tindetermState = false,\r\n\ttrueValueSet = Object.keys(editorParams).includes(\"trueValue\"),\r\n\tfalseValueSet = Object.keys(editorParams).includes(\"falseValue\");\r\n\r\n\tinput.setAttribute(\"type\", \"checkbox\");\r\n\tinput.style.marginTop = \"5px\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = value;\r\n\r\n\tif(tristate && (typeof value === \"undefined\" || value === indetermValue || value === \"\")){\r\n\t\tindetermState = true;\r\n\t\tinput.indeterminate = true;\r\n\t}\r\n\r\n\tif(this.table.browser != \"firefox\"){ //prevent blur issue on mac firefox\r\n\t\tonRendered(function(){\r\n\t\t\tinput.focus({preventScroll: true});\r\n\t\t});\r\n\t}\r\n\r\n\tinput.checked = trueValueSet ? value === editorParams.trueValue : (value === true || value === \"true\" || value === \"True\" || value === 1);\r\n\r\n\tonRendered(function(){\r\n\t\tinput.focus();\r\n\t});\r\n\r\n\tfunction setValue(blur){\r\n\t\tvar checkedValue = input.checked;\r\n\r\n\t\tif(trueValueSet && checkedValue){\r\n\t\t\tcheckedValue = editorParams.trueValue;\r\n\t\t}else if(falseValueSet && !checkedValue){\r\n\t\t\tcheckedValue = editorParams.falseValue;\r\n\t\t}else{\r\n\t\t\tcheckedValue = checkedValue;\r\n\t\t}\r\n\r\n\t\tif(tristate){\r\n\t\t\tif(!blur){\r\n\t\t\t\tif(input.checked && !indetermState){\r\n\t\t\t\t\tinput.checked = false;\r\n\t\t\t\t\tinput.indeterminate = true;\r\n\t\t\t\t\tindetermState = true;\r\n\t\t\t\t\treturn indetermValue;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tindetermState = false;\r\n\t\t\t\t\treturn checkedValue;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(indetermState){\r\n\t\t\t\t\treturn indetermValue;\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn checkedValue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn checkedValue;\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur\r\n\tinput.addEventListener(\"change\", function(e){\r\n\t\tsuccess(setValue());\r\n\t});\r\n\r\n\tinput.addEventListener(\"blur\", function(e){\r\n\t\tsuccess(setValue(true));\r\n\t});\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tif(e.keyCode == 13){\r\n\t\t\tsuccess(setValue());\r\n\t\t}\r\n\t\tif(e.keyCode == 27){\r\n\t\t\tcancel();\r\n\t\t}\r\n\t});\r\n\r\n\treturn input;\r\n};","import input from './editors/input.js';\r\nimport textarea from './editors/textarea.js';\r\nimport number from './editors/number.js';\r\nimport range from './editors/range.js';\r\nimport select from './editors/select.js';\r\nimport list from './editors/list.js';\r\nimport autocomplete from './editors/autocomplete.js';\r\nimport star from './editors/star.js';\r\nimport progress from './editors/progress.js';\r\nimport tickCross from './editors/tickCross.js';\r\n\r\nexport default {\r\n\tinput:input,\r\n\ttextarea:textarea,\r\n number:number,\r\n range:range,\r\n\tselect:select,\r\n\tlist:list,\r\n\tautocomplete:autocomplete,\r\n\tstar:star,\r\n\tprogress:progress,\r\n\ttickCross:tickCross,\r\n};","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defaultEditors from './defaults/editors.js';\r\n\r\nclass Edit extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.currentCell = false; //hold currently editing cell\r\n\t\tthis.mouseClick = false; //hold mousedown state to prevent click binding being overriden by editor opening\r\n\t\tthis.recursionBlock = false; //prevent focus recursion\r\n\t\tthis.invalidEdit = false;\r\n\t\tthis.editedCells = [];\r\n\r\n\t\tthis.editors = Edit.editors;\r\n\r\n\t\tthis.registerColumnOption(\"editable\");\r\n\t\tthis.registerColumnOption(\"editor\");\r\n\t\tthis.registerColumnOption(\"editorParams\");\r\n\r\n\t\tthis.registerColumnOption(\"cellEditing\");\r\n\t\tthis.registerColumnOption(\"cellEdited\");\r\n\t\tthis.registerColumnOption(\"cellEditCancelled\");\r\n\r\n\t\tthis.registerTableFunction(\"getEditedCells\", this.getEditedCells.bind(this));\r\n\t\tthis.registerTableFunction(\"clearCellEdited\", this.clearCellEdited.bind(this));\r\n\t\tthis.registerTableFunction(\"navigatePrev\", this.navigatePrev.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateNext\", this.navigateNext.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateLeft\", this.navigateLeft.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateRight\", this.navigateRight.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateUp\", this.navigateUp.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateDown\", this.navigateDown.bind(this));\r\n\r\n\t\tthis.registerComponentFunction(\"cell\", \"isEdited\", this.cellisEdited.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"clearEdited\", this.clearEdited.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"edit\", this.editCell.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"cancelEdit\", this.cellCancelEdit.bind(this));\r\n\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigatePrev\", this.navigatePrev.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateNext\", this.navigateNext.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateLeft\", this.navigateLeft.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateRight\", this.navigateRight.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateUp\", this.navigateUp.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateDown\", this.navigateDown.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-init\", this.bindEditor.bind(this));\r\n\t\tthis.subscribe(\"cell-delete\", this.clearEdited.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumnCheck.bind(this));\r\n\t\tthis.subscribe(\"column-delete\", this.columnDeleteCheck.bind(this));\r\n\t\tthis.subscribe(\"row-deleting\", this.rowDeleteCheck.bind(this));\r\n\t\tthis.subscribe(\"data-refreshing\", this.cancelEdit.bind(this));\r\n\r\n\t\tthis.subscribe(\"keybinding-nav-prev\", this.navigatePrev.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-next\", this.keybindingNavigateNext.bind(this));\r\n\t\tthis.subscribe(\"keybinding-nav-left\", this.navigateLeft.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-right\", this.navigateRight.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-up\", this.navigateUp.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-down\", this.navigateDown.bind(this, undefined));\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t////// Keybinding Functions ///////\r\n\t///////////////////////////////////\r\n\r\n\tkeybindingNavigateNext(e){\r\n\t\tvar cell = this.currentCell,\r\n\t\tnewRow = this.options(\"tabEndNewRow\");\r\n\r\n\t\tif(cell){\r\n\t\t\tif(!this.navigateNext(cell, e)){\r\n\t\t\t\tif(newRow){\r\n\t\t\t\t\tcell.getElement().firstChild.blur();\r\n\r\n\t\t\t\t\tif(newRow === true){\r\n\t\t\t\t\t\tnewRow = this.table.addRow({})\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(typeof newRow == \"function\"){\r\n\t\t\t\t\t\t\tnewRow = this.table.addRow(newRow(cell.row.getComponent()))\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnewRow = this.table.addRow(Object.assign({}, newRow));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tnewRow.then(() => {\r\n\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\tcell.getComponent().navigateNext();\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Cell Functions //////////\r\n\t///////////////////////////////////\r\n\r\n\tcellisEdited(cell){\r\n\t\treturn !! cell.modules.edit && cell.modules.edit.edited;\r\n\t}\r\n\r\n\tcellCancelEdit(cell){\r\n\t\tif(cell === this.currentCell){\r\n\t\t\tthis.table.modules.edit.cancelEdit();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cancel Editor Error - This cell is not currently being edited \");\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\tclearCellEdited(cells){\r\n\t\tif(!cells){\r\n\t\t\tcells = this.table.modules.edit.getEditedCells();\r\n\t\t}\r\n\r\n\t\tif(!Array.isArray(cells)){\r\n\t\t\tcells = [cells];\r\n\t\t}\r\n\r\n\t\tcells.forEach((cell) => {\r\n\t\t\tthis.table.modules.edit.clearEdited(cell._getSelf());\r\n\t\t});\r\n\t}\r\n\r\n\tnavigatePrev(cell = this.currentCell, e){\r\n\t\tvar nextCell, prevRow;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tnextCell = this.navigateLeft();\r\n\r\n\t\t\tif(nextCell){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tprevRow = this.table.rowManager.prevDisplayRow(cell.row, true);\r\n\r\n\t\t\t\tif(prevRow){\r\n\t\t\t\t\tnextCell = this.findNextEditableCell(prevRow, prevRow.cells.length);\r\n\r\n\t\t\t\t\tif(nextCell){\r\n\t\t\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tnavigateNext(cell = this.currentCell, e){\r\n\t\tvar nextCell, nextRow;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tnextCell = this.navigateRight();\r\n\r\n\t\t\tif(nextCell){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tnextRow = this.table.rowManager.nextDisplayRow(cell.row, true);\r\n\r\n\t\t\t\tif(nextRow){\r\n\t\t\t\t\tnextCell = this.findNextEditableCell(nextRow, -1);\r\n\r\n\t\t\t\t\tif(nextCell){\r\n\t\t\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tnavigateLeft(cell = this.currentCell, e){\r\n\t\tvar index, nextCell;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextCell = this.findPrevEditableCell(cell.row, index);\r\n\r\n\t\t\tif(nextCell){\r\n\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tnavigateRight(cell = this.currentCell, e){\r\n\t\tvar index, nextCell;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextCell = this.findNextEditableCell(cell.row, index);\r\n\r\n\t\t\tif(nextCell){\r\n\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tnavigateUp(cell = this.currentCell, e){\r\n\t\tvar index, nextRow;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextRow = this.table.rowManager.prevDisplayRow(cell.row, true);\r\n\r\n\t\t\tif(nextRow){\r\n\t\t\t\tnextRow.cells[index].getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tnavigateDown(cell = this.currentCell, e){\r\n\t\tvar index, nextRow;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextRow = this.table.rowManager.nextDisplayRow(cell.row, true);\r\n\r\n\t\t\tif(nextRow){\r\n\t\t\t\tnextRow.cells[index].getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfindNextEditableCell(row, index){\r\n\t\tvar nextCell = false;\r\n\r\n\t\tif(index < row.cells.length-1){\r\n\t\t\tfor(var i = index+1; i < row.cells.length; i++){\r\n\t\t\t\tlet cell = row.cells[i];\r\n\r\n\t\t\t\tif(cell.column.modules.edit && Helpers.elVisible(cell.getElement())){\r\n\t\t\t\t\tlet allowEdit = true;\r\n\r\n\t\t\t\t\tif(typeof cell.column.modules.edit.check == \"function\"){\r\n\t\t\t\t\t\tallowEdit = cell.column.modules.edit.check(cell.getComponent());\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(allowEdit){\r\n\t\t\t\t\t\tnextCell = cell;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn nextCell;\r\n\t}\r\n\r\n\tfindPrevEditableCell(row, index){\r\n\t\tvar prevCell = false;\r\n\r\n\t\tif(index > 0){\r\n\t\t\tfor(var i = index-1; i >= 0; i--){\r\n\t\t\t\tlet cell = row.cells[i],\r\n\t\t\t\tallowEdit = true;\r\n\r\n\t\t\t\tif(cell.column.modules.edit && Helpers.elVisible(cell.getElement())){\r\n\t\t\t\t\tif(typeof cell.column.modules.edit.check == \"function\"){\r\n\t\t\t\t\t\tallowEdit = cell.column.modules.edit.check(cell.getComponent());\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(allowEdit){\r\n\t\t\t\t\t\tprevCell = cell;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn prevCell;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tinitializeColumnCheck(column){\r\n\t\tif(typeof column.definition.editor !== \"undefined\"){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\r\n\tcolumnDeleteCheck(column){\r\n\t\tif(this.currentCell && this.currentCell.column === column){\r\n\t\t\tthis.cancelEdit();\r\n\t\t}\r\n\t}\r\n\r\n\trowDeleteCheck(row){\r\n\t\tif(this.currentCell && this.currentCell.row === row){\r\n\t\t\tthis.cancelEdit();\r\n\t\t}\r\n\t}\r\n\r\n\t//initialize column editor\r\n\tinitializeColumn(column){\r\n\t\tvar self = this,\r\n\t\tconfig = {\r\n\t\t\teditor:false,\r\n\t\t\tblocked:false,\r\n\t\t\tcheck:column.definition.editable,\r\n\t\t\tparams:column.definition.editorParams || {}\r\n\t\t};\r\n\r\n\t\t//set column editor\r\n\t\tswitch(typeof column.definition.editor){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(this.editors[column.definition.editor]){\r\n\t\t\t\tconfig.editor = this.editors[column.definition.editor];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Editor Error - No such editor found: \", column.definition.editor);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tconfig.editor = column.definition.editor;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"boolean\":\r\n\t\t\tif(column.definition.editor === true){\r\n\t\t\t\tif(typeof column.definition.formatter !== \"function\"){\r\n\t\t\t\t\tif(this.editors[column.definition.formatter]){\r\n\t\t\t\t\t\tconfig.editor = this.editors[column.definition.formatter];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconfig.editor = this.editors[\"input\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Editor Error - Cannot auto lookup editor for a custom formatter: \", column.definition.formatter);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(config.editor){\r\n\t\t\tcolumn.modules.edit = config;\r\n\t\t}\r\n\t}\r\n\r\n\tgetCurrentCell(){\r\n\t\treturn this.currentCell ? this.currentCell.getComponent() : false;\r\n\t}\r\n\r\n\tclearEditor(cancel){\r\n\t\tvar cell = this.currentCell,\r\n\t\tcellEl;\r\n\r\n\t\tthis.invalidEdit = false;\r\n\r\n\t\tif(cell){\r\n\t\t\tthis.currentCell = false;\r\n\r\n\t\t\tcellEl = cell.getElement();\r\n\r\n\t\t\tthis.dispatch(\"edit-editor-clear\", cell, cancel);\r\n\r\n\t\t\tcellEl.classList.remove(\"tabulator-editing\");\r\n\r\n\t\t\twhile(cellEl.firstChild) cellEl.removeChild(cellEl.firstChild);\r\n\r\n\t\t\tcell.row.getElement().classList.remove(\"tabulator-row-editing\");\r\n\t\t}\r\n\t}\r\n\r\n\tcancelEdit(){\r\n\t\tif(this.currentCell){\r\n\t\t\tvar cell = this.currentCell;\r\n\t\t\tvar component = this.currentCell.getComponent();\r\n\r\n\t\t\tthis.clearEditor(true);\r\n\t\t\tcell.setValueActual(cell.getValue());\r\n\t\t\tcell.cellRendered();\r\n\r\n\t\t\tif(cell.column.definition.editor == \"textarea\" || cell.column.definition.variableHeight){\r\n\t\t\t\tcell.row.normalizeHeight(true);\r\n\t\t\t}\r\n\r\n\t\t\tif(cell.column.definition.cellEditCancelled){\r\n\t\t\t\tcell.column.definition.cellEditCancelled.call(this.table, component);\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatch(\"edit-cancelled\", cell);\r\n\t\t\tthis.dispatchExternal(\"cellEditCancelled\", component);\r\n\t\t}\r\n\t}\r\n\r\n\t//return a formatted value for a cell\r\n\tbindEditor(cell){\r\n\t\tif(cell.column.modules.edit){\r\n\t\t\tvar self = this,\r\n\t\t\telement = cell.getElement(true);\r\n\r\n\t\t\telement.setAttribute(\"tabindex\", 0);\r\n\r\n\t\t\telement.addEventListener(\"click\", function(e){\r\n\t\t\t\tif(!element.classList.contains(\"tabulator-editing\")){\r\n\t\t\t\t\telement.focus({preventScroll: true});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\telement.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif (e.button === 2) {\r\n\t\t\t\t\te.preventDefault();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself.mouseClick = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\telement.addEventListener(\"focus\", function(e){\r\n\t\t\t\tif(!self.recursionBlock){\r\n\t\t\t\t\tself.edit(cell, e, false);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tfocusCellNoEvent(cell, block){\r\n\t\tthis.recursionBlock = true;\r\n\r\n\t\tif(!(block && this.table.browser === \"ie\")){\r\n\t\t\tcell.getElement().focus({preventScroll: true});\r\n\t\t}\r\n\r\n\t\tthis.recursionBlock = false;\r\n\t}\r\n\r\n\teditCell(cell, forceEdit){\r\n\t\tthis.focusCellNoEvent(cell);\r\n\t\tthis.edit(cell, false, forceEdit);\r\n\t}\r\n\r\n\tfocusScrollAdjust(cell){\r\n\t\tif(this.table.rowManager.getRenderMode() == \"virtual\"){\r\n\t\t\tvar topEdge = this.table.rowManager.element.scrollTop,\r\n\t\t\tbottomEdge = this.table.rowManager.element.clientHeight + this.table.rowManager.element.scrollTop,\r\n\t\t\trowEl = cell.row.getElement(),\r\n\t\t\toffset = rowEl.offsetTop;\r\n\r\n\t\t\tif(rowEl.offsetTop < topEdge){\r\n\t\t\t\tthis.table.rowManager.element.scrollTop -= (topEdge - rowEl.offsetTop);\r\n\t\t\t}else{\r\n\t\t\t\tif(rowEl.offsetTop + rowEl.offsetHeight > bottomEdge){\r\n\t\t\t\t\tthis.table.rowManager.element.scrollTop += (rowEl.offsetTop + rowEl.offsetHeight - bottomEdge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar leftEdge = this.table.rowManager.element.scrollLeft,\r\n\t\t\trightEdge = this.table.rowManager.element.clientWidth + this.table.rowManager.element.scrollLeft,\r\n\t\t\tcellEl = cell.getElement(),\r\n\t\t\toffset = cellEl.offsetLeft;\r\n\r\n\t\t\tif(this.table.modExists(\"frozenColumns\")){\r\n\t\t\t\tleftEdge += parseInt(this.table.modules.frozenColumns.leftMargin);\r\n\t\t\t\trightEdge -= parseInt(this.table.modules.frozenColumns.rightMargin);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.options.renderHorizontal === \"virtual\"){\r\n\t\t\t\tleftEdge -= parseInt(this.table.columnManager.renderer.vDomPadLeft);\r\n\t\t\t\trightEdge -= parseInt(this.table.columnManager.renderer.vDomPadLeft);\r\n\t\t\t}\r\n\r\n\t\t\tif(cellEl.offsetLeft < leftEdge){\r\n\r\n\t\t\t\tthis.table.rowManager.element.scrollLeft -= (leftEdge - cellEl.offsetLeft);\r\n\t\t\t}else{\r\n\t\t\t\tif(cellEl.offsetLeft + cellEl.offsetWidth > rightEdge){\r\n\t\t\t\t\tthis.table.rowManager.element.scrollLeft += (cellEl.offsetLeft + cellEl.offsetWidth - rightEdge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tedit(cell, e, forceEdit){\r\n\t\tvar self = this,\r\n\t\tallowEdit = true,\r\n\t\trendered = function(){},\r\n\t\telement = cell.getElement(),\r\n\t\tcellEditor, component, params;\r\n\r\n\t\t//prevent editing if another cell is refusing to leave focus (eg. validation fail)\r\n\t\tif(this.currentCell){\r\n\t\t\tif(!this.invalidEdit){\r\n\t\t\t\tthis.cancelEdit();\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//handle successful value change\r\n\t\tfunction success(value){\r\n\t\t\tif(self.currentCell === cell){\r\n\t\t\t\tvar valid = self.chain(\"edit-success\", [cell, value], true, true);\r\n\r\n\t\t\t\tif(valid === true || self.table.options.validationMode === \"highlight\"){\r\n\t\t\t\t\tself.clearEditor();\r\n\r\n\r\n\t\t\t\t\tif(!cell.modules.edit){\r\n\t\t\t\t\t\tcell.modules.edit = {};\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tcell.modules.edit.edited = true;\r\n\r\n\t\t\t\t\tif(self.editedCells.indexOf(cell) == -1){\r\n\t\t\t\t\t\tself.editedCells.push(cell);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tcell.setValue(value, true);\r\n\r\n\t\t\t\t\treturn valid === true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself.invalidEdit = true;\r\n\t\t\t\t\tself.focusCellNoEvent(cell, true);\r\n\t\t\t\t\trendered();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t// console.warn(\"Edit Success Error - cannot call success on a cell that is no longer being edited\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//handle aborted edit\r\n\t\tfunction cancel(){\r\n\t\t\tif(self.currentCell === cell){\r\n\t\t\t\tself.cancelEdit();\r\n\t\t\t}else{\r\n\t\t\t\t// console.warn(\"Edit Success Error - cannot call cancel on a cell that is no longer being edited\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\trendered = callback;\r\n\t\t}\r\n\r\n\t\tif(!cell.column.modules.edit.blocked){\r\n\t\t\tif(e){\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t}\r\n\r\n\t\t\tswitch(typeof cell.column.modules.edit.check){\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tallowEdit = cell.column.modules.edit.check(cell.getComponent());\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\tallowEdit = cell.column.modules.edit.check;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(allowEdit || forceEdit){\r\n\r\n\t\t\t\tself.cancelEdit();\r\n\r\n\t\t\t\tself.currentCell = cell;\r\n\r\n\t\t\t\tthis.focusScrollAdjust(cell);\r\n\r\n\t\t\t\tcomponent = cell.getComponent();\r\n\r\n\t\t\t\tif(this.mouseClick){\r\n\t\t\t\t\tthis.mouseClick = false;\r\n\r\n\t\t\t\t\tif(cell.column.definition.cellClick){\r\n\t\t\t\t\t\tcell.column.definition.cellClick.call(this.table, e, component);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(cell.column.definition.cellEditing){\r\n\t\t\t\t\tcell.column.definition.cellEditing.call(this.table, component);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.dispatch(\"cell-editing\", cell);\r\n\t\t\t\tthis.dispatchExternal(\"cellEditing\", component);\r\n\r\n\t\t\t\tparams = typeof cell.column.modules.edit.params === \"function\" ? cell.column.modules.edit.params(component) : cell.column.modules.edit.params;\r\n\r\n\t\t\t\tcellEditor = cell.column.modules.edit.editor.call(self, component, onRendered, success, cancel, params);\r\n\r\n\t\t\t\t//if editor returned, add to DOM, if false, abort edit\r\n\t\t\t\tif(cellEditor !== false){\r\n\r\n\t\t\t\t\tif(cellEditor instanceof Node){\r\n\t\t\t\t\t\telement.classList.add(\"tabulator-editing\");\r\n\t\t\t\t\t\tcell.row.getElement().classList.add(\"tabulator-row-editing\");\r\n\t\t\t\t\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\t\t\t\t\telement.appendChild(cellEditor);\r\n\r\n\t\t\t\t\t\t//trigger onRendered Callback\r\n\t\t\t\t\t\trendered();\r\n\r\n\t\t\t\t\t\t//prevent editing from triggering rowClick event\r\n\t\t\t\t\t\tvar children = element.children;\r\n\r\n\t\t\t\t\t\tfor (var i = 0; i < children.length; i++) {\r\n\t\t\t\t\t\t\tchildren[i].addEventListener(\"click\", function(e){\r\n\t\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Edit Error - Editor should return an instance of Node, the editor returned:\", cellEditor);\r\n\t\t\t\t\t\telement.blur();\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.blur();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tthis.mouseClick = false;\r\n\t\t\t\telement.blur();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.mouseClick = false;\r\n\t\t\telement.blur();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tgetEditedCells(){\r\n\t\tvar output = [];\r\n\r\n\t\tthis.editedCells.forEach((cell) => {\r\n\t\t\toutput.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tclearEdited(cell){\r\n\t\tvar editIndex;\r\n\r\n\t\tif(cell.modules.edit && cell.modules.edit.edited){\r\n\t\t\tcell.modules.edit.edited = false;\r\n\r\n\t\t\tthis.dispatch(\"edit-edited-clear\", cell);\r\n\t\t}\r\n\r\n\t\teditIndex = this.editedCells.indexOf(cell);\r\n\r\n\t\tif(editIndex > -1){\r\n\t\t\tthis.editedCells.splice(editIndex, 1);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nEdit.moduleName = \"edit\";\r\n\r\n//load defaults\r\nEdit.editors = defaultEditors;\r\n\r\n\r\nexport default Edit;\r\n","class ExportRow{\r\n\tconstructor(type, columns, component, indent){\r\n\t\tthis.type = type;\r\n\t\tthis.columns = columns;\r\n\t\tthis.component = component || false;\r\n\t\tthis.indent = indent || 0;\r\n\t}\r\n}\r\n\r\nexport default ExportRow;","class ExportColumn{\r\n\tconstructor(value, component, width, height, depth){\r\n\t\tthis.value = value;\r\n\t\tthis.component = component || false;\r\n\t\tthis.width = width;\r\n\t\tthis.height = height;\r\n\t\tthis.depth = depth;\r\n\t}\r\n}\r\n\r\nexport default ExportColumn;","import Module from '../../core/Module.js';\r\n\r\nimport ExportRow from './ExportRow.js';\r\nimport ExportColumn from './ExportColumn.js';\r\n\r\nclass Export extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.config = {};\r\n\t\tthis.cloneTableStyle = true;\r\n\t\tthis.colVisProp = \"\";\r\n\r\n\t\tthis.registerTableOption(\"htmlOutputConfig\", false); //html outypu config\r\n\r\n\t\tthis.registerColumnOption(\"htmlOutput\");\r\n\t\tthis.registerColumnOption(\"titleHtmlOutput\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"getHtml\", this.getHtml.bind(this));\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tgenerateExportList(config, style, range, colVisProp){\r\n\t\tthis.cloneTableStyle = style;\r\n\t\tthis.config = config || {};\r\n\t\tthis.colVisProp = colVisProp;\r\n\r\n\t\tvar headers = this.config.columnHeaders !== false ? this.headersToExportRows(this.generateColumnGroupHeaders()) : [];\r\n\t\tvar body = this.bodyToExportRows(this.rowLookup(range));\r\n\r\n\t\treturn headers.concat(body);\r\n\t}\r\n\r\n\tgenereateTable(config, style, range, colVisProp){\r\n\t\tvar list = this.generateExportList(config, style, range, colVisProp);\r\n\r\n\t\treturn this.genereateTableElement(list);\r\n\t}\r\n\r\n\trowLookup(range){\r\n\t\tvar rows = [];\r\n\r\n\t\tif(typeof range == \"function\"){\r\n\t\t\trange.call(this.table).forEach((row) =>{\r\n\t\t\t\trow = this.table.rowManager.findRow(row);\r\n\r\n\t\t\t\tif(row){\r\n\t\t\t\t\trows.push(row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tswitch(range){\r\n\t\t\t\tcase true:\r\n\t\t\t\tcase \"visible\":\r\n\t\t\t\trows = this.table.rowManager.getVisibleRows(false, true);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"all\":\r\n\t\t\t\trows = this.table.rowManager.rows;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"selected\":\r\n\t\t\t\trows = this.table.modules.selectRow.selectedRows;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"active\":\r\n\t\t\t\tdefault:\r\n\t\t\t\tif(this.table.options.pagination){\r\n\t\t\t\t\trows = this.table.rowManager.getDisplayRows(this.table.rowManager.displayRows.length - 2);\r\n\t\t\t\t}else{\r\n\t\t\t\t\trows = this.table.rowManager.getDisplayRows();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Object.assign([], rows);\r\n\t}\r\n\r\n\tgenerateColumnGroupHeaders(){\r\n\t\tvar output = [];\r\n\r\n\t\tvar columns = this.config.columnGroups !== false ? this.table.columnManager.columns : this.table.columnManager.columnsByIndex;\r\n\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\tvar colData = this.processColumnGroup(column);\r\n\r\n\t\t\tif(colData){\r\n\t\t\t\toutput.push(colData);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tprocessColumnGroup(column){\r\n\t\tvar subGroups = column.columns,\r\n\t\tmaxDepth = 0,\r\n\t\ttitle = column.definition[\"title\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))] || column.definition.title;\r\n\r\n\t\tvar groupData = {\r\n\t\t\ttitle:title,\r\n\t\t\tcolumn:column,\r\n\t\t\tdepth:1,\r\n\t\t};\r\n\r\n\t\tif(subGroups.length){\r\n\t\t\tgroupData.subGroups = [];\r\n\t\t\tgroupData.width = 0;\r\n\r\n\t\t\tsubGroups.forEach((subGroup) => {\r\n\t\t\t\tvar subGroupData = this.processColumnGroup(subGroup);\r\n\r\n\t\t\t\tif(subGroupData){\r\n\t\t\t\t\tgroupData.width += subGroupData.width;\r\n\t\t\t\t\tgroupData.subGroups.push(subGroupData);\r\n\r\n\t\t\t\t\tif(subGroupData.depth > maxDepth){\r\n\t\t\t\t\t\tmaxDepth = subGroupData.depth;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tgroupData.depth += maxDepth;\r\n\r\n\t\t\tif(!groupData.width){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.columnVisCheck(column)){\r\n\t\t\t\tgroupData.width = 1;\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn groupData;\r\n\t}\r\n\r\n\tcolumnVisCheck(column){\r\n\t\treturn column.definition[this.colVisProp] !== false && (column.visible || (!column.visible && column.definition[this.colVisProp]));\r\n\t}\r\n\r\n\theadersToExportRows(columns){\r\n\t\tvar headers = [],\r\n\t\theaderDepth = 0,\r\n\t\texportRows = [];\r\n\r\n\t\tfunction parseColumnGroup(column, level){\r\n\r\n\t\t\tvar depth = headerDepth - level;\r\n\r\n\t\t\tif(typeof headers[level] === \"undefined\"){\r\n\t\t\t\theaders[level] = [];\r\n\t\t\t}\r\n\r\n\t\t\tcolumn.height = column.subGroups ? 1 : (depth - column.depth) + 1;\r\n\r\n\t\t\theaders[level].push(column);\r\n\r\n\t\t\tif(column.height > 1){\r\n\t\t\t\tfor(let i = 1; i < column.height; i ++){\r\n\r\n\t\t\t\t\tif(typeof headers[level + i] === \"undefined\"){\r\n\t\t\t\t\t\theaders[level + i] = [];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\theaders[level + i].push(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(column.width > 1){\r\n\t\t\t\tfor(let i = 1; i < column.width; i ++){\r\n\t\t\t\t\theaders[level].push(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(column.subGroups){\r\n\t\t\t\tcolumn.subGroups.forEach(function(subGroup){\r\n\t\t\t\t\tparseColumnGroup(subGroup, level+1);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//calculate maximum header debth\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tif(column.depth > headerDepth){\r\n\t\t\t\theaderDepth = column.depth;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tparseColumnGroup(column,0);\r\n\t\t});\r\n\r\n\t\theaders.forEach((header) => {\r\n\t\t\tvar columns = [];\r\n\r\n\t\t\theader.forEach((col) => {\r\n\t\t\t\tif(col){\r\n\t\t\t\t\tlet title = typeof col.title === \"undefined\" ? \"\" : col.title;\r\n\t\t\t\t\tcolumns.push(new ExportColumn(title, col.column.getComponent(), col.width, col.height, col.depth));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolumns.push(null);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\texportRows.push(new ExportRow(\"header\", columns));\r\n\t\t});\r\n\r\n\t\treturn exportRows;\r\n\t}\r\n\r\n\tbodyToExportRows(rows){\r\n\r\n\t\tvar columns = [];\r\n\t\tvar exportRows = [];\r\n\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tif (this.columnVisCheck(column)) {\r\n\t\t\t\tcolumns.push(column.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(this.config.columnCalcs !== false && this.table.modExists(\"columnCalcs\")){\r\n\t\t\tif(this.table.modules.columnCalcs.topInitialized){\r\n\t\t\t\trows.unshift(this.table.modules.columnCalcs.topRow);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modules.columnCalcs.botInitialized){\r\n\t\t\t\trows.push(this.table.modules.columnCalcs.botRow);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\trows = rows.filter((row) => {\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\treturn this.config.rowGroups !== false;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"calc\":\r\n\t\t\t\treturn this.config.columnCalcs !== false;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"row\":\r\n\t\t\t\treturn !(this.table.options.dataTree && this.config.dataTree === false && row.modules.dataTree.parent);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\trows.forEach((row, i) => {\r\n\t\t\tvar rowData = row.getData(this.colVisProp);\r\n\t\t\tvar exportCols = [];\r\n\t\t\tvar indent = 0;\r\n\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\tindent = row.level;\r\n\t\t\t\texportCols.push(new ExportColumn(row.key, row.getComponent(), columns.length, 1));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"calc\" :\r\n\t\t\t\tcase \"row\" :\r\n\t\t\t\tcolumns.forEach((col) => {\r\n\t\t\t\t\texportCols.push(new ExportColumn(col._column.getFieldValue(rowData), col, 1, 1));\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(this.table.options.dataTree && this.config.dataTree !== false){\r\n\t\t\t\t\tindent = row.modules.dataTree.index;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\texportRows.push(new ExportRow(row.type, exportCols, row.getComponent(), indent));\r\n\t\t});\r\n\r\n\t\treturn exportRows;\r\n\t}\r\n\r\n\tgenereateTableElement(list){\r\n\t\tvar table = document.createElement(\"table\"),\r\n\t\theaderEl = document.createElement(\"thead\"),\r\n\t\tbodyEl = document.createElement(\"tbody\"),\r\n\t\tstyles = this.lookupTableStyles(),\r\n\t\trowFormatter = this.table.options[\"rowFormatter\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))],\r\n\t\tsetup = {};\r\n\r\n\t\tsetup.rowFormatter = rowFormatter !== null ? rowFormatter : this.table.options.rowFormatter;\r\n\r\n\t\tif(this.table.options.dataTree &&this.config.dataTree !== false && this.table.modExists(\"columnCalcs\")){\r\n\t\t\tsetup.treeElementField = this.table.modules.dataTree.elementField;\r\n\t\t}\r\n\r\n\t\t//assign group header formatter\r\n\t\tsetup.groupHeader = this.table.options[\"groupHeader\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))];\r\n\r\n\t\tif(setup.groupHeader && !Array.isArray(setup.groupHeader)){\r\n\t\t\tsetup.groupHeader = [setup.groupHeader];\r\n\t\t}\r\n\r\n\t\ttable.classList.add(\"tabulator-print-table\");\r\n\r\n\t\tthis.mapElementStyles(this.table.columnManager.getHeadersElement(), headerEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"background-color\", \"color\", \"font-weight\", \"font-family\", \"font-size\"]);\r\n\r\n\r\n\t\tif(list.length > 1000){\r\n\t\t\tconsole.warn(\"It may take a long time to render an HTML table with more than 1000 rows\");\r\n\t\t}\r\n\r\n\t\tlist.forEach((row, i) => {\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"header\":\r\n\t\t\t\theaderEl.appendChild(this.genereateHeaderElement(row, setup, styles));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\tbodyEl.appendChild(this.genereateGroupElement(row, setup, styles));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"calc\":\r\n\t\t\t\tbodyEl.appendChild(this.genereateCalcElement(row, setup, styles));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"row\":\r\n\t\t\t\tlet rowEl = this.genereateRowElement(row, setup, styles);\r\n\t\t\t\tthis.mapElementStyles(((i % 2) && styles.evenRow) ? styles.evenRow : styles.oddRow, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\t\t\t\tbodyEl.appendChild(rowEl);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(headerEl.innerHTML){\r\n\t\t\ttable.appendChild(headerEl);\r\n\t\t}\r\n\r\n\t\ttable.appendChild(bodyEl);\r\n\r\n\r\n\t\tthis.mapElementStyles(this.table.element, table, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\"]);\r\n\t\treturn table;\r\n\t}\r\n\r\n\tlookupTableStyles(){\r\n\t\tvar styles = {};\r\n\r\n\t\t//lookup row styles\r\n\t\tif(this.cloneTableStyle && window.getComputedStyle){\r\n\t\t\tstyles.oddRow = this.table.element.querySelector(\".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.evenRow = this.table.element.querySelector(\".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.calcRow = this.table.element.querySelector(\".tabulator-row.tabulator-calcs\");\r\n\t\t\tstyles.firstRow = this.table.element.querySelector(\".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.firstGroup = this.table.element.getElementsByClassName(\"tabulator-group\")[0];\r\n\r\n\t\t\tif(styles.firstRow){\r\n\t\t\t\tstyles.styleCells = styles.firstRow.getElementsByClassName(\"tabulator-cell\");\r\n\t\t\t\tstyles.firstCell = styles.styleCells[0];\r\n\t\t\t\tstyles.lastCell = styles.styleCells[styles.styleCells.length - 1];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn styles;\r\n\t}\r\n\r\n\tgenereateHeaderElement(row, setup, styles){\r\n\t\tvar rowEl = document.createElement(\"tr\");\r\n\r\n\t\trow.columns.forEach((column) => {\r\n\t\t\tif(column){\r\n\t\t\t\tvar cellEl = document.createElement(\"th\");\r\n\t\t\t\tvar classNames = column.component._column.definition.cssClass ? column.component._column.definition.cssClass.split(\" \") : [];\r\n\r\n\t\t\t\tcellEl.colSpan = column.width;\r\n\t\t\t\tcellEl.rowSpan = column.height;\r\n\r\n\t\t\t\tcellEl.innerHTML = column.value;\r\n\r\n\t\t\t\tif(this.cloneTableStyle){\r\n\t\t\t\t\tcellEl.style.boxSizing = \"border-box\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\tclassNames.forEach(function(className) {\r\n\t\t\t\t\tcellEl.classList.add(className);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.mapElementStyles(column.component.getElement(), cellEl, [\"text-align\", \"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"background-color\", \"color\", \"font-weight\", \"font-family\", \"font-size\"]);\r\n\t\t\t\tthis.mapElementStyles(column.component._column.contentElement, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\"]);\r\n\r\n\t\t\t\tif(column.component._column.visible){\r\n\t\t\t\t\tthis.mapElementStyles(column.component.getElement(), cellEl, [\"width\"]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(column.component._column.definition.width){\r\n\t\t\t\t\t\tcellEl.style.width = column.component._column.definition.width + \"px\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(column.component._column.parent){\r\n\t\t\t\t\tthis.mapElementStyles(column.component._column.parent.groupElement, cellEl, [\"border-top\"]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowEl.appendChild(cellEl);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenereateGroupElement(row, setup, styles){\r\n\r\n\t\tvar rowEl = document.createElement(\"tr\"),\r\n\t\tcellEl = document.createElement(\"td\"),\r\n\t\tgroup = row.columns[0];\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-row\");\r\n\r\n\t\tif(setup.groupHeader && setup.groupHeader[row.indent]){\r\n\t\t\tgroup.value = setup.groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t}else{\r\n\t\t\tif(setup.groupHeader === false){\r\n\t\t\t\tgroup.value = group.value;\r\n\t\t\t}else{\r\n\t\t\t\tgroup.value = row.component._group.generator(group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcellEl.colSpan = group.width;\r\n\t\tcellEl.innerHTML = group.value;\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-group\");\r\n\t\trowEl.classList.add(\"tabulator-group-level-\" + row.indent);\r\n\r\n\t\tif(group.component.isVisible()){\r\n\t\t\trowEl.classList.add(\"tabulator-group-visible\");\r\n\t\t}\r\n\r\n\t\tthis.mapElementStyles(styles.firstGroup, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\t\tthis.mapElementStyles(styles.firstGroup, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\"]);\r\n\r\n\t\trowEl.appendChild(cellEl);\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenereateCalcElement(row, setup, styles){\r\n\t\tvar rowEl = this.genereateRowElement(row, setup, styles);\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-calcs\");\r\n\t\tthis.mapElementStyles(styles.calcRow, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenereateRowElement(row, setup, styles){\r\n\t\tvar rowEl = document.createElement(\"tr\");\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-row\");\r\n\r\n\t\trow.columns.forEach((col) => {\r\n\t\t\tif(col){\r\n\t\t\t\tvar cellEl = document.createElement(\"td\"),\r\n\t\t\t\tcolumn = col.component._column,\r\n\t\t\t\tindex = this.table.columnManager.findColumnIndex(column),\r\n\t\t\t\tvalue = col.value;\r\n\r\n\t\t\t\tvar cellWrapper = {\r\n\t\t\t\t\tmodules:{},\r\n\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetField:function(){\r\n\t\t\t\t\t\treturn column.definition.field;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\treturn cellEl;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetData:function(){\r\n\t\t\t\t\t\treturn row.component.getData();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\treturn row.component;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetComponent:function(){\r\n\t\t\t\t\t\treturn cellWrapper;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tcolumn:column,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tvar classNames = column.definition.cssClass ? column.definition.cssClass.split(\" \") : [];\r\n\r\n\t\t\t\tclassNames.forEach(function(className) {\r\n\t\t\t\t\tcellEl.classList.add(className);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(this.table.modExists(\"format\") && this.config.formatCells !== false){\r\n\t\t\t\t\tvalue = this.table.modules.format.formatExportValue(cellWrapper, this.colVisProp);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\tvalue = value !== null ? JSON.stringify(value) : \"\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tvalue = value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(value instanceof Node){\r\n\t\t\t\t\tcellEl.appendChild(value);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcellEl.innerHTML = value;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(styles.styleCells[index] || styles.firstCell){\r\n\t\t\t\t\tthis.mapElementStyles(styles.styleCells[index] || styles.firstCell, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\", \"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"text-align\"]);\r\n\r\n\t\t\t\t\tif(column.definition.align){\r\n\t\t\t\t\t\tcellEl.style.textAlign = column.definition.align;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(this.table.options.dataTree && this.config.dataTree !== false){\r\n\t\t\t\t\tif((setup.treeElementField && setup.treeElementField == column.field) || (!setup.treeElementField && i == 0)){\r\n\t\t\t\t\t\tif(row.component._row.modules.dataTree.controlEl){\r\n\t\t\t\t\t\t\tcellEl.insertBefore(row.component._row.modules.dataTree.controlEl.cloneNode(true), cellEl.firstChild);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(row.component._row.modules.dataTree.branchEl){\r\n\t\t\t\t\t\t\tcellEl.insertBefore(row.component._row.modules.dataTree.branchEl.cloneNode(true), cellEl.firstChild);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowEl.appendChild(cellEl);\r\n\r\n\t\t\t\tif(cellWrapper.modules.format && cellWrapper.modules.format.renderedCallback){\r\n\t\t\t\t\tcellWrapper.modules.format.renderedCallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(setup.rowFormatter && this.config.formatCells !== false){\r\n\t\t\t\t\tsetup.rowFormatter(row.component);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenereateHTMLTable(list){\r\n\t\tvar holder = document.createElement(\"div\");\r\n\r\n\t\tholder.appendChild(this.genereateTableElement(list));\r\n\r\n\t\treturn holder.innerHTML;\r\n\t}\r\n\r\n\tgetHtml(visible, style, config, colVisProp){\r\n\t\tvar list = this.generateExportList(config || this.table.options.htmlOutputConfig, style, visible, colVisProp || \"htmlOutput\");\r\n\r\n\t\treturn this.genereateHTMLTable(list);\r\n\t}\r\n\r\n\tmapElementStyles(from, to, props){\r\n\t\tif(this.cloneTableStyle && from && to){\r\n\r\n\t\t\tvar lookup = {\r\n\t\t\t\t\"background-color\" : \"backgroundColor\",\r\n\t\t\t\t\"color\" : \"fontColor\",\r\n\t\t\t\t\"width\" : \"width\",\r\n\t\t\t\t\"font-weight\" : \"fontWeight\",\r\n\t\t\t\t\"font-family\" : \"fontFamily\",\r\n\t\t\t\t\"font-size\" : \"fontSize\",\r\n\t\t\t\t\"text-align\" : \"textAlign\",\r\n\t\t\t\t\"border-top\" : \"borderTop\",\r\n\t\t\t\t\"border-left\" : \"borderLeft\",\r\n\t\t\t\t\"border-right\" : \"borderRight\",\r\n\t\t\t\t\"border-bottom\" : \"borderBottom\",\r\n\t\t\t\t\"padding-top\" : \"paddingTop\",\r\n\t\t\t\t\"padding-left\" : \"paddingLeft\",\r\n\t\t\t\t\"padding-right\" : \"paddingRight\",\r\n\t\t\t\t\"padding-bottom\" : \"paddingBottom\",\r\n\t\t\t};\r\n\r\n\t\t\tif(window.getComputedStyle){\r\n\t\t\t\tvar fromStyle = window.getComputedStyle(from);\r\n\r\n\t\t\t\tprops.forEach(function(prop){\r\n\t\t\t\t\tto.style[lookup[prop]] = fromStyle.getPropertyValue(prop);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nExport.moduleName = \"export\";\r\n\r\nexport default Export;\r\n","export default {\r\n\r\n\t//equal to\r\n\t\"=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal == filterVal ? true : false;\r\n\t},\r\n\r\n\t//less than\r\n\t\"<\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal < filterVal ? true : false;\r\n\t},\r\n\r\n\t//less than or equal to\r\n\t\"<=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal <= filterVal ? true : false;\r\n\t},\r\n\r\n\t//greater than\r\n\t\">\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal > filterVal ? true : false;\r\n\t},\r\n\r\n\t//greater than or equal to\r\n\t\">=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal >= filterVal ? true : false;\r\n\t},\r\n\r\n\t//not equal to\r\n\t\"!=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal != filterVal ? true : false;\r\n\t},\r\n\r\n\t\"regex\":function(filterVal, rowVal, rowData, filterParams){\r\n\r\n\t\tif(typeof filterVal == \"string\"){\r\n\t\t\tfilterVal = new RegExp(filterVal);\r\n\t\t}\r\n\r\n\t\treturn filterVal.test(rowVal);\r\n\t},\r\n\r\n\t//contains the string\r\n\t\"like\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().indexOf(filterVal.toLowerCase()) > -1;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//contains the keywords\r\n\t\"keywords\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tvar keywords = filterVal.toLowerCase().split(typeof filterParams.separator === \"undefined\" ? \" \" : filterParams.separator),\r\n\t\tvalue = String(rowVal === null || typeof rowVal === \"undefined\" ? \"\" : rowVal).toLowerCase(),\r\n\t\tmatches = [];\r\n\r\n\t\tkeywords.forEach((keyword) =>{\r\n\t\t\tif(value.includes(keyword)){\r\n\t\t\t\tmatches.push(true);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn filterParams.matchAll ? matches.length === keywords.length : !!matches.length;\r\n\t},\r\n\r\n\t//starts with the string\r\n\t\"starts\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().startsWith(filterVal.toLowerCase());\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//ends with the string\r\n\t\"ends\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().endsWith(filterVal.toLowerCase());\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//in array\r\n\t\"in\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(Array.isArray(filterVal)){\r\n\t\t\treturn filterVal.length ? filterVal.indexOf(rowVal) > -1 : true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Filter Error - filter value is not an array:\", filterVal);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultFilters from './defaults/filters.js';\r\n\r\nclass Filter extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.filterList = []; //hold filter list\r\n\t\tthis.headerFilters = {}; //hold column filters\r\n\t\tthis.headerFilterColumns = []; //hold columns that use header filters\r\n\r\n\t\tthis.prevHeaderFilterChangeCheck = \"\";\r\n\t\tthis.prevHeaderFilterChangeCheck = \"{}\";\r\n\r\n\t\tthis.changed = false; //has filtering changed since last render\r\n\t\tthis.tableInitialized = false;\r\n\r\n\t\tthis.registerTableOption(\"filterMode\", \"local\"); //local or remote filtering\r\n\r\n\t\tthis.registerTableOption(\"initialFilter\", false); //initial filtering criteria\r\n\t\tthis.registerTableOption(\"initialHeaderFilter\", false); //initial header filtering criteria\r\n\t\tthis.registerTableOption(\"headerFilterLiveFilterDelay\", 300); //delay before updating column after user types in header filter\r\n\r\n\t\tthis.registerColumnOption(\"headerFilter\");\r\n\t\tthis.registerColumnOption(\"headerFilterPlaceholder\");\r\n\t\tthis.registerColumnOption(\"headerFilterParams\");\r\n\t\tthis.registerColumnOption(\"headerFilterEmptyCheck\");\r\n\t\tthis.registerColumnOption(\"headerFilterFunc\");\r\n\t\tthis.registerColumnOption(\"headerFilterFuncParams\");\r\n\t\tthis.registerColumnOption(\"headerFilterLiveFilter\");\r\n\r\n\t\tthis.registerTableFunction(\"searchRows\", this.searchRows.bind(this));\r\n\t\tthis.registerTableFunction(\"searchData\", this.searchData.bind(this));\r\n\r\n\t\tthis.registerTableFunction(\"setFilter\", this.userSetFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"refreshFilter\", this.userRefreshFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"addFilter\", this.userAddFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"getFilters\", this.getFilters.bind(this));\r\n\t\tthis.registerTableFunction(\"setHeaderFilterFocus\", this.userSetHeaderFilterFocus.bind(this));\r\n\t\tthis.registerTableFunction(\"getHeaderFilterValue\", this.userGetHeaderFilterValue.bind(this));\r\n\t\tthis.registerTableFunction(\"setHeaderFilterValue\", this.userSetHeaderFilterValue.bind(this));\r\n\t\tthis.registerTableFunction(\"getHeaderFilters\", this.getHeaderFilters.bind(this));\r\n\t\tthis.registerTableFunction(\"removeFilter\", this.userRemoveFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"clearFilter\", this.userClearFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"clearHeaderFilter\", this.userClearHeaderFilter.bind(this));\r\n\r\n\t\tthis.registerComponentFunction(\"column\", \"headerFilterFocus\", this.setHeaderFilterFocus.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"reloadHeaderFilter\", this.reloadHeaderFilter.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"getHeaderFilterValue\", this.getHeaderFilterValue.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"setHeaderFilterValue\", this.setHeaderFilterValue.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumnHeaderFilter.bind(this));\r\n\t\tthis.subscribe(\"column-width-fit-before\", this.hideHeaderFilterElements.bind(this));\r\n\t\tthis.subscribe(\"column-width-fit-after\", this.showHeaderFilterElements.bind(this));\r\n\t\tthis.subscribe(\"table-built\", this.tableBuilt.bind(this));\r\n\r\n\t\tif(this.table.options.filterMode === \"remote\"){\r\n\t\t\tthis.subscribe(\"data-params\", this.remoteFilterParams.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerDataHandler(this.filter.bind(this), 10);\r\n\t}\r\n\r\n\ttableBuilt(){\r\n\t\tif(this.table.options.initialFilter){\r\n\t\t\tthis.setFilter(this.table.options.initialFilter);\r\n\t\t}\r\n\r\n\t\tif(this.table.options.initialHeaderFilter){\r\n\t\t\tthis.table.options.initialHeaderFilter.forEach((item) => {\r\n\r\n\t\t\t\tvar column = this.table.columnManager.findColumn(item.field);\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tthis.setHeaderFilterValue(column, item.value);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", item.field);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.tableInitialized = true;\r\n\t}\r\n\r\n\tremoteFilterParams(data, config, silent, params){\r\n\t\tparams.filter = this.getFilters(true, true);\r\n\t\treturn params;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\t//set standard filters\r\n\tuserSetFilter(field, type, value, params){\r\n\t\tthis.setFilter(field, type, value, params);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//set standard filters\r\n\tuserRefreshFilter(){\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//add filter to array\r\n\tuserAddFilter(field, type, value, params){\r\n\t\tthis.addFilter(field, type, value, params);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\tuserSetHeaderFilterFocus(field){\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\tthis.setHeaderFilterFocus(column);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Focus Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tuserGetHeaderFilterValue(field) {\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\treturn this.getHeaderFilterValue(column);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", field);\r\n\t\t}\r\n\t}\r\n\r\n\tuserSetHeaderFilterValue(field, value){\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\tthis.setHeaderFilterValue(column, value);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//remove filter from array\r\n\tuserRemoveFilter(field, type, value){\r\n\t\tthis.removeFilter(field, type, value);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//clear filters\r\n\tuserClearFilter(all){\r\n\t\tthis.clearFilter(all);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//clear header filters\r\n\tuserClearHeaderFilter(){\r\n\t\tthis.clearHeaderFilter();\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\r\n\t//search for specific row components\r\n\tsearchRows(field, type, value){\r\n\t\treturn this.search(\"rows\", field, type, value);\r\n\t}\r\n\r\n\t//search for specific data\r\n\tsearchData(field, type, value){\r\n\t\treturn this.search(\"data\", field, type, value);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tinitializeColumnHeaderFilter(column){\r\n\t\tvar def = column.definition;\r\n\r\n\t\tif(def.headerFilter){\r\n\r\n\t\t\tif(typeof def.headerFilterPlaceholder !== \"undefined\" && def.field){\r\n\t\t\t\tthis.module(\"localize\").setHeaderFilterColumnPlaceholder(def.field, def.headerFilterPlaceholder);\r\n\t\t\t}\r\n\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\r\n\t//initialize column header filter\r\n\tinitializeColumn(column, value){\r\n\t\tvar self = this,\r\n\t\tfield = column.getField(),\r\n\t\tparams;\r\n\r\n\t\t//handle successfull value change\r\n\t\tfunction success(value){\r\n\t\t\tvar filterType = (column.modules.filter.tagType == \"input\" && column.modules.filter.attrType == \"text\") || column.modules.filter.tagType == \"textarea\" ? \"partial\" : \"match\",\r\n\t\t\ttype = \"\",\r\n\t\t\tfilterChangeCheck = \"\",\r\n\t\t\tfilterFunc;\r\n\r\n\t\t\tif(typeof column.modules.filter.prevSuccess === \"undefined\" || column.modules.filter.prevSuccess !== value){\r\n\r\n\t\t\t\tcolumn.modules.filter.prevSuccess = value;\r\n\r\n\t\t\t\tif(!column.modules.filter.emptyFunc(value)){\r\n\t\t\t\t\tcolumn.modules.filter.value = value;\r\n\r\n\t\t\t\t\tswitch(typeof column.definition.headerFilterFunc){\r\n\t\t\t\t\t\tcase \"string\":\r\n\t\t\t\t\t\tif(Filter.filters[column.definition.headerFilterFunc]){\r\n\t\t\t\t\t\t\ttype = column.definition.headerFilterFunc;\r\n\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\tvar params = column.definition.headerFilterFuncParams || {};\r\n\t\t\t\t\t\t\t\tvar fieldVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\t\tparams = typeof params === \"function\" ? params(value, fieldVal, data) : params;\r\n\r\n\t\t\t\t\t\t\t\treturn Filter.filters[column.definition.headerFilterFunc](value, fieldVal, data, params);\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tconsole.warn(\"Header Filter Error - Matching filter function not found: \", column.definition.headerFilterFunc);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"function\":\r\n\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\tvar params = column.definition.headerFilterFuncParams || {};\r\n\t\t\t\t\t\t\tvar fieldVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\tparams = typeof params === \"function\" ? params(value, fieldVal, data) : params;\r\n\r\n\t\t\t\t\t\t\treturn column.definition.headerFilterFunc(value, fieldVal, data, params);\r\n\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\ttype = filterFunc;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(!filterFunc){\r\n\t\t\t\t\t\tswitch(filterType){\r\n\t\t\t\t\t\t\tcase \"partial\":\r\n\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\tvar colVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\t\tif(typeof colVal !== 'undefined' && colVal !== null){\r\n\t\t\t\t\t\t\t\t\treturn String(colVal).toLowerCase().indexOf(String(value).toLowerCase()) > -1;\r\n\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\ttype = \"like\";\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\treturn column.getFieldValue(data) == value;\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\ttype = \"=\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tself.headerFilters[field] = {value:value, func:filterFunc, type:type, params:params || {}};\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdelete self.headerFilters[field];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcolumn.modules.filter.value = value;\r\n\r\n\t\t\t\tfilterChangeCheck = JSON.stringify(self.headerFilters);\r\n\r\n\t\t\t\tif(self.prevHeaderFilterChangeCheck !== filterChangeCheck){\r\n\t\t\t\t\tself.prevHeaderFilterChangeCheck = filterChangeCheck;\r\n\r\n\t\t\t\t\tself.trackChanges();\r\n\t\t\t\t\tself.refreshFilter();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tcolumn.modules.filter = {\r\n\t\t\tsuccess:success,\r\n\t\t\tattrType:false,\r\n\t\t\ttagType:false,\r\n\t\t\temptyFunc:false,\r\n\t\t};\r\n\r\n\t\tthis.generateHeaderFilterElement(column);\r\n\t}\r\n\r\n\tgenerateHeaderFilterElement(column, initialValue, reinitialize){\r\n\t\tvar self = this,\r\n\t\tsuccess = column.modules.filter.success,\r\n\t\tfield = column.getField(),\r\n\t\tfilterElement, editor, editorElement, cellWrapper, typingTimer, searchTrigger, params;\r\n\r\n\t\tcolumn.modules.filter.value = initialValue;\r\n\r\n\t\t//handle aborted edit\r\n\t\tfunction cancel(){}\r\n\r\n\t\tif(column.modules.filter.headerElement && column.modules.filter.headerElement.parentNode){\r\n\t\t\tcolumn.contentElement.removeChild(column.modules.filter.headerElement.parentNode);\r\n\t\t}\r\n\r\n\t\tif(field){\r\n\r\n\t\t\t//set empty value function\r\n\t\t\tcolumn.modules.filter.emptyFunc = column.definition.headerFilterEmptyCheck || function(value){\r\n\t\t\t\treturn !value && value !== \"0\" && value !== 0;\r\n\t\t\t};\r\n\r\n\t\t\tfilterElement = document.createElement(\"div\");\r\n\t\t\tfilterElement.classList.add(\"tabulator-header-filter\");\r\n\r\n\t\t\t//set column editor\r\n\t\t\tswitch(typeof column.definition.headerFilter){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tif(self.table.modules.edit.editors[column.definition.headerFilter]){\r\n\t\t\t\t\teditor = self.table.modules.edit.editors[column.definition.headerFilter];\r\n\r\n\t\t\t\t\tif((column.definition.headerFilter === \"tick\" || column.definition.headerFilter === \"tickCross\") && !column.definition.headerFilterEmptyCheck){\r\n\t\t\t\t\t\tcolumn.modules.filter.emptyFunc = function(value){\r\n\t\t\t\t\t\t\treturn value !== true && value !== false;\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Filter Error - Cannot build header filter, No such editor found: \", column.definition.editor);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\teditor = column.definition.headerFilter;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\tif(column.modules.edit && column.modules.edit.editor){\r\n\t\t\t\t\teditor = column.modules.edit.editor;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(column.definition.formatter && self.table.modules.edit.editors[column.definition.formatter]){\r\n\t\t\t\t\t\teditor = self.table.modules.edit.editors[column.definition.formatter];\r\n\r\n\t\t\t\t\t\tif((column.definition.formatter === \"tick\" || column.definition.formatter === \"tickCross\") && !column.definition.headerFilterEmptyCheck){\r\n\t\t\t\t\t\t\tcolumn.modules.filter.emptyFunc = function(value){\r\n\t\t\t\t\t\t\t\treturn value !== true && value !== false;\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\teditor = self.table.modules.edit.editors[\"input\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(editor){\r\n\r\n\t\t\t\tcellWrapper = {\r\n\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\treturn typeof initialValue !== \"undefined\" ? initialValue : \"\";\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetField:function(){\r\n\t\t\t\t\t\treturn column.definition.field;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\treturn filterElement;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tnormalizeHeight:function(){\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\r\n\t\t\t\tparams = column.definition.headerFilterParams || {};\r\n\r\n\t\t\t\tparams = typeof params === \"function\" ? params.call(self.table, cellWrapper) : params;\r\n\r\n\t\t\t\teditorElement = editor.call(this.table.modules.edit, cellWrapper, function(){}, success, cancel, params);\r\n\r\n\t\t\t\tif(!editorElement){\r\n\t\t\t\t\tconsole.warn(\"Filter Error - Cannot add filter to \" + field + \" column, editor returned a value of false\");\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!(editorElement instanceof Node)){\r\n\t\t\t\t\tconsole.warn(\"Filter Error - Cannot add filter to \" + field + \" column, editor should return an instance of Node, the editor returned:\", editorElement);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//set Placeholder Text\r\n\t\t\t\tif(field){\r\n\t\t\t\t\tself.langBind(\"headerFilters|columns|\" + column.definition.field, function(value){\r\n\t\t\t\t\t\teditorElement.setAttribute(\"placeholder\", typeof value !== \"undefined\" && value ? value : self.langText(\"headerFilters|default\"));\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself.langBind(\"headerFilters|default\", function(value){\r\n\t\t\t\t\t\teditorElement.setAttribute(\"placeholder\", value);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//focus on element on click\r\n\t\t\t\teditorElement.addEventListener(\"click\", function(e){\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\teditorElement.focus();\r\n\t\t\t\t});\r\n\r\n\t\t\t\teditorElement.addEventListener(\"focus\", (e) => {\r\n\t\t\t\t\tvar left = this.table.columnManager.element.scrollLeft;\r\n\r\n\t\t\t\t\tvar headerPos = this.table.rowManager.element.scrollLeft + parseInt(this.table.columnManager.element.style.marginLeft);\r\n\r\n\t\t\t\t\tif(left !== headerPos){\r\n\t\t\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\t\t\tthis.table.columnManager.scrollHorizontal(left);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\t//live update filters as user types\r\n\t\t\t\ttypingTimer = false;\r\n\r\n\t\t\t\tsearchTrigger = function(e){\r\n\t\t\t\t\tif(typingTimer){\r\n\t\t\t\t\t\tclearTimeout(typingTimer);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\ttypingTimer = setTimeout(function(){\r\n\t\t\t\t\t\tsuccess(editorElement.value);\r\n\t\t\t\t\t},self.table.options.headerFilterLiveFilterDelay);\r\n\t\t\t\t};\r\n\r\n\t\t\t\tcolumn.modules.filter.headerElement = editorElement;\r\n\t\t\t\tcolumn.modules.filter.attrType = editorElement.hasAttribute(\"type\") ? editorElement.getAttribute(\"type\").toLowerCase() : \"\" ;\r\n\t\t\t\tcolumn.modules.filter.tagType = editorElement.tagName.toLowerCase();\r\n\r\n\t\t\t\tif(column.definition.headerFilterLiveFilter !== false){\r\n\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\t!(\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === 'autocomplete' ||\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === 'tickCross' ||\r\n\t\t\t\t\t\t\t((column.definition.editor === 'autocomplete' ||\r\n\t\t\t\t\t\t\t\tcolumn.definition.editor === 'tickCross') &&\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === true)\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t) {\r\n\t\t\t\t\t\teditorElement.addEventListener(\"keyup\", searchTrigger);\r\n\t\t\t\t\teditorElement.addEventListener(\"search\", searchTrigger);\r\n\r\n\r\n\t\t\t\t\t//update number filtered columns on change\r\n\t\t\t\t\tif(column.modules.filter.attrType == \"number\"){\r\n\t\t\t\t\t\teditorElement.addEventListener(\"change\", function(e){\r\n\t\t\t\t\t\t\tsuccess(editorElement.value);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//change text inputs to search inputs to allow for clearing of field\r\n\t\t\t\t\tif(column.modules.filter.attrType == \"text\" && this.table.browser !== \"ie\"){\r\n\t\t\t\t\t\teditorElement.setAttribute(\"type\", \"search\");\r\n\t\t\t\t\t\t// editorElement.off(\"change blur\"); //prevent blur from triggering filter and preventing selection click\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t\t//prevent input and select elements from propegating click to column sorters etc\r\n\t\t\t\t\tif(column.modules.filter.tagType == \"input\" || column.modules.filter.tagType == \"select\" || column.modules.filter.tagType == \"textarea\"){\r\n\t\t\t\t\t\teditorElement.addEventListener(\"mousedown\",function(e){\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfilterElement.appendChild(editorElement);\r\n\r\n\t\t\t\tcolumn.contentElement.appendChild(filterElement);\r\n\r\n\t\t\t\tif(!reinitialize){\r\n\t\t\t\t\tself.headerFilterColumns.push(column);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Filter Error - Cannot add header filter, column has no field set:\", column.definition.title);\r\n\t\t}\r\n\t}\r\n\r\n\t//hide all header filter elements (used to ensure correct column widths in \"fitData\" layout mode)\r\n\thideHeaderFilterElements(){\r\n\t\tthis.headerFilterColumns.forEach(function(column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tcolumn.modules.filter.headerElement.style.display = 'none';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//show all header filter elements (used to ensure correct column widths in \"fitData\" layout mode)\r\n\tshowHeaderFilterElements(){\r\n\t\tthis.headerFilterColumns.forEach(function(column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tcolumn.modules.filter.headerElement.style.display = '';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//programatically set focus of header filter\r\n\tsetHeaderFilterFocus(column){\r\n\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\tcolumn.modules.filter.headerElement.focus();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Focus Error - No header filter set on column:\", column.getField());\r\n\t\t}\r\n\t}\r\n\r\n\t//programmatically get value of header filter\r\n\tgetHeaderFilterValue(column){\r\n\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\treturn column.modules.filter.value;\r\n\t\t} else {\r\n\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t}\r\n\t}\r\n\r\n\t//programatically set value of header filter\r\n\tsetHeaderFilterValue(column, value){\r\n\t\tif (column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tthis.generateHeaderFilterElement(column, value, true);\r\n\t\t\t\tcolumn.modules.filter.success(value);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treloadHeaderFilter(column){\r\n\t\tif (column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tthis.generateHeaderFilterElement(column, column.modules.filter.value, true);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trefreshFilter(){\r\n\t\tif(this.tableInitialized){\r\n\t\t\tif(this.table.options.filterMode === \"remote\"){\r\n\t\t\t\tthis.reloadData(null, false, false);\r\n\t\t\t}else{\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//TODO - Persist left position of row manager\r\n\t\t// left = this.scrollLeft;\r\n\t\t// this.scrollHorizontal(left);\r\n\t}\r\n\r\n\t//check if the filters has changed since last use\r\n\ttrackChanges(){\r\n\t\tthis.changed = true;\r\n\t\tthis.dispatch(\"filter-changed\");\r\n\t}\r\n\r\n\t//check if the filters has changed since last use\r\n\thasChanged(){\r\n\t\tvar changed = this.changed;\r\n\t\tthis.changed = false;\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t//set standard filters\r\n\tsetFilter(field, type, value, params){\r\n\t\tthis.filterList = [];\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value, params:params}];\r\n\t\t}\r\n\r\n\t\tthis.addFilter(field);\r\n\t}\r\n\r\n\t//add filter to array\r\n\taddFilter(field, type, value, params){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value, params:params}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\tthis.filterList.push(filter);\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.trackChanges();\r\n\t\t}\r\n\t}\r\n\r\n\tfindFilter(filter){\r\n\t\tvar column;\r\n\r\n\t\tif(Array.isArray(filter)){\r\n\t\t\treturn this.findSubFilters(filter);\r\n\t\t}\r\n\r\n\t\tvar filterFunc = false;\r\n\r\n\t\tif(typeof filter.field == \"function\"){\r\n\t\t\tfilterFunc = function(data){\r\n\t\t\t\treturn filter.field(data, filter.type || {})// pass params to custom filter function\r\n\t\t\t};\r\n\t\t}else{\r\n\r\n\t\t\tif(Filter.filters[filter.type]){\r\n\r\n\t\t\t\tcolumn = this.table.columnManager.getColumnByField(filter.field);\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\treturn Filter.filters[filter.type](filter.value, column.getFieldValue(data), data, filter.params || {});\r\n\t\t\t\t\t};\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\treturn Filter.filters[filter.type](filter.value, data[filter.field], data, filter.params || {});\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Filter Error - No such filter type found, ignoring: \", filter.type);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfilter.func = filterFunc;\r\n\r\n\t\treturn filter.func ? filter : false;\r\n\t}\r\n\r\n\tfindSubFilters(filters){\r\n\t\tvar output = [];\r\n\r\n\t\tfilters.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\toutput.push(filter);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output.length ? output : false;\r\n\t}\r\n\r\n\t//get all filters\r\n\tgetFilters(all, ajax){\r\n\t\tvar output = [];\r\n\r\n\t\tif(all){\r\n\t\t\toutput = this.getHeaderFilters();\r\n\t\t}\r\n\r\n\t\tif(ajax){\r\n\t\t\toutput.forEach(function(item){\r\n\t\t\t\tif(typeof item.type == \"function\"){\r\n\t\t\t\t\titem.type = \"function\";\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\toutput = output.concat(this.filtersToArray(this.filterList, ajax));\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//filter to Object\r\n\tfiltersToArray(filterList, ajax){\r\n\t\tvar output = [];\r\n\r\n\t\tfilterList.forEach((filter) => {\r\n\t\t\tvar item;\r\n\r\n\t\t\tif(Array.isArray(filter)){\r\n\t\t\t\toutput.push(this.filtersToArray(filter, ajax));\r\n\t\t\t}else{\r\n\t\t\t\titem = {field:filter.field, type:filter.type, value:filter.value}\r\n\r\n\t\t\t\tif(ajax){\r\n\t\t\t\t\tif(typeof item.type == \"function\"){\r\n\t\t\t\t\t\titem.type = \"function\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\toutput.push(item);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//get all filters\r\n\tgetHeaderFilters(){\r\n\t\tvar output = [];\r\n\r\n\t\tfor(var key in this.headerFilters){\r\n\t\t\toutput.push({field:key, type:this.headerFilters[key].type, value:this.headerFilters[key].value});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//remove filter from array\r\n\tremoveFilter(field, type, value){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tvar index = -1;\r\n\r\n\t\t\tif(typeof filter.field == \"object\"){\r\n\t\t\t\tindex = this.filterList.findIndex((element) => {\r\n\t\t\t\t\treturn filter === element;\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tindex = this.filterList.findIndex((element) => {\r\n\t\t\t\t\treturn filter.field === element.field && filter.type === element.type && filter.value === element.value;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.filterList.splice(index, 1);\r\n\t\t\t\tchanged = true;\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Filter Error - No matching filter type found, ignoring: \", filter.type);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//clear filters\r\n\tclearFilter(all){\r\n\t\tthis.filterList = [];\r\n\r\n\t\tif(all){\r\n\t\t\tthis.clearHeaderFilter();\r\n\t\t}\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//clear header filters\r\n\tclearHeaderFilter(){\r\n\t\tthis.headerFilters = {};\r\n\t\tthis.prevHeaderFilterChangeCheck = \"{}\";\r\n\r\n\t\tthis.headerFilterColumns.forEach((column) => {\r\n\t\t\tif(typeof column.modules.filter.value !== \"undefined\"){\r\n\t\t\t\tdelete column.modules.filter.value;\r\n\t\t\t}\r\n\t\t\tcolumn.modules.filter.prevSuccess = undefined;\r\n\t\t\tthis.reloadHeaderFilter(column);\r\n\t\t});\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//search data and return matching rows\r\n\tsearch (searchType, field, type, value){\r\n\t\tvar activeRows = [],\r\n\t\tfilterList = [];\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\tfilterList.push(filter);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\tvar match = true;\r\n\r\n\t\t\tfilterList.forEach((filter) => {\r\n\t\t\t\tif(!this.filterRecurse(filter, row.getData())){\r\n\t\t\t\t\tmatch = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tactiveRows.push(searchType === \"data\" ? row.getData(\"data\") : row.getComponent());\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t\treturn activeRows;\r\n\t}\r\n\r\n\t//filter row array\r\n\tfilter(rowList, filters){\r\n\t\tvar activeRows = [],\r\n\t\tactiveRowComponents = [];\r\n\r\n\t\tif(this.subscribedExternal(\"dataFiltering\")){\r\n\t\t\tthis.dispatchExternal(\"dataFiltering\", this.getFilters(true));\r\n\t\t}\r\n\r\n\t\tif(this.table.options.filterMode !== \"remote\" && (this.filterList.length || Object.keys(this.headerFilters).length)){\r\n\r\n\t\t\trowList.forEach((row) => {\r\n\t\t\t\tif(this.filterRow(row)){\r\n\t\t\t\t\tactiveRows.push(row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t}else{\r\n\t\t\tactiveRows = rowList.slice(0);\r\n\t\t}\r\n\r\n\t\tif(this.subscribedExternal(\"dataFiltered\")){\r\n\r\n\t\t\tactiveRows.forEach((row) => {\r\n\t\t\t\tactiveRowComponents.push(row.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatchExternal(\"dataFiltered\", this.getFilters(true), activeRowComponents);\r\n\t\t}\r\n\r\n\t\treturn activeRows;\r\n\t}\r\n\r\n\t//filter individual row\r\n\tfilterRow(row, filters){\r\n\t\tvar match = true,\r\n\t\tdata = row.getData();\r\n\r\n\t\tthis.filterList.forEach((filter) => {\r\n\t\t\tif(!this.filterRecurse(filter, data)){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\tfor(var field in this.headerFilters){\r\n\t\t\tif(!this.headerFilters[field].func(data)){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tfilterRecurse(filter, data){\r\n\t\tvar match = false;\r\n\r\n\t\tif(Array.isArray(filter)){\r\n\t\t\tfilter.forEach((subFilter) => {\r\n\t\t\t\tif(this.filterRecurse(subFilter, data)){\r\n\t\t\t\t\tmatch = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tmatch = filter.func(data);\r\n\t\t}\r\n\r\n\t\treturn match;\r\n\t}\r\n}\r\n\r\nFilter.moduleName = \"filter\";\r\n\r\n//load defaults\r\nFilter.filters = defaultFilters;\r\n\r\nexport default Filter;","export default function(cell, formatterParams, onRendered){\r\n\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n};","export default function(cell, formatterParams, onRendered){\r\n\treturn cell.getValue();\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().style.whiteSpace = \"pre-wrap\";\r\n\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar floatVal = parseFloat(cell.getValue()),\r\n\tsign = \"\",\r\n\tnumber, integer, decimal, rgx;\r\n\r\n\tvar decimalSym = formatterParams.decimal || \".\";\r\n\tvar thousandSym = formatterParams.thousand || \",\";\r\n\tvar negativeSign = formatterParams.negativeSign || \"-\";\r\n\tvar symbol = formatterParams.symbol || \"\";\r\n\tvar after = !!formatterParams.symbolAfter;\r\n\tvar precision = typeof formatterParams.precision !== \"undefined\" ? formatterParams.precision : 2;\r\n\r\n\tif(isNaN(floatVal)){\r\n\t\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n\t}\r\n\r\n\tif(floatVal < 0){\r\n\t\tfloatVal = Math.abs(floatVal);\r\n\t\tsign = negativeSign;\r\n\t}\r\n\r\n\tnumber = precision !== false ? floatVal.toFixed(precision) : floatVal;\r\n\tnumber = String(number).split(\".\");\r\n\r\n\tinteger = number[0];\r\n\tdecimal = number.length > 1 ? decimalSym + number[1] : \"\";\r\n\r\n\tif (formatterParams.thousand !== false) {\r\n\t\trgx = /(\\d+)(\\d{3})/;\r\n\r\n\t\twhile (rgx.test(integer)){\r\n\t\t\tinteger = integer.replace(rgx, \"$1\" + thousandSym + \"$2\");\r\n\t\t}\r\n\t}\r\n\r\n\treturn after ? sign + integer + decimal + symbol : sign + symbol + integer + decimal;\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\turlPrefix = formatterParams.urlPrefix || \"\",\r\n\tdownload = formatterParams.download,\r\n\tlabel = value,\r\n\tel = document.createElement(\"a\"),\r\n\tdata;\r\n\r\n\tfunction labelTraverse(path, data){\r\n\t\tvar item = path.shift(),\r\n\t\tvalue = data[item];\r\n\t\t\r\n\t\tif(path.length && typeof value === \"object\"){\r\n\t\t\treturn labelTraverse(path, value);\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t};\r\n\r\n\tif(formatterParams.labelField){\r\n\t\tdata = cell.getData();\r\n\t\tlabel = labelTraverse(formatterParams.labelField.split(this.table.options.nestedFieldSeparator), data);\r\n\t}\r\n\r\n\tif(formatterParams.label){\r\n\t\tswitch(typeof formatterParams.label){\r\n\t\t\tcase \"string\":\r\n\t\t\tlabel = formatterParams.label;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tlabel = formatterParams.label(cell);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif(label){\r\n\t\tif(formatterParams.urlField){\r\n\t\t\tdata = cell.getData();\r\n\t\t\tvalue = data[formatterParams.urlField];\r\n\t\t}\r\n\r\n\t\tif(formatterParams.url){\r\n\t\t\tswitch(typeof formatterParams.url){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tvalue = formatterParams.url;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tvalue = formatterParams.url(cell);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tel.setAttribute(\"href\", urlPrefix + value);\r\n\r\n\t\tif(formatterParams.target){\r\n\t\t\tel.setAttribute(\"target\", formatterParams.target);\r\n\t\t}\r\n\r\n\t\tif(formatterParams.download){\r\n\r\n\t\t\tif(typeof download == \"function\"){\r\n\t\t\t\tdownload = download(cell);\r\n\t\t\t}else{\r\n\t\t\t\tdownload = download === true ? \"\" : download;\r\n\t\t\t}\r\n\r\n\t\t\tel.setAttribute(\"download\", download);\r\n\t\t}\r\n\r\n\t\tel.innerHTML = this.emptyToSpace(this.sanitizeHTML(label));\r\n\r\n\t\treturn el;\r\n\t}else{\r\n\t\treturn \" \";\r\n\t}\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar el = document.createElement(\"img\"),\r\n\tsrc = cell.getValue();\r\n\r\n\tif(formatterParams.urlPrefix){\r\n\t\tsrc = formatterParams.urlPrefix + cell.getValue();\r\n\t}\r\n\r\n\tif(formatterParams.urlSuffix){\r\n\t\tsrc = src + formatterParams.urlSuffix;\r\n\t}\r\n\r\n\tel.setAttribute(\"src\", src);\r\n\r\n\tswitch(typeof formatterParams.height){\r\n\t\tcase \"number\":\r\n\t\tel.style.height = formatterParams.height + \"px\";\r\n\t\tbreak;\r\n\r\n\t\tcase \"string\":\r\n\t\tel.style.height = formatterParams.height;\r\n\t\tbreak;\r\n\t}\r\n\r\n\tswitch(typeof formatterParams.width){\r\n\t\tcase \"number\":\r\n\t\tel.style.width = formatterParams.width + \"px\";\r\n\t\tbreak;\r\n\r\n\t\tcase \"string\":\r\n\t\tel.style.width = formatterParams.width;\r\n\t\tbreak;\r\n\t}\r\n\r\n\tel.addEventListener(\"load\", function(){\r\n\t\tcell.getRow().normalizeHeight();\r\n\t});\r\n\r\n\treturn el;\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\telement = cell.getElement(),\r\n\tempty = formatterParams.allowEmpty,\r\n\ttruthy = formatterParams.allowTruthy,\r\n\ttrueValueSet = Object.keys(formatterParams).includes(\"trueValue\"),\r\n\ttick = typeof formatterParams.tickElement !== \"undefined\" ? formatterParams.tickElement : '',\r\n\tcross = typeof formatterParams.crossElement !== \"undefined\" ? formatterParams.crossElement : '';\r\n\r\n\tif((trueValueSet && value === formatterParams.trueValue) || (!trueValueSet && ((truthy && value) || (value === true || value === \"true\" || value === \"True\" || value === 1 || value === \"1\")))){\r\n\t\telement.setAttribute(\"aria-checked\", true);\r\n\t\treturn tick || \"\";\r\n\t}else{\r\n\t\tif(empty && (value === \"null\" || value === \"\" || value === null || typeof value === \"undefined\")){\r\n\t\t\telement.setAttribute(\"aria-checked\", \"mixed\");\r\n\t\t\treturn \"\";\r\n\t\t}else{\r\n\t\t\telement.setAttribute(\"aria-checked\", false);\r\n\t\t\treturn cross || \"\";\r\n\t\t}\r\n\t}\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar inputFormat = formatterParams.inputFormat || \"yyyy-MM-dd HH:mm:ss\";\r\n\tvar\toutputFormat = formatterParams.outputFormat || \"dd/MM/yyyy HH:mm:ss\";\r\n\tvar\tinvalid = typeof formatterParams.invalidPlaceholder !== \"undefined\" ? formatterParams.invalidPlaceholder : \"\";\r\n\tvar value = cell.getValue();\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tvar newDatetime;\r\n\r\n\t\tif(DT.isDateTime(value)){\r\n\t\t\t newDatetime = value;\r\n\t\t }else if(inputFormat === \"iso\"){\r\n\t\t\t newDatetime = DT.fromISO(String(value));\r\n\t\t }else{\r\n\t\t\t newDatetime = DT.fromFormat(String(value), inputFormat);\r\n\t\t }\r\n\r\n\t\tif(newDatetime.isValid){\r\n\t\t\tif(formatterParams.timezone){\r\n\t\t\t\tnewDatetime = newDatetime.setZone(formatterParams.timezone);\r\n\t\t\t}\r\n\r\n\t\t\treturn newDatetime.toFormat(outputFormat);\r\n\t\t}else{\r\n\t\t\tif(invalid === true || !value){\r\n\t\t\t\treturn value;\r\n\t\t\t}else if(typeof invalid === \"function\"){\r\n\t\t\t\treturn invalid(value);\r\n\t\t\t}else{\r\n\t\t\t\treturn invalid;\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tconsole.error(\"Format Error - 'datetime' formatter is dependant on luxon.js\");\r\n\t}\r\n};","export default function (cell, formatterParams, onRendered) {\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar inputFormat = formatterParams.inputFormat || \"yyyy-MM-dd HH:mm:ss\";\r\n\tvar invalid = typeof formatterParams.invalidPlaceholder !== \"undefined\" ? formatterParams.invalidPlaceholder : \"\";\r\n\tvar suffix = typeof formatterParams.suffix !== \"undefined\" ? formatterParams.suffix : false;\r\n\tvar unit = typeof formatterParams.unit !== \"undefined\" ? formatterParams.unit : \"days\";\r\n\tvar humanize = typeof formatterParams.humanize !== \"undefined\" ? formatterParams.humanize : false;\r\n\tvar date = typeof formatterParams.date !== \"undefined\" ? formatterParams.date : DT.now();\r\n\tvar value = cell.getValue();\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tvar newDatetime;\r\n\r\n\t\tif(DT.isDateTime(value)){\r\n\t\t\t newDatetime = value;\r\n\t\t }else if(inputFormat === \"iso\"){\r\n\t\t\t newDatetime = DT.fromISO(String(value));\r\n\t\t }else{\r\n\t\t\t newDatetime = DT.fromFormat(String(value), inputFormat);\r\n\t\t }\r\n\r\n\t\tif (newDatetime.isValid){\r\n\t\t\tif(humanize){\r\n\t\t\t\treturn newDatetime.diff(date, unit).toHuman() + (suffix ? \" \" + suffix : \"\");\r\n\t\t\t}else{\r\n\t\t\t\treturn parseInt(newDatetime.diff(date, unit)[unit]) + (suffix ? \" \" + suffix : \"\");\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\tif (invalid === true) {\r\n\t\t\t\treturn value;\r\n\t\t\t} else if (typeof invalid === \"function\") {\r\n\t\t\t\treturn invalid(value);\r\n\t\t\t} else {\r\n\t\t\t\treturn invalid;\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tconsole.error(\"Format Error - 'datetimediff' formatter is dependant on luxon.js\");\r\n\t}\r\n};","export default function (cell, formatterParams, onRendered) {\r\n\tvar value = cell.getValue();\r\n\r\n\tif (typeof formatterParams[value] === \"undefined\") {\r\n\t\tconsole.warn('Missing display value for ' + value);\r\n\t\treturn value;\r\n\t}\r\n\r\n\treturn formatterParams[value];\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\telement = cell.getElement(),\r\n\tmaxStars = formatterParams && formatterParams.stars ? formatterParams.stars : 5,\r\n\tstars = document.createElement(\"span\"),\r\n\tstar = document.createElementNS('http://www.w3.org/2000/svg', \"svg\"),\r\n\tstarActive = '',\r\n\tstarInactive = '';\r\n\r\n\t//style stars holder\r\n\tstars.style.verticalAlign = \"middle\";\r\n\r\n\t//style star\r\n\tstar.setAttribute(\"width\", \"14\");\r\n\tstar.setAttribute(\"height\", \"14\");\r\n\tstar.setAttribute(\"viewBox\", \"0 0 512 512\");\r\n\tstar.setAttribute(\"xml:space\", \"preserve\");\r\n\tstar.style.padding = \"0 1px\";\r\n\r\n\tvalue = value && !isNaN(value) ? parseInt(value) : 0;\r\n\r\n\tvalue = Math.max(0, Math.min(value, maxStars));\r\n\r\n\tfor(var i=1;i<= maxStars;i++){\r\n\t\tvar nextStar = star.cloneNode(true);\r\n\t\tnextStar.innerHTML = i <= value ? starActive : starInactive;\r\n\r\n\t\tstars.appendChild(nextStar);\r\n\t}\r\n\r\n\telement.style.whiteSpace = \"nowrap\";\r\n\telement.style.overflow = \"hidden\";\r\n\telement.style.textOverflow = \"ellipsis\";\r\n\r\n\telement.setAttribute(\"aria-label\", value);\r\n\r\n\treturn stars;\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar value = this.sanitizeHTML(cell.getValue()) || 0,\r\n\tel = document.createElement(\"span\"),\r\n\tmax = formatterParams && formatterParams.max ? formatterParams.max : 100,\r\n\tmin = formatterParams && formatterParams.min ? formatterParams.min : 0,\r\n\tcolors = formatterParams && typeof formatterParams.color !== \"undefined\" ? formatterParams.color : [\"red\", \"orange\", \"green\"],\r\n\tcolor = \"#666666\",\r\n\tpercent, percentValue;\r\n\r\n\tif(isNaN(value) || typeof cell.getValue() === \"undefined\"){\r\n\t\treturn;\r\n\t}\r\n\r\n\tel.classList.add(\"tabulator-traffic-light\");\r\n\r\n\t//make sure value is in range\r\n\tpercentValue = parseFloat(value) <= max ? parseFloat(value) : max;\r\n\tpercentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min;\r\n\r\n\t//workout percentage\r\n\tpercent = (max - min) / 100;\r\n\tpercentValue = Math.round((percentValue - min) / percent);\r\n\r\n\t//set color\r\n\tswitch(typeof colors){\r\n\t\tcase \"string\":\r\n\t\tcolor = colors;\r\n\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\tcolor = colors(value);\r\n\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\tif(Array.isArray(colors)){\r\n\t\t\tvar unit = 100 / colors.length;\r\n\t\t\tvar index = Math.floor(percentValue / unit);\r\n\r\n\t\t\tindex = Math.min(index, colors.length - 1);\r\n\t\t\tindex = Math.max(index, 0);\r\n\t\t\tcolor = colors[index];\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tel.style.backgroundColor = color;\r\n\r\n\treturn el;\r\n};","import CellComponent from '../../../../core/cell/CellComponent.js';\r\n\r\nexport default function(cell, formatterParams, onRendered){ //progress bar\r\n\tvar value = this.sanitizeHTML(cell.getValue()) || 0,\r\n\telement = cell.getElement(),\r\n\tmax = formatterParams && formatterParams.max ? formatterParams.max : 100,\r\n\tmin = formatterParams && formatterParams.min ? formatterParams.min : 0,\r\n\tlegendAlign = formatterParams && formatterParams.legendAlign ? formatterParams.legendAlign : \"center\",\r\n\tpercent, percentValue, color, legend, legendColor, top, left, right, bottom;\r\n\r\n\t//make sure value is in range\r\n\tpercentValue = parseFloat(value) <= max ? parseFloat(value) : max;\r\n\tpercentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min;\r\n\r\n\t//workout percentage\r\n\tpercent = (max - min) / 100;\r\n\tpercentValue = Math.round((percentValue - min) / percent);\r\n\r\n\t//set bar color\r\n\tswitch(typeof formatterParams.color){\r\n\t\tcase \"string\":\r\n\t\tcolor = formatterParams.color;\r\n\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\tcolor = formatterParams.color(value);\r\n\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\tif(Array.isArray(formatterParams.color)){\r\n\t\t\tvar unit = 100 / formatterParams.color.length;\r\n\t\t\tvar index = Math.floor(percentValue / unit);\r\n\r\n\t\t\tindex = Math.min(index, formatterParams.color.length - 1);\r\n\t\t\tindex = Math.max(index, 0);\r\n\t\t\tcolor = formatterParams.color[index];\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tdefault:\r\n\t\tcolor = \"#2DC214\";\r\n\t}\r\n\r\n\t//generate legend\r\n\tswitch(typeof formatterParams.legend){\r\n\t\tcase \"string\":\r\n\t\tlegend = formatterParams.legend;\r\n\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\tlegend = formatterParams.legend(value);\r\n\t\tbreak;\r\n\t\tcase \"boolean\":\r\n\t\tlegend = value;\r\n\t\tbreak;\r\n\t\tdefault:\r\n\t\tlegend = false;\r\n\t}\r\n\r\n\t//set legend color\r\n\tswitch(typeof formatterParams.legendColor){\r\n\t\tcase \"string\":\r\n\t\tlegendColor = formatterParams.legendColor;\r\n\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\tlegendColor = formatterParams.legendColor(value);\r\n\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\tif(Array.isArray(formatterParams.legendColor)){\r\n\t\t\tvar unit = 100 / formatterParams.legendColor.length;\r\n\t\t\tvar index = Math.floor(percentValue / unit);\r\n\r\n\t\t\tindex = Math.min(index, formatterParams.legendColor.length - 1);\r\n\t\t\tindex = Math.max(index, 0);\r\n\t\t\tlegendColor = formatterParams.legendColor[index];\r\n\t\t}\r\n\t\tbreak;\r\n\t\tdefault:\r\n\t\tlegendColor = \"#000\";\r\n\t}\r\n\r\n\telement.style.minWidth = \"30px\";\r\n\telement.style.position = \"relative\";\r\n\r\n\telement.setAttribute(\"aria-label\", percentValue);\r\n\r\n\tvar barEl = document.createElement(\"div\");\r\n\tbarEl.style.display = \"inline-block\";\r\n\tbarEl.style.position = \"absolute\";\r\n\tbarEl.style.width = percentValue + \"%\";\r\n\tbarEl.style.backgroundColor = color;\r\n\tbarEl.style.height = \"100%\";\r\n\r\n\tbarEl.setAttribute('data-max', max);\r\n\tbarEl.setAttribute('data-min', min);\r\n\r\n\tvar barContainer = document.createElement(\"div\");\r\n\tbarContainer.style.position = \"relative\";\r\n\tbarContainer.style.width = \"100%\";\r\n\tbarContainer.style.height = \"100%\";\r\n\r\n\tif(legend){\r\n\t\tvar legendEl = document.createElement(\"div\");\r\n\t\tlegendEl.style.position = \"absolute\";\r\n\t\tlegendEl.style.top = 0;\r\n\t\tlegendEl.style.left = 0;\r\n\t\tlegendEl.style.textAlign = legendAlign;\r\n\t\tlegendEl.style.width = \"100%\";\r\n\t\tlegendEl.style.color = legendColor;\r\n\t\tlegendEl.innerHTML = legend;\r\n\t}\r\n\r\n\tonRendered(function(){\r\n\r\n\t\t//handle custom element needed if formatter is to be included in printed/downloaded output\r\n\t\tif(!(cell instanceof CellComponent)){\r\n\t\t\tvar holderEl = document.createElement(\"div\");\r\n\t\t\tholderEl.style.position = \"absolute\";\r\n\t\t\tholderEl.style.top = \"4px\";\r\n\t\t\tholderEl.style.bottom = \"4px\";\r\n\t\t\tholderEl.style.left = \"4px\";\r\n\t\t\tholderEl.style.right = \"4px\";\r\n\r\n\t\t\telement.appendChild(holderEl);\r\n\r\n\t\t\telement = holderEl;\r\n\t\t}\r\n\r\n\t\telement.appendChild(barContainer);\r\n\t\tbarContainer.appendChild(barEl);\r\n\r\n\t\tif(legend){\r\n\t\t\tbarContainer.appendChild(legendEl);\r\n\t\t}\r\n\t});\r\n\r\n\treturn \"\";\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().style.backgroundColor = this.sanitizeHTML(cell.getValue());\r\n\treturn \"\";\r\n};","export default function(cell, formatterParams, onRendered){\r\n\treturn '';\r\n};","export default function(cell, formatterParams, onRendered){\r\n\treturn '';\r\n};","export default function(cell, formatterParams, onRendered){\r\n\treturn this.table.rowManager.activeRows.indexOf(cell.getRow()._getSelf()) + 1 || \"\";\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().classList.add(\"tabulator-row-handle\");\r\n\treturn \"
\";\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar open = false,\r\n\tel = document.createElement(\"div\"),\r\n\tconfig = cell.getRow()._row.modules.responsiveLayout;\r\n\r\n\tel.classList.add(\"tabulator-responsive-collapse-toggle\");\r\n\tel.innerHTML = \"+-\";\r\n\r\n\tcell.getElement().classList.add(\"tabulator-row-handle\");\r\n\r\n\tfunction toggleList(isOpen){\r\n\t\tvar collapseEl = config.element;\r\n\r\n\t\tconfig.open = isOpen;\r\n\r\n\t\tif(collapseEl){\r\n\r\n\t\t\tif(config.open){\r\n\t\t\t\tel.classList.add(\"open\");\r\n\t\t\t\tcollapseEl.style.display = '';\r\n\t\t\t}else{\r\n\t\t\t\tel.classList.remove(\"open\");\r\n\t\t\t\tcollapseEl.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tel.addEventListener(\"click\", function(e){\r\n\t\te.stopImmediatePropagation();\r\n\t\ttoggleList(!config.open);\r\n\t});\r\n\r\n\ttoggleList(config.open);\r\n\r\n\treturn el;\r\n};","import RowComponent from '../../../../core/row/RowComponent.js';\r\n\r\nexport default function(cell, formatterParams, onRendered){\r\n\tvar checkbox = document.createElement(\"input\");\r\n\tvar blocked = false;\r\n\r\n\tcheckbox.type = 'checkbox';\r\n\r\n\tcheckbox.setAttribute(\"aria-label\", \"Select Row\");\r\n\t\r\n\tif(this.table.modExists(\"selectRow\", true)){\r\n\r\n\t\tcheckbox.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tif(typeof cell.getRow == 'function'){\r\n\t\t\tvar row = cell.getRow();\r\n\r\n\t\t\tif(row instanceof RowComponent){\r\n\r\n\t\t\t\tcheckbox.addEventListener(\"change\", (e) => {\r\n\t\t\t\t\tif(this.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\t\tif(!blocked){\r\n\t\t\t\t\t\t\trow.toggleSelect();\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tblocked = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trow.toggleSelect();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(this.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\tcheckbox.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\tblocked = true;\r\n\t\t\t\t\t\tthis.table.modules.selectRow.handleComplexRowClick(row._row, e);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcheckbox.checked = row.isSelected && row.isSelected();\r\n\t\t\t\tthis.table.modules.selectRow.registerRowSelectCheckbox(row, checkbox);\r\n\t\t\t}else{\r\n\t\t\t\tcheckbox = \"\";\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\tcheckbox.addEventListener(\"change\", (e) => {\r\n\t\t\t\tif(this.table.modules.selectRow.selectedRows.length){\r\n\t\t\t\t\tthis.table.deselectRow();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis.table.selectRow(formatterParams.rowRange);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.table.modules.selectRow.registerHeaderSelectCheckbox(checkbox);\r\n\t\t}\r\n\t}\r\n\r\n\treturn checkbox;\r\n};","import plaintext from './formatters/plaintext.js';\r\nimport html from './formatters/html.js';\r\nimport textarea from './formatters/textarea.js';\r\nimport money from './formatters/money.js';\r\nimport link from './formatters/link.js';\r\nimport image from './formatters/image.js';\r\nimport tickCross from './formatters/tickCross.js';\r\nimport datetime from './formatters/datetime.js';\r\nimport datetimediff from './formatters/datetimediff.js';\r\nimport lookup from './formatters/lookup.js';\r\nimport star from './formatters/star.js';\r\nimport traffic from './formatters/traffic.js';\r\nimport progress from './formatters/progress.js';\r\nimport color from './formatters/color.js';\r\nimport buttonTick from './formatters/buttonTick.js';\r\nimport buttonCross from './formatters/buttonCross.js';\r\nimport rownum from './formatters/rownum.js';\r\nimport handle from './formatters/handle.js';\r\nimport responsiveCollapse from './formatters/responsiveCollapse.js';\r\nimport rowSelection from './formatters/rowSelection.js';\r\n\r\nexport default {\r\n\tplaintext:plaintext,\r\n\thtml:html,\r\n\ttextarea:textarea,\r\n\tmoney:money,\r\n\tlink:link,\r\n\timage:image,\r\n\ttickCross:tickCross,\r\n\tdatetime:datetime,\r\n\tdatetimediff:datetimediff,\r\n\tlookup:lookup,\r\n\tstar:star,\r\n\ttraffic:traffic,\r\n\tprogress:progress,\r\n\tcolor:color,\r\n\tbuttonTick:buttonTick,\r\n\tbuttonCross:buttonCross,\r\n\trownum:rownum,\r\n\thandle:handle,\r\n\tresponsiveCollapse:responsiveCollapse,\r\n\trowSelection:rowSelection,\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultFormatters from './defaults/formatters.js';\r\n\r\nclass Format extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.registerColumnOption(\"formatter\");\r\n\t\tthis.registerColumnOption(\"formatterParams\");\r\n\r\n\t\tthis.registerColumnOption(\"formatterPrint\");\r\n\t\tthis.registerColumnOption(\"formatterPrintParams\");\r\n\t\tthis.registerColumnOption(\"formatterClipboard\");\r\n\t\tthis.registerColumnOption(\"formatterClipboardParams\");\r\n\t\tthis.registerColumnOption(\"formatterHtmlOutput\");\r\n\t\tthis.registerColumnOption(\"formatterHtmlOutputParams\");\r\n\t\tthis.registerColumnOption(\"titleFormatter\");\r\n\t\tthis.registerColumnOption(\"titleFormatterParams\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-format\", this.formatValue.bind(this));\r\n\t\tthis.subscribe(\"cell-rendered\", this.cellRendered.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"column-format\", this.formatHeader.bind(this));\r\n\t}\r\n\r\n\t//initialize column formatter\r\n\tinitializeColumn(column){\r\n\t\tcolumn.modules.format = this.lookupFormatter(column, \"\");\r\n\r\n\t\tif(typeof column.definition.formatterPrint !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.print = this.lookupFormatter(column, \"Print\");\r\n\t\t}\r\n\r\n\t\tif(typeof column.definition.formatterClipboard !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.clipboard = this.lookupFormatter(column, \"Clipboard\");\r\n\t\t}\r\n\r\n\t\tif(typeof column.definition.formatterHtmlOutput !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.htmlOutput = this.lookupFormatter(column, \"HtmlOutput\");\r\n\t\t}\r\n\t}\r\n\r\n\tlookupFormatter(column, type){\r\n\t\tvar config = {params:column.definition[\"formatter\" + type + \"Params\"] || {}},\r\n\t\tformatter = column.definition[\"formatter\" + type];\r\n\r\n\t\t//set column formatter\r\n\t\tswitch(typeof formatter){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(Format.formatters[formatter]){\r\n\t\t\t\tconfig.formatter = Format.formatters[formatter];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Formatter Error - No such formatter found: \", formatter);\r\n\t\t\t\tconfig.formatter = Format.formatters.plaintext;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tconfig.formatter = formatter;\r\n\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\tconfig.formatter = Format.formatters.plaintext;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn config;\r\n\t}\r\n\r\n\tcellRendered(cell){\r\n\t\tif(cell.modules.format && cell.modules.format.renderedCallback && !cell.modules.format.rendered){\r\n\t\t\tcell.modules.format.renderedCallback();\r\n\t\t\tcell.modules.format.rendered = true;\r\n\t\t}\r\n\t}\r\n\r\n\t//return a formatted value for a column header\r\n\tformatHeader(column, title, el){\r\n\t\tvar formatter, params, onRendered, mockCell;\r\n\r\n\t\tif(column.definition.titleFormatter){\r\n\t\t\tformatter = this.getFormatter(column.definition.titleFormatter);\r\n\r\n\t\t\tonRendered = (callback) => {\r\n\t\t\t\tcolumn.titleFormatterRendered = callback;\r\n\t\t\t};\r\n\r\n\t\t\tmockCell = {\r\n\t\t\t\tgetValue:function(){\r\n\t\t\t\t\treturn title;\r\n\t\t\t\t},\r\n\t\t\t\tgetElement:function(){\r\n\t\t\t\t\treturn el;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\tparams = column.definition.titleFormatterParams || {};\r\n\r\n\t\t\tparams = typeof params === \"function\" ? params() : params;\r\n\r\n\t\t\treturn formatter.call(this, mockCell, params, onRendered);\r\n\t\t}else{\r\n\t\t\treturn title;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t//return a formatted value for a cell\r\n\tformatValue(cell){\r\n\t\tvar component = cell.getComponent(),\r\n\t\tparams = typeof cell.column.modules.format.params === \"function\" ? cell.column.modules.format.params(component) : cell.column.modules.format.params;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\tif(!cell.modules.format){\r\n\t\t\t\tcell.modules.format = {};\r\n\t\t\t}\r\n\r\n\t\t\tcell.modules.format.renderedCallback = callback;\r\n\t\t\tcell.modules.format.rendered = false;\r\n\t\t}\r\n\r\n\t\treturn cell.column.modules.format.formatter.call(this, component, params, onRendered);\r\n\t}\r\n\r\n\tformatExportValue(cell, type){\r\n\t\tvar formatter = cell.column.modules.format[type],\r\n\t\tparams;\r\n\r\n\t\tif(formatter){\r\n\t\t\tparams = typeof formatter.params === \"function\" ? formatter.params(component) : formatter.params;\r\n\r\n\t\t\tfunction onRendered(callback){\r\n\t\t\t\tif(!cell.modules.format){\r\n\t\t\t\t\tcell.modules.format = {};\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcell.modules.format.renderedCallback = callback;\r\n\t\t\t\tcell.modules.format.rendered = false;\r\n\t\t\t}\r\n\r\n\t\t\treturn formatter.formatter.call(this, cell.getComponent(), params, onRendered);\r\n\r\n\t\t}else{\r\n\t\t\treturn this.formatValue(cell);\r\n\t\t}\r\n\t}\r\n\r\n\tsanitizeHTML(value){\r\n\t\tif(value){\r\n\t\t\tvar entityMap = {\r\n\t\t\t\t'&': '&',\r\n\t\t\t\t'<': '<',\r\n\t\t\t\t'>': '>',\r\n\t\t\t\t'\"': '"',\r\n\t\t\t\t\"'\": ''',\r\n\t\t\t\t'/': '/',\r\n\t\t\t\t'`': '`',\r\n\t\t\t\t'=': '='\r\n\t\t\t};\r\n\r\n\t\t\treturn String(value).replace(/[&<>\"'`=\\/]/g, function (s) {\r\n\t\t\t\treturn entityMap[s];\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn value;\r\n\t\t}\r\n\t}\r\n\r\n\temptyToSpace(value){\r\n\t\treturn value === null || typeof value === \"undefined\" || value === \"\" ? \" \" : value;\r\n\t}\r\n\r\n\t//get formatter for cell\r\n\tgetFormatter(formatter){\r\n\t\tvar formatter;\r\n\r\n\t\tswitch(typeof formatter){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(Format.formatters[formatter]){\r\n\t\t\t\tformatter = Format.formatters[formatter]\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Formatter Error - No such formatter found: \", formatter);\r\n\t\t\t\tformatter = Format.formatters.plaintext;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tformatter = formatter;\r\n\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\tformatter = Format.formatters.plaintext;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn formatter;\r\n\t}\r\n}\r\n\r\nFormat.moduleName = \"format\";\r\n\r\n//load defaults\r\nFormat.formatters = defaultFormatters;\r\n\r\nexport default Format;","import Module from '../../core/Module.js';\r\n\r\nclass FrozenColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.leftColumns = [];\r\n\t\tthis.rightColumns = [];\r\n\t\tthis.leftMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.rightPadding = 0;\r\n\t\tthis.initializationMode = \"left\";\r\n\t\tthis.active = false;\r\n\t\tthis.blocked = true;\r\n\t\t\r\n\t\tthis.registerColumnOption(\"frozen\");\r\n\t}\r\n\t\r\n\t//reset initial state\r\n\treset(){\r\n\t\tthis.initializationMode = \"left\";\r\n\t\tthis.leftColumns = [];\r\n\t\tthis.rightColumns = [];\r\n\t\tthis.leftMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.active = false;\r\n\t\t\r\n\t\tthis.table.columnManager.headersElement.style.marginLeft = 0;\r\n\t\tthis.table.columnManager.element.style.paddingRight = 0;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-layout\", this.layoutCell.bind(this));\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"column-width\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"row-layout-after\", this.layoutRow.bind(this));\r\n\t\tthis.subscribe(\"table-layout\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"columns-loading\", this.reset.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"column-add\", this.reinitializeColumns.bind(this));\r\n\t\tthis.subscribe(\"column-delete\", this.reinitializeColumns.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"table-redraw\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"layout-refreshing\", this.blockLayout.bind(this));\r\n\t\tthis.subscribe(\"layout-refreshed\", this.unblockLayout.bind(this));\r\n\t}\r\n\t\r\n\tblockLayout(){\r\n\t\tthis.blocked = true;\r\n\t}\r\n\t\r\n\tunblockLayout(){\r\n\t\tthis.blocked = false;\r\n\t}\r\n\t\r\n\tlayoutCell(cell){\r\n\t\tthis.layoutElement(cell.element, cell.column)\r\n\t}\r\n\t\r\n\treinitializeColumns(){\r\n\t\tthis.reset();\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//initialize specific column\r\n\tinitializeColumn(column){\r\n\t\tvar config = {margin:0, edge:false};\r\n\t\t\r\n\t\tif(!column.isGroup){\r\n\t\t\t\r\n\t\t\tif(this.frozenCheck(column)){\r\n\t\t\t\t\r\n\t\t\t\tconfig.position = this.initializationMode;\r\n\t\t\t\t\r\n\t\t\t\tif(this.initializationMode == \"left\"){\r\n\t\t\t\t\tthis.leftColumns.push(column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.rightColumns.unshift(column);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.active = true;\r\n\t\t\t\t\r\n\t\t\t\tcolumn.modules.frozen = config;\r\n\t\t\t}else{\r\n\t\t\t\tthis.initializationMode = \"right\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tfrozenCheck(column){\r\n\t\tif(column.parent.isGroup && column.definition.frozen){\r\n\t\t\tconsole.warn(\"Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups\");\r\n\t\t}\r\n\t\t\r\n\t\tif(column.parent.isGroup){\r\n\t\t\treturn this.frozenCheck(column.parent);\r\n\t\t}else{\r\n\t\t\treturn column.definition.frozen;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//quick layout to smooth horizontal scrolling\r\n\tscrollHorizontal(){\r\n\t\tvar rows;\r\n\t\t\r\n\t\tif(this.active){\t\t\r\n\t\t\tthis.calcMargins(true);\r\n\t\t\t\r\n\t\t\tthis.layoutColumnPosition();\r\n\t\t\t\r\n\t\t\tthis.layoutCalcRows();\r\n\t\t\t\r\n\t\t\tthis.reinitializeRows();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//calculate margins for rows\r\n\tcalcMargins(scroll){\r\n\t\t\r\n\t\tif(!scroll){\r\n\t\t\tthis.leftMargin = this._calcSpace(this.leftColumns, this.leftColumns.length) + \"px\";\t\t\t\r\n\t\t\tthis.rightMargin = this._calcSpace(this.rightColumns, this.rightColumns.length) + \"px\";\t\r\n\t\t\tthis.table.rowManager.tableElement.style.marginRight = this.rightMargin;\r\n\t\t}\r\n\t\t\r\n\t\t//calculate right frozen columns\r\n\t\tthis.rightPadding = this.table.rowManager.element.clientWidth + this.table.columnManager.scrollLeft;\r\n\t}\r\n\t\r\n\t//layout calculation rows\r\n\tlayoutCalcRows(){\r\n\t\tif(this.table.modExists(\"columnCalcs\")){\r\n\t\t\tif(this.table.modules.columnCalcs.topInitialized && this.table.modules.columnCalcs.topRow){\r\n\t\t\t\tthis.layoutRow(this.table.modules.columnCalcs.topRow);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.modules.columnCalcs.botInitialized && this.table.modules.columnCalcs.botRow){\r\n\t\t\t\tthis.layoutRow(this.table.modules.columnCalcs.botRow);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.modExists(\"groupRows\")){\r\n\t\t\t\tthis.layoutGroupCalcs(this.table.modules.groupRows.getGroups())\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tlayoutGroupCalcs(groups){\r\n\t\tgroups.forEach((group) => {\r\n\t\t\tif(group.calcs.top){\r\n\t\t\t\tthis.layoutRow(group.calcs.top);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(group.calcs.bottom){\r\n\t\t\t\tthis.layoutRow(group.calcs.bottom);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(group.groupList && group.groupList.length){\r\n\t\t\t\tthis.layoutGroupCalcs(group.groupList && group.groupList);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//calculate column positions and layout headers\r\n\tlayoutColumnPosition(allCells){\r\n\t\tvar leftParents = [];\r\n\t\t\r\n\t\tvar leftMargin = 0;\r\n\t\tvar rightMargin = 0;\r\n\t\t\r\n\t\tthis.table.columnManager.headersElement.style.marginLeft = this.leftMargin;\r\n\t\tthis.table.columnManager.element.style.paddingRight = this.rightMargin;\r\n\t\t\r\n\t\tthis.leftColumns.forEach((column, i) => {\t\r\n\t\t\tcolumn.modules.frozen.marginValue = leftMargin + this.table.columnManager.scrollLeft;\r\n\t\t\tcolumn.modules.frozen.margin = column.modules.frozen.marginValue + \"px\";\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\tleftMargin += column.getWidth();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(i == this.leftColumns.length - 1){\r\n\t\t\t\tcolumn.modules.frozen.edge = true;\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.modules.frozen.edge = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(column.parent.isGroup){\r\n\t\t\t\tvar parentEl = this.getColGroupParentElement(column);\r\n\t\t\t\tif(!leftParents.includes(parentEl)){\r\n\t\t\t\t\tthis.layoutElement(parentEl, column);\r\n\t\t\t\t\tleftParents.push(parentEl);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(column.modules.frozen.edge){\r\n\t\t\t\t\tparentEl.classList.add(\"tabulator-frozen-\" + column.modules.frozen.position);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.layoutElement(column.getElement(), column);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(allCells){\r\n\t\t\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.rightColumns.forEach((column, i) => {\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\trightMargin += column.getWidth();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.frozen.marginValue = this.rightPadding - rightMargin;\r\n\t\t\tcolumn.modules.frozen.margin = column.modules.frozen.marginValue + \"px\";\r\n\t\t\t\r\n\t\t\tif(i == this.rightColumns.length - 1){\r\n\t\t\t\tcolumn.modules.frozen.edge = true;\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.modules.frozen.edge = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif(column.parent.isGroup){\r\n\t\t\t\tthis.layoutElement(this.getColGroupParentElement(column), column);\r\n\t\t\t}else{\r\n\t\t\t\tthis.layoutElement(column.getElement(), column);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(allCells){\r\n\t\t\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetColGroupParentElement(column){\r\n\t\treturn column.parent.isGroup ? this.getColGroupParentElement(column.parent) : column.getElement();\r\n\t}\r\n\t\r\n\t//layout columns appropriately\r\n\tlayout(){\t\r\n\t\tif(this.active && !this.blocked){\r\n\t\t\t//calculate row padding\r\n\t\t\tthis.calcMargins();\r\n\t\t\t\r\n\t\t\t//calculate left columns\r\n\t\t\tthis.layoutColumnPosition();\r\n\r\n\t\t\tthis.reinitializeRows();\r\n\t\t\t\r\n\t\t\tthis.layoutCalcRows();\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeRows(){\r\n\t\tvar visibleRows = this.table.rowManager.getVisibleRows();\r\n\t\tvar otherRows = this.table.rowManager.getRows().filter(row => !visibleRows.includes(row));\r\n\r\n\t\totherRows.forEach((row) =>{\r\n\t\t\trow.deinitialize();\r\n\t\t});\r\n\t\t\r\n\t\tvisibleRows.forEach((row) =>{\r\n\t\t\tif(row.type === \"row\"){\r\n\t\t\t\tthis.layoutRow(row);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tlayoutRow(row){\r\n\t\t// console.trace(\"row\")\r\n\t\tvar rowEl = row.getElement();\r\n\t\t\r\n\t\trowEl.style.paddingLeft = this.leftMargin;\r\n\t\t\r\n\t\tif(this.table.options.layout === \"fitDataFill\" && this.rightColumns.length){\r\n\t\t\tthis.table.rowManager.getTableElement().style.minWidth = \"calc(100% - \" + this.rightMargin + \")\";\r\n\t\t}\r\n\t\t\r\n\t\tthis.leftColumns.forEach((column) => {\r\n\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\r\n\t\t\tif(cell){\r\n\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.rightColumns.forEach((column) => {\r\n\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\r\n\t\t\tif(cell){\r\n\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tlayoutElement(element, column){\r\n\t\t\r\n\t\tif(column.modules.frozen){\r\n\t\t\telement.style.position = \"absolute\";\r\n\t\t\telement.style.left = column.modules.frozen.margin;\r\n\t\t\t\r\n\t\t\telement.classList.add(\"tabulator-frozen\");\r\n\t\t\t\r\n\t\t\tif(column.modules.frozen.edge){\r\n\t\t\t\telement.classList.add(\"tabulator-frozen-\" + column.modules.frozen.position);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_calcSpace(columns, index){\r\n\t\tvar width = 0;\r\n\t\t\r\n\t\tfor (let i = 0; i < index; i++){\r\n\t\t\tif(columns[i].visible){\r\n\t\t\t\twidth += columns[i].getWidth();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn width;\r\n\t}\r\n}\r\n\r\nFrozenColumns.moduleName = \"frozenColumns\";\r\n\r\nexport default FrozenColumns;","import Module from '../../core/Module.js';\r\n\r\nclass FrozenRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.topElement = document.createElement(\"div\");\r\n\t\tthis.rows = [];\r\n\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"freeze\", this.freezeRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"unfreeze\", this.unfreezeRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isFrozen\", this.isRowFrozen.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.rows = [];\r\n\r\n\t\tthis.topElement.classList.add(\"tabulator-frozen-rows-holder\");\r\n\r\n\t\t// this.table.columnManager.element.append(this.topElement);\r\n\t\tthis.table.columnManager.getElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling);\r\n\r\n\t\tthis.subscribe(\"row-deleting\", this.detachRow.bind(this));\r\n\t\tthis.subscribe(\"rows-visible\", this.visibleRows.bind(this));\r\n\r\n\t\tthis.registerDisplayHandler(this.getRows.bind(this), 10);\r\n\t}\r\n\r\n\tisRowFrozen(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\t\treturn index > -1;\r\n\t}\r\n\r\n\tisFrozen(){\r\n\t\treturn !!this.rows.length;\r\n\t}\r\n\r\n\tvisibleRows(viewable, rows){\r\n\t\tthis.rows.forEach((row) => {\r\n\t\t\trows.push(row);\r\n\t\t});\r\n\r\n\t\treturn rows;\r\n\t}\r\n\r\n\t//filter frozen rows out of display data\r\n\tgetRows(rows){\r\n\t\tvar self = this,\r\n\t\tfrozen = [],\r\n\t\toutput = rows.slice(0);\r\n\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\tvar index = output.indexOf(row);\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\toutput.splice(index, 1);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tfreezeRow(row){\r\n\t\tif(!row.modules.frozen){\r\n\t\t\trow.modules.frozen = true;\r\n\t\t\tthis.topElement.appendChild(row.getElement());\r\n\t\t\trow.initialize();\r\n\t\t\trow.normalizeHeight();\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\tthis.rows.push(row);\r\n\r\n\t\t\tthis.refreshData(false, \"display\")\r\n\r\n\t\t\tthis.styleRows();\r\n\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Freeze Error - Row is already frozen\");\r\n\t\t}\r\n\t}\r\n\r\n\tunfreezeRow(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\r\n\t\tif(row.modules.frozen){\r\n\r\n\t\t\trow.modules.frozen = false;\r\n\r\n\t\t\tthis.detachRow(row);\r\n\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\tthis.refreshData(false, \"display\")\r\n\r\n\t\t\tif(this.rows.length){\r\n\t\t\t\tthis.styleRows();\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Freeze Error - Row is already unfrozen\");\r\n\t\t}\r\n\t}\r\n\r\n\tdetachRow(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tvar rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\r\n\t\t\tthis.rows.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\tstyleRows(row){\r\n\t\tthis.rows.forEach((row, i) => {\r\n\t\t\tthis.table.rowManager.styleRow(row, i);\r\n\t\t});\r\n\t}\r\n}\r\n\r\nFrozenRows.moduleName = \"frozenRows\";\r\n\r\nexport default FrozenRows;","//public group object\r\nclass GroupComponent {\r\n\tconstructor (group){\r\n\t\tthis._group = group;\r\n\t\tthis.type = \"GroupComponent\";\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._group.groupManager.table.componentFunctionBinder.handle(\"row\", target._group, name)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\tgetKey(){\r\n\t\treturn this._group.key;\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._group.field;\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._group.element;\r\n\t}\r\n\r\n\tgetRows(){\r\n\t\treturn this._group.getRows(true);\r\n\t}\r\n\r\n\tgetSubGroups(){\r\n\t\treturn this._group.getSubGroups(true);\r\n\t}\r\n\r\n\tgetParentGroup(){\r\n\t\treturn this._group.parent ? this._group.parent.getComponent() : false;\r\n\t}\r\n\r\n\tisVisible(){\r\n\t\treturn this._group.visible;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tthis._group.show();\r\n\t}\r\n\r\n\thide(){\r\n\t\tthis._group.hide();\r\n\t}\r\n\r\n\ttoggle(){\r\n\t\tthis._group.toggleVisibility();\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._group;\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._group.groupManager.table;\r\n\t}\r\n}\r\n\r\nexport default GroupComponent;","import Helpers from '../../core/tools/Helpers.js';\r\nimport GroupComponent from './GroupComponent.js';\r\n\r\n//Group functions\r\nclass Group{\r\n\t\r\n\tconstructor(groupManager, parent, level, key, field, generator, oldGroup){\r\n\t\tthis.groupManager = groupManager;\r\n\t\tthis.parent = parent;\r\n\t\tthis.key = key;\r\n\t\tthis.level = level;\r\n\t\tthis.field = field;\r\n\t\tthis.hasSubGroups = level < (groupManager.groupIDLookups.length - 1);\r\n\t\tthis.addRow = this.hasSubGroups ? this._addRowToGroup : this._addRow;\r\n\t\tthis.type = \"group\"; //type of element\r\n\t\tthis.old = oldGroup;\r\n\t\tthis.rows = [];\r\n\t\tthis.groups = [];\r\n\t\tthis.groupList = [];\r\n\t\tthis.generator = generator;\r\n\t\tthis.element = false;\r\n\t\tthis.elementContents = false;\r\n\t\tthis.height = 0;\r\n\t\tthis.outerHeight = 0;\r\n\t\tthis.initialized = false;\r\n\t\tthis.calcs = {};\r\n\t\tthis.initialized = false;\r\n\t\tthis.modules = {};\r\n\t\tthis.arrowElement = false;\r\n\t\t\r\n\t\tthis.visible = oldGroup ? oldGroup.visible : (typeof groupManager.startOpen[level] !== \"undefined\" ? groupManager.startOpen[level] : groupManager.startOpen[0]);\r\n\t\t\r\n\t\tthis.component = null;\r\n\t\t\r\n\t\tthis.createElements();\r\n\t\tthis.addBindings();\r\n\t\t\r\n\t\tthis.createValueGroups();\r\n\t}\r\n\t\r\n\twipe(){\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\tgroup.wipe();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\tif(row.modules){\r\n\t\t\t\t\tdelete row.modules.group;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tthis.element = false;\r\n\t\tthis.arrowElement = false;\r\n\t\tthis.elementContents = false;\r\n\t}\r\n\t\r\n\tcreateElements(){\r\n\t\tvar arrow = document.createElement(\"div\");\r\n\t\tarrow.classList.add(\"tabulator-arrow\");\r\n\t\t\r\n\t\tthis.element = document.createElement(\"div\");\r\n\t\tthis.element.classList.add(\"tabulator-row\");\r\n\t\tthis.element.classList.add(\"tabulator-group\");\r\n\t\tthis.element.classList.add(\"tabulator-group-level-\" + this.level);\r\n\t\tthis.element.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\tthis.arrowElement = document.createElement(\"div\");\r\n\t\tthis.arrowElement.classList.add(\"tabulator-group-toggle\");\r\n\t\tthis.arrowElement.appendChild(arrow);\r\n\t\t\r\n\t\t//setup movable rows\r\n\t\tif(this.groupManager.table.options.movableRows !== false && this.groupManager.table.modExists(\"moveRow\")){\r\n\t\t\tthis.groupManager.table.modules.moveRow.initializeGroupHeader(this);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcreateValueGroups(){\r\n\t\tvar level = this.level + 1;\r\n\t\tif(this.groupManager.allowedValues && this.groupManager.allowedValues[level]){\r\n\t\t\tthis.groupManager.allowedValues[level].forEach((value) => {\r\n\t\t\t\tthis._createGroup(value, level);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\taddBindings(){\r\n\t\tvar toggleElement;\r\n\t\t\r\n\t\tif(this.groupManager.table.options.groupToggleElement){\r\n\t\t\ttoggleElement = this.groupManager.table.options.groupToggleElement == \"arrow\" ? this.arrowElement : this.element;\r\n\t\t\t\r\n\t\t\ttoggleElement.addEventListener(\"click\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\tthis.toggleVisibility();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\t_createGroup(groupID, level){\r\n\t\tvar groupKey = level + \"_\" + groupID;\r\n\t\tvar group = new Group(this.groupManager, this, level, groupID, this.groupManager.groupIDLookups[level].field, this.groupManager.headerGenerator[level] || this.groupManager.headerGenerator[0], this.old ? this.old.groups[groupKey] : false);\r\n\t\t\r\n\t\tthis.groups[groupKey] = group;\r\n\t\tthis.groupList.push(group);\r\n\t}\r\n\t\r\n\t_addRowToGroup(row){\r\n\t\t\r\n\t\tvar level = this.level + 1;\r\n\t\t\r\n\t\tif(this.hasSubGroups){\r\n\t\t\tvar groupID = this.groupManager.groupIDLookups[level].func(row.getData()),\r\n\t\t\tgroupKey = level + \"_\" + groupID;\r\n\t\t\t\r\n\t\t\tif(this.groupManager.allowedValues && this.groupManager.allowedValues[level]){\r\n\t\t\t\tif(this.groups[groupKey]){\r\n\t\t\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(!this.groups[groupKey]){\r\n\t\t\t\t\tthis._createGroup(groupID, level);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_addRow(row){\r\n\t\tthis.rows.push(row);\r\n\t\trow.modules.group = this;\r\n\t}\r\n\t\r\n\tinsertRow(row, to, after){\r\n\t\tvar data = this.conformRowData({});\r\n\t\t\r\n\t\trow.updateData(data);\r\n\t\t\r\n\t\tvar toIndex = this.rows.indexOf(to);\r\n\t\t\r\n\t\tif(toIndex > -1){\r\n\t\t\tif(after){\r\n\t\t\t\tthis.rows.splice(toIndex+1, 0, row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.splice(toIndex, 0, row);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(after){\r\n\t\t\t\tthis.rows.push(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.unshift(row);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\trow.modules.group = this;\r\n\t\t\r\n\t\tthis.generateGroupHeaderContents();\r\n\t\t\r\n\t\tif(this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\tthis.groupManager.table.modules.columnCalcs.recalcGroup(this);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.updateGroupRows(true);\r\n\t}\r\n\t\r\n\tscrollHeader(left){\r\n\t\tif(this.arrowElement){\r\n\t\t\tthis.arrowElement.style.marginLeft = left;\r\n\t\t\t\r\n\t\t\tthis.groupList.forEach(function(child){\r\n\t\t\t\tchild.scrollHeader(left);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRowIndex(row){}\r\n\t\r\n\t//update row data to match grouping contraints\r\n\tconformRowData(data){\r\n\t\tif(this.field){\r\n\t\t\tdata[this.field] = this.key;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Data Conforming Error - Cannot conform row data to match new group as groupBy is a function\");\r\n\t\t}\r\n\t\t\r\n\t\tif(this.parent){\r\n\t\t\tdata = this.parent.conformRowData(data);\r\n\t\t}\r\n\t\t\r\n\t\treturn data;\r\n\t}\r\n\t\r\n\tremoveRow(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\t\tvar el = row.getElement();\r\n\t\t\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.rows.splice(index, 1);\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.groupManager.table.options.groupValues && !this.rows.length){\r\n\t\t\tif(this.parent){\r\n\t\t\t\tthis.parent.removeGroup(this);\r\n\t\t\t}else{\r\n\t\t\t\tthis.groupManager.removeGroup(this);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tif(el.parentNode){\r\n\t\t\t\tel.parentNode.removeChild(el);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.generateGroupHeaderContents();\r\n\t\t\t\r\n\t\t\tif(this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\t\tthis.groupManager.table.modules.columnCalcs.recalcGroup(this);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveGroup(group){\r\n\t\tvar groupKey = group.level + \"_\" + group.key,\r\n\t\tindex;\r\n\t\t\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tdelete this.groups[groupKey];\r\n\t\t\t\r\n\t\t\tindex = this.groupList.indexOf(group);\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.groupList.splice(index, 1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(!this.groupList.length){\r\n\t\t\t\tif(this.parent){\r\n\t\t\t\t\tthis.parent.removeGroup(this);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.groupManager.removeGroup(this);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetHeadersAndRows(noCalc){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\toutput.push(this);\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(this.visible){\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\t\toutput = output.concat(group.getHeadersAndRows(noCalc));\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tif(!noCalc && this.groupManager.table.options.columnCalcs != \"table\" && this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.modules.columnCalcs.hasTopCalcs()){\r\n\t\t\t\t\tif(this.calcs.top){\r\n\t\t\t\t\t\tthis.calcs.top.detachElement();\r\n\t\t\t\t\t\tthis.calcs.top.deleteCells();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows);\r\n\t\t\t\t\toutput.push(this.calcs.top);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\toutput = output.concat(this.rows);\r\n\t\t\t\t\r\n\t\t\t\tif(!noCalc && this.groupManager.table.options.columnCalcs != \"table\" && this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()){\r\n\t\t\t\t\tif(this.calcs.bottom){\r\n\t\t\t\t\t\tthis.calcs.bottom.detachElement();\r\n\t\t\t\t\t\tthis.calcs.bottom.deleteCells();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows);\r\n\t\t\t\t\toutput.push(this.calcs.bottom);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!this.groupList.length && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\t\t\r\n\t\t\t\tif(this.groupManager.table.modExists(\"columnCalcs\")){\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!noCalc && this.groupManager.table.modules.columnCalcs.hasTopCalcs()){\r\n\t\t\t\t\t\tif(this.calcs.top){\r\n\t\t\t\t\t\t\tthis.calcs.top.detachElement();\r\n\t\t\t\t\t\t\tthis.calcs.top.deleteCells();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.groupManager.table.options.groupClosedShowCalcs){\r\n\t\t\t\t\t\t\tthis.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows);\r\n\t\t\t\t\t\t\toutput.push(this.calcs.top);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!noCalc && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()){\r\n\t\t\t\t\t\tif(this.calcs.bottom){\r\n\t\t\t\t\t\t\tthis.calcs.bottom.detachElement();\r\n\t\t\t\t\t\t\tthis.calcs.bottom.deleteCells();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.groupManager.table.options.groupClosedShowCalcs){\r\n\t\t\t\t\t\t\tthis.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows);\r\n\t\t\t\t\t\t\toutput.push(this.calcs.bottom);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetData(visible, transform){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(!visible || (visible && this.visible)){\r\n\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\toutput.push(row.getData(transform || \"data\"));\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetRowCount(){\r\n\t\tvar count = 0;\r\n\t\t\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\tcount += group.getRowCount();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tcount = this.rows.length;\r\n\t\t}\r\n\t\treturn count;\r\n\t}\r\n\t\r\n\ttoggleVisibility(){\r\n\t\tif(this.visible){\r\n\t\t\tthis.hide();\r\n\t\t}else{\r\n\t\t\tthis.show();\r\n\t\t}\r\n\t}\r\n\t\r\n\thide(){\r\n\t\tthis.visible = false;\r\n\t\t\r\n\t\tif(this.groupManager.table.rowManager.getRenderMode() == \"classic\" && !this.groupManager.table.options.pagination){\r\n\t\t\t\r\n\t\t\tthis.element.classList.remove(\"tabulator-group-visible\");\r\n\t\t\t\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar rows = group.getHeadersAndRows();\r\n\t\t\t\t\t\r\n\t\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\t\trow.detachElement();\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());\r\n\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth();\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.table.externalEvents.dispatch(\"groupVisibilityChanged\", this.getComponent(), false);\r\n\t}\r\n\t\r\n\tshow(){\r\n\t\tthis.visible = true;\r\n\t\t\r\n\t\tif(this.groupManager.table.rowManager.getRenderMode() == \"classic\" && !this.groupManager.table.options.pagination){\r\n\t\t\t\r\n\t\t\tthis.element.classList.add(\"tabulator-group-visible\");\r\n\t\t\t\r\n\t\t\tvar prev = this.generateElement();\r\n\t\t\t\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\t\tvar rows = group.getHeadersAndRows();\r\n\t\t\t\t\t\r\n\t\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\t\tprev.parentNode.insertBefore(rowEl, prev.nextSibling);\r\n\t\t\t\t\t\trow.initialize();\r\n\t\t\t\t\t\tprev = rowEl;\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\tprev.parentNode.insertBefore(rowEl, prev.nextSibling);\r\n\t\t\t\t\trow.initialize();\r\n\t\t\t\t\tprev = rowEl;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());\r\n\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth();\r\n\t\t}else{\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.table.externalEvents.dispatch(\"groupVisibilityChanged\", this.getComponent(), true);\r\n\t}\r\n\t\r\n\t_visSet(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tif(typeof this.visible == \"function\"){\r\n\t\t\t\r\n\t\t\tthis.rows.forEach(function(row){\r\n\t\t\t\tdata.push(row.getData());\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.visible = this.visible(this.key, this.getRowCount(), data, this.getComponent());\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRowGroup(row){\r\n\t\tvar match = false;\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\tvar result = group.getRowGroup(row);\r\n\t\t\t\t\r\n\t\t\t\tif(result){\r\n\t\t\t\t\tmatch = result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tif(this.rows.find(function(item){\r\n\t\t\t\treturn item === row;\r\n\t\t\t})){\r\n\t\t\t\tmatch = this;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn match;\r\n\t}\r\n\t\r\n\tgetSubGroups(component){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.groupList.forEach(function(child){\r\n\t\t\toutput.push(component ? child.getComponent() : child);\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetRows(compoment){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\toutput.push(compoment ? row.getComponent() : row);\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgenerateGroupHeaderContents(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\tdata.push(row.getData());\r\n\t\t});\r\n\t\t\r\n\t\tthis.elementContents = this.generator(this.key, this.getRowCount(), data, this.getComponent());\r\n\t\t\r\n\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\r\n\t\tif(typeof this.elementContents === \"string\"){\r\n\t\t\tthis.element.innerHTML = this.elementContents;\r\n\t\t}else{\r\n\t\t\tthis.element.appendChild(this.elementContents);\r\n\t\t}\r\n\t\t\r\n\t\tthis.element.insertBefore(this.arrowElement, this.element.firstChild);\r\n\t}\r\n\t\r\n\tgetPath(path = []) {\r\n\t\tpath.unshift(this.key);\r\n\t\tif(this.parent) {\r\n\t\t\tthis.parent.getPath(path);\r\n\t\t}\r\n\t\treturn path;\r\n\t}\r\n\t\r\n\t////////////// Standard Row Functions //////////////\r\n\t\r\n\tgetElement(){\r\n\t\treturn this.elementContents ? this.element : this.generateElement();\r\n\t}\r\n\t\r\n\tgenerateElement(){\r\n\t\tthis.addBindings = false;\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(this.visible){\r\n\t\t\tthis.element.classList.add(\"tabulator-group-visible\");\r\n\t\t}else{\r\n\t\t\tthis.element.classList.remove(\"tabulator-group-visible\");\r\n\t\t}\r\n\t\t\r\n\t\tfor(var i = 0; i < this.element.childNodes.length; ++i){\r\n\t\t\tthis.element.childNodes[i].parentNode.removeChild(this.element.childNodes[i]);\r\n\t\t}\r\n\t\t\r\n\t\tthis.generateGroupHeaderContents();\r\n\t\t\r\n\t\t// this.addBindings();\r\n\t\t\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\tdetachElement(){\r\n\t\tif (this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//normalize the height of elements in the row\r\n\tnormalizeHeight(){\r\n\t\tthis.setHeight(this.element.clientHeight);\r\n\t}\r\n\t\r\n\tinitialize(force){\r\n\t\tif(!this.initialized || force){\r\n\t\t\tthis.normalizeHeight();\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitialize(){\r\n\t\tthis.initialized = false;\r\n\t\tthis.height = 0;\r\n\t\t\r\n\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\tthis.initialize(true);\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetHeight(height){\r\n\t\tif(this.height != height){\r\n\t\t\tthis.height = height;\r\n\t\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return rows outer height\r\n\tgetHeight(){\r\n\t\treturn this.outerHeight;\r\n\t}\r\n\t\r\n\tgetGroup(){\r\n\t\treturn this;\r\n\t}\r\n\t\r\n\treinitializeHeight(){}\r\n\t\r\n\tcalcHeight(){}\r\n\t\r\n\tsetCellHeight(){}\r\n\t\r\n\tclearCellHeight(){}\r\n\t\r\n\tdeinitializeHeight(){}\r\n\t\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new GroupComponent(this);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n\r\nexport default Group;","import Module from '../../core/Module.js';\r\n\r\nimport GroupComponent from './GroupComponent.js';\r\nimport Group from './Group.js';\r\n\r\nclass GroupRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.groupIDLookups = false; //enable table grouping and set field to group by\r\n\t\tthis.startOpen = [function(){return false;}]; //starting state of group\r\n\t\tthis.headerGenerator = [function(){return \"\";}];\r\n\t\tthis.groupList = []; //ordered list of groups\r\n\t\tthis.allowedValues = false;\r\n\t\tthis.groups = {}; //hold row groups\r\n\t\tthis.displayIndex = 0; //index in display pipeline\r\n\r\n\t\tthis.displayHandler = this.getRows.bind(this);\r\n\r\n\t\t//register table options\r\n\t\tthis.registerTableOption(\"groupBy\", false); //enable table grouping and set field to group by\r\n\t\tthis.registerTableOption(\"groupStartOpen\", true); //starting state of group\r\n\t\tthis.registerTableOption(\"groupValues\", false);\r\n\t\tthis.registerTableOption(\"groupUpdateOnCellEdit\", false);\r\n\t\tthis.registerTableOption(\"groupHeader\", false); //header generation function\r\n\t\tthis.registerTableOption(\"groupHeaderPrint\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderClipboard\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderHtmlOutput\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderDownload\", null);\r\n\t\tthis.registerTableOption(\"groupToggleElement\", \"arrow\");\r\n\t\tthis.registerTableOption(\"groupClosedShowCalcs\", false);\r\n\r\n\t\t//register table functions\r\n\t\tthis.registerTableFunction(\"setGroupBy\", this.setGroupBy.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupValues\", this.setGroupValues.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupStartOpen\", this.setGroupStartOpen.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupHeader\", this.setGroupHeader.bind(this));\r\n\t\tthis.registerTableFunction(\"getGroups\", this.userGetGroups.bind(this));\r\n\t\tthis.registerTableFunction(\"getGroupedData\", this.userGetGroupedData.bind(this));\r\n\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"getGroup\", this.rowGetGroup.bind(this));\r\n\t}\r\n\r\n\t//initialize group configuration\r\n\tinitialize(){\r\n\t\tif(this.table.options.groupBy){\r\n\r\n\t\t\tif(this.table.options.groupUpdateOnCellEdit){\r\n\t\t\t\tthis.subscribe(\"cell-value-updated\", this.cellUpdated.bind(this));\r\n\t\t\t\tthis.subscribe(\"row-data-changed\", this.reassignRowToGroup.bind(this), 0);\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"table-built\", this.configureGroupSetup.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"row-deleting\", this.rowDeleting.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHeaders.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.wipe.bind(this));\r\n\t\t\tthis.subscribe(\"rows-added\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"row-moving\", this.rowMoving.bind(this));\r\n\t\t\tthis.subscribe(\"row-adding-index\", this.rowAddingIndex.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"rows-sample\", this.rowSample.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"render-virtual-fill\", this.virtualRenderFill.bind(this));\r\n\r\n\t\t\tthis.registerDisplayHandler(this.displayHandler, 20);\r\n\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\r\n\tconfigureGroupSetup(){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tvar groupBy = this.table.options.groupBy,\r\n\t\t\tstartOpen = this.table.options.groupStartOpen,\r\n\t\t\tgroupHeader = this.table.options.groupHeader;\r\n\r\n\t\t\tthis.allowedValues = this.table.options.groupValues;\r\n\r\n\t\t\tif(Array.isArray(groupBy) && Array.isArray(groupHeader) && groupBy.length > groupHeader.length){\r\n\t\t\t\tconsole.warn(\"Error creating group headers, groupHeader array is shorter than groupBy array\");\r\n\t\t\t}\r\n\r\n\t\t\tthis.headerGenerator = [function(){return \"\";}];\r\n\t\t\tthis.startOpen = [function(){return false;}]; //starting state of group\r\n\r\n\t\t\tthis.langBind(\"groups|item\", (langValue, lang) => {\r\n\t\t\t\tthis.headerGenerator[0] = (value, count, data) => { //header layout function\r\n\t\t\t\t\treturn (typeof value === \"undefined\" ? \"\" : value) + \"(\" + count + \" \" + ((count === 1) ? langValue : lang.groups.items) + \")\";\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tthis.groupIDLookups = [];\r\n\r\n\t\t\tif(Array.isArray(groupBy) || groupBy){\r\n\t\t\t\tif(this.table.modExists(\"columnCalcs\") && this.table.options.columnCalcs != \"table\" && this.table.options.columnCalcs != \"both\"){\r\n\t\t\t\t\tthis.table.modules.columnCalcs.removeCalcs();\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.modExists(\"columnCalcs\") && this.table.options.columnCalcs != \"group\"){\r\n\r\n\t\t\t\t\tvar cols = this.table.columnManager.getRealColumns();\r\n\r\n\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\tif(col.definition.topCalc){\r\n\t\t\t\t\t\t\tthis.table.modules.columnCalcs.initializeTopRow();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(col.definition.bottomCalc){\r\n\t\t\t\t\t\t\tthis.table.modules.columnCalcs.initializeBottomRow();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(!Array.isArray(groupBy)){\r\n\t\t\t\tgroupBy = [groupBy];\r\n\t\t\t}\r\n\r\n\t\t\tgroupBy.forEach((group, i) => {\r\n\t\t\t\tvar lookupFunc, column;\r\n\r\n\t\t\t\tif(typeof group == \"function\"){\r\n\t\t\t\t\tlookupFunc = group;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolumn = this.table.columnManager.getColumnByField(group);\r\n\r\n\t\t\t\t\tif(column){\r\n\t\t\t\t\t\tlookupFunc = function(data){\r\n\t\t\t\t\t\t\treturn column.getFieldValue(data);\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tlookupFunc = function(data){\r\n\t\t\t\t\t\t\treturn data[group];\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.groupIDLookups.push({\r\n\t\t\t\t\tfield: typeof group === \"function\" ? false : group,\r\n\t\t\t\t\tfunc:lookupFunc,\r\n\t\t\t\t\tvalues:this.allowedValues ? this.allowedValues[i] : false,\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t\tif(startOpen){\r\n\t\t\t\tif(!Array.isArray(startOpen)){\r\n\t\t\t\t\tstartOpen = [startOpen];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstartOpen.forEach((level) => {\r\n\t\t\t\t\tlevel = typeof level == \"function\" ? level : function(){return true;};\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.startOpen = startOpen;\r\n\t\t\t}\r\n\r\n\t\t\tif(groupHeader){\r\n\t\t\t\tthis.headerGenerator = Array.isArray(groupHeader) ? groupHeader : [groupHeader];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trowSample(rows, prevValue){\r\n\t\tvar group = this.getGroups(false)[0];\r\n\r\n\t\tprevValue.push(group.getRows(false)[0]);\r\n\r\n\t\treturn prevValue;\r\n\t}\r\n\r\n\tvirtualRenderFill(){\r\n\t\tvar el = this.table.rowManager.tableElement;\r\n\t\tvar rows = this.table.rowManager.getVisibleRows();\r\n\r\n\t\trows = rows.filter((row) => {\r\n\t\t\treturn row.type !== \"group\";\r\n\t\t});\r\n\r\n\t\tel.style.minWidth = !rows.length ? this.table.columnManager.getWidth() + \"px\" : \"\";\r\n\r\n\t\t// if(this.table.options.groupBy){\r\n\t\t// \tif(this.layoutMode() != \"fitDataFill\" && rowsCount == this.table.modules.groupRows.countGroups()){\r\n\t\t// \t\tel.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t// \t}\r\n\t\t// }\r\n\t}\r\n\r\n\trowAddingIndex(row, index, top){\r\n\t\tthis.assignRowToGroup(row);\r\n\r\n\t\tvar groupRows = row.modules.group.rows;\r\n\r\n\t\tif(groupRows.length > 1){\r\n\t\t\tif(!index || (index && groupRows.indexOf(index) == -1)){\r\n\t\t\t\tif(top){\r\n\t\t\t\t\tif(groupRows[0] !== row){\r\n\t\t\t\t\t\tindex = groupRows[0];\r\n\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(groupRows[groupRows.length -1] !== row){\r\n\t\t\t\t\t\tindex = groupRows[groupRows.length -1];\r\n\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn index;\r\n\t}\r\n\r\n\ttrackChanges(){\r\n\t\tthis.dispatch(\"group-changed\");\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tsetGroupBy(groups){\r\n\t\tthis.table.options.groupBy = groups;\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.initialize();\r\n\t\t}else{\r\n\t\t\tthis.configureGroupSetup();\r\n\t\t}\r\n\r\n\t\tthis.refreshData();\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\tsetGroupValues(groupValues){\r\n\t\tthis.table.options.groupValues = groupValues;\r\n\t\tthis.configureGroupSetup();\r\n\t\tthis.refreshData();\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\tsetGroupStartOpen(values){\r\n\t\tthis.table.options.groupStartOpen = values;\r\n\t\tthis.configureGroupSetup();\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\r\n\t\t\tthis.trackChanges();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Grouping Update - cant refresh view, no groups have been set\");\r\n\t\t}\r\n\t}\r\n\r\n\tsetGroupHeader(values){\r\n\t\tthis.table.options.groupHeader = values;\r\n\t\tthis.configureGroupSetup();\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\r\n\t\t\tthis.trackChanges();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Grouping Update - cant refresh view, no groups have been set\");\r\n\t\t}\r\n\t}\r\n\r\n\tuserGetGroups(values){\r\n\t\treturn this.getGroups(true);\r\n\t}\r\n\r\n\t// get grouped table data in the same format as getData()\r\n\tuserGetGroupedData(){\r\n\t\treturn this.table.options.groupBy ?\r\n\t\tthis.getGroupedData() : this.getData()\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////////\r\n\t///////// Component Functions /////////\r\n\t///////////////////////////////////////\r\n\r\n\trowGetGroup(row){\r\n\t\treturn row.modules.group ? row.modules.group.getComponent() : false;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\trowMoving(from, to, after){\r\n\t\tif(!after && to instanceof Group){\r\n\t\t\tto = this.table.rowManager.prevDisplayRow(from) || to;\r\n\t\t}\r\n\r\n\t\tvar toGroup = to instanceof Group ? to : to.modules.group;\r\n\t\tvar fromGroup = from instanceof Group ? from : from.modules.group;\r\n\r\n\t\tif(toGroup === fromGroup){\r\n\t\t\tthis.table.rowManager.moveRowInArray(toGroup.rows, from, to, after);\r\n\t\t}else{\r\n\t\t\tif(fromGroup){\r\n\t\t\t\tfromGroup.removeRow(from);\r\n\t\t\t}\r\n\r\n\t\t\ttoGroup.insertRow(from, to, after);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trowDeleting(row){\r\n\t\t//remove from group\r\n\t\tif(row.modules.group){\r\n\t\t\trow.modules.group.removeRow(row);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trowsUpdated(row){\r\n\t\tthis.updateGroupRows(true);\r\n\t}\r\n\r\n\tcellUpdated(cell){\r\n\t\tthis.reassignRowToGroup(cell.row);\r\n\t}\r\n\r\n\r\n\tsetDisplayIndex(index){\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\r\n\tgetDisplayIndex(){\r\n\t\treturn this.displayIndex;\r\n\t}\r\n\r\n\t//return appropriate rows with group headers\r\n\tgetRows(rows){\r\n\t\tif(this.table.options.groupBy && this.groupIDLookups.length){\r\n\r\n\t\t\tthis.dispatchExternal(\"dataGrouping\");\r\n\r\n\t\t\tthis.generateGroups(rows);\r\n\r\n\t\t\tif(this.subscribedExternal(\"dataGrouped\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataGrouped\", this.getGroups(true));\r\n\t\t\t}\r\n\r\n\t\t\treturn this.updateGroupRows();\r\n\r\n\t\t}else{\r\n\t\t\treturn rows.slice(0);\r\n\t\t}\r\n\t}\r\n\r\n\tgetGroups(component){\r\n\t\tvar groupComponents = [];\r\n\r\n\t\tthis.groupList.forEach(function(group){\r\n\t\t\tgroupComponents.push(component ? group.getComponent() : group);\r\n\t\t});\r\n\r\n\t\treturn groupComponents;\r\n\t}\r\n\r\n\tgetChildGroups(group){\r\n\t\tvar groupComponents = [];\r\n\r\n\t\tif(!group){\r\n\t\t\tgroup = this;\r\n\t\t}\r\n\r\n\t\tgroup.groupList.forEach((child) => {\r\n\t\t\tif(child.groupList.length){\r\n\t\t\t\tgroupComponents = groupComponents.concat(this.getChildGroups(child));\r\n\t\t\t}else{\r\n\t\t\t\tgroupComponents.push(child);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn groupComponents;\r\n\t}\r\n\r\n\twipe(){\r\n\t\tthis.groupList.forEach(function(group){\r\n\t\t\tgroup.wipe();\r\n\t\t});\r\n\t}\r\n\r\n\tpullGroupListData(groupList) {\r\n\t\tvar groupListData = [];\r\n\r\n\t\tgroupList.forEach((group) => {\r\n\t\t\tvar groupHeader = {};\r\n\t\t\tgroupHeader.level = 0;\r\n\t\t\tgroupHeader.rowCount = 0;\r\n\t\t\tgroupHeader.headerContent = \"\";\r\n\t\t\tvar childData = [];\r\n\r\n\t\t\tif (group.hasSubGroups) {\r\n\t\t\t\tchildData = this.pullGroupListData(group.groupList);\r\n\r\n\t\t\t\tgroupHeader.level = group.level;\r\n\t\t\t\tgroupHeader.rowCount = childData.length - group.groupList.length; // data length minus number of sub-headers\r\n\t\t\t\tgroupHeader.headerContent = group.generator(group.key, groupHeader.rowCount, group.rows, group);\r\n\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\t\t\t\tgroupListData = groupListData.concat(childData);\r\n\t\t\t}\r\n\r\n\t\t\telse {\r\n\t\t\t\tgroupHeader.level = group.level;\r\n\t\t\t\tgroupHeader.headerContent = group.generator(group.key, group.rows.length, group.rows, group);\r\n\t\t\t\tgroupHeader.rowCount = group.getRows().length;\r\n\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\r\n\t\t\t\tgroup.getRows().forEach((row) => {\r\n\t\t\t\t\tgroupListData.push(row.getData(\"data\"));\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn groupListData\r\n\t}\r\n\r\n\tgetGroupedData(){\r\n\r\n\t\treturn this.pullGroupListData(this.groupList);\r\n\t}\r\n\r\n\tgetRowGroup(row){\r\n\t\tvar match = false;\r\n\r\n\t\tif(this.options(\"dataTree\")){\r\n\t\t\trow = this.table.modules.dataTree.getTreeParentRoot(row);\r\n\t\t}\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\tvar result = group.getRowGroup(row);\r\n\r\n\t\t\tif(result){\r\n\t\t\t\tmatch = result;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tcountGroups(){\r\n\t\treturn this.groupList.length;\r\n\t}\r\n\r\n\tgenerateGroups(rows){\r\n\t\tvar oldGroups = this.groups;\r\n\r\n\t\tthis.groups = {};\r\n\t\tthis.groupList = [];\r\n\r\n\t\tif(this.allowedValues && this.allowedValues[0]){\r\n\t\t\tthis.allowedValues[0].forEach((value) => {\r\n\t\t\t\tthis.createGroup(value, 0, oldGroups);\r\n\t\t\t});\r\n\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.assignRowToExistingGroup(row, oldGroups);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.assignRowToGroup(row, oldGroups);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tcreateGroup(groupID, level, oldGroups){\r\n\t\tvar groupKey = level + \"_\" + groupID,\r\n\t\tgroup;\r\n\r\n\t\toldGroups = oldGroups || [];\r\n\r\n\t\tgroup = new Group(this, false, level, groupID, this.groupIDLookups[0].field, this.headerGenerator[0], oldGroups[groupKey]);\r\n\r\n\t\tthis.groups[groupKey] = group;\r\n\t\tthis.groupList.push(group);\r\n\t}\r\n\r\n\tassignRowToExistingGroup(row, oldGroups){\r\n\t\tvar groupID = this.groupIDLookups[0].func(row.getData()),\r\n\t\tgroupKey = \"0_\" + groupID;\r\n\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t}\r\n\t}\r\n\r\n\tassignRowToGroup(row, oldGroups){\r\n\t\tvar groupID = this.groupIDLookups[0].func(row.getData()),\r\n\t\tnewGroupNeeded = !this.groups[\"0_\" + groupID];\r\n\r\n\t\tif(newGroupNeeded){\r\n\t\t\tthis.createGroup(groupID, 0, oldGroups);\r\n\t\t}\r\n\r\n\t\tthis.groups[\"0_\" + groupID].addRow(row);\r\n\r\n\t\treturn !newGroupNeeded;\r\n\t}\r\n\r\n\treassignRowToGroup(row){\r\n\t\tif(row.type === \"row\"){\r\n\t\t\tvar oldRowGroup = row.modules.group,\r\n\t\t\toldGroupPath = oldRowGroup.getPath(),\r\n\t\t\tnewGroupPath = this.getExpectedPath(row),\r\n\t\t\tsamePath = true;\r\n\r\n\t\t\t// figure out if new group path is the same as old group path\r\n\t\t\tvar samePath = (oldGroupPath.length == newGroupPath.length) && oldGroupPath.every((element, index) => {\r\n\t\t\t\treturn element === newGroupPath[index];\r\n\t\t\t});\r\n\r\n\t\t\t// refresh if they new path and old path aren't the same (aka the row's groupings have changed)\r\n\t\t\tif(!samePath) {\r\n\t\t\t\toldRowGroup.removeRow(row);\r\n\t\t\t\tthis.assignRowToGroup(row, this.groups);\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgetExpectedPath(row) {\r\n\t\tvar groupPath = [], rowData = row.getData();\r\n\r\n\t\tthis.groupIDLookups.forEach((groupId) => {\r\n\t\t\tgroupPath.push(groupId.func(rowData));\r\n\t\t});\r\n\r\n\t\treturn groupPath;\r\n\t}\r\n\r\n\tupdateGroupRows(force){\r\n\t\tvar output = [],\r\n\t\toldRowCount;\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\toutput = output.concat(group.getHeadersAndRows());\r\n\t\t});\r\n\r\n\t\tif(force){\r\n\t\t\tthis.refreshData(true, this.displayHandler);\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tscrollHeaders(left){\r\n\t\tif(this.table.options.renderHorizontal === \"virtual\"){\r\n\t\t\tleft -= this.table.columnManager.renderer.vDomPadLeft;\r\n\t\t}\r\n\r\n\t\tleft = left + \"px\";\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\tgroup.scrollHeader(left);\r\n\t\t});\r\n\t}\r\n\r\n\tremoveGroup(group){\r\n\t\tvar groupKey = group.level + \"_\" + group.key,\r\n\t\tindex;\r\n\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tdelete this.groups[groupKey];\r\n\r\n\t\t\tindex = this.groupList.indexOf(group);\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.groupList.splice(index, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nGroupRows.moduleName = \"groupRows\";\r\n\r\nexport default GroupRows;","export default {\r\n\tcellEdit: function(action){\r\n\t\taction.component.setValueProcessData(action.data.oldValue);\r\n\t\taction.component.cellRendered();\r\n\t},\r\n\r\n\trowAdd: function(action){\r\n\t\taction.component.deleteActual();\r\n\t},\r\n\r\n\trowDelete: function(action){\r\n\t\tvar newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index);\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tthis.table.modules.groupRows.updateGroupRows(true);\r\n\t\t}\r\n\r\n\t\tthis._rebindRow(action.component, newRow);\r\n\t},\r\n\r\n\trowMove: function(action){\r\n\t\tthis.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posFrom], !action.data.after);\r\n\t\tthis.table.rowManager.redraw();\r\n\t},\r\n};","export default {\r\n\tcellEdit: function(action){\r\n\t\taction.component.setValueProcessData(action.data.newValue);\r\n\t\taction.component.cellRendered();\r\n\t},\r\n\r\n\trowAdd: function(action){\r\n\t\tvar newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index);\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tthis.table.modules.groupRows.updateGroupRows(true);\r\n\t\t}\r\n\r\n\t\tthis._rebindRow(action.component, newRow);\r\n\t},\r\n\r\n\trowDelete:function(action){\r\n\t\taction.component.deleteActual();\r\n\t},\r\n\r\n\trowMove: function(action){\r\n\t\tthis.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posTo], action.data.after);\r\n\t\tthis.table.rowManager.redraw();\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\nimport Row from '../../core/row/Row.js';\r\nimport Cell from '../../core/cell/Cell.js';\r\n\r\nimport defaultUndoers from './defaults/undoers.js';\r\nimport defaultRedoers from './defaults/redoers.js';\r\n\r\nclass History extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.history = [];\r\n\t\tthis.index = -1;\r\n\r\n\t\tthis.registerTableOption(\"history\", false); //enable edit history\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.history){\r\n\t\t\tthis.subscribe(\"cell-value-updated\", this.cellUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"cell-delete\", this.clearComponentHistory.bind(this));\r\n\t\t\tthis.subscribe(\"row-delete\", this.rowDeleted.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.clear.bind(this));\r\n\t\t\tthis.subscribe(\"row-added\", this.rowAdded.bind(this));\r\n\t\t\tthis.subscribe(\"row-move\", this.rowMoved.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"undo\", this.undo.bind(this));\r\n\t\tthis.registerTableFunction(\"redo\", this.redo.bind(this));\r\n\t\tthis.registerTableFunction(\"getHistoryUndoSize\", this.getHistoryUndoSize.bind(this));\r\n\t\tthis.registerTableFunction(\"getHistoryRedoSize\", this.getHistoryRedoSize.bind(this));\r\n\t\tthis.registerTableFunction(\"clearHistory\", this.clear.bind(this));\r\n\t}\r\n\r\n\trowMoved(from, to, after){\r\n\t\tthis.action(\"rowMove\", from, {posFrom:this.table.rowManager.getRowPosition(from), posTo:this.table.rowManager.getRowPosition(to), to:to, after:after});\r\n\t}\r\n\r\n\trowAdded(row, data, pos, index){\r\n\t\tthis.action(\"rowAdd\", row, {data:data, pos:pos, index:index});\r\n\t}\r\n\r\n\trowDeleted(row){\r\n\t\tvar index, rows;\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\r\n\t\t\trows = row.getComponent().getGroup().rows\r\n\t\t\tindex = rows.indexOf(row);\r\n\r\n\t\t\tif(index){\r\n\t\t\t\tindex = rows[index-1];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tindex = row.table.rowManager.getRowIndex(row);\r\n\r\n\t\t\tif(index){\r\n\t\t\t\tindex = row.table.rowManager.rows[index-1];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.action(\"rowDelete\", row, {data:row.getData(), pos:!index, index:index});\r\n\t}\r\n\r\n\tcellUpdated(cell){\r\n\t\tthis.action(\"cellEdit\", cell, {oldValue:cell.oldValue, newValue:cell.value});\r\n\t}\r\n\r\n\tclear(){\r\n\t\tthis.history = [];\r\n\t\tthis.index = -1;\r\n\t}\r\n\r\n\taction(type, component, data){\r\n\t\tthis.history = this.history.slice(0, this.index + 1);\r\n\r\n\t\tthis.history.push({\r\n\t\t\ttype:type,\r\n\t\t\tcomponent:component,\r\n\t\t\tdata:data,\r\n\t\t});\r\n\r\n\t\tthis.index ++;\r\n\t}\r\n\r\n\tgetHistoryUndoSize(){\r\n\t\treturn this.index + 1;\r\n\t}\r\n\r\n\tgetHistoryRedoSize(){\r\n\t\treturn this.history.length - (this.index + 1);\r\n\t}\r\n\r\n\tclearComponentHistory(component){\r\n\t\tvar index = this.history.findIndex(function(item){\r\n\t\t\treturn item.component === component;\r\n\t\t});\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.history.splice(index, 1);\r\n\t\t\tif(index <= this.index){\r\n\t\t\t\tthis.index--;\r\n\t\t\t}\r\n\r\n\t\t\tthis.clearComponentHistory(component);\r\n\t\t}\r\n\t}\r\n\r\n\tundo(){\r\n\t\tif(this.index > -1){\r\n\t\t\tlet action = this.history[this.index];\r\n\r\n\t\t\tHistory.undoers[action.type].call(this, action);\r\n\r\n\t\t\tthis.index--;\r\n\r\n\t\t\tthis.dispatchExternal(\"historyUndo\", action.type, action.component.getComponent(), action.data);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"History Undo Error - No more history to undo\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tredo(){\r\n\t\tif(this.history.length-1 > this.index){\r\n\r\n\t\t\tthis.index++;\r\n\r\n\t\t\tlet action = this.history[this.index];\r\n\r\n\t\t\tHistory.redoers[action.type].call(this, action);\r\n\r\n\t\t\tthis.dispatchExternal(\"historyRedo\", action.type, action.component.getComponent(), action.data);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"History Redo Error - No more history to redo\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//rebind rows to new element after deletion\r\n\t_rebindRow(oldRow, newRow){\r\n\t\tthis.history.forEach(function(action){\r\n\t\t\tif(action.component instanceof Row){\r\n\t\t\t\tif(action.component === oldRow){\r\n\t\t\t\t\taction.component = newRow;\r\n\t\t\t\t}\r\n\t\t\t}else if(action.component instanceof Cell){\r\n\t\t\t\tif(action.component.row === oldRow){\r\n\t\t\t\t\tvar field = action.component.column.getField();\r\n\r\n\t\t\t\t\tif(field){\r\n\t\t\t\t\t\taction.component = newRow.getCell(field);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n\r\nHistory.moduleName = \"history\";\r\n\r\n//load defaults\r\nHistory.undoers = defaultUndoers;\r\nHistory.redoers = defaultRedoers;\r\n\r\nexport default History;","import Module from '../../core/Module.js';\r\nimport Column from '../../core/column/Column.js';\r\n\r\nclass HtmlTableImport extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.fieldIndex = [];\r\n\t\tthis.hasIndex = false;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.tableElementCheck();\r\n\t}\r\n\r\n\ttableElementCheck(){\r\n\t\tif(this.table.originalElement && this.table.originalElement.tagName === \"TABLE\"){\r\n\t\t\tif(this.table.originalElement.childNodes.length){\r\n\t\t\t\tthis.parseTable();\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Unable to parse data from empty table tag, Tabulator should be initialized on a div tag unless importing data from a table element.\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tparseTable(){\r\n\t\tvar element = this.table.originalElement,\r\n\t\toptions = this.table.options,\r\n\t\tcolumns = options.columns,\r\n\t\theaders = element.getElementsByTagName(\"th\"),\r\n\t\trows = element.getElementsByTagName(\"tbody\")[0],\r\n\t\tdata = [],\r\n\t\tnewTable;\r\n\r\n\t\tthis.hasIndex = false;\r\n\r\n\t\tthis.dispatchExternal(\"htmlImporting\");\r\n\r\n\t\trows = rows ? rows.getElementsByTagName(\"tr\") : [];\r\n\r\n\t\t//check for Tabulator inline options\r\n\t\tthis._extractOptions(element, options);\r\n\r\n\t\tif(headers.length){\r\n\t\t\tthis._extractHeaders(headers, rows);\r\n\t\t}else{\r\n\t\t\tthis._generateBlankHeaders(headers, rows);\r\n\t\t}\r\n\r\n\t\t//iterate through table rows and build data set\r\n\t\tfor(var index = 0; index < rows.length; index++){\r\n\t\t\tvar row = rows[index],\r\n\t\t\tcells = row.getElementsByTagName(\"td\"),\r\n\t\t\titem = {};\r\n\r\n\t\t\t//create index if the dont exist in table\r\n\t\t\tif(!this.hasIndex){\r\n\t\t\t\titem[options.index] = index;\r\n\t\t\t}\r\n\r\n\t\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\t\tvar cell = cells[i];\r\n\t\t\t\tif(typeof this.fieldIndex[i] !== \"undefined\"){\r\n\t\t\t\t\titem[this.fieldIndex[i]] = cell.innerHTML;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//add row data to item\r\n\t\t\tdata.push(item);\r\n\t\t}\r\n\r\n\t\toptions.data = data;\r\n\r\n\t\tthis.dispatchExternal(\"htmlImported\");\r\n\t}\r\n\r\n\t//extract tabulator attribute options\r\n\t_extractOptions(element, options, defaultOptions){\r\n\t\tvar attributes = element.attributes;\r\n\t\tvar optionsArr = defaultOptions ? Object.keys(defaultOptions) : Object.keys(options);\r\n\t\tvar optionsList = {};\r\n\r\n\t\toptionsArr.forEach((item) => {\r\n\t\t\toptionsList[item.toLowerCase()] = item;\r\n\t\t});\r\n\r\n\t\tfor(var index in attributes){\r\n\t\t\tvar attrib = attributes[index];\r\n\t\t\tvar name;\r\n\r\n\t\t\tif(attrib && typeof attrib == \"object\" && attrib.name && attrib.name.indexOf(\"tabulator-\") === 0){\r\n\t\t\t\tname = attrib.name.replace(\"tabulator-\", \"\");\r\n\r\n\t\t\t\tif(typeof optionsList[name] !== \"undefined\"){\r\n\t\t\t\t\toptions[optionsList[name]] = this._attribValue(attrib.value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//get value of attribute\r\n\t_attribValue(value){\r\n\t\tif(value === \"true\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif(value === \"false\"){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\t//find column if it has already been defined\r\n\t_findCol(title){\r\n\t\tvar match = this.table.options.columns.find((column) => {\r\n\t\t\treturn column.title === title;\r\n\t\t});\r\n\r\n\t\treturn match || false;\r\n\t}\r\n\r\n\t//extract column from headers\r\n\t_extractHeaders(headers, rows){\r\n\t\tfor(var index = 0; index < headers.length; index++){\r\n\t\t\tvar header = headers[index],\r\n\t\t\texists = false,\r\n\t\t\tcol = this._findCol(header.textContent),\r\n\t\t\twidth, attributes;\r\n\r\n\t\t\tif(col){\r\n\t\t\t\texists = true;\r\n\t\t\t}else{\r\n\t\t\t\tcol = {title:header.textContent.trim()};\r\n\t\t\t}\r\n\r\n\t\t\tif(!col.field) {\r\n\t\t\t\tcol.field = header.textContent.trim().toLowerCase().replace(\" \", \"_\");\r\n\t\t\t}\r\n\r\n\t\t\twidth = header.getAttribute(\"width\");\r\n\r\n\t\t\tif(width && !col.width)\t{\r\n\t\t\t\tcol.width = width;\r\n\t\t\t}\r\n\r\n\t\t\t//check for Tabulator inline options\r\n\t\t\tthis._extractOptions(header, col, this.table.columnManager.optionsList.registeredDefaults);\r\n\r\n\t\t\tthis.fieldIndex[index] = col.field;\r\n\r\n\t\t\tif(col.field == this.table.options.index){\r\n\t\t\t\tthis.hasIndex = true;\r\n\t\t\t}\r\n\r\n\t\t\tif(!exists){\r\n\t\t\t\tthis.table.options.columns.push(col);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\r\n\t//generate blank headers\r\n\t_generateBlankHeaders(headers, rows){\r\n\t\tfor(var index = 0; index < headers.length; index++){\r\n\t\t\tvar header = headers[index],\r\n\t\t\tcol = {title:\"\", field:\"col\" + index};\r\n\r\n\t\t\tthis.fieldIndex[index] = col.field;\r\n\r\n\t\t\tvar width = header.getAttribute(\"width\");\r\n\r\n\t\t\tif(width){\r\n\t\t\t\tcol.width = width;\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.options.columns.push(col);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nHtmlTableImport.moduleName = \"htmlTableImport\";\r\n\r\nexport default HtmlTableImport;","function csvImporter(input){\r\n var data = [],\r\n row = 0, \r\n col = 0,\r\n inQuote = false;\r\n \r\n //Iterate over each character\r\n for (let index = 0; index < input.length; index++) {\r\n let char = input[index], \r\n nextChar = input[index+1]; \r\n \r\n //Initialize empty row\r\n if(!data[row]){\r\n data[row] = [];\r\n }\r\n\r\n //Initialize empty column\r\n if(!data[row][col]){\r\n data[row][col] = \"\";\r\n }\r\n \r\n //Handle quotation mark inside string\r\n if (char == '\"' && inQuote && nextChar == '\"') { \r\n data[row][col] += char; \r\n index++;\r\n continue; \r\n }\r\n \r\n //Begin / End Quote\r\n if (char == '\"') { \r\n inQuote = !inQuote;\r\n continue;\r\n }\r\n \r\n //Next column (if not in quote)\r\n if (char == ',' && !inQuote) { \r\n col++;\r\n continue; \r\n }\r\n \r\n //New row if new line and not in quote (CRLF) \r\n if (char == '\\r' && nextChar == '\\n' && !inQuote) { \r\n col = 0; \r\n row++; \r\n index++; \r\n continue; \r\n }\r\n \r\n //New row if new line and not in quote (CR or LF) \r\n if ((char == '\\r' || char == '\\n') && !inQuote) { \r\n col = 0;\r\n row++;\r\n continue; \r\n }\r\n\r\n //Normal Character, append to column\r\n data[row][col] += char;\r\n }\r\n\r\n return data;\r\n}\r\n\r\nexport default csvImporter;","export default function(input){\r\n try {\r\n return JSON.parse(input);\r\n } catch(e) {\r\n console.warn(\"JSON Import Error - File contents is invalid JSON\", e);\r\n return Promise.reject();\r\n }\r\n}","import csv from './importers/csv.js';\r\nimport json from './importers/json.js';\r\n\r\nexport default {\r\n\tcsv:csv,\r\n\tjson:json,\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultImporters from './defaults/importers.js';\r\n\r\nclass Import extends Module{\r\n \r\n constructor(table){\r\n super(table);\r\n \r\n this.registerTableOption(\"importFormat\");\r\n this.registerTableOption(\"importReader\", \"text\");\r\n }\r\n \r\n initialize(){\r\n this.registerTableFunction(\"import\", this.importFromFile.bind(this));\r\n\r\n if(this.table.options.importFormat){\r\n this.subscribe(\"data-loading\", this.loadDataCheck.bind(this), 10);\r\n this.subscribe(\"data-load\", this.loadData.bind(this), 10);\r\n }\r\n }\r\n\r\n loadDataCheck(data){\r\n return typeof data === \"string\";\r\n }\r\n\r\n loadData(data, params, config, silent, previousData){\r\n return this.importData(this.lookupImporter(), data)\r\n .then(this.structureData.bind(this))\r\n .catch((err) => {\r\n console.error(\"Import Error:\", err || \"Unable to import data\")\r\n return Promise.reject(err);\r\n })\r\n }\r\n\r\n lookupImporter(importFormat){\r\n var importer;\r\n \r\n if(!importFormat){\r\n importFormat = this.table.options.importFormat;\r\n }\r\n \r\n if(typeof importFormat === \"string\"){\r\n importer = Import.importers[importFormat];\r\n }else{\r\n importer = importFormat;\r\n }\r\n\r\n if(!importer){\r\n console.error(\"Import Error - Importer not found:\", importFormat);\r\n }\r\n \r\n return importer;\r\n }\r\n \r\n importFromFile(importFormat, extension){\r\n var importer = this.lookupImporter(importFormat);\r\n \r\n if(importer){\r\n return this.pickFile(extension)\r\n .then(this.importData.bind(this, importer))\r\n .then(this.structureData.bind(this))\r\n .then(this.setData.bind(this))\r\n .catch((err) => {\r\n console.error(\"Import Error:\", err || \"Unable to import file\")\r\n return Promise.reject(err);\r\n })\r\n }\r\n }\r\n \r\n pickFile(extensions){\r\n return new Promise((resolve, reject) => {\r\n var input = document.createElement(\"input\");\r\n input.type = \"file\";\r\n input.accept = extensions;\r\n \r\n input.addEventListener(\"change\", (e) => {\r\n var file = input.files[0],\r\n reader = new FileReader(),\r\n data;\r\n \r\n switch(this.table.options.importReader){\r\n case \"buffer\":\r\n reader.readAsArrayBuffer(file);\r\n break;\r\n\r\n case \"binary\":\r\n reader.readAsBinaryString(file);\r\n break;\r\n\r\n case \"url\":\r\n reader.readAsDataURL(file);\r\n break;\r\n\r\n case \"text\":\r\n default:\r\n reader.readAsText(file);\r\n }\r\n \r\n reader.onload = (e) => {\r\n resolve(reader.result)\r\n };\r\n \r\n reader.onerror = (e) => {\r\n console.warn(\"File Load Error - Unable to read file\");\r\n reject();\r\n };\r\n });\r\n \r\n input.click();\r\n });\r\n }\r\n \r\n importData(importer, fileContents){\r\n var data = importer.call(this.table, fileContents);\r\n \r\n if(data instanceof Promise){\r\n return data;\r\n }else{\r\n return data ? Promise.resolve(data) : Promise.reject();\r\n }\r\n }\r\n\r\n structureData(parsedData){\r\n var data = [];\r\n \r\n if(Array.isArray(parsedData) && parsedData.length && Array.isArray(parsedData[0])){\r\n if(this.table.options.autoColumns){\r\n data = this.structureArrayToObject(parsedData);\r\n }else{\r\n data = this.structureArrayToColumns(parsedData);\r\n }\r\n\r\n return data;\r\n }else{\r\n return parsedData;\r\n }\r\n }\r\n\r\n structureArrayToObject(parsedData){\r\n var columns = parsedData.shift();\r\n\r\n var data = parsedData.map((values) => {\r\n var row = {};\r\n\r\n columns.forEach((key, i) => {\r\n row[key] = values[i];\r\n })\r\n\r\n return row;\r\n })\r\n\r\n return data;\r\n }\r\n\r\n structureArrayToColumns(parsedData){\r\n var data = [],\r\n columns = this.table.getColumns();\r\n\r\n //remove first row if it is the column names\r\n if(columns[0] && parsedData[0][0]){\r\n if(columns[0].getDefinition().title === parsedData[0][0]){\r\n parsedData.shift();\r\n }\r\n }\r\n \r\n //convert row arrays to objects\r\n parsedData.forEach((rowData) => {\r\n var row = {};\r\n\r\n rowData.forEach((value, index) => {\r\n var column = columns[index];\r\n\r\n if(column){\r\n row[column.getField()] = value;\r\n }\r\n })\r\n\r\n data.push(row);\r\n });\r\n\r\n return data;\r\n }\r\n \r\n setData(data){\r\n return this.table.setData(data);\r\n }\r\n}\r\n\r\nImport.moduleName = \"import\";\r\n\r\n//load defaults\r\nImport.importers = defaultImporters;\r\n\r\nexport default Import;","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport Cell from '../../core/cell/Cell.js';\r\nimport Column from '../../core/column/Column.js';\r\n\r\nclass Interaction extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.eventMap = {\r\n\t\t\t//row events\r\n\t\t\trowClick:\"row-click\",\r\n\t\t\trowDblClick:\"row-dblclick\",\r\n\t\t\trowContext:\"row-contextmenu\",\r\n\t\t\trowMouseEnter:\"row-mouseenter\",\r\n\t\t\trowMouseLeave:\"row-mouseleave\",\r\n\t\t\trowMouseOver:\"row-mouseover\",\r\n\t\t\trowMouseOut:\"row-mouseout\",\r\n\t\t\trowMouseMove:\"row-mousemove\",\r\n\t\t\trowTap:\"row\",\r\n\t\t\trowDblTap:\"row\",\r\n\t\t\trowTapHold:\"row\",\r\n\r\n\t\t\t//cell events\r\n\t\t\tcellClick:\"cell-click\",\r\n\t\t\tcellDblClick:\"cell-dblclick\",\r\n\t\t\tcellContext:\"cell-contextmenu\",\r\n\t\t\tcellMouseEnter:\"cell-mouseenter\",\r\n\t\t\tcellMouseLeave:\"cell-mouseleave\",\r\n\t\t\tcellMouseOver:\"cell-mouseover\",\r\n\t\t\tcellMouseOut:\"cell-mouseout\",\r\n\t\t\tcellMouseMove:\"cell-mousemove\",\r\n\t\t\tcellTap:\"cell\",\r\n\t\t\tcellDblTap:\"cell\",\r\n\t\t\tcellTapHold:\"cell\",\r\n\r\n\t\t\t//column header events\r\n\t\t\theaderClick:\"column-click\",\r\n\t\t\theaderDblClick:\"column-dblclick\",\r\n\t\t\theaderContext:\"column-contextmenu\",\r\n\t\t\theaderMouseEnter:\"column-mouseenter\",\r\n\t\t\theaderMouseLeave:\"column-mouseleave\",\r\n\t\t\theaderMouseOver:\"column-mouseover\",\r\n\t\t\theaderMouseOut:\"column-mouseout\",\r\n\t\t\theaderMouseMove:\"column-mousemove\",\r\n\t\t\theaderTap:\"column\",\r\n\t\t\theaderDblTap:\"column\",\r\n\t\t\theaderTapHold:\"column\",\r\n\r\n\t\t\t//group header\r\n\t\t\tgroupClick:\"group-click\",\r\n\t\t\tgroupDblClick:\"group-dblclick\",\r\n\t\t\tgroupContext:\"group-contextmenu\",\r\n\t\t\tgroupMouseEnter:\"group-mouseenter\",\r\n\t\t\tgroupMouseLeave:\"group-mouseleave\",\r\n\t\t\tgroupMouseOver:\"group-mouseover\",\r\n\t\t\tgroupMouseOut:\"group-mouseout\",\r\n\t\t\tgroupMouseMove:\"group-mousemove\",\r\n\t\t\tgroupTap:\"group\",\r\n\t\t\tgroupDblTap:\"group\",\r\n\t\t\tgroupTapHold:\"group\",\r\n\t\t}\r\n\r\n\t\tthis.subscribers = {};\r\n\r\n\t\tthis.touchSubscribers = {};\r\n\r\n\t\tthis.columnSubscribers = {};\r\n\r\n\t\tthis.touchWatchers = {\r\n\t\t\trow:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tcell:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tcolumn:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tgroup:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.registerColumnOption(\"headerClick\");\r\n\t\tthis.registerColumnOption(\"headerDblClick\");\r\n\t\tthis.registerColumnOption(\"headerContext\");\r\n\t\tthis.registerColumnOption(\"headerMouseEnter\");\r\n\t\tthis.registerColumnOption(\"headerMouseLeave\");\r\n\t\tthis.registerColumnOption(\"headerMouseOver\");\r\n\t\tthis.registerColumnOption(\"headerMouseOut\");\r\n\t\tthis.registerColumnOption(\"headerMouseMove\");\r\n\t\tthis.registerColumnOption(\"headerTap\");\r\n\t\tthis.registerColumnOption(\"headerDblTap\");\r\n\t\tthis.registerColumnOption(\"headerTapHold\");\r\n\r\n\t\tthis.registerColumnOption(\"cellClick\");\r\n\t\tthis.registerColumnOption(\"cellDblClick\");\r\n\t\tthis.registerColumnOption(\"cellContext\");\r\n\t\tthis.registerColumnOption(\"cellMouseEnter\");\r\n\t\tthis.registerColumnOption(\"cellMouseLeave\");\r\n\t\tthis.registerColumnOption(\"cellMouseOver\");\r\n\t\tthis.registerColumnOption(\"cellMouseOut\");\r\n\t\tthis.registerColumnOption(\"cellMouseMove\");\r\n\t\tthis.registerColumnOption(\"cellTap\");\r\n\t\tthis.registerColumnOption(\"cellDblTap\");\r\n\t\tthis.registerColumnOption(\"cellTapHold\");\r\n\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.initializeExternalEvents();\r\n\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this))\r\n\t\tthis.subscribe(\"cell-dblclick\", this.cellContentsSelectionFixer.bind(this))\r\n\t}\r\n\r\n\tcellContentsSelectionFixer(e, cell){\r\n\t\tif(this.table.modExists(\"edit\")){\r\n\t\t\tif (this.table.modules.edit.currentCell === this){\r\n\t\t\t\treturn; //prevent instant selection of editor content\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\ttry{\r\n\t\t\tif (document.selection) { // IE\r\n\t\t\t\tvar range = document.body.createTextRange();\r\n\t\t\t\trange.moveToElementText(this.element);\r\n\t\t\t\trange.select();\r\n\t\t\t} else if (window.getSelection) {\r\n\t\t\t\tvar range = document.createRange();\r\n\t\t\t\trange.selectNode(this.element);\r\n\t\t\t\twindow.getSelection().removeAllRanges();\r\n\t\t\t\twindow.getSelection().addRange(range);\r\n\t\t\t}\r\n\t\t}catch(e){}\r\n\t}\r\n\r\n\tinitializeExternalEvents(){\r\n\t\tfor(let key in this.eventMap){\r\n\t\t\tthis.subscriptionChangeExternal(key, this.subscriptionChanged.bind(this, key))\r\n\t\t}\r\n\t}\r\n\r\n\tsubscriptionChanged(key, added){\r\n\t\tvar index;\r\n\r\n\t\tif(added){\r\n\t\t\tif(!this.subscribers[key]){\r\n\t\t\t\tif(this.eventMap[key].includes(\"-\")){\r\n\t\t\t\t\tthis.subscribers[key] = this.handle.bind(this, key);\r\n\t\t\t\t\tthis.subscribe(this.eventMap[key], this.subscribers[key]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.subscribeTouchEvents(key);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.eventMap[key].includes(\"-\")){\r\n\t\t\t\tif(this.subscribers[key] && !this.columnSubscribers[key] && !this.subscribedExternal(key)){\r\n\t\t\t\t\tthis.unsubscribe(this.eventMap[key], this.subscribers[key]);\r\n\t\t\t\t\tdelete this.subscribers[key];\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.unsubscribeTouchEvents(key);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tsubscribeTouchEvents(key){\r\n\t\tvar type = this.eventMap[key];\r\n\r\n\t\tif(!this.touchSubscribers[type + \"-touchstart\"]){\r\n\t\t\tthis.touchSubscribers[type + \"-touchstart\"] = this.handleTouch.bind(this, type, \"start\");\r\n\t\t\tthis.touchSubscribers[type + \"-touchend\"] = this.handleTouch.bind(this, type, \"end\");\r\n\r\n\t\t\tthis.subscribe(type + \"-touchstart\", this.touchSubscribers[type + \"-touchstart\"]);\r\n\t\t\tthis.subscribe(type + \"-touchend\", this.touchSubscribers[type + \"-touchend\"]);\r\n\t\t}\r\n\r\n\t\tthis.subscribers[key] = true;\r\n\t}\r\n\r\n\tunsubscribeTouchEvents(key){\r\n\t\tvar notouch = true,\r\n\t\ttype = this.eventMap[key];\r\n\r\n\t\tif(this.subscribers[key] && !this.subscribedExternal(key)){\r\n\t\t\tdelete this.subscribers[key];\r\n\r\n\t\t\tfor(let i in this.eventMap){\r\n\t\t\t\tif(this.eventMap[i] === type){\r\n\t\t\t\t\tif(this.subscribers[i]){\r\n\t\t\t\t\t\tnotouch = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(notouch){\r\n\t\t\t\tthis.unsubscribe(type + \"-touchstart\", this.touchSubscribers[type + \"-touchstart\"]);\r\n\t\t\t\tthis.unsubscribe(type + \"-touchend\", this.touchSubscribers[type + \"-touchend\"]);\r\n\r\n\t\t\t\tdelete this.touchSubscribers[type + \"-touchstart\"];\r\n\t\t\t\tdelete this.touchSubscribers[type + \"-touchend\"];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.definition;\r\n\r\n\t\tfor(let key in this.eventMap){\r\n\t\t\tif(def[key]){\r\n\t\t\t\tthis.subscriptionChanged(key, true);\r\n\r\n\t\t\t\tif(!this.columnSubscribers[key]){\r\n\t\t\t\t\tthis.columnSubscribers[key] = [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.columnSubscribers[key].push(column);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\thandle(action, e, component){\r\n\t\tthis.dispatchEvent(action, e, component);\r\n\t}\r\n\r\n\thandleTouch(type, action, e, component){\r\n\t\tvar watchers = this.touchWatchers[type];\r\n\r\n\t\tif(type === \"column\"){\r\n\t\t\ttype = \"header\";\r\n\t\t}\r\n\r\n\t\tswitch(action){\r\n\t\t\tcase \"start\":\r\n\t\t\twatchers.tap = true;\r\n\r\n\t\t\tclearTimeout(watchers.tapHold);\r\n\r\n\t\t\twatchers.tapHold = setTimeout(() => {\r\n\t\t\t\tclearTimeout(watchers.tapHold);\r\n\t\t\t\twatchers.tapHold = null;\r\n\r\n\t\t\t\twatchers.tap = null;\r\n\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\twatchers.tapDbl = null;\r\n\r\n\t\t\t\tthis.dispatchEvent(type + \"TapHold\", e, component);\r\n\t\t\t}, 1000);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"end\":\r\n\t\t\tif(watchers.tap){\r\n\r\n\t\t\t\twatchers.tap = null;\r\n\t\t\t\tthis.dispatchEvent(type + \"Tap\", e, component);\r\n\t\t\t}\r\n\r\n\t\t\tif(watchers.tapDbl){\r\n\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\twatchers.tapDbl = null;\r\n\r\n\t\t\t\tthis.dispatchEvent(type + \"DblTap\", e, component);\r\n\t\t\t}else{\r\n\t\t\t\twatchers.tapDbl = setTimeout(() => {\r\n\t\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\t\twatchers.tapDbl = null;\r\n\t\t\t\t}, 300);\r\n\t\t\t}\r\n\r\n\t\t\tclearTimeout(watchers.tapHold);\r\n\t\t\twatchers.tapHold = null;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tdispatchEvent(action, e, component){\r\n\t\tvar componentObj = component.getComponent(),\r\n\t\tcallback;\r\n\r\n\t\tif(this.columnSubscribers[action]){\r\n\r\n\t\t\tif(component instanceof Cell){\r\n\t\t\t\tcallback = component.column.definition[action];\r\n\t\t\t}else if(component instanceof Column){\r\n\t\t\t\tcallback = component.definition[action];\r\n\t\t\t}\r\n\r\n\t\t\tif(callback){\r\n\t\t\t\tcallback(e, componentObj);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(action, e, componentObj);\r\n\t}\r\n}\r\n\r\nInteraction.moduleName = \"interaction\";\r\n\r\nexport default Interaction;\r\n","export default {\r\n\tnavPrev:\"shift + 9\",\r\n\tnavNext:9,\r\n\tnavUp:38,\r\n\tnavDown:40,\r\n\tscrollPageUp:33,\r\n\tscrollPageDown:34,\r\n\tscrollToStart:36,\r\n\tscrollToEnd:35,\r\n\tundo:[\"ctrl + 90\", \"meta + 90\"],\r\n\tredo:[\"ctrl + 89\", \"meta + 89\"],\r\n\tcopyToClipboard:[\"ctrl + 67\", \"meta + 89\"],\r\n};","export default {\r\n\tkeyBlock:function(e){\r\n\t\te.stopPropagation();\r\n\t\te.preventDefault();\r\n\t},\r\n\tscrollPageUp:function(e){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tnewPos = rowManager.scrollTop - rowManager.element.clientHeight,\r\n\t\tscrollMax = rowManager.element.scrollHeight;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\tif(newPos >= 0){\r\n\t\t\t\trowManager.element.scrollTop = newPos;\r\n\t\t\t}else{\r\n\t\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[0]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tscrollPageDown:function(e){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tnewPos = rowManager.scrollTop + rowManager.element.clientHeight,\r\n\t\tscrollMax = rowManager.element.scrollHeight;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\tif(newPos <= scrollMax){\r\n\t\t\t\trowManager.element.scrollTop = newPos;\r\n\t\t\t}else{\r\n\t\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\r\n\t},\r\n\tscrollToStart:function(e){\r\n\t\tvar rowManager = this.table.rowManager;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[0]);\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tscrollToEnd:function(e){\r\n\t\tvar rowManager = this.table.rowManager;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]);\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tnavPrev:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-prev\", e);\r\n\t},\r\n\r\n\tnavNext:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-next\", e);\r\n\t},\r\n\r\n\tnavLeft:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-left\", e);\r\n\t},\r\n\r\n\tnavRight:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-right\", e);\r\n\t},\r\n\r\n\tnavUp:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-up\", e);\r\n\t},\r\n\r\n\tnavDown:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-down\", e);\r\n\t},\r\n\r\n\tundo:function(e){\r\n\t\tvar cell = false;\r\n\t\tif(this.table.options.history && this.table.modExists(\"history\") && this.table.modExists(\"edit\")){\r\n\r\n\t\t\tcell = this.table.modules.edit.currentCell;\r\n\r\n\t\t\tif(!cell){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tthis.table.modules.history.undo();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tredo:function(e){\r\n\t\tvar cell = false;\r\n\t\tif(this.table.options.history && this.table.modExists(\"history\") && this.table.modExists(\"edit\")){\r\n\r\n\t\t\tcell = this.table.modules.edit.currentCell;\r\n\r\n\t\t\tif(!cell){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tthis.table.modules.history.redo();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tcopyToClipboard:function(e){\r\n\t\tif(!this.table.modules.edit.currentCell){\r\n\t\t\tif(this.table.modExists(\"clipboard\", true)){\r\n\t\t\t\tthis.table.modules.clipboard.copy(false, true);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultBindings from './defaults/bindings.js';\r\nimport defaultActions from './defaults/actions.js';\r\n\r\nclass Keybindings extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.watchKeys = null;\r\n\t\tthis.pressedKeys = null;\r\n\t\tthis.keyupBinding = false;\r\n\t\tthis.keydownBinding = false;\r\n\r\n\t\tthis.registerTableOption(\"keybindings\", {}); //array for keybindings\r\n\t\tthis.registerTableOption(\"tabEndNewRow\", false); //create new row when tab to end of table\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tvar bindings = this.table.options.keybindings,\r\n\t\tmergedBindings = {};\r\n\r\n\t\tthis.watchKeys = {};\r\n\t\tthis.pressedKeys = [];\r\n\r\n\t\tif(bindings !== false){\r\n\t\t\tObject.assign(mergedBindings, Keybindings.bindings)\r\n\t\t\tObject.assign(mergedBindings, bindings)\r\n\r\n\t\t\tthis.mapBindings(mergedBindings);\r\n\t\t\tthis.bindEvents();\r\n\t\t}\r\n\r\n\t\tthis.subscribe(\"table-destroy\", this.clearBindings.bind(this));\r\n\t}\r\n\r\n\tmapBindings(bindings){\r\n\t\tfor(let key in bindings){\r\n\t\t\tif(Keybindings.actions[key]){\r\n\t\t\t\tif(bindings[key]){\r\n\t\t\t\t\tif(typeof bindings[key] !== \"object\"){\r\n\t\t\t\t\t\tbindings[key] = [bindings[key]];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbindings[key].forEach((binding) => {\r\n\t\t\t\t\t\tvar bindingList = Array.isArray(binding) ? binding : [binding];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tbindingList.forEach((item) => {\r\n\t\t\t\t\t\t\tthis.mapBinding(key, item);\r\n\t\t\t\t\t\t});\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Key Binding Error - no such action:\", key);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmapBinding(action, symbolsList){\r\n\t\tvar binding = {\r\n\t\t\taction: Keybindings.actions[action],\r\n\t\t\tkeys: [],\r\n\t\t\tctrl: false,\r\n\t\t\tshift: false,\r\n\t\t\tmeta: false,\r\n\t\t};\r\n\r\n\t\tvar symbols = symbolsList.toString().toLowerCase().split(\" \").join(\"\").split(\"+\");\r\n\r\n\t\tsymbols.forEach((symbol) => {\r\n\t\t\tswitch(symbol){\r\n\t\t\t\tcase \"ctrl\":\r\n\t\t\t\tbinding.ctrl = true;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"shift\":\r\n\t\t\t\tbinding.shift = true;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"meta\":\r\n\t\t\t\tbinding.meta = true;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\tsymbol = isNaN(symbol) ? symbol.toUpperCase().charCodeAt(0) : parseInt(symbol);\r\n\t\t\t\tbinding.keys.push(symbol);\r\n\r\n\t\t\t\tif(!this.watchKeys[symbol]){\r\n\t\t\t\t\tthis.watchKeys[symbol] = [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.watchKeys[symbol].push(binding);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tbindEvents(){\r\n\t\tvar self = this;\r\n\r\n\t\tthis.keyupBinding = function(e){\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tvar bindings = self.watchKeys[code];\r\n\r\n\t\t\tif(bindings){\r\n\r\n\t\t\t\tself.pressedKeys.push(code);\r\n\r\n\t\t\t\tbindings.forEach(function(binding){\r\n\t\t\t\t\tself.checkBinding(e, binding);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.keydownBinding = function(e){\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tvar bindings = self.watchKeys[code];\r\n\r\n\t\t\tif(bindings){\r\n\r\n\t\t\t\tvar index = self.pressedKeys.indexOf(code);\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tself.pressedKeys.splice(index, 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.table.element.addEventListener(\"keydown\", this.keyupBinding);\r\n\r\n\t\tthis.table.element.addEventListener(\"keyup\", this.keydownBinding);\r\n\t}\r\n\r\n\tclearBindings(){\r\n\t\tif(this.keyupBinding){\r\n\t\t\tthis.table.element.removeEventListener(\"keydown\", this.keyupBinding);\r\n\t\t}\r\n\r\n\t\tif(this.keydownBinding){\r\n\t\t\tthis.table.element.removeEventListener(\"keyup\", this.keydownBinding);\r\n\t\t}\r\n\t}\r\n\r\n\tcheckBinding(e, binding){\r\n\t\tvar match = true;\r\n\r\n\t\tif(e.ctrlKey == binding.ctrl && e.shiftKey == binding.shift && e.metaKey == binding.meta){\r\n\t\t\tbinding.keys.forEach((key) => {\r\n\t\t\t\tvar index = this.pressedKeys.indexOf(key);\r\n\r\n\t\t\t\tif(index == -1){\r\n\t\t\t\t\tmatch = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tbinding.action.call(this, e);\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\nKeybindings.moduleName = \"keybindings\";\r\n\r\n//load defaults\r\nKeybindings.bindings = defaultBindings;\r\nKeybindings.actions = defaultActions;\r\n\r\nexport default Keybindings;","import Module from '../../core/Module.js';\r\n\r\nclass Menu extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.menuContainer = null;\r\n\t\tthis.nestedMenuBlock = false;\r\n\t\t\r\n\t\tthis.currentComponent = null;\r\n\t\tthis.rootPopup = null;\r\n\t\t\r\n\t\tthis.columnSubscribers = {};\r\n\t\t\r\n\t\tthis.registerTableOption(\"menuContainer\", undefined); //deprecated\r\n\r\n\t\tthis.registerTableOption(\"rowContextMenu\", false);\r\n\t\tthis.registerTableOption(\"rowClickMenu\", false);\r\n\t\tthis.registerTableOption(\"groupContextMenu\", false);\r\n\t\tthis.registerTableOption(\"groupClickMenu\", false);\r\n\t\t\r\n\t\tthis.registerColumnOption(\"headerContextMenu\");\r\n\t\tthis.registerColumnOption(\"headerClickMenu\");\r\n\t\tthis.registerColumnOption(\"headerMenu\");\r\n\t\tthis.registerColumnOption(\"headerMenuIcon\");\r\n\t\tthis.registerColumnOption(\"contextMenu\");\r\n\t\tthis.registerColumnOption(\"clickMenu\");\r\n\t\t\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.deprecationCheck();\r\n\t\tthis.initializeRowWatchers();\r\n\t\tthis.initializeGroupWatchers();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\r\n\tdeprecationCheck(){\r\n\t\tif(typeof this.table.options.menuContainer !== \"undefined\"){\r\n\t\t\tconsole.warn(\"Use of the menuContainer option is now deprecated. Please use the popupContainer option instead\");\r\n\r\n\t\t\tthis.table.options.popupContainer = this.table.options.menuContainer;\r\n\t\t}\r\n\t}\t\r\n\t\r\n\tinitializeRowWatchers(){\r\n\t\tif(this.table.options.rowContextMenu){\r\n\t\t\tthis.subscribe(\"row-contextmenu\", this.loadMenuEvent.bind(this, this.table.options.rowContextMenu));\r\n\t\t\tthis.table.on(\"rowTapHold\", this.loadMenuEvent.bind(this, this.table.options.rowContextMenu));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.rowClickMenu){\r\n\t\t\tthis.subscribe(\"row-click\", this.loadMenuEvent.bind(this, this.table.options.rowClickMenu));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeGroupWatchers(){\r\n\t\tif(this.table.options.groupContextMenu){\r\n\t\t\tthis.subscribe(\"group-contextmenu\", this.loadMenuEvent.bind(this, this.table.options.groupContextMenu));\r\n\t\t\tthis.table.on(\"groupTapHold\", this.loadMenuEvent.bind(this, this.table.options.groupContextMenu));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.groupClickMenu){\r\n\t\t\tthis.subscribe(\"group-click\", this.loadMenuEvent.bind(this, this.table.options.groupClickMenu));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar options = [\"headerContextMenu\", \"headerClickMenu\"],\r\n\t\tdef = column.definition;\r\n\t\t\r\n\t\t//handle column events\r\n\t\tif(def.headerContextMenu && !this.columnSubscribers.headerContextMenu){\r\n\t\t\tthis.columnSubscribers.headerContextMenu = this.loadMenuTableColumnEvent.bind(this, \"headerContextMenu\");\r\n\t\t\tthis.subscribe(\"column-contextmenu\", this.columnSubscribers.headerContextMenu);\r\n\t\t\tthis.table.on(\"headerTapHold\", this.loadMenuTableColumnEvent.bind(this, \"headerContextMenu\"))\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerClickMenu && !this.columnSubscribers.headerClickMenu){\r\n\t\t\tthis.columnSubscribers.headerClickMenu = this.loadMenuTableColumnEvent.bind(this, \"headerClickMenu\");\r\n\t\t\tthis.subscribe(\"column-click\", this.columnSubscribers.headerClickMenu);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerMenu){\r\n\t\t\tthis.initializeColumnHeaderMenu(column);\r\n\t\t}\r\n\t\t\r\n\t\t//handle cell events\r\n\t\tif(def.contextMenu && !this.columnSubscribers.contextMenu){\r\n\t\t\tthis.columnSubscribers.contextMenu = this.loadMenuTableCellEvent.bind(this, \"contextMenu\");\r\n\t\t\tthis.subscribe(\"cell-contextmenu\", this.columnSubscribers.contextMenu);\r\n\t\t\tthis.table.on(\"cellTapHold\", this.loadMenuTableCellEvent.bind(this, \"contextMenu\"))\r\n\t\t}\r\n\t\t\r\n\t\tif(def.clickMenu && !this.columnSubscribers.clickMenu){\r\n\t\t\tthis.columnSubscribers.clickMenu = this.loadMenuTableCellEvent.bind(this, \"clickMenu\");\r\n\t\t\tthis.subscribe(\"cell-click\", this.columnSubscribers.clickMenu);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumnHeaderMenu(column){\r\n\t\tvar icon = column.definition.headerMenuIcon,\r\n\t\theaderMenuEl;\r\n\t\t\r\n\t\theaderMenuEl = document.createElement(\"span\");\r\n\t\theaderMenuEl.classList.add(\"tabulator-header-popup-button\");\r\n\r\n\t\tif(icon){\r\n\t\t\tif(typeof icon === \"function\"){\r\n\t\t\t\ticon = icon(column.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tif(icon instanceof HTMLElement){\r\n\t\t\t\theaderMenuEl.appendChild(icon);\r\n\t\t\t}else{\r\n\t\t\t\theaderMenuEl.innerHTML = icon;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\theaderMenuEl.innerHTML = \"⋮\";\r\n\t\t}\r\n\t\t\r\n\t\theaderMenuEl.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tthis.loadMenuEvent(column.definition.headerMenu, e, column);\r\n\t\t});\r\n\t\t\r\n\t\tcolumn.titleElement.insertBefore(headerMenuEl, column.titleElement.firstChild);\r\n\t}\r\n\t\r\n\tloadMenuTableCellEvent(option, e, cell){\r\n\t\tif(cell._cell){\r\n\t\t\tcell = cell._cell;\r\n\t\t}\r\n\t\t\r\n\t\tif(cell.column.definition[option]){\r\n\t\t\tthis.loadMenuEvent(cell.column.definition[option], e, cell);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadMenuTableColumnEvent(option, e, column){\r\n\t\tif(column._column){\r\n\t\t\tcolumn = column._column;\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition[option]){\r\n\t\t\tthis.loadMenuEvent(column.definition[option], e, column);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadMenuEvent(menu, e, component){\r\n\t\tif(component._group){\r\n\t\t\tcomponent = component._group;\r\n\t\t}else if(component._row){\r\n\t\t\tcomponent = component._row;\r\n\t\t}\r\n\t\t\r\n\t\tmenu = typeof menu == \"function\" ? menu.call(this.table, e, component.getComponent()) : menu;\r\n\t\t\r\n\t\tthis.loadMenu(e, component, menu);\r\n\t}\r\n\t\r\n\tloadMenu(e, component, menu, parentEl, parentPopup){\r\n\t\tvar touch = !(e instanceof MouseEvent),\t\t\r\n\t\tmenuEl = document.createElement(\"div\"),\r\n\t\tpopup;\r\n\t\t\r\n\t\tmenuEl.classList.add(\"tabulator-menu\");\r\n\t\t\r\n\t\tif(!touch){\r\n\t\t\te.preventDefault();\r\n\t\t}\r\n\t\t\r\n\t\t//abort if no menu set\r\n\t\tif(!menu || !menu.length){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif(!parentEl){\r\n\t\t\tif(this.nestedMenuBlock){\r\n\t\t\t\t//abort if child menu already open\r\n\t\t\t\tif(this.rootPopup){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.nestedMenuBlock = setTimeout(() => {\r\n\t\t\t\t\tthis.nestedMenuBlock = false;\r\n\t\t\t\t}, 100)\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.rootPopup){\r\n\t\t\t\tthis.rootPopup.hide();\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.rootPopup = popup = this.popup(menuEl);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tpopup = parentPopup.child(menuEl);\r\n\t\t}\r\n\t\t\r\n\t\tmenu.forEach((item) => {\r\n\t\t\tvar itemEl = document.createElement(\"div\"),\r\n\t\t\tlabel = item.label,\r\n\t\t\tdisabled = item.disabled;\r\n\t\t\t\r\n\t\t\tif(item.separator){\r\n\t\t\t\titemEl.classList.add(\"tabulator-menu-separator\");\r\n\t\t\t}else{\r\n\t\t\t\titemEl.classList.add(\"tabulator-menu-item\");\r\n\t\t\t\t\r\n\t\t\t\tif(typeof label == \"function\"){\r\n\t\t\t\t\tlabel = label.call(this.table, component.getComponent());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(label instanceof Node){\r\n\t\t\t\t\titemEl.appendChild(label);\r\n\t\t\t\t}else{\r\n\t\t\t\t\titemEl.innerHTML = label;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(typeof disabled == \"function\"){\r\n\t\t\t\t\tdisabled = disabled.call(this.table, component.getComponent());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(disabled){\r\n\t\t\t\t\titemEl.classList.add(\"tabulator-menu-item-disabled\");\r\n\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(item.menu && item.menu.length){\r\n\t\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\tthis.loadMenu(e, component, item.menu, itemEl, popup);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(item.action){\r\n\t\t\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\t\t\titem.action(e, component.getComponent());\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(item.menu && item.menu.length){\r\n\t\t\t\t\titemEl.classList.add(\"tabulator-menu-item-submenu\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmenuEl.appendChild(itemEl);\r\n\t\t});\r\n\t\t\r\n\t\tmenuEl.addEventListener(\"click\", (e) => {\r\n\t\t\tthis.rootPopup.hide();\r\n\t\t});\r\n\t\t\r\n\t\tpopup.show(parentEl || e);\r\n\t\t\r\n\t\tif(popup === this.rootPopup){\r\n\t\t\tthis.rootPopup.hideOnBlur(() => {\r\n\t\t\t\tthis.rootPopup = null;\r\n\t\t\t\t\r\n\t\t\t\tif(this.currentComponent){\r\n\t\t\t\t\tthis.dispatchExternal(\"menuClosed\", this.currentComponent.getComponent());\r\n\t\t\t\t\tthis.currentComponent = null;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.currentComponent = component;\r\n\r\n\t\t\tthis.dispatchExternal(\"menuOpened\", component.getComponent())\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMenu.moduleName = \"menu\";\r\n\r\nexport default Menu;\r\n","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nclass MoveColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.placeholderElement = this.createPlaceholderElement();\r\n\t\tthis.hoverElement = false; //floating column header element\r\n\t\tthis.checkTimeout = false; //click check timeout holder\r\n\t\tthis.checkPeriod = 250; //period to wait on mousedown to consider this a move and not a click\r\n\t\tthis.moving = false; //currently moving column\r\n\t\tthis.toCol = false; //destination column\r\n\t\tthis.toColAfter = false; //position of moving column relative to the desitnation column\r\n\t\tthis.startX = 0; //starting position within header element\r\n\t\tthis.autoScrollMargin = 40; //auto scroll on edge when within margin\r\n\t\tthis.autoScrollStep = 5; //auto scroll distance in pixels\r\n\t\tthis.autoScrollTimeout = false; //auto scroll timeout\r\n\t\tthis.touchMove = false;\r\n\t\t\r\n\t\tthis.moveHover = this.moveHover.bind(this);\r\n\t\tthis.endMove = this.endMove.bind(this);\r\n\t\t\r\n\t\tthis.registerTableOption(\"movableColumns\", false); //enable movable columns\r\n\t}\r\n\t\r\n\tcreatePlaceholderElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-col\");\r\n\t\tel.classList.add(\"tabulator-col-placeholder\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.movableColumns){\r\n\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar self = this,\r\n\t\tconfig = {},\r\n\t\tcolEl;\r\n\t\t\r\n\t\tif(!column.modules.frozen && !column.isGroup){\r\n\t\t\tcolEl = column.getElement();\r\n\t\t\t\r\n\t\t\tconfig.mousemove = function(e){\r\n\t\t\t\tif(column.parent === self.moving.parent){\r\n\t\t\t\t\tif((((self.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(colEl).left) + self.table.columnManager.element.scrollLeft) > (column.getWidth() / 2)){\r\n\t\t\t\t\t\tif(self.toCol !== column || !self.toColAfter){\r\n\t\t\t\t\t\t\tcolEl.parentNode.insertBefore(self.placeholderElement, colEl.nextSibling);\r\n\t\t\t\t\t\t\tself.moveColumn(column, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(self.toCol !== column || self.toColAfter){\r\n\t\t\t\t\t\t\tcolEl.parentNode.insertBefore(self.placeholderElement, colEl);\r\n\t\t\t\t\t\t\tself.moveColumn(column, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}.bind(self);\r\n\t\t\t\r\n\t\t\tcolEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tself.touchMove = false;\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, column);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tcolEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tself.bindTouchEvents(column);\r\n\t\t}\r\n\t\t\r\n\t\tcolumn.modules.moveColumn = config;\r\n\t}\r\n\t\r\n\tbindTouchEvents(column){\r\n\t\tvar colEl = column.getElement(),\r\n\t\tstartXMove = false, //shifting center position of the cell\r\n\t\tdir = false,\r\n\t\tcurrentCol, nextCol, prevCol, nextColWidth, prevColWidth, nextColWidthLast, prevColWidthLast;\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchstart\", (e) => {\r\n\t\t\tthis.checkTimeout = setTimeout(() => {\r\n\t\t\t\tthis.touchMove = true;\r\n\t\t\t\tcurrentCol = column;\r\n\t\t\t\tnextCol = column.nextColumn();\r\n\t\t\t\tnextColWidth = nextCol ? nextCol.getWidth()/2 : 0;\r\n\t\t\t\tprevCol = column.prevColumn();\r\n\t\t\t\tprevColWidth = prevCol ? prevCol.getWidth()/2 : 0;\r\n\t\t\t\tnextColWidthLast = 0;\r\n\t\t\t\tprevColWidthLast = 0;\r\n\t\t\t\tstartXMove = false;\r\n\t\t\t\t\r\n\t\t\t\tthis.startMove(e, column);\r\n\t\t\t}, this.checkPeriod);\r\n\t\t}, {passive: true});\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchmove\", (e) => {\r\n\t\t\tvar halfCol, diff, moveToCol;\r\n\t\t\t\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.moveHover(e);\r\n\t\t\t\t\r\n\t\t\t\tif(!startXMove){\r\n\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tdiff = e.touches[0].pageX - startXMove;\r\n\t\t\t\t\r\n\t\t\t\tif(diff > 0){\r\n\t\t\t\t\tif(nextCol && diff - nextColWidthLast > nextColWidth){\r\n\t\t\t\t\t\tmoveToCol = nextCol;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(moveToCol !== column){\r\n\t\t\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t\t\t\tmoveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement().nextSibling);\r\n\t\t\t\t\t\t\tthis.moveColumn(moveToCol, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(prevCol && -diff - prevColWidthLast > prevColWidth){\r\n\t\t\t\t\t\tmoveToCol = prevCol;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(moveToCol !== column){\r\n\t\t\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t\t\t\tmoveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement());\r\n\t\t\t\t\t\t\tthis.moveColumn(moveToCol, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(moveToCol){\r\n\t\t\t\t\tcurrentCol = moveToCol;\r\n\t\t\t\t\tnextCol = moveToCol.nextColumn();\r\n\t\t\t\t\tnextColWidthLast = nextColWidth;\r\n\t\t\t\t\tnextColWidth = nextCol ? nextCol.getWidth() / 2 : 0;\r\n\t\t\t\t\tprevCol = moveToCol.prevColumn();\r\n\t\t\t\t\tprevColWidthLast = prevColWidth;\r\n\t\t\t\t\tprevColWidth = prevCol ? prevCol.getWidth() / 2 : 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}, {passive: true});\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchend\", (e) => {\r\n\t\t\tif(this.checkTimeout){\r\n\t\t\t\tclearTimeout(this.checkTimeout);\r\n\t\t\t}\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.endMove(e);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tstartMove(e, column){\r\n\t\tvar element = column.getElement(),\r\n\t\theaderElement = this.table.columnManager.getElement(),\r\n\t\theadersElement = this.table.columnManager.getHeadersElement();\r\n\t\t\r\n\t\tthis.moving = column;\r\n\t\tthis.startX = (this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(element).left;\r\n\t\t\r\n\t\tthis.table.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\t//create placeholder\r\n\t\tthis.placeholderElement.style.width = column.getWidth() + \"px\";\r\n\t\tthis.placeholderElement.style.height = column.getHeight() + \"px\";\r\n\t\t\r\n\t\telement.parentNode.insertBefore(this.placeholderElement, element);\r\n\t\telement.parentNode.removeChild(element);\r\n\t\t\r\n\t\t//create hover element\r\n\t\tthis.hoverElement = element.cloneNode(true);\r\n\t\tthis.hoverElement.classList.add(\"tabulator-moving\");\r\n\t\t\r\n\t\tthis.table.columnManager.getElement().appendChild(this.hoverElement);\r\n\t\t\r\n\t\tthis.hoverElement.style.left = \"0\";\r\n\t\tthis.hoverElement.style.bottom = (headerElement.clientHeight - headersElement.offsetHeight) + \"px\";\r\n\t\t\r\n\t\tif(!this.touchMove){\r\n\t\t\tthis._bindMouseMove();\r\n\t\t\t\r\n\t\t\tdocument.body.addEventListener(\"mousemove\", this.moveHover);\r\n\t\t\tdocument.body.addEventListener(\"mouseup\", this.endMove);\r\n\t\t}\r\n\t\t\r\n\t\tthis.moveHover(e);\r\n\t}\r\n\t\r\n\t_bindMouseMove(){\r\n\t\tthis.table.columnManager.columnsByIndex.forEach(function(column){\r\n\t\t\tif(column.modules.moveColumn.mousemove){\r\n\t\t\t\tcolumn.getElement().addEventListener(\"mousemove\", column.modules.moveColumn.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t_unbindMouseMove(){\r\n\t\tthis.table.columnManager.columnsByIndex.forEach(function(column){\r\n\t\t\tif(column.modules.moveColumn.mousemove){\r\n\t\t\t\tcolumn.getElement().removeEventListener(\"mousemove\", column.modules.moveColumn.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tmoveColumn(column, after){\r\n\t\tvar movingCells = this.moving.getCells();\r\n\t\t\r\n\t\tthis.toCol = column;\r\n\t\tthis.toColAfter = after;\r\n\t\t\r\n\t\tif(after){\r\n\t\t\tcolumn.getCells().forEach(function(cell, i){\r\n\t\t\t\tvar cellEl = cell.getElement(true);\r\n\t\t\t\t\r\n\t\t\t\tif(cellEl.parentNode && movingCells[i]){\r\n\t\t\t\t\tcellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl.nextSibling);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tcolumn.getCells().forEach(function(cell, i){\r\n\t\t\t\tvar cellEl = cell.getElement(true);\r\n\t\t\t\t\r\n\t\t\t\tif(cellEl.parentNode && movingCells[i]){\r\n\t\t\t\t\tcellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tendMove(e){\r\n\t\tif(e.which === 1 || this.touchMove){\r\n\t\t\tthis._unbindMouseMove();\r\n\t\t\t\r\n\t\t\tthis.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling);\r\n\t\t\tthis.placeholderElement.parentNode.removeChild(this.placeholderElement);\r\n\t\t\tthis.hoverElement.parentNode.removeChild(this.hoverElement);\r\n\t\t\t\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-block-select\");\r\n\t\t\t\r\n\t\t\tif(this.toCol){\r\n\t\t\t\tthis.table.columnManager.moveColumnActual(this.moving, this.toCol, this.toColAfter);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.moving = false;\r\n\t\t\tthis.toCol = false;\r\n\t\t\tthis.toColAfter = false;\r\n\t\t\t\r\n\t\t\tif(!this.touchMove){\r\n\t\t\t\tdocument.body.removeEventListener(\"mousemove\", this.moveHover);\r\n\t\t\t\tdocument.body.removeEventListener(\"mouseup\", this.endMove);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveHover(e){\r\n\t\tvar columnHolder = this.table.columnManager.getElement(),\r\n\t\tscrollLeft = columnHolder.scrollLeft,\r\n\t\txPos = ((this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(columnHolder).left) + scrollLeft,\r\n\t\tscrollPos;\r\n\t\t\r\n\t\tthis.hoverElement.style.left = (xPos - this.startX) + \"px\";\r\n\t\t\r\n\t\tif(xPos - scrollLeft < this.autoScrollMargin){\r\n\t\t\tif(!this.autoScrollTimeout){\r\n\t\t\t\tthis.autoScrollTimeout = setTimeout(() => {\r\n\t\t\t\t\tscrollPos = Math.max(0,scrollLeft-5);\r\n\t\t\t\t\tthis.table.rowManager.getElement().scrollLeft = scrollPos;\r\n\t\t\t\t\tthis.autoScrollTimeout = false;\r\n\t\t\t\t}, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(scrollLeft + columnHolder.clientWidth - xPos < this.autoScrollMargin){\r\n\t\t\tif(!this.autoScrollTimeout){\r\n\t\t\t\tthis.autoScrollTimeout = setTimeout(() => {\r\n\t\t\t\t\tscrollPos = Math.min(columnHolder.clientWidth, scrollLeft+5);\r\n\t\t\t\t\tthis.table.rowManager.getElement().scrollLeft = scrollPos;\r\n\t\t\t\t\tthis.autoScrollTimeout = false;\r\n\t\t\t\t}, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMoveColumns.moduleName = \"moveColumn\";\r\n\r\nexport default MoveColumns;\r\n","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nclass MoveRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.placeholderElement = this.createPlaceholderElement();\r\n\t\tthis.hoverElement = false; //floating row header element\r\n\t\tthis.checkTimeout = false; //click check timeout holder\r\n\t\tthis.checkPeriod = 150; //period to wait on mousedown to consider this a move and not a click\r\n\t\tthis.moving = false; //currently moving row\r\n\t\tthis.toRow = false; //destination row\r\n\t\tthis.toRowAfter = false; //position of moving row relative to the desitnation row\r\n\t\tthis.hasHandle = false; //row has handle instead of fully movable row\r\n\t\tthis.startY = 0; //starting Y position within header element\r\n\t\tthis.startX = 0; //starting X position within header element\r\n\r\n\t\tthis.moveHover = this.moveHover.bind(this);\r\n\t\tthis.endMove = this.endMove.bind(this);\r\n\t\tthis.tableRowDropEvent = false;\r\n\r\n\t\tthis.touchMove = false;\r\n\r\n\t\tthis.connection = false;\r\n\t\tthis.connectionSelectorsTables = false;\r\n\t\tthis.connectionSelectorsElements = false;\r\n\t\tthis.connectionElements = [];\r\n\t\tthis.connections = [];\r\n\r\n\t\tthis.connectedTable = false;\r\n\t\tthis.connectedRow = false;\r\n\r\n\t\tthis.registerTableOption(\"movableRows\", false); //enable movable rows\r\n\t\tthis.registerTableOption(\"movableRowsConnectedTables\", false); //tables for movable rows to be connected to\r\n\t\tthis.registerTableOption(\"movableRowsConnectedElements\", false); //other elements for movable rows to be connected to\r\n\t\tthis.registerTableOption(\"movableRowsSender\", false);\r\n\t\tthis.registerTableOption(\"movableRowsReceiver\", \"insert\");\r\n\r\n\t\tthis.registerColumnOption(\"rowHandle\");\r\n\t}\r\n\r\n\tcreatePlaceholderElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-row\");\r\n\t\tel.classList.add(\"tabulator-row-placeholder\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.movableRows){\r\n\t\t\tthis.connectionSelectorsTables = this.table.options.movableRowsConnectedTables;\r\n\t\t\tthis.connectionSelectorsElements = this.table.options.movableRowsConnectedElements;\r\n\r\n\t\t\tthis.connection = this.connectionSelectorsTables || this.connectionSelectorsElements;\r\n\r\n\t\t\tthis.subscribe(\"cell-init\", this.initializeCell.bind(this));\r\n\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeGroupHeader(group){\r\n\t\tvar self = this,\r\n\t\tconfig = {},\r\n\t\trowEl;\r\n\r\n\t\t//inter table drag drop\r\n\t\tconfig.mouseup = function(e){\r\n\t\t\tself.tableRowDrop(e, row);\r\n\t\t}.bind(self);\r\n\r\n\t\t//same table drag drop\r\n\t\tconfig.mousemove = function(e){\r\n\t\t\tif(((e.pageY - Helpers.elOffset(group.element).top) + self.table.rowManager.element.scrollTop) > (group.getHeight() / 2)){\r\n\t\t\t\tif(self.toRow !== group || !self.toRowAfter){\r\n\t\t\t\t\tvar rowEl = group.getElement();\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);\r\n\t\t\t\t\tself.moveRow(group, true);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(self.toRow !== group || self.toRowAfter){\r\n\t\t\t\t\tvar rowEl = group.getElement();\r\n\t\t\t\t\tif(rowEl.previousSibling){\r\n\t\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl);\r\n\t\t\t\t\t\tself.moveRow(group, false);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.bind(self);\r\n\r\n\t\tgroup.modules.moveRow = config;\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\tconfig = {},\r\n\t\trowEl;\r\n\r\n\t\t//inter table drag drop\r\n\t\tconfig.mouseup = function(e){\r\n\t\t\tself.tableRowDrop(e, row);\r\n\t\t}.bind(self);\r\n\r\n\t\t//same table drag drop\r\n\t\tconfig.mousemove = function(e){\r\n\t\t\tvar rowEl = row.getElement();\r\n\r\n\t\t\tif(((e.pageY - Helpers.elOffset(rowEl).top) + self.table.rowManager.element.scrollTop) > (row.getHeight() / 2)){\r\n\t\t\t\tif(self.toRow !== row || !self.toRowAfter){\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);\r\n\t\t\t\t\tself.moveRow(row, true);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(self.toRow !== row || self.toRowAfter){\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl);\r\n\t\t\t\t\tself.moveRow(row, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.bind(self);\r\n\r\n\r\n\t\tif(!this.hasHandle){\r\n\r\n\t\t\trowEl = row.getElement();\r\n\r\n\t\t\trowEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, row);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trowEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.bindTouchEvents(row, row.getElement());\r\n\t\t}\r\n\r\n\t\trow.modules.moveRow = config;\r\n\t}\r\n\r\n\tinitializeColumn(column){\r\n\t\tif(column.definition.rowHandle && this.table.options.movableRows !== false){\r\n\t\t\tthis.hasHandle = true;\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeCell(cell){\r\n\t\tif(cell.column.definition.rowHandle && this.table.options.movableRows !== false){\r\n\t\t\tvar self = this,\r\n\t\t\tcellEl = cell.getElement(true);\r\n\r\n\t\t\tcellEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, cell.row);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tcellEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.bindTouchEvents(cell.row, cellEl);\r\n\t\t}\r\n\t}\r\n\r\n\tbindTouchEvents(row, element){\r\n\t\tvar startYMove = false, //shifting center position of the cell\r\n\t\tdir = false,\r\n\t\tcurrentRow, nextRow, prevRow, nextRowHeight, prevRowHeight, nextRowHeightLast, prevRowHeightLast;\r\n\r\n\t\telement.addEventListener(\"touchstart\", (e) => {\r\n\t\t\tthis.checkTimeout = setTimeout(() => {\r\n\t\t\t\tthis.touchMove = true;\r\n\t\t\t\tcurrentRow = row;\r\n\t\t\t\tnextRow = row.nextRow();\r\n\t\t\t\tnextRowHeight = nextRow ? nextRow.getHeight()/2 : 0;\r\n\t\t\t\tprevRow = row.prevRow();\r\n\t\t\t\tprevRowHeight = prevRow ? prevRow.getHeight()/2 : 0;\r\n\t\t\t\tnextRowHeightLast = 0;\r\n\t\t\t\tprevRowHeightLast = 0;\r\n\t\t\t\tstartYMove = false;\r\n\r\n\t\t\t\tthis.startMove(e, row);\r\n\t\t\t}, this.checkPeriod);\r\n\t\t}, {passive: true});\r\n\t\tthis.moving, this.toRow, this.toRowAfter\r\n\t\telement.addEventListener(\"touchmove\", (e) => {\r\n\r\n\t\t\tvar halfCol, diff, moveToRow;\r\n\r\n\t\t\tif(this.moving){\r\n\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\tthis.moveHover(e);\r\n\r\n\t\t\t\tif(!startYMove){\r\n\t\t\t\t\tstartYMove = e.touches[0].pageY;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdiff = e.touches[0].pageY - startYMove;\r\n\r\n\t\t\t\tif(diff > 0){\r\n\t\t\t\t\tif(nextRow && diff - nextRowHeightLast > nextRowHeight){\r\n\t\t\t\t\t\tmoveToRow = nextRow;\r\n\r\n\t\t\t\t\t\tif(moveToRow !== row){\r\n\t\t\t\t\t\t\tstartYMove = e.touches[0].pageY\r\n\t\t\t\t\t\t\tmoveToRow.getElement().parentNode.insertBefore(this.placeholderElement, moveToRow.getElement().nextSibling);\r\n\t\t\t\t\t\t\tthis.moveRow(moveToRow, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(prevRow && -diff - prevRowHeightLast > prevRowHeight){\r\n\t\t\t\t\t\tmoveToRow = prevRow;\r\n\r\n\t\t\t\t\t\tif(moveToRow !== row){\r\n\t\t\t\t\t\t\tstartYMove = e.touches[0].pageY;\r\n\t\t\t\t\t\t\tmoveToRow.getElement().parentNode.insertBefore(this.placeholderElement, moveToRow.getElement());\r\n\t\t\t\t\t\t\tthis.moveRow(moveToRow, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(moveToRow){\r\n\t\t\t\t\tcurrentRow = moveToRow;\r\n\t\t\t\t\tnextRow = moveToRow.nextRow();\r\n\t\t\t\t\tnextRowHeightLast = nextRowHeight;\r\n\t\t\t\t\tnextRowHeight = nextRow ? nextRow.getHeight() / 2 : 0;\r\n\t\t\t\t\tprevRow = moveToRow.prevRow();\r\n\t\t\t\t\tprevRowHeightLast = prevRowHeight;\r\n\t\t\t\t\tprevRowHeight = prevRow ? prevRow.getHeight() / 2 : 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\telement.addEventListener(\"touchend\", (e) => {\r\n\t\t\tif(this.checkTimeout){\r\n\t\t\t\tclearTimeout(this.checkTimeout);\r\n\t\t\t}\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.endMove(e);\r\n\t\t\t\tthis.touchMove = false;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t_bindMouseMove(){\r\n\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\tif((row.type === \"row\" || row.type === \"group\") && row.modules.moveRow && row.modules.moveRow.mousemove){\r\n\t\t\t\trow.getElement().addEventListener(\"mousemove\", row.modules.moveRow.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t_unbindMouseMove(){\r\n\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\tif((row.type === \"row\" || row.type === \"group\") && row.modules.moveRow && row.modules.moveRow.mousemove){\r\n\t\t\t\trow.getElement().removeEventListener(\"mousemove\", row.modules.moveRow.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tstartMove(e, row){\r\n\t\tvar element = row.getElement();\r\n\r\n\t\tthis.setStartPosition(e, row);\r\n\r\n\t\tthis.moving = row;\r\n\r\n\t\tthis.table.element.classList.add(\"tabulator-block-select\");\r\n\r\n\t\t//create placeholder\r\n\t\tthis.placeholderElement.style.width = row.getWidth() + \"px\";\r\n\t\tthis.placeholderElement.style.height = row.getHeight() + \"px\";\r\n\r\n\t\tif(!this.connection){\r\n\t\t\telement.parentNode.insertBefore(this.placeholderElement, element);\r\n\t\t\telement.parentNode.removeChild(element);\r\n\t\t}else{\r\n\t\t\tthis.table.element.classList.add(\"tabulator-movingrow-sending\");\r\n\t\t\tthis.connectToTables(row);\r\n\t\t}\r\n\r\n\t\t//create hover element\r\n\t\tthis.hoverElement = element.cloneNode(true);\r\n\t\tthis.hoverElement.classList.add(\"tabulator-moving\");\r\n\r\n\t\tif(this.connection){\r\n\t\t\tdocument.body.appendChild(this.hoverElement);\r\n\t\t\tthis.hoverElement.style.left = \"0\";\r\n\t\t\tthis.hoverElement.style.top = \"0\";\r\n\t\t\tthis.hoverElement.style.width = this.table.element.clientWidth + \"px\";\r\n\t\t\tthis.hoverElement.style.whiteSpace = \"nowrap\";\r\n\t\t\tthis.hoverElement.style.overflow = \"hidden\";\r\n\t\t\tthis.hoverElement.style.pointerEvents = \"none\";\r\n\t\t}else{\r\n\t\t\tthis.table.rowManager.getTableElement().appendChild(this.hoverElement);\r\n\r\n\t\t\tthis.hoverElement.style.left = \"0\";\r\n\t\t\tthis.hoverElement.style.top = \"0\";\r\n\r\n\t\t\tthis._bindMouseMove();\r\n\t\t}\r\n\r\n\t\tdocument.body.addEventListener(\"mousemove\", this.moveHover);\r\n\t\tdocument.body.addEventListener(\"mouseup\", this.endMove);\r\n\r\n\t\tthis.dispatchExternal(\"rowMoving\", row.getComponent());\r\n\r\n\t\tthis.moveHover(e);\r\n\t}\r\n\r\n\tsetStartPosition(e, row){\r\n\t\tvar pageX = this.touchMove ? e.touches[0].pageX : e.pageX,\r\n\t\tpageY = this.touchMove ? e.touches[0].pageY : e.pageY,\r\n\t\telement, position;\r\n\r\n\t\telement = row.getElement();\r\n\t\tif(this.connection){\r\n\t\t\tposition = element.getBoundingClientRect();\r\n\r\n\t\t\tthis.startX = position.left - pageX + window.pageXOffset;\r\n\t\t\tthis.startY = position.top - pageY + window.pageYOffset;\r\n\t\t}else{\r\n\t\t\tthis.startY = (pageY - element.getBoundingClientRect().top);\r\n\t\t}\r\n\t}\r\n\r\n\tendMove(e){\r\n\t\tif(!e || e.which === 1 || this.touchMove){\r\n\t\t\tthis._unbindMouseMove();\r\n\r\n\t\t\tif(!this.connection){\r\n\t\t\t\tthis.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling);\r\n\t\t\t\tthis.placeholderElement.parentNode.removeChild(this.placeholderElement);\r\n\t\t\t}\r\n\r\n\t\t\tthis.hoverElement.parentNode.removeChild(this.hoverElement);\r\n\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-block-select\");\r\n\r\n\t\t\tif(this.toRow){\r\n\t\t\t\tthis.table.rowManager.moveRow(this.moving, this.toRow, this.toRowAfter);\r\n\t\t\t}else{\r\n\t\t\t\tthis.dispatchExternal(\"rowMoveCancelled\", this.moving.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tthis.moving = false;\r\n\t\t\tthis.toRow = false;\r\n\t\t\tthis.toRowAfter = false;\r\n\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", this.moveHover);\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", this.endMove);\r\n\r\n\t\t\tif(this.connection){\r\n\t\t\t\tthis.table.element.classList.remove(\"tabulator-movingrow-sending\");\r\n\t\t\t\tthis.disconnectFromTables();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmoveRow(row, after){\r\n\t\tthis.toRow = row;\r\n\t\tthis.toRowAfter = after;\r\n\t}\r\n\r\n\tmoveHover(e){\r\n\t\tif(this.connection){\r\n\t\t\tthis.moveHoverConnections.call(this, e);\r\n\t\t}else{\r\n\t\t\tthis.moveHoverTable.call(this, e);\r\n\t\t}\r\n\t}\r\n\r\n\tmoveHoverTable(e){\r\n\t\tvar rowHolder = this.table.rowManager.getElement(),\r\n\t\tscrollTop = rowHolder.scrollTop,\r\n\t\tyPos = ((this.touchMove ? e.touches[0].pageY : e.pageY) - rowHolder.getBoundingClientRect().top) + scrollTop,\r\n\t\tscrollPos;\r\n\r\n\t\tthis.hoverElement.style.top = (yPos - this.startY) + \"px\";\r\n\t}\r\n\r\n\tmoveHoverConnections(e){\r\n\t\tthis.hoverElement.style.left = (this.startX + (this.touchMove ? e.touches[0].pageX : e.pageX)) + \"px\";\r\n\t\tthis.hoverElement.style.top = (this.startY + (this.touchMove ? e.touches[0].pageY : e.pageY)) + \"px\";\r\n\t}\r\n\r\n\telementRowDrop(e, element, row){\r\n\t\tthis.dispatchExternal(\"movableRowsElementDrop\", e, element, row ? row.getComponent() : false);\r\n\t}\r\n\r\n\t//establish connection with other tables\r\n\tconnectToTables(row){\r\n\t\tvar connectionTables;\r\n\r\n\t\tif(this.connectionSelectorsTables){\r\n\t\t\tconnectionTables = this.commsConnections(this.connectionSelectorsTables);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSendingStart\", connectionTables);\r\n\r\n\t\t\tthis.commsSend(this.connectionSelectorsTables, \"moveRow\", \"connect\", {\r\n\t\t\t\trow:row,\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.connectionSelectorsElements){\r\n\r\n\t\t\tthis.connectionElements = [];\r\n\r\n\t\t\tif(!Array.isArray(this.connectionSelectorsElements)){\r\n\t\t\t\tthis.connectionSelectorsElements = [this.connectionSelectorsElements];\r\n\t\t\t}\r\n\r\n\t\t\tthis.connectionSelectorsElements.forEach((query) => {\r\n\t\t\t\tif(typeof query === \"string\"){\r\n\t\t\t\t\tthis.connectionElements = this.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(query)));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.connectionElements.push(query);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.connectionElements.forEach((element) => {\r\n\t\t\t\tvar dropEvent = (e) => {\r\n\t\t\t\t\tthis.elementRowDrop(e, element, this.moving);\r\n\t\t\t\t};\r\n\r\n\t\t\t\telement.addEventListener(\"mouseup\", dropEvent);\r\n\t\t\t\telement.tabulatorElementDropEvent = dropEvent;\r\n\r\n\t\t\t\telement.classList.add(\"tabulator-movingrow-receiving\");\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t//disconnect from other tables\r\n\tdisconnectFromTables(){\r\n\t\tvar connectionTables;\r\n\r\n\t\tif(this.connectionSelectorsTables){\r\n\t\t\tconnectionTables = this.commsConnections(this.connectionSelectorsTables);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSendingStop\", connectionTables);\r\n\r\n\t\t\tthis.commsSend(this.connectionSelectorsTables, \"moveRow\", \"disconnect\");\r\n\t\t}\r\n\r\n\t\tthis.connectionElements.forEach((element) => {\r\n\t\t\telement.classList.remove(\"tabulator-movingrow-receiving\");\r\n\t\t\telement.removeEventListener(\"mouseup\", element.tabulatorElementDropEvent);\r\n\t\t\tdelete element.tabulatorElementDropEvent;\r\n\t\t});\r\n\t}\r\n\r\n\t//accept incomming connection\r\n\tconnect(table, row){\r\n\t\tif(!this.connectedTable){\r\n\t\t\tthis.connectedTable = table;\r\n\t\t\tthis.connectedRow = row;\r\n\r\n\t\t\tthis.table.element.classList.add(\"tabulator-movingrow-receiving\");\r\n\r\n\t\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\t\tif(row.type === \"row\" && row.modules.moveRow && row.modules.moveRow.mouseup){\r\n\t\t\t\t\trow.getElement().addEventListener(\"mouseup\", row.modules.moveRow.mouseup);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.tableRowDropEvent = this.tableRowDrop.bind(this);\r\n\r\n\t\t\tthis.table.element.addEventListener(\"mouseup\", this.tableRowDropEvent);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivingStart\", row, table);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Row Error - Table cannot accept connection, already connected to table:\", this.connectedTable);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//close incomming connection\r\n\tdisconnect(table){\r\n\t\tif(table === this.connectedTable){\r\n\t\t\tthis.connectedTable = false;\r\n\t\t\tthis.connectedRow = false;\r\n\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-movingrow-receiving\");\r\n\r\n\t\t\tthis.table.rowManager.getDisplayRows().forEach((row) =>{\r\n\t\t\t\tif(row.type === \"row\" && row.modules.moveRow && row.modules.moveRow.mouseup){\r\n\t\t\t\t\trow.getElement().removeEventListener(\"mouseup\", row.modules.moveRow.mouseup);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.table.element.removeEventListener(\"mouseup\", this.tableRowDropEvent);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivingStop\", table);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Row Error - trying to disconnect from non connected table\")\r\n\t\t}\r\n\t}\r\n\r\n\tdropComplete(table, row, success){\r\n\t\tvar sender = false;\r\n\r\n\t\tif(success){\r\n\r\n\t\t\tswitch(typeof this.table.options.movableRowsSender){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tsender = this.senders[this.table.options.movableRowsSender];\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tsender = this.table.options.movableRowsSender;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(sender){\r\n\t\t\t\tsender.call(this, this.moving.getComponent(), row ? row.getComponent() : undefined, table)\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.options.movableRowsSender){\r\n\t\t\t\t\tconsole.warn(\"Mover Row Error - no matching sender found:\", this.table.options.movableRowsSender);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSent\", this.moving.getComponent(), row ? row.getComponent() : undefined, table);\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"movableRowsSentFailed\", this.moving.getComponent(), row ? row.getComponent() : undefined, table);\r\n\t\t}\r\n\r\n\t\tthis.endMove();\r\n\t}\r\n\r\n\ttableRowDrop(e, row){\r\n\t\tvar receiver = false,\r\n\t\tsuccess = false;\r\n\r\n\t\te.stopImmediatePropagation();\r\n\r\n\t\tswitch(typeof this.table.options.movableRowsReceiver){\r\n\t\t\tcase \"string\":\r\n\t\t\treceiver = this.receivers[this.table.options.movableRowsReceiver];\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\treceiver = this.table.options.movableRowsReceiver;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(receiver){\r\n\t\t\tsuccess = receiver.call(this, this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable)\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Mover Row Error - no matching receiver found:\", this.table.options.movableRowsReceiver)\r\n\t\t}\r\n\r\n\t\tif(success){\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceived\", this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivedFailed\", this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);\r\n\t\t}\r\n\r\n\t\tthis.commsSend(this.connectedTable, \"moveRow\", \"dropcomplete\", {\r\n\t\t\trow:row,\r\n\t\t\tsuccess:success,\r\n\t\t});\r\n\t}\r\n\r\n\tcommsReceived(table, action, data){\r\n\t\tswitch(action){\r\n\t\t\tcase \"connect\":\r\n\t\t\treturn this.connect(table, data.row);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"disconnect\":\r\n\t\t\treturn this.disconnect(table);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"dropcomplete\":\r\n\t\t\treturn this.dropComplete(table, data.row, data.success);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMoveRows.prototype.receivers = {\r\n\tinsert:function(fromRow, toRow, fromTable){\r\n\t\tthis.table.addRow(fromRow.getData(), undefined, toRow);\r\n\t\treturn true;\r\n\t},\r\n\r\n\tadd:function(fromRow, toRow, fromTable){\r\n\t\tthis.table.addRow(fromRow.getData());\r\n\t\treturn true;\r\n\t},\r\n\r\n\tupdate:function(fromRow, toRow, fromTable){\r\n\t\tif(toRow){\r\n\t\t\ttoRow.update(fromRow.getData());\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n\r\n\treplace:function(fromRow, toRow, fromTable){\r\n\t\tif(toRow){\r\n\t\t\tthis.table.addRow(fromRow.getData(), undefined, toRow);\r\n\t\t\ttoRow.delete();\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n};\r\n\r\nMoveRows.prototype.senders = {\r\n\tdelete:function(fromRow, toRow, toTable){\r\n\t\tfromRow.delete();\r\n\t}\r\n};\r\n\r\nMoveRows.moduleName = \"moveRow\";\r\n\r\nexport default MoveRows;","export default {};","import Module from '../../core/Module.js';\r\n\r\nimport defaultMutators from './defaults/mutators.js';\r\n\r\nclass Mutator extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.allowedTypes = [\"\", \"data\", \"edit\", \"clipboard\"]; //list of muatation types\r\n\t\tthis.enabled = true;\r\n\r\n\t\tthis.registerColumnOption(\"mutator\");\r\n\t\tthis.registerColumnOption(\"mutatorParams\");\r\n\t\tthis.registerColumnOption(\"mutatorData\");\r\n\t\tthis.registerColumnOption(\"mutatorDataParams\");\r\n\t\tthis.registerColumnOption(\"mutatorEdit\");\r\n\t\tthis.registerColumnOption(\"mutatorEditParams\");\r\n\t\tthis.registerColumnOption(\"mutatorClipboard\");\r\n\t\tthis.registerColumnOption(\"mutatorClipboardParams\");\r\n\t\tthis.registerColumnOption(\"mutateLink\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-value-changing\", this.transformCell.bind(this));\r\n\t\tthis.subscribe(\"cell-value-changed\", this.mutateLink.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"row-data-init-before\", this.rowDataChanged.bind(this));\r\n\t\tthis.subscribe(\"row-data-changing\", this.rowDataChanged.bind(this));\r\n\t}\r\n\r\n\trowDataChanged(row, tempData, updatedData){\r\n\t\treturn this.transformRow(tempData, \"data\", updatedData);\r\n\t}\r\n\r\n\t//initialize column mutator\r\n\tinitializeColumn(column){\r\n\t\tvar match = false,\r\n\t\tconfig = {};\r\n\r\n\t\tthis.allowedTypes.forEach((type) => {\r\n\t\t\tvar key = \"mutator\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\t\tmutator;\r\n\r\n\t\t\tif(column.definition[key]){\r\n\t\t\t\tmutator = this.lookupMutator(column.definition[key]);\r\n\r\n\t\t\t\tif(mutator){\r\n\t\t\t\t\tmatch = true;\r\n\r\n\t\t\t\t\tconfig[key] = {\r\n\t\t\t\t\t\tmutator:mutator,\r\n\t\t\t\t\t\tparams: column.definition[key + \"Params\"] || {},\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(match){\r\n\t\t\tcolumn.modules.mutate = config;\r\n\t\t}\r\n\t}\r\n\r\n\tlookupMutator(value){\r\n\t\tvar mutator = false;\r\n\r\n\t\t//set column mutator\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(Mutator.mutators[value]){\r\n\t\t\t\tmutator = Mutator.mutators[value];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Mutator Error - No such mutator found, ignoring: \", value);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tmutator = value;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn mutator;\r\n\t}\r\n\r\n\t//apply mutator to row\r\n\ttransformRow(data, type, updatedData){\r\n\t\tvar key = \"mutator\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\tvalue;\r\n\r\n\t\tif(this.enabled){\r\n\r\n\t\t\tthis.table.columnManager.traverse((column) => {\r\n\t\t\t\tvar mutator, params, component;\r\n\r\n\t\t\t\tif(column.modules.mutate){\r\n\t\t\t\t\tmutator = column.modules.mutate[key] || column.modules.mutate.mutator || false;\r\n\r\n\t\t\t\t\tif(mutator){\r\n\t\t\t\t\t\tvalue = column.getFieldValue(typeof updatedData !== \"undefined\" ? updatedData : data);\r\n\r\n\t\t\t\t\t\tif(type == \"data\" || typeof value !== \"undefined\"){\r\n\t\t\t\t\t\t\tcomponent = column.getComponent();\r\n\t\t\t\t\t\t\tparams = typeof mutator.params === \"function\" ? mutator.params(value, data, type, component) : mutator.params;\r\n\t\t\t\t\t\t\tcolumn.setFieldValue(data, mutator.mutator(value, data, type, params, component));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//apply mutator to new cell value\r\n\ttransformCell(cell, value){\r\n\t\tif(cell.column.modules.mutate){\r\n\t\t\tvar mutator = cell.column.modules.mutate.mutatorEdit || cell.column.modules.mutate.mutator || false,\r\n\t\t\ttempData = {};\r\n\r\n\t\t\tif(mutator){\r\n\t\t\t\ttempData = Object.assign(tempData, cell.row.getData());\r\n\t\t\t\tcell.column.setFieldValue(tempData, value);\r\n\t\t\t\treturn mutator.mutator(value, tempData, \"edit\", mutator.params, cell.getComponent());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\tmutateLink(cell){\r\n\t\tvar links = cell.column.definition.mutateLink;\r\n\r\n\t\tif(links){\r\n\t\t\tif(!Array.isArray(links)){\r\n\t\t\t\tlinks = [links];\r\n\t\t\t}\r\n\r\n\t\t\tlinks.forEach((link) => {\r\n\t\t\t\tvar linkCell = cell.row.getCell(link);\r\n\r\n\t\t\t\tif(linkCell){\r\n\t\t\t\t\tlinkCell.setValue(linkCell.getValue(), true, true);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tenable(){\r\n\t\tthis.enabled = true;\r\n\t}\r\n\r\n\tdisable(){\r\n\t\tthis.enabled = false;\r\n\t}\r\n}\r\n\r\nMutator.moduleName = \"mutator\";\r\n\r\n//load defaults\r\nMutator.mutators = defaultMutators;\r\n\r\nexport default Mutator;","export default function(pageSize, currentRow, currentPage, totalRows, totalPages){\r\n\tvar el = document.createElement(\"span\"),\r\n\tshowingEl = document.createElement(\"span\"),\r\n\tvalueEl = document.createElement(\"span\"),\r\n\tofEl = document.createElement(\"span\"),\r\n\ttotalEl = document.createElement(\"span\"),\r\n\trowsEl = document.createElement(\"span\");\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|showing\", (value) => {\r\n\t\tshowingEl.innerHTML = value;\r\n\t});\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|of\", (value) => {\r\n\t\tofEl.innerHTML = value;\r\n\t});\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|rows\", (value) => {\r\n\t\trowsEl.innerHTML = value;\r\n\t});\r\n\r\n\tif(totalRows){\r\n\t\tvalueEl.innerHTML = \" \" + currentRow + \"-\" + Math.min((currentRow + pageSize - 1), totalRows) + \" \";\r\n\t\t\r\n\t\ttotalEl.innerHTML = \" \" + totalRows + \" \";\r\n\t\t\r\n\t\tel.appendChild(showingEl);\r\n\t\tel.appendChild(valueEl);\r\n\t\tel.appendChild(ofEl);\r\n\t\tel.appendChild(totalEl);\r\n\t\tel.appendChild(rowsEl);\r\n\t}else{\r\n\t\tvalueEl.innerHTML = \" 0 \";\r\n\r\n\t\tel.appendChild(showingEl);\r\n\t\tel.appendChild(valueEl);\r\n\t\tel.appendChild(rowsEl);\r\n\t}\r\n\t\r\n\treturn el;\r\n};","export default function(pageSize, currentRow, currentPage, totalRows, totalPages){\r\n\r\n var el = document.createElement(\"span\"),\r\n\tshowingEl = document.createElement(\"span\"),\r\n\tvalueEl = document.createElement(\"span\"),\r\n\tofEl = document.createElement(\"span\"),\r\n\ttotalEl = document.createElement(\"span\"),\r\n\trowsEl = document.createElement(\"span\");\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|showing\", (value) => {\r\n\t\tshowingEl.innerHTML = value;\r\n\t});\r\n\t\r\n\tvalueEl.innerHTML = \" \" + currentPage + \" \";\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|of\", (value) => {\r\n\t\tofEl.innerHTML = value;\r\n\t});\r\n\t\r\n\ttotalEl.innerHTML = \" \" + totalPages + \" \";\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|pages\", (value) => {\r\n\t\trowsEl.innerHTML = value;\r\n\t});\r\n\t\r\n\tel.appendChild(showingEl);\r\n\tel.appendChild(valueEl);\r\n\tel.appendChild(ofEl);\r\n\tel.appendChild(totalEl);\r\n\tel.appendChild(rowsEl);\r\n\t\r\n\treturn el;\r\n};","import rows from './pageCounters/rows.js';\r\nimport pages from './pageCounters/pages.js';\r\n\r\n\r\nexport default {\r\n\trows:rows,\r\n\tpages:pages,\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultPageCounters from './defaults/pageCounters.js';\r\n\r\nclass Page extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.mode = \"local\";\r\n\t\tthis.progressiveLoad = false;\r\n\t\t\r\n\t\tthis.element = null;\r\n\t\tthis.pageCounterElement = null;\r\n\t\tthis.pageCounter = null;\r\n\t\t\r\n\t\tthis.size = 0;\r\n\t\tthis.page = 1;\r\n\t\tthis.count = 5;\r\n\t\tthis.max = 1;\r\n\r\n\t\tthis.remoteRowCountEstimate = null;\r\n\t\t\r\n\t\tthis.displayIndex = 0; //index in display pipeline\r\n\t\t\r\n\t\tthis.initialLoad = true;\r\n\t\tthis.dataChanging = false; //flag to check if data is being changed by this module\r\n\t\t\r\n\t\tthis.pageSizes = [];\r\n\t\t\r\n\t\tthis.registerTableOption(\"pagination\", false); //set pagination type\r\n\t\tthis.registerTableOption(\"paginationMode\", \"local\"); //local or remote pagination\r\n\t\tthis.registerTableOption(\"paginationSize\", false); //set number of rows to a page\r\n\t\tthis.registerTableOption(\"paginationInitialPage\", 1); //initial page to show on load\r\n\t\tthis.registerTableOption(\"paginationCounter\", false); // set pagination counter\r\n\t\tthis.registerTableOption(\"paginationCounterElement\", false); // set pagination counter\r\n\t\tthis.registerTableOption(\"paginationButtonCount\", 5); // set count of page button\r\n\t\tthis.registerTableOption(\"paginationSizeSelector\", false); //add pagination size selector element\r\n\t\tthis.registerTableOption(\"paginationElement\", false); //element to hold pagination numbers\r\n\t\t// this.registerTableOption(\"paginationDataSent\", {}); //pagination data sent to the server\r\n\t\t// this.registerTableOption(\"paginationDataReceived\", {}); //pagination data received from the server\r\n\t\tthis.registerTableOption(\"paginationAddRow\", \"page\"); //add rows on table or page\r\n\t\t\r\n\t\tthis.registerTableOption(\"progressiveLoad\", false); //progressive loading\r\n\t\tthis.registerTableOption(\"progressiveLoadDelay\", 0); //delay between requests\r\n\t\tthis.registerTableOption(\"progressiveLoadScrollMargin\", 0); //margin before scroll begins\r\n\t\t\r\n\t\tthis.registerTableFunction(\"setMaxPage\", this.setMaxPage.bind(this));\r\n\t\tthis.registerTableFunction(\"setPage\", this.setPage.bind(this));\r\n\t\tthis.registerTableFunction(\"setPageToRow\", this.userSetPageToRow.bind(this));\r\n\t\tthis.registerTableFunction(\"setPageSize\", this.userSetPageSize.bind(this));\r\n\t\tthis.registerTableFunction(\"getPageSize\", this.getPageSize.bind(this));\r\n\t\tthis.registerTableFunction(\"previousPage\", this.previousPage.bind(this));\r\n\t\tthis.registerTableFunction(\"nextPage\", this.nextPage.bind(this));\r\n\t\tthis.registerTableFunction(\"getPage\", this.getPage.bind(this));\r\n\t\tthis.registerTableFunction(\"getPageMax\", this.getPageMax.bind(this));\r\n\t\t\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"pageTo\", this.setPageToRow.bind(this));\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"row-added\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"data-processed\", this.initialLoadComplete.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.calculatePageSizes.bind(this));\r\n\t\t\tthis.subscribe(\"footer-redraw\", this.footerRedraw.bind(this));\r\n\r\n\t\t\tif(this.table.options.paginationAddRow == \"page\"){\r\n\t\t\t\tthis.subscribe(\"row-adding-position\", this.rowAddingPosition.bind(this));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.options.paginationMode === \"remote\"){\r\n\t\t\t\tthis.subscribe(\"data-params\", this.remotePageParams.bind(this));\r\n\t\t\t\tthis.subscribe(\"data-loaded\", this._parseRemoteData.bind(this));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.options.progressiveLoad){\r\n\t\t\t\tconsole.error(\"Progressive Load Error - Pagination and progressive load cannot be used at the same time\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.registerDisplayHandler(this.restOnRenderBefore.bind(this), 40);\r\n\t\t\tthis.registerDisplayHandler(this.getRows.bind(this), 50);\r\n\t\t\t\r\n\t\t\tthis.createElements();\r\n\t\t\tthis.initializePageCounter();\r\n\t\t\tthis.initializePaginator();\r\n\t\t}else if(this.table.options.progressiveLoad){\r\n\t\t\tthis.subscribe(\"data-params\", this.remotePageParams.bind(this));\r\n\t\t\tthis.subscribe(\"data-loaded\", this._parseRemoteData.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.calculatePageSizes.bind(this));\r\n\t\t\tthis.subscribe(\"data-processed\", this.initialLoadComplete.bind(this));\r\n\t\t\t\r\n\t\t\tthis.initializeProgressive(this.table.options.progressiveLoad)\r\n\t\t\t\r\n\t\t\tif(this.table.options.progressiveLoad === \"scroll\"){\r\n\t\t\t\tthis.subscribe(\"scroll-vertical\", this.scrollVertical.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trowAddingPosition(row, top){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tdispRows = rowManager.getDisplayRows(),\r\n\t\tindex;\r\n\t\t\r\n\t\tif(top){\r\n\t\t\tif(dispRows.length){\r\n\t\t\t\tindex = dispRows[0];\r\n\t\t\t}else{\r\n\t\t\t\tif(rowManager.activeRows.length){\r\n\t\t\t\t\tindex = rowManager.activeRows[rowManager.activeRows.length-1];\r\n\t\t\t\t\ttop = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(dispRows.length){\r\n\t\t\t\tindex = dispRows[dispRows.length - 1];\r\n\t\t\t\ttop = dispRows.length < this.size ? false : true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn {index, top}\r\n\t}\r\n\t\r\n\tcalculatePageSizes(){\r\n\t\tvar testElRow, testElCell;\r\n\t\t\r\n\t\tif(this.table.options.paginationSize){\r\n\t\t\tthis.size = this.table.options.paginationSize;\r\n\t\t}else{\r\n\t\t\ttestElRow = document.createElement(\"div\");\r\n\t\t\ttestElRow.classList.add(\"tabulator-row\");\r\n\t\t\ttestElRow.style.visibility = \"hidden\";\r\n\t\t\t\r\n\t\t\ttestElCell = document.createElement(\"div\");\r\n\t\t\ttestElCell.classList.add(\"tabulator-cell\");\r\n\t\t\ttestElCell.innerHTML = \"Page Row Test\";\r\n\t\t\t\r\n\t\t\ttestElRow.appendChild(testElCell);\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.getTableElement().appendChild(testElRow);\r\n\t\t\t\r\n\t\t\tthis.size = Math.floor(this.table.rowManager.getElement().clientHeight / testElRow.offsetHeight);\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.getTableElement().removeChild(testElRow);\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(\"pageSizeChanged\", this.size);\r\n\t\t\r\n\t\tthis.generatePageSizeSelectList();\r\n\t}\r\n\t\r\n\tinitialLoadComplete(){\r\n\t\tthis.initialLoad = false;\r\n\t}\r\n\t\r\n\tremotePageParams(data, config, silent, params){\r\n\t\tif(!this.initialLoad){\r\n\t\t\tif((this.progressiveLoad && !silent) || (!this.progressiveLoad && !this.dataChanging)){\r\n\t\t\t\tthis.reset(true);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//configure request params\r\n\t\tparams.page = this.page;\r\n\t\t\r\n\t\t//set page size if defined\r\n\t\tif(this.size){\r\n\t\t\tparams.size = this.size;\r\n\t\t}\r\n\t\t\r\n\t\treturn params;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\tuserSetPageToRow(row){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\trow = this.rowManager.findRow(row);\r\n\t\t\t\r\n\t\t\tif(row){\r\n\t\t\t\treturn this.setPageToRow(row)\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn Promise.reject();\r\n\t}\r\n\t\r\n\tuserSetPageSize(size){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\tthis.setPageSize(size);\r\n\t\t\treturn this.setPage(1);\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tscrollVertical(top, dir){\r\n\t\tvar element, diff, margin;\r\n\t\tif(!dir && !this.table.dataLoader.loading){\r\n\t\t\telement = this.table.rowManager.getElement();\r\n\t\t\tdiff = element.scrollHeight - element.clientHeight - top;\r\n\t\t\tmargin = this.table.options.progressiveLoadScrollMargin || (element.clientHeight * 2);\r\n\t\t\t\r\n\t\t\tif(diff < margin){\r\n\t\t\t\tthis.nextPage()\r\n\t\t\t\t.catch(() => {}); //consume the exception thrown when on the last page\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trestOnRenderBefore(rows, renderInPosition){\r\n\t\tif(!renderInPosition){\r\n\t\t\tif(this.mode === \"local\"){\r\n\t\t\t\tthis.reset();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\trowsUpdated(){\r\n\t\tthis.refreshData(true, \"all\");\r\n\t}\r\n\t\r\n\tcreateElements(){\r\n\t\tvar button;\r\n\t\t\r\n\t\tthis.element = document.createElement(\"span\");\r\n\t\tthis.element.classList.add(\"tabulator-paginator\");\r\n\t\t\r\n\t\tthis.pagesElement = document.createElement(\"span\");\r\n\t\tthis.pagesElement.classList.add(\"tabulator-pages\");\r\n\t\t\r\n\t\tbutton = document.createElement(\"button\");\r\n\t\tbutton.classList.add(\"tabulator-page\");\r\n\t\tbutton.setAttribute(\"type\", \"button\");\r\n\t\tbutton.setAttribute(\"role\", \"button\");\r\n\t\tbutton.setAttribute(\"aria-label\", \"\");\r\n\t\tbutton.setAttribute(\"title\", \"\");\r\n\t\t\r\n\t\tthis.firstBut = button.cloneNode(true);\r\n\t\tthis.firstBut.setAttribute(\"data-page\", \"first\");\r\n\t\t\r\n\t\tthis.prevBut = button.cloneNode(true);\r\n\t\tthis.prevBut.setAttribute(\"data-page\", \"prev\");\r\n\t\t\r\n\t\tthis.nextBut = button.cloneNode(true);\r\n\t\tthis.nextBut.setAttribute(\"data-page\", \"next\");\r\n\t\t\r\n\t\tthis.lastBut = button.cloneNode(true);\r\n\t\tthis.lastBut.setAttribute(\"data-page\", \"last\");\r\n\t\t\r\n\t\tif(this.table.options.paginationSizeSelector){\r\n\t\t\tthis.pageSizeSelect = document.createElement(\"select\");\r\n\t\t\tthis.pageSizeSelect.classList.add(\"tabulator-page-size\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tgeneratePageSizeSelectList(){\r\n\t\tvar pageSizes = [];\r\n\t\t\r\n\t\tif(this.pageSizeSelect){\r\n\t\t\t\r\n\t\t\tif(Array.isArray(this.table.options.paginationSizeSelector)){\r\n\t\t\t\tpageSizes = this.table.options.paginationSizeSelector;\r\n\t\t\t\tthis.pageSizes = pageSizes;\r\n\t\t\t\t\r\n\t\t\t\tif(this.pageSizes.indexOf(this.size) == -1){\r\n\t\t\t\t\tpageSizes.unshift(this.size);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t\r\n\t\t\t\tif(this.pageSizes.indexOf(this.size) == -1){\r\n\t\t\t\t\tpageSizes = [];\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (let i = 1; i < 5; i++){\r\n\t\t\t\t\t\tpageSizes.push(this.size * i);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.pageSizes = pageSizes;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tpageSizes = this.pageSizes;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\twhile(this.pageSizeSelect.firstChild) this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);\r\n\t\t\t\r\n\t\t\tpageSizes.forEach((item) => {\r\n\t\t\t\tvar itemEl = document.createElement(\"option\");\r\n\t\t\t\titemEl.value = item;\r\n\t\t\t\t\r\n\t\t\t\tif(item === true){\r\n\t\t\t\t\tthis.langBind(\"pagination|all\", function(value){\r\n\t\t\t\t\t\titemEl.innerHTML = value;\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\titemEl.innerHTML = item;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tthis.pageSizeSelect.appendChild(itemEl);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.pageSizeSelect.value = this.size;\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializePageCounter(){\r\n\t\tvar counter = this.table.options.paginationCounter,\r\n\t\tpageCounter = null;\r\n\t\t\r\n\t\tif(counter){\r\n\t\t\tif(typeof counter === \"function\"){\r\n\t\t\t\tpageCounter = counter;\r\n\t\t\t}else{\r\n\t\t\t\tpageCounter = Page.pageCounters[counter];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(pageCounter){\r\n\t\t\t\tthis.pageCounter = pageCounter;\r\n\t\t\t\t\r\n\t\t\t\tthis.pageCounterElement = document.createElement(\"span\");\r\n\t\t\t\tthis.pageCounterElement.classList.add(\"tabulator-page-counter\");\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Pagination Error - No such page counter found: \", counter);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//setup pagination\r\n\tinitializePaginator(hidden){\r\n\t\tvar pageSelectLabel, paginationCounterHolder;\r\n\t\t\r\n\t\tif(!hidden){\r\n\t\t\t//build pagination element\r\n\t\t\t\r\n\t\t\t//bind localizations\r\n\t\t\tthis.langBind(\"pagination|first\", (value) => {\r\n\t\t\t\tthis.firstBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|first_title\", (value) => {\r\n\t\t\t\tthis.firstBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.firstBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|prev\", (value) => {\r\n\t\t\t\tthis.prevBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|prev_title\", (value) => {\r\n\t\t\t\tthis.prevBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.prevBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|next\", (value) => {\r\n\t\t\t\tthis.nextBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|next_title\", (value) => {\r\n\t\t\t\tthis.nextBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.nextBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|last\", (value) => {\r\n\t\t\t\tthis.lastBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|last_title\", (value) => {\r\n\t\t\t\tthis.lastBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.lastBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t//click bindings\r\n\t\t\tthis.firstBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.setPage(1)\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.prevBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.previousPage()\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.nextBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.nextPage()\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.lastBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.setPage(this.max)\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(this.table.options.paginationElement){\r\n\t\t\t\tthis.element = this.table.options.paginationElement;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.pageSizeSelect){\r\n\t\t\t\tpageSelectLabel = document.createElement(\"label\");\r\n\t\t\t\t\r\n\t\t\t\tthis.langBind(\"pagination|page_size\", (value) => {\r\n\t\t\t\t\tthis.pageSizeSelect.setAttribute(\"aria-label\", value);\r\n\t\t\t\t\tthis.pageSizeSelect.setAttribute(\"title\", value);\r\n\t\t\t\t\tpageSelectLabel.innerHTML = value;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.element.appendChild(pageSelectLabel);\r\n\t\t\t\tthis.element.appendChild(this.pageSizeSelect);\r\n\t\t\t\t\r\n\t\t\t\tthis.pageSizeSelect.addEventListener(\"change\", (e) => {\r\n\t\t\t\t\tthis.setPageSize(this.pageSizeSelect.value == \"true\" ? true : this.pageSizeSelect.value);\r\n\t\t\t\t\tthis.setPage(1)\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//append to DOM\r\n\t\t\tthis.element.appendChild(this.firstBut);\r\n\t\t\tthis.element.appendChild(this.prevBut);\r\n\t\t\tthis.element.appendChild(this.pagesElement);\r\n\t\t\tthis.element.appendChild(this.nextBut);\r\n\t\t\tthis.element.appendChild(this.lastBut);\r\n\t\t\t\r\n\t\t\tif(!this.table.options.paginationElement && !hidden){\r\n\t\t\t\tif(this.table.options.paginationCounter){\r\n\r\n\t\t\t\t\tpaginationCounterHolder \r\n\r\n\t\t\t\t\tif(this.table.options.paginationCounterElement){\r\n\t\t\t\t\t\tif(this.table.options.paginationCounterElement instanceof HTMLElement){\r\n\t\t\t\t\t\t\tthis.table.options.paginationCounterElement.appendChild(this.pageCounterElement);\r\n\t\t\t\t\t\t}else if(typeof this.table.options.paginationCounterElement === \"string\"){\r\n\t\t\t\t\t\t\tpaginationCounterHolder = document.querySelector(this.table.options.paginationCounterElement);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(paginationCounterHolder){\r\n\t\t\t\t\t\t\t\tpaginationCounterHolder.appendChild(this.pageCounterElement);\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Pagination Error - Unable to find element matching paginationCounterElement selector:\", this.table.options.paginationCounterElement);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.footerAppend(this.pageCounterElement);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.footerAppend(this.element);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.page = this.table.options.paginationInitialPage;\r\n\t\t\tthis.count = this.table.options.paginationButtonCount;\r\n\t\t}\r\n\t\t\r\n\t\t//set default values\r\n\t\tthis.mode = this.table.options.paginationMode;\r\n\t}\r\n\t\r\n\tinitializeProgressive(mode){\r\n\t\tthis.initializePaginator(true);\r\n\t\tthis.mode = \"progressive_\" + mode;\r\n\t\tthis.progressiveLoad = true;\r\n\t}\r\n\t\r\n\ttrackChanges(){\r\n\t\tthis.dispatch(\"page-changed\");\r\n\t}\r\n\t\r\n\tsetDisplayIndex(index){\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\t\r\n\tgetDisplayIndex(){\r\n\t\treturn this.displayIndex;\r\n\t}\r\n\t\r\n\t//calculate maximum page from number of rows\r\n\tsetMaxRows(rowCount){\r\n\t\tif(!rowCount){\r\n\t\t\tthis.max = 1;\r\n\t\t}else{\r\n\t\t\tthis.max = this.size === true ? 1 : Math.ceil(rowCount/this.size);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.page > this.max){\r\n\t\t\tthis.page = this.max;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//reset to first page without triggering action\r\n\treset(force){\r\n\t\tif(!this.initialLoad){\r\n\t\t\tif(this.mode == \"local\" || force){\r\n\t\t\t\tthis.page = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set the maximum page\r\n\tsetMaxPage(max){\r\n\t\t\r\n\t\tmax = parseInt(max);\r\n\t\t\r\n\t\tthis.max = max || 1;\r\n\t\t\r\n\t\tif(this.page > this.max){\r\n\t\t\tthis.page = this.max;\r\n\t\t\tthis.trigger();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set current page number\r\n\tsetPage(page){\r\n\t\tswitch(page){\r\n\t\t\tcase \"first\":\r\n\t\t\treturn this.setPage(1);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"prev\":\r\n\t\t\treturn this.previousPage();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"next\":\r\n\t\t\treturn this.nextPage();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"last\":\r\n\t\t\treturn this.setPage(this.max);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\tpage = parseInt(page);\r\n\t\t\r\n\t\tif((page > 0 && page <= this.max) || this.mode !== \"local\"){\r\n\t\t\tthis.page = page;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Requested page is out of range of 1 - \" + this.max + \":\", page);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetPageToRow(row){\r\n\t\tvar rows = this.table.rowManager.getDisplayRows(this.displayIndex - 1);\r\n\t\tvar index = rows.indexOf(row);\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tvar page = this.size === true ? 1 : Math.ceil((index + 1) / this.size);\r\n\t\t\t\r\n\t\t\treturn this.setPage(page)\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Requested row is not visible\");\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetPageSize(size){\r\n\t\tif(size !== true){\r\n\t\t\tsize = parseInt(size);\r\n\t\t}\r\n\r\n\t\tif(size > 0){\r\n\t\t\tthis.size = size;\r\n\t\t\tthis.dispatchExternal(\"pageSizeChanged\", size);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.pageSizeSelect){\r\n\t\t\t// this.pageSizeSelect.value = size;\r\n\t\t\tthis.generatePageSizeSelectList();\r\n\t\t}\r\n\t\t\r\n\t\tthis.trackChanges();\r\n\t}\r\n\t\r\n\t_setPageCounter(totalRows, size, currentRow){\r\n\t\tvar content;\r\n\t\t\r\n\t\tif(this.pageCounter){\r\n\r\n\t\t\tif(this.mode === \"remote\"){\r\n\t\t\t\tsize = this.size;\r\n\t\t\t\tcurrentRow = ((this.page - 1) * this.size) + 1;\r\n\t\t\t\ttotalRows = this.remoteRowCountEstimate;\r\n\t\t\t}\r\n\r\n\t\t\tcontent = this.pageCounter.call(this, size, currentRow, this.page, totalRows, this.max);\r\n\t\t\t\r\n\t\t\tswitch(typeof content){\r\n\t\t\t\tcase \"object\":\r\n\t\t\t\tif(content instanceof Node){\r\n\t\t\t\t\t\r\n\t\t\t\t\t//clear previous cell contents\r\n\t\t\t\t\twhile(this.pageCounterElement.firstChild) this.pageCounterElement.removeChild(this.pageCounterElement.firstChild);\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.pageCounterElement.appendChild(content);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.pageCounterElement.innerHTML = \"\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(content != null){\r\n\t\t\t\t\t\tconsole.warn(\"Page Counter Error - Page Counter has returned a type of object, the only valid page counter object return is an instance of Node, the page counter returned:\", content);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"undefined\":\r\n\t\t\t\tthis.pageCounterElement.innerHTML = \"\";\r\n\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\tthis.pageCounterElement.innerHTML = content;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//setup the pagination buttons\r\n\t_setPageButtons(){\r\n\t\tlet leftSize = Math.floor((this.count-1) / 2);\r\n\t\tlet rightSize = Math.ceil((this.count-1) / 2);\r\n\t\tlet min = this.max - this.page + leftSize + 1 < this.count ? this.max-this.count+1: Math.max(this.page-leftSize,1);\r\n\t\tlet max = this.page <= rightSize? Math.min(this.count, this.max) :Math.min(this.page+rightSize, this.max);\r\n\t\t\r\n\t\twhile(this.pagesElement.firstChild) this.pagesElement.removeChild(this.pagesElement.firstChild);\r\n\t\t\r\n\t\tif(this.page == 1){\r\n\t\t\tthis.firstBut.disabled = true;\r\n\t\t\tthis.prevBut.disabled = true;\r\n\t\t}else{\r\n\t\t\tthis.firstBut.disabled = false;\r\n\t\t\tthis.prevBut.disabled = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.page == this.max){\r\n\t\t\tthis.lastBut.disabled = true;\r\n\t\t\tthis.nextBut.disabled = true;\r\n\t\t}else{\r\n\t\t\tthis.lastBut.disabled = false;\r\n\t\t\tthis.nextBut.disabled = false;\r\n\t\t}\r\n\t\t\r\n\t\tfor(let i = min; i <= max; i++){\r\n\t\t\tif(i>0 && i <= this.max){\r\n\t\t\t\tthis.pagesElement.appendChild(this._generatePageButton(i));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.footerRedraw();\r\n\t}\r\n\t\r\n\t_generatePageButton(page){\r\n\t\tvar button = document.createElement(\"button\");\r\n\t\t\r\n\t\tbutton.classList.add(\"tabulator-page\");\r\n\t\tif(page == this.page){\r\n\t\t\tbutton.classList.add(\"active\");\r\n\t\t}\r\n\t\t\r\n\t\tbutton.setAttribute(\"type\", \"button\");\r\n\t\tbutton.setAttribute(\"role\", \"button\");\r\n\t\t\r\n\t\tthis.langBind(\"pagination|page_title\", (value) => {\r\n\t\t\tbutton.setAttribute(\"aria-label\", value + \" \" + page);\r\n\t\t\tbutton.setAttribute(\"title\", value + \" \" + page);\r\n\t\t});\r\n\t\t\r\n\t\tbutton.setAttribute(\"data-page\", page);\r\n\t\tbutton.textContent = page;\r\n\t\t\r\n\t\tbutton.addEventListener(\"click\", (e) => {\r\n\t\t\tthis.setPage(page)\r\n\t\t});\r\n\t\t\r\n\t\treturn button;\r\n\t}\r\n\t\r\n\t//previous page\r\n\tpreviousPage(){\r\n\t\tif(this.page > 1){\r\n\t\t\tthis.page--;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger()\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Previous page would be less than page 1:\", 0);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//next page\r\n\tnextPage(){\r\n\t\tif(this.page < this.max){\r\n\t\t\tthis.page++;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger();\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tif(!this.progressiveLoad){\r\n\t\t\t\tconsole.warn(\"Pagination Error - Next page would be greater than maximum page of \" + this.max + \":\", this.max + 1);\r\n\t\t\t}\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return current page number\r\n\tgetPage(){\r\n\t\treturn this.page;\r\n\t}\r\n\t\r\n\t//return max page number\r\n\tgetPageMax(){\r\n\t\treturn this.max;\r\n\t}\r\n\t\r\n\tgetPageSize(size){\r\n\t\treturn this.size;\r\n\t}\r\n\t\r\n\tgetMode(){\r\n\t\treturn this.mode;\r\n\t}\r\n\t\r\n\t//return appropriate rows for current page\r\n\tgetRows(data){\r\n\t\tvar actualRowPageSize = 0,\r\n\t\toutput, start, end, actualStartRow;\r\n\r\n\t\tvar actualRows = data.filter((row) => {\r\n\t\t\treturn row.type === \"row\";\r\n\t\t});\r\n\t\t\r\n\t\tif(this.mode == \"local\"){\r\n\t\t\toutput = [];\r\n\t\t\t\r\n\t\t\tthis.setMaxRows(data.length);\r\n\t\t\t\r\n\t\t\tif(this.size === true){\r\n\t\t\t\tstart = 0;\r\n\t\t\t\tend = data.length;\r\n\t\t\t}else{\r\n\t\t\t\tstart = this.size * (this.page - 1);\r\n\t\t\t\tend = start + parseInt(this.size);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._setPageButtons();\r\n\t\t\t\r\n\t\t\tfor(let i = start; i < end; i++){\r\n\t\t\t\tlet row = data[i];\r\n\r\n\t\t\t\tif(row){\r\n\t\t\t\t\toutput.push(row);\r\n\r\n\t\t\t\t\tif(row.type === \"row\"){\r\n\t\t\t\t\t\tif(!actualStartRow){\r\n\t\t\t\t\t\t\tactualStartRow = row;\r\n\t\t\t\t\t\t}\t\r\n\r\n\t\t\t\t\t\tactualRowPageSize++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._setPageCounter(actualRows.length, actualRowPageSize, actualStartRow ? (actualRows.indexOf(actualStartRow) + 1) : 0);\r\n\t\t\t\r\n\t\t\treturn output;\r\n\t\t}else{\r\n\t\t\tthis._setPageButtons();\r\n\t\t\tthis._setPageCounter(actualRows.length);\r\n\t\t\t\r\n\t\t\treturn data.slice(0);\r\n\t\t}\r\n\t}\r\n\t\r\n\ttrigger(){\r\n\t\tvar left;\r\n\t\t\r\n\t\tswitch(this.mode){\r\n\t\t\tcase \"local\":\r\n\t\t\tleft = this.table.rowManager.scrollLeft;\r\n\t\t\t\r\n\t\t\tthis.refreshData();\r\n\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"pageLoaded\", this.getPage());\r\n\t\t\t\r\n\t\t\treturn Promise.resolve();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"remote\":\r\n\t\t\tthis.dataChanging = true;\r\n\t\t\treturn this.reloadData(null)\r\n\t\t\t.finally(() => {\r\n\t\t\t\tthis.dataChanging = false;\r\n\t\t\t})\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"progressive_load\":\r\n\t\t\tcase \"progressive_scroll\":\r\n\t\t\treturn this.reloadData(null, true);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\tconsole.warn(\"Pagination Error - no such pagination mode:\", this.mode);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_parseRemoteData(data){\r\n\t\tvar left, data, margin;\r\n\t\t\r\n\t\tif(typeof data.last_page === \"undefined\"){\r\n\t\t\tconsole.warn(\"Remote Pagination Error - Server response missing '\" + (this.options(\"dataReceiveParams\").last_page || \"last_page\") + \"' property\");\r\n\t\t}\r\n\t\t\r\n\t\tif(data.data){\r\n\t\t\tthis.max = parseInt(data.last_page) || 1;\r\n\r\n\t\t\tthis.remoteRowCountEstimate = typeof data.last_row !== \"undefined\" ? data.last_row : (data.last_page * this.size - (this.page == data.last_page ? (this.size - data.data.length) : 0));\r\n\t\t\t\r\n\t\t\tif(this.progressiveLoad){\r\n\t\t\t\tswitch(this.mode){\r\n\t\t\t\t\tcase \"progressive_load\":\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.page == 1){\r\n\t\t\t\t\t\tthis.table.rowManager.setData(data.data, false, this.page == 1)\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.table.rowManager.addRows(data.data);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.page < this.max){\r\n\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\tthis.nextPage();\r\n\t\t\t\t\t\t}, this.table.options.progressiveLoadDelay);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"progressive_scroll\":\r\n\t\t\t\t\tdata = this.page === 1 ? data.data : this.table.rowManager.getData().concat(data.data);\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.table.rowManager.setData(data, this.page !== 1, this.page == 1);\r\n\t\t\t\t\t\r\n\t\t\t\t\tmargin = this.table.options.progressiveLoadScrollMargin || (this.table.rowManager.element.clientHeight * 2);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.table.rowManager.element.scrollHeight <= (this.table.rowManager.element.clientHeight + margin)){\r\n\t\t\t\t\t\tif(this.page < this.max){\r\n\t\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\t\tthis.nextPage();\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\t// left = this.table.rowManager.scrollLeft;\r\n\t\t\t\tthis.dispatchExternal(\"pageLoaded\", this.getPage());\r\n\t\t\t\t// this.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\t// this.table.columnManager.scrollHorizontal(left);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Remote Pagination Error - Server response missing '\" + (this.options(\"dataReceiveParams\").data || \"data\") + \"' property\");\r\n\t\t}\r\n\t\t\r\n\t\treturn data.data;\r\n\t}\r\n\t\r\n\t//handle the footer element being redrawn\r\n\tfooterRedraw(){\r\n\t\tvar footer = this.table.footerManager.containerElement;\r\n\r\n\t\tif((Math.ceil(footer.clientWidth) - footer.scrollWidth) < 0){\r\n\t\t\tthis.pagesElement.style.display = 'none';\r\n\t\t}else{\r\n\t\t\tthis.pagesElement.style.display = '';\r\n\t\t\t\r\n\t\t\tif((Math.ceil(footer.clientWidth) - footer.scrollWidth) < 0){\r\n\t\t\t\tthis.pagesElement.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nPage.moduleName = \"page\";\r\n\r\n//load defaults\r\nPage.pageCounters = defaultPageCounters;\r\n\r\nexport default Page;\r\n","// read peristence information from storage\r\nexport default {\r\n\tlocal:function(id, type){\r\n\t\tvar data = localStorage.getItem(id + \"-\" + type);\r\n\r\n\t\treturn data ? JSON.parse(data) : false;\r\n\t},\r\n\tcookie:function(id, type){\r\n\t\tvar cookie = document.cookie,\r\n\t\tkey = id + \"-\" + type,\r\n\t\tcookiePos = cookie.indexOf(key + \"=\"),\r\n\t\tend, data;\r\n\r\n\t\t//if cookie exists, decode and load column data into tabulator\r\n\t\tif(cookiePos > -1){\r\n\t\t\tcookie = cookie.slice(cookiePos);\r\n\r\n\t\t\tend = cookie.indexOf(\";\");\r\n\r\n\t\t\tif(end > -1){\r\n\t\t\t\tcookie = cookie.slice(0, end);\r\n\t\t\t}\r\n\r\n\t\t\tdata = cookie.replace(key + \"=\", \"\");\r\n\t\t}\r\n\r\n\t\treturn data ? JSON.parse(data) : false;\r\n\t}\r\n};\r\n","//write persistence information to storage\r\nexport default {\r\n\tlocal:function(id, type, data){\r\n\t\tlocalStorage.setItem(id + \"-\" + type, JSON.stringify(data));\r\n\t},\r\n\tcookie:function(id, type, data){\r\n\t\tvar expireDate = new Date();\r\n\r\n\t\texpireDate.setDate(expireDate.getDate() + 10000);\r\n\r\n\t\tdocument.cookie = id + \"-\" + type + \"=\" + JSON.stringify(data) + \"; expires=\" + expireDate.toUTCString();\r\n\t}\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultReaders from './defaults/readers.js';\r\nimport defaultWriters from './defaults/writers.js';\r\n\r\nclass Persistence extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.mode = \"\";\r\n\t\tthis.id = \"\";\r\n\t\t// this.persistProps = [\"field\", \"width\", \"visible\"];\r\n\t\tthis.defWatcherBlock = false;\r\n\t\tthis.config = {};\r\n\t\tthis.readFunc = false;\r\n\t\tthis.writeFunc = false;\r\n\r\n\t\tthis.registerTableOption(\"persistence\", false);\r\n\t\tthis.registerTableOption(\"persistenceID\", \"\"); //key for persistent storage\r\n\t\tthis.registerTableOption(\"persistenceMode\", true); //mode for storing persistence information\r\n\t\tthis.registerTableOption(\"persistenceReaderFunc\", false); //function for handling persistence data reading\r\n\t\tthis.registerTableOption(\"persistenceWriterFunc\", false); //function for handling persistence data writing\r\n\t}\r\n\r\n\t// Test for whether localStorage is available for use.\r\n\tlocalStorageTest() {\r\n\t\tvar testKey = \"_tabulator_test\";\r\n\r\n\t\ttry {\r\n\t\t\twindow.localStorage.setItem( testKey, testKey);\r\n\t\t\twindow.localStorage.removeItem( testKey );\r\n\t\t\treturn true;\r\n\t\t} catch(e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//setup parameters\r\n\tinitialize(){\r\n\t\tif(this.table.options.persistence){\r\n\t\t\t//determine persistent layout storage type\r\n\t\t\tvar mode = this.table.options.persistenceMode,\r\n\t\t\tid = this.table.options.persistenceID,\r\n\t\t\tretreivedData;\r\n\r\n\t\t\tthis.mode = mode !== true ? mode : (this.localStorageTest() ? \"local\" : \"cookie\");\r\n\r\n\t\t\tif(this.table.options.persistenceReaderFunc){\r\n\t\t\t\tif(typeof this.table.options.persistenceReaderFunc === \"function\"){\r\n\t\t\t\t\tthis.readFunc = this.table.options.persistenceReaderFunc;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(Persistence.readers[this.table.options.persistenceReaderFunc]){\r\n\t\t\t\t\t\tthis.readFunc = Persistence.readers[this.table.options.persistenceReaderFunc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Persistence Read Error - invalid reader set\", this.table.options.persistenceReaderFunc);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(Persistence.readers[this.mode]){\r\n\t\t\t\t\tthis.readFunc = Persistence.readers[this.mode];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Persistence Read Error - invalid reader set\", this.mode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.options.persistenceWriterFunc){\r\n\t\t\t\tif(typeof this.table.options.persistenceWriterFunc === \"function\"){\r\n\t\t\t\t\tthis.writeFunc = this.table.options.persistenceWriterFunc;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(Persistence.writers[this.table.options.persistenceWriterFunc]){\r\n\t\t\t\t\t\tthis.writeFunc = Persistence.writers[this.table.options.persistenceWriterFunc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Persistence Write Error - invalid reader set\", this.table.options.persistenceWriterFunc);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(Persistence.writers[this.mode]){\r\n\t\t\t\t\tthis.writeFunc = Persistence.writers[this.mode];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Persistence Write Error - invalid writer set\", this.mode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//set storage tag\r\n\t\t\tthis.id = \"tabulator-\" + (id || (this.table.element.getAttribute(\"id\") || \"\"));\r\n\r\n\t\t\tthis.config = {\r\n\t\t\t\tsort:this.table.options.persistence === true || this.table.options.persistence.sort,\r\n\t\t\t\tfilter:this.table.options.persistence === true || this.table.options.persistence.filter,\r\n\t\t\t\tgroup:this.table.options.persistence === true || this.table.options.persistence.group,\r\n\t\t\t\tpage:this.table.options.persistence === true || this.table.options.persistence.page,\r\n\t\t\t\tcolumns:this.table.options.persistence === true ? [\"title\", \"width\", \"visible\"] : this.table.options.persistence.columns,\r\n\t\t\t};\r\n\r\n\t\t\t//load pagination data if needed\r\n\t\t\tif(this.config.page){\r\n\t\t\t\tretreivedData = this.retreiveData(\"page\");\r\n\r\n\t\t\t\tif(retreivedData){\r\n\t\t\t\t\tif(typeof retreivedData.paginationSize !== \"undefined\" && (this.config.page === true || this.config.page.size)){\r\n\t\t\t\t\t\tthis.table.options.paginationSize = retreivedData.paginationSize;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(typeof retreivedData.paginationInitialPage !== \"undefined\" && (this.config.page === true || this.config.page.page)){\r\n\t\t\t\t\t\tthis.table.options.paginationInitialPage = retreivedData.paginationInitialPage;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//load group data if needed\r\n\t\t\tif(this.config.group){\r\n\t\t\t\tretreivedData = this.retreiveData(\"group\");\r\n\r\n\t\t\t\tif(retreivedData){\r\n\t\t\t\t\tif(typeof retreivedData.groupBy !== \"undefined\" && (this.config.group === true || this.config.group.groupBy)){\r\n\t\t\t\t\t\tthis.table.options.groupBy = retreivedData.groupBy;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(typeof retreivedData.groupStartOpen !== \"undefined\" && (this.config.group === true || this.config.group.groupStartOpen)){\r\n\t\t\t\t\t\tthis.table.options.groupStartOpen = retreivedData.groupStartOpen;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(typeof retreivedData.groupHeader !== \"undefined\" && (this.config.group === true || this.config.group.groupHeader)){\r\n\t\t\t\t\t\tthis.table.options.groupHeader = retreivedData.groupHeader;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.columns){\r\n\t\t\t\tthis.table.options.columns = this.load(\"columns\", this.table.options.columns);\r\n\t\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t\t\tthis.subscribe(\"column-show\", this.save.bind(this, \"columns\"));\r\n\t\t\t\tthis.subscribe(\"column-hide\", this.save.bind(this, \"columns\"));\r\n\t\t\t\tthis.subscribe(\"column-moved\", this.save.bind(this, \"columns\"));\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"table-built\", this.tableBuilt.bind(this), 0);\r\n\r\n\t\t\tthis.subscribe(\"table-redraw\", this.tableRedraw.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"filter-changed\", this.eventSave.bind(this, \"filter\"));\r\n\t\t\tthis.subscribe(\"sort-changed\", this.eventSave.bind(this, \"sort\"));\r\n\t\t\tthis.subscribe(\"group-changed\", this.eventSave.bind(this, \"group\"));\r\n\t\t\tthis.subscribe(\"page-changed\", this.eventSave.bind(this, \"page\"));\r\n\t\t\tthis.subscribe(\"column-resized\", this.eventSave.bind(this, \"columns\"));\r\n\t\t\tthis.subscribe(\"layout-refreshed\", this.eventSave.bind(this, \"columns\"));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"getColumnLayout\", this.getColumnLayout.bind(this));\r\n\t\tthis.registerTableFunction(\"setColumnLayout\", this.setColumnLayout.bind(this));\r\n\t}\r\n\r\n\teventSave(type){\r\n\t\tif(this.config[type]){\r\n\t\t\tthis.save(type);\r\n\t\t}\r\n\t}\r\n\r\n\ttableBuilt(){\r\n\t\tvar options = this.table.options,\r\n\t\tsorters, filters;\r\n\r\n\t\tif(this.config.sort){\r\n\t\t\tsorters = this.load(\"sort\");\r\n\r\n\t\t\tif(!sorters === false){\r\n\t\t\t\tthis.table.options.initialSort = sorters;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this.config.filter){\r\n\t\t\tfilters = this.load(\"filter\");\r\n\r\n\t\t\tif(!filters === false){\r\n\t\t\t\tthis.table.options.initialFilter = filters;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tif(force && this.config.columns){\r\n\t\t\tthis.save(\"columns\");\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tgetColumnLayout(){\r\n\t\treturn this.parseColumns(this.table.columnManager.getColumns());\r\n\t}\r\n\r\n\tsetColumnLayout(layout){\r\n\t\tthis.table.columnManager.setColumns(this.mergeDefinition(this.table.options.columns, layout))\r\n\t\treturn true;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tinitializeColumn(column){\r\n\t\tvar def, keys;\r\n\r\n\t\tif(this.config.columns){\r\n\t\t\tthis.defWatcherBlock = true;\r\n\r\n\t\t\tdef = column.getDefinition();\r\n\r\n\t\t\tkeys = this.config.columns === true ? Object.keys(def) : this.config.columns;\r\n\r\n\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\tvar props = Object.getOwnPropertyDescriptor(def, key);\r\n\t\t\t\tvar value = def[key];\r\n\t\t\t\tif(props){\r\n\t\t\t\t\tObject.defineProperty(def, key, {\r\n\t\t\t\t\t\tset: function(newValue){\r\n\t\t\t\t\t\t\tvalue = newValue;\r\n\r\n\t\t\t\t\t\t\tif(!this.defWatcherBlock){\r\n\t\t\t\t\t\t\t\tthis.save(\"columns\");\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif(props.set){\r\n\t\t\t\t\t\t\t\tprops.set(newValue);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tget:function(){\r\n\t\t\t\t\t\t\tif(props.get){\r\n\t\t\t\t\t\t\t\tprops.get();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.defWatcherBlock = false;\r\n\t\t}\r\n\t}\r\n\r\n\t//load saved definitions\r\n\tload(type, current){\r\n\t\tvar data = this.retreiveData(type);\r\n\r\n\t\tif(current){\r\n\t\t\tdata = data ? this.mergeDefinition(current, data) : current;\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//retreive data from memory\r\n\tretreiveData(type){\r\n\t\treturn this.readFunc ? this.readFunc(this.id, type) : false;\r\n\t}\r\n\r\n\t//merge old and new column definitions\r\n\tmergeDefinition(oldCols, newCols){\r\n\t\tvar output = [];\r\n\r\n\t\tnewCols = newCols || [];\r\n\r\n\t\tnewCols.forEach((column, to) => {\r\n\t\t\tvar from = this._findColumn(oldCols, column),\r\n\t\t\tkeys;\r\n\r\n\t\t\tif(from){\r\n\t\t\t\tif(this.config.columns === true || this.config.columns == undefined){\r\n\t\t\t\t\tkeys = Object.keys(from);\r\n\t\t\t\t\tkeys.push(\"width\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tkeys = this.config.columns;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\t\tif(key !== \"columns\" && typeof column[key] !== \"undefined\"){\r\n\t\t\t\t\t\tfrom[key] = column[key];\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(from.columns){\r\n\t\t\t\t\tfrom.columns = this.mergeDefinition(from.columns, column.columns);\r\n\t\t\t\t}\r\n\r\n\t\t\t\toutput.push(from);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\toldCols.forEach((column, i) => {\r\n\t\t\tvar from = this._findColumn(newCols, column);\r\n\r\n\t\t\tif (!from) {\r\n\t\t\t\tif(output.length>i){\r\n\t\t\t\t\toutput.splice(i, 0, column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\toutput.push(column);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//find matching columns\r\n\t_findColumn(columns, subject){\r\n\t\tvar type = subject.columns ? \"group\" : (subject.field ? \"field\" : \"object\");\r\n\r\n\t\treturn columns.find(function(col){\r\n\t\t\tswitch(type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\treturn col.title === subject.title && col.columns.length === subject.columns.length;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"field\":\r\n\t\t\t\treturn col.field === subject.field;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"object\":\r\n\t\t\t\treturn col === subject;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//save data\r\n\tsave(type){\r\n\t\tvar data = {};\r\n\r\n\t\tswitch(type){\r\n\t\t\tcase \"columns\":\r\n\t\t\tdata = this.parseColumns(this.table.columnManager.getColumns())\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"filter\":\r\n\t\t\tdata = this.table.modules.filter.getFilters();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"sort\":\r\n\t\t\tdata = this.validateSorters(this.table.modules.sort.getSort());\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\tdata = this.getGroupConfig();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"page\":\r\n\t\t\tdata = this.getPageConfig();\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(this.writeFunc){\r\n\t\t\tthis.writeFunc(this.id, type, data);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t//ensure sorters contain no function data\r\n\tvalidateSorters(data){\r\n\t\tdata.forEach(function(item){\r\n\t\t\titem.column = item.field;\r\n\t\t\tdelete item.field;\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tgetGroupConfig(){\r\n\t\tvar data = {};\r\n\r\n\t\tif(this.config.group){\r\n\t\t\tif(this.config.group === true || this.config.group.groupBy){\r\n\t\t\t\tdata.groupBy = this.table.options.groupBy;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.group === true || this.config.group.groupStartOpen){\r\n\t\t\t\tdata.groupStartOpen = this.table.options.groupStartOpen;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.group === true || this.config.group.groupHeader){\r\n\t\t\t\tdata.groupHeader = this.table.options.groupHeader;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tgetPageConfig(){\r\n\t\tvar data = {};\r\n\r\n\t\tif(this.config.page){\r\n\t\t\tif(this.config.page === true || this.config.page.size){\r\n\t\t\t\tdata.paginationSize = this.table.modules.page.getPageSize();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.page === true || this.config.page.page){\r\n\t\t\t\tdata.paginationInitialPage = this.table.modules.page.getPage();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\r\n\t//parse columns for data to store\r\n\tparseColumns(columns){\r\n\t\tvar definitions = [],\r\n\t\texcludedKeys = [\"headerContextMenu\", \"headerMenu\", \"contextMenu\", \"clickMenu\"];\r\n\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\tvar defStore = {},\r\n\t\t\tcolDef = column.getDefinition(),\r\n\t\t\tkeys;\r\n\r\n\t\t\tif(column.isGroup){\r\n\t\t\t\tdefStore.title = colDef.title;\r\n\t\t\t\tdefStore.columns = this.parseColumns(column.getColumns());\r\n\t\t\t}else{\r\n\t\t\t\tdefStore.field = column.getField();\r\n\r\n\t\t\t\tif(this.config.columns === true || this.config.columns == undefined){\r\n\t\t\t\t\tkeys = Object.keys(colDef);\r\n\t\t\t\t\tkeys.push(\"width\");\r\n\t\t\t\t\tkeys.push(\"visible\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tkeys = this.config.columns;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\t\tswitch(key){\r\n\t\t\t\t\t\tcase \"width\":\r\n\t\t\t\t\t\tdefStore.width = column.getWidth();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"visible\":\r\n\t\t\t\t\t\tdefStore.visible = column.visible;\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tif(typeof colDef[key] !== \"function\" && excludedKeys.indexOf(key) === -1){\r\n\t\t\t\t\t\t\tdefStore[key] = colDef[key];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tdefinitions.push(defStore);\r\n\t\t});\r\n\r\n\t\treturn definitions;\r\n\t}\r\n}\r\n\r\nPersistence.moduleName = \"persistence\";\r\n\r\nPersistence.moduleInitOrder = -10;\r\n\r\n//load defaults\r\nPersistence.readers = defaultReaders;\r\nPersistence.writers = defaultWriters;\r\n\r\nexport default Persistence;","import Module from '../../core/Module.js';\r\n\r\nclass Popup extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.columnSubscribers = {};\r\n\t\t\r\n\t\tthis.registerTableOption(\"rowContextPopup\", false);\r\n\t\tthis.registerTableOption(\"rowClickPopup\", false);\r\n\t\tthis.registerTableOption(\"groupContextPopup\", false);\r\n\t\tthis.registerTableOption(\"groupClickPopup\", false);\r\n\t\t\r\n\t\tthis.registerColumnOption(\"headerContextPopup\");\r\n\t\tthis.registerColumnOption(\"headerClickPopup\");\r\n\t\tthis.registerColumnOption(\"headerPopup\");\r\n\t\tthis.registerColumnOption(\"headerPopupIcon\");\r\n\t\tthis.registerColumnOption(\"contextPopup\");\r\n\t\tthis.registerColumnOption(\"clickPopup\");\r\n\t\t\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.initializeRowWatchers();\r\n\t\tthis.initializeGroupWatchers();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\t\r\n\tinitializeRowWatchers(){\r\n\t\tif(this.table.options.rowContextPopup){\r\n\t\t\tthis.subscribe(\"row-contextmenu\", this.loadPopupEvent.bind(this, this.table.options.rowContextPopup));\r\n\t\t\tthis.table.on(\"rowTapHold\", this.loadPopupEvent.bind(this, this.table.options.rowContextPopup));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.rowClickPopup){\r\n\t\t\tthis.subscribe(\"row-click\", this.loadPopupEvent.bind(this, this.table.options.rowClickPopup));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeGroupWatchers(){\r\n\t\tif(this.table.options.groupContextPopup){\r\n\t\t\tthis.subscribe(\"group-contextmenu\", this.loadPopupEvent.bind(this, this.table.options.groupContextPopup));\r\n\t\t\tthis.table.on(\"groupTapHold\", this.loadPopupEvent.bind(this, this.table.options.groupContextPopup));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.groupClickPopup){\r\n\t\t\tthis.subscribe(\"group-click\", this.loadPopupEvent.bind(this, this.table.options.groupClickPopup));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar options = [\"headerContextPopup\", \"headerClickPopup\"],\r\n\t\tdef = column.definition;\r\n\t\t\r\n\t\t//handle column events\r\n\t\tif(def.headerContextPopup && !this.columnSubscribers.headerContextPopup){\r\n\t\t\tthis.columnSubscribers.headerContextPopup = this.loadPopupTableColumnEvent.bind(this, \"headerContextPopup\");\r\n\t\t\tthis.subscribe(\"column-contextmenu\", this.columnSubscribers.headerContextPopup);\r\n\t\t\tthis.table.on(\"headerTapHold\", this.loadPopupTableColumnEvent.bind(this, \"headerContextPopup\"))\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerClickPopup && !this.columnSubscribers.headerClickPopup){\r\n\t\t\tthis.columnSubscribers.headerClickPopup = this.loadPopupTableColumnEvent.bind(this, \"headerClickPopup\");\r\n\t\t\tthis.subscribe(\"column-click\", this.columnSubscribers.headerClickPopup);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerPopup){\r\n\t\t\tthis.initializeColumnHeaderPopup(column);\r\n\t\t}\r\n\t\t\r\n\t\t//handle cell events\r\n\t\tif(def.contextPopup && !this.columnSubscribers.contextPopup){\r\n\t\t\tthis.columnSubscribers.contextPopup = this.loadPopupTableCellEvent.bind(this, \"contextPopup\");\r\n\t\t\tthis.subscribe(\"cell-contextmenu\", this.columnSubscribers.contextPopup);\r\n\t\t\tthis.table.on(\"cellTapHold\", this.loadPopupTableCellEvent.bind(this, \"contextPopup\"))\r\n\t\t}\r\n\t\t\r\n\t\tif(def.clickPopup && !this.columnSubscribers.clickPopup){\r\n\t\t\tthis.columnSubscribers.clickPopup = this.loadPopupTableCellEvent.bind(this, \"clickPopup\");\r\n\t\t\tthis.subscribe(\"cell-click\", this.columnSubscribers.clickPopup);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumnHeaderPopup(column){\r\n\t\tvar icon = column.definition.headerPopupIcon,\r\n\t\theaderPopupEl;\r\n\t\t\r\n\t\theaderPopupEl = document.createElement(\"span\");\r\n\t\theaderPopupEl.classList.add(\"tabulator-header-popup-button\");\r\n\r\n\t\tif(icon){\r\n\t\t\tif(typeof icon === \"function\"){\r\n\t\t\t\ticon = icon(column.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tif(icon instanceof HTMLElement){\r\n\t\t\t\theaderPopupEl.appendChild(icon);\r\n\t\t\t}else{\r\n\t\t\t\theaderPopupEl.innerHTML = icon;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\theaderPopupEl.innerHTML = \"⋮\";\r\n\t\t}\r\n\t\t\r\n\t\theaderPopupEl.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tthis.loadPopupEvent(column.definition.headerPopup, e, column);\r\n\t\t});\r\n\t\t\r\n\t\tcolumn.titleElement.insertBefore(headerPopupEl, column.titleElement.firstChild);\r\n\t}\r\n\t\r\n\tloadPopupTableCellEvent(option, e, cell){\r\n\t\tif(cell._cell){\r\n\t\t\tcell = cell._cell;\r\n\t\t}\r\n\t\t\r\n\t\tif(cell.column.definition[option]){\r\n\t\t\tthis.loadPopupEvent(cell.column.definition[option], e, cell);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadPopupTableColumnEvent(option, e, column){\r\n\t\tif(column._column){\r\n\t\t\tcolumn = column._column;\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition[option]){\r\n\t\t\tthis.loadPopupEvent(column.definition[option], e, column);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadPopupEvent(contents, e, component){\r\n\t\tvar renderedCallback;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\trenderedCallback = callback;\r\n\t\t}\r\n\t\t\r\n\t\tif(component._group){\r\n\t\t\tcomponent = component._group;\r\n\t\t}else if(component._row){\r\n\t\t\tcomponent = component._row;\r\n\t\t}\r\n\t\t\r\n\t\tcontents = typeof contents == \"function\" ? contents.call(this.table, e, component.getComponent(), onRendered) : contents;\r\n\t\t\r\n\t\tthis.loadPopup(e, component, contents, renderedCallback);\r\n\t}\r\n\t\r\n\tloadPopup(e, component, contents, renderedCallback){\r\n\t\tvar touch = !(e instanceof MouseEvent),\r\n\t\tcontentsEl, popup;\r\n\t\t\r\n\t\tif(contents instanceof HTMLElement){\r\n\t\t\tcontentsEl = contents;\r\n\t\t}else{\r\n\t\t\tcontentsEl = document.createElement(\"div\");\r\n\t\t\tcontentsEl.innerHTML = contents;\r\n\t\t}\r\n\t\t\r\n\t\tcontentsEl.classList.add(\"tabulator-popup\");\r\n\r\n\t\tcontentsEl.addEventListener(\"click\", (e) =>{\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tif(!touch){\r\n\t\t\te.preventDefault();\r\n\t\t}\r\n\t\t\r\n\t\tpopup = this.popup(contentsEl);\r\n\r\n\t\tif(typeof renderedCallback === \"function\"){\r\n\t\t\tpopup.renderCallback(renderedCallback);\r\n\t\t}\r\n\t\t\r\n\t\tpopup.show(e).hideOnBlur(() => {\r\n\t\t\tthis.dispatchExternal(\"popupClosed\", component.getComponent());\r\n\t\t});\r\n\r\n\r\n\r\n\t\tthis.dispatchExternal(\"popupOpened\", component.getComponent())\r\n\t}\r\n}\r\n\r\nPopup.moduleName = \"popup\";\r\n\r\nexport default Popup;\r\n","import Module from '../../core/Module.js';\r\n\r\nclass Print extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.element = false;\r\n\t\tthis.manualBlock = false;\r\n\r\n\t\tthis.registerTableOption(\"printAsHtml\", false); //enable print as html\r\n\t\tthis.registerTableOption(\"printFormatter\", false); //printing page formatter\r\n\t\tthis.registerTableOption(\"printHeader\", false); //page header contents\r\n\t\tthis.registerTableOption(\"printFooter\", false); //page footer contents\r\n\t\tthis.registerTableOption(\"printStyled\", true); //enable print as html styling\r\n\t\tthis.registerTableOption(\"printRowRange\", \"visible\"); //restrict print to visible rows only\r\n\t\tthis.registerTableOption(\"printConfig\", {}); //print config options\r\n\r\n\t\tthis.registerColumnOption(\"print\");\r\n\t\tthis.registerColumnOption(\"titlePrint\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.printAsHtml){\r\n\t\t\twindow.addEventListener(\"beforeprint\", this.replaceTable.bind(this));\r\n\t\t\twindow.addEventListener(\"afterprint\", this.cleanup.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"print\", this.printFullscreen.bind(this));\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\treplaceTable(){\r\n\t\tif(!this.manualBlock){\r\n\t\t\tthis.element = document.createElement(\"div\");\r\n\t\t\tthis.element.classList.add(\"tabulator-print-table\");\r\n\r\n\t\t\tthis.element.appendChild(this.table.modules.export.genereateTable(this.table.options.printConfig, this.table.options.printStyled, this.table.options.printRowRange, \"print\"));\r\n\r\n\t\t\tthis.table.element.style.display = \"none\";\r\n\r\n\t\t\tthis.table.element.parentNode.insertBefore(this.element, this.table.element);\r\n\t\t}\r\n\t}\r\n\r\n\tcleanup(){\r\n\t\tdocument.body.classList.remove(\"tabulator-print-fullscreen-hide\");\r\n\r\n\t\tif(this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\tthis.table.element.style.display = \"\";\r\n\t\t}\r\n\t}\r\n\r\n\tprintFullscreen(visible, style, config){\r\n\t\tvar scrollX = window.scrollX,\r\n\t\tscrollY = window.scrollY,\r\n\t\theaderEl = document.createElement(\"div\"),\r\n\t\tfooterEl = document.createElement(\"div\"),\r\n\t\ttableEl = this.table.modules.export.genereateTable(typeof config != \"undefined\" ? config : this.table.options.printConfig, typeof style != \"undefined\" ? style : this.table.options.printStyled, visible || this.table.options.printRowRange, \"print\"),\r\n\t\theaderContent, footerContent;\r\n\r\n\t\tthis.manualBlock = true;\r\n\r\n\t\tthis.element = document.createElement(\"div\");\r\n\t\tthis.element.classList.add(\"tabulator-print-fullscreen\");\r\n\r\n\t\tif(this.table.options.printHeader){\r\n\t\t\theaderEl.classList.add(\"tabulator-print-header\");\r\n\r\n\t\t\theaderContent = typeof this.table.options.printHeader == \"function\" ? this.table.options.printHeader.call(this.table) : this.table.options.printHeader;\r\n\r\n\t\t\tif(typeof headerContent == \"string\"){\r\n\t\t\t\theaderEl.innerHTML = headerContent;\r\n\t\t\t}else{\r\n\t\t\t\theaderEl.appendChild(headerContent);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element.appendChild(headerEl);\r\n\t\t}\r\n\r\n\t\tthis.element.appendChild(tableEl);\r\n\r\n\t\tif(this.table.options.printFooter){\r\n\t\t\tfooterEl.classList.add(\"tabulator-print-footer\");\r\n\r\n\t\t\tfooterContent = typeof this.table.options.printFooter == \"function\" ? this.table.options.printFooter.call(this.table) : this.table.options.printFooter;\r\n\r\n\r\n\t\t\tif(typeof footerContent == \"string\"){\r\n\t\t\t\tfooterEl.innerHTML = footerContent;\r\n\t\t\t}else{\r\n\t\t\t\tfooterEl.appendChild(footerContent);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element.appendChild(footerEl);\r\n\t\t}\r\n\r\n\t\tdocument.body.classList.add(\"tabulator-print-fullscreen-hide\");\r\n\t\tdocument.body.appendChild(this.element);\r\n\r\n\t\tif(this.table.options.printFormatter){\r\n\t\t\tthis.table.options.printFormatter(this.element, tableEl);\r\n\t\t}\r\n\r\n\t\twindow.print();\r\n\r\n\t\tthis.cleanup();\r\n\r\n\t\twindow.scrollTo(scrollX, scrollY);\r\n\r\n\t\tthis.manualBlock = false;\r\n\t}\r\n}\r\n\r\nPrint.moduleName = \"print\";\r\n\r\nexport default Print;","import Module from '../../core/Module.js';\r\n\r\nclass ReactiveData extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.data = false;\r\n\t\tthis.blocked = false; //block reactivity while performing update\r\n\t\tthis.origFuncs = {}; // hold original data array functions to allow replacement after data is done with\r\n\t\tthis.currentVersion = 0;\r\n\r\n\t\tthis.registerTableOption(\"reactiveData\", false); //enable data reactivity\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.reactiveData){\r\n\t\t\tthis.subscribe(\"cell-value-save-before\", this.block.bind(this));\r\n\t\t\tthis.subscribe(\"cell-value-save-after\", this.unblock.bind(this));\r\n\t\t\tthis.subscribe(\"row-data-save-before\", this.block.bind(this));\r\n\t\t\tthis.subscribe(\"row-data-save-after\", this.unblock.bind(this));\r\n\t\t\tthis.subscribe(\"row-data-init-after\", this.watchRow.bind(this));\r\n\t\t\tthis.subscribe(\"data-processing\", this.watchData.bind(this));\r\n\t\t\tthis.subscribe(\"table-destroy\", this.unwatchData.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\twatchData(data){\r\n\t\tvar self = this,\r\n\t\tpushFunc, version;\r\n\r\n\t\tthis.currentVersion ++;\r\n\r\n\t\tversion = this.currentVersion;\r\n\r\n\t\tthis.unwatchData();\r\n\r\n\t\tthis.data = data;\r\n\r\n\t\t//override array push function\r\n\t\tthis.origFuncs.push = data.push;\r\n\r\n\t\tObject.defineProperty(this.data, \"push\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments);\r\n\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\targs.forEach((arg) => {\r\n\t\t\t\t\t\tself.table.rowManager.addRowActual(arg, false);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.origFuncs.push.apply(data, arguments);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t//override array unshift function\r\n\t\tthis.origFuncs.unshift = data.unshift;\r\n\r\n\t\tObject.defineProperty(this.data, \"unshift\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments);\r\n\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\targs.forEach((arg) => {\r\n\t\t\t\t\t\tself.table.rowManager.addRowActual(arg, true);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.origFuncs.unshift.apply(data, arguments);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\t//override array shift function\r\n\t\tthis.origFuncs.shift = data.shift;\r\n\r\n\t\tObject.defineProperty(this.data, \"shift\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar row;\r\n\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tif(self.data.length){\r\n\t\t\t\t\t\trow = self.table.rowManager.getRowFromDataObject(self.data[0]);\r\n\r\n\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\trow.deleteActual();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.origFuncs.shift.call(data);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t//override array pop function\r\n\t\tthis.origFuncs.pop = data.pop;\r\n\r\n\t\tObject.defineProperty(this.data, \"pop\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar row;\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tif(self.data.length){\r\n\t\t\t\t\t\trow = self.table.rowManager.getRowFromDataObject(self.data[self.data.length - 1]);\r\n\r\n\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\trow.deleteActual();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn self.origFuncs.pop.call(data);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\t//override array splice function\r\n\t\tthis.origFuncs.splice = data.splice;\r\n\r\n\t\tObject.defineProperty(this.data, \"splice\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments),\r\n\t\t\t\tstart = args[0] < 0 ? data.length + args[0] : args[0],\r\n\t\t\t\tend = args[1],\r\n\t\t\t\tnewRows = args[2] ? args.slice(2) : false,\r\n\t\t\t\tstartRow;\r\n\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\r\n\t\t\t\t\t//add new rows\r\n\t\t\t\t\tif(newRows){\r\n\t\t\t\t\t\tstartRow = data[start] ? self.table.rowManager.getRowFromDataObject(data[start]) : false;\r\n\r\n\t\t\t\t\t\tif(startRow){\r\n\t\t\t\t\t\t\tnewRows.forEach((rowData) => {\r\n\t\t\t\t\t\t\t\tself.table.rowManager.addRowActual(rowData, true, startRow, true);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnewRows = newRows.slice().reverse();\r\n\r\n\t\t\t\t\t\t\tnewRows.forEach((rowData) => {\r\n\t\t\t\t\t\t\t\tself.table.rowManager.addRowActual(rowData, true, false, true);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//delete removed rows\r\n\t\t\t\t\tif(end !== 0){\r\n\t\t\t\t\t\tvar oldRows = data.slice(start, typeof args[1] === \"undefined\" ? args[1] : start + end);\r\n\r\n\t\t\t\t\t\toldRows.forEach((rowData, i) => {\r\n\t\t\t\t\t\t\tvar row = self.table.rowManager.getRowFromDataObject(rowData);\r\n\r\n\t\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\t\trow.deleteActual(i !== oldRows.length - 1);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(newRows || end !== 0){\r\n\t\t\t\t\t\tself.table.rowManager.reRenderInPosition();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.origFuncs.splice.apply(data, arguments);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tunwatchData(){\r\n\t\tif(this.data !== false){\r\n\t\t\tfor(var key in this.origFuncs){\r\n\t\t\t\tObject.defineProperty(this.data, key, {\r\n\t\t\t\t\tenumerable: true,\r\n\t\t\t\t\tconfigurable:true,\r\n\t\t\t\t\twritable:true,\r\n\t\t\t\t\tvalue: this.origFuncs.key,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\twatchRow(row){\r\n\t\tvar data = row.getData();\r\n\r\n\t\tthis.blocked = true;\r\n\r\n\t\tfor(var key in data){\r\n\t\t\tthis.watchKey(row, data, key);\r\n\t\t}\r\n\r\n\t\tif(this.table.options.dataTree){\r\n\t\t\tthis.watchTreeChildren(row);\r\n\t\t}\r\n\r\n\t\tthis.blocked = false;\r\n\t}\r\n\r\n\twatchTreeChildren (row){\r\n\t\tvar childField = row.getData()[this.table.options.dataTreeChildField],\r\n\t\torigFuncs = {};\r\n\r\n\t\tfunction rebuildTree(){\r\n\t\t\tthis.table.modules.dataTree.initializeRow(row);\r\n\t\t\tthis.table.modules.dataTree.layoutRow(row);\r\n\t\t\tthis.table.rowManager.refreshActiveData(\"tree\", false, true);\r\n\t\t}\r\n\r\n\t\tif(childField){\r\n\r\n\t\t\torigFuncs.push = childField.push;\r\n\r\n\t\t\tObject.defineProperty(childField, \"push\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tvar result = origFuncs.push.apply(childField, arguments);\r\n\r\n\t\t\t\t\trebuildTree();\r\n\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\torigFuncs.unshift = childField.unshift;\r\n\r\n\t\t\tObject.defineProperty(childField, \"unshift\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tvar result = origFuncs.unshift.apply(childField, arguments);\r\n\r\n\t\t\t\t\trebuildTree();\r\n\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\torigFuncs.shift = childField.shift;\r\n\r\n\t\t\tObject.defineProperty(childField, \"shift\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tvar result = origFuncs.shift.call(childField);\r\n\r\n\t\t\t\t\trebuildTree();\r\n\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\torigFuncs.pop = childField.pop;\r\n\r\n\t\t\tObject.defineProperty(childField, \"pop\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tvar result = origFuncs.pop.call(childField);\r\n\r\n\t\t\t\t\trebuildTree();\r\n\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\torigFuncs.splice = childField.splice;\r\n\r\n\t\t\tObject.defineProperty(childField, \"splice\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tvar result = origFuncs.splice.apply(childField, arguments);\r\n\r\n\t\t\t\t\trebuildTree();\r\n\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\twatchKey(row, data, key){\r\n\t\tvar props = Object.getOwnPropertyDescriptor(data, key),\r\n\t\tvalue = data[key],\r\n\t\tversion = this.currentVersion;\r\n\r\n\t\tObject.defineProperty(data, key, {\r\n\t\t\tset: (newValue) => {\r\n\t\t\t\tvalue = newValue;\r\n\t\t\t\tif(!this.blocked && version === this.currentVersion){\r\n\t\t\t\t\tvar update = {};\r\n\t\t\t\t\tupdate[key] = newValue;\r\n\t\t\t\t\trow.updateData(update);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(props.set){\r\n\t\t\t\t\tprops.set(newValue);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tget:() => {\r\n\r\n\t\t\t\tif(props.get){\r\n\t\t\t\t\tprops.get();\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn value;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tunwatchRow(row){\r\n\t\tvar data = row.getData();\r\n\r\n\t\tfor(var key in data){\r\n\t\t\tObject.defineProperty(data, key, {\r\n\t\t\t\tvalue:data[key],\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tblock(){\r\n\t\tthis.blocked = true;\r\n\t}\r\n\r\n\tunblock(){\r\n\t\tthis.blocked = false;\r\n\t}\r\n}\r\n\r\nReactiveData.moduleName = \"reactiveData\";\r\n\r\nexport default ReactiveData;\r\n\r\n\r\n\r\n","import Module from '../../core/Module.js';\r\n\r\nclass ResizeColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.startColumn = false;\r\n\t\tthis.startX = false;\r\n\t\tthis.startWidth = false;\r\n\t\tthis.latestX = false;\r\n\t\tthis.handle = null;\r\n\t\tthis.initialNextColumn = null;\r\n\t\tthis.nextColumn = null;\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.registerColumnOption(\"resizable\", true);\r\n\t\tthis.registerTableOption(\"resizableColumnFit\", false);\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-rendered\", this.layoutColumnHeader.bind(this));\r\n\t}\r\n\t\r\n\tinitializeEventWatchers(){\r\n\t\tif(!this.initialized){\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-rendered\", this.layoutCellHandles.bind(this));\r\n\t\t\tthis.subscribe(\"cell-delete\", this.deInitializeComponent.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-height\", this.resizeHandle.bind(this));\r\n\t\t\tthis.subscribe(\"column-moved\", this.columnLayoutUpdated.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-hide\", this.deInitializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"column-show\", this.columnLayoutUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"column-width\", this.columnWidthUpdated.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-delete\", this.deInitializeComponent.bind(this));\r\n\t\t\tthis.subscribe(\"column-height\", this.resizeHandle.bind(this));\r\n\t\t\t\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\tlayoutCellHandles(cell){\r\n\t\tif(cell.row.type === \"row\"){\r\n\t\t\tthis.deInitializeComponent(cell);\r\n\t\t\tthis.initializeColumn(\"cell\", cell, cell.column, cell.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tlayoutColumnHeader(column){\r\n\t\tif(column.definition.resizable){\r\n\t\t\tthis.initializeEventWatchers();\r\n\t\t\tthis.deInitializeComponent(column);\r\n\t\t\tthis.initializeColumn(\"header\", column, column, column.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolumnLayoutUpdated(column){\r\n\t\tvar prev = column.prevColumn();\r\n\t\t\r\n\t\tthis.reinitializeColumn(column);\r\n\t\t\r\n\t\tif(prev){\r\n\t\t\tthis.reinitializeColumn(prev);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolumnWidthUpdated(column){\r\n\t\tif(column.modules.frozen){\r\n\t\t\tif(this.table.modules.frozenColumns.leftColumns.includes(column)){\r\n\t\t\t\tthis.table.modules.frozenColumns.leftColumns.forEach((col) => {\r\n\t\t\t\t\tthis.reinitializeColumn(col);\r\n\t\t\t\t});\r\n\t\t\t}else if(this.table.modules.frozenColumns.rightColumns.includes(column)){\r\n\t\t\t\tthis.table.modules.frozenColumns.rightColumns.forEach((col) => {\r\n\t\t\t\t\tthis.reinitializeColumn(col);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeColumn(column){\r\n\t\tvar frozenOffset = column.modules.frozen ? (column.modules.frozen.marginValue + column.getWidth() + \"px\") : false;\r\n\t\t;\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tif(cell.modules.resize && cell.modules.resize.handleEl){\r\n\t\t\t\tif(frozenOffset){\r\n\t\t\t\t\tcell.modules.resize.handleEl.style.left = frozenOffset;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcell.element.after(cell.modules.resize.handleEl);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(column.modules.resize && column.modules.resize.handleEl){\r\n\t\t\tif(frozenOffset){\r\n\t\t\t\tcolumn.modules.resize.handleEl.style.left = frozenOffset;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.element.after(column.modules.resize.handleEl);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(type, component, column, element){\r\n\t\tvar self = this,\r\n\t\tvariableHeight = false,\r\n\t\tmode = column.definition.resizable,\r\n\t\tconfig = {},\r\n\t\tnearestColumn = column.getLastColumn();\r\n\t\t\r\n\t\t//set column resize mode\r\n\t\tif(type === \"header\"){\r\n\t\t\tvariableHeight = column.definition.formatter == \"textarea\" || column.definition.variableHeight;\r\n\t\t\tconfig = {variableHeight:variableHeight};\r\n\t\t}\r\n\t\t\r\n\t\tif((mode === true || mode == type) && this._checkResizability(nearestColumn)){\r\n\t\t\t\r\n\t\t\tvar handle = document.createElement('span');\r\n\t\t\thandle.className = \"tabulator-col-resize-handle\";\r\n\t\t\t\r\n\t\t\thandle.addEventListener(\"click\", function(e){\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tvar handleDown = function(e){\r\n\t\t\t\tself.startColumn = column;\r\n\t\t\t\tself.initialNextColumn = self.nextColumn = nearestColumn.nextColumn();\r\n\t\t\t\tself._mouseDown(e, nearestColumn, handle);\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\thandle.addEventListener(\"mousedown\", handleDown);\r\n\t\t\thandle.addEventListener(\"touchstart\", handleDown, {passive: true});\r\n\t\t\t\r\n\t\t\t//resize column on double click\r\n\t\t\thandle.addEventListener(\"dblclick\", (e) => {\r\n\t\t\t\tvar oldWidth = nearestColumn.getWidth();\r\n\t\t\t\t\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tnearestColumn.reinitializeWidth(true);\r\n\t\t\t\t\r\n\t\t\t\tif(oldWidth !== nearestColumn.getWidth()){\r\n\t\t\t\t\tself.dispatch(\"column-resized\", nearestColumn);\r\n\t\t\t\t\tself.table.externalEvents.dispatch(\"columnResized\", nearestColumn.getComponent());\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(column.modules.frozen){\r\n\t\t\t\thandle.style.position = \"absolute\";\r\n\t\t\t\thandle.style.left = column.modules.frozen.marginValue + column.getWidth() + \"px\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconfig.handleEl = handle;\r\n\t\t\t\r\n\t\t\tif(element.parentNode && column.visible){\r\n\t\t\t\telement.after(handle);\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcomponent.modules.resize = config;\r\n\t}\r\n\t\r\n\tdeInitializeColumn(column){\r\n\t\tthis.deInitializeComponent(column);\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tthis.deInitializeComponent(cell);\r\n\t\t});\r\n\t}\r\n\t\r\n\tdeInitializeComponent(component){\r\n\t\tvar handleEl;\r\n\t\t\r\n\t\tif(component.modules.resize){\r\n\t\t\thandleEl = component.modules.resize.handleEl;\r\n\t\t\t\r\n\t\t\tif(handleEl && handleEl.parentElement){\r\n\t\t\t\thandleEl.parentElement.removeChild(handleEl);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tresizeHandle(component, height){\r\n\t\tif(component.modules.resize && component.modules.resize.handleEl){\r\n\t\t\tcomponent.modules.resize.handleEl.style.height = height;\r\n\t\t}\r\n\t}\r\n\t\r\n\t_checkResizability(column){\r\n\t\treturn column.definition.resizable;\r\n\t}\r\n\t\r\n\t_mouseDown(e, column, handle){\r\n\t\tvar self = this;\r\n\t\t\r\n\t\tself.table.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\tfunction mouseMove(e){\r\n\t\t\tvar x = typeof e.screenX === \"undefined\" ? e.touches[0].screenX : e.screenX,\r\n\t\t\tstartDiff = x - self.startX,\r\n\t\t\tmoveDiff = x - self.latestX,\r\n\t\t\tblockedBefore, blockedAfter;\r\n\t\t\t\r\n\t\t\tself.latestX = x;\r\n\t\t\t\r\n\t\t\tif(self.table.rtl){\r\n\t\t\t\tstartDiff = -startDiff;\r\n\t\t\t\tmoveDiff = -moveDiff;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tblockedBefore = column.width == column.minWidth || column.width == column.maxWidth;\r\n\t\t\t\r\n\t\t\tcolumn.setWidth(self.startWidth + startDiff);\r\n\t\t\t\r\n\t\t\tblockedAfter = column.width == column.minWidth || column.width == column.maxWidth;\r\n\t\t\t\r\n\t\t\tif(moveDiff < 0){\r\n\t\t\t\tself.nextColumn = self.initialNextColumn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(self.table.options.resizableColumnFit && self.nextColumn && !(blockedBefore && blockedAfter)){\r\n\t\t\t\tlet colWidth = self.nextColumn.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tif(moveDiff > 0){\r\n\t\t\t\t\tif(colWidth <= self.nextColumn.minWidth){\r\n\t\t\t\t\t\tself.nextColumn = self.nextColumn.nextColumn();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(self.nextColumn){\r\n\t\t\t\t\tself.nextColumn.setWidth(self.nextColumn.getWidth() - moveDiff);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tself.table.columnManager.renderer.rerenderColumns(true);\r\n\t\t\t\r\n\t\t\tif(!self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight){\r\n\t\t\t\tcolumn.checkCellHeights();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfunction mouseUp(e){\r\n\t\t\t\r\n\t\t\t//block editor from taking action while resizing is taking place\r\n\t\t\tif(self.startColumn.modules.edit){\r\n\t\t\t\tself.startColumn.modules.edit.blocked = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight){\r\n\t\t\t\tcolumn.checkCellHeights();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", mouseUp);\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", mouseMove);\r\n\t\t\t\r\n\t\t\thandle.removeEventListener(\"touchmove\", mouseMove);\r\n\t\t\thandle.removeEventListener(\"touchend\", mouseUp);\r\n\t\t\t\r\n\t\t\tself.table.element.classList.remove(\"tabulator-block-select\");\r\n\t\t\t\r\n\t\t\tif(self.startWidth !== column.getWidth()){\r\n\t\t\t\tself.dispatch(\"column-resized\", column);\r\n\t\t\t\tself.table.externalEvents.dispatch(\"columnResized\", column.getComponent());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\te.stopPropagation(); //prevent resize from interfereing with movable columns\r\n\t\t\r\n\t\t//block editor from taking action while resizing is taking place\r\n\t\tif(self.startColumn.modules.edit){\r\n\t\t\tself.startColumn.modules.edit.blocked = true;\r\n\t\t}\r\n\t\t\r\n\t\tself.startX = typeof e.screenX === \"undefined\" ? e.touches[0].screenX : e.screenX;\r\n\t\tself.latestX = self.startX;\r\n\t\tself.startWidth = column.getWidth();\r\n\t\t\r\n\t\tdocument.body.addEventListener(\"mousemove\", mouseMove);\r\n\t\tdocument.body.addEventListener(\"mouseup\", mouseUp);\r\n\t\thandle.addEventListener(\"touchmove\", mouseMove, {passive: true});\r\n\t\thandle.addEventListener(\"touchend\", mouseUp);\r\n\t}\r\n}\r\n\r\nResizeColumns.moduleName = \"resizeColumns\";\r\n\r\nexport default ResizeColumns;","import Module from '../../core/Module.js';\r\n\r\nclass ResizeRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.startColumn = false;\r\n\t\tthis.startY = false;\r\n\t\tthis.startHeight = false;\r\n\t\tthis.handle = null;\r\n\t\tthis.prevHandle = null;\r\n\r\n\t\tthis.registerTableOption(\"resizableRows\", false); //resizable rows\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.resizableRows){\r\n\t\t\tthis.subscribe(\"row-layout-after\", this.initializeRow.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\trowEl = row.getElement();\r\n\r\n\t\tvar handle = document.createElement('div');\r\n\t\thandle.className = \"tabulator-row-resize-handle\";\r\n\r\n\t\tvar prevHandle = document.createElement('div');\r\n\t\tprevHandle.className = \"tabulator-row-resize-handle prev\";\r\n\r\n\t\thandle.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tvar handleDown = function(e){\r\n\t\t\tself.startRow = row;\r\n\t\t\tself._mouseDown(e, row, handle);\r\n\t\t};\r\n\r\n\t\thandle.addEventListener(\"mousedown\", handleDown);\r\n\t\thandle.addEventListener(\"touchstart\", handleDown, {passive: true});\r\n\r\n\t\tprevHandle.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tvar prevHandleDown = function(e){\r\n\t\t\tvar prevRow = self.table.rowManager.prevDisplayRow(row);\r\n\r\n\t\t\tif(prevRow){\r\n\t\t\t\tself.startRow = prevRow;\r\n\t\t\t\tself._mouseDown(e, prevRow, prevHandle);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tprevHandle.addEventListener(\"mousedown\",prevHandleDown);\r\n\t\tprevHandle.addEventListener(\"touchstart\",prevHandleDown, {passive: true});\r\n\r\n\t\trowEl.appendChild(handle);\r\n\t\trowEl.appendChild(prevHandle);\r\n\t}\r\n\r\n\t_mouseDown(e, row, handle){\r\n\t\tvar self = this;\r\n\r\n\t\tself.table.element.classList.add(\"tabulator-block-select\");\r\n\r\n\t\tfunction mouseMove(e){\r\n\t\t\trow.setHeight(self.startHeight + ((typeof e.screenY === \"undefined\" ? e.touches[0].screenY : e.screenY) - self.startY));\r\n\t\t}\r\n\r\n\t\tfunction mouseUp(e){\r\n\r\n\t\t\t// //block editor from taking action while resizing is taking place\r\n\t\t\t// if(self.startColumn.modules.edit){\r\n\t\t\t// \tself.startColumn.modules.edit.blocked = false;\r\n\t\t\t// }\r\n\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", mouseMove);\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", mouseMove);\r\n\r\n\t\t\thandle.removeEventListener(\"touchmove\", mouseMove);\r\n\t\t\thandle.removeEventListener(\"touchend\", mouseUp);\r\n\r\n\t\t\tself.table.element.classList.remove(\"tabulator-block-select\");\r\n\r\n\t\t\tself.dispatchExternal(\"rowResized\", row.getComponent());\r\n\t\t}\r\n\r\n\t\te.stopPropagation(); //prevent resize from interfereing with movable columns\r\n\r\n\t\t//block editor from taking action while resizing is taking place\r\n\t\t// if(self.startColumn.modules.edit){\r\n\t\t// \tself.startColumn.modules.edit.blocked = true;\r\n\t\t// }\r\n\r\n\t\tself.startY = typeof e.screenY === \"undefined\" ? e.touches[0].screenY : e.screenY;\r\n\t\tself.startHeight = row.getHeight();\r\n\r\n\t\tdocument.body.addEventListener(\"mousemove\", mouseMove);\r\n\t\tdocument.body.addEventListener(\"mouseup\", mouseUp);\r\n\r\n\t\thandle.addEventListener(\"touchmove\", mouseMove, {passive: true});\r\n\t\thandle.addEventListener(\"touchend\", mouseUp);\r\n\t}\r\n}\r\n\r\nResizeRows.moduleName = \"resizeRows\";\r\n\r\nexport default ResizeRows;","import Module from '../../core/Module.js';\r\n\r\nclass ResizeTable extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.binding = false;\r\n\t\tthis.observer = false;\r\n\t\tthis.containerObserver = false;\r\n\r\n\t\tthis.tableHeight = 0;\r\n\t\tthis.tableWidth = 0;\r\n\t\tthis.containerHeight = 0;\r\n\t\tthis.containerWidth = 0;\r\n\r\n\t\tthis.autoResize = false;\r\n\r\n\t\tthis.registerTableOption(\"autoResize\", true); //auto resize table\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.autoResize){\r\n\t\t\tvar table = this.table,\r\n\t\t\ttableStyle;\r\n\r\n\t\t\tthis.tableHeight = table.element.clientHeight;\r\n\t\t\tthis.tableWidth = table.element.clientWidth;\r\n\r\n\t\t\tif(table.element.parentNode){\r\n\t\t\t\tthis.containerHeight = table.element.parentNode.clientHeight;\r\n\t\t\t\tthis.containerWidth = table.element.parentNode.clientWidth;\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof ResizeObserver !== \"undefined\" && table.rowManager.getRenderMode() === \"virtual\"){\r\n\r\n\t\t\t\tthis.autoResize = true;\r\n\r\n\t\t\t\tthis.observer = new ResizeObserver((entry) => {\r\n\t\t\t\t\tif(!table.browserMobile || (table.browserMobile &&!table.modules.edit.currentCell)){\r\n\r\n\t\t\t\t\t\tvar nodeHeight = Math.floor(entry[0].contentRect.height);\r\n\t\t\t\t\t\tvar nodeWidth = Math.floor(entry[0].contentRect.width);\r\n\r\n\t\t\t\t\t\tif(this.tableHeight != nodeHeight || this.tableWidth != nodeWidth){\r\n\t\t\t\t\t\t\tthis.tableHeight = nodeHeight;\r\n\t\t\t\t\t\t\tthis.tableWidth = nodeWidth;\r\n\r\n\t\t\t\t\t\t\tif(table.element.parentNode){\r\n\t\t\t\t\t\t\t\tthis.containerHeight = table.element.parentNode.clientHeight;\r\n\t\t\t\t\t\t\t\tthis.containerWidth = table.element.parentNode.clientWidth;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tthis.table.columnManager.renderer.rerenderColumns(true);\r\n\r\n\t\t\t\t\t\t\ttable.redraw();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.observer.observe(table.element);\r\n\r\n\t\t\t\ttableStyle = window.getComputedStyle(table.element);\r\n\r\n\t\t\t\tif(this.table.element.parentNode && !this.table.rowManager.fixedHeight && (tableStyle.getPropertyValue(\"max-height\") || tableStyle.getPropertyValue(\"min-height\"))){\r\n\r\n\t\t\t\t\tthis.containerObserver = new ResizeObserver((entry) => {\r\n\t\t\t\t\t\tif(!table.browserMobile || (table.browserMobile &&!table.modules.edit.currentCell)){\r\n\r\n\t\t\t\t\t\t\tvar nodeHeight = Math.floor(entry[0].contentRect.height);\r\n\t\t\t\t\t\t\tvar nodeWidth = Math.floor(entry[0].contentRect.width);\r\n\r\n\t\t\t\t\t\t\tif(this.containerHeight != nodeHeight || this.containerWidth != nodeWidth){\r\n\t\t\t\t\t\t\t\tthis.containerHeight = nodeHeight;\r\n\t\t\t\t\t\t\t\tthis.containerWidth = nodeWidth;\r\n\t\t\t\t\t\t\t\tthis.tableHeight = table.element.clientHeight;\r\n\t\t\t\t\t\t\t\tthis.tableWidth = table.element.clientWidth;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\ttable.columnManager.renderer.rerenderColumns(true);\r\n\r\n\t\t\t\t\t\t\ttable.redraw();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tthis.containerObserver.observe(this.table.element.parentNode);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.subscribe(\"table-resize\", this.tableResized.bind(this));\r\n\r\n\t\t\t}else{\r\n\t\t\t\tthis.binding = function(){\r\n\t\t\t\t\tif(!table.browserMobile || (table.browserMobile && !table.modules.edit.currentCell)){\r\n\r\n\t\t\t\t\t\ttable.columnManager.renderer.rerenderColumns(true);\r\n\r\n\t\t\t\t\t\ttable.redraw();\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\r\n\t\t\t\twindow.addEventListener(\"resize\", this.binding);\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"table-destroy\", this.clearBindings.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\ttableResized(){\r\n\t\tthis.table.rowManager.redraw();\r\n\t}\r\n\r\n\tclearBindings(){\r\n\t\tif(this.binding){\r\n\t\t\twindow.removeEventListener(\"resize\", this.binding);\r\n\t\t}\r\n\r\n\t\tif(this.observer){\r\n\t\t\tthis.observer.unobserve(this.table.element);\r\n\t\t}\r\n\r\n\t\tif(this.containerObserver){\r\n\t\t\tthis.containerObserver.unobserve(this.table.element.parentNode);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nResizeTable.moduleName = \"resizeTable\";\r\n\r\nexport default ResizeTable;","import Module from '../../core/Module.js';\r\n\r\nclass ResponsiveLayout extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.columns = [];\r\n\t\tthis.hiddenColumns = [];\r\n\t\tthis.mode = \"\";\r\n\t\tthis.index = 0;\r\n\t\tthis.collapseFormatter = [];\r\n\t\tthis.collapseStartOpen = true;\r\n\t\tthis.collapseHandleColumn = false;\r\n\r\n\t\tthis.registerTableOption(\"responsiveLayout\", false); //responsive layout flags\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseStartOpen\", true); //start showing collapsed data\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseUseFormatters\", true); //responsive layout collapse formatter\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseFormatter\", false); //responsive layout collapse formatter\r\n\r\n\t\tthis.registerColumnOption(\"responsive\");\r\n\t}\r\n\r\n\t//generate responsive columns list\r\n\tinitialize(){\r\n\t\tvar self = this,\r\n\t\tcolumns = [];\r\n\r\n\t\tif(this.table.options.responsiveLayout){\r\n\t\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"column-show\", this.updateColumnVisibility.bind(this));\r\n\t\t\tthis.subscribe(\"column-hide\", this.updateColumnVisibility.bind(this));\r\n\t\t\tthis.subscribe(\"columns-loaded\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-moved\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-add\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-delete\", this.initializeResponsivity.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"table-redrawing\", this.tableRedraw.bind(this));\r\n\r\n\t\t\tif(this.table.options.responsiveLayout === \"collapse\"){\r\n\t\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\t\tthis.subscribe(\"row-layout\", this.layoutRow.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tif([\"fitColumns\", \"fitDataStretch\"].indexOf(this.layoutMode()) === -1){\r\n\t\t\tif(!force){\r\n\t\t\t\tthis.update();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeResponsivity(){\r\n\t\tvar columns = [];\r\n\r\n\t\tthis.mode = this.table.options.responsiveLayout;\r\n\t\tthis.collapseFormatter = this.table.options.responsiveLayoutCollapseFormatter || this.formatCollapsedData;\r\n\t\tthis.collapseStartOpen = this.table.options.responsiveLayoutCollapseStartOpen;\r\n\t\tthis.hiddenColumns = [];\r\n\r\n\t\t//determine level of responsivity for each column\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column, i) => {\r\n\t\t\tif(column.modules.responsive){\r\n\t\t\t\tif(column.modules.responsive.order && column.modules.responsive.visible){\r\n\t\t\t\t\tcolumn.modules.responsive.index = i;\r\n\t\t\t\t\tcolumns.push(column);\r\n\r\n\t\t\t\t\tif(!column.visible && this.mode === \"collapse\"){\r\n\t\t\t\t\t\tthis.hiddenColumns.push(column);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t//sort list by responsivity\r\n\t\tcolumns = columns.reverse();\r\n\t\tcolumns = columns.sort((a, b) => {\r\n\t\t\tvar diff = b.modules.responsive.order - a.modules.responsive.order;\r\n\t\t\treturn diff || (b.modules.responsive.index - a.modules.responsive.index);\r\n\t\t});\r\n\r\n\t\tthis.columns = columns;\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tthis.generateCollapsedContent();\r\n\t\t}\r\n\r\n\t\t//assign collapse column\r\n\t\tfor (let col of this.table.columnManager.columnsByIndex){\r\n\t\t\tif(col.definition.formatter == \"responsiveCollapse\"){\r\n\t\t\t\tthis.collapseHandleColumn = col;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this.collapseHandleColumn){\r\n\t\t\tif(this.hiddenColumns.length){\r\n\t\t\t\tthis.collapseHandleColumn.show();\r\n\t\t\t}else{\r\n\t\t\t\tthis.collapseHandleColumn.hide();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//define layout information\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.getDefinition();\r\n\r\n\t\tcolumn.modules.responsive = {order: typeof def.responsive === \"undefined\" ? 1 : def.responsive, visible:def.visible === false ? false : true};\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar el;\r\n\r\n\t\tif(row.type !== \"calc\"){\r\n\t\t\tel = document.createElement(\"div\");\r\n\t\t\tel.classList.add(\"tabulator-responsive-collapse\");\r\n\r\n\t\t\trow.modules.responsiveLayout = {\r\n\t\t\t\telement:el,\r\n\t\t\t\topen:this.collapseStartOpen,\r\n\t\t\t};\r\n\r\n\t\t\tif(!this.collapseStartOpen){\r\n\t\t\t\tel.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tlayoutRow(row){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tif(row.modules.responsiveLayout){\r\n\t\t\trowEl.appendChild(row.modules.responsiveLayout.element);\r\n\t\t\tthis.generateCollapsedRowContent(row);\r\n\t\t}\r\n\t}\r\n\r\n\t//update column visibility\r\n\tupdateColumnVisibility(column, responsiveToggle){\r\n\t\tif(!responsiveToggle && column.modules.responsive){\r\n\t\t\tcolumn.modules.responsive.visible = column.visible;\r\n\t\t\tthis.initializeResponsivity();\r\n\t\t}\r\n\t}\r\n\r\n\thideColumn(column){\r\n\t\tvar colCount = this.hiddenColumns.length;\r\n\r\n\t\tcolumn.hide(false, true);\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tthis.hiddenColumns.unshift(column);\r\n\t\t\tthis.generateCollapsedContent();\r\n\r\n\t\t\tif(this.collapseHandleColumn && !colCount){\r\n\t\t\t\tthis.collapseHandleColumn.show();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tshowColumn(column){\r\n\t\tvar index;\r\n\r\n\t\tcolumn.show(false, true);\r\n\t\t//set column width to prevent calculation loops on uninitialized columns\r\n\t\tcolumn.setWidth(column.getWidth());\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tindex = this.hiddenColumns.indexOf(column);\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.hiddenColumns.splice(index, 1);\r\n\t\t\t}\r\n\r\n\t\t\tthis.generateCollapsedContent();\r\n\r\n\t\t\tif(this.collapseHandleColumn && !this.hiddenColumns.length){\r\n\t\t\t\tthis.collapseHandleColumn.hide();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//redraw columns to fit space\r\n\tupdate(){\r\n\t\tvar self = this,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\r\n\t\t\tlet width = self.table.modules.layout.getMode() == \"fitColumns\" ? self.table.columnManager.getFlexBaseWidth() : self.table.columnManager.getWidth();\r\n\r\n\t\t\tlet diff = (self.table.options.headerVisible ? self.table.columnManager.element.clientWidth : self.table.element.clientWidth) - width;\r\n\r\n\t\t\tif(diff < 0){\r\n\t\t\t\t//table is too wide\r\n\t\t\t\tlet column = self.columns[self.index];\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tself.hideColumn(column);\r\n\t\t\t\t\tself.index ++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\r\n\t\t\t\t//table has spare space\r\n\t\t\t\tlet column = self.columns[self.index -1];\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tif(diff > 0){\r\n\t\t\t\t\t\tif(diff >= column.getWidth()){\r\n\t\t\t\t\t\t\tself.showColumn(column);\r\n\t\t\t\t\t\t\tself.index --;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tworking = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tworking = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(!self.table.rowManager.activeRowsCount){\r\n\t\t\t\tself.table.rowManager.renderEmptyScroll();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateCollapsedContent(){\r\n\t\tvar self = this,\r\n\t\trows = this.table.rowManager.getDisplayRows();\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\tself.generateCollapsedRowContent(row);\r\n\t\t});\r\n\t}\r\n\r\n\tgenerateCollapsedRowContent(row){\r\n\t\tvar el, contents;\r\n\r\n\t\tif(row.modules.responsiveLayout){\r\n\t\t\tel = row.modules.responsiveLayout.element;\r\n\r\n\t\t\twhile(el.firstChild) el.removeChild(el.firstChild);\r\n\r\n\t\t\tcontents = this.collapseFormatter(this.generateCollapsedRowData(row));\r\n\t\t\tif(contents){\r\n\t\t\t\tel.appendChild(contents);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateCollapsedRowData(row){\r\n\t\tvar self = this,\r\n\t\tdata = row.getData(),\r\n\t\toutput = [],\r\n\t\tmockCellComponent;\r\n\r\n\t\tthis.hiddenColumns.forEach(function(column){\r\n\t\t\tvar value = column.getFieldValue(data);\r\n\r\n\t\t\tif(column.definition.title && column.field){\r\n\t\t\t\tif(column.modules.format && self.table.options.responsiveLayoutCollapseUseFormatters){\r\n\r\n\t\t\t\t\tmockCellComponent = {\r\n\t\t\t\t\t\tvalue:false,\r\n\t\t\t\t\t\tdata:{},\r\n\t\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetData:function(){\r\n\t\t\t\t\t\t\treturn data;\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\t\treturn document.createElement(\"div\");\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\t\treturn row.getComponent();\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tfunction onRendered(callback){\r\n\t\t\t\t\t\tcallback();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\toutput.push({\r\n\t\t\t\t\t\tfield: column.field,\r\n\t\t\t\t\t\ttitle: column.definition.title,\r\n\t\t\t\t\t\tvalue: column.modules.format.formatter.call(self.table.modules.format, mockCellComponent, column.modules.format.params, onRendered)\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\toutput.push({\r\n\t\t\t\t\t\tfield: column.field,\r\n\t\t\t\t\t\ttitle: column.definition.title,\r\n\t\t\t\t\t\tvalue: value\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tformatCollapsedData(data){\r\n\t\tvar list = document.createElement(\"table\");\r\n\r\n\t\tdata.forEach(function(item){\r\n\t\t\tvar row = document.createElement(\"tr\");\r\n\t\t\tvar titleData = document.createElement(\"td\");\r\n\t\t\tvar valueData = document.createElement(\"td\");\r\n\t\t\tvar node_content;\r\n\r\n\t\t\tvar titleHighlight = document.createElement(\"strong\");\r\n\t\t\ttitleData.appendChild(titleHighlight);\r\n\t\t\tthis.langBind(\"columns|\" + item.field, function(text){\r\n\t\t\t\ttitleHighlight.innerHTML = text || item.title;\r\n\t\t\t});\r\n\r\n\t\t\tif(item.value instanceof Node){\r\n\t\t\t\tnode_content = document.createElement(\"div\");\r\n\t\t\t\tnode_content.appendChild(item.value);\r\n\t\t\t\tvalueData.appendChild(node_content);\r\n\t\t\t}else{\r\n\t\t\t\tvalueData.innerHTML = item.value;\r\n\t\t\t}\r\n\r\n\t\t\trow.appendChild(titleData);\r\n\t\t\trow.appendChild(valueData);\r\n\t\t\tlist.appendChild(row);\r\n\t\t}, this);\r\n\r\n\t\treturn Object.keys(data).length ? list : \"\";\r\n\t}\r\n}\r\n\r\nResponsiveLayout.moduleName = \"responsiveLayout\";\r\n\r\nexport default ResponsiveLayout;","import Module from '../../core/Module.js';\r\n\r\nclass SelectRow extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.selecting = false; //flag selecting in progress\r\n\t\tthis.lastClickedRow = false; //last clicked row\r\n\t\tthis.selectPrev = []; //hold previously selected element for drag drop selection\r\n\t\tthis.selectedRows = []; //hold selected rows\r\n\t\tthis.headerCheckboxElement = null; // hold header select element\r\n\t\t\r\n\t\tthis.registerTableOption(\"selectable\", \"highlight\"); //highlight rows on hover\r\n\t\tthis.registerTableOption(\"selectableRangeMode\", \"drag\"); //highlight rows on hover\r\n\t\tthis.registerTableOption(\"selectableRollingSelection\", true); //roll selection once maximum number of selectable rows is reached\r\n\t\tthis.registerTableOption(\"selectablePersistence\", true); // maintain selection when table view is updated\r\n\t\tthis.registerTableOption(\"selectableCheck\", function(data, row){return true;}); //check wheather row is selectable\r\n\t\t\r\n\t\tthis.registerTableFunction(\"selectRow\", this.selectRows.bind(this));\r\n\t\tthis.registerTableFunction(\"deselectRow\", this.deselectRows.bind(this));\r\n\t\tthis.registerTableFunction(\"toggleSelectRow\", this.toggleRow.bind(this));\r\n\t\tthis.registerTableFunction(\"getSelectedRows\", this.getSelectedRows.bind(this));\r\n\t\tthis.registerTableFunction(\"getSelectedData\", this.getSelectedData.bind(this));\r\n\t\t\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"select\", this.selectRows.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"deselect\", this.deselectRows.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"toggleSelect\", this.toggleRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isSelected\", this.isRowSelected.bind(this));\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.selectable !== false){\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleting\", this.rowDeleted.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.clearSelectionData.bind(this));\r\n\t\t\tthis.subscribe(\"rows-retrieve\", this.rowRetrieve.bind(this));\r\n\t\t\t\r\n\t\t\tif(this.table.options.selectable && !this.table.options.selectablePersistence){\r\n\t\t\t\tthis.subscribe(\"data-refreshing\", this.deselectRows.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trowRetrieve(type, prevValue){\r\n\t\treturn type === \"selected\" ? this.selectedRows : prevValue;\r\n\t}\r\n\t\r\n\trowDeleted(row){\r\n\t\tthis._deselectRow(row, true);\r\n\t}\r\n\t\r\n\tclearSelectionData(silent){\r\n\t\tthis.selecting = false;\r\n\t\tthis.lastClickedRow = false;\r\n\t\tthis.selectPrev = [];\r\n\t\tthis.selectedRows = [];\r\n\t\t\r\n\t\tif(silent !== true){\r\n\t\t\tthis._rowSelectionChanged();\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\telement = row.getElement();\r\n\t\t\r\n\t\t// trigger end of row selection\r\n\t\tvar endSelect = function(){\r\n\t\t\t\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tself.selecting = false;\r\n\t\t\t}, 50);\r\n\t\t\t\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", endSelect);\r\n\t\t};\r\n\t\t\r\n\t\trow.modules.select = {selected:false};\r\n\t\t\r\n\t\t//set row selection class\r\n\t\tif(self.table.options.selectableCheck.call(this.table, row.getComponent())){\r\n\t\t\telement.classList.add(\"tabulator-selectable\");\r\n\t\t\telement.classList.remove(\"tabulator-unselectable\");\r\n\t\t\t\r\n\t\t\tif(self.table.options.selectable && self.table.options.selectable != \"highlight\"){\r\n\t\t\t\tif(self.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\telement.addEventListener(\"click\", this.handleComplexRowClick.bind(this, row));\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.addEventListener(\"click\", function(e){\r\n\t\t\t\t\t\tif(!self.table.modExists(\"edit\") || !self.table.modules.edit.getCurrentCell()){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!self.selecting){\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\t\t\tif(e.shiftKey){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.selecting = true;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.selectPrev = [];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tdocument.body.addEventListener(\"mouseup\", endSelect);\r\n\t\t\t\t\t\t\tdocument.body.addEventListener(\"keyup\", endSelect);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mouseenter\", function(e){\r\n\t\t\t\t\t\tif(self.selecting){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(self.selectPrev[1] == row){\r\n\t\t\t\t\t\t\t\tself.toggleRow(self.selectPrev[0]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mouseout\", function(e){\r\n\t\t\t\t\t\tif(self.selecting){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\tself.selectPrev.unshift(row);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\telement.classList.add(\"tabulator-unselectable\");\r\n\t\t\telement.classList.remove(\"tabulator-selectable\");\r\n\t\t}\r\n\t}\r\n\t\r\n\thandleComplexRowClick(row, e){\r\n\t\tif(e.shiftKey){\r\n\t\t\tthis.table._clearSelection();\r\n\t\t\tthis.lastClickedRow = this.lastClickedRow || row;\r\n\t\t\t\r\n\t\t\tvar lastClickedRowIdx = this.table.rowManager.getDisplayRowIndex(this.lastClickedRow);\r\n\t\t\tvar rowIdx = this.table.rowManager.getDisplayRowIndex(row);\r\n\t\t\t\r\n\t\t\tvar fromRowIdx = lastClickedRowIdx <= rowIdx ? lastClickedRowIdx : rowIdx;\r\n\t\t\tvar toRowIdx = lastClickedRowIdx >= rowIdx ? lastClickedRowIdx : rowIdx;\r\n\t\t\t\r\n\t\t\tvar rows = this.table.rowManager.getDisplayRows().slice(0);\r\n\t\t\tvar toggledRows = rows.splice(fromRowIdx, toRowIdx - fromRowIdx + 1);\r\n\t\t\t\r\n\t\t\tif(e.ctrlKey || e.metaKey){\r\n\t\t\t\ttoggledRows.forEach((toggledRow)=>{\r\n\t\t\t\t\tif(toggledRow !== this.lastClickedRow){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.table.options.selectable !== true && !this.isRowSelected(row)){\r\n\t\t\t\t\t\t\tif(this.selectedRows.length < this.table.options.selectable){\r\n\t\t\t\t\t\t\t\tthis.toggleRow(toggledRow);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.toggleRow(toggledRow);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tthis.lastClickedRow = row;\r\n\t\t\t}else{\r\n\t\t\t\tthis.deselectRows(undefined, true);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.selectable !== true){\r\n\t\t\t\t\tif(toggledRows.length > this.table.options.selectable){\r\n\t\t\t\t\t\ttoggledRows = toggledRows.slice(0, this.table.options.selectable)\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.selectRows(toggledRows);\r\n\t\t\t}\r\n\t\t\tthis.table._clearSelection();\r\n\t\t}\r\n\t\telse if(e.ctrlKey || e.metaKey){\r\n\t\t\tthis.toggleRow(row);\r\n\t\t\tthis.lastClickedRow = row;\r\n\t\t}else{\r\n\t\t\tthis.deselectRows(undefined, true);\r\n\t\t\tthis.selectRows(row);\r\n\t\t\tthis.lastClickedRow = row;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//toggle row selection\r\n\ttoggleRow(row){\r\n\t\tif(this.table.options.selectableCheck.call(this.table, row.getComponent())){\r\n\t\t\tif(row.modules.select && row.modules.select.selected){\r\n\t\t\t\tthis._deselectRow(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis._selectRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//select a number of rows\r\n\tselectRows(rows){\r\n\t\tvar rowMatch;\r\n\t\t\r\n\t\tswitch(typeof rows){\r\n\t\t\tcase \"undefined\":\r\n\t\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis._rowSelectionChanged();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"string\":\r\n\t\t\t\r\n\t\t\trowMatch = this.table.rowManager.findRow(rows);\r\n\t\t\t\r\n\t\t\tif(rowMatch){\r\n\t\t\t\tthis._selectRow(rowMatch, true, true);\r\n\t\t\t}else{\r\n\t\t\t\tthis.table.rowManager.getRows(rows).forEach((row) => {\r\n\t\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._rowSelectionChanged();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\tif(Array.isArray(rows)){\r\n\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis._rowSelectionChanged();\r\n\t\t\t}else{\r\n\t\t\t\tthis._selectRow(rows, false, true);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//select an individual row\r\n\t_selectRow(rowInfo, silent, force){\r\n\t\tvar index;\r\n\t\t\r\n\t\t//handle max row count\r\n\t\tif(!isNaN(this.table.options.selectable) && this.table.options.selectable !== true && !force){\r\n\t\t\tif(this.selectedRows.length >= this.table.options.selectable){\r\n\t\t\t\tif(this.table.options.selectableRollingSelection){\r\n\t\t\t\t\tthis._deselectRow(this.selectedRows[0]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tvar row = this.table.rowManager.findRow(rowInfo);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\tif(this.selectedRows.indexOf(row) == -1){\r\n\t\t\t\trow.getElement().classList.add(\"tabulator-selected\");\r\n\t\t\t\tif(!row.modules.select){\r\n\t\t\t\t\trow.modules.select = {};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\trow.modules.select.selected = true;\r\n\t\t\t\tif(row.modules.select.checkboxEl){\r\n\t\t\t\t\trow.modules.select.checkboxEl.checked = true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.selectedRows.push(row);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.dataTreeSelectPropagate){\r\n\t\t\t\t\tthis.childRowSelection(row, true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatchExternal(\"rowSelected\", row.getComponent());\r\n\t\t\t\t\r\n\t\t\t\tthis._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Selection Error - No such row found, ignoring selection:\" + rowInfo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tisRowSelected(row){\r\n\t\treturn this.selectedRows.indexOf(row) !== -1;\r\n\t}\r\n\t\r\n\t//deselect a number of rows\r\n\tdeselectRows(rows, silent){\r\n\t\tvar self = this,\r\n\t\trowCount;\r\n\t\t\r\n\t\tif(typeof rows == \"undefined\"){\r\n\t\t\t\r\n\t\t\trowCount = self.selectedRows.length;\r\n\t\t\t\r\n\t\t\tfor(let i = 0; i < rowCount; i++){\r\n\t\t\t\tself._deselectRow(self.selectedRows[0], true);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(rowCount){\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tif(Array.isArray(rows)){\r\n\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\tself._deselectRow(row, true);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}else{\r\n\t\t\t\tself._deselectRow(rows, silent);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//deselect an individual row\r\n\t_deselectRow(rowInfo, silent){\r\n\t\tvar self = this,\r\n\t\trow = self.table.rowManager.findRow(rowInfo),\r\n\t\tindex;\r\n\t\t\r\n\t\tif(row){\r\n\t\t\tindex = self.selectedRows.findIndex(function(selectedRow){\r\n\t\t\t\treturn selectedRow == row;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\t\r\n\t\t\t\trow.getElement().classList.remove(\"tabulator-selected\");\r\n\t\t\t\tif(!row.modules.select){\r\n\t\t\t\t\trow.modules.select = {};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\trow.modules.select.selected = false;\r\n\t\t\t\tif(row.modules.select.checkboxEl){\r\n\t\t\t\t\trow.modules.select.checkboxEl.checked = false;\r\n\t\t\t\t}\r\n\t\t\t\tself.selectedRows.splice(index, 1);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.dataTreeSelectPropagate){\r\n\t\t\t\t\tthis.childRowSelection(row, false);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatchExternal(\"rowDeselected\", row.getComponent());\r\n\t\t\t\t\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Deselection Error - No such row found, ignoring selection:\" + rowInfo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetSelectedData(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tthis.selectedRows.forEach(function(row){\r\n\t\t\tdata.push(row.getData());\r\n\t\t});\r\n\t\t\r\n\t\treturn data;\r\n\t}\r\n\t\r\n\tgetSelectedRows(){\r\n\t\t\r\n\t\tvar rows = [];\r\n\t\t\r\n\t\tthis.selectedRows.forEach(function(row){\r\n\t\t\trows.push(row.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t_rowSelectionChanged(silent){\r\n\t\tif(this.headerCheckboxElement){\r\n\t\t\tif(this.selectedRows.length === 0){\r\n\t\t\t\tthis.headerCheckboxElement.checked = false;\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = false;\r\n\t\t\t} else if(this.table.rowManager.rows.length === this.selectedRows.length){\r\n\t\t\t\tthis.headerCheckboxElement.checked = true;\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = false;\r\n\t\t\t} else {\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = true;\r\n\t\t\t\tthis.headerCheckboxElement.checked = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(!silent){\r\n\t\t\tthis.dispatchExternal(\"rowSelectionChanged\", this.getSelectedData(), this.getSelectedRows());\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterRowSelectCheckbox (row, element) {\r\n\t\tif(!row._row.modules.select){\r\n\t\t\trow._row.modules.select = {};\r\n\t\t}\r\n\t\t\r\n\t\trow._row.modules.select.checkboxEl = element;\r\n\t}\r\n\t\r\n\tregisterHeaderSelectCheckbox (element) {\r\n\t\tthis.headerCheckboxElement = element;\r\n\t}\r\n\t\r\n\tchildRowSelection(row, select){\r\n\t\tvar children = this.table.modules.dataTree.getChildren(row, true);\r\n\t\t\r\n\t\tif(select){\r\n\t\t\tfor(let child of children){\r\n\t\t\t\tthis._selectRow(child, true);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tfor(let child of children){\r\n\t\t\t\tthis._deselectRow(child, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nSelectRow.moduleName = \"selectRow\";\r\n\r\nexport default SelectRow;","//sort numbers\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar decimal = params.decimalSeparator;\r\n\tvar thousand = params.thousandSeparator;\r\n\tvar emptyAlign = 0;\r\n\r\n\ta = String(a);\r\n\tb = String(b);\r\n\r\n\tif(thousand){\r\n\t\ta = a.split(thousand).join(\"\");\r\n\t\tb = b.split(thousand).join(\"\");\r\n\t}\r\n\r\n\tif(decimal){\r\n\t\ta = a.split(decimal).join(\".\");\r\n\t\tb = b.split(decimal).join(\".\");\r\n\t}\r\n\r\n\ta = parseFloat(a);\r\n\tb = parseFloat(b);\r\n\r\n\t//handle non numeric values\r\n\tif(isNaN(a)){\r\n\t\temptyAlign = isNaN(b) ? 0 : -1;\r\n\t}else if(isNaN(b)){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\t\t//compare valid values\r\n\t\treturn a - b;\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n};","//sort strings\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar emptyAlign = 0;\r\n\tvar locale;\r\n\r\n\t//handle empty values\r\n\tif(!a){\r\n\t\temptyAlign = !b ? 0 : -1;\r\n\t}else if(!b){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\t\t//compare valid values\r\n\t\tswitch(typeof params.locale){\r\n\t\t\tcase \"boolean\":\r\n\t\t\tif(params.locale){\r\n\t\t\t\tlocale = this.langLocale();\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\tcase \"string\":\r\n\t\t\tlocale = params.locale;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn String(a).toLowerCase().localeCompare(String(b).toLowerCase(), locale);\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n};","//sort datetime\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar format = params.format || \"dd/MM/yyyy HH:mm:ss\",\r\n\talignEmptyValues = params.alignEmptyValues,\r\n\temptyAlign = 0;\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tif(DT.isDateTime(a)){\r\n\t\t\t a = a;\r\n\t\t}else if(format === \"iso\"){\r\n\t\t\t a = DT.fromISO(String(a));\r\n\t\t}else{\r\n\t\t\t a = DT.fromFormat(String(a), format);\r\n\t\t}\r\n\r\n\t\tif(DT.isDateTime(b)){\r\n\t\t\t b = b;\r\n\t\t}else if(format === \"iso\"){\r\n\t\t\t b = DT.fromISO(String(b));\r\n\t\t}else{\r\n\t\t\t b = DT.fromFormat(String(b), format);\r\n\t\t}\r\n\r\n\t\tif(!a.isValid){\r\n\t\t\temptyAlign = !b.isValid ? 0 : -1;\r\n\t\t}else if(!b.isValid){\r\n\t\t\temptyAlign = 1;\r\n\t\t}else{\r\n\t\t\t//compare valid values\r\n\t\t\treturn a - b;\r\n\t\t}\r\n\r\n\t\t//fix empty values in position\r\n\t\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\t\temptyAlign *= -1;\r\n\t\t}\r\n\r\n\t\treturn emptyAlign;\r\n\r\n\t}else{\r\n\t\tconsole.error(\"Sort Error - 'datetime' sorter is dependant on luxon.js\");\r\n\t}\r\n};","import datetime from './datetime.js';\r\n\r\n//sort date\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tif(!params.format){\r\n\t\tparams.format = \"dd/MM/yyyy\";\r\n\t}\r\n\r\n\treturn datetime.call(this, a, b, aRow, bRow, column, dir, params);\r\n};","import datetime from './datetime.js';\r\n\r\n//sort times\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tif(!params.format){\r\n\t\tparams.format = \"HH:mm\";\r\n\t}\r\n\r\n\treturn datetime.call(this, a, b, aRow, bRow, column, dir, params);\r\n};","//sort booleans\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar el1 = a === true || a === \"true\" || a === \"True\" || a === 1 ? 1 : 0;\r\n\tvar el2 = b === true || b === \"true\" || b === \"True\" || b === 1 ? 1 : 0;\r\n\r\n\treturn el1 - el2;\r\n};","//sort if element contains any data\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar el1 = 0;\r\n\tvar el2 = 0;\r\n\tvar type = params.type || \"length\";\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar emptyAlign = 0;\r\n\r\n\tfunction calc(value){\r\n\r\n\t\tswitch(type){\r\n\t\t\tcase \"length\":\r\n\t\t\treturn value.length;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"sum\":\r\n\t\t\treturn value.reduce(function(c, d){\r\n\t\t\t\treturn c + d;\r\n\t\t\t});\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"max\":\r\n\t\t\treturn Math.max.apply(null, value) ;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"min\":\r\n\t\t\treturn Math.min.apply(null, value) ;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"avg\":\r\n\t\t\treturn value.reduce(function(c, d){\r\n\t\t\t\treturn c + d;\r\n\t\t\t}) / value.length;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\t//handle non array values\r\n\tif(!Array.isArray(a)){\r\n\t\talignEmptyValues = !Array.isArray(b) ? 0 : -1;\r\n\t}else if(!Array.isArray(b)){\r\n\t\talignEmptyValues = 1;\r\n\t}else{\r\n\r\n\t\t//compare valid values\r\n\t\tel1 = a ? calc(a) : 0;\r\n\t\tel2 = b ? calc(b) : 0;\r\n\r\n\t\treturn el1 - el2;\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n};","//sort if element contains any data\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar el1 = typeof a == \"undefined\" ? 0 : 1;\r\n\tvar el2 = typeof b == \"undefined\" ? 0 : 1;\r\n\r\n\treturn el1 - el2;\r\n};","//sort alpha numeric strings\r\nexport default function(as, bs, aRow, bRow, column, dir, params){\r\n\tvar a, b, a1, b1, i= 0, L, rx = /(\\d+)|(\\D+)/g, rd = /\\d/;\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar emptyAlign = 0;\r\n\r\n\t//handle empty values\r\n\tif(!as && as!== 0){\r\n\t\temptyAlign = !bs && bs!== 0 ? 0 : -1;\r\n\t}else if(!bs && bs!== 0){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\r\n\t\tif(isFinite(as) && isFinite(bs)) return as - bs;\r\n\t\ta = String(as).toLowerCase();\r\n\t\tb = String(bs).toLowerCase();\r\n\t\tif(a === b) return 0;\r\n\t\tif(!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1;\r\n\t\ta = a.match(rx);\r\n\t\tb = b.match(rx);\r\n\t\tL = a.length > b.length ? b.length : a.length;\r\n\t\twhile(i < L){\r\n\t\t\ta1= a[i];\r\n\t\t\tb1= b[i++];\r\n\t\t\tif(a1 !== b1){\r\n\t\t\t\tif(isFinite(a1) && isFinite(b1)){\r\n\t\t\t\t\tif(a1.charAt(0) === \"0\") a1 = \".\" + a1;\r\n\t\t\t\t\tif(b1.charAt(0) === \"0\") b1 = \".\" + b1;\r\n\t\t\t\t\treturn a1 - b1;\r\n\t\t\t\t}\r\n\t\t\t\telse return a1 > b1 ? 1 : -1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn a.length > b.length;\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n};","import number from './sorters/number.js';\r\nimport string from './sorters/string.js';\r\nimport date from './sorters/date.js';\r\nimport time from './sorters/time.js';\r\nimport datetime from './sorters/datetime.js';\r\nimport boolean from './sorters/boolean.js';\r\nimport array from './sorters/array.js';\r\nimport exists from './sorters/exists.js';\r\nimport alphanum from './sorters/alphanum.js';\r\n\r\nexport default {\r\n\tnumber:number,\r\n\tstring:string,\r\n\tdate:date,\r\n\ttime:time,\r\n\tdatetime:datetime,\r\n\tboolean:boolean,\r\n\tarray:array,\r\n\texists:exists,\r\n\talphanum:alphanum\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultSorters from './defaults/sorters.js';\r\n\r\nclass Sort extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t \tthis.sortList = []; //holder current sort\r\n\t \tthis.changed = false; //has the sort changed since last render\r\n\r\n\t \tthis.registerTableOption(\"sortMode\", \"local\"); //local or remote sorting\r\n\r\n\t \tthis.registerTableOption(\"initialSort\", false); //initial sorting criteria\r\n\t \tthis.registerTableOption(\"columnHeaderSortMulti\", true); //multiple or single column sorting\r\n\t \tthis.registerTableOption(\"sortOrderReverse\", false); //reverse internal sort ordering\r\n\t \tthis.registerTableOption(\"headerSortElement\", \"
\"); //header sort element\r\n\r\n\t \tthis.registerColumnOption(\"sorter\");\r\n\t \tthis.registerColumnOption(\"sorterParams\");\r\n\r\n\t \tthis.registerColumnOption(\"headerSort\", true);\r\n\t \tthis.registerColumnOption(\"headerSortStartingDir\");\r\n\t \tthis.registerColumnOption(\"headerSortTristate\");\r\n\r\n\t }\r\n\r\n\t initialize(){\r\n\t \tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t \tthis.subscribe(\"table-built\", this.tableBuilt.bind(this));\r\n\t \tthis.registerDataHandler(this.sort.bind(this), 20);\r\n\r\n\t \tthis.registerTableFunction(\"setSort\", this.userSetSort.bind(this));\r\n\t \tthis.registerTableFunction(\"getSorters\", this.getSort.bind(this));\r\n\t \tthis.registerTableFunction(\"clearSort\", this.clearSort.bind(this));\r\n\r\n\t \tif(this.table.options.sortMode === \"remote\"){\r\n\t \t\tthis.subscribe(\"data-params\", this.remoteSortParams.bind(this));\r\n\t \t}\r\n\t }\r\n\r\n\t tableBuilt(){\r\n\t \tif(this.table.options.initialSort){\r\n\t \t\tthis.setSort(this.table.options.initialSort);\r\n\t \t}\r\n\t }\r\n\r\n\t remoteSortParams(data, config, silent, params){\r\n\t \tvar sorters = this.getSort();\r\n\r\n\t \tsorters.forEach((item) => {\r\n\t \t\tdelete item.column;\r\n\t \t});\r\n\r\n\t \tparams.sort = sorters;\r\n\r\n\t \treturn params;\r\n\t }\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tuserSetSort(sortList, dir){\r\n\t\tthis.setSort(sortList, dir);\r\n\t\t// this.table.rowManager.sorterRefresh();\r\n\t\tthis.refreshSort();\r\n\t}\r\n\r\n\tclearSort(){\r\n\t\tthis.clear();\r\n\t\t// this.table.rowManager.sorterRefresh();\r\n\t\tthis.refreshSort();\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\t//initialize column header for sorting\r\n\tinitializeColumn(column){\r\n\t\tvar sorter = false,\r\n\t\tcolEl,\r\n\t\tarrowEl;\r\n\r\n\t\tswitch(typeof column.definition.sorter){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(Sort.sorters[column.definition.sorter]){\r\n\t\t\t\tsorter = Sort.sorters[column.definition.sorter];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Sort Error - No such sorter found: \", column.definition.sorter);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tsorter = column.definition.sorter;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcolumn.modules.sort = {\r\n\t\t\tsorter:sorter, dir:\"none\",\r\n\t\t\tparams:column.definition.sorterParams || {},\r\n\t\t\tstartingDir:column.definition.headerSortStartingDir || \"asc\",\r\n\t\t\ttristate: column.definition.headerSortTristate,\r\n\t\t};\r\n\r\n\t\tif(column.definition.headerSort !== false){\r\n\r\n\t\t\tcolEl = column.getElement();\r\n\r\n\t\t\tcolEl.classList.add(\"tabulator-sortable\");\r\n\r\n\r\n\t\t\tarrowEl = document.createElement(\"div\");\r\n\t\t\tarrowEl.classList.add(\"tabulator-col-sorter\");\r\n\r\n\t\t\tif(typeof this.table.options.headerSortElement == \"object\"){\r\n\t\t\t\tarrowEl.appendChild(this.table.options.headerSortElement);\r\n\t\t\t}else{\r\n\t\t\t\tarrowEl.innerHTML = this.table.options.headerSortElement;\r\n\t\t\t}\r\n\r\n\t\t\t//create sorter arrow\r\n\t\t\tcolumn.titleHolderElement.appendChild(arrowEl);\r\n\r\n\t\t\tcolumn.modules.sort.element = arrowEl;\r\n\r\n\t\t\t//sort on click\r\n\t\t\tcolEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\tvar dir = \"\",\r\n\t\t\t\tsorters=[],\r\n\t\t\t\tmatch = false;\r\n\r\n\t\t\t\tif(column.modules.sort){\r\n\t\t\t\t\tif(column.modules.sort.tristate){\r\n\t\t\t\t\t\tif(column.modules.sort.dir == \"none\"){\r\n\t\t\t\t\t\t\tdir = column.modules.sort.startingDir;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(column.modules.sort.dir == column.modules.sort.startingDir){\r\n\t\t\t\t\t\t\t\tdir = column.modules.sort.dir == \"asc\" ? \"desc\" : \"asc\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tdir = \"none\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tswitch(column.modules.sort.dir){\r\n\t\t\t\t\t\t\tcase \"asc\":\r\n\t\t\t\t\t\t\tdir = \"desc\";\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase \"desc\":\r\n\t\t\t\t\t\t\tdir = \"asc\";\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tdir = column.modules.sort.startingDir;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\tif (this.table.options.columnHeaderSortMulti && (e.shiftKey || e.ctrlKey)) {\r\n\t\t\t\t\t\tsorters = this.getSort();\r\n\r\n\t\t\t\t\t\tmatch = sorters.findIndex((sorter) => {\r\n\t\t\t\t\t\t\treturn sorter.field === column.getField();\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\tif(match > -1){\r\n\t\t\t\t\t\t\tsorters[match].dir = dir;\r\n\r\n\t\t\t\t\t\t\tif(match != sorters.length -1){\r\n\t\t\t\t\t\t\t\tmatch = sorters.splice(match, 1)[0];\r\n\t\t\t\t\t\t\t\tif(dir != \"none\"){\r\n\t\t\t\t\t\t\t\t\tsorters.push(match);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(dir != \"none\"){\r\n\t\t\t\t\t\t\t\tsorters.push({column:column, dir:dir});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t//add to existing sort\r\n\t\t\t\t\t\tthis.setSort(sorters);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(dir == \"none\"){\r\n\t\t\t\t\t\t\tthis.clear();\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t//sort by column only\r\n\t\t\t\t\t\t\tthis.setSort(column, dir);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// this.table.rowManager.sorterRefresh(!this.sortList.length);\r\n\t\t\t\t\tthis.refreshSort();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\trefreshSort(){\r\n\t\tif(this.table.options.sortMode === \"remote\"){\r\n\t\t\tthis.reloadData(null, false, false);\r\n\t\t}else{\r\n\t\t\tthis.refreshData(true);\r\n\t\t}\r\n\r\n\t\t//TODO - Persist left position of row manager\r\n\t\t// left = this.scrollLeft;\r\n\t\t// this.scrollHorizontal(left);\r\n\t}\r\n\r\n\t//check if the sorters have changed since last use\r\n\thasChanged(){\r\n\t\tvar changed = this.changed;\r\n\t\tthis.changed = false;\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t//return current sorters\r\n\tgetSort(){\r\n\t\tvar self = this,\r\n\t\tsorters = [];\r\n\r\n\t\tself.sortList.forEach(function(item){\r\n\t\t\tif(item.column){\r\n\t\t\t\tsorters.push({column:item.column.getComponent(), field:item.column.getField(), dir:item.dir});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn sorters;\r\n\t}\r\n\r\n\t//change sort list and trigger sort\r\n\tsetSort(sortList, dir){\r\n\t\tvar self = this,\r\n\t\tnewSortList = [];\r\n\r\n\t\tif(!Array.isArray(sortList)){\r\n\t\t\tsortList = [{column: sortList, dir:dir}];\r\n\t\t}\r\n\r\n\t\tsortList.forEach(function(item){\r\n\t\t\tvar column;\r\n\r\n\t\t\tcolumn = self.table.columnManager.findColumn(item.column);\r\n\r\n\t\t\tif(column){\r\n\t\t\t\titem.column = column;\r\n\t\t\t\tnewSortList.push(item);\r\n\t\t\t\tself.changed = true;\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Sort Warning - Sort field does not exist and is being ignored: \", item.column);\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t\tself.sortList = newSortList;\r\n\r\n\t\tthis.dispatch(\"sort-changed\");\r\n\t}\r\n\r\n\t//clear sorters\r\n\tclear(){\r\n\t\tthis.setSort([]);\r\n\t}\r\n\r\n\t//find appropriate sorter for column\r\n\tfindSorter(column){\r\n\t\tvar row = this.table.rowManager.activeRows[0],\r\n\t\tsorter = \"string\",\r\n\t\tfield, value;\r\n\r\n\t\tif(row){\r\n\t\t\trow = row.getData();\r\n\t\t\tfield = column.getField();\r\n\r\n\t\t\tif(field){\r\n\r\n\t\t\t\tvalue = column.getFieldValue(row);\r\n\r\n\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\tsorter = \"boolean\";\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\tif(!isNaN(value) && value !== \"\"){\r\n\t\t\t\t\t\tsorter = \"number\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)){\r\n\t\t\t\t\t\t\tsorter = \"alphanum\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Sort.sorters[sorter];\r\n\t}\r\n\r\n\t//work through sort list sorting data\r\n\tsort(data){\r\n\t\tvar self = this,\r\n\t\tsortList = this.table.options.sortOrderReverse ? self.sortList.slice().reverse() : self.sortList,\r\n\t\tsortListActual = [],\r\n\t\trowComponents = [],\r\n\t\tlastSort;\r\n\r\n\t\tif(this.subscribedExternal(\"dataSorting\")){\r\n\t\t\tthis.dispatchExternal(\"dataSorting\", self.getSort());\r\n\t\t}\r\n\r\n\t\tself.clearColumnHeaders();\r\n\r\n\t\tif(this.table.options.sortMode !== \"remote\"){\r\n\r\n\t\t\t//build list of valid sorters and trigger column specific callbacks before sort begins\r\n\t\t\tsortList.forEach(function(item, i){\r\n\t\t\t\tvar sortObj = item.column.modules.sort;\r\n\r\n\t\t\t\tif(item.column && sortObj){\r\n\r\n\t\t\t\t\t//if no sorter has been defined, take a guess\r\n\t\t\t\t\tif(!sortObj.sorter){\r\n\t\t\t\t\t\tsortObj.sorter = self.findSorter(item.column);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\titem.params = typeof sortObj.params === \"function\" ? sortObj.params(item.column.getComponent(), item.dir) : sortObj.params;\r\n\r\n\t\t\t\t\tsortListActual.push(item);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tself.setColumnHeader(item.column, item.dir);\r\n\t\t\t});\r\n\r\n\t\t\t//sort data\r\n\t\t\tif (sortListActual.length) {\r\n\t\t\t\tself._sortItems(data, sortListActual);\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tsortList.forEach(function(item, i){\r\n\t\t\t\tself.setColumnHeader(item.column, item.dir);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.subscribedExternal(\"dataSorted\")){\r\n\t\t\tdata.forEach((row) => {\r\n\t\t\t\trowComponents.push(row.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatchExternal(\"dataSorted\", self.getSort(), rowComponents);\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//clear sort arrows on columns\r\n\tclearColumnHeaders(){\r\n\t\tthis.table.columnManager.getRealColumns().forEach(function(column){\r\n\t\t\tif(column.modules.sort){\r\n\t\t\t\tcolumn.modules.sort.dir = \"none\";\r\n\t\t\t\tcolumn.getElement().setAttribute(\"aria-sort\", \"none\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//set the column header sort direction\r\n\tsetColumnHeader(column, dir){\r\n\t\tcolumn.modules.sort.dir = dir;\r\n\t\tcolumn.getElement().setAttribute(\"aria-sort\", dir === \"asc\" ? \"ascending\" : \"descending\");\r\n\t}\r\n\r\n\t//sort each item in sort list\r\n\t_sortItems(data, sortList){\r\n\t\tvar sorterCount = sortList.length - 1;\r\n\r\n\t\tdata.sort((a, b) => {\r\n\t\t\tvar result;\r\n\r\n\t\t\tfor(var i = sorterCount; i>= 0; i--){\r\n\t\t\t\tlet sortItem = sortList[i];\r\n\r\n\t\t\t\tresult = this._sortRow(a, b, sortItem.column, sortItem.dir, sortItem.params);\r\n\r\n\t\t\t\tif(result !== 0){\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn result;\r\n\t\t});\r\n\t}\r\n\r\n\t//process individual rows for a sort function on active data\r\n\t_sortRow(a, b, column, dir, params){\r\n\t\tvar el1Comp, el2Comp, colComp;\r\n\r\n\t\t//switch elements depending on search direction\r\n\t\tvar el1 = dir == \"asc\" ? a : b;\r\n\t\tvar el2 = dir == \"asc\" ? b : a;\r\n\r\n\t\ta = column.getFieldValue(el1.getData());\r\n\t\tb = column.getFieldValue(el2.getData());\r\n\r\n\t\ta = typeof a !== \"undefined\" ? a : \"\";\r\n\t\tb = typeof b !== \"undefined\" ? b : \"\";\r\n\r\n\t\tel1Comp = el1.getComponent();\r\n\t\tel2Comp = el2.getComponent();\r\n\r\n\t\treturn column.modules.sort.sorter.call(this, a, b, el1Comp, el2Comp, column.getComponent(), dir, params);\r\n\t}\r\n}\r\n\r\nSort.moduleName = \"sort\";\r\n\r\n//load defaults\r\nSort.sorters = defaultSorters;\r\n\r\nexport default Sort;","import Module from '../../core/Module.js';\r\nimport Cell from '../../core/cell/Cell.js';\r\n\r\nclass Tooltip extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.tooltipSubscriber = null,\r\n\t\tthis.headerSubscriber = null,\r\n\t\t\r\n\t\tthis.timeout = null;\r\n\t\tthis.popupInstance = null;\r\n\t\t\r\n\t\tthis.registerTableOption(\"tooltipGenerationMode\", undefined); //deprecated\r\n\t\tthis.registerTableOption(\"tooltipDelay\", 300); \r\n\t\t\r\n\t\tthis.registerColumnOption(\"tooltip\");\r\n\t\tthis.registerColumnOption(\"headerTooltip\");\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.deprecationCheck();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\t\r\n\tdeprecationCheck(){\r\n\t\tif(typeof this.table.options.tooltipGenerationMode !== \"undefined\"){\r\n\t\t\tconsole.warn(\"Use of the tooltipGenerationMode option is now deprecated. This option is no longer needed as tooltips are always generated on hover now\");\r\n\t\t}\r\n\t}\t\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tif(column.definition.headerTooltip && !this.headerSubscriber){\r\n\t\t\tthis.headerSubscriber = true;\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-mousemove\", this.mousemoveCheck.bind(this, \"headerTooltip\"));\r\n\t\t\tthis.subscribe(\"column-mouseout\", this.mouseoutCheck.bind(this, \"headerTooltip\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition.tooltip && !this.tooltipSubscriber){\r\n\t\t\tthis.tooltipSubscriber = true;\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-mousemove\", this.mousemoveCheck.bind(this, \"tooltip\"));\r\n\t\t\tthis.subscribe(\"cell-mouseout\", this.mouseoutCheck.bind(this, \"tooltip\"));\r\n\t\t}\r\n\t}\r\n\t\r\n\tmousemoveCheck(action, e, component){\r\n\t\tvar tooltip = action === \"tooltip\" ? component.column.definition.tooltip : component.definition.headerTooltip;\r\n\t\t\r\n\t\tif(tooltip){\r\n\t\t\tthis.clearPopup();\r\n\t\t\tthis.timeout = setTimeout(this.loadTooltip.bind(this, e, component, tooltip), this.table.options.tooltipDelay);\r\n\t\t}\r\n\t}\r\n\r\n\tmouseoutCheck(action, e, component){\r\n\t\tif(!this.popupInstance){\r\n\t\t\tthis.clearPopup();\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearPopup(action, e, component){\r\n\t\tclearTimeout(this.timeout);\r\n\t\tthis.timeout = null;\r\n\t\t\r\n\t\tif(this.popupInstance){\r\n\t\t\tthis.popupInstance.hide();\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadTooltip(e, component, tooltip){\r\n\t\tvar contentsEl, renderedCallback, coords;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\trenderedCallback = callback;\r\n\t\t}\r\n\t\t\r\n\t\tif(typeof tooltip === \"function\"){\r\n\t\t\ttooltip = tooltip(e, component.getComponent(), onRendered);\r\n\t\t}\r\n\t\t\r\n\t\tif(tooltip instanceof HTMLElement){\r\n\t\t\tcontentsEl = tooltip;\r\n\t\t}else{\r\n\t\t\tcontentsEl = document.createElement(\"div\");\r\n\t\t\t\r\n\t\t\tif(tooltip === true){\r\n\t\t\t\tif(component instanceof Cell){\r\n\t\t\t\t\ttooltip = component.value;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(component.definition.field){\r\n\t\t\t\t\t\tthis.langBind(\"columns|\" + component.definition.field, (value) => {\r\n\t\t\t\t\t\t\tcontentsEl.innerHTML = tooltip = value || component.definition.title;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\ttooltip = component.definition.title;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcontentsEl.innerHTML = tooltip;\r\n\t\t}\r\n\t\t\r\n\t\tif(tooltip || tooltip === 0 || tooltip === \"0\" || tooltip === false){\r\n\t\t\tcontentsEl.classList.add(\"tabulator-tooltip\");\r\n\r\n\t\t\tcontentsEl.addEventListener(\"mousemove\", e => e.preventDefault())\r\n\t\t\t\r\n\t\t\tthis.popupInstance = this.popup(contentsEl);\r\n\t\t\t\r\n\t\t\tif(typeof renderedCallback === \"function\"){\r\n\t\t\t\tthis.popupInstance.renderCallback(renderedCallback);\r\n\t\t\t}\r\n\r\n\t\t\tcoords = this.popupInstance.containerEventCoords(e);\r\n\t\t\t\r\n\t\t\tthis.popupInstance.show(coords.x + 15, coords.y + 15).hideOnBlur(() => {\r\n\t\t\t\tthis.dispatchExternal(\"TooltipClosed\", component.getComponent());\r\n\t\t\t\tthis.popupInstance = null;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"TooltipOpened\", component.getComponent());\r\n\t\t}\r\n\t}\r\n}\r\n\r\nTooltip.moduleName = \"tooltip\";\r\n\r\nexport default Tooltip;\r\n","export default {\r\n\t//is integer\r\n\tinteger: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvalue = Number(value);\r\n\t\treturn typeof value === 'number' && isFinite(value) && Math.floor(value) === value;\r\n\t},\r\n\r\n\t//is float\r\n\tfloat: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvalue = Number(value);\r\n\t\treturn typeof value === 'number' && isFinite(value) && value % 1 !== 0;\r\n\t},\r\n\r\n\t//must be a number\r\n\tnumeric: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn !isNaN(value);\r\n\t},\r\n\r\n\t//must be a string\r\n\tstring: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn isNaN(value);\r\n\t},\r\n\r\n\t//maximum value\r\n\tmax: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn parseFloat(value) <= parameters;\r\n\t},\r\n\r\n\t//minimum value\r\n\tmin: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn parseFloat(value) >= parameters;\r\n\t},\r\n\r\n\t//starts with value\r\n\tstarts: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).toLowerCase().startsWith(String(parameters).toLowerCase());\r\n\t},\r\n\r\n\t//ends with value\r\n\tends: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).toLowerCase().endsWith(String(parameters).toLowerCase());\r\n\t},\r\n\r\n\r\n\t//minimum string length\r\n\tminLength: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).length >= parameters;\r\n\t},\r\n\r\n\t//maximum string length\r\n\tmaxLength: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).length <= parameters;\r\n\t},\r\n\r\n\t//in provided value list\r\n\tin: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif(typeof parameters == \"string\"){\r\n\t\t\tparameters = parameters.split(\"|\");\r\n\t\t}\r\n\r\n\t\treturn value === \"\" || parameters.indexOf(value) > -1;\r\n\t},\r\n\r\n\t//must match provided regex\r\n\tregex: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar reg = new RegExp(parameters);\r\n\r\n\t\treturn reg.test(value);\r\n\t},\r\n\r\n\t//value must be unique in this column\r\n\tunique: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar unique = true;\r\n\r\n\t\tvar cellData = cell.getData();\r\n\t\tvar column = cell.getColumn()._getSelf();\r\n\r\n\t\tthis.table.rowManager.rows.forEach(function(row){\r\n\t\t\tvar data = row.getData();\r\n\r\n\t\t\tif(data !== cellData){\r\n\t\t\t\tif(value == column.getFieldValue(data)){\r\n\t\t\t\t\tunique = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn unique;\r\n\t},\r\n\r\n\t//must have a value\r\n\trequired:function(cell, value, parameters){\r\n\t\treturn value !== \"\" && value !== null && typeof value !== \"undefined\";\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultValidators from './defaults/validators.js';\r\n\r\nclass Validate extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.invalidCells = [];\r\n\t\t\r\n\t\tthis.registerTableOption(\"validationMode\", \"blocking\");\r\n\t\t\r\n\t\tthis.registerColumnOption(\"validator\");\r\n\t\t\r\n\t\tthis.registerTableFunction(\"getInvalidCells\", this.getInvalidCells.bind(this));\r\n\t\tthis.registerTableFunction(\"clearCellValidation\", this.userClearCellValidation.bind(this));\r\n\t\tthis.registerTableFunction(\"validate\", this.userValidate.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"cell\", \"isValid\", this.cellIsValid.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"clearValidation\", this.clearValidation.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"validate\", this.cellValidate.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"column\", \"validate\", this.columnValidate.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"validate\", this.rowValidate.bind(this));\r\n\t}\r\n\t\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-delete\", this.clearValidation.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumnCheck.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"edit-success\", this.editValidate.bind(this));\r\n\t\tthis.subscribe(\"edit-editor-clear\", this.editorClear.bind(this));\r\n\t\tthis.subscribe(\"edit-edited-clear\", this.editedClear.bind(this));\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Event Handling //////////\r\n\t///////////////////////////////////\r\n\t\r\n\teditValidate(cell, value, previousValue){\r\n\t\tvar valid = this.table.options.validationMode !== \"manual\" ? this.validate(cell.column.modules.validate, cell, value) : true;\r\n\t\t\r\n\t\t// allow time for editor to make render changes then style cell\r\n\t\tif(valid !== true){\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tcell.getElement().classList.add(\"tabulator-validation-fail\");\r\n\t\t\t\tthis.dispatchExternal(\"validationFailed\", cell.getComponent(), value, valid);\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\treturn valid;\r\n\t}\r\n\t\r\n\teditorClear(cell, cancelled){\r\n\t\tif(cancelled){\r\n\t\t\tif(cell.column.modules.validate){\r\n\t\t\t\tthis.cellValidate(cell);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t}\r\n\t\r\n\teditedClear(cell){\r\n\t\tif(cell.modules.validate){\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t////////// Cell Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\tcellIsValid(cell){\r\n\t\treturn cell.modules.validate ? (cell.modules.validate.invalid || true) : true;\r\n\t}\r\n\t\r\n\tcellValidate(cell){\r\n\t\treturn this.validate(cell.column.modules.validate, cell, cell.getValue());\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Column Functions ////////\r\n\t///////////////////////////////////\r\n\t\r\n\tcolumnValidate(column){\r\n\t\tvar invalid = [];\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tif(this.cellValidate(cell) !== true){\r\n\t\t\t\tinvalid.push(cell.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn invalid.length ? invalid : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t////////// Row Functions //////////\r\n\t///////////////////////////////////\r\n\t\r\n\trowValidate(row){\r\n\t\tvar invalid = [];\r\n\t\t\r\n\t\trow.cells.forEach((cell) => {\r\n\t\t\tif(this.cellValidate(cell) !== true){\r\n\t\t\t\tinvalid.push(cell.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn invalid.length ? invalid : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\t\r\n\tuserClearCellValidation(cells){\r\n\t\tif(!cells){\r\n\t\t\tcells = this.getInvalidCells();\r\n\t\t}\r\n\t\t\r\n\t\tif(!Array.isArray(cells)){\r\n\t\t\tcells = [cells];\r\n\t\t}\r\n\t\t\r\n\t\tcells.forEach((cell) => {\r\n\t\t\tthis.clearValidation(cell._getSelf());\r\n\t\t});\r\n\t}\r\n\t\r\n\tuserValidate(cells){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\t//clear row data\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\trow = row.getComponent();\r\n\t\t\t\r\n\t\t\tvar valid = row.validate();\r\n\t\t\t\r\n\t\t\tif(valid !== true){\r\n\t\t\t\toutput = output.concat(valid);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn output.length ? output : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tinitializeColumnCheck(column){\r\n\t\tif(typeof column.definition.validator !== \"undefined\"){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//validate\r\n\tinitializeColumn(column){\r\n\t\tvar self = this,\r\n\t\tconfig = [],\r\n\t\tvalidator;\r\n\t\t\r\n\t\tif(column.definition.validator){\r\n\t\t\t\r\n\t\t\tif(Array.isArray(column.definition.validator)){\r\n\t\t\t\tcolumn.definition.validator.forEach((item) => {\r\n\t\t\t\t\tvalidator = self._extractValidator(item);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(validator){\r\n\t\t\t\t\t\tconfig.push(validator);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tvalidator = this._extractValidator(column.definition.validator);\r\n\t\t\t\t\r\n\t\t\t\tif(validator){\r\n\t\t\t\t\tconfig.push(validator);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.validate = config.length ? config : false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t_extractValidator(value){\r\n\t\tvar type, params, pos;\r\n\t\t\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\tpos = value.indexOf(':');\r\n\t\t\t\r\n\t\t\tif(pos > -1){\r\n\t\t\t\ttype = value.substring(0,pos);\r\n\t\t\t\tparams = value.substring(pos+1);\r\n\t\t\t}else{\r\n\t\t\t\ttype = value;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn this._buildValidator(type, params);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"function\":\r\n\t\t\treturn this._buildValidator(value);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"object\":\r\n\t\t\treturn this._buildValidator(value.type, value.parameters);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t\r\n\t_buildValidator(type, params){\r\n\t\t\r\n\t\tvar func = typeof type == \"function\" ? type : Validate.validators[type];\r\n\t\t\r\n\t\tif(!func){\r\n\t\t\tconsole.warn(\"Validator Setup Error - No matching validator found:\", type);\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn {\r\n\t\t\t\ttype:typeof type == \"function\" ? \"function\" : type,\r\n\t\t\t\tfunc:func,\r\n\t\t\t\tparams:params,\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n\t\r\n\tvalidate(validators, cell, value){\r\n\t\tvar self = this,\r\n\t\tfailedValidators = [],\r\n\t\tinvalidIndex = this.invalidCells.indexOf(cell);\r\n\t\t\r\n\t\tif(validators){\r\n\t\t\tvalidators.forEach((item) => {\r\n\t\t\t\tif(!item.func.call(self, cell.getComponent(), value, item.params)){\r\n\t\t\t\t\tfailedValidators.push({\r\n\t\t\t\t\t\ttype:item.type,\r\n\t\t\t\t\t\tparameters:item.params\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tif(!cell.modules.validate){\r\n\t\t\tcell.modules.validate = {};\r\n\t\t}\r\n\t\t\r\n\t\tif(!failedValidators.length){\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t\t\t\r\n\t\t\tif(invalidIndex > -1){\r\n\t\t\t\tthis.invalidCells.splice(invalidIndex, 1);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcell.modules.validate.invalid = failedValidators;\r\n\t\t\t\r\n\t\t\tif(this.table.options.validationMode !== \"manual\"){\r\n\t\t\t\tcell.getElement().classList.add(\"tabulator-validation-fail\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(invalidIndex == -1){\r\n\t\t\t\tthis.invalidCells.push(cell);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn failedValidators.length ? failedValidators : true;\r\n\t}\r\n\t\r\n\tgetInvalidCells(){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.invalidCells.forEach((cell) => {\r\n\t\t\toutput.push(cell.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tclearValidation(cell){\r\n\t\tvar invalidIndex;\r\n\t\t\r\n\t\tif(cell.modules.validate && cell.modules.validate.invalid){\r\n\t\t\t\r\n\t\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t\t\r\n\t\t\tinvalidIndex = this.invalidCells.indexOf(cell);\r\n\t\t\t\r\n\t\t\tif(invalidIndex > -1){\r\n\t\t\t\tthis.invalidCells.splice(invalidIndex, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nValidate.moduleName = \"validate\";\r\n\r\n//load defaults\r\nValidate.validators = defaultValidators;\r\n\r\nexport default Validate;\r\n","//tabulator with all modules installed\r\nimport {default as Tabulator} from './Tabulator.js';\r\nimport * as modules from '../core/modules/optional.js';\r\nimport ModuleBinder from './tools/ModuleBinder.js';\r\n\r\nclass TabulatorFull extends Tabulator {};\r\n\r\n//bind modules and static functionality\r\nnew ModuleBinder(TabulatorFull, modules);\r\n\r\nexport default TabulatorFull;"],"names":["debugEventsExternal","debugEventsInternal","debugInvalidOptions","debugInitialization","height","minHeight","maxHeight","columnHeaderVertAlign","popupContainer","columns","columnDefaults","data","autoColumns","autoColumnsDefinitions","nestedFieldSeparator","footerElement","index","textDirection","addRowPos","headerVisible","renderVertical","renderHorizontal","renderVerticalBuffer","scrollToRowPosition","scrollToRowIfVisible","scrollToColumnPosition","scrollToColumnIfVisible","rowFormatter","rowFormatterPrint","rowFormatterClipboard","rowFormatterHtmlOutput","rowHeight","placeholder","dataLoader","dataLoaderLoading","dataLoaderError","dataLoaderErrorTimeout","dataSendParams","dataReceiveParams","CoreFeature","table","silent","columnsChanged","load","undefined","modules","localize","getText","arguments","bind","getLocale","comms","getConnections","send","layout","getMode","eventBus","subscribe","unsubscribe","key","subscribed","subscriptionChange","dispatch","chain","confirm","externalEvents","options","value","module","ColumnComponent","column","_column","type","Proxy","get","target","name","receiver","componentFunctionBinder","handle","getElement","getDefinition","getField","getTitleDownload","cells","forEach","cell","push","getComponent","visible","isGroup","show","hide","output","length","parent","Column","columnManager","scrollToColumn","to","after","toColumn","findColumn","moveColumn","console","warn","nextCol","nextColumn","prevCol","prevColumn","updates","updateDefinition","getWidth","width","result","reinitializeWidth","setWidth","renderer","rerenderColumns","CellComponent","_cell","getValue","getOldValue","initialValue","row","getData","mutate","setValue","setValueActual","checkHeight","Cell","element","oldValue","minWidth","component","loaded","build","generateElement","_configureCell","getFieldValue","document","createElement","className","setAttribute","field","vertAligns","top","bottom","middle","hozAligns","left","right","center","style","textAlign","hozAlign","vertAlign","display","alignItems","justifyContent","definition","cssClass","classNames","split","classList","add","val","innerHTML","Node","firstChild","removeChild","appendChild","containerOnly","layoutElement","force","changed","setValueProcessData","cellRendered","cellEdited","call","dispatchExternal","subscribedExternal","rowManager","setFieldValue","_generateContents","widthStyled","offsetWidth","minWidthStyled","maxWidth","maxWidthStyled","reinitializeHeight","heightStyled","offsetHeight","redrawBlock","parentNode","deleteCell","calcs","getCellIndex","def","contentElement","titleHolderElement","titleElement","groupElement","createGroupElement","fieldStructure","titleDownload","titleFormatterRendered","mapDefinitions","setField","maxInitialWidth","widthFixed","i","newCol","attachColumn","checkColumnVisibility","registerColumnField","_initialize","bindModuleColumns","el","defaults","optionsList","generate","defaultOptionList","Object","keys","indexOf","title","_getNestedData","_getFlatData","_setNestedData","_setFlatData","registerColumnPosition","reRegisterPosition","headerVertical","_buildColumnHeaderContent","_buildGroupHeader","_buildColumnHeader","classeNames","setMinWidth","parseInt","setMaxWidth","headerHozAlign","_buildColumnHeaderTitle","editableTitle","addEventListener","e","stopPropagation","focus","langBind","text","_formatColumnHeaderTitle","contents","dataObj","structure","columnRendered","alignment","parentHeight","getGroupElement","clientHeight","getHeadersElement","paddingTop","verticalAlign","clearVerticalAlign","formatter","rowNumColumn","getFirstColumn","getLastColumn","getTopColumn","updateBranches","colDefs","responsiveToggle","verticalAlignHeaders","matchChildWidths","childWidth","child","splice","setWidthActual","isNaN","Math","floor","clientWidth","max","min","rows","heightInitialized","offsetParent","clearCellHeight","calcHeight","setCellHeight","ceil","getBoundingClientRect","Promise","resolve","reject","cellCount","deregisterColumn","findColumnIndex","_nextVisibleColumn","getColumnByIndex","_prevVisibleColumn","fitToData","clearWidth","setTo","assign","addColumn","then","error","defaultOptions","Helpers","box","window","pageYOffset","documentElement","clientTop","pageXOffset","clientLeft","obj","clone","list","objectProto","__proto__","arrayProto","Array","isArray","subject","match","copy","findIndex","item","unshift","deepClone","OptionsList","msgType","registeredDefaults","option","userOptions","hasOwnProperty","Renderer","elementVertical","elementHorizontal","tableElement","verticalFillMode","callback","update","blockRedraw","dir","includingBuffer","getDisplayRows","rowEl","remove","clearRows","clearColumns","renderRows","renderColumns","rerenderRows","position","ifVisible","rowIndex","offset","elVisible","elOffset","scrollToRowNearestTop","scrollToRow","scrollHeight","scrollTop","offsetTop","BaiscHorizontal","VirtualDomHorizontal","leftCol","rightCol","scrollLeft","vDomScrollPosLeft","vDomScrollPosRight","vDomPadLeft","vDomPadRight","fitDataColAvg","windowBuffer","visibleRows","initialized","isFitData","compatibilityCheck","layoutCheck","vertScrollListen","frozen","ok","find","col","startsWith","clearVisRowCache","dataChange","scroll","buffer","columnsByIndex","old","cols","colPos","clear","calcWindowBuffer","config","leftPos","rightPos","fitDataCheck","vdomHoz","paddingLeft","paddingRight","reinitChanged","reinitializeRows","initializeRow","reinitializeRow","change","collsWidth","colEnd","generateCells","layoutRefresh","getVisibleRows","diff","abs","addColRight","removeColLeft","addColLeft","removeColRight","start","end","changes","getCell","fitDataColActualWidthCheck","prepend","ex","message","newWidth","widthDiff","colPositionAdjust","ColumnManager","blockHozScrollEvent","headersElement","columnsByField","defaultColumnOptions","initializeRenderer","createHeadersElement","createHeaderElement","insertBefore","scrollHorizontal","renderClass","renderers","RendererVirtualDomHorizontal","RendererBasicHorizontal","initialize","hozAdjust","scrollWidth","marginLeft","scrollColumns","definitions","sorter","setColumns","_addColumn","_reIndexColumns","redraw","before","nextToColumn","colEl","topColumn","parentIndex","nextEl","nextSibling","getHeight","adjustTableSize","_getSelf","HTMLElement","root","matches","fieldRoot","active","structured","from","moveColumnActual","reinitialize","_moveColumnInArray","getComponents","updateRows","fromIndex","toIndex","concat","adjust","offsetLeft","generateCell","totalWidth","fixedWidth","colWidth","layoutMode","resetScroll","footerManager","RowComponent","_row","transform","getCells","getRowPosition","moveToRow","updateData","normalizeHeight","nextRow","prevRow","Row","manualHeight","outerHeight","created","setData","create","deleteCells","renderRowCells","rerenderRowCells","children","resizableRows","setHeight","clearHeight","updatedData","tempData","newRowData","JSON","parse","attrname","getColumnsByFieldRoot","findCell","nextDisplayRow","prevDisplayRow","toRow","findRow","moveRowActual","refreshActiveData","deleteActual","getRowIndex","detatchModules","deleteRow","group","BaiscVertical","visibility","onlyGroupHeaders","styleRow","rowTop","VirtualDomVertical","vDomRowHeight","vDomTop","vDomBottom","vDomScrollPosTop","vDomScrollPosBottom","vDomTopPad","vDomBottomPad","vDomMaxRenderChain","vDomWindowBuffer","vDomWindowMinTotalRows","vDomWindowMinMarginRows","vDomTopNewRows","vDomBottomNewRows","paddingBottom","_virtualRenderFill","topRow","topOffset","deinitializeHeight","topDiff","bottomDiff","margin","_addTopRow","vDomScrollHeight","_removeBottomRow","_addBottomRow","_removeTopRow","topEdge","bottomEdge","topFound","bottomRow","slice","forceMove","holder","topPad","rowsHeight","heightOccupied","topPadHeight","rowsCount","containerHeight","fillableSpace","addedRows","paddingAdjust","_quickNormalizeRowHeight","removableRows","RowManager","createHolderElement","createTableElement","heightFixer","placeholderContents","firstRender","renderMode","fixedHeight","activeRowsPipeline","activeRows","activeRowsCount","displayRows","displayRowsCount","redrawBlockRestoreConfig","redrawBlockRenderInPosition","dataPipeline","displayPipeline","initializePlaceholder","leftDir","topDir","_positionPlaceholder","scrollRows","renderInPosition","pagination","_setDataActual","reRenderInPosition","generateColumnsFromRowData","_wipeElements","wipe","allIndex","activeIndex","setActiveRows","displayRowIterator","displayIndex","regenerateRowNumbers","_showPlaceholder","pos","addRowActual","findAddRowPos","reverse","addRow","_clearPlaceholder","chainResult","moveRowInArray","findRowIndex","rowOnly","getDisplayRowIndex","getRows","handler","priority","sort","a","b","skipStage","stage","cascadeOrder","refreshPipelines","renderTable","layoutColumnsOnNewData","resetDisplayRows","setDisplayRows","viewable","RendererVirtualDomVertical","RendererBasicVertical","_clearTable","renderEmptyScroll","initialHeight","otherHeight","external","resize","tableWidth","browser","event","createEvent","initEvent","dispatchEvent","Event","FooterManager","containerElement","createContainerElement","initializeElement","querySelector","activate","deactivate","InteractionManager","abortClasses","previousTargets","listeners","componentMap","pseudoTrackers","subscriber","pseudoTracking","buildListenerMap","bindSubscriptionWatchers","listenerMap","listener","components","pseudoMouseEnter","pseudoMouseLeave","leaveList","linkedKeys","filter","links","includes","values","comp","subscriptionChanged","clearWatchers","added","bindPseudoEvents","updateEventListeners","track","removeEventListener","path","composedPath","targets","findTargets","bindComponents","triggerEvents","abort","elTargets","targetMatches","previousTarget","closest","ComponentFunctionBinder","bindings","funcName","DataLoader","requestOrder","loading","params","replace","requestNo","alertLoader","mapParams","response","objectInvert","rowData","clearAlert","alertError","setTimeout","map","shouldLoad","alertManager","alert","langText","ExternalEventBus","debug","events","subscriptionNotifiers","_debugDispatch","_dispatch","_notifiySubscriptionChange","notifiers","args","shift","callResult","apply","log","InternalEventBus","_debugChain","_chain","_debugConfirm","_confirm","fallback","confirmed","TableRegistry","tables","query","results","querySelectorAll","matchElement","Tabulator","lookupTable","Popup","container","_lookupContainer","reversedX","childPopup","blurable","blurCallback","renderedCallback","blurEvent","escEvent","_escapeCheck","destroyBinding","_checkContainerIsParent","body","touch","MouseEvent","x","touches","pageX","y","pageY","parentOffset","containerOffset","origin","parentEl","coords","elementPositionCoords","containerEventCoords","_fitToScreen","keyCode","Module","_handler","register","func","initGuard","registerDataPipelineHandler","registerDisplayPipelineHandler","append","menuEl","menuContainer","content","reinitializeColumnWidths","responsiveLayout","modExists","colsWidth","gap","lastCol","responsive","flexWidth","flexGrowUnits","flexColWidth","flexColumns","fixedShrinkColumns","flexShrinkUnits","overflowWidth","gapFill","calcWidth","scaleColumns","freeSpace","shrinkCols","oversizeCols","oversizeSpace","remainingSpace","nextColWidth","remainingFlexGrowUnits","changeUnits","undersizeCols","calcGrow","widthGrow","calcShrink","widthShrink","fitData","fitDataFill","fitDataGeneral","fitDataTable","fitDataStretch","fitColumns","Layout","mode","registerTableOption","registerColumnOption","modes","moduleName","defaultModes","Localize","locale","lang","langList","langs","headerFilterPlaceholder","setHeaderFilterPlaceholder","installLang","setLocale","registerTableFunction","getLang","headerFilters","_setLangProp","desiredLocale","traverseLang","trans","prop","navigator","language","toLowerCase","prefix","_executeBindings","pathArray","_getLangElement","level","rootPath","binding","defaultLangs","Comms","receive","selectors","connections","connection","con","action","tableComms","commsReceived","ModuleBinder","tabulator","bindStaticFuctionality","bindModules","coreModules","moduleBindings","extendModule","property","source","registerModule","mod","registerModuleBinding","findTable","prototype","orderedStartMods","orderedEndMods","unOrderedMods","moduleCore","modulesCore","moduleInitOrder","modulesRegular","core","mods","Alert","_createAlertElement","msgElement","_createMsgElement","_typeClass","interactionMonitor","browserSlow","browserMobile","rtl","originalElement","initializeCoreSystems","_create","_clearObjectPointers","_mapDeprecatedFunctionality","InteractionMonitor","getSelection","empty","removeAllRanges","selection","_rtlCheck","_buildElement","_initializeTable","_loadInitialData","getComputedStyle","direction","reactiveData","newElement","tagName","attributes","replaceChild","_detectBrowser","deregister","ua","userAgent","vendor","opera","test","msg","stack","line","Error","trim","restoreRedraw","blockActiveLoad","clearData","getDataCount","responses","addRows","newRows","getRowFromPosition","foundRows","fromRow","getDefinitionTree","fromColumn","plugin","required","Accessor","allowedTypes","initializeColumn","transformRow","charAt","toUpperCase","accessor","lookupAccessor","accessors","rowComponent","traverse","colCompnent","defautlAccessors","method","generateParamsList","serializeParams","encoded","encodeURIComponent","join","url","contentType","urlGenerator","ajaxContentType","contentTypeFormatters","headers","Accept","location","credentials","fetch","json","status","statusText","stringify","form","FormData","Ajax","loaderPromise","ajaxRequestFunc","defaultLoaderPromise","ajaxURLGenerator","defaultURLGenerator","ajaxURL","setUrl","setDefaultConfig","ajaxConfig","getUrl","requestDataCheck","requestParams","requestData","ajaxParams","previousData","generateConfig","sendRequest","defaultConfig","ajaxRequesting","ajaxResponse","defaultContentTypeFormatters","updateOrAddData","insert","addData","clipboard","headerFindSuccess","columnMap","Clipboard","pasteParser","pasteAction","customSelection","rowRange","blocked","clipboardCopyRowRange","plain","html","preventDefault","clipboardCopyFormatter","generateExportList","clipboardCopyConfig","clipboardCopyStyled","genereateHTMLTable","generatePlainContent","clipboardData","originalEvent","reset","paste","setPasteParser","clipboardPasteParser","setPasteAction","clipboardPasteAction","getKey","range","internal","sel","textRange","createRange","selectNodeContents","toString","addRange","createTextRange","moveToElementText","select","execCommand","pasteActions","parser","pasteParsers","checkPaseOrigin","getPasteData","mutateData","mutator","valid","edit","currentCell","defaultPasteActions","defaultPasteParsers","CalcComponent","calcParams","precision","reduce","sum","Number","toFixed","parseFloat","String","ColumnCalcs","topCalcs","botCalcs","genColumn","topElement","botElement","botRow","topInitialized","botInitialized","cellValueChanged","initializeColumnCheck","rowsUpdated","recalcActiveRows","recalcActiveRowsRefresh","tableRedraw","getResults","userRecalc","recalc","groupBy","recalcRowGroup","dataTreeStartExpanded","dataTree","recalcAll","topCalc","bottomCalc","columnCalcs","topCalcParams","botCalcParams","bottomCalcParams","calculations","initializeTopRow","botCalc","initializeBottomRow","footerRemove","footerPrepend","rowsToData","generateRow","frozenColumns","recalcGroup","groupRows","getRowGroup","groups","getChildGroups","generateRowData","dataTreeChildColumnCalcs","open","getFilteredTreeChildren","disable","enable","format","getFormatter","paramKey","getGroups","getGroupResults","groupObj","subGroups","getSubGroups","subGroupResults","subgroup","defaultCalculations","DataTree","indent","collapseEl","expandEl","branchEl","elementField","startOpen","registerComponentFunction","collapseRow","expandRow","toggleRow","getTreeParent","getRowChildren","addTreeChildRow","isRowExpanded","dummyEl","dataTreeChildField","dataTreeChildIndent","dataTreeBranchElement","dataTreeCollapseElement","tabIndex","dataTreeExpandElement","layoutRow","rowDelete","rowDataChanged","columnMoving","initializeElementField","tableRedrawing","registerDisplayHandler","reinitializeRowChildren","firstCol","getFirstVisibleColumn","dataTreeElementColumn","getTreeChildren","redrawNeeded","refreshData","childArray","controlEl","generateControlElement","cloneNode","marginRight","getPropertyValue","oldControl","getChildren","allChildren","generateChildren","dataTreeFilter","dataTreeSort","subChildren","sub","childData","childRow","getTreeParentRoot","childIndex","findChildIndex","recurse","setFileContents","delimiter","fileContents","depth","bom","header","autoTableParams","rowGroupStyles","fontStyle","fontSize","cellPadding","fillColor","rowCalcStyles","jsPDFParams","jsPDF","orientation","unit","parseRow","styles","colSpan","rowSpan","doc","jspdf","autoTable","didDrawPage","head","documentProcessing","self","sheetName","workbook","XLSX","utils","book_new","tableFeatures","SheetNames","Sheets","generateSheet","merges","worksheet","s","c","r","j","Date","sheet_add_aoa","encode_range","sheetOnly","sheets","sheet","commsSend","intercept","s2ab","buf","ArrayBuffer","view","Uint8Array","charCodeAt","write","bookType","bookSST","csv","jsonLines","pdf","xlsx","Download","blob","download","downloadToTab","filename","interceptCallback","downloadFunc","buildLink","mime","triggerDownload","downloaders","downloadConfig","downloadRowRange","groupHeader","groupHeaderDownload","_group","getRowCount","newTab","Blob","downloadReady","URL","createObjectURL","msSaveOrOpenBlob","click","defaultDownloaders","maskInput","mask","maskLetter","maskLetterChar","maskNumber","maskNumberChar","maskWildcard","maskWildcardChar","fillSymbols","symbol","char","maskAutoFill","onRendered","success","cancel","editorParams","cellValue","input","search","padding","boxSizing","elementAttributes","getAttribute","preventScroll","selectContents","onChange","vertNav","verticalNavigation","count","whiteSpace","getRow","heightNow","selectionStart","stopImmediatePropagation","step","blurFunc","Edit","editor","_initializeParams","displayItems","currentItems","focusedItem","_createInputElement","listEl","_createListElement","initialValues","isFilter","filterTimeout","filtered","typing","popup","listIteration","actions","_deprecationCheck","_initializeValue","_onRendered","listItemFormatter","sortValuesList","searchFunc","searchingPlaceholder","defaultValue","multiselect","headerFilterInitialListGen","cellEl","clickStop","_preventBlur","_inputKeyDown","attribs","clearable","autocomplete","cursor","caretColor","_bindInputEvents","valueKeys","valueCheck","placeholderLoading","placeholderEmpty","filterDelay","emptyValue","freetext","filterFunc","filterRemote","allowEmpty","listOnEmpty","valuesLookup","valuesURL","_inputFocus","_inputClick","_inputBlur","_inputSearch","_inputKeyUp","rebuildOptionsList","clearTimeout","_filterList","_clearChoices","_keyUp","_keyDown","_keySide","_keyEnter","_keyEsc","_keyHomeEnd","_keySelectLetter","_keyAutoCompLetter","_focusItem","_chooseItem","_cancel","_scrollToValue","_filter","character","fromCharCode","filterTerm","label","scrollIntoView","behavior","block","inline","_generateOptions","_sortOptions","_buildList","_showList","isInteger","_filterOptions","itteration","_ajaxRequest","_uniqueColumnValues","valuesLookupField","_addPlaceholder","responseValues","_parseList","_clearList","term","urlBuilder","getColumnByField","getColumn","inputValues","entries","_parseListItem","_parseListGroup","itemParams","selected","original","_defaultSortFunction","_sortGroup","as","bs","a1","b1","L","rx","rd","emptyAlign","isFinite","_defaultFilterFunc","_filterItem","_buildItem","itemFormatter","_groupClick","_itemClick","_styleItem","startVis","isVisible","_setListWidth","hideOnBlur","_resolveValue","blur","List","maxStars","getElementsByTagName","size","stars","starsHolder","star","createElementNS","starChange","buildStar","starHolder","nextStar","changeValue","overflow","textOverflow","percent","bar","mouseDrag","mouseDragWidth","updateValue","calcVal","round","backgroundColor","screenX","tristate","indetermValue","indeterminateValue","indetermState","trueValueSet","falseValueSet","marginTop","indeterminate","checked","trueValue","checkedValue","falseValue","textarea","number","progress","tickCross","mouseClick","recursionBlock","invalidEdit","editedCells","editors","getEditedCells","clearCellEdited","navigatePrev","navigateNext","navigateLeft","navigateRight","navigateUp","navigateDown","cellisEdited","clearEdited","editCell","cellCancelEdit","bindEditor","columnDeleteCheck","rowDeleteCheck","cancelEdit","keybindingNavigateNext","newRow","edited","nextCell","findNextEditableCell","getIndex","findPrevEditableCell","allowEdit","check","prevCell","editable","clearEditor","variableHeight","cellEditCancelled","contains","button","forceEdit","focusCellNoEvent","getRenderMode","leftEdge","rightEdge","leftMargin","rightMargin","rendered","cellEditor","validationMode","focusScrollAdjust","cellClick","cellEditing","editIndex","defaultEditors","ExportRow","ExportColumn","Export","cloneTableStyle","colVisProp","getHtml","columnHeaders","headersToExportRows","generateColumnGroupHeaders","bodyToExportRows","rowLookup","genereateTableElement","selectRow","selectedRows","columnGroups","colData","processColumnGroup","maxDepth","groupData","subGroup","subGroupData","columnVisCheck","headerDepth","exportRows","parseColumnGroup","rowGroups","exportCols","headerEl","bodyEl","lookupTableStyles","setup","treeElementField","mapElementStyles","genereateHeaderElement","genereateGroupElement","genereateCalcElement","genereateRowElement","evenRow","oddRow","calcRow","firstRow","firstGroup","getElementsByClassName","styleCells","firstCell","lastCell","generator","cellWrapper","formatCells","formatExportValue","align","htmlOutputConfig","props","lookup","fromStyle","filterVal","rowVal","filterParams","RegExp","keywords","separator","keyword","matchAll","endsWith","Filter","filterList","headerFilterColumns","prevHeaderFilterChangeCheck","tableInitialized","searchRows","searchData","userSetFilter","userRefreshFilter","userAddFilter","getFilters","userSetHeaderFilterFocus","userGetHeaderFilterValue","userSetHeaderFilterValue","getHeaderFilters","userRemoveFilter","userClearFilter","userClearHeaderFilter","setHeaderFilterFocus","reloadHeaderFilter","getHeaderFilterValue","setHeaderFilterValue","initializeColumnHeaderFilter","hideHeaderFilterElements","showHeaderFilterElements","tableBuilt","filterMode","remoteFilterParams","registerDataHandler","initialFilter","setFilter","initialHeaderFilter","refreshFilter","addFilter","removeFilter","all","clearFilter","clearHeaderFilter","headerFilter","setHeaderFilterColumnPlaceholder","filterType","tagType","attrType","filterChangeCheck","prevSuccess","emptyFunc","headerFilterFunc","filters","headerFilterFuncParams","fieldVal","colVal","trackChanges","generateHeaderFilterElement","filterElement","editorElement","typingTimer","searchTrigger","headerElement","headerFilterEmptyCheck","headerFilterParams","headerPos","headerFilterLiveFilterDelay","hasAttribute","headerFilterLiveFilter","reloadData","findFilter","findSubFilters","ajax","filtersToArray","searchType","filterRecurse","rowList","activeRowComponents","filterRow","subFilter","defaultFilters","formatterParams","emptyToSpace","sanitizeHTML","floatVal","sign","integer","decimal","rgx","decimalSym","thousandSym","thousand","negativeSign","symbolAfter","urlPrefix","labelTraverse","labelField","urlField","src","urlSuffix","truthy","allowTruthy","tick","tickElement","cross","crossElement","DT","DateTime","luxon","inputFormat","outputFormat","invalid","invalidPlaceholder","newDatetime","isDateTime","fromISO","fromFormat","isValid","timezone","setZone","toFormat","suffix","humanize","date","now","toHuman","starActive","starInactive","colors","color","percentValue","legendAlign","legend","legendColor","barEl","barContainer","legendEl","holderEl","toggleList","isOpen","checkbox","selectableRangeMode","toggleSelect","handleComplexRowClick","isSelected","registerRowSelectCheckbox","deselectRow","registerHeaderSelectCheckbox","plaintext","money","link","image","datetime","datetimediff","traffic","buttonTick","buttonCross","rownum","responsiveCollapse","rowSelection","Format","formatValue","formatHeader","lookupFormatter","formatterPrint","print","formatterClipboard","formatterHtmlOutput","htmlOutput","formatters","mockCell","titleFormatter","titleFormatterParams","entityMap","defaultFormatters","FrozenColumns","leftColumns","rightColumns","rightPadding","initializationMode","layoutCell","reinitializeColumns","blockLayout","unblockLayout","edge","frozenCheck","calcMargins","layoutColumnPosition","layoutCalcRows","_calcSpace","layoutGroupCalcs","groupList","allCells","leftParents","marginValue","getColGroupParentElement","otherRows","deinitialize","getTableElement","FrozenRows","freezeRow","unfreezeRow","isRowFrozen","detachRow","styleRows","GroupComponent","groupManager","toggleVisibility","Group","oldGroup","hasSubGroups","groupIDLookups","_addRowToGroup","_addRow","elementContents","arrowElement","createElements","addBindings","createValueGroups","arrow","movableRows","moveRow","initializeGroupHeader","allowedValues","_createGroup","toggleElement","groupToggleElement","groupID","groupKey","headerGenerator","conformRowData","generateGroupHeaderContents","updateGroupRows","scrollHeader","groupValues","removeGroup","noCalc","_visSet","getHeadersAndRows","hasTopCalcs","detachElement","generateTopRow","hasBottomCalcs","generateBottomRow","groupClosedShowCalcs","getDisplayIndex","checkClassicModeGroupHeaderWidth","prev","compoment","getPath","childNodes","GroupRows","displayHandler","setGroupBy","setGroupValues","setGroupStartOpen","setGroupHeader","userGetGroups","userGetGroupedData","rowGetGroup","groupUpdateOnCellEdit","cellUpdated","reassignRowToGroup","configureGroupSetup","rowDeleting","scrollHeaders","rowMoving","rowAddingIndex","rowSample","virtualRenderFill","groupStartOpen","langValue","items","removeCalcs","getRealColumns","lookupFunc","prevValue","assignRowToGroup","getGroupedData","toGroup","fromGroup","removeRow","insertRow","generateGroups","groupComponents","groupListData","rowCount","headerContent","pullGroupListData","oldGroups","createGroup","assignRowToExistingGroup","newGroupNeeded","oldRowGroup","oldGroupPath","newGroupPath","getExpectedPath","samePath","every","groupPath","groupId","cellEdit","rowAdd","_rebindRow","rowMove","posFrom","newValue","posTo","History","history","clearComponentHistory","rowDeleted","rowAdded","rowMoved","undo","redo","getHistoryUndoSize","getHistoryRedoSize","getGroup","undoers","redoers","oldRow","defaultUndoers","defaultRedoers","HtmlTableImport","fieldIndex","hasIndex","tableElementCheck","parseTable","_extractOptions","_extractHeaders","_generateBlankHeaders","optionsArr","attrib","_attribValue","exists","_findCol","textContent","csvImporter","inQuote","nextChar","Import","importFromFile","importFormat","loadDataCheck","loadData","importData","lookupImporter","structureData","err","importer","importers","extension","pickFile","extensions","accept","file","files","reader","FileReader","importReader","readAsArrayBuffer","readAsBinaryString","readAsDataURL","readAsText","onload","onerror","parsedData","structureArrayToObject","structureArrayToColumns","getColumns","defaultImporters","Interaction","eventMap","rowClick","rowDblClick","rowContext","rowMouseEnter","rowMouseLeave","rowMouseOver","rowMouseOut","rowMouseMove","rowTap","rowDblTap","rowTapHold","cellDblClick","cellContext","cellMouseEnter","cellMouseLeave","cellMouseOver","cellMouseOut","cellMouseMove","cellTap","cellDblTap","cellTapHold","headerClick","headerDblClick","headerContext","headerMouseEnter","headerMouseLeave","headerMouseOver","headerMouseOut","headerMouseMove","headerTap","headerDblTap","headerTapHold","groupClick","groupDblClick","groupContext","groupMouseEnter","groupMouseLeave","groupMouseOver","groupMouseOut","groupMouseMove","groupTap","groupDblTap","groupTapHold","subscribers","touchSubscribers","columnSubscribers","touchWatchers","tap","tapDbl","tapHold","initializeExternalEvents","cellContentsSelectionFixer","selectNode","subscriptionChangeExternal","subscribeTouchEvents","unsubscribeTouchEvents","handleTouch","notouch","watchers","componentObj","navPrev","navNext","navUp","navDown","scrollPageUp","scrollPageDown","scrollToStart","scrollToEnd","copyToClipboard","keyBlock","newPos","scrollMax","navLeft","navRight","Keybindings","watchKeys","pressedKeys","keyupBinding","keydownBinding","keybindings","mergedBindings","mapBindings","bindEvents","clearBindings","bindingList","mapBinding","symbolsList","ctrl","meta","symbols","code","checkBinding","ctrlKey","shiftKey","metaKey","defaultBindings","defaultActions","Menu","nestedMenuBlock","currentComponent","rootPopup","deprecationCheck","initializeRowWatchers","initializeGroupWatchers","rowContextMenu","loadMenuEvent","on","rowClickMenu","groupContextMenu","groupClickMenu","headerContextMenu","loadMenuTableColumnEvent","headerClickMenu","headerMenu","initializeColumnHeaderMenu","contextMenu","loadMenuTableCellEvent","clickMenu","icon","headerMenuIcon","headerMenuEl","menu","loadMenu","parentPopup","itemEl","disabled","MoveColumns","placeholderElement","createPlaceholderElement","hoverElement","checkTimeout","checkPeriod","moving","toCol","toColAfter","startX","autoScrollMargin","autoScrollStep","autoScrollTimeout","touchMove","moveHover","endMove","movableColumns","mousemove","which","startMove","bindTouchEvents","startXMove","prevColWidth","nextColWidthLast","prevColWidthLast","passive","moveToCol","_bindMouseMove","movingCells","_unbindMouseMove","columnHolder","xPos","scrollPos","MoveRows","toRowAfter","hasHandle","startY","tableRowDropEvent","connectionSelectorsTables","connectionSelectorsElements","connectionElements","connectedTable","connectedRow","movableRowsConnectedTables","movableRowsConnectedElements","initializeCell","mouseup","tableRowDrop","previousSibling","rowHandle","startYMove","nextRowHeight","prevRowHeight","nextRowHeightLast","prevRowHeightLast","setStartPosition","connectToTables","pointerEvents","disconnectFromTables","moveHoverConnections","moveHoverTable","rowHolder","yPos","connectionTables","commsConnections","dropEvent","elementRowDrop","tabulatorElementDropEvent","sender","movableRowsSender","senders","movableRowsReceiver","receivers","connect","disconnect","dropComplete","fromTable","toTable","Mutator","enabled","transformCell","mutateLink","lookupMutator","mutators","mutatorEdit","linkCell","defaultMutators","pageSize","currentRow","currentPage","totalRows","totalPages","showingEl","valueEl","ofEl","totalEl","rowsEl","pages","Page","progressiveLoad","pageCounterElement","pageCounter","page","remoteRowCountEstimate","initialLoad","dataChanging","pageSizes","setMaxPage","setPage","userSetPageToRow","userSetPageSize","getPageSize","previousPage","nextPage","getPage","getPageMax","setPageToRow","initialLoadComplete","calculatePageSizes","footerRedraw","paginationAddRow","rowAddingPosition","paginationMode","remotePageParams","_parseRemoteData","restOnRenderBefore","initializePageCounter","initializePaginator","initializeProgressive","scrollVertical","dispRows","testElRow","testElCell","paginationSize","generatePageSizeSelectList","setPageSize","progressiveLoadScrollMargin","pagesElement","firstBut","prevBut","nextBut","lastBut","paginationSizeSelector","pageSizeSelect","counter","paginationCounter","pageCounters","hidden","pageSelectLabel","paginationCounterHolder","paginationElement","paginationCounterElement","footerAppend","paginationInitialPage","paginationButtonCount","trigger","leftSize","rightSize","_generatePageButton","actualRowPageSize","actualStartRow","actualRows","setMaxRows","_setPageButtons","_setPageCounter","last_page","last_row","progressiveLoadDelay","footer","defaultPageCounters","local","id","localStorage","getItem","cookie","cookiePos","setItem","expireDate","setDate","getDate","toUTCString","Persistence","defWatcherBlock","readFunc","writeFunc","testKey","removeItem","persistence","persistenceMode","persistenceID","retreivedData","localStorageTest","persistenceReaderFunc","readers","persistenceWriterFunc","writers","retreiveData","save","eventSave","getColumnLayout","setColumnLayout","sorters","initialSort","parseColumns","mergeDefinition","getOwnPropertyDescriptor","defineProperty","set","current","oldCols","newCols","_findColumn","validateSorters","getSort","getGroupConfig","getPageConfig","excludedKeys","defStore","colDef","defaultReaders","defaultWriters","rowContextPopup","loadPopupEvent","rowClickPopup","groupContextPopup","groupClickPopup","headerContextPopup","loadPopupTableColumnEvent","headerClickPopup","headerPopup","initializeColumnHeaderPopup","contextPopup","loadPopupTableCellEvent","clickPopup","headerPopupIcon","headerPopupEl","loadPopup","contentsEl","renderCallback","Print","manualBlock","printAsHtml","replaceTable","cleanup","printFullscreen","genereateTable","printConfig","printStyled","printRowRange","scrollX","scrollY","footerEl","tableEl","footerContent","printHeader","printFooter","printFormatter","scrollTo","ReactiveData","origFuncs","currentVersion","unblock","watchRow","watchData","unwatchData","version","enumerable","configurable","arg","getRowFromDataObject","pop","startRow","oldRows","writable","watchKey","watchTreeChildren","childField","rebuildTree","ResizeColumns","startColumn","startWidth","latestX","initialNextColumn","layoutColumnHeader","layoutCellHandles","deInitializeComponent","resizeHandle","columnLayoutUpdated","deInitializeColumn","columnWidthUpdated","resizable","initializeEventWatchers","reinitializeColumn","frozenOffset","handleEl","nearestColumn","_checkResizability","handleDown","_mouseDown","oldWidth","parentElement","mouseMove","startDiff","moveDiff","blockedBefore","blockedAfter","resizableColumnFit","checkCellHeights","mouseUp","ResizeRows","startHeight","prevHandle","prevHandleDown","screenY","ResizeTable","observer","containerObserver","tableHeight","containerWidth","autoResize","tableStyle","ResizeObserver","entry","nodeHeight","contentRect","nodeWidth","observe","tableResized","unobserve","ResponsiveLayout","hiddenColumns","collapseFormatter","collapseStartOpen","collapseHandleColumn","updateColumnVisibility","initializeResponsivity","responsiveLayoutCollapseFormatter","formatCollapsedData","responsiveLayoutCollapseStartOpen","order","generateCollapsedContent","generateCollapsedRowContent","colCount","working","getFlexBaseWidth","hideColumn","showColumn","generateCollapsedRowData","mockCellComponent","responsiveLayoutCollapseUseFormatters","titleData","valueData","node_content","titleHighlight","SelectRow","selecting","lastClickedRow","selectPrev","headerCheckboxElement","selectRows","deselectRows","getSelectedRows","getSelectedData","isRowSelected","selectable","clearSelectionData","rowRetrieve","selectablePersistence","_deselectRow","_rowSelectionChanged","endSelect","selectableCheck","getCurrentCell","_clearSelection","lastClickedRowIdx","rowIdx","fromRowIdx","toRowIdx","toggledRows","toggledRow","_selectRow","rowMatch","rowInfo","selectableRollingSelection","checkboxEl","dataTreeSelectPropagate","childRowSelection","selectedRow","aRow","bRow","alignEmptyValues","decimalSeparator","thousandSeparator","langLocale","localeCompare","el1","el2","calc","d","string","time","boolean","array","alphanum","Sort","sortList","userSetSort","clearSort","sortMode","remoteSortParams","setSort","refreshSort","arrowEl","sorterParams","startingDir","headerSortStartingDir","headerSortTristate","headerSort","headerSortElement","columnHeaderSortMulti","newSortList","sortOrderReverse","sortListActual","rowComponents","clearColumnHeaders","sortObj","findSorter","setColumnHeader","_sortItems","sorterCount","sortItem","_sortRow","el1Comp","el2Comp","defaultSorters","Tooltip","tooltipSubscriber","headerSubscriber","timeout","popupInstance","tooltipGenerationMode","headerTooltip","mousemoveCheck","mouseoutCheck","tooltip","clearPopup","loadTooltip","tooltipDelay","parameters","numeric","starts","ends","minLength","maxLength","regex","reg","unique","cellData","Validate","invalidCells","getInvalidCells","userClearCellValidation","userValidate","cellIsValid","clearValidation","cellValidate","columnValidate","rowValidate","editValidate","editorClear","editedClear","previousValue","validate","cancelled","validator","_extractValidator","substring","_buildValidator","validators","failedValidators","invalidIndex","defaultValidators","TabulatorFull"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,KAAKrB,YAAL,CAAkB7xE,OAAlB,CAA0B3I,IAA1B,CAAf;;EAEA,YAAG67E,YAAY,GAAG,CAAC,CAAnB,EAAqB;EACpB,eAAKrB,YAAL,CAAkB3uE,MAAlB,CAAyBgwE,YAAzB,EAAuC,CAAvC;EACA;EACD;EACD;;;;IAvSqBhwD;;EA0SvB0uD,QAAQ,CAACtrD,UAAT,GAAsB,UAAtB;;EAGAsrD,QAAQ,CAACoB,UAAT,GAAsBG,iBAAtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MC5SMC;;;;;;;;;;;;IAAsBlyD;;EAG5B,IAAI2H,YAAJ,CAAiBuqD,aAAjB,EAAgCx+E,OAAhC;;;;"} \ No newline at end of file diff --git a/dist/js/tabulator.min.js b/dist/js/tabulator.min.js index 682d46e17..d0f43d298 100644 --- a/dist/js/tabulator.min.js +++ b/dist/js/tabulator.min.js @@ -1,3 +1,3 @@ -/* Tabulator v5.2.4 (c) Oliver Folkerd 2022 */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Tabulator=t()}(this,(function(){"use strict";function e(t){return(e="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})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var i=0;ie.length)&&(t=e.length);for(var i=0,n=new Array(t);i=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 a,r=!0,s=!1;return{s:function(){i=e[Symbol.iterator]()},n:function(){var e=i.next();return r=e.done,e},e:function(e){s=!0,a=e},f:function(){try{r||null==i.return||i.return()}finally{if(s)throw a}}}}var g=function(){function e(i){t(this,e),this.table=i}return o(e,[{key:"reloadData",value:function(e,t,i){return this.table.dataLoader.load(e,void 0,void 0,void 0,t,i)}},{key:"langText",value:function(){var e;return(e=this.table.modules.localize).getText.apply(e,arguments)}},{key:"langBind",value:function(){var e;return(e=this.table.modules.localize).bind.apply(e,arguments)}},{key:"langLocale",value:function(){var e;return(e=this.table.modules.localize).getLocale.apply(e,arguments)}},{key:"commsConnections",value:function(){var e;return(e=this.table.modules.comms).getConnections.apply(e,arguments)}},{key:"commsSend",value:function(){var e;return(e=this.table.modules.comms).send.apply(e,arguments)}},{key:"layoutMode",value:function(){return this.table.modules.layout.getMode()}},{key:"layoutRefresh",value:function(){return this.table.modules.layout.layout()}},{key:"subscribe",value:function(){var e;return(e=this.table.eventBus).subscribe.apply(e,arguments)}},{key:"unsubscribe",value:function(){var e;return(e=this.table.eventBus).unsubscribe.apply(e,arguments)}},{key:"subscribed",value:function(e){return this.table.eventBus.subscribed(e)}},{key:"subscriptionChange",value:function(){var e;return(e=this.table.eventBus).subscriptionChange.apply(e,arguments)}},{key:"dispatch",value:function(){var e;return(e=this.table.eventBus).dispatch.apply(e,arguments)}},{key:"chain",value:function(){var e;return(e=this.table.eventBus).chain.apply(e,arguments)}},{key:"confirm",value:function(){var e;return(e=this.table.eventBus).confirm.apply(e,arguments)}},{key:"dispatchExternal",value:function(){var e;return(e=this.table.externalEvents).dispatch.apply(e,arguments)}},{key:"subscribedExternal",value:function(e){return this.table.externalEvents.subscribed(e)}},{key:"subscriptionChangeExternal",value:function(){var e;return(e=this.table.externalEvents).subscriptionChange.apply(e,arguments)}},{key:"options",value:function(e){return this.table.options[e]}},{key:"setOption",value:function(e,t){return void 0!==t&&(this.table.options[e]=t),this.table.options[e]}},{key:"module",value:function(e){return this.table.module(e)}}]),e}(),v=function(){function e(i){return t(this,e),this._column=i,this.type="ColumnComponent",new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._column.table.componentFunctionBinder.handle("column",e._column,t)}})}return o(e,[{key:"getElement",value:function(){return this._column.getElement()}},{key:"getDefinition",value:function(){return this._column.getDefinition()}},{key:"getField",value:function(){return this._column.getField()}},{key:"getTitleDownload",value:function(){return this._column.getTitleDownload()}},{key:"getCells",value:function(){var e=[];return this._column.cells.forEach((function(t){e.push(t.getComponent())})),e}},{key:"isVisible",value:function(){return this._column.visible}},{key:"show",value:function(){this._column.isGroup?this._column.columns.forEach((function(e){e.show()})):this._column.show()}},{key:"hide",value:function(){this._column.isGroup?this._column.columns.forEach((function(e){e.hide()})):this._column.hide()}},{key:"toggle",value:function(){this._column.visible?this.hide():this.show()}},{key:"delete",value:function(){return this._column.delete()}},{key:"getSubColumns",value:function(){var e=[];return this._column.columns.length&&this._column.columns.forEach((function(t){e.push(t.getComponent())})),e}},{key:"getParentColumn",value:function(){return this._column.parent instanceof C&&this._column.parent.getComponent()}},{key:"_getSelf",value:function(){return this._column}},{key:"scrollTo",value:function(){return this._column.table.columnManager.scrollToColumn(this._column)}},{key:"getTable",value:function(){return this._column.table}},{key:"move",value:function(e,t){var i=this._column.table.columnManager.findColumn(e);i?this._column.table.columnManager.moveColumn(this._column,i,t):console.warn("Move Error - No matching column found:",i)}},{key:"getNextColumn",value:function(){var e=this._column.nextColumn();return!!e&&e.getComponent()}},{key:"getPrevColumn",value:function(){var e=this._column.prevColumn();return!!e&&e.getComponent()}},{key:"updateDefinition",value:function(e){return this._column.updateDefinition(e)}},{key:"getWidth",value:function(){return this._column.getWidth()}},{key:"setWidth",value:function(e){var t;return t=!0===e?this._column.reinitializeWidth(!0):this._column.setWidth(e),this._column.table.columnManager.renderer.rerenderColumns(!0),t}}]),e}(),b={title:void 0,field:void 0,columns:void 0,visible:void 0,hozAlign:void 0,vertAlign:void 0,width:void 0,minWidth:40,maxWidth:void 0,maxInitialWidth:void 0,cssClass:void 0,variableHeight:void 0,headerVertical:void 0,headerHozAlign:void 0,editableTitle:void 0},y=function(){function e(i){return t(this,e),this._cell=i,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._cell.table.componentFunctionBinder.handle("cell",e._cell,t)}})}return o(e,[{key:"getValue",value:function(){return this._cell.getValue()}},{key:"getOldValue",value:function(){return this._cell.getOldValue()}},{key:"getInitialValue",value:function(){return this._cell.initialValue}},{key:"getElement",value:function(){return this._cell.getElement()}},{key:"getRow",value:function(){return this._cell.row.getComponent()}},{key:"getData",value:function(){return this._cell.row.getData()}},{key:"getField",value:function(){return this._cell.column.getField()}},{key:"getColumn",value:function(){return this._cell.column.getComponent()}},{key:"setValue",value:function(e,t){void 0===t&&(t=!0),this._cell.setValue(e,t)}},{key:"restoreOldValue",value:function(){this._cell.setValueActual(this._cell.getOldValue())}},{key:"restoreInitialValue",value:function(){this._cell.setValueActual(this._cell.initialValue)}},{key:"checkHeight",value:function(){this._cell.checkHeight()}},{key:"getTable",value:function(){return this._cell.table}},{key:"_getSelf",value:function(){return this._cell}}]),e}(),w=function(i){a(r,i);var n=c(r);function r(e,i){var o;return t(this,r),(o=n.call(this,e.table)).table=e.table,o.column=e,o.row=i,o.element=null,o.value=null,o.initialValue,o.oldValue=null,o.modules={},o.height=null,o.width=null,o.minWidth=null,o.component=null,o.loaded=!1,o.build(),o}return o(r,[{key:"build",value:function(){this.generateElement(),this.setWidth(),this._configureCell(),this.setValueActual(this.column.getFieldValue(this.row.data)),this.initialValue=this.value}},{key:"generateElement",value:function(){this.element=document.createElement("div"),this.element.className="tabulator-cell",this.element.setAttribute("role","gridcell"),this.element=this.element}},{key:"_configureCell",value:function(){var e=this.element,t=this.column.getField();(e.style.textAlign=this.column.hozAlign,this.column.vertAlign&&(e.style.display="inline-flex",e.style.alignItems={top:"flex-start",bottom:"flex-end",middle:"center"}[this.column.vertAlign]||"",this.column.hozAlign&&(e.style.justifyContent={left:"flex-start",right:"flex-end",center:"center"}[this.column.hozAlign]||"")),t&&e.setAttribute("tabulator-field",t),this.column.definition.cssClass)&&this.column.definition.cssClass.split(" ").forEach((function(t){e.classList.add(t)}));this.dispatch("cell-init",this),this.column.visible||this.hide()}},{key:"_generateContents",value:function(){var t,i=this;switch(e(t=this.chain("cell-format",this,null,(function(){return i.element.innerHTML=i.value})))){case"object":if(t instanceof Node){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.appendChild(t)}else this.element.innerHTML="",null!=t&&console.warn("Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",t);break;case"undefined":case"null":this.element.innerHTML="";break;default:this.element.innerHTML=t}}},{key:"cellRendered",value:function(){this.dispatch("cell-rendered",this)}},{key:"getElement",value:function(e){return this.loaded||(this.loaded=!0,e||this.layoutElement()),this.element}},{key:"getValue",value:function(){return this.value}},{key:"getOldValue",value:function(){return this.oldValue}},{key:"setValue",value:function(e,t,i){this.setValueProcessData(e,t,i)&&(this.dispatch("cell-value-updated",this),this.cellRendered(),this.column.definition.cellEdited&&this.column.definition.cellEdited.call(this.table,this.getComponent()),this.dispatchExternal("cellEdited",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()))}},{key:"setValueProcessData",value:function(e,t,i){var n=!1;return(this.value!==e||i)&&(n=!0,t&&(e=this.chain("cell-value-changing",[this,e],null,e))),this.setValueActual(e),n&&this.dispatch("cell-value-changed",this),n}},{key:"setValueActual",value:function(e){this.oldValue=this.value,this.value=e,this.dispatch("cell-value-save-before",this),this.column.setFieldValue(this.row.data,e),this.dispatch("cell-value-save-after",this),this.loaded&&this.layoutElement()}},{key:"layoutElement",value:function(){this._generateContents(),this.dispatch("cell-layout",this)}},{key:"setWidth",value:function(){this.width=this.column.width,this.element.style.width=this.column.widthStyled}},{key:"clearWidth",value:function(){this.width="",this.element.style.width=""}},{key:"getWidth",value:function(){return this.width||this.element.offsetWidth}},{key:"setMinWidth",value:function(){this.minWidth=this.column.minWidth,this.element.style.minWidth=this.column.minWidthStyled}},{key:"setMaxWidth",value:function(){this.maxWidth=this.column.maxWidth,this.element.style.maxWidth=this.column.maxWidthStyled}},{key:"checkHeight",value:function(){this.row.reinitializeHeight()}},{key:"clearHeight",value:function(){this.element.style.height="",this.height=null,this.dispatch("cell-height",this,"")}},{key:"setHeight",value:function(){this.height=this.row.height,this.element.style.height=this.row.heightStyled,this.dispatch("cell-height",this,this.row.heightStyled)}},{key:"getHeight",value:function(){return this.height||this.element.offsetHeight}},{key:"show",value:function(){this.element.style.display=this.column.vertAlign?"inline-flex":""}},{key:"hide",value:function(){this.element.style.display="none"}},{key:"delete",value:function(){this.dispatch("cell-delete",this),!this.table.rowManager.redrawBlock&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=!1,this.column.deleteCell(this),this.row.deleteCell(this),this.calcs={}}},{key:"getIndex",value:function(){return this.row.getCellIndex(this)}},{key:"getComponent",value:function(){return this.component||(this.component=new y(this)),this.component}}]),r}(g),C=function(i){a(r,i);var n=c(r);function r(e,i){var o;return t(this,r),(o=n.call(this,i.table)).definition=e,o.parent=i,o.type="column",o.columns=[],o.cells=[],o.element=o.createElement(),o.contentElement=!1,o.titleHolderElement=!1,o.titleElement=!1,o.groupElement=o.createGroupElement(),o.isGroup=!1,o.hozAlign="",o.vertAlign="",o.field="",o.fieldStructure="",o.getFieldValue="",o.setFieldValue="",o.titleDownload=null,o.titleFormatterRendered=!1,o.mapDefinitions(),o.setField(o.definition.field),o.modules={},o.width=null,o.widthStyled="",o.maxWidth=null,o.maxWidthStyled="",o.maxInitialWidth=null,o.minWidth=null,o.minWidthStyled="",o.widthFixed=!1,o.visible=!0,o.component=null,o.definition.columns?(o.isGroup=!0,o.definition.columns.forEach((function(e,t){var i=new r(e,l(o));o.attachColumn(i)})),o.checkColumnVisibility()):i.registerColumnField(l(o)),o._initialize(),o.bindModuleColumns(),o}return o(r,[{key:"createElement",value:function(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.setAttribute("role","columnheader"),e.setAttribute("aria-sort","none"),e}},{key:"createGroupElement",value:function(){var e=document.createElement("div");return e.classList.add("tabulator-col-group-cols"),e}},{key:"mapDefinitions",value:function(){var e=this.table.options.columnDefaults;if(e)for(var t in e)void 0===this.definition[t]&&(this.definition[t]=e[t]);this.definition=this.table.columnManager.optionsList.generate(r.defaultOptionList,this.definition)}},{key:"checkDefinition",value:function(){var e=this;Object.keys(this.definition).forEach((function(t){-1===r.defaultOptionList.indexOf(t)&&console.warn("Invalid column definition option in '"+(e.field||e.definition.title)+"' column:",t)}))}},{key:"setField",value:function(e){this.field=e,this.fieldStructure=e?this.table.options.nestedFieldSeparator?e.split(this.table.options.nestedFieldSeparator):[e]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData}},{key:"registerColumnPosition",value:function(e){this.parent.registerColumnPosition(e)}},{key:"registerColumnField",value:function(e){this.parent.registerColumnField(e)}},{key:"reRegisterPosition",value:function(){this.isGroup?this.columns.forEach((function(e){e.reRegisterPosition()})):this.registerColumnPosition(this)}},{key:"_mapDepricatedFunctionality",value:function(){}},{key:"_initialize",value:function(){for(var e=this.definition;this.element.firstChild;)this.element.removeChild(this.element.firstChild);e.headerVertical&&(this.element.classList.add("tabulator-col-vertical"),"flip"===e.headerVertical&&this.element.classList.add("tabulator-col-vertical-flip")),this.contentElement=this._bindEvents(),this.contentElement=this._buildColumnHeaderContent(),this.element.appendChild(this.contentElement),this.isGroup?this._buildGroupHeader():this._buildColumnHeader(),this.dispatch("column-init",this)}},{key:"_bindEvents",value:function(){var e,t,i,n=this,o=this.definition;"function"==typeof o.headerClick&&this.element.addEventListener("click",(function(e){o.headerClick(e,n.getComponent())})),"function"==typeof o.headerDblClick&&this.element.addEventListener("dblclick",(function(e){o.headerDblClick(e,n.getComponent())})),"function"==typeof o.headerContext&&this.element.addEventListener("contextmenu",(function(e){o.headerContext(e,n.getComponent())})),"function"==typeof o.headerTap&&(i=!1,this.element.addEventListener("touchstart",(function(e){i=!0}),{passive:!0}),this.element.addEventListener("touchend",(function(e){i&&o.headerTap(e,n.getComponent()),i=!1}))),"function"==typeof o.headerDblTap&&(e=null,this.element.addEventListener("touchend",(function(t){e?(clearTimeout(e),e=null,o.headerDblTap(t,n.getComponent())):e=setTimeout((function(){clearTimeout(e),e=null}),300)}))),"function"==typeof o.headerTapHold&&(t=null,this.element.addEventListener("touchstart",(function(e){clearTimeout(t),t=setTimeout((function(){clearTimeout(t),t=null,i=!1,o.headerTapHold(e,this.getComponent())}),1e3)}),{passive:!0}),this.element.addEventListener("touchend",(function(e){clearTimeout(t),t=null})))}},{key:"_buildColumnHeader",value:function(){var e=this,t=this.definition;this.table;(this.dispatch("column-layout",this),void 0!==t.visible&&(t.visible?this.show(!0):this.hide(!0)),t.cssClass)&&t.cssClass.split(" ").forEach((function(t){e.element.classList.add(t)}));t.field&&this.element.setAttribute("tabulator-field",t.field),this.setMinWidth(parseInt(t.minWidth)),t.maxInitialWidth&&(this.maxInitialWidth=parseInt(t.maxInitialWidth)),t.maxWidth&&this.setMaxWidth(parseInt(t.maxWidth)),this.reinitializeWidth(),this.hozAlign=this.definition.hozAlign,this.vertAlign=this.definition.vertAlign,this.titleElement.style.textAlign=this.definition.headerHozAlign}},{key:"_buildColumnHeaderContent",value:function(){this.definition,this.table;var e=document.createElement("div");return e.classList.add("tabulator-col-content"),this.titleHolderElement=document.createElement("div"),this.titleHolderElement.classList.add("tabulator-col-title-holder"),e.appendChild(this.titleHolderElement),this.titleElement=this._buildColumnHeaderTitle(),this.titleHolderElement.appendChild(this.titleElement),e}},{key:"_buildColumnHeaderTitle",value:function(){var e=this,t=this.definition,i=document.createElement("div");if(i.classList.add("tabulator-col-title"),t.editableTitle){var n=document.createElement("input");n.classList.add("tabulator-title-editor"),n.addEventListener("click",(function(e){e.stopPropagation(),n.focus()})),n.addEventListener("change",(function(){t.title=n.value,e.dispatchExternal("columnTitleChanged",e.getComponent())})),i.appendChild(n),t.field?this.langBind("columns|"+t.field,(function(e){n.value=e||t.title||" "})):n.value=t.title||" "}else t.field?this.langBind("columns|"+t.field,(function(n){e._formatColumnHeaderTitle(i,n||t.title||" ")})):this._formatColumnHeaderTitle(i,t.title||" ");return i}},{key:"_formatColumnHeaderTitle",value:function(t,i){var n=this.chain("column-format",[this,i,t],null,(function(){return i}));switch(e(n)){case"object":n instanceof Node?t.appendChild(n):(t.innerHTML="",console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",n));break;case"undefined":case"null":t.innerHTML="";break;default:t.innerHTML=n}}},{key:"_buildGroupHeader",value:function(){var e=this;(this.element.classList.add("tabulator-col-group"),this.element.setAttribute("role","columngroup"),this.element.setAttribute("aria-title",this.definition.title),this.definition.cssClass)&&this.definition.cssClass.split(" ").forEach((function(t){e.element.classList.add(t)}));this.titleElement.style.textAlign=this.definition.headerHozAlign,this.element.appendChild(this.groupElement)}},{key:"_getFlatData",value:function(e){return e[this.field]}},{key:"_getNestedData",value:function(e){for(var t,i=e,n=this.fieldStructure,o=n.length,a=0;a-1&&this.columns.splice(t,1),this.columns.length||this.delete()}},{key:"setWidth",value:function(e){this.widthFixed=!0,this.setWidthActual(e)}},{key:"setWidthActual",value:function(e){isNaN(e)&&(e=Math.floor(this.table.element.clientWidth/100*parseInt(e))),e=Math.max(this.minWidth,e),this.maxWidth&&(e=Math.min(this.maxWidth,e)),this.width=e,this.widthStyled=e?e+"px":"",this.element.style.width=this.widthStyled,this.isGroup||this.cells.forEach((function(e){e.setWidth()})),this.parent.isGroup&&this.parent.matchChildWidths(),this.dispatch("column-width",this)}},{key:"checkCellHeights",value:function(){var e=[];this.cells.forEach((function(t){t.row.heightInitialized&&(null!==t.row.getElement().offsetParent?(e.push(t.row),t.row.clearCellHeight()):t.row.heightInitialized=!1)})),e.forEach((function(e){e.calcHeight()})),e.forEach((function(e){e.setCellHeight()}))}},{key:"getWidth",value:function(){var e=0;return this.isGroup?this.columns.forEach((function(t){t.visible&&(e+=t.getWidth())})):e=this.width,e}},{key:"getHeight",value:function(){return Math.ceil(this.element.getBoundingClientRect().height)}},{key:"setMinWidth",value:function(e){this.minWidth=e,this.minWidthStyled=e?e+"px":"",this.element.style.minWidth=this.minWidthStyled,this.cells.forEach((function(e){e.setMinWidth()}))}},{key:"setMaxWidth",value:function(e){this.maxWidth=e,this.maxWidthStyled=e?e+"px":"",this.element.style.maxWidth=this.maxWidthStyled,this.cells.forEach((function(e){e.setMaxWidth()}))}},{key:"delete",value:function(){var e=this;return new Promise((function(t,i){e.isGroup&&e.columns.forEach((function(e){e.delete()})),e.dispatch("column-delete",e);for(var n=e.cells.length,o=0;o-1&&this._nextVisibleColumn(e+1)}},{key:"_nextVisibleColumn",value:function(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._nextVisibleColumn(e+1)}},{key:"prevColumn",value:function(){var e=this.table.columnManager.findColumnIndex(this);return e>-1&&this._prevVisibleColumn(e-1)}},{key:"_prevVisibleColumn",value:function(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._prevVisibleColumn(e-1)}},{key:"reinitializeWidth",value:function(e){this.widthFixed=!1,void 0===this.definition.width||e||this.setWidth(this.definition.width),this.dispatch("column-width-fit-before",this),this.fitToData(e),this.dispatch("column-width-fit-after",this)}},{key:"fitToData",value:function(e){if(!this.isGroup){this.widthFixed||(this.element.style.width="",this.cells.forEach((function(e){e.clearWidth()})));var t=this.element.offsetWidth;if((!this.width||!this.widthFixed)&&(this.cells.forEach((function(e){var i=e.getWidth();i>t&&(t=i)})),t)){var i=t+1;this.maxInitialWidth&&!e&&(i=Math.min(i,this.maxInitialWidth)),this.setWidthActual(i)}}}},{key:"updateDefinition",value:function(e){var t,i=this;return this.isGroup||this.parent.isGroup?(console.error("Column Update Error - The updateDefinition function is only available on ungrouped columns"),Promise.reject("Column Update Error - The updateDefinition function is only available on columns, not column groups")):(t=Object.assign({},this.getDefinition()),t=Object.assign(t,e),this.table.columnManager.addColumn(t,!1,this).then((function(e){return t.field==i.field&&(i.field=!1),i.delete().then((function(){return e.getComponent()}))})))}},{key:"deleteCell",value:function(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}},{key:"getComponent",value:function(){return this.component||(this.component=new v(this)),this.component}}]),r}(g);C.defaultOptionList=b;var k=function(){function i(){t(this,i)}return o(i,null,[{key:"elVisible",value:function(e){return!(e.offsetWidth<=0&&e.offsetHeight<=0)}},{key:"elOffset",value:function(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}}},{key:"deepClone",value:function(t,i){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a={}.__proto__,r=[].__proto__;i||(i=Object.assign(Array.isArray(t)?[]:{},t));var s=function(){var s=t[l],u=void 0,c=void 0;null==s||"object"!==e(s)||s.__proto__!==a&&s.__proto__!==r||((u=o.findIndex((function(e){return e.subject===s})))>-1?i[l]=o[u].copy:(c=Object.assign(Array.isArray(s)?[]:{},s),o.unshift({subject:s,copy:c}),i[l]=n.deepClone(s,c,o)))};for(var l in t)s();return i}}]),i}(),E=function(){function i(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t(this,i),this.table=e,this.msgType=n,this.registeredDefaults=Object.assign({},o)}return o(i,[{key:"register",value:function(e,t){this.registeredDefaults[e]=t}},{key:"generate",value:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object.assign({},this.registeredDefaults);if(Object.assign(n,t),!1!==i.debugInvalidOptions||this.table.options.debugInvalidOptions)for(var o in i)n.hasOwnProperty(o)||console.warn("Invalid "+this.msgType+" option:",o);for(var o in n)o in i?n[o]=i[o]:Array.isArray(n[o])?n[o]=Object.assign([],n[o]):"object"===e(n[o])&&null!==n[o]?n[o]=Object.assign({},n[o]):void 0===n[o]&&delete n[o];return n}}]),i}(),R=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).elementVertical=e.rowManager.element,o.elementHorizontal=e.columnManager.element,o.tableElement=e.rowManager.tableElement,o.verticalFillMode="fit",o}return o(n,[{key:"initialize",value:function(){}},{key:"clearRows",value:function(){}},{key:"clearColumns",value:function(){}},{key:"reinitializeColumnWidths",value:function(e){}},{key:"renderRows",value:function(){}},{key:"renderColumns",value:function(){}},{key:"rerenderRows",value:function(e){e&&e()}},{key:"rerenderColumns",value:function(e,t){}},{key:"renderRowCells",value:function(e){}},{key:"rerenderRowCells",value:function(e,t){}},{key:"scrollColumns",value:function(e,t){}},{key:"scrollRows",value:function(e,t){}},{key:"resize",value:function(){}},{key:"scrollToRow",value:function(e){}},{key:"scrollToRowNearestTop",value:function(e){}},{key:"visibleRows",value:function(e){return[]}},{key:"rows",value:function(){return this.table.rowManager.getDisplayRows()}},{key:"styleRow",value:function(e,t){var i=e.getElement();t%2?(i.classList.add("tabulator-row-even"),i.classList.remove("tabulator-row-odd")):(i.classList.add("tabulator-row-odd"),i.classList.remove("tabulator-row-even"))}},{key:"clear",value:function(){this.clearRows(),this.clearColumns()}},{key:"render",value:function(){this.renderRows(),this.renderColumns()}},{key:"rerender",value:function(e){this.rerenderRows(),this.rerenderColumns()}},{key:"scrollToRowPosition",value:function(e,t,i){var n=this,o=this.rows().indexOf(e),a=e.getElement(),r=0;return new Promise((function(s,l){if(o>-1){if(void 0===i&&(i=n.table.options.scrollToRowIfVisible),!i&&k.elVisible(a)&&(r=k.elOffset(a).top-k.elOffset(n.elementVertical).top)>0&&re&&(e=i)}})),this.windowBuffer=2*e}},{key:"rerenderColumns",value:function(e,t){var i=this,n={cols:this.columns,leftCol:this.leftCol,rightCol:this.rightCol},o=0;e&&!this.initialized||(this.clear(),this.calcWindowBuffer(),this.scrollLeft=this.elementVertical.scrollLeft,this.vDomScrollPosLeft=this.scrollLeft-this.windowBuffer,this.vDomScrollPosRight=this.scrollLeft+this.elementVertical.clientWidth+this.windowBuffer,this.table.columnManager.columnsByIndex.forEach((function(e){var t={};if(e.visible){var n=e.getWidth();t.leftPos=o,t.rightPos=o+n,t.width=n,i.isFitData&&(t.fitDataCheck=!e.modules.vdomHoz||e.modules.vdomHoz.fitDataCheck),o+n>i.vDomScrollPosLeft&&othis.windowBuffer/2?this.rerenderColumns():e>0?(this.addColRight(),this.removeColLeft()):(this.addColLeft(),this.removeColRight())}},{key:"colPositionAdjust",value:function(e,t,i){for(var n=e;n=e.columns.length-1?e.vDomPadRight=0:e.vDomPadRight-=i.getWidth())):"break"};;){if("break"===i())break}t&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}},{key:"addColLeft",value:function(){for(var e=this,t=!1,i=function(){var i=e.columns[e.leftCol-1];if(!i)return"break";if(!(i.modules.vdomHoz.rightPos>=e.vDomScrollPosLeft))return"break";t=!0,e.getVisibleRows().forEach((function(e){if("group"!==e.type){var t=e.getCell(i);e.getElement().prepend(t.getElement()),t.cellRendered()}})),e.leftCol--,e.leftCol<=0?e.vDomPadLeft=0:e.vDomPadLeft-=i.getWidth();var n=e.fitDataColActualWidthCheck(i);n&&(e.scrollLeft=e.elementVertical.scrollLeft=e.elementVertical.scrollLeft+n,e.vDomPadRight-=n)};;){if("break"===i())break}t&&(this.tableElement.style.paddingLeft=this.vDomPadLeft+"px")}},{key:"removeColRight",value:function(){for(var e=this,t=!1,i=function(){var i=e.columns[e.rightCol];return i&&i.modules.vdomHoz.leftPos>e.vDomScrollPosRight?(t=!0,e.getVisibleRows().forEach((function(e){if("group"!==e.type){var t=e.getCell(i);try{e.getElement().removeChild(t.getElement())}catch(e){console.warn("Could not removeColRight",e.message)}}})),e.vDomPadRight+=i.getWidth(),void e.rightCol--):"break"};;){if("break"===i())break}t&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}},{key:"removeColLeft",value:function(){for(var e=this,t=!1,i=function(){var i=e.columns[e.leftCol];return i&&i.modules.vdomHoz.rightPosi?(t=e-i,this.element.style.marginLeft=-t+"px"):this.element.style.marginLeft=0,this.scrollLeft=e,this.renderer.scrollColumns(e)}},{key:"generateColumnsFromRowData",value:function(t){var i,n,o=[],a=this.table.options.autoColumnsDefinitions;if(t&&t.length){for(var r in i=t[0]){var s={field:r,title:r},l=i[r];switch(e(l)){case"undefined":n="string";break;case"boolean":n="boolean";break;case"object":n=Array.isArray(l)?"array":"string";break;default:n=isNaN(l)||""===l?l.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?"alphanum":"string":"number"}s.sorter=n,o.push(s)}if(a)switch(e(a)){case"function":this.table.options.columns=a.call(this.table,o);break;case"object":Array.isArray(a)?o.forEach((function(e){var t=a.find((function(t){return t.field===e.field}));t&&Object.assign(e,t)})):o.forEach((function(e){a[e.field]&&Object.assign(e,a[e.field])})),this.table.options.columns=o}else this.table.options.columns=o;this.setColumns(this.table.options.columns)}}},{key:"setColumns",value:function(e,t){for(var i=this;this.headersElement.firstChild;)this.headersElement.removeChild(this.headersElement.firstChild);this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.dispatch("columns-loading"),e.forEach((function(e,t){i._addColumn(e)})),this._reIndexColumns(),this.dispatch("columns-loaded"),this.renderer.rerenderColumns(!1,!0),this.redraw(!0)}},{key:"_addColumn",value:function(e,t,i){var n=new C(e,this),o=n.getElement(),a=i?this.findColumnIndex(i):i;if(i&&a>-1){var r=i.getTopColumn(),s=this.columns.indexOf(r),l=r.getElement();t?(this.columns.splice(s,0,n),l.parentNode.insertBefore(o,l)):(this.columns.splice(s+1,0,n),l.parentNode.insertBefore(o,l.nextSibling))}else t?(this.columns.unshift(n),this.headersElement.insertBefore(n.getElement(),this.headersElement.firstChild)):(this.columns.push(n),this.headersElement.appendChild(n.getElement()));return n.columnRendered(),n}},{key:"registerColumnField",value:function(e){e.definition.field&&(this.columnsByField[e.definition.field]=e)}},{key:"registerColumnPosition",value:function(e){this.columnsByIndex.push(e)}},{key:"_reIndexColumns",value:function(){this.columnsByIndex=[],this.columns.forEach((function(e){e.reRegisterPosition()}))}},{key:"verticalAlignHeaders",value:function(){var e=this,t=0;this.columns.forEach((function(e){var i;e.clearVerticalAlign(),(i=e.getHeight())>t&&(t=i)})),this.columns.forEach((function(i){i.verticalAlign(e.table.options.columnHeaderVertAlign,t)})),this.table.rowManager.adjustTableSize()}},{key:"findColumn",value:function(t){return"object"!=e(t)?this.columnsByField[t]||!1:t instanceof C?t:t instanceof v?t._getSelf()||!1:"undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&this.columns.find((function(e){return e.element===t}))||!1}},{key:"getColumnByField",value:function(e){return this.columnsByField[e]}},{key:"getColumnsByFieldRoot",value:function(e){var t=this,i=[];return Object.keys(this.columnsByField).forEach((function(n){n.split(".")[0]===e&&i.push(t.columnsByField[n])})),i}},{key:"getColumnByIndex",value:function(e){return this.columnsByIndex[e]}},{key:"getFirstVisibleColumn",value:function(e){return(e=this.columnsByIndex.findIndex((function(e){return e.visible})))>-1&&this.columnsByIndex[e]}},{key:"getColumns",value:function(){return this.columns}},{key:"findColumnIndex",value:function(e){return this.columnsByIndex.findIndex((function(t){return e===t}))}},{key:"getRealColumns",value:function(){return this.columnsByIndex}},{key:"traverse",value:function(e){this.columnsByIndex.forEach((function(t,i){e(t,i)}))}},{key:"getDefinitions",value:function(e){var t=[];return this.columnsByIndex.forEach((function(i){(!e||e&&i.visible)&&t.push(i.getDefinition())})),t}},{key:"getDefinitionTree",value:function(){var e=[];return this.columns.forEach((function(t){e.push(t.getDefinition(!0))})),e}},{key:"getComponents",value:function(e){var t=[];return(e?this.columns:this.columnsByIndex).forEach((function(e){t.push(e.getComponent())})),t}},{key:"getWidth",value:function(){var e=0;return this.columnsByIndex.forEach((function(t){t.visible&&(e+=t.getWidth())})),e}},{key:"moveColumn",value:function(e,t,i){this.moveColumnActual(e,t,i),t.element.parentNode.insertBefore(e.element,t.element),i&&t.element.parentNode.insertBefore(t.element,e.element),this.verticalAlignHeaders(),this.table.rowManager.reinitialize()}},{key:"moveColumnActual",value:function(e,t,i){e.parent.isGroup?this._moveColumnInArray(e.parent.columns,e,t,i):this._moveColumnInArray(this.columns,e,t,i),this._moveColumnInArray(this.columnsByIndex,e,t,i,!0),this.renderer.rerenderColumns(!0),this.dispatch("column-moved",e,t,i),this.subscribedExternal("columnMoved")&&this.dispatchExternal("columnMoved",e.getComponent(),this.table.columnManager.getComponents())}},{key:"_moveColumnInArray",value:function(e,t,i,n,o){var a,r=e.indexOf(t);r>-1&&(e.splice(r,1),(a=e.indexOf(i))>-1?n&&(a+=1):a=r,e.splice(a,0,t),o&&(this.chain("column-moving-rows",[t,i,n],null,[])||[]).concat(this.table.rowManager.rows).forEach((function(e){if(e.cells.length){var t=e.cells.splice(r,1)[0];e.cells.splice(a,0,t)}})))}},{key:"scrollToColumn",value:function(e,t,i){var n=this,o=0,a=0,r=0,s=e.getElement();return new Promise((function(l,u){if(void 0===t&&(t=n.table.options.scrollToColumnPosition),void 0===i&&(i=n.table.options.scrollToColumnIfVisible),e.visible){switch(t){case"middle":case"center":r=-n.element.clientWidth/2;break;case"right":r=s.clientWidth-n.headersElement.clientWidth}if(!i&&(a=s.offsetLeft)>0&&a+s.offsetWidththis.table.rowManager.element.clientHeight&&(e-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),this.columnsByIndex.forEach((function(i){var n,o,a;i.visible&&(n=i.definition.width||0,o=parseInt(i.minWidth),a="string"==typeof n?n.indexOf("%")>-1?e/100*parseInt(n):parseInt(n):n,t+=a>o?a:o)})),t}},{key:"addColumn",value:function(e,t,i){var n=this;return new Promise((function(o,a){var r=n._addColumn(e,t,i);n._reIndexColumns(),n.dispatch("column-add",e,t,i),"fitColumns"!=n.layoutMode()&&r.reinitializeWidth(),n.redraw(!0),n.table.rowManager.reinitialize(),n.renderer.rerenderColumns(),o(r)}))}},{key:"deregisterColumn",value:function(e){var t,i=e.getField();i&&delete this.columnsByField[i],(t=this.columnsByIndex.indexOf(e))>-1&&this.columnsByIndex.splice(t,1),(t=this.columns.indexOf(e))>-1&&this.columns.splice(t,1),this.verticalAlignHeaders(),this.redraw()}},{key:"redraw",value:function(e){k.elVisible(this.element)&&this.verticalAlignHeaders(),e&&(this.table.rowManager.resetScroll(),this.table.rowManager.reinitialize()),this.confirm("table-redrawing",e)||this.layoutRefresh(),this.dispatch("table-redraw",e),this.table.footerManager.redraw()}}]),r}(g),L=function(){function e(i){return t(this,e),this._row=i,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._row.table.componentFunctionBinder.handle("row",e._row,t)}})}return o(e,[{key:"getData",value:function(e){return this._row.getData(e)}},{key:"getElement",value:function(){return this._row.getElement()}},{key:"getCells",value:function(){var e=[];return this._row.getCells().forEach((function(t){e.push(t.getComponent())})),e}},{key:"getCell",value:function(e){var t=this._row.getCell(e);return!!t&&t.getComponent()}},{key:"getIndex",value:function(){return this._row.getData("data")[this._row.table.options.index]}},{key:"getPosition",value:function(e){return this._row.table.rowManager.getRowPosition(this._row,e)}},{key:"delete",value:function(){return this._row.delete()}},{key:"scrollTo",value:function(){return this._row.table.rowManager.scrollToRow(this._row)}},{key:"move",value:function(e,t){this._row.moveToRow(e,t)}},{key:"update",value:function(e){return this._row.updateData(e)}},{key:"normalizeHeight",value:function(){this._row.normalizeHeight(!0)}},{key:"_getSelf",value:function(){return this._row}},{key:"reformat",value:function(){return this._row.reinitialize()}},{key:"getTable",value:function(){return this._row.table}},{key:"getNextRow",value:function(){var e=this._row.nextRow();return e?e.getComponent():e}},{key:"getPrevRow",value:function(){var e=this._row.prevRow();return e?e.getComponent():e}}]),e}(),D=function(e){a(n,e);var i=c(n);function n(e,o){var a,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"row";return t(this,n),(a=i.call(this,o.table)).parent=o,a.data={},a.type=r,a.element=!1,a.modules={},a.cells=[],a.height=0,a.heightStyled="",a.manualHeight=!1,a.outerHeight=0,a.initialized=!1,a.heightInitialized=!1,a.component=null,a.created=!1,a.setData(e),a}return o(n,[{key:"create",value:function(){this.created||(this.created=!0,this.generateElement())}},{key:"createElement",value:function(){var e=document.createElement("div");e.classList.add("tabulator-row"),e.setAttribute("role","row"),this.element=e}},{key:"getElement",value:function(){return this.create(),this.element}},{key:"detachElement",value:function(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}},{key:"generateElement",value:function(){this.createElement(),this.dispatch("row-init",this)}},{key:"generateCells",value:function(){this.cells=this.table.columnManager.generateCells(this)}},{key:"initialize",value:function(e){if(this.create(),!this.initialized||e){for(this.deleteCells();this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.dispatch("row-layout-before",this),this.generateCells(),this.initialized=!0,this.table.columnManager.renderer.renderRowCells(this),e&&this.normalizeHeight(),this.dispatch("row-layout",this),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent()),this.dispatch("row-layout-after",this)}else this.table.columnManager.renderer.rerenderRowCells(this)}},{key:"reinitializeHeight",value:function(){this.heightInitialized=!1,this.element&&null!==this.element.offsetParent&&this.normalizeHeight(!0)}},{key:"deinitialize",value:function(){this.initialized=!1}},{key:"deinitializeHeight",value:function(){this.heightInitialized=!1}},{key:"reinitialize",value:function(e){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),this.element&&null!==this.element.offsetParent&&this.initialize(!0),this.dispatch("row-relayout",this)}},{key:"calcHeight",value:function(e){var t,i=0;this.table.options.rowHeight?this.height=this.table.options.rowHeight:(t=this.table.options.resizableRows?this.element.clientHeight:0,this.cells.forEach((function(e){var t=e.getHeight();t>i&&(i=t)})),this.height=e?Math.max(i,t):this.manualHeight?this.height:Math.max(i,t)),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight}},{key:"setCellHeight",value:function(){this.cells.forEach((function(e){e.setHeight()})),this.heightInitialized=!0}},{key:"clearCellHeight",value:function(){this.cells.forEach((function(e){e.clearHeight()}))}},{key:"normalizeHeight",value:function(e){e&&!this.table.options.rowHeight&&this.clearCellHeight(),this.calcHeight(e),this.setCellHeight()}},{key:"setHeight",value:function(e,t){(this.height!=e||t)&&(this.manualHeight=!0,this.height=e,this.heightStyled=e?e+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight)}},{key:"getHeight",value:function(){return this.outerHeight}},{key:"getWidth",value:function(){return this.element.offsetWidth}},{key:"deleteCell",value:function(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}},{key:"setData",value:function(e){this.data=this.chain("row-data-init-before",[this,e],void 0,e),this.dispatch("row-data-init-after",this)}},{key:"updateData",value:function(e){var t,i=this,n=this.element&&k.elVisible(this.element),o={};return new Promise((function(a,r){for(var s in"string"==typeof e&&(e=JSON.parse(e)),i.dispatch("row-data-save-before",i),i.subscribed("row-data-changing")&&(o=Object.assign(o,i.data),o=Object.assign(o,e)),t=i.chain("row-data-changing",[i,o,e],null,e))i.data[s]=t[s];for(var s in i.dispatch("row-data-save-after",i),e){i.table.columnManager.getColumnsByFieldRoot(s).forEach((function(e){var o=i.getCell(e.getField());if(o){var a=e.getFieldValue(t);o.getValue()!=a&&(o.setValueProcessData(a),n&&o.cellRendered())}}))}n?(i.normalizeHeight(!0),i.table.options.rowFormatter&&i.table.options.rowFormatter(i.getComponent())):(i.initialized=!1,i.height=0,i.heightStyled=""),i.dispatch("row-data-changed",i,n,e),i.dispatchExternal("rowUpdated",i.getComponent()),i.subscribedExternal("dataChanged")&&i.dispatchExternal("dataChanged",i.table.rowManager.getData()),a()}))}},{key:"getData",value:function(e){return e?this.chain("row-data-retrieve",[this,e],null,this.data):this.data}},{key:"getCell",value:function(e){return e=this.table.columnManager.findColumn(e),this.initialized||this.generateCells(),this.cells.find((function(t){return t.column===e}))}},{key:"getCellIndex",value:function(e){return this.cells.findIndex((function(t){return t===e}))}},{key:"findCell",value:function(e){return this.cells.find((function(t){return t.element===e}))}},{key:"getCells",value:function(){return this.initialized||this.generateCells(),this.cells}},{key:"nextRow",value:function(){return this.table.rowManager.nextDisplayRow(this,!0)||!1}},{key:"prevRow",value:function(){return this.table.rowManager.prevDisplayRow(this,!0)||!1}},{key:"moveToRow",value:function(e,t){var i=this.table.rowManager.findRow(e);i?(this.table.rowManager.moveRowActual(this,i,!t),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",e)}},{key:"delete",value:function(){return this.dispatch("row-delete",this),this.deleteActual(),Promise.resolve()}},{key:"deleteActual",value:function(e){this.table.rowManager.getRowIndex(this);this.detatchModules(),this.table.rowManager.deleteRow(this,e),this.deleteCells(),this.initialized=!1,this.heightInitialized=!1,this.element=!1,this.dispatch("row-deleted",this)}},{key:"detatchModules",value:function(){this.dispatch("row-deleting",this)}},{key:"deleteCells",value:function(){for(var e=this.cells.length,t=0;tMath.abs(this.elementVertical.scrollTop+this.elementVertical.clientHeight-t))}},{key:"scrollToRow",value:function(e){var t=e.getElement();this.elementVertical.scrollTop=k.elOffset(t).top-k.elOffset(this.elementVertical).top+this.elementVertical.scrollTop}},{key:"visibleRows",value:function(e){return this.rows()}}]),n}(R),P=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).verticalFillMode="fill",o.scrollTop=0,o.scrollLeft=0,o.vDomRowHeight=20,o.vDomTop=0,o.vDomBottom=0,o.vDomScrollPosTop=0,o.vDomScrollPosBottom=0,o.vDomTopPad=0,o.vDomBottomPad=0,o.vDomMaxRenderChain=90,o.vDomWindowBuffer=0,o.vDomWindowMinTotalRows=20,o.vDomWindowMinMarginRows=5,o.vDomTopNewRows=[],o.vDomBottomNewRows=[],o}return o(n,[{key:"clearRows",value:function(){for(var e=this.tableElement;e.firstChild;)e.removeChild(e.firstChild);e.style.paddingTop="",e.style.paddingBottom="",e.style.minHeight="",e.style.display="",e.style.visibility="",this.elementVertical.scrollTop=0,this.elementVertical.scrollLeft=0,this.scrollTop=0,this.scrollLeft=0,this.vDomTop=0,this.vDomBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0}},{key:"renderRows",value:function(){this._virtualRenderFill()}},{key:"rerenderRows",value:function(e){for(var t=this.elementVertical.scrollTop,i=!1,n=!1,o=this.table.rowManager.scrollLeft,a=this.rows(),r=this.vDomTop;r<=this.vDomBottom;r++)if(a[r]){var s=t-a[r].getElement().offsetTop;if(!(!1===n||Math.abs(s)o||n>o){var r=this.table.rowManager.scrollLeft;this._virtualRenderFill(Math.floor(this.elementVertical.scrollTop/this.elementVertical.scrollHeight*a.length)),this.scrollColumns(r)}else t?(i<0&&this._addTopRow(a,-i),n<0&&(this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer?this._removeBottomRow(a,-n):this.vDomScrollPosBottom=this.scrollTop)):(n>=0&&this._addBottomRow(a,n),i>=0&&(this.scrollTop>this.vDomWindowBuffer?this._removeTopRow(a,i):this.vDomScrollPosTop=this.scrollTop))}},{key:"resize",value:function(){this.vDomWindowBuffer=this.table.options.renderVerticalBuffer||this.elementVertical.clientHeight}},{key:"scrollToRowNearestTop",value:function(e){var t=this.rows().indexOf(e);return!(Math.abs(this.vDomTop-t)>Math.abs(this.vDomBottom-t))}},{key:"scrollToRow",value:function(e){var t=this.rows().indexOf(e);t>-1&&this._virtualRenderFill(t,!0)}},{key:"visibleRows",value:function(e){var t=this.elementVertical.scrollTop,i=this.elementVertical.clientHeight+t,n=!1,o=0,a=0,r=this.rows();if(e)o=this.vDomTop,a=this.vDomBottom;else for(var s=this.vDomTop;s<=this.vDomBottom;s++)if(r[s])if(n){if(!(i-r[s].getElement().offsetTop>=0))break;a=s}else if(t-r[s].getElement().offsetTop>=0)o=s;else{if(n=!0,!(i-r[s].getElement().offsetTop>=0))break;a=s}return r.slice(o,a+1)}},{key:"_virtualRenderFill",value:function(e,t,i){var n=this.tableElement,o=this.elementVertical,a=0,r=0,s=0,l=0,u=0,c=this.rows(),h=c.length,d=this.elementVertical.clientHeight;if(i=i||0,e=e||0){for(;n.firstChild;)n.removeChild(n.firstChild);(s=(h-e+1)*this.vDomRowHeight)this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*m),this.vDomBottom++,u++}e?(this.vDomTopPad=t?this.vDomRowHeight*this.vDomTop+i:this.scrollTop-l,this.vDomBottomPad=this.vDomBottom==h-1?0:Math.max(this.vDomScrollHeight-this.vDomTopPad-r-l,0)):(this.vDomTopPad=0,this.vDomRowHeight=Math.floor((r+l)/u),this.vDomBottomPad=this.vDomRowHeight*(h-this.vDomBottom-1),this.vDomScrollHeight=l+r+this.vDomBottomPad-d),n.style.paddingTop=this.vDomTopPad+"px",n.style.paddingBottom=this.vDomBottomPad+"px",t&&(this.scrollTop=this.vDomTopPad+l+i-(this.elementVertical.scrollWidth>this.elementVertical.clientWidth?this.elementVertical.offsetHeight-d:0)),this.scrollTop=Math.min(this.scrollTop,this.elementVertical.scrollHeight-d),this.elementVertical.scrollWidth>this.elementVertical.offsetWidth&&t&&(this.scrollTop+=this.elementVertical.offsetHeight-d),this.vDomScrollPosTop=this.scrollTop,this.vDomScrollPosBottom=this.scrollTop,o.scrollTop=this.scrollTop,this.dispatch("render-virtual-fill")}}},{key:"_addTopRow",value:function(e,t){for(var i=this.tableElement,n=[],o=0,a=this.vDomTop-1,r=0;this.vDomTop;){var s=e[a],l=void 0,u=void 0;if(!(s&&r=l))break;this.styleRow(s,a),i.insertBefore(s.getElement(),i.firstChild),s.initialized&&s.heightInitialized||n.push(s),s.initialize(),u||(l=s.getElement().offsetHeight)>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*l),t-=l,o+=l,this.vDomTop--,a--,r++}for(var c=0,h=n;c=(r=a.getHeight()||this.vDomRowHeight)))break;this.vDomTop++,t-=r,n+=r,i.push(a),o++}for(var s=0,l=i;s=l))break;this.styleRow(s,a),i.appendChild(s.getElement()),s.initialized&&s.heightInitialized||n.push(s),s.initialize(),u||(l=s.getElement().offsetHeight)>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*l),t-=l,o+=l,this.vDomBottom++,a++,r++}for(var c=0,h=n;c=(r=a.getHeight()||this.vDomRowHeight)))break;this.vDomBottom--,t-=r,n+=r,i.push(a),o++}for(var s=0,l=i;st,n=e.element.scrollTop,o=e.scrollTop>n;e.scrollLeft!=t&&(e.scrollLeft=t,e.dispatch("scroll-horizontal",t,i),e.dispatchExternal("scrollHorizontal",t,i),e._positionPlaceholder()),e.scrollTop!=n&&(e.scrollTop=n,e.renderer.scrollRows(n,o),e.dispatch("scroll-vertical",n,o),e.dispatchExternal("scrollVertical",n,o))}))}},{key:"findRow",value:function(t){var i=this;return"object"!=e(t)?null!=t&&(this.rows.find((function(e){return e.data[i.table.options.index]==t}))||!1):t instanceof D?t:t instanceof L?t._getSelf()||!1:"undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&this.rows.find((function(e){return e.getElement()===t}))||!1}},{key:"getRowFromDataObject",value:function(e){return this.rows.find((function(t){return t.data===e}))||!1}},{key:"getRowFromPosition",value:function(e,t){return t?this.activeRows[e]:this.rows[e]}},{key:"scrollToRow",value:function(e,t,i){return this.renderer.scrollToRowPosition(e,t,i)}},{key:"setData",value:function(e,t,i){var n=this;return new Promise((function(o,a){t&&n.getDisplayRows().length?n.table.options.pagination?n._setDataActual(e,!0):n.reRenderInPosition((function(){n._setDataActual(e)})):(n.table.options.autoColumns&&i&&n.table.initialized&&n.table.columnManager.generateColumnsFromRowData(e),n.resetScroll(),n._setDataActual(e)),o()}))}},{key:"_setDataActual",value:function(t,i){var n=this;this.dispatchExternal("dataProcessing",t),this._wipeElements(),Array.isArray(t)?(this.dispatch("data-processing",t),t.forEach((function(t,i){if(t&&"object"===e(t)){var o=new D(t,n);n.rows.push(o)}else console.warn("Data Loading Warning - Invalid row data detected and ignored, expecting object but received:",t)})),this.refreshActiveData(!1,!1,i),this.dispatch("data-processed",t),this.dispatchExternal("dataProcessed",t)):console.error("Data Loading Error - Unable to process data due to invalid data type \nExpecting: array \nReceived: ",e(t),"\nData: ",t)}},{key:"_wipeElements",value:function(){this.dispatch("rows-wipe"),this.rows.forEach((function(e){e.wipe()})),this.rows=[],this.activeRows=[],this.activeRowsPipeline=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.adjustTableSize()}},{key:"deleteRow",value:function(e,t){var i=this.rows.indexOf(e),n=this.activeRows.indexOf(e);n>-1&&this.activeRows.splice(n,1),i>-1&&this.rows.splice(i,1),this.setActiveRows(this.activeRows),this.displayRowIterator((function(t){var i=t.indexOf(e);i>-1&&t.splice(i,1)})),t||this.reRenderInPosition(),this.regenerateRowNumbers(),this.dispatchExternal("rowDeleted",e.getComponent()),this.displayRowsCount||this._showPlaceholder(),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.getData())}},{key:"addRow",value:function(e,t,i,n){return this.addRowActual(e,t,i,n)}},{key:"addRows",value:function(e,t,i){var n=this,o=[];return new Promise((function(a,r){t=n.findAddRowPos(t),Array.isArray(e)||(e=[e]),e.length,(void 0===i&&t||void 0!==i&&!t)&&e.reverse(),e.forEach((function(a,r){var s=n.addRow(a,t,i,!0);o.push(s),n.dispatch("row-added",s,e,t,i)})),n.refreshActiveData(!1,!1,!0),n.regenerateRowNumbers(),o.length&&n._clearPlaceholder(),a(o)}))}},{key:"findAddRowPos",value:function(e){return void 0===e&&(e=this.table.options.addRowPos),"pos"===e&&(e=!0),"bottom"===e&&(e=!1),e}},{key:"addRowActual",value:function(e,t,i,n){var o,a,r=e instanceof D?e:new D(e||{},this),s=this.findAddRowPos(t),l=-1;return i||(a=this.chain("row-adding-position",[r,s],null,{index:i,top:s}),i=a.index,s=a.top),void 0!==i&&(i=this.findRow(i)),(i=this.chain("row-adding-index",[r,i,s],null,i))&&(l=this.rows.indexOf(i)),i&&l>-1?(o=this.activeRows.indexOf(i),this.displayRowIterator((function(e){var t=e.indexOf(i);t>-1&&e.splice(s?t:t+1,0,r)})),o>-1&&this.activeRows.splice(s?o:o+1,0,r),this.rows.splice(s?l:l+1,0,r)):s?(this.displayRowIterator((function(e){e.unshift(r)})),this.activeRows.unshift(r),this.rows.unshift(r)):(this.displayRowIterator((function(e){e.push(r)})),this.activeRows.push(r),this.rows.push(r)),this.setActiveRows(this.activeRows),this.dispatchExternal("rowAdded",r.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),n||this.reRenderInPosition(),r}},{key:"moveRow",value:function(e,t,i){this.dispatch("row-move",e,t,i),this.moveRowActual(e,t,i),this.regenerateRowNumbers(),this.dispatch("row-moved",e,t,i),this.dispatchExternal("rowMoved",e.getComponent())}},{key:"moveRowActual",value:function(e,t,i){var n=this;this.moveRowInArray(this.rows,e,t,i),this.moveRowInArray(this.activeRows,e,t,i),this.displayRowIterator((function(o){n.moveRowInArray(o,e,t,i)})),this.dispatch("row-moving",e,t,i)}},{key:"moveRowInArray",value:function(e,t,i,n){var o,a,r;if(t!==i&&((o=e.indexOf(t))>-1&&(e.splice(o,1),(a=e.indexOf(i))>-1?n?e.splice(a+1,0,t):e.splice(a,0,t):e.splice(o,0,t)),e===this.getDisplayRows())){r=a>o?a:o+1;for(var s=o-1&&t}},{key:"nextDisplayRow",value:function(e,t){var i=this.getDisplayRowIndex(e),n=!1;return!1!==i&&i-1)&&i}},{key:"getData",value:function(e,t){var i=[];return this.getRows(e).forEach((function(e){"row"==e.type&&i.push(e.getData(t||"data"))})),i}},{key:"getComponents",value:function(e){var t=[];return this.getRows(e).forEach((function(e){t.push(e.getComponent())})),t}},{key:"getDataCount",value:function(e){return this.getRows(e).length}},{key:"scrollHorizontal",value:function(e){this.scrollLeft=e,this.element.scrollLeft=e,this.dispatch("scroll-horizontal",e)}},{key:"registerDataPipelineHandler",value:function(e,t){void 0!==t?(this.dataPipeline.push({handler:e,priority:t}),this.dataPipeline.sort((function(e,t){return e.priority-t.priority}))):console.error("Data pipeline handlers must have a priority in order to be registered")}},{key:"registerDisplayPipelineHandler",value:function(e,t){void 0!==t?(this.displayPipeline.push({handler:e,priority:t}),this.displayPipeline.sort((function(e,t){return e.priority-t.priority}))):console.error("Display pipeline handlers must have a priority in order to be registered")}},{key:"refreshActiveData",value:function(e,t,i){var n=this.table,o="",a=0,r=["all","dataPipeline","display","displayPipeline","end"];if("function"==typeof e)if((a=this.dataPipeline.findIndex((function(t){return t.handler===e})))>-1)o="dataPipeline",t&&(a==this.dataPipeline.length-1?o="display":a++);else{if(!((a=this.displayPipeline.findIndex((function(t){return t.handler===e})))>-1))return void console.error("Unable to refresh data, invalid handler provided",e);o="displayPipeline",t&&(a==this.displayPipeline.length-1?o="end":a++)}else o=e||"all",a=0;this.redrawBlock?(!this.redrawBlockRestoreConfig||this.redrawBlockRestoreConfig&&(this.redrawBlockRestoreConfig.stage===o&&a-1&&(n.splice(o,1),a=!0),"mouseenter"!==t&&"mouseleave"!==t||this.pseudoTracking||this.bindPseudoEvents(),a&&this.updateEventListeners()}},{key:"updateEventListeners",value:function(){for(var e in this.listeners){var t=this.listeners[e];t.components.length?t.handler||(t.handler=this.track.bind(this,e),this.el.addEventListener(e,t.handler)):t.handler&&(this.el.removeEventListener(e,t.handler),t.handler=null)}}},{key:"track",value:function(e,t){var i=t.composedPath&&t.composedPath()||t.path,n=this.findTargets(i);n=this.bindComponents(e,n),this.triggerEvents(e,t,n),!this.pseudoTracking||"mouseover"!=e&&"mouseleave"!=e||Object.keys(n).length||this.pseudoMouseLeave("none",t)}},{key:"findTargets",value:function(e){var t,i=this,n={},o=Object.keys(this.componentMap),a=f(e);try{for(a.s();!(t=a.n()).done;){var r=t.value,s=r.classList?d(r.classList):[];if(s.filter((function(e){return i.abortClasses.includes(e)})).length)break;var l,u=f(s.filter((function(e){return o.includes(e)})));try{for(u.s();!(l=u.n()).done;){var c=l.value;n[this.componentMap[c]]=r}}catch(e){u.e(e)}finally{u.f()}}}catch(e){a.e(e)}finally{a.f()}return n.group&&n.group===n.row&&delete n.row,n}},{key:"bindComponents",value:function(e,t){var i,n=this,o=Object.keys(t).reverse(),a=this.listeners[e],r={},s=f(o);try{var l=function(){var e=i.value,o=void 0,s=t[e],l=n.previousTargets[e];if(l&&l.target===s)o=l.component;else switch(e){case"row":case"group":if(a.components.includes("row")||a.components.includes("cell")||a.components.includes("group"))o=n.table.rowManager.getVisibleRows(!0).find((function(e){return e.getElement()===s})),t.row&&t.row.parentNode&&t.row.parentNode.closest(".tabulator-row")&&(t[e]=!1);break;case"column":a.components.includes("column")&&(o=n.table.columnManager.findColumn(s));break;case"cell":a.components.includes("cell")&&(t.row instanceof D?o=t.row.findCell(s):t.row&&console.warn("Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?"))}o&&(t[e]=o,r[e]={target:s,component:o})};for(s.s();!(i=s.n()).done;)l()}catch(e){s.e(e)}finally{s.f()}return this.previousTargets=r,t}},{key:"triggerEvents",value:function(e,t,i){var n=this.listeners[e];for(var o in i)i[o]&&n.components.includes(o)&&this.dispatch(o+"-"+e,t,i[o])}},{key:"clearWatchers",value:function(){for(var e in this.listeners){var t=this.listeners[e];t.handler&&(this.el.removeEventListener(e,t.handler),t.handler=null)}}}]),n}(g),_=function(){function e(i){t(this,e),this.table=i,this.bindings={}}return o(e,[{key:"bind",value:function(e,t,i){this.bindings[e]||(this.bindings[e]={}),this.bindings[e][t]?console.warn("Unable to bind component handler, a matching function name is already bound",e,t,i):this.bindings[e][t]=i}},{key:"handle",value:function(e,t,i){if(this.bindings[e]&&this.bindings[e][i]&&"function"==typeof this.bindings[e][i].bind)return this.bindings[e][i].bind(null,t);"then"===i||"string"!=typeof i||i.startsWith("_")||console.error("The "+e+" component does not have a "+i+" function, have you checked that you have the correct Tabulator module installed?")}}]),e}(),O=function(i){a(r,i);var n=c(r);function r(e){var i;return t(this,r),(i=n.call(this,e)).requestOrder=0,i.loading=!1,i}return o(r,[{key:"initialize",value:function(){}},{key:"load",value:function(t,i,n,o,a,r){var s=this,l=++this.requestOrder;return this.dispatchExternal("dataLoading",t),!t||0!=t.indexOf("{")&&0!=t.indexOf("[")||(t=JSON.parse(t)),this.confirm("data-loading",[t,i,n,a])?(this.loading=!0,a||this.alertLoader(),i=this.chain("data-params",[t,n,a],i||{},i||{}),i=this.mapParams(i,this.table.options.dataSendParams),this.chain("data-load",[t,i,n,a],!1,Promise.resolve([])).then((function(t){Array.isArray(t)||"object"!=e(t)||(t=s.mapParams(t,s.objectInvert(s.table.options.dataReceiveParams)));var i=s.chain("data-loaded",t,null,t);l==s.requestOrder?(s.clearAlert(),!1!==i&&(s.dispatchExternal("dataLoaded",i),s.table.rowManager.setData(i,o,void 0===r?!o:r))):console.warn("Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made")})).catch((function(e){console.error("Data Load Error: ",e),s.dispatchExternal("dataLoadError",e),a||s.alertError(),setTimeout((function(){s.clearAlert()}),s.table.options.dataLoaderErrorTimeout)})).finally((function(){s.loading=!1}))):(this.dispatchExternal("dataLoaded",t),t||(t=[]),this.table.rowManager.setData(t,o,void 0===r?!o:r),Promise.resolve())}},{key:"mapParams",value:function(e,t){var i={};for(var n in e)i[t.hasOwnProperty(n)?t[n]:n]=e[n];return i}},{key:"objectInvert",value:function(e){var t={};for(var i in e)t[e[i]]=i;return t}},{key:"blockActiveLoad",value:function(){this.requestOrder++}},{key:"alertLoader",value:function(){("function"==typeof this.table.options.dataLoader?this.table.options.dataLoader():this.table.options.dataLoader)&&this.table.alertManager.alert(this.table.options.dataLoaderLoading||this.langText("data|loading"))}},{key:"alertError",value:function(){this.table.alertManager.alert(this.table.options.dataLoaderError||this.langText("data|error"),"error")}},{key:"clearAlert",value:function(){this.table.alertManager.clear()}}]),r}(g),A=function(){function e(i,n,o){t(this,e),this.table=i,this.events={},this.optionsList=n||{},this.subscriptionNotifiers={},this.dispatch=o?this._debugDispatch.bind(this):this._dispatch.bind(this),this.debug=o}return o(e,[{key:"subscriptionChange",value:function(e,t){this.subscriptionNotifiers[e]||(this.subscriptionNotifiers[e]=[]),this.subscriptionNotifiers[e].push(t),this.subscribed(e)&&this._notifiySubscriptionChange(e,!0)}},{key:"subscribe",value:function(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t),this._notifiySubscriptionChange(e,!0)}},{key:"unsubscribe",value:function(e,t){var i;if(this.events[e]){if(t){if(!((i=this.events[e].findIndex((function(e){return e===t})))>-1))return void console.warn("Cannot remove event, no matching event found:",e,t);this.events[e].splice(i,1)}else delete this.events[e];this._notifiySubscriptionChange(e,!1)}else console.warn("Cannot remove event, no events set on:",e)}},{key:"subscribed",value:function(e){return this.events[e]&&this.events[e].length}},{key:"_notifiySubscriptionChange",value:function(e,t){var i=this.subscriptionNotifiers[e];i&&i.forEach((function(e){e(t)}))}},{key:"_dispatch",value:function(){var e,t=this,i=Array.from(arguments),n=i.shift();return this.events[n]&&this.events[n].forEach((function(n,o){var a=n.apply(t.table,i);o||(e=a)})),e}},{key:"_debugDispatch",value:function(){var e,t=Array.from(arguments),i=t[0];(t[0]="ExternalEvent:"+t[0],!0===this.debug||this.debug.includes(i))&&(e=console).log.apply(e,d(t));return this._dispatch.apply(this,arguments)}}]),e}(),B=function(){function e(i){t(this,e),this.events={},this.subscriptionNotifiers={},this.dispatch=i?this._debugDispatch.bind(this):this._dispatch.bind(this),this.chain=i?this._debugChain.bind(this):this._chain.bind(this),this.confirm=i?this._debugConfirm.bind(this):this._confirm.bind(this),this.debug=i}return o(e,[{key:"subscriptionChange",value:function(e,t){this.subscriptionNotifiers[e]||(this.subscriptionNotifiers[e]=[]),this.subscriptionNotifiers[e].push(t),this.subscribed(e)&&this._notifiySubscriptionChange(e,!0)}},{key:"subscribe",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e4;this.events[e]||(this.events[e]=[]),this.events[e].push({callback:t,priority:i}),this.events[e].sort((function(e,t){return e.priority-t.priority})),this._notifiySubscriptionChange(e,!0)}},{key:"unsubscribe",value:function(e,t){var i;if(this.events[e]){if(t){if(!((i=this.events[e].findIndex((function(e){return e.callback===t})))>-1))return void console.warn("Cannot remove event, no matching event found:",e,t);this.events[e].splice(i,1)}this._notifiySubscriptionChange(e,!1)}else console.warn("Cannot remove event, no events set on:",e)}},{key:"subscribed",value:function(e){return this.events[e]&&this.events[e].length}},{key:"_chain",value:function(e,t,i,n){var o=this,a=i;return Array.isArray(t)||(t=[t]),this.subscribed(e)?(this.events[e].forEach((function(e,i){a=e.callback.apply(o,t.concat([a]))})),a):"function"==typeof n?n():n}},{key:"_confirm",value:function(e,t){var i=this,n=!1;return Array.isArray(t)||(t=[t]),this.subscribed(e)&&this.events[e].forEach((function(e,o){e.callback.apply(i,t)&&(n=!0)})),n}},{key:"_notifiySubscriptionChange",value:function(e,t){var i=this.subscriptionNotifiers[e];i&&i.forEach((function(e){e(t)}))}},{key:"_dispatch",value:function(){var e=this,t=Array.from(arguments),i=t.shift();this.events[i]&&this.events[i].forEach((function(i){i.callback.apply(e,t)}))}},{key:"_debugDispatch",value:function(){var e,t=Array.from(arguments),i=t[0];(t[0]="InternalEvent:"+i,!0===this.debug||this.debug.includes(i))&&(e=console).log.apply(e,d(t));return this._dispatch.apply(this,arguments)}},{key:"_debugChain",value:function(){var e,t=Array.from(arguments),i=t[0];(t[0]="InternalEvent:"+i,!0===this.debug||this.debug.includes(i))&&(e=console).log.apply(e,d(t));return this._chain.apply(this,arguments)}},{key:"_debugConfirm",value:function(){var e,t=Array.from(arguments),i=t[0];(t[0]="InternalEvent:"+i,!0===this.debug||this.debug.includes(i))&&(e=console).log.apply(e,d(t));return this._confirm.apply(this,arguments)}}]),e}(),I=function(){function e(){t(this,e)}return o(e,null,[{key:"register",value:function(t){e.tables.push(t)}},{key:"deregister",value:function(t){var i=e.tables.indexOf(t);i>-1&&e.tables.splice(i,1)}},{key:"lookupTable",value:function(t,i){var n,o,a=[];if("string"==typeof t){if((n=document.querySelectorAll(t)).length)for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:this.table.element;return e===t||!!t.parentNode&&this._checkContainerIsParent(e,t.parentNode)}},{key:"renderCallback",value:function(e){this.renderedCallback=e}},{key:"containerEventCoords",value:function(e){var t=!(e instanceof MouseEvent),i=t?e.touches[0].pageX:e.pageX,n=t?e.touches[0].pageY:e.pageY;if(this.container!==document.body){var o=k.elOffset(this.container);i-=o.left,n-=o.top}return{x:i,y:n}}},{key:"elementPositionCoords",value:function(e){var t,i,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"right",a=k.elOffset(e);switch(this.container!==document.body&&(t=k.elOffset(this.container),a.left-=t.left,a.top-=t.top),o){case"right":i=a.left+e.offsetWidth,n=a.top-1;break;case"bottom":i=a.left,n=a.top+e.offsetHeight}return{x:i,y:n,offset:a}}},{key:"show",value:function(e,t){var i,n,o,a,r;return e instanceof HTMLElement?(o=e,a=(r=this.elementPositionCoords(e,t)).offset,i=r.x,n=r.y):"number"==typeof e?(a={top:0,left:0},i=e,n=t):(i=(r=this.containerEventCoords(e)).x,n=r.y,this.reversedX=!1),this.element.style.top=n+"px",this.element.style.left=i+"px",this.container.appendChild(this.element),"function"==typeof this.renderedCallback&&this.renderedCallback(),this._fitToScreen(i,n,o,a,t),this.visible=!0,this}},{key:"_fitToScreen",value:function(e,t,i,n,o){var a=this.container===document.body?document.documentElement.scrollTop:this.container.scrollTop;if((e+this.element.offsetWidth>=this.container.offsetWidth||this.reversedX)&&(this.element.style.left="",this.element.style.right=i?this.container.offsetWidth-n.left+"px":this.container.offsetWidth-e+"px",this.reversedX=!0),t+this.element.offsetHeight>Math.max(this.container.offsetHeight,a?this.container.scrollHeight:0))if(i)switch(o){case"bottom":this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight-i.offsetHeight-1+"px";break;default:this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+i.offsetHeight+1+"px"}else this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+"px"}},{key:"isVisible",value:function(){return this.visible}},{key:"hideOnBlur",value:function(e){var t=this;return this.blurable=!0,this.visible&&(setTimeout((function(){t.table.rowManager.element.addEventListener("scroll",t.blurEvent),t.subscribe("cell-editing",t.blurEvent),document.body.addEventListener("click",t.blurEvent),document.body.addEventListener("contextmenu",t.blurEvent),window.addEventListener("resize",t.blurEvent),document.body.addEventListener("keydown",t.escEvent)}),100),this.blurCallback=e),this}},{key:"_escapeCheck",value:function(e){27==e.keyCode&&this.hide()}},{key:"hide",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.visible&&(this.blurable&&(document.body.removeEventListener("keydown",this.escEvent),document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),window.removeEventListener("resize",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent),this.unsubscribe("cell-editing",this.blurEvent)),this.childPopup&&this.childPopup.hide(),this.parent&&(this.parent.childPopup=null),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.visible=!1,this.blurCallback&&!e&&this.blurCallback()),this}},{key:"child",value:function(e){return this.childPopup&&this.childPopup.hide(),this.childPopup=new n(this.table,e,this),this.childPopup}}]),n}(g),V=function(e){a(n,e);var i=c(n);function n(e,o){var a;return t(this,n),(a=i.call(this,e))._handler=null,a}return o(n,[{key:"initialize",value:function(){}},{key:"registerTableOption",value:function(e,t){this.table.optionsList.register(e,t)}},{key:"registerColumnOption",value:function(e,t){this.table.columnManager.optionsList.register(e,t)}},{key:"registerTableFunction",value:function(e,t){var i=this;void 0===this.table[e]?this.table[e]=function(){return i.table.initGuard(e),t.apply(void 0,arguments)}:console.warn("Unable to bind table function, name already in use",e)}},{key:"registerComponentFunction",value:function(e,t,i){return this.table.componentFunctionBinder.bind(e,t,i)}},{key:"registerDataHandler",value:function(e,t){this.table.rowManager.registerDataPipelineHandler(e,t),this._handler=e}},{key:"registerDisplayHandler",value:function(e,t){this.table.rowManager.registerDisplayPipelineHandler(e,t),this._handler=e}},{key:"refreshData",value:function(e,t){t||(t=this._handler),t&&this.table.rowManager.refreshActiveData(t,!1,e)}},{key:"footerAppend",value:function(e){return this.table.footerManager.append(e)}},{key:"footerPrepend",value:function(e){return this.table.footerManager.prepend(e)}},{key:"footerRemove",value:function(e){return this.table.footerManager.remove(e)}},{key:"popup",value:function(e,t){return new N(this.table,e,t)}},{key:"alert",value:function(e,t){return this.table.alertManager.alert(e,t)}},{key:"clearAlert",value:function(){return this.table.alertManager.clear()}}]),n}(g);function W(e){e.forEach((function(e){e.reinitializeWidth()})),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()}var j={fitData:function(e){this.table.columnManager.renderer.reinitializeColumnWidths(e),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitDataFill:W,fitDataTable:W,fitDataStretch:function(e){var t=this,i=0,n=this.table.rowManager.element.clientWidth,o=0,a=!1;e.forEach((function(e,n){e.widthFixed||e.reinitializeWidth(),(t.table.options.responsiveLayout?e.modules.responsive.visible:e.visible)&&(a=e),e.visible&&(i+=e.getWidth())})),a?(o=n-i+a.getWidth(),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&(a.setWidth(0),this.table.modules.responsiveLayout.update()),o>0?a.setWidth(o):a.reinitializeWidth()):this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitColumns:function(e){var t,i,n=this.table.element.clientWidth,o=0,a=0,r=0,s=[],l=[],u=0,c=0;function h(e){return"string"==typeof e?e.indexOf("%")>-1?n/100*parseInt(e):parseInt(e):e}function d(e,t,i,n){var o=[],a=0,s=0,l=0,u=r,c=0,m=0,p=[];function f(e){return i*(e.column.definition.widthGrow||1)}function g(e){return h(e.width)-i*(e.column.definition.widthShrink||0)}return e.forEach((function(e,a){var r=n?g(e):f(e);e.column.minWidth>=r?o.push(e):e.column.maxWidth&&e.column.maxWidththis.table.rowManager.element.clientHeight&&(n-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),e.forEach((function(e){var t,i,n;e.visible&&(t=e.definition.width,i=parseInt(e.minWidth),t?(n=h(t),o+=n>i?n:i,e.definition.widthShrink&&(l.push({column:e,width:n>i?n:i}),u+=e.definition.widthShrink)):(s.push({column:e,width:0}),r+=e.definition.widthGrow||1))})),a=n-o,t=Math.floor(a/r),c=d(s,a,t,!1),s.length&&c>0&&(s[s.length-1].width+=+c),s.forEach((function(e){a-=e.width})),(i=Math.abs(c)+a)>0&&u&&(c=d(l,i,Math.floor(i/u),!0)),l.length&&(l[l.length-1].width-=c),s.forEach((function(e){e.column.setWidth(e.width)})),l.forEach((function(e){e.column.setWidth(e.width)}))}},G=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e,"layout")).mode=null,o.registerTableOption("layout","fitData"),o.registerTableOption("layoutColumnsOnNewData",!1),o.registerColumnOption("widthGrow"),o.registerColumnOption("widthShrink"),o}return o(n,[{key:"initialize",value:function(){var e=this.table.options.layout;n.modes[e]?this.mode=e:(console.warn("Layout Error - invalid mode set, defaulting to 'fitData' : "+e),this.mode="fitData"),this.table.element.setAttribute("tabulator-layout",this.mode)}},{key:"getMode",value:function(){return this.mode}},{key:"layout",value:function(){this.dispatch("layout-refreshing"),n.modes[this.mode].call(this,this.table.columnManager.columnsByIndex),this.dispatch("layout-refreshed")}}]),n}(V);G.moduleName="layout",G.modes=j;var U=function(i){a(r,i);var n=c(r);function r(e){var i;return t(this,r),(i=n.call(this,e)).locale="default",i.lang=!1,i.bindings={},i.langList={},i.registerTableOption("locale",!1),i.registerTableOption("langs",{}),i}return o(r,[{key:"initialize",value:function(){for(var e in this.langList=k.deepClone(r.langs),!1!==this.table.options.columnDefaults.headerFilterPlaceholder&&this.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder),this.table.options.langs)this.installLang(e,this.table.options.langs[e]);this.setLocale(this.table.options.locale),this.registerTableFunction("setLocale",this.setLocale.bind(this)),this.registerTableFunction("getLocale",this.getLocale.bind(this)),this.registerTableFunction("getLang",this.getLang.bind(this))}},{key:"setHeaderFilterPlaceholder",value:function(e){this.langList.default.headerFilters.default=e}},{key:"setHeaderFilterColumnPlaceholder",value:function(e,t){this.langList.default.headerFilters.columns[e]=t,this.lang&&!this.lang.headerFilters.columns[e]&&(this.lang.headerFilters.columns[e]=t)}},{key:"installLang",value:function(e,t){this.langList[e]?this._setLangProp(this.langList[e],t):this.langList[e]=t}},{key:"_setLangProp",value:function(t,i){for(var n in i)t[n]&&"object"==e(t[n])?this._setLangProp(t[n],i[n]):t[n]=i[n]}},{key:"setLocale",value:function(t){if(!0===(t=t||"default")&&navigator.language&&(t=navigator.language.toLowerCase()),t&&!this.langList[t]){var i=t.split("-")[0];this.langList[i]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",t,i),t=i):(console.warn("Localization Error - Matching locale not found, using default: ",t),t="default")}this.locale=t,this.lang=k.deepClone(this.langList.default||{}),"default"!=t&&function t(i,n){for(var o in i)"object"==e(i[o])?(n[o]||(n[o]={}),t(i[o],n[o])):n[o]=i[o]}(this.langList[t],this.lang),this.dispatchExternal("localized",this.locale,this.lang),this._executeBindings()}},{key:"getLocale",value:function(e){return this.locale}},{key:"getLang",value:function(e){return e?this.langList[e]:this.lang}},{key:"getText",value:function(e,t){var i=(e=t?e+"|"+t:e).split("|");return this._getLangElement(i,this.locale)||""}},{key:"_getLangElement",value:function(e,t){var i=this.lang;return e.forEach((function(e){var t;i&&(t=i[e],i=void 0!==t&&t)})),i}},{key:"bind",value:function(e,t){this.bindings[e]||(this.bindings[e]=[]),this.bindings[e].push(t),t(this.getText(e),this.lang)}},{key:"_executeBindings",value:function(){var e=this,t=function(t){e.bindings[t].forEach((function(i){i(e.getText(t),e.lang)}))};for(var i in this.bindings)t(i)}}]),r}(V);U.moduleName="localize",U.langs={default:{groups:{item:"item",items:"items"},columns:{},data:{loading:"Loading",error:"Error"},pagination:{page_size:"Page Size",page_title:"Show Page",first:"First",first_title:"First Page",last:"Last",last_title:"Last Page",prev:"Prev",prev_title:"Prev Page",next:"Next",next_title:"Next Page",all:"All",counter:{showing:"Showing",of:"of",rows:"rows",pages:"pages"}},headerFilters:{default:"filter column...",columns:{}}}};var X=function(e){a(n,e);var i=c(n);function n(e){return t(this,n),i.call(this,e)}return o(n,[{key:"initialize",value:function(){this.registerTableFunction("tableComms",this.receive.bind(this))}},{key:"getConnections",value:function(e){var t=this,i=[];return I.lookupTable(e).forEach((function(e){t.table!==e&&i.push(e)})),i}},{key:"send",value:function(e,t,i,n){var o=this,a=this.getConnections(e);a.forEach((function(e){e.tableComms(o.table.element,t,i,n)})),!a.length&&e&&console.warn("Table Connection Error - No tables matching selector found",e)}},{key:"receive",value:function(e,t,i,n){if(this.table.modExists(t))return this.table.modules[t].commsReceived(e,i,n);console.warn("Inter-table Comms Error - no such module:",t)}}]),n}(V);X.moduleName="comms";var q=Object.freeze({__proto__:null,LayoutModule:G,LocalizeModule:U,CommsModule:X}),K=function(){function i(e,n){t(this,i),this.bindStaticFuctionality(e),this.bindModules(e,q,!0),n&&this.bindModules(e,n)}return o(i,[{key:"bindStaticFuctionality",value:function(t){t.moduleBindings={},t.extendModule=function(i,n,o){if(t.moduleBindings[i]){var a=t.moduleBindings[i][n];if(a)if("object"==e(o))for(var r in o)a[r]=o[r];else console.warn("Module Error - Invalid value type, it must be an object");else console.warn("Module Error - property does not exist:",n)}else console.warn("Module Error - module does not exist:",i)},t.registerModule=function(e){Array.isArray(e)||(e=[e]),e.forEach((function(e){t.registerModuleBinding(e)}))},t.registerModuleBinding=function(e){t.moduleBindings[e.moduleName]=e},t.findTable=function(e){var t=I.lookupTable(e,!0);return!(Array.isArray(t)&&!t.length)&&t},t.prototype.bindModules=function(){var e=[],i=[],n=[];for(var o in this.modules={},t.moduleBindings){var a=t.moduleBindings[o],r=new a(this);this.modules[o]=r,a.prototype.moduleCore?this.modulesCore.push(r):a.moduleInitOrder?a.moduleInitOrder<0?e.push(r):i.push(r):n.push(r)}e.sort((function(e,t){return e.moduleInitOrder>t.moduleInitOrder?1:-1})),i.sort((function(e,t){return e.moduleInitOrder>t.moduleInitOrder?1:-1})),this.modulesRegular=e.concat(n.concat(i))}}},{key:"bindModules",value:function(e,t,i){var n=Object.values(t);i&&n.forEach((function(e){e.prototype.moduleCore=!0})),e.registerModule(n)}}]),i}(),J=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).element=o._createAlertElement(),o.msgElement=o._createMsgElement(),o.type=null,o.element.appendChild(o.msgElement),o}return o(n,[{key:"_createAlertElement",value:function(){var e=document.createElement("div");return e.classList.add("tabulator-alert"),e}},{key:"_createMsgElement",value:function(){var e=document.createElement("div");return e.classList.add("tabulator-alert-msg"),e.setAttribute("role","alert"),e}},{key:"_typeClass",value:function(){return"tabulator-alert-state-"+this.type}},{key:"alert",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"msg";if(e){for(this.clear(),this.type=t;this.msgElement.firstChild;)this.msgElement.removeChild(this.msgElement.firstChild);this.msgElement.classList.add(this._typeClass()),"function"==typeof e&&(e=e()),e instanceof HTMLElement?this.msgElement.appendChild(e):this.msgElement.innerHTML=e,this.table.element.appendChild(this.element)}}},{key:"clear",value:function(){this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.msgElement.classList.remove(this._typeClass())}}]),n}(g),Y=function(){function i(e,n){var o=this;t(this,i),this.options={},this.columnManager=null,this.rowManager=null,this.footerManager=null,this.alertManager=null,this.vdomHoz=null,this.externalEvents=null,this.eventBus=null,this.interactionMonitor=!1,this.browser="",this.browserSlow=!1,this.browserMobile=!1,this.rtl=!1,this.originalElement=null,this.componentFunctionBinder=new _(this),this.dataLoader=!1,this.modules={},this.modulesCore=[],this.modulesRegular=[],this.optionsList=new E(this,"table constructor"),this.initialized=!1,this.initializeElement(e)&&(this.initializeCoreSystems(n),setTimeout((function(){o._create()}))),I.register(this)}return o(i,[{key:"initializeElement",value:function(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement?(this.element=e,!0):"string"==typeof e?(this.element=document.querySelector(e),!!this.element||(console.error("Tabulator Creation Error - no element found matching selector: ",e),!1)):(console.error("Tabulator Creation Error - Invalid element provided:",e),!1)}},{key:"initializeCoreSystems",value:function(e){this.columnManager=new M(this),this.rowManager=new z(this),this.footerManager=new F(this),this.dataLoader=new O(this),this.alertManager=new J(this),this.bindModules(),this.options=this.optionsList.generate(i.defaultOptions,e),this._clearObjectPointers(),this._mapDeprecatedFunctionality(),this.externalEvents=new A(this,this.options,this.options.debugEventsExternal),this.eventBus=new B(this.options.debugEventsInternal),this.interactionMonitor=new H(this),this.dataLoader.initialize(),this.footerManager.initialize()}},{key:"_mapDeprecatedFunctionality",value:function(){}},{key:"_clearSelection",value:function(){this.element.classList.add("tabulator-block-select"),window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty(),this.element.classList.remove("tabulator-block-select")}},{key:"_create",value:function(){this.externalEvents.dispatch("tableBuilding"),this.eventBus.dispatch("table-building"),this._rtlCheck(),this._buildElement(),this._initializeTable(),this._loadInitialData(),this.initialized=!0,this.externalEvents.dispatch("tableBuilt")}},{key:"_rtlCheck",value:function(){var e=window.getComputedStyle(this.element);switch(this.options.textDirection){case"auto":if("rtl"!==e.direction)break;case"rtl":this.element.classList.add("tabulator-rtl"),this.rtl=!0;break;case"ltr":this.element.classList.add("tabulator-ltr");default:this.rtl=!1}}},{key:"_clearObjectPointers",value:function(){this.options.columns=this.options.columns.slice(0),Array.isArray(this.options.data)&&!this.options.reactiveData&&(this.options.data=this.options.data.slice(0))}},{key:"_buildElement",value:function(){var t,i=this.element,n=this.options;if("TABLE"===i.tagName){this.originalElement=this.element,t=document.createElement("div");var o=i.attributes;for(var a in o)"object"==e(o[a])&&t.setAttribute(o[a].name,o[a].value);i.parentNode.replaceChild(t,i),this.element=i=t}for(i.classList.add("tabulator"),i.setAttribute("role","grid");i.firstChild;)i.removeChild(i.firstChild);n.height&&(n.height=isNaN(n.height)?n.height:n.height+"px",i.style.height=n.height),!1!==n.minHeight&&(n.minHeight=isNaN(n.minHeight)?n.minHeight:n.minHeight+"px",i.style.minHeight=n.minHeight),!1!==n.maxHeight&&(n.maxHeight=isNaN(n.maxHeight)?n.maxHeight:n.maxHeight+"px",i.style.maxHeight=n.maxHeight)}},{key:"_initializeTable",value:function(){var e=this.element,t=this.options;this.interactionMonitor.initialize(),this.columnManager.initialize(),this.rowManager.initialize(),this._detectBrowser(),this.modulesCore.forEach((function(e){e.initialize()})),e.appendChild(this.columnManager.getElement()),e.appendChild(this.rowManager.getElement()),t.footerElement&&this.footerManager.activate(),t.autoColumns&&t.data&&this.columnManager.generateColumnsFromRowData(this.options.data),this.modulesRegular.forEach((function(e){e.initialize()})),this.columnManager.setColumns(t.columns),this.eventBus.dispatch("table-built")}},{key:"_loadInitialData",value:function(){this.dataLoader.load(this.options.data)}},{key:"destroy",value:function(){var e=this.element;for(I.deregister(this),this.eventBus.dispatch("table-destroy"),this.rowManager.rows.forEach((function(e){e.wipe()})),this.rowManager.rows=[],this.rowManager.activeRows=[],this.rowManager.displayRows=[];e.firstChild;)e.removeChild(e.firstChild);e.classList.remove("tabulator")}},{key:"_detectBrowser",value:function(){var e=navigator.userAgent||navigator.vendor||window.opera;e.indexOf("Trident")>-1?(this.browser="ie",this.browserSlow=!0):e.indexOf("Edge")>-1?(this.browser="edge",this.browserSlow=!0):e.indexOf("Firefox")>-1?(this.browser="firefox",this.browserSlow=!1):(this.browser="other",this.browserSlow=!1),this.browserMobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.slice(0,4))}},{key:"initGuard",value:function(e,t){var i,n;return this.options.debugInitialization&&!this.initialized&&(e||(e=" "==(n="Error"==(i=(new Error).stack.split("\n"))[0]?i[2]:i[1])[0]?n.trim().split(" ")[1].split(".")[1]:n.trim().split("@")[0]),console.warn("Table Not Initialized - Calling the "+e+" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function."+(t?" "+t:""))),this.initialized}},{key:"blockRedraw",value:function(){return this.initGuard(),this.rowManager.blockRedraw()}},{key:"restoreRedraw",value:function(){return this.initGuard(),this.rowManager.restoreRedraw()}},{key:"setData",value:function(e,t,i){return this.initGuard(!1,"To set initial data please use the 'data' property in the table constructor."),this.dataLoader.load(e,t,i,!1)}},{key:"clearData",value:function(){this.initGuard(),this.dataLoader.blockActiveLoad(),this.rowManager.clearData()}},{key:"getData",value:function(e){return this.rowManager.getData(e)}},{key:"getDataCount",value:function(e){return this.rowManager.getDataCount(e)}},{key:"replaceData",value:function(e,t,i){return this.initGuard(),this.dataLoader.load(e,t,i,!0,!0)}},{key:"updateData",value:function(e){var t=this,i=0;return this.initGuard(),new Promise((function(n,o){t.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e?e.forEach((function(e){var o=t.rowManager.findRow(e[t.options.index]);o&&(i++,o.updateData(e).then((function(){--i||n()})))})):(console.warn("Update Error - No data provided"),o("Update Error - No data provided"))}))}},{key:"addData",value:function(e,t,i){var n=this;return this.initGuard(),new Promise((function(o,a){n.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e?n.rowManager.addRows(e,t,i).then((function(e){var t=[];e.forEach((function(e){t.push(e.getComponent())})),o(t)})):(console.warn("Update Error - No data provided"),a("Update Error - No data provided"))}))}},{key:"updateOrAddData",value:function(e){var t=this,i=[],n=0;return this.initGuard(),new Promise((function(o,a){t.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e?e.forEach((function(e){var a=t.rowManager.findRow(e[t.options.index]);n++,a?a.updateData(e).then((function(){n--,i.push(a.getComponent()),n||o(i)})):t.rowManager.addRows(e).then((function(e){n--,i.push(e[0].getComponent()),n||o(i)}))})):(console.warn("Update Error - No data provided"),a("Update Error - No data provided"))}))}},{key:"getRow",value:function(e){var t=this.rowManager.findRow(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}},{key:"getRowFromPosition",value:function(e,t){var i=this.rowManager.getRowFromPosition(e,t);return i?i.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}},{key:"deleteRow",value:function(e){var t=this,i=[];this.initGuard(),Array.isArray(e)||(e=[e]);var n,o=f(e);try{for(o.s();!(n=o.n()).done;){var a=n.value,r=this.rowManager.findRow(a,!0);if(!r)return console.error("Delete Error - No matching row found:",a),Promise.reject("Delete Error - No matching row found");i.push(r)}}catch(e){o.e(e)}finally{o.f()}return i.sort((function(e,i){return t.rowManager.rows.indexOf(e)>t.rowManager.rows.indexOf(i)?1:-1})),i.forEach((function(e){e.delete()})),this.rowManager.reRenderInPosition(),Promise.resolve()}},{key:"addRow",value:function(e,t,i){return this.initGuard(),"string"==typeof e&&(e=JSON.parse(e)),this.rowManager.addRows(e,t,i).then((function(e){return e[0].getComponent()}))}},{key:"updateOrAddRow",value:function(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),"string"==typeof t&&(t=JSON.parse(t)),i?i.updateData(t).then((function(){return i.getComponent()})):this.rowManager.addRows(t).then((function(e){return e[0].getComponent()}))}},{key:"updateRow",value:function(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),"string"==typeof t&&(t=JSON.parse(t)),i?i.updateData(t).then((function(){return Promise.resolve(i.getComponent())})):(console.warn("Update Error - No matching row found:",e),Promise.reject("Update Error - No matching row found"))}},{key:"scrollToRow",value:function(e,t,i){var n=this.rowManager.findRow(e);return n?this.rowManager.scrollToRow(n,t,i):(console.warn("Scroll Error - No matching row found:",e),Promise.reject("Scroll Error - No matching row found"))}},{key:"moveRow",value:function(e,t,i){var n=this.rowManager.findRow(e);this.initGuard(),n?n.moveToRow(t,i):console.warn("Move Error - No matching row found:",e)}},{key:"getRows",value:function(e){return this.rowManager.getComponents(e)}},{key:"getRowPosition",value:function(e,t){var i=this.rowManager.findRow(e);return i?this.rowManager.getRowPosition(i,t):(console.warn("Position Error - No matching row found:",e),!1)}},{key:"setColumns",value:function(e){this.initGuard(!1,"To set initial columns please use the 'columns' property in the table constructor"),this.columnManager.setColumns(e)}},{key:"getColumns",value:function(e){return this.columnManager.getComponents(e)}},{key:"getColumn",value:function(e){var t=this.columnManager.findColumn(e);return t?t.getComponent():(console.warn("Find Error - No matching column found:",e),!1)}},{key:"getColumnDefinitions",value:function(){return this.columnManager.getDefinitionTree()}},{key:"showColumn",value:function(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Show Error - No matching column found:",e),!1;t.show()}},{key:"hideColumn",value:function(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Hide Error - No matching column found:",e),!1;t.hide()}},{key:"toggleColumn",value:function(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Visibility Toggle Error - No matching column found:",e),!1;t.visible?t.hide():t.show()}},{key:"addColumn",value:function(e,t,i){var n=this.columnManager.findColumn(i);return this.initGuard(),this.columnManager.addColumn(e,t,n).then((function(e){return e.getComponent()}))}},{key:"deleteColumn",value:function(e){var t=this.columnManager.findColumn(e);return this.initGuard(),t?t.delete():(console.warn("Column Delete Error - No matching column found:",e),Promise.reject())}},{key:"updateColumnDefinition",value:function(e,t){var i=this.columnManager.findColumn(e);return this.initGuard(),i?i.updateDefinition(t):(console.warn("Column Update Error - No matching column found:",e),Promise.reject())}},{key:"moveColumn",value:function(e,t,i){var n=this.columnManager.findColumn(e),o=this.columnManager.findColumn(t);this.initGuard(),n?o?this.columnManager.moveColumn(n,o,i):console.warn("Move Error - No matching column found:",o):console.warn("Move Error - No matching column found:",e)}},{key:"scrollToColumn",value:function(e,t,i){var n=this;return new Promise((function(o,a){var r=n.columnManager.findColumn(e);return r?n.columnManager.scrollToColumn(r,t,i):(console.warn("Scroll Error - No matching column found:",e),Promise.reject("Scroll Error - No matching column found"))}))}},{key:"redraw",value:function(e){this.initGuard(),this.columnManager.redraw(e),this.rowManager.redraw(e)}},{key:"setHeight",value:function(e){this.options.height=isNaN(e)?e:e+"px",this.element.style.height=this.options.height,this.rowManager.initializeRenderer(),this.rowManager.redraw()}},{key:"on",value:function(e,t){this.externalEvents.subscribe(e,t)}},{key:"off",value:function(e,t){this.externalEvents.unsubscribe(e,t)}},{key:"dispatchEvent",value:function(){var e,t=Array.from(arguments);t.shift();(e=this.externalEvents).dispatch.apply(e,arguments)}},{key:"alert",value:function(e,t){this.initGuard(),this.alertManager.alert(e,t)}},{key:"clearAlert",value:function(){this.initGuard(),this.alertManager.clear()}},{key:"modExists",value:function(e,t){return!!this.modules[e]||(t&&console.error("Tabulator Module Not Installed: "+e),!1)}},{key:"module",value:function(e){var t=this.modules[e];return t||console.error("Tabulator module not installed: "+e),t}}]),i}();Y.defaultOptions={debugEventsExternal:!1,debugEventsInternal:!1,debugInvalidOptions:!0,debugInitialization:!0,height:!1,minHeight:!1,maxHeight:!1,columnHeaderVertAlign:"top",popupContainer:!1,columns:[],columnDefaults:{},data:!1,autoColumns:!1,autoColumnsDefinitions:!1,nestedFieldSeparator:".",footerElement:!1,index:"id",textDirection:"auto",addRowPos:"bottom",headerVisible:!0,renderVertical:"virtual",renderHorizontal:"basic",renderVerticalBuffer:0,scrollToRowPosition:"top",scrollToRowIfVisible:!0,scrollToColumnPosition:"left",scrollToColumnIfVisible:!0,rowFormatter:!1,rowFormatterPrint:null,rowFormatterClipboard:null,rowFormatterHtmlOutput:null,rowHeight:null,placeholder:!1,dataLoader:!0,dataLoaderLoading:!1,dataLoaderError:!1,dataLoaderErrorTimeout:3e3,dataSendParams:{},dataReceiveParams:{}},new K(Y);var $=function(i){a(r,i);var n=c(r);function r(e){var i;return t(this,r),(i=n.call(this,e)).allowedTypes=["","data","download","clipboard","print","htmlOutput"],i.registerColumnOption("accessor"),i.registerColumnOption("accessorParams"),i.registerColumnOption("accessorData"),i.registerColumnOption("accessorDataParams"),i.registerColumnOption("accessorDownload"),i.registerColumnOption("accessorDownloadParams"),i.registerColumnOption("accessorClipboard"),i.registerColumnOption("accessorClipboardParams"),i.registerColumnOption("accessorPrint"),i.registerColumnOption("accessorPrintParams"),i.registerColumnOption("accessorHtmlOutput"),i.registerColumnOption("accessorHtmlOutputParams"),i}return o(r,[{key:"initialize",value:function(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-retrieve",this.transformRow.bind(this))}},{key:"initializeColumn",value:function(e){var t=this,i=!1,n={};this.allowedTypes.forEach((function(o){var a,r="accessor"+(o.charAt(0).toUpperCase()+o.slice(1));e.definition[r]&&(a=t.lookupAccessor(e.definition[r]))&&(i=!0,n[r]={accessor:a,params:e.definition[r+"Params"]||{}})})),i&&(e.modules.accessor=n)}},{key:"lookupAccessor",value:function(t){var i=!1;switch(e(t)){case"string":r.accessors[t]?i=r.accessors[t]:console.warn("Accessor Error - No such accessor found, ignoring: ",t);break;case"function":i=t}return i}},{key:"transformRow",value:function(e,t){var i="accessor"+(t.charAt(0).toUpperCase()+t.slice(1)),n=e.getComponent(),o=k.deepClone(e.data||{});return this.table.columnManager.traverse((function(e){var a,r,s,l;e.modules.accessor&&(r=e.modules.accessor[i]||e.modules.accessor.accessor||!1)&&"undefined"!=(a=e.getFieldValue(o))&&(l=e.getComponent(),s="function"==typeof r.params?r.params(a,o,t,l,n):r.params,e.setFieldValue(o,r.accessor(a,o,t,s,l,n)))})),o}}]),r}(V);$.moduleName="accessor",$.accessors={};function Z(t,i){var n=[];if(i=i||"",Array.isArray(t))t.forEach((function(e,t){n=n.concat(Z(e,i?i+"["+t+"]":t))}));else if("object"===e(t))for(var o in t)n=n.concat(Z(t[o],i?i+"["+o+"]":o));else n.push({key:i,value:t});return n}function Q(e){var t=Z(e),i=[];return t.forEach((function(e){i.push(encodeURIComponent(e.key)+"="+encodeURIComponent(e.value))})),i.join("&")}function ee(e,t,i){return e&&i&&Object.keys(i).length&&(t.method&&"get"!=t.method.toLowerCase()||(t.method="get",e+=(e.includes("?")?"&":"?")+Q(i))),e}function te(t,i){var n=[];if(i=i||"",Array.isArray(t))t.forEach((function(e,t){n=n.concat(te(e,i?i+"["+t+"]":t))}));else if("object"===e(t))for(var o in t)n=n.concat(te(t[o],i?i+"["+o+"]":o));else n.push({key:i,value:t});return n}var ie={json:{headers:{"Content-Type":"application/json"},body:function(e,t,i){return JSON.stringify(i)}},form:{headers:{},body:function(e,t,i){var n=te(i),o=new FormData;return n.forEach((function(e){o.append(e.key,e.value)})),o}}},ne=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).config={},o.url="",o.urlGenerator=!1,o.params=!1,o.loaderPromise=!1,o.registerTableOption("ajaxURL",!1),o.registerTableOption("ajaxURLGenerator",!1),o.registerTableOption("ajaxParams",{}),o.registerTableOption("ajaxConfig","get"),o.registerTableOption("ajaxContentType","form"),o.registerTableOption("ajaxRequestFunc",!1),o.registerTableOption("ajaxRequesting",(function(){})),o.registerTableOption("ajaxResponse",!1),o.contentTypeFormatters=n.contentTypeFormatters,o}return o(n,[{key:"initialize",value:function(){this.loaderPromise=this.table.options.ajaxRequestFunc||n.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||n.defaultURLGenerator,this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.setDefaultConfig(this.table.options.ajaxConfig),this.registerTableFunction("getAjaxUrl",this.getUrl.bind(this)),this.subscribe("data-loading",this.requestDataCheck.bind(this)),this.subscribe("data-params",this.requestParams.bind(this)),this.subscribe("data-load",this.requestData.bind(this))}},{key:"requestParams",value:function(e,t,i,n){var o=this.table.options.ajaxParams;return o&&("function"==typeof o&&(o=o.call(this.table)),n=Object.assign(n,o)),n}},{key:"requestDataCheck",value:function(e,t,i,n){return!((e||!this.url)&&"string"!=typeof e)}},{key:"requestData",value:function(e,t,i,n,o){var a;return!o&&this.requestDataCheck(e)?(e&&this.setUrl(e),a=this.generateConfig(i),this.sendRequest(this.url,t,a)):o}},{key:"setDefaultConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config=Object.assign({},n.defaultConfig),"string"==typeof e?this.config.method=e:Object.assign(this.config,e)}},{key:"generateConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign({},this.config);return"string"==typeof e?t.method=e:Object.assign(t,e),t}},{key:"setUrl",value:function(e){this.url=e}},{key:"getUrl",value:function(){return this.url}},{key:"sendRequest",value:function(e,t,i){var n=this;return!1!==this.table.options.ajaxRequesting.call(this.table,e,t)?this.loaderPromise(e,i,t).then((function(i){return n.table.options.ajaxResponse&&(i=n.table.options.ajaxResponse.call(n.table,e,t,i)),i})):Promise.reject()}}]),n}(V);ne.moduleName="ajax",ne.defaultConfig={method:"GET"},ne.defaultURLGenerator=ee,ne.defaultLoaderPromise=function(t,i,n){var o,a=this;return new Promise((function(r,s){if(t=a.urlGenerator.call(a.table,t,i,n),"GET"!=i.method.toUpperCase())if(o="object"===e(a.table.options.ajaxContentType)?a.table.options.ajaxContentType:a.contentTypeFormatters[a.table.options.ajaxContentType]){for(var l in o.headers)i.headers||(i.headers={}),void 0===i.headers[l]&&(i.headers[l]=o.headers[l]);i.body=o.body.call(a,t,i,n)}else console.warn("Ajax Error - Invalid ajaxContentType value:",a.table.options.ajaxContentType);t?(void 0===i.headers&&(i.headers={}),void 0===i.headers.Accept&&(i.headers.Accept="application/json"),void 0===i.headers["X-Requested-With"]&&(i.headers["X-Requested-With"]="XMLHttpRequest"),void 0===i.mode&&(i.mode="cors"),"cors"==i.mode?(void 0===i.headers.Origin&&(i.headers.Origin=window.location.origin),void 0===i.credentials&&(i.credentials="same-origin")):void 0===i.credentials&&(i.credentials="include"),fetch(t,i).then((function(e){e.ok?e.json().then((function(e){r(e)})).catch((function(e){s(e),console.warn("Ajax Load Error - Invalid JSON returned",e)})):(console.error("Ajax Load Error - Connection Error: "+e.status,e.statusText),s(e))})).catch((function(e){console.error("Ajax Load Error - Connection Error: ",e),s(e)}))):(console.warn("Ajax Load Error - No URL Set"),r([]))}))},ne.contentTypeFormatters=ie;var oe=function(i){a(r,i);var n=c(r);function r(e){var i;return t(this,r),(i=n.call(this,e)).mode=!0,i.pasteParser=function(){},i.pasteAction=function(){},i.customSelection=!1,i.rowRange=!1,i.blocked=!0,i.registerTableOption("clipboard",!1),i.registerTableOption("clipboardCopyStyled",!0),i.registerTableOption("clipboardCopyConfig",!1),i.registerTableOption("clipboardCopyFormatter",!1),i.registerTableOption("clipboardCopyRowRange","active"),i.registerTableOption("clipboardPasteParser","table"),i.registerTableOption("clipboardPasteAction","insert"),i.registerColumnOption("clipboard"),i.registerColumnOption("titleClipboard"),i}return o(r,[{key:"initialize",value:function(){var e=this;this.mode=this.table.options.clipboard,this.rowRange=this.table.options.clipboardCopyRowRange,!0!==this.mode&&"copy"!==this.mode||this.table.element.addEventListener("copy",(function(t){var i,n;if(!e.blocked){if(t.preventDefault(),e.customSelection)i=e.customSelection,e.table.options.clipboardCopyFormatter&&(i=e.table.options.clipboardCopyFormatter("plain",i));else{var o=e.table.modules.export.generateExportList(e.table.options.clipboardCopyConfig,e.table.options.clipboardCopyStyled,e.rowRange,"clipboard");i=(n=e.table.modules.export.genereateHTMLTable(o))?e.generatePlainContent(o):"",e.table.options.clipboardCopyFormatter&&(i=e.table.options.clipboardCopyFormatter("plain",i),n=e.table.options.clipboardCopyFormatter("html",n))}window.clipboardData&&window.clipboardData.setData?window.clipboardData.setData("Text",i):t.clipboardData&&t.clipboardData.setData?(t.clipboardData.setData("text/plain",i),n&&t.clipboardData.setData("text/html",n)):t.originalEvent&&t.originalEvent.clipboardData.setData&&(t.originalEvent.clipboardData.setData("text/plain",i),n&&t.originalEvent.clipboardData.setData("text/html",n)),e.dispatchExternal("clipboardCopied",i,n),e.reset()}})),!0!==this.mode&&"paste"!==this.mode||this.table.element.addEventListener("paste",(function(t){e.paste(t)})),this.setPasteParser(this.table.options.clipboardPasteParser),this.setPasteAction(this.table.options.clipboardPasteAction),this.registerTableFunction("copyToClipboard",this.copy.bind(this))}},{key:"reset",value:function(){this.blocked=!0,this.customSelection=!1}},{key:"generatePlainContent",value:function(t){var i=[];return t.forEach((function(t){var n=[];t.columns.forEach((function(i){var o="";if(i)if("group"===t.type&&(i.value=i.component.getKey()),null===i.value)o="";else switch(e(i.value)){case"object":o=JSON.stringify(i.value);break;case"undefined":o="";break;default:o=i.value}n.push(o)})),i.push(n.join("\t"))})),i.join("\n")}},{key:"copy",value:function(e,t){var i,n;this.blocked=!1,this.customSelection=!1,!0!==this.mode&&"copy"!==this.mode||(this.rowRange=e||this.table.options.clipboardCopyRowRange,void 0!==window.getSelection&&void 0!==document.createRange?((e=document.createRange()).selectNodeContents(this.table.element),(i=window.getSelection()).toString()&&t&&(this.customSelection=i.toString()),i.removeAllRanges(),i.addRange(e)):void 0!==document.selection&&void 0!==document.body.createTextRange&&((n=document.body.createTextRange()).moveToElementText(this.table.element),n.select()),document.execCommand("copy"),i&&i.removeAllRanges())}},{key:"setPasteAction",value:function(t){switch(e(t)){case"string":this.pasteAction=r.pasteActions[t],this.pasteAction||console.warn("Clipboard Error - No such paste action found:",t);break;case"function":this.pasteAction=t}}},{key:"setPasteParser",value:function(t){switch(e(t)){case"string":this.pasteParser=r.pasteParsers[t],this.pasteParser||console.warn("Clipboard Error - No such paste parser found:",t);break;case"function":this.pasteParser=t}}},{key:"paste",value:function(e){var t,i,n;this.checkPaseOrigin(e)&&(t=this.getPasteData(e),(i=this.pasteParser.call(this,t))?(e.preventDefault(),this.table.modExists("mutator")&&(i=this.mutateData(i)),n=this.pasteAction.call(this,i),this.dispatchExternal("clipboardPasted",t,i,n)):this.dispatchExternal("clipboardPasteError",t))}},{key:"mutateData",value:function(e){var t=this,i=[];return Array.isArray(e)?e.forEach((function(e){i.push(t.table.modules.mutator.transformRow(e,"clipboard"))})):i=e,i}},{key:"checkPaseOrigin",value:function(e){var t=!0;return("DIV"!=e.target.tagName||this.table.modules.edit.currentCell)&&(t=!1),t}},{key:"getPasteData",value:function(e){var t;return window.clipboardData&&window.clipboardData.getData?t=window.clipboardData.getData("Text"):e.clipboardData&&e.clipboardData.getData?t=e.clipboardData.getData("text/plain"):e.originalEvent&&e.originalEvent.clipboardData.getData&&(t=e.originalEvent.clipboardData.getData("text/plain")),t}}]),r}(V);oe.moduleName="clipboard",oe.pasteActions={replace:function(e){return this.table.setData(e)},update:function(e){return this.table.updateOrAddData(e)},insert:function(e){return this.table.addData(e)}},oe.pasteParsers={table:function(e){var t=[],i=!0,n=this.table.columnManager.columns,o=[],a=[];return(e=e.split("\n")).forEach((function(e){t.push(e.split("\t"))})),!(!t.length||1===t.length&&t[0].length<2)&&(t[0].forEach((function(e){var t=n.find((function(t){return e&&t.definition.title&&e.trim()&&t.definition.title.trim()===e.trim()}));t?o.push(t):i=!1})),i||(i=!0,o=[],t[0].forEach((function(e){var t=n.find((function(t){return e&&t.field&&e.trim()&&t.field.trim()===e.trim()}));t?o.push(t):i=!1})),i||(o=this.table.columnManager.columnsByIndex)),i&&t.shift(),t.forEach((function(e){var t={};e.forEach((function(e,i){o[i]&&(t[o[i].field]=e)})),a.push(t)})),a)}};var ae=function(){function e(i){return t(this,e),this._row=i,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._row.table.componentFunctionBinder.handle("row",e._row,t)}})}return o(e,[{key:"getData",value:function(e){return this._row.getData(e)}},{key:"getElement",value:function(){return this._row.getElement()}},{key:"getTable",value:function(){return this._row.table}},{key:"getCells",value:function(){var e=[];return this._row.getCells().forEach((function(t){e.push(t.getComponent())})),e}},{key:"getCell",value:function(e){var t=this._row.getCell(e);return!!t&&t.getComponent()}},{key:"_getSelf",value:function(){return this._row}}]),e}(),re={avg:function(e,t,i){var n=0,o=void 0!==i.precision?i.precision:2;return e.length&&(n=e.reduce((function(e,t){return Number(e)+Number(t)})),n/=e.length,n=!1!==o?n.toFixed(o):n),parseFloat(n).toString()},max:function(e,t,i){var n=null,o=void 0!==i.precision&&i.precision;return e.forEach((function(e){((e=Number(e))>n||null===n)&&(n=e)})),null!==n?!1!==o?n.toFixed(o):n:""},min:function(e,t,i){var n=null,o=void 0!==i.precision&&i.precision;return e.forEach((function(e){((e=Number(e))"),i.dataTreeExpandElement?"string"==typeof i.dataTreeExpandElement?((t=document.createElement("div")).innerHTML=i.dataTreeExpandElement,this.expandEl=t.firstChild):this.expandEl=i.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.tabIndex=0,this.expandEl.innerHTML="
"),e(i.dataTreeStartExpanded)){case"boolean":this.startOpen=function(e,t){return i.dataTreeStartExpanded};break;case"function":this.startOpen=i.dataTreeStartExpanded;break;default:this.startOpen=function(e,t){return i.dataTreeStartExpanded[t]}}this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("row-deleted",this.rowDelete.bind(this),0),this.subscribe("row-data-changed",this.rowDataChanged.bind(this),10),this.subscribe("cell-value-updated",this.cellValueChanged.bind(this)),this.subscribe("edit-cancelled",this.cellValueChanged.bind(this)),this.subscribe("column-moving-rows",this.columnMoving.bind(this)),this.subscribe("table-built",this.initializeElementField.bind(this)),this.subscribe("table-redrawing",this.tableRedrawing.bind(this)),this.registerDisplayHandler(this.getRows.bind(this),30)}}},{key:"tableRedrawing",value:function(e){var t=this;e&&this.table.rowManager.getRows().forEach((function(e){t.reinitializeRowChildren(e)}))}},{key:"initializeElementField",value:function(){var e=this.table.columnManager.getFirstVisibleColumn();this.elementField=this.table.options.dataTreeElementColumn||!!e&&e.field}},{key:"getRowChildren",value:function(e){return this.getTreeChildren(e,!0)}},{key:"columnMoving",value:function(){var e=this,t=[];return this.table.rowManager.rows.forEach((function(i){t=t.concat(e.getTreeChildren(i,!1,!0))})),t}},{key:"rowDataChanged",value:function(e,t,i){this.redrawNeeded(i)&&(this.initializeRow(e),t&&(this.layoutRow(e),this.refreshData(!0)))}},{key:"cellValueChanged",value:function(e){e.column.getField()===this.elementField&&this.layoutRow(e.row)}},{key:"initializeRow",value:function(t){var i=t.getData()[this.field],n=Array.isArray(i),o=n||!n&&"object"===e(i)&&null!==i;!o&&t.modules.dataTree&&t.modules.dataTree.branchEl&&t.modules.dataTree.branchEl.parentNode.removeChild(t.modules.dataTree.branchEl),!o&&t.modules.dataTree&&t.modules.dataTree.controlEl&&t.modules.dataTree.controlEl.parentNode.removeChild(t.modules.dataTree.controlEl),t.modules.dataTree={index:t.modules.dataTree?t.modules.dataTree.index:0,open:!!o&&(t.modules.dataTree?t.modules.dataTree.open:this.startOpen(t.getComponent(),0)),controlEl:!(!t.modules.dataTree||!o)&&t.modules.dataTree.controlEl,branchEl:!(!t.modules.dataTree||!o)&&t.modules.dataTree.branchEl,parent:!!t.modules.dataTree&&t.modules.dataTree.parent,children:o}}},{key:"reinitializeRowChildren",value:function(e){this.getTreeChildren(e,!1,!0).forEach((function(e){e.reinitialize(!0)}))}},{key:"layoutRow",value:function(e){var t=(this.elementField?e.getCell(this.elementField):e.getCells()[0]).getElement(),i=e.modules.dataTree;i.branchEl&&(i.branchEl.parentNode&&i.branchEl.parentNode.removeChild(i.branchEl),i.branchEl=!1),i.controlEl&&(i.controlEl.parentNode&&i.controlEl.parentNode.removeChild(i.controlEl),i.controlEl=!1),this.generateControlElement(e,t),e.getElement().classList.add("tabulator-tree-level-"+i.index),i.index&&(this.branchEl?(i.branchEl=this.branchEl.cloneNode(!0),t.insertBefore(i.branchEl,t.firstChild),this.table.rtl?i.branchEl.style.marginRight=(i.branchEl.offsetWidth+i.branchEl.style.marginLeft)*(i.index-1)+i.index*this.indent+"px":i.branchEl.style.marginLeft=(i.branchEl.offsetWidth+i.branchEl.style.marginRight)*(i.index-1)+i.index*this.indent+"px"):this.table.rtl?t.style.paddingRight=parseInt(window.getComputedStyle(t,null).getPropertyValue("padding-right"))+i.index*this.indent+"px":t.style.paddingLeft=parseInt(window.getComputedStyle(t,null).getPropertyValue("padding-left"))+i.index*this.indent+"px")}},{key:"generateControlElement",value:function(e,t){var i=this,n=e.modules.dataTree,o=(t=t||e.getCells()[0].getElement(),n.controlEl);!1!==n.children&&(n.open?(n.controlEl=this.collapseEl.cloneNode(!0),n.controlEl.addEventListener("click",(function(t){t.stopPropagation(),i.collapseRow(e)}))):(n.controlEl=this.expandEl.cloneNode(!0),n.controlEl.addEventListener("click",(function(t){t.stopPropagation(),i.expandRow(e)}))),n.controlEl.addEventListener("mousedown",(function(e){e.stopPropagation()})),o&&o.parentNode===t?o.parentNode.replaceChild(n.controlEl,o):t.insertBefore(n.controlEl,t.firstChild))}},{key:"setDisplayIndex",value:function(e){this.displayIndex=e}},{key:"getDisplayIndex",value:function(){return this.displayIndex}},{key:"getRows",value:function(e){var t=this,i=[];return e.forEach((function(e,n){var o;i.push(e),e instanceof D&&(e.create(),(o=e.modules.dataTree.children).index||!1===o.children||t.getChildren(e).forEach((function(e){e.create(),i.push(e)})))})),i}},{key:"getChildren",value:function(e,t){var i=this,n=e.modules.dataTree,o=[],a=[];return!1!==n.children&&(n.open||t)&&(Array.isArray(n.children)||(n.children=this.generateChildren(e)),o=this.table.modExists("filter")&&this.table.options.dataTreeFilter?this.table.modules.filter.filter(n.children):n.children,this.table.modExists("sort")&&this.table.options.dataTreeSort&&this.table.modules.sort.sort(o),o.forEach((function(e){a.push(e),i.getChildren(e).forEach((function(e){a.push(e)}))}))),a}},{key:"generateChildren",value:function(e){var t=this,i=[],n=e.getData()[this.field];return Array.isArray(n)||(n=[n]),n.forEach((function(n){var o=new D(n||{},t.table.rowManager);o.create(),o.modules.dataTree.index=e.modules.dataTree.index+1,o.modules.dataTree.parent=e,o.modules.dataTree.children&&(o.modules.dataTree.open=t.startOpen(o.getComponent(),o.modules.dataTree.index)),i.push(o)})),i}},{key:"expandRow",value:function(e,t){var i=e.modules.dataTree;!1!==i.children&&(i.open=!0,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowExpanded",e.getComponent(),e.modules.dataTree.index))}},{key:"collapseRow",value:function(e){var t=e.modules.dataTree;!1!==t.children&&(t.open=!1,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowCollapsed",e.getComponent(),e.modules.dataTree.index))}},{key:"toggleRow",value:function(e){var t=e.modules.dataTree;!1!==t.children&&(t.open?this.collapseRow(e):this.expandRow(e))}},{key:"isRowExpanded",value:function(e){return e.modules.dataTree.open}},{key:"getTreeParent",value:function(e){return!!e.modules.dataTree.parent&&e.modules.dataTree.parent.getComponent()}},{key:"getTreeParentRoot",value:function(e){return e.modules.dataTree.parent?this.getTreeParentRoot(e.modules.dataTree.parent):e}},{key:"getFilteredTreeChildren",value:function(e){var t=e.modules.dataTree,i=[];return t.children&&(Array.isArray(t.children)||(t.children=this.generateChildren(e)),(this.table.modExists("filter")&&this.table.options.dataTreeFilter?this.table.modules.filter.filter(t.children):t.children).forEach((function(e){e instanceof D&&i.push(e)}))),i}},{key:"rowDelete",value:function(e){var t,i=e.modules.dataTree.parent;i&&(!1!==(t=this.findChildIndex(e,i))&&i.data[this.field].splice(t,1),i.data[this.field].length||delete i.data[this.field],this.initializeRow(i),this.layoutRow(i)),this.refreshData(!0)}},{key:"addTreeChildRow",value:function(e,t,i,n){var o=!1;"string"==typeof t&&(t=JSON.parse(t)),Array.isArray(e.data[this.field])||(e.data[this.field]=[],e.modules.dataTree.open=this.startOpen(e.getComponent(),e.modules.dataTree.index)),void 0!==n&&!1!==(o=this.findChildIndex(n,e))&&e.data[this.field].splice(i?o:o+1,0,t),!1===o&&(i?e.data[this.field].unshift(t):e.data[this.field].push(t)),this.initializeRow(e),this.layoutRow(e),this.refreshData(!0)}},{key:"findChildIndex",value:function(t,i){var n=this,o=!1;return"object"==e(t)?t instanceof D?o=t.data:t instanceof RowComponent?o=t._getSelf().data:"undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&i.modules.dataTree&&(o=i.modules.dataTree.children.find((function(e){return e instanceof D&&e.element===t})))&&(o=o.data):o=null!=t&&i.data[this.field].find((function(e){return e.data[n.table.options.index]==t})),o&&(Array.isArray(i.data[this.field])&&(o=i.data[this.field].indexOf(o)),-1==o&&(o=!1)),o}},{key:"getTreeChildren",value:function(e,t,i){var n=this,o=e.modules.dataTree,a=[];return o.children&&(Array.isArray(o.children)||(o.children=this.generateChildren(e)),o.children.forEach((function(e){e instanceof D&&(a.push(t?e.getComponent():e),i&&(a=a.concat(n.getTreeChildren(e,t,i))))}))),a}},{key:"getChildField",value:function(){return this.field}},{key:"redrawNeeded",value:function(e){return!!this.field&&void 0!==e[this.field]||!!this.elementField&&void 0!==e[this.elementField]}}]),r}(V);le.moduleName="dataTree";var ue={csv:function(t,i,n){var o=i&&i.delimiter?i.delimiter:",",a=[],r=[];t.forEach((function(t){var i=[];switch(t.type){case"group":console.warn("Download Warning - CSV downloader cannot process row groups");break;case"calc":console.warn("Download Warning - CSV downloader cannot process column calculations");break;case"header":t.columns.forEach((function(e,t){e&&1===e.depth&&(r[t]=void 0===e.value||null===e.value?"":'"'+String(e.value).split('"').join('""')+'"')}));break;case"row":t.columns.forEach((function(t){if(t){switch(e(t.value)){case"object":t.value=JSON.stringify(t.value);break;case"undefined":case"null":t.value=""}i.push('"'+String(t.value).split('"').join('""')+'"')}})),a.push(i.join(o))}})),r.length&&a.unshift(r.join(o)),a=a.join("\n"),i.bom&&(a="\ufeff"+a),n(a,"text/csv")},json:function(e,t,i){var n=[];e.forEach((function(e){var t={};switch(e.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":e.columns.forEach((function(e){e&&(t[e.component.getTitleDownload()||e.component.getField()]=e.value)})),n.push(t)}})),i(n=JSON.stringify(n,null,"\t"),"application/json")},jsonLines:function(e,t,i){var n=[];e.forEach((function(e){var t={};switch(e.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":e.columns.forEach((function(e){e&&(t[e.component.getTitleDownload()||e.component.getField()]=e.value)})),n.push(JSON.stringify(t))}})),i(n.join("\n"),"application/x-ndjson")},pdf:function(t,i,n){var o=[],a=[],r={},s=i.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},l=i.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},u=i.jsPDF||{},c=i&&i.title?i.title:"";function h(t,i){var n=[];return t.columns.forEach((function(t){var o;if(t){switch(e(t.value)){case"object":t.value=JSON.stringify(t.value);break;case"undefined":case"null":t.value=""}o={content:t.value,colSpan:t.width,rowSpan:t.height},i&&(o.styles=i),n.push(o)}})),n}u.orientation||(u.orientation=i.orientation||"landscape"),u.unit||(u.unit="pt"),t.forEach((function(e){switch(e.type){case"header":o.push(h(e));break;case"group":a.push(h(e,s));break;case"calc":a.push(h(e,l));break;case"row":a.push(h(e))}}));var d=new jspdf.jsPDF(u);i&&i.autoTable&&(r="function"==typeof i.autoTable?i.autoTable(d)||{}:i.autoTable),c&&(r.didDrawPage=function(e){d.text(c,40,30)}),r.head=o,r.body=a,d.autoTable(r),i&&i.documentProcessing&&i.documentProcessing(d),n(d.output("arraybuffer"),"application/pdf")},xlsx:function(t,i,n){var o=i.sheetName||"Sheet1",a=XLSX.utils.book_new(),r=new g(this);function s(){var i=[],n=[],o={},a={s:{c:0,r:0},e:{c:t[0]?t[0].columns.reduce((function(e,t){return e+(t&&t.width?t.width:1)}),0):0,r:t.length}};return t.forEach((function(t,o){var a=[];t.columns.forEach((function(t,i){t?(a.push(t.value instanceof Date||"object"!==e(t.value)?t.value:JSON.stringify(t.value)),(t.width>1||t.height>-1)&&(t.height>1||t.width>1)&&n.push({s:{r:o,c:i},e:{r:o+t.height-1,c:i+t.width-1}})):a.push("")})),i.push(a)})),XLSX.utils.sheet_add_aoa(o,i),o["!ref"]=XLSX.utils.encode_range(a),n.length&&(o["!merges"]=n),o}if(a.SheetNames=[],a.Sheets={},i.sheetOnly)n(s());else{if(i.sheets)for(var l in i.sheets)!0===i.sheets[l]?(a.SheetNames.push(l),a.Sheets[l]=s()):(a.SheetNames.push(l),r.commsSend(i.sheets[l],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},active:this.active,intercept:function(e){a.Sheets[l]=e}}));else a.SheetNames.push(o),a.Sheets[o]=s();i.documentProcessing&&(a=i.documentProcessing(a)),n(function(e){for(var t=new ArrayBuffer(e.length),i=new Uint8Array(t),n=0;n!=e.length;++n)i[n]=255&e.charCodeAt(n);return t}(XLSX.write(a,{bookType:"xlsx",bookSST:!0,type:"binary"})),"application/octet-stream")}},html:function(e,t,i){this.modExists("export",!0)&&i(this.modules.export.genereateHTMLTable(e),"text/html")}},ce=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).registerTableOption("downloadReady",(function(e,t){return t})),o.registerTableOption("downloadConfig",{}),o.registerTableOption("downloadRowRange","active"),o.registerColumnOption("download"),o.registerColumnOption("titleDownload"),o}return o(n,[{key:"initialize",value:function(){this.registerTableFunction("download",this.download.bind(this)),this.registerTableFunction("downloadToTab",this.downloadToTab.bind(this))}},{key:"downloadToTab",value:function(e,t,i,n){this.download(e,t,i,n,!0)}},{key:"download",value:function(e,t,i,o,a){var r=!1;if("function"==typeof e?r=e:n.downloaders[e]?r=n.downloaders[e]:console.warn("Download Error - No such download type found: ",e),r){var s=this.generateExportList(o);r.call(this.table,s,i||{},function(i,n){a?!0===a?this.triggerDownload(i,n,e,t,!0):a(i):this.triggerDownload(i,n,e,t)}.bind(this))}}},{key:"generateExportList",value:function(e){var t=this.table.modules.export.generateExportList(this.table.options.downloadConfig,!1,e||this.table.options.downloadRowRange,"download"),i=this.table.options.groupHeaderDownload;return i&&!Array.isArray(i)&&(i=[i]),t.forEach((function(e){var t;"group"===e.type&&(t=e.columns[0],i&&i[e.indent]&&(t.value=i[e.indent](t.value,e.component._group.getRowCount(),e.component._group.getData(),e.component)))})),t}},{key:"triggerDownload",value:function(e,t,i,n,o){var a=document.createElement("a"),r=new Blob([e],{type:t});n=n||"Tabulator."+("function"==typeof i?"txt":i);(r=this.table.options.downloadReady(e,r))&&(o?window.open(window.URL.createObjectURL(r)):navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(r,n):(a.setAttribute("href",window.URL.createObjectURL(r)),a.setAttribute("download",n),a.style.display="none",document.body.appendChild(a),a.click(),document.body.removeChild(a)),this.dispatchExternal("downloadComplete"))}},{key:"commsReceived",value:function(e,t,i){switch(t){case"intercept":this.download(i.type,"",i.options,i.active,i.intercept)}}}]),n}(V);function he(e,t){var i=t.mask,n=void 0!==t.maskLetterChar?t.maskLetterChar:"A",o=void 0!==t.maskNumberChar?t.maskNumberChar:"9",a=void 0!==t.maskWildcardChar?t.maskWildcardChar:"*";function r(t){var s=i[t];void 0!==s&&s!==a&&s!==n&&s!==o&&(e.value=e.value+""+s,r(t+1))}e.addEventListener("keydown",(function(t){var r=e.value.length,s=t.key;if(t.keyCode>46){if(r>=i.length)return t.preventDefault(),t.stopPropagation(),!1;switch(i[r]){case n:if(s.toUpperCase()==s.toLowerCase())return t.preventDefault(),t.stopPropagation(),!1;break;case o:if(isNaN(s))return t.preventDefault(),t.stopPropagation(),!1;break;case a:break;default:if(s!==i[r])return t.preventDefault(),t.stopPropagation(),!1}}})),e.addEventListener("keyup",(function(i){i.keyCode>46&&t.maskAutoFill&&r(e.value.length)})),e.placeholder||(e.placeholder=i),t.maskAutoFill&&r(e.value.length)}ce.moduleName="download",ce.downloaders=ue;var de=function(){function i(e,n,o,a,r,s){t(this,i),this.edit=e,this.table=e.table,this.cell=n,this.params=this._initializeParams(s),this.data=[],this.displayItems=[],this.currentItems=[],this.focusedItem=null,this.input=this._createInputElement(),this.listEl=this._createListElement(),this.initialValues=null,this.isFilter=!n._getSelf,this.filterTimeout=null,this.filtered=!1,this.typing=!1,this.values=[],this.popup=null,this.listIteration=0,this.blurable=!0,this.actions={success:a,cancel:r},this._deprecationCheck(),this._initializeValue(),o(this._onRendered.bind(this))}return o(i,[{key:"_deprecationCheck",value:function(){this.params.listItemFormatter&&console.warn("The listItemFormatter editor param has been deprecated, please see the latest editor documentation for updated options"),this.params.sortValuesList&&console.warn("The sortValuesList editor param has been deprecated, please see the latest editor documentation for updated options"),this.params.searchFunc&&console.warn("The searchFunc editor param has been deprecated, please see the latest editor documentation for updated options"),this.params.searchingPlaceholder&&console.warn("The searchingPlaceholder editor param has been deprecated, please see the latest editor documentation for updated options")}},{key:"_initializeValue",value:function(){var e=this.cell.getValue();void 0===e&&void 0!==this.params.defaultValue&&(e=this.params.defaultValue),this.initialValues=this.params.multiselect?e:[e],this.isFilter&&(this.input.value=this.initialValues.join(","),this.headerFilterInitialListGen())}},{key:"_onRendered",value:function(){var e=this.cell.getElement();function t(e){e.stopPropagation()}this.input.style.height="100%",this.input.focus({preventScroll:!0}),e.addEventListener("click",t),setTimeout((function(){e.removeEventListener("click",t)}),1e3)}},{key:"_createListElement",value:function(){var e=document.createElement("div");return e.classList.add("tabulator-edit-list"),e.addEventListener("mousedown",this._preventBlur.bind(this)),e.addEventListener("keydown",this._inputKeyDown.bind(this)),e}},{key:"_setListWidth",value:function(){var e=this.isFilter?this.input:this.cell.getElement();this.listEl.style.minWidth=e.offsetWidth+"px",this.params.maxWidth&&(!0===this.params.maxWidth?this.listEl.style.maxWidth=e.offsetWidth+"px":"number"==typeof this.params.maxWidth?this.listEl.style.maxWidth=this.params.maxWidth+"px":this.listEl.style.maxWidth=this.params.maxWidth)}},{key:"_createInputElement",value:function(){var t=this.params.elementAttributes,i=document.createElement("input");if(i.setAttribute("type",this.params.clearable?"search":"text"),i.style.padding="4px",i.style.width="100%",i.style.boxSizing="border-box",this.params.autocomplete||(i.style.cursor="default",i.style.caretColor="transparent"),t&&"object"==e(t))for(var n in t)"+"==n.charAt(0)?(n=n.slice(1),i.setAttribute(n,i.getAttribute(n)+t["+"+n])):i.setAttribute(n,t[n]);return this.params.mask&&he(i,this.params),this._bindInputEvents(i),i}},{key:"_initializeParams",value:function(t){var i,n=["values","valuesURL","valuesLookup"];return(t=Object.assign({},t)).verticalNavigation=t.verticalNavigation||"editor",t.placeholderLoading=void 0===t.placeholderLoading?"Searching ...":t.placeholderLoading,t.placeholderEmpty=void 0===t.placeholderEmpty?"No Results Found":t.placeholderEmpty,t.filterDelay=void 0===t.filterDelay?300:t.filterDelay,t.emptyValue=Object.keys(t).includes("emptyValue")?t.emptyValue:"",(i=Object.keys(t).filter((function(e){return n.includes(e)})).length)?i>1&&console.warn("list editor config error - only one of the values, valuesURL, or valuesLookup options can be set on the same editor"):console.warn("list editor config error - either the values, valuesURL, or valuesLookup option must be set"),t.autocomplete?t.multiselect&&(t.multiselect=!1,console.warn("list editor config error - multiselect option is not available when autocomplete is enabled")):(t.freetext&&(t.freetext=!1,console.warn("list editor config error - freetext option is only available when autocomplete is enabled")),t.filterFunc&&(t.filterFunc=!1,console.warn("list editor config error - filterFunc option is only available when autocomplete is enabled")),t.filterRemote&&(t.filterRemote=!1,console.warn("list editor config error - filterRemote option is only available when autocomplete is enabled")),t.mask&&(t.mask=!1,console.warn("list editor config error - mask option is only available when autocomplete is enabled")),t.allowEmpty&&(t.allowEmpty=!1,console.warn("list editor config error - allowEmpty option is only available when autocomplete is enabled")),t.listOnEmpty&&(t.listOnEmpty=!1,console.warn("list editor config error - listOnEmpty option is only available when autocomplete is enabled"))),t.filterRemote&&"function"!=typeof t.valuesLookup&&!e(t.valuesURL)&&(t.filterRemote=!1,console.warn("list editor config error - filterRemote option should only be used when values list is populated from a remote source")),t}},{key:"_bindInputEvents",value:function(e){e.addEventListener("focus",this._inputFocus.bind(this)),e.addEventListener("click",this._inputClick.bind(this)),e.addEventListener("blur",this._inputBlur.bind(this)),e.addEventListener("keydown",this._inputKeyDown.bind(this)),e.addEventListener("search",this._inputSearch.bind(this)),this.params.autocomplete&&e.addEventListener("keyup",this._inputKeyUp.bind(this))}},{key:"_inputFocus",value:function(e){this.rebuildOptionsList()}},{key:"_filter",value:function(){var e=this;this.params.filterRemote?(clearTimeout(this.filterTimeout),this.filterTimeout=setTimeout((function(){e.rebuildOptionsList()}),this.params.filterDelay)):this._filterList()}},{key:"_inputClick",value:function(e){e.stopPropagation()}},{key:"_inputBlur",value:function(e){this.blurable&&this.popup&&this.popup.hide()}},{key:"_inputSearch",value:function(){this._clearChoices()}},{key:"_inputKeyDown",value:function(e){switch(e.keyCode){case 38:this._keyUp(e);break;case 40:this._keyDown(e);break;case 37:case 39:this._keySide(e);break;case 13:this._keyEnter();break;case 27:this._keyEsc();break;case 36:case 35:this._keyHomeEnd(e);break;case 9:break;default:this._keySelectLetter(e)}}},{key:"_inputKeyUp",value:function(e){switch(e.keyCode){case 38:case 37:case 39:case 40:case 13:case 27:break;default:this._keyAutoCompLetter(e)}}},{key:"_preventBlur",value:function(){this.blurable=!1,setTimeout((function(){this.blurable=!0}),10)}},{key:"_keyUp",value:function(e){var t=this.displayItems.indexOf(this.focusedItem);("editor"==this.params.verticalNavigation||"hybrid"==this.params.verticalNavigation&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t>0&&this._focusItem(this.displayItems[t-1]))}},{key:"_keyDown",value:function(e){var t=this.displayItems.indexOf(this.focusedItem);("editor"==this.params.verticalNavigation||"hybrid"==this.params.verticalNavigation&&t=38&&e.keyCode<=90&&this._scrollToValue(e.keyCode))}},{key:"_keyAutoCompLetter",value:function(e){this._filter(),this.typing=!0}},{key:"_scrollToValue",value:function(e){var t=this;clearTimeout(this.filterTimeout);var i=String.fromCharCode(e).toLowerCase();this.filterTerm+=i.toLowerCase();var n=this.displayItems.find((function(e){return void 0!==e.label&&e.label.toLowerCase().startsWith(t.filterTerm)}));n&&this._focusItem(n),this.filterTimeout=setTimeout((function(){t.filterTerm=""}),800)}},{key:"_focusItem",value:function(e){this.focusedItem&&this.focusedItem.element&&this.focusedItem.element.classList.remove("focused"),this.focusedItem=e,e&&e.element&&(e.element.classList.add("focused"),e.element.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"}))}},{key:"headerFilterInitialListGen",value:function(){this._generateOptions(!0)}},{key:"rebuildOptionsList",value:function(){this._generateOptions().then(this._sortOptions.bind(this)).then(this._buildList.bind(this)).then(this._showList.bind(this)).catch((function(e){Number.isInteger(e)||console.error("List generation error",e)}))}},{key:"_filterList",value:function(){this._buildList(this._filterOptions()),this._showList()}},{key:"_generateOptions",value:function(e){var t=this,i=[],n=++this.listIteration;return this.filtered=!1,this.params.values?i=this.params.values:this.params.valuesURL?i=this._ajaxRequest(this.params.valuesURL,this.input.value):"function"==typeof this.params.valuesLookup?i=this.params.valuesLookup(this.cell,this.input.value):this.params.valuesLookup&&(i=this._uniqueColumnValues(this.params.valuesLookupField)),i instanceof Promise?(e||this._addPlaceholder(this.params.placeholderLoading),i.then().then((function(e){return t.listIteration===n?t._parseList(e):Promise.reject(n)}))):Promise.resolve(this._parseList(i))}},{key:"_addPlaceholder",value:function(e){var t=document.createElement("div");"function"==typeof e&&(e=e(cell.getComponent(),this.listEl)),e&&(this._clearList(),e instanceof HTMLElement?t=e:(t.classList.add("tabulator-edit-list-placeholder"),t.innerHTML=e),this.listEl.appendChild(t),this._showList())}},{key:"_ajaxRequest",value:function(e,t){return e=ee(e,{},this.params.filterRemote?{term:t}:{}),fetch(e).then((function(e){return e.ok?e.json().catch((function(e){return console.warn("List Ajax Load Error - Invalid JSON returned",e),Promise.reject(e)})):(console.error("List Ajax Load Error - Connection Error: "+e.status,e.statusText),Promise.reject(e))})).catch((function(e){return console.error("List Ajax Load Error - Connection Error: ",e),Promise.reject(e)}))}},{key:"_uniqueColumnValues",value:function(e){var t,i={},n=this.table.getData(this.params.valuesLookup);return(t=e?this.table.columnManager.getColumnByField(e):this.cell.getColumn()._getSelf())?n.forEach((function(e){var n=t.getFieldValue(e);null!=n&&""!==n&&(i[n]=!0)})):(console.warn("unable to find matching column to create select lookup list:",e),i=[]),Object.keys(i)}},{key:"_parseList",value:function(t){var i=this,n=[];return Array.isArray(t)||(t=Object.entries(t).map((function(e){var t=h(e,2),i=t[0];return{label:t[1],value:i}}))),t.forEach((function(t){"object"!==e(t)&&(t={label:t,value:t}),i._parseListItem(t,n,0)})),this.data=n,n}},{key:"_parseListItem",value:function(e,t,i){var n={};e.options?n=this._parseListGroup(e,i+1):(n={label:e.label,value:e.value,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1,selected:!1,visible:!0,level:i,original:e},this.initialValues&&this.initialValues.indexOf(e.value)>-1&&this._chooseItem(n,!0)),t.push(n)}},{key:"_parseListGroup",value:function(e,t){var i=this,n={label:e.label,group:!0,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1,visible:!0,level:t,options:[],original:e};return e.options.forEach((function(e){i._parseListItem(e,n.options,t)})),n}},{key:"_sortOptions",value:function(e){var t;return this.params.sort&&(t="function"==typeof this.params.sort?this.params.sort:this._defaultSortFunction.bind(this),this._sortGroup(t,e)),e}},{key:"_sortGroup",value:function(e,t){var i=this;t.sort((function(t,i){return e(t.label,i.label,t.value,i.value,t.original,i.original)})),t.forEach((function(t){t.group&&i._sortGroup(e,t.options)}))}},{key:"_defaultSortFunction",value:function(e,t){var i,n,o,a,r,s=0,l=/(\d+)|(\D+)/g,u=/\d/,c=0;if("desc"===this.params.sort){var h=[t,e];e=h[0],t=h[1]}if(e||0===e){if(t||0===t){if(isFinite(e)&&isFinite(t))return e-t;if((i=String(e).toLowerCase())===(n=String(t).toLowerCase()))return 0;if(!u.test(i)||!u.test(n))return i>n?1:-1;for(i=i.match(l),n=n.match(l),r=i.length>n.length?n.length:i.length;sa?1:-1;return i.length>n.length}c=1}else c=t||0===t?-1:0;return c}},{key:"_filterOptions",value:function(){var e=this,t=this.params.filterFunc||this._defaultFilterFunc,i=this.input.value;return i?(this.filtered=!0,this.data.forEach((function(n){e._filterItem(t,i,n)}))):this.filtered=!1,this.data}},{key:"_filterItem",value:function(e,t,i){var n=this,o=!1;return i.group?(i.options.forEach((function(i){n._filterItem(e,t,i)&&(o=!0)})),i.visible=o):i.visible=e(t,i.label,i.value,i.original),i.visible}},{key:"_defaultFilterFunc",value:function(e,t,i,n){e=String(e).toLowerCase();return(null!==t||void 0!==t)&&(String(t).toLowerCase().indexOf(e)>-1||String(i).toLowerCase(e).indexOf()>-1)}},{key:"_clearList",value:function(){for(;this.listEl.firstChild;)this.listEl.removeChild(this.listEl.firstChild);this.displayItems=[]}},{key:"_buildList",value:function(e){var t=this;this._clearList(),e.forEach((function(e){t._buildItem(e)})),this.displayItems.length||this._addPlaceholder(this.params.placeholderEmpty)}},{key:"_buildItem",value:function(t){var i,n=this,o=t.element;if(!this.filtered||t.visible){if(!o){if((o=document.createElement("div")).tabIndex=0,(i=this.params.itemFormatter?this.params.itemFormatter(t.label,t.value,t.original,o):t.label)instanceof HTMLElement?o.appendChild(i):o.innerHTML=i,t.group?o.classList.add("tabulator-edit-list-group"):o.classList.add("tabulator-edit-list-item"),o.classList.add("tabulator-edit-list-group-level-"+t.level),t.elementAttributes&&"object"==e(t.elementAttributes))for(var a in t.elementAttributes)"+"==a.charAt(0)?(a=a.slice(1),o.setAttribute(a,this.input.getAttribute(a)+t.elementAttributes["+"+a])):o.setAttribute(a,t.elementAttributes[a]);t.group?o.addEventListener("click",this._groupClick.bind(this,t)):o.addEventListener("click",this._itemClick.bind(this,t)),o.addEventListener("mousedown",this._preventBlur.bind(this)),t.element=o}this._styleItem(t),this.listEl.appendChild(o),t.group?t.options.forEach((function(e){n._buildItem(e)})):this.displayItems.push(t)}}},{key:"_showList",value:function(){var e=this.popup&&this.popup.isVisible();if(this.input.parentNode){if(this.params.autocomplete&&""===this.input.value&&!this.params.listOnEmpty&&this.popup)return void this.popup.hide(!0);this._setListWidth(),this.popup||(this.popup=this.edit.popup(this.listEl)),this.popup.show(this.cell.getElement(),"bottom"),e||this.popup.hideOnBlur(this._resolveValue.bind(this,!0))}}},{key:"_styleItem",value:function(e){e&&e.element&&(e.selected?e.element.classList.add("active"):e.element.classList.remove("active"))}},{key:"_itemClick",value:function(e,t){t.stopPropagation(),this._chooseItem(e)}},{key:"_groupClick",value:function(e,t){t.stopPropagation()}},{key:"_cancel",value:function(){this.popup.hide(!0),this.actions.cancel()}},{key:"_clearChoices",value:function(){var e=this;this.typing=!0,this.currentItems.forEach((function(t){t.selected=!1,e._styleItem(t)})),this.currentItems=[],this.focusedItem=null}},{key:"_chooseItem",value:function(e,t){var i;this.typing=!1,this.params.multiselect?((i=this.currentItems.indexOf(e))>-1?(this.currentItems.splice(i,1),e.selected=!1):(this.currentItems.push(e),e.selected=!0),this.input.value=this.currentItems.map((function(e){return e.label})).join(","),this._styleItem(e)):(this.currentItems=[e],e.selected=!0,this.input.value=e.label,this._styleItem(e),t||this._resolveValue()),this._focusItem(e)}},{key:"_resolveValue",value:function(e){var t,i;if(this.popup.hide(!0),this.params.multiselect)t=this.currentItems.map((function(e){return e.value}));else if(e&&this.params.autocomplete&&this.typing){if(!(this.params.freetext||this.params.allowEmpty&&""===this.input.value))return void this.actions.cancel();t=this.input.value}else t=this.currentItems[0]?this.currentItems[0].value:null==(i=this.initialValues[0])||""===i?i:this.params.emptyValue;""===t&&(t=this.params.emptyValue),this.actions.success(t),this.isFilter&&(this.initialValues=t&&!Array.isArray[t]?[t]:t)}}]),i}();var me={input:function(t,i,n,o,a){var r=t.getValue(),s=document.createElement("input");if(s.setAttribute("type",a.search?"search":"text"),s.style.padding="4px",s.style.width="100%",s.style.boxSizing="border-box",a.elementAttributes&&"object"==e(a.elementAttributes))for(var l in a.elementAttributes)"+"==l.charAt(0)?(l=l.slice(1),s.setAttribute(l,s.getAttribute(l)+a.elementAttributes["+"+l])):s.setAttribute(l,a.elementAttributes[l]);function u(e){null==r&&""!==s.value||s.value!==r?n(s.value)&&(r=s.value):o()}return s.value=void 0!==r?r:"",i((function(){s.focus({preventScroll:!0}),s.style.height="100%",a.selectContents&&s.select()})),s.addEventListener("change",u),s.addEventListener("blur",u),s.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:u();break;case 27:o();break;case 35:case 36:e.stopPropagation()}})),a.mask&&he(s,a),s},textarea:function(t,i,n,o,a){var r=t.getValue(),s=a.verticalNavigation||"hybrid",l=String(null!=r?r:""),u=((l.match(/(?:\r\n|\r|\n)/g)||[]).length,document.createElement("textarea")),c=0;if(u.style.display="block",u.style.padding="2px",u.style.height="100%",u.style.width="100%",u.style.boxSizing="border-box",u.style.whiteSpace="pre-wrap",u.style.resize="none",a.elementAttributes&&"object"==e(a.elementAttributes))for(var h in a.elementAttributes)"+"==h.charAt(0)?(h=h.slice(1),u.setAttribute(h,u.getAttribute(h)+a.elementAttributes["+"+h])):u.setAttribute(h,a.elementAttributes[h]);function d(e){null==r&&""!==u.value||u.value!==r?(n(u.value)&&(r=u.value),setTimeout((function(){t.getRow().normalizeHeight()}),300)):o()}return u.value=l,i((function(){u.focus({preventScroll:!0}),u.style.height="100%",u.scrollHeight,u.style.height=u.scrollHeight+"px",t.getRow().normalizeHeight(),a.selectContents&&u.select()})),u.addEventListener("change",d),u.addEventListener("blur",d),u.addEventListener("keyup",(function(){u.style.height="";var e=u.scrollHeight;u.style.height=e+"px",e!=c&&(c=e,t.getRow().normalizeHeight())})),u.addEventListener("keydown",(function(e){switch(e.keyCode){case 27:o();break;case 38:("editor"==s||"hybrid"==s&&u.selectionStart)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 40:("editor"==s||"hybrid"==s&&u.selectionStart!==u.value.length)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 35:case 36:e.stopPropagation()}})),a.mask&&he(u,a),u},number:function(t,i,n,o,a){var r=t.getValue(),s=a.verticalNavigation||"editor",l=document.createElement("input");if(l.setAttribute("type","number"),void 0!==a.max&&l.setAttribute("max",a.max),void 0!==a.min&&l.setAttribute("min",a.min),void 0!==a.step&&l.setAttribute("step",a.step),l.style.padding="4px",l.style.width="100%",l.style.boxSizing="border-box",a.elementAttributes&&"object"==e(a.elementAttributes))for(var u in a.elementAttributes)"+"==u.charAt(0)?(u=u.slice(1),l.setAttribute(u,l.getAttribute(u)+a.elementAttributes["+"+u])):l.setAttribute(u,a.elementAttributes[u]);l.value=r;var c=function(e){h()};function h(){var e=l.value;isNaN(e)||""===e||(e=Number(e)),e!==r?n(e)&&(r=e):o()}return i((function(){l.removeEventListener("blur",c),l.focus({preventScroll:!0}),l.style.height="100%",l.addEventListener("blur",c),a.selectContents&&l.select()})),l.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:h();break;case 27:o();break;case 38:case 40:"editor"==s&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 35:case 36:e.stopPropagation()}})),a.mask&&he(l,a),l},range:function(t,i,n,o,a){var r=t.getValue(),s=document.createElement("input");if(s.setAttribute("type","range"),void 0!==a.max&&s.setAttribute("max",a.max),void 0!==a.min&&s.setAttribute("min",a.min),void 0!==a.step&&s.setAttribute("step",a.step),s.style.padding="4px",s.style.width="100%",s.style.boxSizing="border-box",a.elementAttributes&&"object"==e(a.elementAttributes))for(var l in a.elementAttributes)"+"==l.charAt(0)?(l=l.slice(1),s.setAttribute(l,s.getAttribute(l)+a.elementAttributes["+"+l])):s.setAttribute(l,a.elementAttributes[l]);function u(){var e=s.value;isNaN(e)||""===e||(e=Number(e)),e!=r?n(e)&&(r=e):o()}return s.value=r,i((function(){s.focus({preventScroll:!0}),s.style.height="100%"})),s.addEventListener("blur",(function(e){u()})),s.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:u();break;case 27:o()}})),s},select:function(e,t,i,n,o){return console.warn("The select editor has been deprecated, please use the new list editor"),new de(this,e,t,i,n,o).input},list:function(e,t,i,n,o){return new de(this,e,t,i,n,o).input},autocomplete:function(e,t,i,n,o){return console.warn("The autocomplete editor has been deprecated, please use the new list editor with the 'autocomplete' editorParam"),o.autocomplete=!0,new de(this,e,t,i,n,o).input},star:function(t,i,n,o,a){var r=this,s=t.getElement(),l=t.getValue(),u=s.getElementsByTagName("svg").length||5,c=s.getElementsByTagName("svg")[0]?s.getElementsByTagName("svg")[0].getAttribute("width"):14,h=[],d=document.createElement("div"),m=document.createElementNS("http://www.w3.org/2000/svg","svg");function p(e){h.forEach((function(t,i){i'):("ie"==r.table.browser?t.setAttribute("class","tabulator-star-inactive"):t.classList.replace("tabulator-star-active","tabulator-star-inactive"),t.innerHTML='')}))}function f(e){var t=document.createElement("span"),i=m.cloneNode(!0);h.push(i),t.addEventListener("mouseenter",(function(t){t.stopPropagation(),t.stopImmediatePropagation(),p(e)})),t.addEventListener("mousemove",(function(e){e.stopPropagation(),e.stopImmediatePropagation()})),t.addEventListener("click",(function(t){t.stopPropagation(),t.stopImmediatePropagation(),n(e),s.blur()})),t.appendChild(i),d.appendChild(t)}function g(e){l=e,p(e)}if(s.style.whiteSpace="nowrap",s.style.overflow="hidden",s.style.textOverflow="ellipsis",d.style.verticalAlign="middle",d.style.display="inline-block",d.style.padding="4px",m.setAttribute("width",c),m.setAttribute("height",c),m.setAttribute("viewBox","0 0 512 512"),m.setAttribute("xml:space","preserve"),m.style.padding="0 1px",a.elementAttributes&&"object"==e(a.elementAttributes))for(var v in a.elementAttributes)"+"==v.charAt(0)?(v=v.slice(1),d.setAttribute(v,d.getAttribute(v)+a.elementAttributes["+"+v])):d.setAttribute(v,a.elementAttributes[v]);for(var b=1;b<=u;b++)f(b);return p(l=Math.min(parseInt(l),u)),d.addEventListener("mousemove",(function(e){p(0)})),d.addEventListener("click",(function(e){n(0)})),s.addEventListener("blur",(function(e){o()})),s.addEventListener("keydown",(function(e){switch(e.keyCode){case 39:g(l+1);break;case 37:g(l-1);break;case 13:n(l);break;case 27:o()}})),d},progress:function(t,i,n,o,a){var r,s,l=t.getElement(),u=void 0===a.max?l.getElementsByTagName("div")[0]&&l.getElementsByTagName("div")[0].getAttribute("max")||100:a.max,c=void 0===a.min?l.getElementsByTagName("div")[0]&&l.getElementsByTagName("div")[0].getAttribute("min")||0:a.min,h=(u-c)/100,d=t.getValue()||0,m=document.createElement("div"),p=document.createElement("div");function f(){var e=window.getComputedStyle(l,null),t=h*Math.round(p.offsetWidth/((l.clientWidth-parseInt(e.getPropertyValue("padding-left"))-parseInt(e.getPropertyValue("padding-right")))/100))+c;n(t),l.setAttribute("aria-valuenow",t),l.setAttribute("aria-label",d)}if(m.style.position="absolute",m.style.right="0",m.style.top="0",m.style.bottom="0",m.style.width="5px",m.classList.add("tabulator-progress-handle"),p.style.display="inline-block",p.style.position="relative",p.style.height="100%",p.style.backgroundColor="#488CE9",p.style.maxWidth="100%",p.style.minWidth="0%",a.elementAttributes&&"object"==e(a.elementAttributes))for(var g in a.elementAttributes)"+"==g.charAt(0)?(g=g.slice(1),p.setAttribute(g,p.getAttribute(g)+a.elementAttributes["+"+g])):p.setAttribute(g,a.elementAttributes[g]);return l.style.padding="4px 4px",d=Math.min(parseFloat(d),u),d=Math.max(parseFloat(d),c),d=Math.round((d-c)/h),p.style.width=d+"%",l.setAttribute("aria-valuemin",c),l.setAttribute("aria-valuemax",u),p.appendChild(m),m.addEventListener("mousedown",(function(e){r=e.screenX,s=p.offsetWidth})),m.addEventListener("mouseover",(function(){m.style.cursor="ew-resize"})),l.addEventListener("mousemove",(function(e){r&&(p.style.width=s+e.screenX-r+"px")})),l.addEventListener("mouseup",(function(e){r&&(e.stopPropagation(),e.stopImmediatePropagation(),r=!1,s=!1,f())})),l.addEventListener("keydown",(function(e){switch(e.keyCode){case 39:e.preventDefault(),p.style.width=p.clientWidth+l.clientWidth/100+"px";break;case 37:e.preventDefault(),p.style.width=p.clientWidth-l.clientWidth/100+"px";break;case 9:case 13:f();break;case 27:o()}})),l.addEventListener("blur",(function(){o()})),p},tickCross:function(t,i,n,o,a){var r=t.getValue(),s=document.createElement("input"),l=a.tristate,u=void 0===a.indeterminateValue?null:a.indeterminateValue,c=!1,h=Object.keys(a).includes("trueValue"),d=Object.keys(a).includes("falseValue");if(s.setAttribute("type","checkbox"),s.style.marginTop="5px",s.style.boxSizing="border-box",a.elementAttributes&&"object"==e(a.elementAttributes))for(var m in a.elementAttributes)"+"==m.charAt(0)?(m=m.slice(1),s.setAttribute(m,s.getAttribute(m)+a.elementAttributes["+"+m])):s.setAttribute(m,a.elementAttributes[m]);function p(e){var t=s.checked;return t=h&&t?a.trueValue:d&&!t?a.falseValue:t,l?e?c?u:t:s.checked&&!c?(s.checked=!1,s.indeterminate=!0,c=!0,u):(c=!1,t):t}return s.value=r,!l||void 0!==r&&r!==u&&""!==r||(c=!0,s.indeterminate=!0),"firefox"!=this.table.browser&&i((function(){s.focus({preventScroll:!0})})),s.checked=h?r===a.trueValue:!0===r||"true"===r||"True"===r||1===r,i((function(){s.focus()})),s.addEventListener("change",(function(e){n(p())})),s.addEventListener("blur",(function(e){n(p(!0))})),s.addEventListener("keydown",(function(e){13==e.keyCode&&n(p()),27==e.keyCode&&o()})),s}},pe=function(i){a(r,i);var n=c(r);function r(e){var i;return t(this,r),(i=n.call(this,e)).currentCell=!1,i.mouseClick=!1,i.recursionBlock=!1,i.invalidEdit=!1,i.editedCells=[],i.editors=r.editors,i.registerColumnOption("editable"),i.registerColumnOption("editor"),i.registerColumnOption("editorParams"),i.registerColumnOption("cellEditing"),i.registerColumnOption("cellEdited"),i.registerColumnOption("cellEditCancelled"),i.registerTableFunction("getEditedCells",i.getEditedCells.bind(l(i))),i.registerTableFunction("clearCellEdited",i.clearCellEdited.bind(l(i))),i.registerTableFunction("navigatePrev",i.navigatePrev.bind(l(i))),i.registerTableFunction("navigateNext",i.navigateNext.bind(l(i))),i.registerTableFunction("navigateLeft",i.navigateLeft.bind(l(i))),i.registerTableFunction("navigateRight",i.navigateRight.bind(l(i))),i.registerTableFunction("navigateUp",i.navigateUp.bind(l(i))),i.registerTableFunction("navigateDown",i.navigateDown.bind(l(i))),i.registerComponentFunction("cell","isEdited",i.cellisEdited.bind(l(i))),i.registerComponentFunction("cell","clearEdited",i.clearEdited.bind(l(i))),i.registerComponentFunction("cell","edit",i.editCell.bind(l(i))),i.registerComponentFunction("cell","cancelEdit",i.cellCancelEdit.bind(l(i))),i.registerComponentFunction("cell","navigatePrev",i.navigatePrev.bind(l(i))),i.registerComponentFunction("cell","navigateNext",i.navigateNext.bind(l(i))),i.registerComponentFunction("cell","navigateLeft",i.navigateLeft.bind(l(i))),i.registerComponentFunction("cell","navigateRight",i.navigateRight.bind(l(i))),i.registerComponentFunction("cell","navigateUp",i.navigateUp.bind(l(i))),i.registerComponentFunction("cell","navigateDown",i.navigateDown.bind(l(i))),i}return o(r,[{key:"initialize",value:function(){this.subscribe("cell-init",this.bindEditor.bind(this)),this.subscribe("cell-delete",this.clearEdited.bind(this)),this.subscribe("column-layout",this.initializeColumnCheck.bind(this)),this.subscribe("column-delete",this.columnDeleteCheck.bind(this)),this.subscribe("row-deleting",this.rowDeleteCheck.bind(this)),this.subscribe("data-refreshing",this.cancelEdit.bind(this)),this.subscribe("keybinding-nav-prev",this.navigatePrev.bind(this,void 0)),this.subscribe("keybinding-nav-next",this.keybindingNavigateNext.bind(this)),this.subscribe("keybinding-nav-left",this.navigateLeft.bind(this,void 0)),this.subscribe("keybinding-nav-right",this.navigateRight.bind(this,void 0)),this.subscribe("keybinding-nav-up",this.navigateUp.bind(this,void 0)),this.subscribe("keybinding-nav-down",this.navigateDown.bind(this,void 0))}},{key:"keybindingNavigateNext",value:function(e){var t=this.currentCell,i=this.options("tabEndNewRow");t&&(this.navigateNext(t,e)||i&&(t.getElement().firstChild.blur(),(i=!0===i?this.table.addRow({}):"function"==typeof i?this.table.addRow(i(t.row.getComponent())):this.table.addRow(Object.assign({},i))).then((function(){setTimeout((function(){t.getComponent().navigateNext()}))}))))}},{key:"cellisEdited",value:function(e){return!!e.modules.edit&&e.modules.edit.edited}},{key:"cellCancelEdit",value:function(e){e===this.currentCell?this.table.modules.edit.cancelEdit():console.warn("Cancel Editor Error - This cell is not currently being edited ")}},{key:"clearCellEdited",value:function(e){var t=this;e||(e=this.table.modules.edit.getEditedCells()),Array.isArray(e)||(e=[e]),e.forEach((function(e){t.table.modules.edit.clearEdited(e._getSelf())}))}},{key:"navigatePrev",value:function(){var e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentCell,n=arguments.length>1?arguments[1]:void 0;if(i){if(n&&n.preventDefault(),e=this.navigateLeft())return!0;if((t=this.table.rowManager.prevDisplayRow(i.row,!0))&&(e=this.findNextEditableCell(t,t.cells.length)))return e.getComponent().edit(),!0}return!1}},{key:"navigateNext",value:function(){var e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentCell,n=arguments.length>1?arguments[1]:void 0;if(i){if(n&&n.preventDefault(),e=this.navigateRight())return!0;if((t=this.table.rowManager.nextDisplayRow(i.row,!0))&&(e=this.findNextEditableCell(t,-1)))return e.getComponent().edit(),!0}return!1}},{key:"navigateLeft",value:function(){var e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentCell,n=arguments.length>1?arguments[1]:void 0;return!!(i&&(n&&n.preventDefault(),e=i.getIndex(),t=this.findPrevEditableCell(i.row,e)))&&(t.getComponent().edit(),!0)}},{key:"navigateRight",value:function(){var e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentCell,n=arguments.length>1?arguments[1]:void 0;return!!(i&&(n&&n.preventDefault(),e=i.getIndex(),t=this.findNextEditableCell(i.row,e)))&&(t.getComponent().edit(),!0)}},{key:"navigateUp",value:function(){var e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentCell,n=arguments.length>1?arguments[1]:void 0;return!!(i&&(n&&n.preventDefault(),e=i.getIndex(),t=this.table.rowManager.prevDisplayRow(i.row,!0)))&&(t.cells[e].getComponent().edit(),!0)}},{key:"navigateDown",value:function(){var e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentCell,n=arguments.length>1?arguments[1]:void 0;return!!(i&&(n&&n.preventDefault(),e=i.getIndex(),t=this.table.rowManager.nextDisplayRow(i.row,!0)))&&(t.cells[e].getComponent().edit(),!0)}},{key:"findNextEditableCell",value:function(e,t){var i=!1;if(t0)for(var n=t-1;n>=0;n--){var o=e.cells[n],a=!0;if(o.column.modules.edit&&k.elVisible(o.getElement())&&("function"==typeof o.column.modules.edit.check&&(a=o.column.modules.edit.check(o.getComponent())),a)){i=o;break}}return i}},{key:"initializeColumnCheck",value:function(e){void 0!==e.definition.editor&&this.initializeColumn(e)}},{key:"columnDeleteCheck",value:function(e){this.currentCell&&this.currentCell.column===e&&this.cancelEdit()}},{key:"rowDeleteCheck",value:function(e){this.currentCell&&this.currentCell.row===e&&this.cancelEdit()}},{key:"initializeColumn",value:function(t){var i={editor:!1,blocked:!1,check:t.definition.editable,params:t.definition.editorParams||{}};switch(e(t.definition.editor)){case"string":this.editors[t.definition.editor]?i.editor=this.editors[t.definition.editor]:console.warn("Editor Error - No such editor found: ",t.definition.editor);break;case"function":i.editor=t.definition.editor;break;case"boolean":!0===t.definition.editor&&("function"!=typeof t.definition.formatter?this.editors[t.definition.formatter]?i.editor=this.editors[t.definition.formatter]:i.editor=this.editors.input:console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",t.definition.formatter))}i.editor&&(t.modules.edit=i)}},{key:"getCurrentCell",value:function(){return!!this.currentCell&&this.currentCell.getComponent()}},{key:"clearEditor",value:function(e){var t,i=this.currentCell;if(this.invalidEdit=!1,i){for(this.currentCell=!1,t=i.getElement(),this.dispatch("edit-editor-clear",i,e),t.classList.remove("tabulator-editing");t.firstChild;)t.removeChild(t.firstChild);i.row.getElement().classList.remove("tabulator-row-editing")}}},{key:"cancelEdit",value:function(){if(this.currentCell){var e=this.currentCell,t=this.currentCell.getComponent();this.clearEditor(!0),e.setValueActual(e.getValue()),e.cellRendered(),("textarea"==e.column.definition.editor||e.column.definition.variableHeight)&&e.row.normalizeHeight(!0),e.column.definition.cellEditCancelled&&e.column.definition.cellEditCancelled.call(this.table,t),this.dispatch("edit-cancelled",e),this.dispatchExternal("cellEditCancelled",t)}}},{key:"bindEditor",value:function(e){if(e.column.modules.edit){var t=this,i=e.getElement(!0);i.setAttribute("tabindex",0),i.addEventListener("click",(function(e){i.classList.contains("tabulator-editing")||i.focus({preventScroll:!0})})),i.addEventListener("mousedown",(function(e){2===e.button?e.preventDefault():t.mouseClick=!0})),i.addEventListener("focus",(function(i){t.recursionBlock||t.edit(e,i,!1)}))}}},{key:"focusCellNoEvent",value:function(e,t){this.recursionBlock=!0,t&&"ie"===this.table.browser||e.getElement().focus({preventScroll:!0}),this.recursionBlock=!1}},{key:"editCell",value:function(e,t){this.focusCellNoEvent(e),this.edit(e,!1,t)}},{key:"focusScrollAdjust",value:function(e){if("virtual"==this.table.rowManager.getRenderMode()){var t=this.table.rowManager.element.scrollTop,i=this.table.rowManager.element.clientHeight+this.table.rowManager.element.scrollTop,n=e.row.getElement();n.offsetTop;n.offsetTopi&&(this.table.rowManager.element.scrollTop+=n.offsetTop+n.offsetHeight-i);var o=this.table.rowManager.element.scrollLeft,a=this.table.rowManager.element.clientWidth+this.table.rowManager.element.scrollLeft,r=e.getElement();r.offsetLeft;this.table.modExists("frozenColumns")&&(o+=parseInt(this.table.modules.frozenColumns.leftMargin),a-=parseInt(this.table.modules.frozenColumns.rightMargin)),"virtual"===this.table.options.renderHorizontal&&(o-=parseInt(this.table.columnManager.renderer.vDomPadLeft),a-=parseInt(this.table.columnManager.renderer.vDomPadLeft)),r.offsetLefta&&(this.table.rowManager.element.scrollLeft+=r.offsetLeft+r.offsetWidth-a)}}},{key:"edit",value:function(t,i,n){var o,a,r,s=this,l=!0,u=function(){},c=t.getElement();if(!this.currentCell){if(t.column.modules.edit.blocked)return this.mouseClick=!1,c.blur(),!1;switch(i&&i.stopPropagation(),e(t.column.modules.edit.check)){case"function":l=t.column.modules.edit.check(t.getComponent());break;case"boolean":l=t.column.modules.edit.check}if(l||n){if(s.cancelEdit(),s.currentCell=t,this.focusScrollAdjust(t),a=t.getComponent(),this.mouseClick&&(this.mouseClick=!1,t.column.definition.cellClick&&t.column.definition.cellClick.call(this.table,i,a)),t.column.definition.cellEditing&&t.column.definition.cellEditing.call(this.table,a),this.dispatch("cell-editing",t),this.dispatchExternal("cellEditing",a),r="function"==typeof t.column.modules.edit.params?t.column.modules.edit.params(a):t.column.modules.edit.params,!1===(o=t.column.modules.edit.editor.call(s,a,(function(e){u=e}),(function(e){if(s.currentCell===t){var i=s.chain("edit-success",[t,e],!0,!0);return!0===i||"highlight"===s.table.options.validationMode?(s.clearEditor(),t.modules.edit||(t.modules.edit={}),t.modules.edit.edited=!0,-1==s.editedCells.indexOf(t)&&s.editedCells.push(t),t.setValue(e,!0),!0===i):(s.invalidEdit=!0,s.focusCellNoEvent(t,!0),u(),!1)}}),(function(){s.currentCell===t&&s.cancelEdit()}),r)))return c.blur(),!1;if(!(o instanceof Node))return console.warn("Edit Error - Editor should return an instance of Node, the editor returned:",o),c.blur(),!1;for(c.classList.add("tabulator-editing"),t.row.getElement().classList.add("tabulator-row-editing");c.firstChild;)c.removeChild(c.firstChild);c.appendChild(o),u();for(var h=c.children,d=0;d-1&&this.editedCells.splice(t,1)}}]),r}(V);pe.moduleName="edit",pe.editors=me;var fe=function e(i,n,o,a){t(this,e),this.type=i,this.columns=n,this.component=o||!1,this.indent=a||0},ge=function e(i,n,o,a,r){t(this,e),this.value=i,this.component=n||!1,this.width=o,this.height=a,this.depth=r},ve=function(n){a(s,n);var r=c(s);function s(e){var i;return t(this,s),(i=r.call(this,e)).config={},i.cloneTableStyle=!0,i.colVisProp="",i.registerTableOption("htmlOutputConfig",!1),i.registerColumnOption("htmlOutput"),i.registerColumnOption("titleHtmlOutput"),i}return o(s,[{key:"initialize",value:function(){this.registerTableFunction("getHtml",this.getHtml.bind(this))}},{key:"generateExportList",value:function(e,t,i,n){this.cloneTableStyle=t,this.config=e||{},this.colVisProp=n;var o=!1!==this.config.columnHeaders?this.headersToExportRows(this.generateColumnGroupHeaders()):[],a=this.bodyToExportRows(this.rowLookup(i));return o.concat(a)}},{key:"genereateTable",value:function(e,t,i,n){var o=this.generateExportList(e,t,i,n);return this.genereateTableElement(o)}},{key:"rowLookup",value:function(e){var t=this,i=[];if("function"==typeof e)e.call(this.table).forEach((function(e){(e=t.table.rowManager.findRow(e))&&i.push(e)}));else switch(e){case!0:case"visible":i=this.table.rowManager.getVisibleRows(!1,!0);break;case"all":i=this.table.rowManager.rows;break;case"selected":i=this.table.modules.selectRow.selectedRows;break;case"active":default:i=this.table.options.pagination?this.table.rowManager.getDisplayRows(this.table.rowManager.displayRows.length-2):this.table.rowManager.getDisplayRows()}return Object.assign([],i)}},{key:"generateColumnGroupHeaders",value:function(){var e=this,t=[];return(!1!==this.config.columnGroups?this.table.columnManager.columns:this.table.columnManager.columnsByIndex).forEach((function(i){var n=e.processColumnGroup(i);n&&t.push(n)})),t}},{key:"processColumnGroup",value:function(e){var t=this,i=e.columns,n=0,o={title:e.definition["title"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))]||e.definition.title,column:e,depth:1};if(i.length){if(o.subGroups=[],o.width=0,i.forEach((function(e){var i=t.processColumnGroup(e);i&&(o.width+=i.width,o.subGroups.push(i),i.depth>n&&(n=i.depth))})),o.depth+=n,!o.width)return!1}else{if(!this.columnVisCheck(e))return!1;o.width=1}return o}},{key:"columnVisCheck",value:function(e){return!1!==e.definition[this.colVisProp]&&(e.visible||!e.visible&&e.definition[this.colVisProp])}},{key:"headersToExportRows",value:function(e){var t=[],i=0,n=[];function o(e,n){var a=i-n;if(void 0===t[n]&&(t[n]=[]),e.height=e.subGroups?1:a-e.depth+1,t[n].push(e),e.height>1)for(var r=1;r1)for(var s=1;si&&(i=e.depth)})),e.forEach((function(e){o(e,0)})),t.forEach((function(e){var t=[];e.forEach((function(e){if(e){var i=void 0===e.title?"":e.title;t.push(new ge(i,e.column.getComponent(),e.width,e.height,e.depth))}else t.push(null)})),n.push(new fe("header",t))})),n}},{key:"bodyToExportRows",value:function(e){var t=this,i=[],n=[];return this.table.columnManager.columnsByIndex.forEach((function(e){t.columnVisCheck(e)&&i.push(e.getComponent())})),!1!==this.config.columnCalcs&&this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&e.unshift(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&e.push(this.table.modules.columnCalcs.botRow)),(e=e.filter((function(e){switch(e.type){case"group":return!1!==t.config.rowGroups;case"calc":return!1!==t.config.columnCalcs;case"row":return!(t.table.options.dataTree&&!1===t.config.dataTree&&e.modules.dataTree.parent)}return!0}))).forEach((function(e,o){var a=e.getData(t.colVisProp),r=[],s=0;switch(e.type){case"group":s=e.level,r.push(new ge(e.key,e.getComponent(),i.length,1));break;case"calc":case"row":i.forEach((function(e){r.push(new ge(e._column.getFieldValue(a),e,1,1))})),t.table.options.dataTree&&!1!==t.config.dataTree&&(s=e.modules.dataTree.index)}n.push(new fe(e.type,r,e.getComponent(),s))})),n}},{key:"genereateTableElement",value:function(e){var t=this,i=document.createElement("table"),n=document.createElement("thead"),o=document.createElement("tbody"),a=this.lookupTableStyles(),r=this.table.options["rowFormatter"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],s={};return s.rowFormatter=null!==r?r:this.table.options.rowFormatter,this.table.options.dataTree&&!1!==this.config.dataTree&&this.table.modExists("columnCalcs")&&(s.treeElementField=this.table.modules.dataTree.elementField),s.groupHeader=this.table.options["groupHeader"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],s.groupHeader&&!Array.isArray(s.groupHeader)&&(s.groupHeader=[s.groupHeader]),i.classList.add("tabulator-print-table"),this.mapElementStyles(this.table.columnManager.getHeadersElement(),n,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),e.length>1e3&&console.warn("It may take a long time to render an HTML table with more than 1000 rows"),e.forEach((function(e,i){switch(e.type){case"header":n.appendChild(t.genereateHeaderElement(e,s,a));break;case"group":o.appendChild(t.genereateGroupElement(e,s,a));break;case"calc":o.appendChild(t.genereateCalcElement(e,s,a));break;case"row":var r=t.genereateRowElement(e,s,a);t.mapElementStyles(i%2&&a.evenRow?a.evenRow:a.oddRow,r,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),o.appendChild(r)}})),n.innerHTML&&i.appendChild(n),i.appendChild(o),this.mapElementStyles(this.table.element,i,["border-top","border-left","border-right","border-bottom"]),i}},{key:"lookupTableStyles",value:function(){var e={};return this.cloneTableStyle&&window.getComputedStyle&&(e.oddRow=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"),e.evenRow=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),e.calcRow=this.table.element.querySelector(".tabulator-row.tabulator-calcs"),e.firstRow=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),e.firstGroup=this.table.element.getElementsByClassName("tabulator-group")[0],e.firstRow&&(e.styleCells=e.firstRow.getElementsByClassName("tabulator-cell"),e.firstCell=e.styleCells[0],e.lastCell=e.styleCells[e.styleCells.length-1])),e}},{key:"genereateHeaderElement",value:function(e,t,i){var n=this,o=document.createElement("tr");return e.columns.forEach((function(e){if(e){var t=document.createElement("th"),i=e.component._column.definition.cssClass?e.component._column.definition.cssClass.split(" "):[];t.colSpan=e.width,t.rowSpan=e.height,t.innerHTML=e.value,n.cloneTableStyle&&(t.style.boxSizing="border-box"),i.forEach((function(e){t.classList.add(e)})),n.mapElementStyles(e.component.getElement(),t,["text-align","border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),n.mapElementStyles(e.component._column.contentElement,t,["padding-top","padding-left","padding-right","padding-bottom"]),e.component._column.visible?n.mapElementStyles(e.component.getElement(),t,["width"]):e.component._column.definition.width&&(t.style.width=e.component._column.definition.width+"px"),e.component._column.parent&&n.mapElementStyles(e.component._column.parent.groupElement,t,["border-top"]),o.appendChild(t)}})),o}},{key:"genereateGroupElement",value:function(e,t,i){var n=document.createElement("tr"),o=document.createElement("td"),a=e.columns[0];return n.classList.add("tabulator-print-table-row"),t.groupHeader&&t.groupHeader[e.indent]?a.value=t.groupHeader[e.indent](a.value,e.component._group.getRowCount(),e.component._group.getData(),e.component):!1===t.groupHeader?a.value=a.value:a.value=e.component._group.generator(a.value,e.component._group.getRowCount(),e.component._group.getData(),e.component),o.colSpan=a.width,o.innerHTML=a.value,n.classList.add("tabulator-print-table-group"),n.classList.add("tabulator-group-level-"+e.indent),a.component.isVisible()&&n.classList.add("tabulator-group-visible"),this.mapElementStyles(i.firstGroup,n,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),this.mapElementStyles(i.firstGroup,o,["padding-top","padding-left","padding-right","padding-bottom"]),n.appendChild(o),n}},{key:"genereateCalcElement",value:function(e,t,i){var n=this.genereateRowElement(e,t,i);return n.classList.add("tabulator-print-table-calcs"),this.mapElementStyles(i.calcRow,n,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),n}},{key:"genereateRowElement",value:function(t,n,o){var a=this,r=document.createElement("tr");return r.classList.add("tabulator-print-table-row"),t.columns.forEach((function(s){if(s){var l=document.createElement("td"),u=s.component._column,c=a.table.columnManager.findColumnIndex(u),h=s.value,d={modules:{},getValue:function(){return h},getField:function(){return u.definition.field},getElement:function(){return l},getColumn:function(){return u.getComponent()},getData:function(){return t.component.getData()},getRow:function(){return t.component},getComponent:function(){return d},column:u};if((u.definition.cssClass?u.definition.cssClass.split(" "):[]).forEach((function(e){l.classList.add(e)})),a.table.modExists("format")&&!1!==a.config.formatCells)h=a.table.modules.format.formatExportValue(d,a.colVisProp);else switch(e(h)){case"object":h=JSON.stringify(h);break;case"undefined":case"null":h="";break;default:h=h}h instanceof Node?l.appendChild(h):l.innerHTML=h,(o.styleCells[c]||o.firstCell)&&(a.mapElementStyles(o.styleCells[c]||o.firstCell,l,["padding-top","padding-left","padding-right","padding-bottom","border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","text-align"]),u.definition.align&&(l.style.textAlign=u.definition.align)),a.table.options.dataTree&&!1!==a.config.dataTree&&(n.treeElementField&&n.treeElementField==u.field||!n.treeElementField&&0==i)&&(t.component._row.modules.dataTree.controlEl&&l.insertBefore(t.component._row.modules.dataTree.controlEl.cloneNode(!0),l.firstChild),t.component._row.modules.dataTree.branchEl&&l.insertBefore(t.component._row.modules.dataTree.branchEl.cloneNode(!0),l.firstChild)),r.appendChild(l),d.modules.format&&d.modules.format.renderedCallback&&d.modules.format.renderedCallback(),n.rowFormatter&&!1!==a.config.formatCells&&n.rowFormatter(t.component)}})),r}},{key:"genereateHTMLTable",value:function(e){var t=document.createElement("div");return t.appendChild(this.genereateTableElement(e)),t.innerHTML}},{key:"getHtml",value:function(e,t,i,n){var o=this.generateExportList(i||this.table.options.htmlOutputConfig,t,e,n||"htmlOutput");return this.genereateHTMLTable(o)}},{key:"mapElementStyles",value:function(e,t,i){if(this.cloneTableStyle&&e&&t){var n={"background-color":"backgroundColor",color:"fontColor",width:"width","font-weight":"fontWeight","font-family":"fontFamily","font-size":"fontSize","text-align":"textAlign","border-top":"borderTop","border-left":"borderLeft","border-right":"borderRight","border-bottom":"borderBottom","padding-top":"paddingTop","padding-left":"paddingLeft","padding-right":"paddingRight","padding-bottom":"paddingBottom"};if(window.getComputedStyle){var o=window.getComputedStyle(e);i.forEach((function(e){t.style[n[e]]=o.getPropertyValue(e)}))}}}}]),s}(V);ve.moduleName="export";var be={"=":function(e,t,i,n){return t==e},"<":function(e,t,i,n){return t":function(e,t,i,n){return t>e},">=":function(e,t,i,n){return t>=e},"!=":function(e,t,i,n){return t!=e},regex:function(e,t,i,n){return"string"==typeof e&&(e=new RegExp(e)),e.test(t)},like:function(e,t,i,n){return null==e?t===e:null!=t&&String(t).toLowerCase().indexOf(e.toLowerCase())>-1},keywords:function(e,t,i,n){var o=e.toLowerCase().split(void 0===n.separator?" ":n.separator),a=String(null==t?"":t).toLowerCase(),r=[];return o.forEach((function(e){a.includes(e)&&r.push(!0)})),n.matchAll?r.length===o.length:!!r.length},starts:function(e,t,i,n){return null==e?t===e:null!=t&&String(t).toLowerCase().startsWith(e.toLowerCase())},ends:function(e,t,i,n){return null==e?t===e:null!=t&&String(t).toLowerCase().endsWith(e.toLowerCase())},in:function(e,t,i,n){return Array.isArray(e)?!e.length||e.indexOf(t)>-1:(console.warn("Filter Error - filter value is not an array:",e),!1)}},ye=function(i){a(r,i);var n=c(r);function r(e){var i;return t(this,r),(i=n.call(this,e)).filterList=[],i.headerFilters={},i.headerFilterColumns=[],i.prevHeaderFilterChangeCheck="",i.prevHeaderFilterChangeCheck="{}",i.changed=!1,i.tableInitialized=!1,i.registerTableOption("filterMode","local"),i.registerTableOption("initialFilter",!1),i.registerTableOption("initialHeaderFilter",!1),i.registerTableOption("headerFilterLiveFilterDelay",300),i.registerColumnOption("headerFilter"),i.registerColumnOption("headerFilterPlaceholder"),i.registerColumnOption("headerFilterParams"),i.registerColumnOption("headerFilterEmptyCheck"),i.registerColumnOption("headerFilterFunc"),i.registerColumnOption("headerFilterFuncParams"),i.registerColumnOption("headerFilterLiveFilter"),i.registerTableFunction("searchRows",i.searchRows.bind(l(i))),i.registerTableFunction("searchData",i.searchData.bind(l(i))),i.registerTableFunction("setFilter",i.userSetFilter.bind(l(i))),i.registerTableFunction("refreshFilter",i.userRefreshFilter.bind(l(i))),i.registerTableFunction("addFilter",i.userAddFilter.bind(l(i))),i.registerTableFunction("getFilters",i.getFilters.bind(l(i))),i.registerTableFunction("setHeaderFilterFocus",i.userSetHeaderFilterFocus.bind(l(i))),i.registerTableFunction("getHeaderFilterValue",i.userGetHeaderFilterValue.bind(l(i))),i.registerTableFunction("setHeaderFilterValue",i.userSetHeaderFilterValue.bind(l(i))),i.registerTableFunction("getHeaderFilters",i.getHeaderFilters.bind(l(i))),i.registerTableFunction("removeFilter",i.userRemoveFilter.bind(l(i))),i.registerTableFunction("clearFilter",i.userClearFilter.bind(l(i))),i.registerTableFunction("clearHeaderFilter",i.userClearHeaderFilter.bind(l(i))),i.registerComponentFunction("column","headerFilterFocus",i.setHeaderFilterFocus.bind(l(i))),i.registerComponentFunction("column","reloadHeaderFilter",i.reloadHeaderFilter.bind(l(i))),i.registerComponentFunction("column","getHeaderFilterValue",i.getHeaderFilterValue.bind(l(i))),i.registerComponentFunction("column","setHeaderFilterValue",i.setHeaderFilterValue.bind(l(i))),i}return o(r,[{key:"initialize",value:function(){this.subscribe("column-init",this.initializeColumnHeaderFilter.bind(this)),this.subscribe("column-width-fit-before",this.hideHeaderFilterElements.bind(this)),this.subscribe("column-width-fit-after",this.showHeaderFilterElements.bind(this)),this.subscribe("table-built",this.tableBuilt.bind(this)),"remote"===this.table.options.filterMode&&this.subscribe("data-params",this.remoteFilterParams.bind(this)),this.registerDataHandler(this.filter.bind(this),10)}},{key:"tableBuilt",value:function(){var e=this;this.table.options.initialFilter&&this.setFilter(this.table.options.initialFilter),this.table.options.initialHeaderFilter&&this.table.options.initialHeaderFilter.forEach((function(t){var i=e.table.columnManager.findColumn(t.field);if(!i)return console.warn("Column Filter Error - No matching column found:",t.field),!1;e.setHeaderFilterValue(i,t.value)})),this.tableInitialized=!0}},{key:"remoteFilterParams",value:function(e,t,i,n){return n.filter=this.getFilters(!0,!0),n}},{key:"userSetFilter",value:function(e,t,i,n){this.setFilter(e,t,i,n),this.refreshFilter()}},{key:"userRefreshFilter",value:function(){this.refreshFilter()}},{key:"userAddFilter",value:function(e,t,i,n){this.addFilter(e,t,i,n),this.refreshFilter()}},{key:"userSetHeaderFilterFocus",value:function(e){var t=this.table.columnManager.findColumn(e);if(!t)return console.warn("Column Filter Focus Error - No matching column found:",e),!1;this.setHeaderFilterFocus(t)}},{key:"userGetHeaderFilterValue",value:function(e){var t=this.table.columnManager.findColumn(e);if(t)return this.getHeaderFilterValue(t);console.warn("Column Filter Error - No matching column found:",e)}},{key:"userSetHeaderFilterValue",value:function(e,t){var i=this.table.columnManager.findColumn(e);if(!i)return console.warn("Column Filter Error - No matching column found:",e),!1;this.setHeaderFilterValue(i,t)}},{key:"userRemoveFilter",value:function(e,t,i){this.removeFilter(e,t,i),this.refreshFilter()}},{key:"userClearFilter",value:function(e){this.clearFilter(e),this.refreshFilter()}},{key:"userClearHeaderFilter",value:function(){this.clearHeaderFilter(),this.refreshFilter()}},{key:"searchRows",value:function(e,t,i){return this.search("rows",e,t,i)}},{key:"searchData",value:function(e,t,i){return this.search("data",e,t,i)}},{key:"initializeColumnHeaderFilter",value:function(e){var t=e.definition;t.headerFilter&&(void 0!==t.headerFilterPlaceholder&&t.field&&this.module("localize").setHeaderFilterColumnPlaceholder(t.field,t.headerFilterPlaceholder),this.initializeColumn(e))}},{key:"initializeColumn",value:function(t,i){var n=this,o=t.getField();t.modules.filter={success:function(i){var a,s="input"==t.modules.filter.tagType&&"text"==t.modules.filter.attrType||"textarea"==t.modules.filter.tagType?"partial":"match",l="",u="";if(void 0===t.modules.filter.prevSuccess||t.modules.filter.prevSuccess!==i){if(t.modules.filter.prevSuccess=i,t.modules.filter.emptyFunc(i))delete n.headerFilters[o];else{switch(t.modules.filter.value=i,e(t.definition.headerFilterFunc)){case"string":r.filters[t.definition.headerFilterFunc]?(l=t.definition.headerFilterFunc,a=function(e){var n=t.definition.headerFilterFuncParams||{},o=t.getFieldValue(e);return n="function"==typeof n?n(i,o,e):n,r.filters[t.definition.headerFilterFunc](i,o,e,n)}):console.warn("Header Filter Error - Matching filter function not found: ",t.definition.headerFilterFunc);break;case"function":l=a=function(e){var n=t.definition.headerFilterFuncParams||{},o=t.getFieldValue(e);return n="function"==typeof n?n(i,o,e):n,t.definition.headerFilterFunc(i,o,e,n)}}if(!a)switch(s){case"partial":a=function(e){var n=t.getFieldValue(e);return null!=n&&String(n).toLowerCase().indexOf(String(i).toLowerCase())>-1},l="like";break;default:a=function(e){return t.getFieldValue(e)==i},l="="}n.headerFilters[o]={value:i,func:a,type:l,params:{}}}t.modules.filter.value=i,u=JSON.stringify(n.headerFilters),n.prevHeaderFilterChangeCheck!==u&&(n.prevHeaderFilterChangeCheck=u,n.trackChanges(),n.refreshFilter())}return!0},attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(t)}},{key:"generateHeaderFilterElement",value:function(t,i,n){var o,a,r,s,l,u,c,h=this,d=this,m=t.modules.filter.success,p=t.getField();if(t.modules.filter.value=i,t.modules.filter.headerElement&&t.modules.filter.headerElement.parentNode&&t.contentElement.removeChild(t.modules.filter.headerElement.parentNode),p){switch(t.modules.filter.emptyFunc=t.definition.headerFilterEmptyCheck||function(e){return!e&&"0"!==e&&0!==e},(o=document.createElement("div")).classList.add("tabulator-header-filter"),e(t.definition.headerFilter)){case"string":d.table.modules.edit.editors[t.definition.headerFilter]?(a=d.table.modules.edit.editors[t.definition.headerFilter],"tick"!==t.definition.headerFilter&&"tickCross"!==t.definition.headerFilter||t.definition.headerFilterEmptyCheck||(t.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):console.warn("Filter Error - Cannot build header filter, No such editor found: ",t.definition.editor);break;case"function":a=t.definition.headerFilter;break;case"boolean":t.modules.edit&&t.modules.edit.editor?a=t.modules.edit.editor:t.definition.formatter&&d.table.modules.edit.editors[t.definition.formatter]?(a=d.table.modules.edit.editors[t.definition.formatter],"tick"!==t.definition.formatter&&"tickCross"!==t.definition.formatter||t.definition.headerFilterEmptyCheck||(t.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):a=d.table.modules.edit.editors.input}if(a){if(s={getValue:function(){return void 0!==i?i:""},getField:function(){return t.definition.field},getElement:function(){return o},getColumn:function(){return t.getComponent()},getRow:function(){return{normalizeHeight:function(){}}}},c="function"==typeof(c=t.definition.headerFilterParams||{})?c.call(d.table,s):c,!(r=a.call(this.table.modules.edit,s,(function(){}),m,(function(){}),c)))return void console.warn("Filter Error - Cannot add filter to "+p+" column, editor returned a value of false");if(!(r instanceof Node))return void console.warn("Filter Error - Cannot add filter to "+p+" column, editor should return an instance of Node, the editor returned:",r);p?d.langBind("headerFilters|columns|"+t.definition.field,(function(e){r.setAttribute("placeholder",void 0!==e&&e?e:d.langText("headerFilters|default"))})):d.langBind("headerFilters|default",(function(e){r.setAttribute("placeholder",e)})),r.addEventListener("click",(function(e){e.stopPropagation(),r.focus()})),r.addEventListener("focus",(function(e){var t=h.table.columnManager.element.scrollLeft;t!==h.table.rowManager.element.scrollLeft+parseInt(h.table.columnManager.element.style.marginLeft)&&(h.table.rowManager.scrollHorizontal(t),h.table.columnManager.scrollHorizontal(t))})),l=!1,u=function(e){l&&clearTimeout(l),l=setTimeout((function(){m(r.value)}),d.table.options.headerFilterLiveFilterDelay)},t.modules.filter.headerElement=r,t.modules.filter.attrType=r.hasAttribute("type")?r.getAttribute("type").toLowerCase():"",t.modules.filter.tagType=r.tagName.toLowerCase(),!1!==t.definition.headerFilterLiveFilter&&("autocomplete"!==t.definition.headerFilter&&"tickCross"!==t.definition.headerFilter&&("autocomplete"!==t.definition.editor&&"tickCross"!==t.definition.editor||!0!==t.definition.headerFilter)&&(r.addEventListener("keyup",u),r.addEventListener("search",u),"number"==t.modules.filter.attrType&&r.addEventListener("change",(function(e){m(r.value)})),"text"==t.modules.filter.attrType&&"ie"!==this.table.browser&&r.setAttribute("type","search")),"input"!=t.modules.filter.tagType&&"select"!=t.modules.filter.tagType&&"textarea"!=t.modules.filter.tagType||r.addEventListener("mousedown",(function(e){e.stopPropagation()}))),o.appendChild(r),t.contentElement.appendChild(o),n||d.headerFilterColumns.push(t)}}else console.warn("Filter Error - Cannot add header filter, column has no field set:",t.definition.title)}},{key:"hideHeaderFilterElements",value:function(){this.headerFilterColumns.forEach((function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="none")}))}},{key:"showHeaderFilterElements",value:function(){this.headerFilterColumns.forEach((function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="")}))}},{key:"setHeaderFilterFocus",value:function(e){e.modules.filter&&e.modules.filter.headerElement?e.modules.filter.headerElement.focus():console.warn("Column Filter Focus Error - No header filter set on column:",e.getField())}},{key:"getHeaderFilterValue",value:function(e){if(e.modules.filter&&e.modules.filter.headerElement)return e.modules.filter.value;console.warn("Column Filter Error - No header filter set on column:",e.getField())}},{key:"setHeaderFilterValue",value:function(e,t){e&&(e.modules.filter&&e.modules.filter.headerElement?(this.generateHeaderFilterElement(e,t,!0),e.modules.filter.success(t)):console.warn("Column Filter Error - No header filter set on column:",e.getField()))}},{key:"reloadHeaderFilter",value:function(e){e&&(e.modules.filter&&e.modules.filter.headerElement?this.generateHeaderFilterElement(e,e.modules.filter.value,!0):console.warn("Column Filter Error - No header filter set on column:",e.getField()))}},{key:"refreshFilter",value:function(){this.tableInitialized&&("remote"===this.table.options.filterMode?this.reloadData(null,!1,!1):this.refreshData(!0))}},{key:"trackChanges",value:function(){this.changed=!0,this.dispatch("filter-changed")}},{key:"hasChanged",value:function(){var e=this.changed;return this.changed=!1,e}},{key:"setFilter",value:function(e,t,i,n){this.filterList=[],Array.isArray(e)||(e=[{field:e,type:t,value:i,params:n}]),this.addFilter(e)}},{key:"addFilter",value:function(e,t,i,n){var o=this,a=!1;Array.isArray(e)||(e=[{field:e,type:t,value:i,params:n}]),e.forEach((function(e){(e=o.findFilter(e))&&(o.filterList.push(e),a=!0)})),a&&this.trackChanges()}},{key:"findFilter",value:function(e){var t;if(Array.isArray(e))return this.findSubFilters(e);var i=!1;return"function"==typeof e.field?i=function(t){return e.field(t,e.type||{})}:r.filters[e.type]?i=(t=this.table.columnManager.getColumnByField(e.field))?function(i){return r.filters[e.type](e.value,t.getFieldValue(i),i,e.params||{})}:function(t){return r.filters[e.type](e.value,t[e.field],t,e.params||{})}:console.warn("Filter Error - No such filter type found, ignoring: ",e.type),e.func=i,!!e.func&&e}},{key:"findSubFilters",value:function(e){var t=this,i=[];return e.forEach((function(e){(e=t.findFilter(e))&&i.push(e)})),!!i.length&&i}},{key:"getFilters",value:function(e,t){var i=[];return e&&(i=this.getHeaderFilters()),t&&i.forEach((function(e){"function"==typeof e.type&&(e.type="function")})),i=i.concat(this.filtersToArray(this.filterList,t))}},{key:"filtersToArray",value:function(e,t){var i=this,n=[];return e.forEach((function(e){var o;Array.isArray(e)?n.push(i.filtersToArray(e,t)):(o={field:e.field,type:e.type,value:e.value},t&&"function"==typeof o.type&&(o.type="function"),n.push(o))})),n}},{key:"getHeaderFilters",value:function(){var e=[];for(var t in this.headerFilters)e.push({field:t,type:this.headerFilters[t].type,value:this.headerFilters[t].value});return e}},{key:"removeFilter",value:function(t,i,n){var o=this;Array.isArray(t)||(t=[{field:t,type:i,value:n}]),t.forEach((function(t){var i=-1;(i="object"==e(t.field)?o.filterList.findIndex((function(e){return t===e})):o.filterList.findIndex((function(e){return t.field===e.field&&t.type===e.type&&t.value===e.value})))>-1?o.filterList.splice(i,1):console.warn("Filter Error - No matching filter type found, ignoring: ",t.type)})),this.trackChanges()}},{key:"clearFilter",value:function(e){this.filterList=[],e&&this.clearHeaderFilter(),this.trackChanges()}},{key:"clearHeaderFilter",value:function(){var e=this;this.headerFilters={},this.prevHeaderFilterChangeCheck="{}",this.headerFilterColumns.forEach((function(t){void 0!==t.modules.filter.value&&delete t.modules.filter.value,t.modules.filter.prevSuccess=void 0,e.reloadHeaderFilter(t)})),this.trackChanges()}},{key:"search",value:function(e,t,i,n){var o=this,a=[],r=[];return Array.isArray(t)||(t=[{field:t,type:i,value:n}]),t.forEach((function(e){(e=o.findFilter(e))&&r.push(e)})),this.table.rowManager.rows.forEach((function(t){var i=!0;r.forEach((function(e){o.filterRecurse(e,t.getData())||(i=!1)})),i&&a.push("data"===e?t.getData("data"):t.getComponent())})),a}},{key:"filter",value:function(e,t){var i=this,n=[],o=[];return this.subscribedExternal("dataFiltering")&&this.dispatchExternal("dataFiltering",this.getFilters(!0)),"remote"!==this.table.options.filterMode&&(this.filterList.length||Object.keys(this.headerFilters).length)?e.forEach((function(e){i.filterRow(e)&&n.push(e)})):n=e.slice(0),this.subscribedExternal("dataFiltered")&&(n.forEach((function(e){o.push(e.getComponent())})),this.dispatchExternal("dataFiltered",this.getFilters(!0),o)),n}},{key:"filterRow",value:function(e,t){var i=this,n=!0,o=e.getData();for(var a in this.filterList.forEach((function(e){i.filterRecurse(e,o)||(n=!1)})),this.headerFilters)this.headerFilters[a].func(o)||(n=!1);return n}},{key:"filterRecurse",value:function(e,t){var i=this,n=!1;return Array.isArray(e)?e.forEach((function(e){i.filterRecurse(e,t)&&(n=!0)})):n=e.func(t),n}}]),r}(V);ye.moduleName="filter",ye.filters=be;var we={plaintext:function(e,t,i){return this.emptyToSpace(this.sanitizeHTML(e.getValue()))},html:function(e,t,i){return e.getValue()},textarea:function(e,t,i){return e.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(e.getValue()))},money:function(e,t,i){var n,o,a,r,s=parseFloat(e.getValue()),l="",u=t.decimal||".",c=t.thousand||",",h=t.negativeSign||"-",d=t.symbol||"",m=!!t.symbolAfter,p=void 0!==t.precision?t.precision:2;if(isNaN(s))return this.emptyToSpace(this.sanitizeHTML(e.getValue()));if(s<0&&(s=Math.abs(s),l=h),n=!1!==p?s.toFixed(p):s,o=(n=String(n).split("."))[0],a=n.length>1?u+n[1]:"",!1!==t.thousand)for(r=/(\d+)(\d{3})/;r.test(o);)o=o.replace(r,"$1"+c+"$2");return m?l+o+a+d:l+d+o+a},link:function(t,i,n){var o,a=t.getValue(),r=i.urlPrefix||"",s=i.download,l=a,u=document.createElement("a");if(i.labelField&&(o=t.getData(),l=function t(i,n){var o=n[i.shift()];return i.length&&"object"===e(o)?t(i,o):o}(i.labelField.split(this.table.options.nestedFieldSeparator),o)),i.label)switch(e(i.label)){case"string":l=i.label;break;case"function":l=i.label(t)}if(l){if(i.urlField&&(a=(o=t.getData())[i.urlField]),i.url)switch(e(i.url)){case"string":a=i.url;break;case"function":a=i.url(t)}return u.setAttribute("href",r+a),i.target&&u.setAttribute("target",i.target),i.download&&(s="function"==typeof s?s(t):!0===s?"":s,u.setAttribute("download",s)),u.innerHTML=this.emptyToSpace(this.sanitizeHTML(l)),u}return" "},image:function(t,i,n){var o=document.createElement("img"),a=t.getValue();switch(i.urlPrefix&&(a=i.urlPrefix+t.getValue()),i.urlSuffix&&(a+=i.urlSuffix),o.setAttribute("src",a),e(i.height)){case"number":o.style.height=i.height+"px";break;case"string":o.style.height=i.height}switch(e(i.width)){case"number":o.style.width=i.width+"px";break;case"string":o.style.width=i.width}return o.addEventListener("load",(function(){t.getRow().normalizeHeight()})),o},tickCross:function(e,t,i){var n=e.getValue(),o=e.getElement(),a=t.allowEmpty,r=t.allowTruthy,s=Object.keys(t).includes("trueValue"),l=void 0!==t.tickElement?t.tickElement:'',u=void 0!==t.crossElement?t.crossElement:'';return s&&n===t.trueValue||!s&&(r&&n||!0===n||"true"===n||"True"===n||1===n||"1"===n)?(o.setAttribute("aria-checked",!0),l||""):!a||"null"!==n&&""!==n&&null!=n?(o.setAttribute("aria-checked",!1),u||""):(o.setAttribute("aria-checked","mixed"),"")},datetime:function(e,t,i){var n,o=window.DateTime||luxon.DateTime,a=t.inputFormat||"yyyy-MM-dd HH:mm:ss",r=t.outputFormat||"dd/MM/yyyy HH:mm:ss",s=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",l=e.getValue();if(void 0!==o)return(n=o.isDateTime(l)?l:"iso"===a?o.fromISO(String(l)):o.fromFormat(String(l),a)).isValid?(t.timezone&&(n=n.setZone(t.timezone)),n.toFormat(r)):!0!==s&&l?"function"==typeof s?s(l):s:l;console.error("Format Error - 'datetime' formatter is dependant on luxon.js")},datetimediff:function(e,t,i){var n,o=window.DateTime||luxon.DateTime,a=t.inputFormat||"yyyy-MM-dd HH:mm:ss",r=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",s=void 0!==t.suffix&&t.suffix,l=void 0!==t.unit?t.unit:"days",u=void 0!==t.humanize&&t.humanize,c=void 0!==t.date?t.date:o.now(),h=e.getValue();if(void 0!==o)return(n=o.isDateTime(h)?h:"iso"===a?o.fromISO(String(h)):o.fromFormat(String(h),a)).isValid?u?n.diff(c,l).toHuman()+(s?" "+s:""):parseInt(n.diff(c,l)[l])+(s?" "+s:""):!0===r?h:"function"==typeof r?r(h):r;console.error("Format Error - 'datetimediff' formatter is dependant on luxon.js")},lookup:function(e,t,i){var n=e.getValue();return void 0===t[n]?(console.warn("Missing display value for "+n),n):t[n]},star:function(e,t,i){var n=e.getValue(),o=e.getElement(),a=t&&t.stars?t.stars:5,r=document.createElement("span"),s=document.createElementNS("http://www.w3.org/2000/svg","svg");r.style.verticalAlign="middle",s.setAttribute("width","14"),s.setAttribute("height","14"),s.setAttribute("viewBox","0 0 512 512"),s.setAttribute("xml:space","preserve"),s.style.padding="0 1px",n=n&&!isNaN(n)?parseInt(n):0,n=Math.max(0,Math.min(n,a));for(var l=1;l<=a;l++){var u=s.cloneNode(!0);u.innerHTML=l<=n?'':'',r.appendChild(u)}return o.style.whiteSpace="nowrap",o.style.overflow="hidden",o.style.textOverflow="ellipsis",o.setAttribute("aria-label",n),r},traffic:function(t,i,n){var o,a,r=this.sanitizeHTML(t.getValue())||0,s=document.createElement("span"),l=i&&i.max?i.max:100,u=i&&i.min?i.min:0,c=i&&void 0!==i.color?i.color:["red","orange","green"],h="#666666";if(!isNaN(r)&&void 0!==t.getValue()){switch(s.classList.add("tabulator-traffic-light"),a=parseFloat(r)<=l?parseFloat(r):l,a=parseFloat(a)>=u?parseFloat(a):u,o=(l-u)/100,a=Math.round((a-u)/o),e(c)){case"string":h=c;break;case"function":h=c(r);break;case"object":if(Array.isArray(c)){var d=100/c.length,m=Math.floor(a/d);m=Math.min(m,c.length-1),h=c[m=Math.max(m,0)];break}}return s.style.backgroundColor=h,s}},progress:function(t,i,n){var o,a,r,s,l,u=this.sanitizeHTML(t.getValue())||0,c=t.getElement(),h=i&&i.max?i.max:100,d=i&&i.min?i.min:0,m=i&&i.legendAlign?i.legendAlign:"center";switch(a=parseFloat(u)<=h?parseFloat(u):h,a=parseFloat(a)>=d?parseFloat(a):d,o=(h-d)/100,a=Math.round((a-d)/o),e(i.color)){case"string":r=i.color;break;case"function":r=i.color(u);break;case"object":if(Array.isArray(i.color)){var p=100/i.color.length,f=Math.floor(a/p);f=Math.min(f,i.color.length-1),f=Math.max(f,0),r=i.color[f];break}default:r="#2DC214"}switch(e(i.legend)){case"string":s=i.legend;break;case"function":s=i.legend(u);break;case"boolean":s=u;break;default:s=!1}switch(e(i.legendColor)){case"string":l=i.legendColor;break;case"function":l=i.legendColor(u);break;case"object":if(Array.isArray(i.legendColor)){p=100/i.legendColor.length,f=Math.floor(a/p);f=Math.min(f,i.legendColor.length-1),f=Math.max(f,0),l=i.legendColor[f]}break;default:l="#000"}c.style.minWidth="30px",c.style.position="relative",c.setAttribute("aria-label",a);var g=document.createElement("div");g.style.display="inline-block",g.style.position="absolute",g.style.width=a+"%",g.style.backgroundColor=r,g.style.height="100%",g.setAttribute("data-max",h),g.setAttribute("data-min",d);var v=document.createElement("div");if(v.style.position="relative",v.style.width="100%",v.style.height="100%",s){var b=document.createElement("div");b.style.position="absolute",b.style.top=0,b.style.left=0,b.style.textAlign=m,b.style.width="100%",b.style.color=l,b.innerHTML=s}return n((function(){if(!(t instanceof y)){var e=document.createElement("div");e.style.position="absolute",e.style.top="4px",e.style.bottom="4px",e.style.left="4px",e.style.right="4px",c.appendChild(e),c=e}c.appendChild(v),v.appendChild(g),s&&v.appendChild(b)})),""},color:function(e,t,i){return e.getElement().style.backgroundColor=this.sanitizeHTML(e.getValue()),""},buttonTick:function(e,t,i){return''},buttonCross:function(e,t,i){return''},rownum:function(e,t,i){return this.table.rowManager.activeRows.indexOf(e.getRow()._getSelf())+1||""},handle:function(e,t,i){return e.getElement().classList.add("tabulator-row-handle"),"
"},responsiveCollapse:function(e,t,i){var n=document.createElement("div"),o=e.getRow()._row.modules.responsiveLayout;function a(e){var t=o.element;o.open=e,t&&(o.open?(n.classList.add("open"),t.style.display=""):(n.classList.remove("open"),t.style.display="none"))}return n.classList.add("tabulator-responsive-collapse-toggle"),n.innerHTML="+-",e.getElement().classList.add("tabulator-row-handle"),n.addEventListener("click",(function(e){e.stopImmediatePropagation(),a(!o.open)})),a(o.open),n},rowSelection:function(e,t,i){var n=this,o=document.createElement("input"),a=!1;if(o.type="checkbox",o.setAttribute("aria-label","Select Row"),this.table.modExists("selectRow",!0))if(o.addEventListener("click",(function(e){e.stopPropagation()})),"function"==typeof e.getRow){var r=e.getRow();r instanceof L?(o.addEventListener("change",(function(e){"click"===n.table.options.selectableRangeMode&&a?a=!1:r.toggleSelect()})),"click"===this.table.options.selectableRangeMode&&o.addEventListener("click",(function(e){a=!0,n.table.modules.selectRow.handleComplexRowClick(r._row,e)})),o.checked=r.isSelected&&r.isSelected(),this.table.modules.selectRow.registerRowSelectCheckbox(r,o)):o=""}else o.addEventListener("change",(function(e){n.table.modules.selectRow.selectedRows.length?n.table.deselectRow():n.table.selectRow(t.rowRange)})),this.table.modules.selectRow.registerHeaderSelectCheckbox(o);return o}},Ce=function(i){a(r,i);var n=c(r);function r(e){var i;return t(this,r),(i=n.call(this,e)).registerColumnOption("formatter"),i.registerColumnOption("formatterParams"),i.registerColumnOption("formatterPrint"),i.registerColumnOption("formatterPrintParams"),i.registerColumnOption("formatterClipboard"),i.registerColumnOption("formatterClipboardParams"),i.registerColumnOption("formatterHtmlOutput"),i.registerColumnOption("formatterHtmlOutputParams"),i.registerColumnOption("titleFormatter"),i.registerColumnOption("titleFormatterParams"),i}return o(r,[{key:"initialize",value:function(){this.subscribe("cell-format",this.formatValue.bind(this)),this.subscribe("cell-rendered",this.cellRendered.bind(this)),this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("column-format",this.formatHeader.bind(this))}},{key:"initializeColumn",value:function(e){e.modules.format=this.lookupFormatter(e,""),void 0!==e.definition.formatterPrint&&(e.modules.format.print=this.lookupFormatter(e,"Print")),void 0!==e.definition.formatterClipboard&&(e.modules.format.clipboard=this.lookupFormatter(e,"Clipboard")),void 0!==e.definition.formatterHtmlOutput&&(e.modules.format.htmlOutput=this.lookupFormatter(e,"HtmlOutput"))}},{key:"lookupFormatter",value:function(t,i){var n={params:t.definition["formatter"+i+"Params"]||{}},o=t.definition["formatter"+i];switch(e(o)){case"string":r.formatters[o]?n.formatter=r.formatters[o]:(console.warn("Formatter Error - No such formatter found: ",o),n.formatter=r.formatters.plaintext);break;case"function":n.formatter=o;break;default:n.formatter=r.formatters.plaintext}return n}},{key:"cellRendered",value:function(e){e.modules.format&&e.modules.format.renderedCallback&&!e.modules.format.rendered&&(e.modules.format.renderedCallback(),e.modules.format.rendered=!0)}},{key:"formatHeader",value:function(e,t,i){var n,o,a,r;return e.definition.titleFormatter?(n=this.getFormatter(e.definition.titleFormatter),a=function(t){e.titleFormatterRendered=t},r={getValue:function(){return t},getElement:function(){return i}},o="function"==typeof(o=e.definition.titleFormatterParams||{})?o():o,n.call(this,r,o,a)):t}},{key:"formatValue",value:function(e){var t=e.getComponent(),i="function"==typeof e.column.modules.format.params?e.column.modules.format.params(t):e.column.modules.format.params;return e.column.modules.format.formatter.call(this,t,i,(function(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t,e.modules.format.rendered=!1}))}},{key:"formatExportValue",value:function(e,t){var i,n=e.column.modules.format[t];if(n){return i="function"==typeof n.params?n.params(component):n.params,n.formatter.call(this,e.getComponent(),i,(function(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t,e.modules.format.rendered=!1}))}return this.formatValue(e)}},{key:"sanitizeHTML",value:function(e){if(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(e).replace(/[&<>"'`=\/]/g,(function(e){return t[e]}))}return e}},{key:"emptyToSpace",value:function(e){return null==e||""===e?" ":e}},{key:"getFormatter",value:function(t){switch(e(t)){case"string":r.formatters[t]?t=r.formatters[t]:(console.warn("Formatter Error - No such formatter found: ",t),t=r.formatters.plaintext);break;case"function":t=t;break;default:t=r.formatters.plaintext}return t}}]),r}(V);Ce.moduleName="format",Ce.formatters=we;var ke=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).leftColumns=[],o.rightColumns=[],o.leftMargin=0,o.rightMargin=0,o.rightPadding=0,o.initializationMode="left",o.active=!1,o.blocked=!0,o.registerColumnOption("frozen"),o}return o(n,[{key:"reset",value:function(){this.initializationMode="left",this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightMargin=0,this.active=!1,this.table.columnManager.headersElement.style.marginLeft=0,this.table.columnManager.element.style.paddingRight=0}},{key:"initialize",value:function(){this.subscribe("cell-layout",this.layoutCell.bind(this)),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-width",this.layout.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("table-layout",this.layout.bind(this)),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("columns-loading",this.reset.bind(this)),this.subscribe("column-add",this.reinitializeColumns.bind(this)),this.subscribe("column-delete",this.reinitializeColumns.bind(this)),this.subscribe("table-redraw",this.layout.bind(this)),this.subscribe("layout-refreshing",this.blockLayout.bind(this)),this.subscribe("layout-refreshed",this.unblockLayout.bind(this))}},{key:"blockLayout",value:function(){this.blocked=!0}},{key:"unblockLayout",value:function(){this.blocked=!1}},{key:"layoutCell",value:function(e){this.layoutElement(e.element,e.column)}},{key:"reinitializeColumns",value:function(){var e=this;this.reset(),this.table.columnManager.columnsByIndex.forEach((function(t){e.initializeColumn(t)}))}},{key:"initializeColumn",value:function(e){var t={margin:0,edge:!1};e.isGroup||(this.frozenCheck(e)?(t.position=this.initializationMode,"left"==this.initializationMode?this.leftColumns.push(e):this.rightColumns.unshift(e),this.active=!0,e.modules.frozen=t):this.initializationMode="right")}},{key:"frozenCheck",value:function(e){return e.parent.isGroup&&e.definition.frozen&&console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups"),e.parent.isGroup?this.frozenCheck(e.parent):e.definition.frozen}},{key:"scrollHorizontal",value:function(){this.active&&(this.calcMargins(!0),this.layoutColumnPosition(),this.layoutCalcRows(),this.reinitializeRows())}},{key:"calcMargins",value:function(e){e||(this.leftMargin=this._calcSpace(this.leftColumns,this.leftColumns.length)+"px",this.rightMargin=this._calcSpace(this.rightColumns,this.rightColumns.length)+"px",this.table.rowManager.tableElement.style.marginRight=this.rightMargin),this.rightPadding=this.table.rowManager.element.clientWidth+this.table.columnManager.scrollLeft}},{key:"layoutCalcRows",value:function(){this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&this.table.modules.columnCalcs.topRow&&this.layoutRow(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&this.table.modules.columnCalcs.botRow&&this.layoutRow(this.table.modules.columnCalcs.botRow),this.table.modExists("groupRows")&&this.layoutGroupCalcs(this.table.modules.groupRows.getGroups()))}},{key:"layoutGroupCalcs",value:function(e){var t=this;e.forEach((function(e){e.calcs.top&&t.layoutRow(e.calcs.top),e.calcs.bottom&&t.layoutRow(e.calcs.bottom),e.groupList&&e.groupList.length&&t.layoutGroupCalcs(e.groupList&&e.groupList)}))}},{key:"layoutColumnPosition",value:function(e){var t=this,i=[],n=0,o=0;this.table.columnManager.headersElement.style.marginLeft=this.leftMargin,this.table.columnManager.element.style.paddingRight=this.rightMargin,this.leftColumns.forEach((function(o,a){if(o.modules.frozen.marginValue=n+t.table.columnManager.scrollLeft,o.modules.frozen.margin=o.modules.frozen.marginValue+"px",o.visible&&(n+=o.getWidth()),a==t.leftColumns.length-1?o.modules.frozen.edge=!0:o.modules.frozen.edge=!1,o.parent.isGroup){var r=t.getColGroupParentElement(o);i.includes(r)||(t.layoutElement(r,o),i.push(r)),o.modules.frozen.edge&&r.classList.add("tabulator-frozen-"+o.modules.frozen.position)}else t.layoutElement(o.getElement(),o);e&&o.cells.forEach((function(e){t.layoutElement(e.getElement(!0),o)}))})),this.rightColumns.forEach((function(i,n){i.visible&&(o+=i.getWidth()),i.modules.frozen.marginValue=t.rightPadding-o,i.modules.frozen.margin=i.modules.frozen.marginValue+"px",n==t.rightColumns.length-1?i.modules.frozen.edge=!0:i.modules.frozen.edge=!1,i.parent.isGroup?t.layoutElement(t.getColGroupParentElement(i),i):t.layoutElement(i.getElement(),i),e&&i.cells.forEach((function(e){t.layoutElement(e.getElement(!0),i)}))}))}},{key:"getColGroupParentElement",value:function(e){return e.parent.isGroup?this.getColGroupParentElement(e.parent):e.getElement()}},{key:"layout",value:function(){this.active&&!this.blocked&&(this.calcMargins(),this.layoutColumnPosition(),this.reinitializeRows(),this.layoutCalcRows())}},{key:"reinitializeRows",value:function(){var e=this,t=this.table.rowManager.getVisibleRows();this.table.rowManager.getRows().filter((function(e){return!t.includes(e)})).forEach((function(e){e.deinitialize()})),t.forEach((function(t){"row"===t.type&&e.layoutRow(t)}))}},{key:"layoutRow",value:function(e){var t=this;e.getElement().style.paddingLeft=this.leftMargin,"fitDataFill"===this.table.options.layout&&this.rightColumns.length&&(this.table.rowManager.getTableElement().style.minWidth="calc(100% - "+this.rightMargin+")"),this.leftColumns.forEach((function(i){var n=e.getCell(i);n&&t.layoutElement(n.getElement(!0),i)})),this.rightColumns.forEach((function(i){var n=e.getCell(i);n&&t.layoutElement(n.getElement(!0),i)}))}},{key:"layoutElement",value:function(e,t){t.modules.frozen&&(e.style.position="absolute",e.style.left=t.modules.frozen.margin,e.classList.add("tabulator-frozen"),t.modules.frozen.edge&&e.classList.add("tabulator-frozen-"+t.modules.frozen.position))}},{key:"_calcSpace",value:function(e,t){for(var i=0,n=0;n-1}},{key:"isFrozen",value:function(){return!!this.rows.length}},{key:"visibleRows",value:function(e,t){return this.rows.forEach((function(e){t.push(e)})),t}},{key:"getRows",value:function(e){var t=e.slice(0);return this.rows.forEach((function(e){var i=t.indexOf(e);i>-1&&t.splice(i,1)})),t}},{key:"freezeRow",value:function(e){e.modules.frozen?console.warn("Freeze Error - Row is already frozen"):(e.modules.frozen=!0,this.topElement.appendChild(e.getElement()),e.initialize(),e.normalizeHeight(),this.table.rowManager.adjustTableSize(),this.rows.push(e),this.refreshData(!1,"display"),this.styleRows())}},{key:"unfreezeRow",value:function(e){this.rows.indexOf(e);e.modules.frozen?(e.modules.frozen=!1,this.detachRow(e),this.table.rowManager.adjustTableSize(),this.refreshData(!1,"display"),this.rows.length&&this.styleRows()):console.warn("Freeze Error - Row is already unfrozen")}},{key:"detachRow",value:function(e){var t=this.rows.indexOf(e);if(t>-1){var i=e.getElement();i.parentNode&&i.parentNode.removeChild(i),this.rows.splice(t,1)}}},{key:"styleRows",value:function(e){var t=this;this.rows.forEach((function(e,i){t.table.rowManager.styleRow(e,i)}))}}]),n}(V);Ee.moduleName="frozenRows";var Re=function(){function e(i){return t(this,e),this._group=i,this.type="GroupComponent",new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._group.groupManager.table.componentFunctionBinder.handle("row",e._group,t)}})}return o(e,[{key:"getKey",value:function(){return this._group.key}},{key:"getField",value:function(){return this._group.field}},{key:"getElement",value:function(){return this._group.element}},{key:"getRows",value:function(){return this._group.getRows(!0)}},{key:"getSubGroups",value:function(){return this._group.getSubGroups(!0)}},{key:"getParentGroup",value:function(){return!!this._group.parent&&this._group.parent.getComponent()}},{key:"isVisible",value:function(){return this._group.visible}},{key:"show",value:function(){this._group.show()}},{key:"hide",value:function(){this._group.hide()}},{key:"toggle",value:function(){this._group.toggleVisibility()}},{key:"_getSelf",value:function(){return this._group}},{key:"getTable",value:function(){return this._group.groupManager.table}}]),e}(),xe=function(){function e(i,n,o,a,r,s,l){t(this,e),this.groupManager=i,this.parent=n,this.key=a,this.level=o,this.field=r,this.hasSubGroups=o-1?i?this.rows.splice(o+1,0,e):this.rows.splice(o,0,e):i?this.rows.push(e):this.rows.unshift(e),e.modules.group=this,this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this),this.groupManager.updateGroupRows(!0)}},{key:"scrollHeader",value:function(e){this.arrowElement&&(this.arrowElement.style.marginLeft=e,this.groupList.forEach((function(t){t.scrollHeader(e)})))}},{key:"getRowIndex",value:function(e){}},{key:"conformRowData",value:function(e){return this.field?e[this.field]=this.key:console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"),this.parent&&(e=this.parent.conformRowData(e)),e}},{key:"removeRow",value:function(e){var t=this.rows.indexOf(e),i=e.getElement();t>-1&&this.rows.splice(t,1),this.groupManager.table.options.groupValues||this.rows.length?(i.parentNode&&i.parentNode.removeChild(i),this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this)):(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this),this.groupManager.updateGroupRows(!0))}},{key:"removeGroup",value:function(e){var t,i=e.level+"_"+e.key;this.groups[i]&&(delete this.groups[i],(t=this.groupList.indexOf(e))>-1&&this.groupList.splice(t,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))}},{key:"getHeadersAndRows",value:function(e){var t=[];return t.push(this),this._visSet(),this.visible?this.groupList.length?this.groupList.forEach((function(i){t=t.concat(i.getHeadersAndRows(e))})):(!e&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),t.push(this.calcs.top)),t=t.concat(this.rows),!e&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),t.push(this.calcs.bottom))):this.groupList.length||"table"==this.groupManager.table.options.columnCalcs||this.groupManager.table.modExists("columnCalcs")&&(!e&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),t.push(this.calcs.top))),!e&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),t.push(this.calcs.bottom)))),t}},{key:"getData",value:function(e,t){var i=[];return this._visSet(),(!e||e&&this.visible)&&this.rows.forEach((function(e){i.push(e.getData(t||"data"))})),i}},{key:"getRowCount",value:function(){var e=0;return this.groupList.length?this.groupList.forEach((function(t){e+=t.getRowCount()})):e=this.rows.length,e}},{key:"toggleVisibility",value:function(){this.visible?this.hide():this.show()}},{key:"hide",value:function(){this.visible=!1,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination?this.groupManager.updateGroupRows(!0):(this.element.classList.remove("tabulator-group-visible"),this.groupList.length?this.groupList.forEach((function(e){e.getHeadersAndRows().forEach((function(e){e.detachElement()}))})):this.rows.forEach((function(e){var t=e.getElement();t.parentNode.removeChild(t)})),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()),this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!1)}},{key:"show",value:function(){if(this.visible=!0,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination)this.groupManager.updateGroupRows(!0);else{this.element.classList.add("tabulator-group-visible");var e=this.generateElement();this.groupList.length?this.groupList.forEach((function(t){t.getHeadersAndRows().forEach((function(t){var i=t.getElement();e.parentNode.insertBefore(i,e.nextSibling),t.initialize(),e=i}))})):this.rows.forEach((function(t){var i=t.getElement();e.parentNode.insertBefore(i,e.nextSibling),t.initialize(),e=i})),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()}this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!0)}},{key:"_visSet",value:function(){var e=[];"function"==typeof this.visible&&(this.rows.forEach((function(t){e.push(t.getData())})),this.visible=this.visible(this.key,this.getRowCount(),e,this.getComponent()))}},{key:"getRowGroup",value:function(e){var t=!1;return this.groupList.length?this.groupList.forEach((function(i){var n=i.getRowGroup(e);n&&(t=n)})):this.rows.find((function(t){return t===e}))&&(t=this),t}},{key:"getSubGroups",value:function(e){var t=[];return this.groupList.forEach((function(i){t.push(e?i.getComponent():i)})),t}},{key:"getRows",value:function(e){var t=[];return this.rows.forEach((function(i){t.push(e?i.getComponent():i)})),t}},{key:"generateGroupHeaderContents",value:function(){var e=[];for(this.rows.forEach((function(t){e.push(t.getData())})),this.elementContents=this.generator(this.key,this.getRowCount(),e,this.getComponent());this.element.firstChild;)this.element.removeChild(this.element.firstChild);"string"==typeof this.elementContents?this.element.innerHTML=this.elementContents:this.element.appendChild(this.elementContents),this.element.insertBefore(this.arrowElement,this.element.firstChild)}},{key:"getPath",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.unshift(this.key),this.parent&&this.parent.getPath(e),e}},{key:"getElement",value:function(){return this.elementContents?this.element:this.generateElement()}},{key:"generateElement",value:function(){this.addBindings=!1,this._visSet(),this.visible?this.element.classList.add("tabulator-group-visible"):this.element.classList.remove("tabulator-group-visible");for(var e=0;en.length&&console.warn("Error creating group headers, groupHeader array is shorter than groupBy array"),this.headerGenerator=[function(){return""}],this.startOpen=[function(){return!1}],this.langBind("groups|item",(function(t,i){e.headerGenerator[0]=function(e,n,o){return(void 0===e?"":e)+"("+n+" "+(1===n?t:i.groups.items)+")"}})),this.groupIDLookups=[],Array.isArray(t)||t)this.table.modExists("columnCalcs")&&"table"!=this.table.options.columnCalcs&&"both"!=this.table.options.columnCalcs&&this.table.modules.columnCalcs.removeCalcs();else if(this.table.modExists("columnCalcs")&&"group"!=this.table.options.columnCalcs)this.table.columnManager.getRealColumns().forEach((function(t){t.definition.topCalc&&e.table.modules.columnCalcs.initializeTopRow(),t.definition.bottomCalc&&e.table.modules.columnCalcs.initializeBottomRow()}));Array.isArray(t)||(t=[t]),t.forEach((function(t,i){var n,o;n="function"==typeof t?t:(o=e.table.columnManager.getColumnByField(t))?function(e){return o.getFieldValue(e)}:function(e){return e[t]},e.groupIDLookups.push({field:"function"!=typeof t&&t,func:n,values:!!e.allowedValues&&e.allowedValues[i]})})),i&&(Array.isArray(i)||(i=[i]),i.forEach((function(e){})),this.startOpen=i),n&&(this.headerGenerator=Array.isArray(n)?n:[n])}}},{key:"rowSample",value:function(e,t){var i=this.getGroups(!1)[0];return t.push(i.getRows(!1)[0]),t}},{key:"virtualRenderFill",value:function(){var e=this.table.rowManager.tableElement,t=this.table.rowManager.getVisibleRows();t=t.filter((function(e){return"group"!==e.type})),e.style.minWidth=t.length?"":this.table.columnManager.getWidth()+"px"}},{key:"rowAddingIndex",value:function(e,t,i){this.assignRowToGroup(e);var n=e.modules.group.rows;return n.length>1&&(!t||t&&-1==n.indexOf(t)?i?n[0]!==e&&(t=n[0],this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)):n[n.length-1]!==e&&(t=n[n.length-1],this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)):this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)),t}},{key:"trackChanges",value:function(){this.dispatch("group-changed")}},{key:"setGroupBy",value:function(e){this.table.options.groupBy=e,this.initialized?this.configureGroupSetup():this.initialize(),this.refreshData(),this.trackChanges()}},{key:"setGroupValues",value:function(e){this.table.options.groupValues=e,this.configureGroupSetup(),this.refreshData(),this.trackChanges()}},{key:"setGroupStartOpen",value:function(e){this.table.options.groupStartOpen=e,this.configureGroupSetup(),this.table.options.groupBy?(this.refreshData(),this.trackChanges()):console.warn("Grouping Update - cant refresh view, no groups have been set")}},{key:"setGroupHeader",value:function(e){this.table.options.groupHeader=e,this.configureGroupSetup(),this.table.options.groupBy?(this.refreshData(),this.trackChanges()):console.warn("Grouping Update - cant refresh view, no groups have been set")}},{key:"userGetGroups",value:function(e){return this.getGroups(!0)}},{key:"userGetGroupedData",value:function(){return this.table.options.groupBy?this.getGroupedData():this.getData()}},{key:"rowGetGroup",value:function(e){return!!e.modules.group&&e.modules.group.getComponent()}},{key:"rowMoving",value:function(e,t,i){!i&&t instanceof xe&&(t=this.table.rowManager.prevDisplayRow(e)||t);var n=t instanceof xe?t:t.modules.group,o=e instanceof xe?e:e.modules.group;n===o?this.table.rowManager.moveRowInArray(n.rows,e,t,i):(o&&o.removeRow(e),n.insertRow(e,t,i))}},{key:"rowDeleting",value:function(e){e.modules.group&&e.modules.group.removeRow(e)}},{key:"rowsUpdated",value:function(e){this.updateGroupRows(!0)}},{key:"cellUpdated",value:function(e){this.reassignRowToGroup(e.row)}},{key:"setDisplayIndex",value:function(e){this.displayIndex=e}},{key:"getDisplayIndex",value:function(){return this.displayIndex}},{key:"getRows",value:function(e){return this.table.options.groupBy&&this.groupIDLookups.length?(this.dispatchExternal("dataGrouping"),this.generateGroups(e),this.subscribedExternal("dataGrouped")&&this.dispatchExternal("dataGrouped",this.getGroups(!0)),this.updateGroupRows()):e.slice(0)}},{key:"getGroups",value:function(e){var t=[];return this.groupList.forEach((function(i){t.push(e?i.getComponent():i)})),t}},{key:"getChildGroups",value:function(e){var t=this,i=[];return e||(e=this),e.groupList.forEach((function(e){e.groupList.length?i=i.concat(t.getChildGroups(e)):i.push(e)})),i}},{key:"wipe",value:function(){this.groupList.forEach((function(e){e.wipe()}))}},{key:"pullGroupListData",value:function(e){var t=this,i=[];return e.forEach((function(e){var n={level:0,rowCount:0,headerContent:""},o=[];e.hasSubGroups?(o=t.pullGroupListData(e.groupList),n.level=e.level,n.rowCount=o.length-e.groupList.length,n.headerContent=e.generator(e.key,n.rowCount,e.rows,e),i.push(n),i=i.concat(o)):(n.level=e.level,n.headerContent=e.generator(e.key,e.rows.length,e.rows,e),n.rowCount=e.getRows().length,i.push(n),e.getRows().forEach((function(e){i.push(e.getData("data"))})))})),i}},{key:"getGroupedData",value:function(){return this.pullGroupListData(this.groupList)}},{key:"getRowGroup",value:function(e){var t=!1;return this.options("dataTree")&&(e=this.table.modules.dataTree.getTreeParentRoot(e)),this.groupList.forEach((function(i){var n=i.getRowGroup(e);n&&(t=n)})),t}},{key:"countGroups",value:function(){return this.groupList.length}},{key:"generateGroups",value:function(e){var t=this,i=this.groups;this.groups={},this.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach((function(e){t.createGroup(e,0,i)})),e.forEach((function(e){t.assignRowToExistingGroup(e,i)}))):e.forEach((function(e){t.assignRowToGroup(e,i)}))}},{key:"createGroup",value:function(e,t,i){var n,o=t+"_"+e;i=i||[],n=new xe(this,!1,t,e,this.groupIDLookups[0].field,this.headerGenerator[0],i[o]),this.groups[o]=n,this.groupList.push(n)}},{key:"assignRowToExistingGroup",value:function(e,t){var i="0_"+this.groupIDLookups[0].func(e.getData());this.groups[i]&&this.groups[i].addRow(e)}},{key:"assignRowToGroup",value:function(e,t){var i=this.groupIDLookups[0].func(e.getData()),n=!this.groups["0_"+i];return n&&this.createGroup(i,0,t),this.groups["0_"+i].addRow(e),!n}},{key:"reassignRowToGroup",value:function(e){if("row"===e.type){var t=e.modules.group,i=t.getPath(),n=this.getExpectedPath(e);i.length==n.length&&i.every((function(e,t){return e===n[t]}))||(t.removeRow(e),this.assignRowToGroup(e,this.groups),this.refreshData(!0))}}},{key:"getExpectedPath",value:function(e){var t=[],i=e.getData();return this.groupIDLookups.forEach((function(e){t.push(e.func(i))})),t}},{key:"updateGroupRows",value:function(e){var t=[];return this.groupList.forEach((function(e){t=t.concat(e.getHeadersAndRows())})),e&&this.refreshData(!0,this.displayHandler),t}},{key:"scrollHeaders",value:function(e){"virtual"===this.table.options.renderHorizontal&&(e-=this.table.columnManager.renderer.vDomPadLeft),e+="px",this.groupList.forEach((function(t){t.scrollHeader(e)}))}},{key:"removeGroup",value:function(e){var t,i=e.level+"_"+e.key;this.groups[i]&&(delete this.groups[i],(t=this.groupList.indexOf(e))>-1&&this.groupList.splice(t,1))}}]),n}(V);Te.moduleName="groupRows";var Me=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).history=[],o.index=-1,o.registerTableOption("history",!1),o}return o(n,[{key:"initialize",value:function(){this.table.options.history&&(this.subscribe("cell-value-updated",this.cellUpdated.bind(this)),this.subscribe("cell-delete",this.clearComponentHistory.bind(this)),this.subscribe("row-delete",this.rowDeleted.bind(this)),this.subscribe("rows-wipe",this.clear.bind(this)),this.subscribe("row-added",this.rowAdded.bind(this)),this.subscribe("row-move",this.rowMoved.bind(this))),this.registerTableFunction("undo",this.undo.bind(this)),this.registerTableFunction("redo",this.redo.bind(this)),this.registerTableFunction("getHistoryUndoSize",this.getHistoryUndoSize.bind(this)),this.registerTableFunction("getHistoryRedoSize",this.getHistoryRedoSize.bind(this)),this.registerTableFunction("clearHistory",this.clear.bind(this))}},{key:"rowMoved",value:function(e,t,i){this.action("rowMove",e,{posFrom:this.table.rowManager.getRowPosition(e),posTo:this.table.rowManager.getRowPosition(t),to:t,after:i})}},{key:"rowAdded",value:function(e,t,i,n){this.action("rowAdd",e,{data:t,pos:i,index:n})}},{key:"rowDeleted",value:function(e){var t,i;this.table.options.groupBy?(t=(i=e.getComponent().getGroup().rows).indexOf(e))&&(t=i[t-1]):(t=e.table.rowManager.getRowIndex(e))&&(t=e.table.rowManager.rows[t-1]),this.action("rowDelete",e,{data:e.getData(),pos:!t,index:t})}},{key:"cellUpdated",value:function(e){this.action("cellEdit",e,{oldValue:e.oldValue,newValue:e.value})}},{key:"clear",value:function(){this.history=[],this.index=-1}},{key:"action",value:function(e,t,i){this.history=this.history.slice(0,this.index+1),this.history.push({type:e,component:t,data:i}),this.index++}},{key:"getHistoryUndoSize",value:function(){return this.index+1}},{key:"getHistoryRedoSize",value:function(){return this.history.length-(this.index+1)}},{key:"clearComponentHistory",value:function(e){var t=this.history.findIndex((function(t){return t.component===e}));t>-1&&(this.history.splice(t,1),t<=this.index&&this.index--,this.clearComponentHistory(e))}},{key:"undo",value:function(){if(this.index>-1){var e=this.history[this.index];return n.undoers[e.type].call(this,e),this.index--,this.dispatchExternal("historyUndo",e.type,e.component.getComponent(),e.data),!0}return console.warn("History Undo Error - No more history to undo"),!1}},{key:"redo",value:function(){if(this.history.length-1>this.index){this.index++;var e=this.history[this.index];return n.redoers[e.type].call(this,e),this.dispatchExternal("historyRedo",e.type,e.component.getComponent(),e.data),!0}return console.warn("History Redo Error - No more history to redo"),!1}},{key:"_rebindRow",value:function(e,t){this.history.forEach((function(i){if(i.component instanceof D)i.component===e&&(i.component=t);else if(i.component instanceof w&&i.component.row===e){var n=i.component.column.getField();n&&(i.component=t.getCell(n))}}))}}]),n}(V);Me.moduleName="history",Me.undoers={cellEdit:function(e){e.component.setValueProcessData(e.data.oldValue),e.component.cellRendered()},rowAdd:function(e){e.component.deleteActual()},rowDelete:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t)},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.rows[e.data.posFrom],!e.data.after),this.table.rowManager.redraw()}},Me.redoers={cellEdit:function(e){e.component.setValueProcessData(e.data.newValue),e.component.cellRendered()},rowAdd:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t)},rowDelete:function(e){e.component.deleteActual()},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.rows[e.data.posTo],e.data.after),this.table.rowManager.redraw()}};var Le=function(i){a(r,i);var n=c(r);function r(e){var i;return t(this,r),(i=n.call(this,e)).fieldIndex=[],i.hasIndex=!1,i}return o(r,[{key:"initialize",value:function(){this.tableElementCheck()}},{key:"tableElementCheck",value:function(){this.table.originalElement&&"TABLE"===this.table.originalElement.tagName&&(this.table.originalElement.childNodes.length?this.parseTable():console.warn("Unable to parse data from empty table tag, Tabulator should be initialized on a div tag unless importing data from a table element."))}},{key:"parseTable",value:function(){var e=this.table.originalElement,t=this.table.options,i=(t.columns,e.getElementsByTagName("th")),n=e.getElementsByTagName("tbody")[0],o=[];this.hasIndex=!1,this.dispatchExternal("htmlImporting"),n=n?n.getElementsByTagName("tr"):[],this._extractOptions(e,t),i.length?this._extractHeaders(i,n):this._generateBlankHeaders(i,n);for(var a=0;a-1&&e.pressedKeys.splice(n,1)}},this.table.element.addEventListener("keydown",this.keyupBinding),this.table.element.addEventListener("keyup",this.keydownBinding)}},{key:"clearBindings",value:function(){this.keyupBinding&&this.table.element.removeEventListener("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.removeEventListener("keyup",this.keydownBinding)}},{key:"checkBinding",value:function(e,t){var i=this,n=!0;return e.ctrlKey==t.ctrl&&e.shiftKey==t.shift&&e.metaKey==t.meta&&(t.keys.forEach((function(e){-1==i.pressedKeys.indexOf(e)&&(n=!1)})),n&&t.action.call(this,e),!0)}}]),r}(V);ze.moduleName="keybindings",ze.bindings={navPrev:"shift + 9",navNext:9,navUp:38,navDown:40,scrollPageUp:33,scrollPageDown:34,scrollToStart:36,scrollToEnd:35,undo:["ctrl + 90","meta + 90"],redo:["ctrl + 89","meta + 89"],copyToClipboard:["ctrl + 67","meta + 89"]},ze.actions={keyBlock:function(e){e.stopPropagation(),e.preventDefault()},scrollPageUp:function(e){var t=this.table.rowManager,i=t.scrollTop-t.element.clientHeight;t.element.scrollHeight;e.preventDefault(),t.displayRowsCount&&(i>=0?t.element.scrollTop=i:t.scrollToRow(t.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(e){var t=this.table.rowManager,i=t.scrollTop+t.element.clientHeight,n=t.element.scrollHeight;e.preventDefault(),t.displayRowsCount&&(i<=n?t.element.scrollTop=i:t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1])),this.table.element.focus()},scrollToStart:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[0]),this.table.element.focus()},scrollToEnd:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1]),this.table.element.focus()},navPrev:function(e){this.dispatch("keybinding-nav-prev",e)},navNext:function(e){this.dispatch("keybinding-nav-next",e)},navLeft:function(e){this.dispatch("keybinding-nav-left",e)},navRight:function(e){this.dispatch("keybinding-nav-right",e)},navUp:function(e){this.dispatch("keybinding-nav-up",e)},navDown:function(e){this.dispatch("keybinding-nav-down",e)},undo:function(e){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(e.preventDefault(),this.table.modules.history.undo()))},redo:function(e){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(e.preventDefault(),this.table.modules.history.redo()))},copyToClipboard:function(e){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}};var Fe=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).menuContainer=null,o.nestedMenuBlock=!1,o.currentComponent=null,o.rootPopup=null,o.columnSubscribers={},o.registerTableOption("menuContainer",void 0),o.registerTableOption("rowContextMenu",!1),o.registerTableOption("rowClickMenu",!1),o.registerTableOption("groupContextMenu",!1),o.registerTableOption("groupClickMenu",!1),o.registerColumnOption("headerContextMenu"),o.registerColumnOption("headerClickMenu"),o.registerColumnOption("headerMenu"),o.registerColumnOption("headerMenuIcon"),o.registerColumnOption("contextMenu"),o.registerColumnOption("clickMenu"),o}return o(n,[{key:"initialize",value:function(){this.deprecationCheck(),this.initializeRowWatchers(),this.initializeGroupWatchers(),this.subscribe("column-init",this.initializeColumn.bind(this))}},{key:"deprecationCheck",value:function(){void 0!==this.table.options.menuContainer&&(console.warn("Use of the menuContainer option is now deprecated. Please use the popupContainer option instead"),this.table.options.popupContainer=this.table.options.menuContainer)}},{key:"initializeRowWatchers",value:function(){this.table.options.rowContextMenu&&(this.subscribe("row-contextmenu",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu)),this.table.on("rowTapHold",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu))),this.table.options.rowClickMenu&&this.subscribe("row-click",this.loadMenuEvent.bind(this,this.table.options.rowClickMenu))}},{key:"initializeGroupWatchers",value:function(){this.table.options.groupContextMenu&&(this.subscribe("group-contextmenu",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu)),this.table.on("groupTapHold",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu))),this.table.options.groupClickMenu&&this.subscribe("group-click",this.loadMenuEvent.bind(this,this.table.options.groupClickMenu))}},{key:"initializeColumn",value:function(e){var t=e.definition;t.headerContextMenu&&!this.columnSubscribers.headerContextMenu&&(this.columnSubscribers.headerContextMenu=this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"),this.subscribe("column-contextmenu",this.columnSubscribers.headerContextMenu),this.table.on("headerTapHold",this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"))),t.headerClickMenu&&!this.columnSubscribers.headerClickMenu&&(this.columnSubscribers.headerClickMenu=this.loadMenuTableColumnEvent.bind(this,"headerClickMenu"),this.subscribe("column-click",this.columnSubscribers.headerClickMenu)),t.headerMenu&&this.initializeColumnHeaderMenu(e),t.contextMenu&&!this.columnSubscribers.contextMenu&&(this.columnSubscribers.contextMenu=this.loadMenuTableCellEvent.bind(this,"contextMenu"),this.subscribe("cell-contextmenu",this.columnSubscribers.contextMenu),this.table.on("cellTapHold",this.loadMenuTableCellEvent.bind(this,"contextMenu"))),t.clickMenu&&!this.columnSubscribers.clickMenu&&(this.columnSubscribers.clickMenu=this.loadMenuTableCellEvent.bind(this,"clickMenu"),this.subscribe("cell-click",this.columnSubscribers.clickMenu))}},{key:"initializeColumnHeaderMenu",value:function(e){var t,i=this,n=e.definition.headerMenuIcon;(t=document.createElement("span")).classList.add("tabulator-header-popup-button"),n?("function"==typeof n&&(n=n(e.getComponent())),n instanceof HTMLElement?t.appendChild(n):t.innerHTML=n):t.innerHTML="⋮",t.addEventListener("click",(function(t){t.stopPropagation(),t.preventDefault(),i.loadMenuEvent(e.definition.headerMenu,t,e)})),e.titleElement.insertBefore(t,e.titleElement.firstChild)}},{key:"loadMenuTableCellEvent",value:function(e,t,i){i._cell&&(i=i._cell),i.column.definition[e]&&this.loadMenuEvent(i.column.definition[e],t,i)}},{key:"loadMenuTableColumnEvent",value:function(e,t,i){i._column&&(i=i._column),i.definition[e]&&this.loadMenuEvent(i.definition[e],t,i)}},{key:"loadMenuEvent",value:function(e,t,i){i._group?i=i._group:i._row&&(i=i._row),e="function"==typeof e?e.call(this.table,t,i.getComponent()):e,this.loadMenu(t,i,e)}},{key:"loadMenu",value:function(e,t,i,n,o){var a,r=this,s=!(e instanceof MouseEvent),l=document.createElement("div");if(l.classList.add("tabulator-menu"),s||e.preventDefault(),i&&i.length){if(n)a=o.child(l);else{if(this.nestedMenuBlock){if(this.rootPopup)return}else this.nestedMenuBlock=setTimeout((function(){r.nestedMenuBlock=!1}),100);this.rootPopup&&this.rootPopup.hide(),this.rootPopup=a=this.popup(l)}i.forEach((function(e){var i=document.createElement("div"),n=e.label,o=e.disabled;e.separator?i.classList.add("tabulator-menu-separator"):(i.classList.add("tabulator-menu-item"),"function"==typeof n&&(n=n.call(r.table,t.getComponent())),n instanceof Node?i.appendChild(n):i.innerHTML=n,"function"==typeof o&&(o=o.call(r.table,t.getComponent())),o?(i.classList.add("tabulator-menu-item-disabled"),i.addEventListener("click",(function(e){e.stopPropagation()}))):e.menu&&e.menu.length?i.addEventListener("click",(function(n){n.stopPropagation(),r.loadMenu(n,t,e.menu,i,a)})):e.action&&i.addEventListener("click",(function(i){e.action(i,t.getComponent())})),e.menu&&e.menu.length&&i.classList.add("tabulator-menu-item-submenu")),l.appendChild(i)})),l.addEventListener("click",(function(e){r.rootPopup.hide()})),a.show(n||e),a===this.rootPopup&&(this.rootPopup.hideOnBlur((function(){r.rootPopup=null,r.currentComponent&&(r.dispatchExternal("menuClosed",r.currentComponent.getComponent()),r.currentComponent=null)})),this.currentComponent=t,this.dispatchExternal("menuOpened",t.getComponent()))}}}]),n}(V);Fe.moduleName="menu";var He=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).placeholderElement=o.createPlaceholderElement(),o.hoverElement=!1,o.checkTimeout=!1,o.checkPeriod=250,o.moving=!1,o.toCol=!1,o.toColAfter=!1,o.startX=0,o.autoScrollMargin=40,o.autoScrollStep=5,o.autoScrollTimeout=!1,o.touchMove=!1,o.moveHover=o.moveHover.bind(l(o)),o.endMove=o.endMove.bind(l(o)),o.registerTableOption("movableColumns",!1),o}return o(n,[{key:"createPlaceholderElement",value:function(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.classList.add("tabulator-col-placeholder"),e}},{key:"initialize",value:function(){this.table.options.movableColumns&&this.subscribe("column-init",this.initializeColumn.bind(this))}},{key:"initializeColumn",value:function(e){var t,i=this,n={};e.modules.frozen||e.isGroup||(t=e.getElement(),n.mousemove=function(n){e.parent===i.moving.parent&&((i.touchMove?n.touches[0].pageX:n.pageX)-k.elOffset(t).left+i.table.columnManager.element.scrollLeft>e.getWidth()/2?i.toCol===e&&i.toColAfter||(t.parentNode.insertBefore(i.placeholderElement,t.nextSibling),i.moveColumn(e,!0)):(i.toCol!==e||i.toColAfter)&&(t.parentNode.insertBefore(i.placeholderElement,t),i.moveColumn(e,!1)))}.bind(i),t.addEventListener("mousedown",(function(t){i.touchMove=!1,1===t.which&&(i.checkTimeout=setTimeout((function(){i.startMove(t,e)}),i.checkPeriod))})),t.addEventListener("mouseup",(function(e){1===e.which&&i.checkTimeout&&clearTimeout(i.checkTimeout)})),i.bindTouchEvents(e)),e.modules.moveColumn=n}},{key:"bindTouchEvents",value:function(e){var t,i,n,o,a,r,s=this,l=e.getElement(),u=!1;l.addEventListener("touchstart",(function(l){s.checkTimeout=setTimeout((function(){s.touchMove=!0,t=e.nextColumn(),n=t?t.getWidth()/2:0,i=e.prevColumn(),o=i?i.getWidth()/2:0,a=0,r=0,u=!1,s.startMove(l,e)}),s.checkPeriod)}),{passive:!0}),l.addEventListener("touchmove",(function(l){var c,h;s.moving&&(s.moveHover(l),u||(u=l.touches[0].pageX),(c=l.touches[0].pageX-u)>0?t&&c-a>n&&(h=t)!==e&&(u=l.touches[0].pageX,h.getElement().parentNode.insertBefore(s.placeholderElement,h.getElement().nextSibling),s.moveColumn(h,!0)):i&&-c-r>o&&(h=i)!==e&&(u=l.touches[0].pageX,h.getElement().parentNode.insertBefore(s.placeholderElement,h.getElement()),s.moveColumn(h,!1)),h&&(t=h.nextColumn(),a=n,n=t?t.getWidth()/2:0,i=h.prevColumn(),r=o,o=i?i.getWidth()/2:0))}),{passive:!0}),l.addEventListener("touchend",(function(e){s.checkTimeout&&clearTimeout(s.checkTimeout),s.moving&&s.endMove(e)}))}},{key:"startMove",value:function(e,t){var i=t.getElement(),n=this.table.columnManager.getElement(),o=this.table.columnManager.getHeadersElement();this.moving=t,this.startX=(this.touchMove?e.touches[0].pageX:e.pageX)-k.elOffset(i).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",i.parentNode.insertBefore(this.placeholderElement,i),i.parentNode.removeChild(i),this.hoverElement=i.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.table.columnManager.getElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.bottom=n.clientHeight-o.offsetHeight+"px",this.touchMove||(this._bindMouseMove(),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove)),this.moveHover(e)}},{key:"_bindMouseMove",value:function(){this.table.columnManager.columnsByIndex.forEach((function(e){e.modules.moveColumn.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveColumn.mousemove)}))}},{key:"_unbindMouseMove",value:function(){this.table.columnManager.columnsByIndex.forEach((function(e){e.modules.moveColumn.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveColumn.mousemove)}))}},{key:"moveColumn",value:function(e,t){var i=this.moving.getCells();this.toCol=e,this.toColAfter=t,t?e.getCells().forEach((function(e,t){var n=e.getElement(!0);n.parentNode&&i[t]&&n.parentNode.insertBefore(i[t].getElement(),n.nextSibling)})):e.getCells().forEach((function(e,t){var n=e.getElement(!0);n.parentNode&&i[t]&&n.parentNode.insertBefore(i[t].getElement(),n)}))}},{key:"endMove",value:function(e){(1===e.which||this.touchMove)&&(this._unbindMouseMove(),this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toCol&&this.table.columnManager.moveColumnActual(this.moving,this.toCol,this.toColAfter),this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.touchMove||(document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove)))}},{key:"moveHover",value:function(e){var t,i=this,n=this.table.columnManager.getElement(),o=n.scrollLeft,a=(this.touchMove?e.touches[0].pageX:e.pageX)-k.elOffset(n).left+o;this.hoverElement.style.left=a-this.startX+"px",a-oe.getHeight()/2?t.toRow===e&&t.toRowAfter||((n=e.getElement()).parentNode.insertBefore(t.placeholderElement,n.nextSibling),t.moveRow(e,!0)):(t.toRow!==e||t.toRowAfter)&&(n=e.getElement()).previousSibling&&(n.parentNode.insertBefore(t.placeholderElement,n),t.moveRow(e,!1))}.bind(t),e.modules.moveRow=i}},{key:"initializeRow",value:function(e){var t,i=this,n={};n.mouseup=function(t){i.tableRowDrop(t,e)}.bind(i),n.mousemove=function(t){var n=e.getElement();t.pageY-k.elOffset(n).top+i.table.rowManager.element.scrollTop>e.getHeight()/2?i.toRow===e&&i.toRowAfter||(n.parentNode.insertBefore(i.placeholderElement,n.nextSibling),i.moveRow(e,!0)):(i.toRow!==e||i.toRowAfter)&&(n.parentNode.insertBefore(i.placeholderElement,n),i.moveRow(e,!1))}.bind(i),this.hasHandle||((t=e.getElement()).addEventListener("mousedown",(function(t){1===t.which&&(i.checkTimeout=setTimeout((function(){i.startMove(t,e)}),i.checkPeriod))})),t.addEventListener("mouseup",(function(e){1===e.which&&i.checkTimeout&&clearTimeout(i.checkTimeout)})),this.bindTouchEvents(e,e.getElement())),e.modules.moveRow=n}},{key:"initializeColumn",value:function(e){e.definition.rowHandle&&!1!==this.table.options.movableRows&&(this.hasHandle=!0)}},{key:"initializeCell",value:function(e){if(e.column.definition.rowHandle&&!1!==this.table.options.movableRows){var t=this,i=e.getElement(!0);i.addEventListener("mousedown",(function(i){1===i.which&&(t.checkTimeout=setTimeout((function(){t.startMove(i,e.row)}),t.checkPeriod))})),i.addEventListener("mouseup",(function(e){1===e.which&&t.checkTimeout&&clearTimeout(t.checkTimeout)})),this.bindTouchEvents(e.row,i)}}},{key:"bindTouchEvents",value:function(e,t){var i,n,o,a,r,s,l=this,u=!1;t.addEventListener("touchstart",(function(t){l.checkTimeout=setTimeout((function(){l.touchMove=!0,i=e.nextRow(),o=i?i.getHeight()/2:0,n=e.prevRow(),a=n?n.getHeight()/2:0,r=0,s=0,u=!1,l.startMove(t,e)}),l.checkPeriod)}),{passive:!0}),this.moving,this.toRow,this.toRowAfter,t.addEventListener("touchmove",(function(t){var c,h;l.moving&&(t.preventDefault(),l.moveHover(t),u||(u=t.touches[0].pageY),(c=t.touches[0].pageY-u)>0?i&&c-r>o&&(h=i)!==e&&(u=t.touches[0].pageY,h.getElement().parentNode.insertBefore(l.placeholderElement,h.getElement().nextSibling),l.moveRow(h,!0)):n&&-c-s>a&&(h=n)!==e&&(u=t.touches[0].pageY,h.getElement().parentNode.insertBefore(l.placeholderElement,h.getElement()),l.moveRow(h,!1)),h&&(i=h.nextRow(),r=o,o=i?i.getHeight()/2:0,n=h.prevRow(),s=a,a=n?n.getHeight()/2:0))})),t.addEventListener("touchend",(function(e){l.checkTimeout&&clearTimeout(l.checkTimeout),l.moving&&(l.endMove(e),l.touchMove=!1)}))}},{key:"_bindMouseMove",value:function(){this.table.rowManager.getDisplayRows().forEach((function(e){("row"===e.type||"group"===e.type)&&e.modules.moveRow&&e.modules.moveRow.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveRow.mousemove)}))}},{key:"_unbindMouseMove",value:function(){this.table.rowManager.getDisplayRows().forEach((function(e){("row"===e.type||"group"===e.type)&&e.modules.moveRow&&e.modules.moveRow.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveRow.mousemove)}))}},{key:"startMove",value:function(e,t){var i=t.getElement();this.setStartPosition(e,t),this.moving=t,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",this.connection?(this.table.element.classList.add("tabulator-movingrow-sending"),this.connectToTables(t)):(i.parentNode.insertBefore(this.placeholderElement,i),i.parentNode.removeChild(i)),this.hoverElement=i.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.connection?(document.body.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this.hoverElement.style.width=this.table.element.clientWidth+"px",this.hoverElement.style.whiteSpace="nowrap",this.hoverElement.style.overflow="hidden",this.hoverElement.style.pointerEvents="none"):(this.table.rowManager.getTableElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this._bindMouseMove()),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove),this.dispatchExternal("rowMoving",t.getComponent()),this.moveHover(e)}},{key:"setStartPosition",value:function(e,t){var i,n,o=this.touchMove?e.touches[0].pageX:e.pageX,a=this.touchMove?e.touches[0].pageY:e.pageY;i=t.getElement(),this.connection?(n=i.getBoundingClientRect(),this.startX=n.left-o+window.pageXOffset,this.startY=n.top-a+window.pageYOffset):this.startY=a-i.getBoundingClientRect().top}},{key:"endMove",value:function(e){e&&1!==e.which&&!this.touchMove||(this._unbindMouseMove(),this.connection||(this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement)),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toRow?this.table.rowManager.moveRow(this.moving,this.toRow,this.toRowAfter):this.dispatchExternal("rowMoveCancelled",this.moving.getComponent()),this.moving=!1,this.toRow=!1,this.toRowAfter=!1,document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove),this.connection&&(this.table.element.classList.remove("tabulator-movingrow-sending"),this.disconnectFromTables()))}},{key:"moveRow",value:function(e,t){this.toRow=e,this.toRowAfter=t}},{key:"moveHover",value:function(e){this.connection?this.moveHoverConnections.call(this,e):this.moveHoverTable.call(this,e)}},{key:"moveHoverTable",value:function(e){var t=this.table.rowManager.getElement(),i=t.scrollTop,n=(this.touchMove?e.touches[0].pageY:e.pageY)-t.getBoundingClientRect().top+i;this.hoverElement.style.top=n-this.startY+"px"}},{key:"moveHoverConnections",value:function(e){this.hoverElement.style.left=this.startX+(this.touchMove?e.touches[0].pageX:e.pageX)+"px",this.hoverElement.style.top=this.startY+(this.touchMove?e.touches[0].pageY:e.pageY)+"px"}},{key:"elementRowDrop",value:function(e,t,i){this.dispatchExternal("movableRowsElementDrop",e,t,!!i&&i.getComponent())}},{key:"connectToTables",value:function(e){var t,i=this;this.connectionSelectorsTables&&(t=this.commsConnections(this.connectionSelectorsTables),this.dispatchExternal("movableRowsSendingStart",t),this.commsSend(this.connectionSelectorsTables,"moveRow","connect",{row:e})),this.connectionSelectorsElements&&(this.connectionElements=[],Array.isArray(this.connectionSelectorsElements)||(this.connectionSelectorsElements=[this.connectionSelectorsElements]),this.connectionSelectorsElements.forEach((function(e){"string"==typeof e?i.connectionElements=i.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(e))):i.connectionElements.push(e)})),this.connectionElements.forEach((function(e){var t=function(t){i.elementRowDrop(t,e,i.moving)};e.addEventListener("mouseup",t),e.tabulatorElementDropEvent=t,e.classList.add("tabulator-movingrow-receiving")})))}},{key:"disconnectFromTables",value:function(){var e;this.connectionSelectorsTables&&(e=this.commsConnections(this.connectionSelectorsTables),this.dispatchExternal("movableRowsSendingStop",e),this.commsSend(this.connectionSelectorsTables,"moveRow","disconnect")),this.connectionElements.forEach((function(e){e.classList.remove("tabulator-movingrow-receiving"),e.removeEventListener("mouseup",e.tabulatorElementDropEvent),delete e.tabulatorElementDropEvent}))}},{key:"connect",value:function(e,t){return this.connectedTable?(console.warn("Move Row Error - Table cannot accept connection, already connected to table:",this.connectedTable),!1):(this.connectedTable=e,this.connectedRow=t,this.table.element.classList.add("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach((function(e){"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().addEventListener("mouseup",e.modules.moveRow.mouseup)})),this.tableRowDropEvent=this.tableRowDrop.bind(this),this.table.element.addEventListener("mouseup",this.tableRowDropEvent),this.dispatchExternal("movableRowsReceivingStart",t,e),!0)}},{key:"disconnect",value:function(e){e===this.connectedTable?(this.connectedTable=!1,this.connectedRow=!1,this.table.element.classList.remove("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach((function(e){"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().removeEventListener("mouseup",e.modules.moveRow.mouseup)})),this.table.element.removeEventListener("mouseup",this.tableRowDropEvent),this.dispatchExternal("movableRowsReceivingStop",e)):console.warn("Move Row Error - trying to disconnect from non connected table")}},{key:"dropComplete",value:function(t,i,n){var o=!1;if(n){switch(e(this.table.options.movableRowsSender)){case"string":o=this.senders[this.table.options.movableRowsSender];break;case"function":o=this.table.options.movableRowsSender}o?o.call(this,this.moving.getComponent(),i?i.getComponent():void 0,t):this.table.options.movableRowsSender&&console.warn("Mover Row Error - no matching sender found:",this.table.options.movableRowsSender),this.dispatchExternal("movableRowsSent",this.moving.getComponent(),i?i.getComponent():void 0,t)}else this.dispatchExternal("movableRowsSentFailed",this.moving.getComponent(),i?i.getComponent():void 0,t);this.endMove()}},{key:"tableRowDrop",value:function(t,i){var n=!1,o=!1;switch(t.stopImmediatePropagation(),e(this.table.options.movableRowsReceiver)){case"string":n=this.receivers[this.table.options.movableRowsReceiver];break;case"function":n=this.table.options.movableRowsReceiver}n?o=n.call(this,this.connectedRow.getComponent(),i?i.getComponent():void 0,this.connectedTable):console.warn("Mover Row Error - no matching receiver found:",this.table.options.movableRowsReceiver),o?this.dispatchExternal("movableRowsReceived",this.connectedRow.getComponent(),i?i.getComponent():void 0,this.connectedTable):this.dispatchExternal("movableRowsReceivedFailed",this.connectedRow.getComponent(),i?i.getComponent():void 0,this.connectedTable),this.commsSend(this.connectedTable,"moveRow","dropcomplete",{row:i,success:o})}},{key:"commsReceived",value:function(e,t,i){switch(t){case"connect":return this.connect(e,i.row);case"disconnect":return this.disconnect(e);case"dropcomplete":return this.dropComplete(e,i.row,i.success)}}}]),r}(V);_e.prototype.receivers={insert:function(e,t,i){return this.table.addRow(e.getData(),void 0,t),!0},add:function(e,t,i){return this.table.addRow(e.getData()),!0},update:function(e,t,i){return!!t&&(t.update(e.getData()),!0)},replace:function(e,t,i){return!!t&&(this.table.addRow(e.getData(),void 0,t),t.delete(),!0)}},_e.prototype.senders={delete:function(e,t,i){e.delete()}},_e.moduleName="moveRow";var Oe=function(i){a(r,i);var n=c(r);function r(e){var i;return t(this,r),(i=n.call(this,e)).allowedTypes=["","data","edit","clipboard"],i.enabled=!0,i.registerColumnOption("mutator"),i.registerColumnOption("mutatorParams"),i.registerColumnOption("mutatorData"),i.registerColumnOption("mutatorDataParams"),i.registerColumnOption("mutatorEdit"),i.registerColumnOption("mutatorEditParams"),i.registerColumnOption("mutatorClipboard"),i.registerColumnOption("mutatorClipboardParams"),i.registerColumnOption("mutateLink"),i}return o(r,[{key:"initialize",value:function(){this.subscribe("cell-value-changing",this.transformCell.bind(this)),this.subscribe("cell-value-changed",this.mutateLink.bind(this)),this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-init-before",this.rowDataChanged.bind(this)),this.subscribe("row-data-changing",this.rowDataChanged.bind(this))}},{key:"rowDataChanged",value:function(e,t,i){return this.transformRow(t,"data",i)}},{key:"initializeColumn",value:function(e){var t=this,i=!1,n={};this.allowedTypes.forEach((function(o){var a,r="mutator"+(o.charAt(0).toUpperCase()+o.slice(1));e.definition[r]&&(a=t.lookupMutator(e.definition[r]))&&(i=!0,n[r]={mutator:a,params:e.definition[r+"Params"]||{}})})),i&&(e.modules.mutate=n)}},{key:"lookupMutator",value:function(t){var i=!1;switch(e(t)){case"string":r.mutators[t]?i=r.mutators[t]:console.warn("Mutator Error - No such mutator found, ignoring: ",t);break;case"function":i=t}return i}},{key:"transformRow",value:function(e,t,i){var n,o="mutator"+(t.charAt(0).toUpperCase()+t.slice(1));return this.enabled&&this.table.columnManager.traverse((function(a){var r,s,l;a.modules.mutate&&(r=a.modules.mutate[o]||a.modules.mutate.mutator||!1)&&(n=a.getFieldValue(void 0!==i?i:e),"data"!=t&&void 0===n||(l=a.getComponent(),s="function"==typeof r.params?r.params(n,e,t,l):r.params,a.setFieldValue(e,r.mutator(n,e,t,s,l))))})),e}},{key:"transformCell",value:function(e,t){if(e.column.modules.mutate){var i=e.column.modules.mutate.mutatorEdit||e.column.modules.mutate.mutator||!1,n={};if(i)return n=Object.assign(n,e.row.getData()),e.column.setFieldValue(n,t),i.mutator(t,n,"edit",i.params,e.getComponent())}return t}},{key:"mutateLink",value:function(e){var t=e.column.definition.mutateLink;t&&(Array.isArray(t)||(t=[t]),t.forEach((function(t){var i=e.row.getCell(t);i&&i.setValue(i.getValue(),!0,!0)})))}},{key:"enable",value:function(){this.enabled=!0}},{key:"disable",value:function(){this.enabled=!1}}]),r}(V);Oe.moduleName="mutator",Oe.mutators={};var Ae={rows:function(e,t,i,n,o){var a=document.createElement("span"),r=document.createElement("span"),s=document.createElement("span"),l=document.createElement("span"),u=document.createElement("span"),c=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",(function(e){r.innerHTML=e})),this.table.modules.localize.langBind("pagination|counter|of",(function(e){l.innerHTML=e})),this.table.modules.localize.langBind("pagination|counter|rows",(function(e){c.innerHTML=e})),n?(s.innerHTML=" "+t+"-"+Math.min(t+e-1,n)+" ",u.innerHTML=" "+n+" ",a.appendChild(r),a.appendChild(s),a.appendChild(l),a.appendChild(u),a.appendChild(c)):(s.innerHTML=" 0 ",a.appendChild(r),a.appendChild(s),a.appendChild(c)),a},pages:function(e,t,i,n,o){var a=document.createElement("span"),r=document.createElement("span"),s=document.createElement("span"),l=document.createElement("span"),u=document.createElement("span"),c=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",(function(e){r.innerHTML=e})),s.innerHTML=" "+i+" ",this.table.modules.localize.langBind("pagination|counter|of",(function(e){l.innerHTML=e})),u.innerHTML=" "+o+" ",this.table.modules.localize.langBind("pagination|counter|pages",(function(e){c.innerHTML=e})),a.appendChild(r),a.appendChild(s),a.appendChild(l),a.appendChild(u),a.appendChild(c),a}},Be=function(i){a(r,i);var n=c(r);function r(e){var i;return t(this,r),(i=n.call(this,e)).mode="local",i.progressiveLoad=!1,i.element=null,i.pageCounterElement=null,i.pageCounter=null,i.size=0,i.page=1,i.count=5,i.max=1,i.remoteRowCountEstimate=null,i.displayIndex=0,i.initialLoad=!0,i.dataChanging=!1,i.pageSizes=[],i.registerTableOption("pagination",!1),i.registerTableOption("paginationMode","local"),i.registerTableOption("paginationSize",!1),i.registerTableOption("paginationInitialPage",1),i.registerTableOption("paginationCounter",!1),i.registerTableOption("paginationCounterElement",!1),i.registerTableOption("paginationButtonCount",5),i.registerTableOption("paginationSizeSelector",!1),i.registerTableOption("paginationElement",!1),i.registerTableOption("paginationAddRow","page"),i.registerTableOption("progressiveLoad",!1),i.registerTableOption("progressiveLoadDelay",0),i.registerTableOption("progressiveLoadScrollMargin",0),i.registerTableFunction("setMaxPage",i.setMaxPage.bind(l(i))),i.registerTableFunction("setPage",i.setPage.bind(l(i))),i.registerTableFunction("setPageToRow",i.userSetPageToRow.bind(l(i))),i.registerTableFunction("setPageSize",i.userSetPageSize.bind(l(i))),i.registerTableFunction("getPageSize",i.getPageSize.bind(l(i))),i.registerTableFunction("previousPage",i.previousPage.bind(l(i))),i.registerTableFunction("nextPage",i.nextPage.bind(l(i))),i.registerTableFunction("getPage",i.getPage.bind(l(i))),i.registerTableFunction("getPageMax",i.getPageMax.bind(l(i))),i.registerComponentFunction("row","pageTo",i.setPageToRow.bind(l(i))),i}return o(r,[{key:"initialize",value:function(){this.table.options.pagination?(this.subscribe("row-deleted",this.rowsUpdated.bind(this)),this.subscribe("row-added",this.rowsUpdated.bind(this)),this.subscribe("data-processed",this.initialLoadComplete.bind(this)),this.subscribe("table-built",this.calculatePageSizes.bind(this)),this.subscribe("footer-redraw",this.footerRedraw.bind(this)),"page"==this.table.options.paginationAddRow&&this.subscribe("row-adding-position",this.rowAddingPosition.bind(this)),"remote"===this.table.options.paginationMode&&(this.subscribe("data-params",this.remotePageParams.bind(this)),this.subscribe("data-loaded",this._parseRemoteData.bind(this))),this.table.options.progressiveLoad&&console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time"),this.registerDisplayHandler(this.restOnRenderBefore.bind(this),40),this.registerDisplayHandler(this.getRows.bind(this),50),this.createElements(),this.initializePageCounter(),this.initializePaginator()):this.table.options.progressiveLoad&&(this.subscribe("data-params",this.remotePageParams.bind(this)),this.subscribe("data-loaded",this._parseRemoteData.bind(this)),this.subscribe("table-built",this.calculatePageSizes.bind(this)),this.subscribe("data-processed",this.initialLoadComplete.bind(this)),this.initializeProgressive(this.table.options.progressiveLoad),"scroll"===this.table.options.progressiveLoad&&this.subscribe("scroll-vertical",this.scrollVertical.bind(this)))}},{key:"rowAddingPosition",value:function(e,t){var i,n=this.table.rowManager,o=n.getDisplayRows();return t?o.length?i=o[0]:n.activeRows.length&&(i=n.activeRows[n.activeRows.length-1],t=!1):o.length&&(i=o[o.length-1],t=!(o.lengththis.max&&(this.page=this.max)}},{key:"reset",value:function(e){this.initialLoad||("local"==this.mode||e)&&(this.page=1)}},{key:"setMaxPage",value:function(e){e=parseInt(e),this.max=e||1,this.page>this.max&&(this.page=this.max,this.trigger())}},{key:"setPage",value:function(e){switch(e){case"first":return this.setPage(1);case"prev":return this.previousPage();case"next":return this.nextPage();case"last":return this.setPage(this.max)}return(e=parseInt(e))>0&&e<=this.max||"local"!==this.mode?(this.page=e,this.trackChanges(),this.trigger()):(console.warn("Pagination Error - Requested page is out of range of 1 - "+this.max+":",e),Promise.reject())}},{key:"setPageToRow",value:function(e){var t=this.table.rowManager.getDisplayRows(this.displayIndex-1).indexOf(e);if(t>-1){var i=!0===this.size?1:Math.ceil((t+1)/this.size);return this.setPage(i)}return console.warn("Pagination Error - Requested row is not visible"),Promise.reject()}},{key:"setPageSize",value:function(e){!0!==e&&(e=parseInt(e)),e>0&&(this.size=e,this.dispatchExternal("pageSizeChanged",e)),this.pageSizeSelect&&this.generatePageSizeSelectList(),this.trackChanges()}},{key:"_setPageCounter",value:function(t,i,n){var o;if(this.pageCounter)switch("remote"===this.mode&&(i=this.size,n=(this.page-1)*this.size+1,t=this.remoteRowCountEstimate),e(o=this.pageCounter.call(this,i,n,this.page,t,this.max))){case"object":if(o instanceof Node){for(;this.pageCounterElement.firstChild;)this.pageCounterElement.removeChild(this.pageCounterElement.firstChild);this.pageCounterElement.appendChild(o)}else this.pageCounterElement.innerHTML="",null!=o&&console.warn("Page Counter Error - Page Counter has returned a type of object, the only valid page counter object return is an instance of Node, the page counter returned:",o);break;case"undefined":case"null":this.pageCounterElement.innerHTML="";break;default:this.pageCounterElement.innerHTML=o}}},{key:"_setPageButtons",value:function(){for(var e=Math.floor((this.count-1)/2),t=Math.ceil((this.count-1)/2),i=this.max-this.page+e+10&&o<=this.max&&this.pagesElement.appendChild(this._generatePageButton(o));this.footerRedraw()}},{key:"_generatePageButton",value:function(e){var t=this,i=document.createElement("button");return i.classList.add("tabulator-page"),e==this.page&&i.classList.add("active"),i.setAttribute("type","button"),i.setAttribute("role","button"),this.langBind("pagination|page_title",(function(t){i.setAttribute("aria-label",t+" "+e),i.setAttribute("title",t+" "+e)})),i.setAttribute("data-page",e),i.textContent=e,i.addEventListener("click",(function(i){t.setPage(e)})),i}},{key:"previousPage",value:function(){return this.page>1?(this.page--,this.trackChanges(),this.trigger()):(console.warn("Pagination Error - Previous page would be less than page 1:",0),Promise.reject())}},{key:"nextPage",value:function(){return this.page-1&&(o=o.slice(r),(i=o.indexOf(";"))>-1&&(o=o.slice(0,i)),n=o.replace(a+"=","")),!!n&&JSON.parse(n)}},Ne={local:function(e,t,i){localStorage.setItem(e+"-"+t,JSON.stringify(i))},cookie:function(e,t,i){var n=new Date;n.setDate(n.getDate()+1e4),document.cookie=e+"-"+t+"="+JSON.stringify(i)+"; expires="+n.toUTCString()}},Ve=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).mode="",o.id="",o.defWatcherBlock=!1,o.config={},o.readFunc=!1,o.writeFunc=!1,o.registerTableOption("persistence",!1),o.registerTableOption("persistenceID",""),o.registerTableOption("persistenceMode",!0),o.registerTableOption("persistenceReaderFunc",!1),o.registerTableOption("persistenceWriterFunc",!1),o}return o(n,[{key:"localStorageTest",value:function(){var e="_tabulator_test";try{return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}}},{key:"initialize",value:function(){if(this.table.options.persistence){var e,t=this.table.options.persistenceMode,i=this.table.options.persistenceID;this.mode=!0!==t?t:this.localStorageTest()?"local":"cookie",this.table.options.persistenceReaderFunc?"function"==typeof this.table.options.persistenceReaderFunc?this.readFunc=this.table.options.persistenceReaderFunc:n.readers[this.table.options.persistenceReaderFunc]?this.readFunc=n.readers[this.table.options.persistenceReaderFunc]:console.warn("Persistence Read Error - invalid reader set",this.table.options.persistenceReaderFunc):n.readers[this.mode]?this.readFunc=n.readers[this.mode]:console.warn("Persistence Read Error - invalid reader set",this.mode),this.table.options.persistenceWriterFunc?"function"==typeof this.table.options.persistenceWriterFunc?this.writeFunc=this.table.options.persistenceWriterFunc:n.writers[this.table.options.persistenceWriterFunc]?this.writeFunc=n.writers[this.table.options.persistenceWriterFunc]:console.warn("Persistence Write Error - invalid reader set",this.table.options.persistenceWriterFunc):n.writers[this.mode]?this.writeFunc=n.writers[this.mode]:console.warn("Persistence Write Error - invalid writer set",this.mode),this.id="tabulator-"+(i||this.table.element.getAttribute("id")||""),this.config={sort:!0===this.table.options.persistence||this.table.options.persistence.sort,filter:!0===this.table.options.persistence||this.table.options.persistence.filter,group:!0===this.table.options.persistence||this.table.options.persistence.group,page:!0===this.table.options.persistence||this.table.options.persistence.page,columns:!0===this.table.options.persistence?["title","width","visible"]:this.table.options.persistence.columns},this.config.page&&(e=this.retreiveData("page"))&&(void 0===e.paginationSize||!0!==this.config.page&&!this.config.page.size||(this.table.options.paginationSize=e.paginationSize),void 0===e.paginationInitialPage||!0!==this.config.page&&!this.config.page.page||(this.table.options.paginationInitialPage=e.paginationInitialPage)),this.config.group&&(e=this.retreiveData("group"))&&(void 0===e.groupBy||!0!==this.config.group&&!this.config.group.groupBy||(this.table.options.groupBy=e.groupBy),void 0===e.groupStartOpen||!0!==this.config.group&&!this.config.group.groupStartOpen||(this.table.options.groupStartOpen=e.groupStartOpen),void 0===e.groupHeader||!0!==this.config.group&&!this.config.group.groupHeader||(this.table.options.groupHeader=e.groupHeader)),this.config.columns&&(this.table.options.columns=this.load("columns",this.table.options.columns),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-show",this.save.bind(this,"columns")),this.subscribe("column-hide",this.save.bind(this,"columns")),this.subscribe("column-moved",this.save.bind(this,"columns"))),this.subscribe("table-built",this.tableBuilt.bind(this),0),this.subscribe("table-redraw",this.tableRedraw.bind(this)),this.subscribe("filter-changed",this.eventSave.bind(this,"filter")),this.subscribe("sort-changed",this.eventSave.bind(this,"sort")),this.subscribe("group-changed",this.eventSave.bind(this,"group")),this.subscribe("page-changed",this.eventSave.bind(this,"page")),this.subscribe("column-resized",this.eventSave.bind(this,"columns")),this.subscribe("layout-refreshed",this.eventSave.bind(this,"columns"))}this.registerTableFunction("getColumnLayout",this.getColumnLayout.bind(this)),this.registerTableFunction("setColumnLayout",this.setColumnLayout.bind(this))}},{key:"eventSave",value:function(e){this.config[e]&&this.save(e)}},{key:"tableBuilt",value:function(){var e,t;this.table.options;this.config.sort&&!1==!(e=this.load("sort"))&&(this.table.options.initialSort=e),this.config.filter&&!1==!(t=this.load("filter"))&&(this.table.options.initialFilter=t)}},{key:"tableRedraw",value:function(e){e&&this.config.columns&&this.save("columns")}},{key:"getColumnLayout",value:function(){return this.parseColumns(this.table.columnManager.getColumns())}},{key:"setColumnLayout",value:function(e){return this.table.columnManager.setColumns(this.mergeDefinition(this.table.options.columns,e)),!0}},{key:"initializeColumn",value:function(e){var t;this.config.columns&&(this.defWatcherBlock=!0,t=e.getDefinition(),(!0===this.config.columns?Object.keys(t):this.config.columns).forEach((function(e){var i=Object.getOwnPropertyDescriptor(t,e),n=t[e];i&&Object.defineProperty(t,e,{set:function(e){n=e,this.defWatcherBlock||this.save("columns"),i.set&&i.set(e)},get:function(){return i.get&&i.get(),n}})})),this.defWatcherBlock=!1)}},{key:"load",value:function(e,t){var i=this.retreiveData(e);return t&&(i=i?this.mergeDefinition(t,i):t),i}},{key:"retreiveData",value:function(e){return!!this.readFunc&&this.readFunc(this.id,e)}},{key:"mergeDefinition",value:function(e,t){var i=this,n=[];return(t=t||[]).forEach((function(t,o){var a,r=i._findColumn(e,t);r&&(!0===i.config.columns||null==i.config.columns?(a=Object.keys(r)).push("width"):a=i.config.columns,a.forEach((function(e){"columns"!==e&&void 0!==t[e]&&(r[e]=t[e])})),r.columns&&(r.columns=i.mergeDefinition(r.columns,t.columns)),n.push(r))})),e.forEach((function(e,o){i._findColumn(t,e)||(n.length>o?n.splice(o,0,e):n.push(e))})),n}},{key:"_findColumn",value:function(e,t){var i=t.columns?"group":t.field?"field":"object";return e.find((function(e){switch(i){case"group":return e.title===t.title&&e.columns.length===t.columns.length;case"field":return e.field===t.field;case"object":return e===t}}))}},{key:"save",value:function(e){var t={};switch(e){case"columns":t=this.parseColumns(this.table.columnManager.getColumns());break;case"filter":t=this.table.modules.filter.getFilters();break;case"sort":t=this.validateSorters(this.table.modules.sort.getSort());break;case"group":t=this.getGroupConfig();break;case"page":t=this.getPageConfig()}this.writeFunc&&this.writeFunc(this.id,e,t)}},{key:"validateSorters",value:function(e){return e.forEach((function(e){e.column=e.field,delete e.field})),e}},{key:"getGroupConfig",value:function(){var e={};return this.config.group&&((!0===this.config.group||this.config.group.groupBy)&&(e.groupBy=this.table.options.groupBy),(!0===this.config.group||this.config.group.groupStartOpen)&&(e.groupStartOpen=this.table.options.groupStartOpen),(!0===this.config.group||this.config.group.groupHeader)&&(e.groupHeader=this.table.options.groupHeader)),e}},{key:"getPageConfig",value:function(){var e={};return this.config.page&&((!0===this.config.page||this.config.page.size)&&(e.paginationSize=this.table.modules.page.getPageSize()),(!0===this.config.page||this.config.page.page)&&(e.paginationInitialPage=this.table.modules.page.getPage())),e}},{key:"parseColumns",value:function(e){var t=this,i=[],n=["headerContextMenu","headerMenu","contextMenu","clickMenu"];return e.forEach((function(e){var o,a={},r=e.getDefinition();e.isGroup?(a.title=r.title,a.columns=t.parseColumns(e.getColumns())):(a.field=e.getField(),!0===t.config.columns||null==t.config.columns?((o=Object.keys(r)).push("width"),o.push("visible")):o=t.config.columns,o.forEach((function(t){switch(t){case"width":a.width=e.getWidth();break;case"visible":a.visible=e.visible;break;default:"function"!=typeof r[t]&&-1===n.indexOf(t)&&(a[t]=r[t])}}))),i.push(a)})),i}}]),n}(V);Ve.moduleName="persistence",Ve.moduleInitOrder=-10,Ve.readers=Ie,Ve.writers=Ne;var We=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).columnSubscribers={},o.registerTableOption("rowContextPopup",!1),o.registerTableOption("rowClickPopup",!1),o.registerTableOption("groupContextPopup",!1),o.registerTableOption("groupClickPopup",!1),o.registerColumnOption("headerContextPopup"),o.registerColumnOption("headerClickPopup"),o.registerColumnOption("headerPopup"),o.registerColumnOption("headerPopupIcon"),o.registerColumnOption("contextPopup"),o.registerColumnOption("clickPopup"),o}return o(n,[{key:"initialize",value:function(){this.initializeRowWatchers(),this.initializeGroupWatchers(),this.subscribe("column-init",this.initializeColumn.bind(this))}},{key:"initializeRowWatchers",value:function(){this.table.options.rowContextPopup&&(this.subscribe("row-contextmenu",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup)),this.table.on("rowTapHold",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup))),this.table.options.rowClickPopup&&this.subscribe("row-click",this.loadPopupEvent.bind(this,this.table.options.rowClickPopup))}},{key:"initializeGroupWatchers",value:function(){this.table.options.groupContextPopup&&(this.subscribe("group-contextmenu",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup)),this.table.on("groupTapHold",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup))),this.table.options.groupClickPopup&&this.subscribe("group-click",this.loadPopupEvent.bind(this,this.table.options.groupClickPopup))}},{key:"initializeColumn",value:function(e){var t=e.definition;t.headerContextPopup&&!this.columnSubscribers.headerContextPopup&&(this.columnSubscribers.headerContextPopup=this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"),this.subscribe("column-contextmenu",this.columnSubscribers.headerContextPopup),this.table.on("headerTapHold",this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"))),t.headerClickPopup&&!this.columnSubscribers.headerClickPopup&&(this.columnSubscribers.headerClickPopup=this.loadPopupTableColumnEvent.bind(this,"headerClickPopup"),this.subscribe("column-click",this.columnSubscribers.headerClickPopup)),t.headerPopup&&this.initializeColumnHeaderPopup(e),t.contextPopup&&!this.columnSubscribers.contextPopup&&(this.columnSubscribers.contextPopup=this.loadPopupTableCellEvent.bind(this,"contextPopup"),this.subscribe("cell-contextmenu",this.columnSubscribers.contextPopup),this.table.on("cellTapHold",this.loadPopupTableCellEvent.bind(this,"contextPopup"))),t.clickPopup&&!this.columnSubscribers.clickPopup&&(this.columnSubscribers.clickPopup=this.loadPopupTableCellEvent.bind(this,"clickPopup"),this.subscribe("cell-click",this.columnSubscribers.clickPopup))}},{key:"initializeColumnHeaderPopup",value:function(e){var t,i=this,n=e.definition.headerPopupIcon;(t=document.createElement("span")).classList.add("tabulator-header-popup-button"),n?("function"==typeof n&&(n=n(e.getComponent())),n instanceof HTMLElement?t.appendChild(n):t.innerHTML=n):t.innerHTML="⋮",t.addEventListener("click",(function(t){t.stopPropagation(),t.preventDefault(),i.loadPopupEvent(e.definition.headerPopup,t,e)})),e.titleElement.insertBefore(t,e.titleElement.firstChild)}},{key:"loadPopupTableCellEvent",value:function(e,t,i){i._cell&&(i=i._cell),i.column.definition[e]&&this.loadPopupEvent(i.column.definition[e],t,i)}},{key:"loadPopupTableColumnEvent",value:function(e,t,i){i._column&&(i=i._column),i.definition[e]&&this.loadPopupEvent(i.definition[e],t,i)}},{key:"loadPopupEvent",value:function(e,t,i){var n;i._group?i=i._group:i._row&&(i=i._row),e="function"==typeof e?e.call(this.table,t,i.getComponent(),(function(e){n=e})):e,this.loadPopup(t,i,e,n)}},{key:"loadPopup",value:function(e,t,i,n){var o,a,r=this,s=!(e instanceof MouseEvent);i instanceof HTMLElement?o=i:(o=document.createElement("div")).innerHTML=i,o.classList.add("tabulator-popup"),o.addEventListener("click",(function(e){e.stopPropagation()})),s||e.preventDefault(),a=this.popup(o),"function"==typeof n&&a.renderCallback(n),a.show(e).hideOnBlur((function(){r.dispatchExternal("popupClosed",t.getComponent())})),this.dispatchExternal("popupOpened",t.getComponent())}}]),n}(V);We.moduleName="popup";var je=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).element=!1,o.manualBlock=!1,o.registerTableOption("printAsHtml",!1),o.registerTableOption("printFormatter",!1),o.registerTableOption("printHeader",!1),o.registerTableOption("printFooter",!1),o.registerTableOption("printStyled",!0),o.registerTableOption("printRowRange","visible"),o.registerTableOption("printConfig",{}),o.registerColumnOption("print"),o.registerColumnOption("titlePrint"),o}return o(n,[{key:"initialize",value:function(){this.table.options.printAsHtml&&(window.addEventListener("beforeprint",this.replaceTable.bind(this)),window.addEventListener("afterprint",this.cleanup.bind(this))),this.registerTableFunction("print",this.printFullscreen.bind(this))}},{key:"replaceTable",value:function(){this.manualBlock||(this.element=document.createElement("div"),this.element.classList.add("tabulator-print-table"),this.element.appendChild(this.table.modules.export.genereateTable(this.table.options.printConfig,this.table.options.printStyled,this.table.options.printRowRange,"print")),this.table.element.style.display="none",this.table.element.parentNode.insertBefore(this.element,this.table.element))}},{key:"cleanup",value:function(){document.body.classList.remove("tabulator-print-fullscreen-hide"),this.element&&this.element.parentNode&&(this.element.parentNode.removeChild(this.element),this.table.element.style.display="")}},{key:"printFullscreen",value:function(e,t,i){var n,o,a=window.scrollX,r=window.scrollY,s=document.createElement("div"),l=document.createElement("div"),u=this.table.modules.export.genereateTable(void 0!==i?i:this.table.options.printConfig,void 0!==t?t:this.table.options.printStyled,e||this.table.options.printRowRange,"print");this.manualBlock=!0,this.element=document.createElement("div"),this.element.classList.add("tabulator-print-fullscreen"),this.table.options.printHeader&&(s.classList.add("tabulator-print-header"),"string"==typeof(n="function"==typeof this.table.options.printHeader?this.table.options.printHeader.call(this.table):this.table.options.printHeader)?s.innerHTML=n:s.appendChild(n),this.element.appendChild(s)),this.element.appendChild(u),this.table.options.printFooter&&(l.classList.add("tabulator-print-footer"),"string"==typeof(o="function"==typeof this.table.options.printFooter?this.table.options.printFooter.call(this.table):this.table.options.printFooter)?l.innerHTML=o:l.appendChild(o),this.element.appendChild(l)),document.body.classList.add("tabulator-print-fullscreen-hide"),document.body.appendChild(this.element),this.table.options.printFormatter&&this.table.options.printFormatter(this.element,u),window.print(),this.cleanup(),window.scrollTo(a,r),this.manualBlock=!1}}]),n}(V);je.moduleName="print";var Ge=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).data=!1,o.blocked=!1,o.origFuncs={},o.currentVersion=0,o.registerTableOption("reactiveData",!1),o}return o(n,[{key:"initialize",value:function(){this.table.options.reactiveData&&(this.subscribe("cell-value-save-before",this.block.bind(this)),this.subscribe("cell-value-save-after",this.unblock.bind(this)),this.subscribe("row-data-save-before",this.block.bind(this)),this.subscribe("row-data-save-after",this.unblock.bind(this)),this.subscribe("row-data-init-after",this.watchRow.bind(this)),this.subscribe("data-processing",this.watchData.bind(this)),this.subscribe("table-destroy",this.unwatchData.bind(this)))}},{key:"watchData",value:function(e){var t,i=this;this.currentVersion++,t=this.currentVersion,this.unwatchData(),this.data=e,this.origFuncs.push=e.push,Object.defineProperty(this.data,"push",{enumerable:!1,configurable:!0,value:function(){var n=Array.from(arguments);return i.blocked||t!==i.currentVersion||n.forEach((function(e){i.table.rowManager.addRowActual(e,!1)})),i.origFuncs.push.apply(e,arguments)}}),this.origFuncs.unshift=e.unshift,Object.defineProperty(this.data,"unshift",{enumerable:!1,configurable:!0,value:function(){var n=Array.from(arguments);return i.blocked||t!==i.currentVersion||n.forEach((function(e){i.table.rowManager.addRowActual(e,!0)})),i.origFuncs.unshift.apply(e,arguments)}}),this.origFuncs.shift=e.shift,Object.defineProperty(this.data,"shift",{enumerable:!1,configurable:!0,value:function(){var n;return i.blocked||t!==i.currentVersion||i.data.length&&(n=i.table.rowManager.getRowFromDataObject(i.data[0]))&&n.deleteActual(),i.origFuncs.shift.call(e)}}),this.origFuncs.pop=e.pop,Object.defineProperty(this.data,"pop",{enumerable:!1,configurable:!0,value:function(){var n;return i.blocked||t!==i.currentVersion||i.data.length&&(n=i.table.rowManager.getRowFromDataObject(i.data[i.data.length-1]))&&n.deleteActual(),i.origFuncs.pop.call(e)}}),this.origFuncs.splice=e.splice,Object.defineProperty(this.data,"splice",{enumerable:!1,configurable:!0,value:function(){var n,o=Array.from(arguments),a=o[0]<0?e.length+o[0]:o[0],r=o[1],s=!!o[2]&&o.slice(2);if(!i.blocked&&t===i.currentVersion){if(s&&((n=!!e[a]&&i.table.rowManager.getRowFromDataObject(e[a]))?s.forEach((function(e){i.table.rowManager.addRowActual(e,!0,n,!0)})):(s=s.slice().reverse()).forEach((function(e){i.table.rowManager.addRowActual(e,!0,!1,!0)}))),0!==r){var l=e.slice(a,void 0===o[1]?o[1]:a+r);l.forEach((function(e,t){var n=i.table.rowManager.getRowFromDataObject(e);n&&n.deleteActual(t!==l.length-1)}))}(s||0!==r)&&i.table.rowManager.reRenderInPosition()}return i.origFuncs.splice.apply(e,arguments)}})}},{key:"unwatchData",value:function(){if(!1!==this.data)for(var e in this.origFuncs)Object.defineProperty(this.data,e,{enumerable:!0,configurable:!0,writable:!0,value:this.origFuncs.key})}},{key:"watchRow",value:function(e){var t=e.getData();for(var i in this.blocked=!0,t)this.watchKey(e,t,i);this.table.options.dataTree&&this.watchTreeChildren(e),this.blocked=!1}},{key:"watchTreeChildren",value:function(e){var t=arguments,i=e.getData()[this.table.options.dataTreeChildField],n={};function o(){this.table.modules.dataTree.initializeRow(e),this.table.modules.dataTree.layoutRow(e),this.table.rowManager.refreshActiveData("tree",!1,!0)}i&&(n.push=i.push,Object.defineProperty(i,"push",{enumerable:!1,configurable:!0,value:function(){var e=n.push.apply(i,t);return o(),e}}),n.unshift=i.unshift,Object.defineProperty(i,"unshift",{enumerable:!1,configurable:!0,value:function(){var e=n.unshift.apply(i,t);return o(),e}}),n.shift=i.shift,Object.defineProperty(i,"shift",{enumerable:!1,configurable:!0,value:function(){var e=n.shift.call(i);return o(),e}}),n.pop=i.pop,Object.defineProperty(i,"pop",{enumerable:!1,configurable:!0,value:function(){var e=n.pop.call(i);return o(),e}}),n.splice=i.splice,Object.defineProperty(i,"splice",{enumerable:!1,configurable:!0,value:function(){var e=n.splice.apply(i,t);return o(),e}}))}},{key:"watchKey",value:function(e,t,i){var n=this,o=Object.getOwnPropertyDescriptor(t,i),a=t[i],r=this.currentVersion;Object.defineProperty(t,i,{set:function(t){if(a=t,!n.blocked&&r===n.currentVersion){var s={};s[i]=t,e.updateData(s)}o.set&&o.set(t)},get:function(){return o.get&&o.get(),a}})}},{key:"unwatchRow",value:function(e){var t=e.getData();for(var i in t)Object.defineProperty(t,i,{value:t[i]})}},{key:"block",value:function(){this.blocked=!0}},{key:"unblock",value:function(){this.blocked=!1}}]),n}(V);Ge.moduleName="reactiveData";var Ue=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).startColumn=!1,o.startX=!1,o.startWidth=!1,o.latestX=!1,o.handle=null,o.initialNextColumn=null,o.nextColumn=null,o.initialized=!1,o.registerColumnOption("resizable",!0),o.registerTableOption("resizableColumnFit",!1),o}return o(n,[{key:"initialize",value:function(){this.subscribe("column-rendered",this.layoutColumnHeader.bind(this))}},{key:"initializeEventWatchers",value:function(){this.initialized||(this.subscribe("cell-rendered",this.layoutCellHandles.bind(this)),this.subscribe("cell-delete",this.deInitializeComponent.bind(this)),this.subscribe("cell-height",this.resizeHandle.bind(this)),this.subscribe("column-moved",this.columnLayoutUpdated.bind(this)),this.subscribe("column-hide",this.deInitializeColumn.bind(this)),this.subscribe("column-show",this.columnLayoutUpdated.bind(this)),this.subscribe("column-width",this.columnWidthUpdated.bind(this)),this.subscribe("column-delete",this.deInitializeComponent.bind(this)),this.subscribe("column-height",this.resizeHandle.bind(this)),this.initialized=!0)}},{key:"layoutCellHandles",value:function(e){"row"===e.row.type&&(this.deInitializeComponent(e),this.initializeColumn("cell",e,e.column,e.element))}},{key:"layoutColumnHeader",value:function(e){e.definition.resizable&&(this.initializeEventWatchers(),this.deInitializeComponent(e),this.initializeColumn("header",e,e,e.element))}},{key:"columnLayoutUpdated",value:function(e){var t=e.prevColumn();this.reinitializeColumn(e),t&&this.reinitializeColumn(t)}},{key:"columnWidthUpdated",value:function(e){var t=this;e.modules.frozen&&(this.table.modules.frozenColumns.leftColumns.includes(e)?this.table.modules.frozenColumns.leftColumns.forEach((function(e){t.reinitializeColumn(e)})):this.table.modules.frozenColumns.rightColumns.includes(e)&&this.table.modules.frozenColumns.rightColumns.forEach((function(e){t.reinitializeColumn(e)})))}},{key:"reinitializeColumn",value:function(e){var t=!!e.modules.frozen&&e.modules.frozen.marginValue+e.getWidth()+"px";e.cells.forEach((function(e){e.modules.resize&&e.modules.resize.handleEl&&(t&&(e.modules.resize.handleEl.style.left=t),e.element.after(e.modules.resize.handleEl))})),e.modules.resize&&e.modules.resize.handleEl&&(t&&(e.modules.resize.handleEl.style.left=t),e.element.after(e.modules.resize.handleEl))}},{key:"initializeColumn",value:function(e,t,i,n){var o=this,a=i.definition.resizable,r={},s=i.getLastColumn();if("header"===e&&(r={variableHeight:"textarea"==i.definition.formatter||i.definition.variableHeight}),(!0===a||a==e)&&this._checkResizability(s)){var l=document.createElement("span");l.className="tabulator-col-resize-handle",l.addEventListener("click",(function(e){e.stopPropagation()}));var u=function(e){o.startColumn=i,o.initialNextColumn=o.nextColumn=s.nextColumn(),o._mouseDown(e,s,l)};l.addEventListener("mousedown",u),l.addEventListener("touchstart",u,{passive:!0}),l.addEventListener("dblclick",(function(e){var t=s.getWidth();e.stopPropagation(),s.reinitializeWidth(!0),t!==s.getWidth()&&(o.dispatch("column-resized",s),o.table.externalEvents.dispatch("columnResized",s.getComponent()))})),i.modules.frozen&&(l.style.position="absolute",l.style.left=i.modules.frozen.marginValue+i.getWidth()+"px"),r.handleEl=l,n.parentNode&&n.after(l)}t.modules.resize=r}},{key:"deInitializeColumn",value:function(e){var t=this;this.deInitializeComponent(e),e.cells.forEach((function(e){t.deInitializeComponent(e)}))}},{key:"deInitializeComponent",value:function(e){var t;e.modules.resize&&(t=e.modules.resize.handleEl)&&t.parentElement&&t.parentElement.removeChild(t)}},{key:"resizeHandle",value:function(e,t){e.modules.resize&&e.modules.resize.handleEl&&(e.modules.resize.handleEl.style.height=t)}},{key:"_checkResizability",value:function(e){return e.definition.resizable}},{key:"_mouseDown",value:function(e,t,i){var n=this;function o(e){var i,o,a=void 0===e.screenX?e.touches[0].screenX:e.screenX,r=a-n.startX,s=a-n.latestX;if(n.latestX=a,n.table.rtl&&(r=-r,s=-s),i=t.width==t.minWidth||t.width==t.maxWidth,t.setWidth(n.startWidth+r),o=t.width==t.minWidth||t.width==t.maxWidth,s<0&&(n.nextColumn=n.initialNextColumn),n.table.options.resizableColumnFit&&n.nextColumn&&(!i||!o)){var l=n.nextColumn.getWidth();s>0&&l<=n.nextColumn.minWidth&&(n.nextColumn=n.nextColumn.nextColumn()),n.nextColumn&&n.nextColumn.setWidth(n.nextColumn.getWidth()-s)}n.table.columnManager.renderer.rerenderColumns(!0),!n.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights()}function a(e){n.startColumn.modules.edit&&(n.startColumn.modules.edit.blocked=!1),n.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights(),document.body.removeEventListener("mouseup",a),document.body.removeEventListener("mousemove",o),i.removeEventListener("touchmove",o),i.removeEventListener("touchend",a),n.table.element.classList.remove("tabulator-block-select"),n.startWidth!==t.getWidth()&&(n.dispatch("column-resized",t),n.table.externalEvents.dispatch("columnResized",t.getComponent()))}n.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),n.startColumn.modules.edit&&(n.startColumn.modules.edit.blocked=!0),n.startX=void 0===e.screenX?e.touches[0].screenX:e.screenX,n.latestX=n.startX,n.startWidth=t.getWidth(),document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",a),i.addEventListener("touchmove",o,{passive:!0}),i.addEventListener("touchend",a)}}]),n}(V);Ue.moduleName="resizeColumns";var Xe=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).startColumn=!1,o.startY=!1,o.startHeight=!1,o.handle=null,o.prevHandle=null,o.registerTableOption("resizableRows",!1),o}return o(n,[{key:"initialize",value:function(){this.table.options.resizableRows&&this.subscribe("row-layout-after",this.initializeRow.bind(this))}},{key:"initializeRow",value:function(e){var t=this,i=e.getElement(),n=document.createElement("div");n.className="tabulator-row-resize-handle";var o=document.createElement("div");o.className="tabulator-row-resize-handle prev",n.addEventListener("click",(function(e){e.stopPropagation()}));var a=function(i){t.startRow=e,t._mouseDown(i,e,n)};n.addEventListener("mousedown",a),n.addEventListener("touchstart",a,{passive:!0}),o.addEventListener("click",(function(e){e.stopPropagation()}));var r=function(i){var n=t.table.rowManager.prevDisplayRow(e);n&&(t.startRow=n,t._mouseDown(i,n,o))};o.addEventListener("mousedown",r),o.addEventListener("touchstart",r,{passive:!0}),i.appendChild(n),i.appendChild(o)}},{key:"_mouseDown",value:function(e,t,i){var n=this;function o(e){t.setHeight(n.startHeight+((void 0===e.screenY?e.touches[0].screenY:e.screenY)-n.startY))}function a(e){document.body.removeEventListener("mouseup",o),document.body.removeEventListener("mousemove",o),i.removeEventListener("touchmove",o),i.removeEventListener("touchend",a),n.table.element.classList.remove("tabulator-block-select"),n.dispatchExternal("rowResized",t.getComponent())}n.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),n.startY=void 0===e.screenY?e.touches[0].screenY:e.screenY,n.startHeight=t.getHeight(),document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",a),i.addEventListener("touchmove",o,{passive:!0}),i.addEventListener("touchend",a)}}]),n}(V);Xe.moduleName="resizeRows";var qe=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).binding=!1,o.observer=!1,o.containerObserver=!1,o.tableHeight=0,o.tableWidth=0,o.containerHeight=0,o.containerWidth=0,o.autoResize=!1,o.registerTableOption("autoResize",!0),o}return o(n,[{key:"initialize",value:function(){var e=this;if(this.table.options.autoResize){var t,i=this.table;this.tableHeight=i.element.clientHeight,this.tableWidth=i.element.clientWidth,i.element.parentNode&&(this.containerHeight=i.element.parentNode.clientHeight,this.containerWidth=i.element.parentNode.clientWidth),"undefined"!=typeof ResizeObserver&&"virtual"===i.rowManager.getRenderMode()?(this.autoResize=!0,this.observer=new ResizeObserver((function(t){if(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell){var n=Math.floor(t[0].contentRect.height),o=Math.floor(t[0].contentRect.width);e.tableHeight==n&&e.tableWidth==o||(e.tableHeight=n,e.tableWidth=o,i.element.parentNode&&(e.containerHeight=i.element.parentNode.clientHeight,e.containerWidth=i.element.parentNode.clientWidth),e.table.columnManager.renderer.rerenderColumns(!0),i.redraw())}})),this.observer.observe(i.element),t=window.getComputedStyle(i.element),this.table.element.parentNode&&!this.table.rowManager.fixedHeight&&(t.getPropertyValue("max-height")||t.getPropertyValue("min-height"))&&(this.containerObserver=new ResizeObserver((function(t){if(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell){var n=Math.floor(t[0].contentRect.height),o=Math.floor(t[0].contentRect.width);e.containerHeight==n&&e.containerWidth==o||(e.containerHeight=n,e.containerWidth=o,e.tableHeight=i.element.clientHeight,e.tableWidth=i.element.clientWidth),i.columnManager.renderer.rerenderColumns(!0),i.redraw()}})),this.containerObserver.observe(this.table.element.parentNode)),this.subscribe("table-resize",this.tableResized.bind(this))):(this.binding=function(){(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell)&&(i.columnManager.renderer.rerenderColumns(!0),i.redraw())},window.addEventListener("resize",this.binding)),this.subscribe("table-destroy",this.clearBindings.bind(this))}}},{key:"tableResized",value:function(){this.table.rowManager.redraw()}},{key:"clearBindings",value:function(){this.binding&&window.removeEventListener("resize",this.binding),this.observer&&this.observer.unobserve(this.table.element),this.containerObserver&&this.containerObserver.unobserve(this.table.element.parentNode)}}]),n}(V);qe.moduleName="resizeTable";var Ke=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).columns=[],o.hiddenColumns=[],o.mode="",o.index=0,o.collapseFormatter=[],o.collapseStartOpen=!0,o.collapseHandleColumn=!1,o.registerTableOption("responsiveLayout",!1),o.registerTableOption("responsiveLayoutCollapseStartOpen",!0),o.registerTableOption("responsiveLayoutCollapseUseFormatters",!0),o.registerTableOption("responsiveLayoutCollapseFormatter",!1),o.registerColumnOption("responsive"),o}return o(n,[{key:"initialize",value:function(){this.table.options.responsiveLayout&&(this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("column-show",this.updateColumnVisibility.bind(this)),this.subscribe("column-hide",this.updateColumnVisibility.bind(this)),this.subscribe("columns-loaded",this.initializeResponsivity.bind(this)),this.subscribe("column-moved",this.initializeResponsivity.bind(this)),this.subscribe("column-add",this.initializeResponsivity.bind(this)),this.subscribe("column-delete",this.initializeResponsivity.bind(this)),this.subscribe("table-redrawing",this.tableRedraw.bind(this)),"collapse"===this.table.options.responsiveLayout&&(this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout",this.layoutRow.bind(this))))}},{key:"tableRedraw",value:function(e){-1===["fitColumns","fitDataStretch"].indexOf(this.layoutMode())&&(e||this.update())}},{key:"initializeResponsivity",value:function(){var e=this,t=[];this.mode=this.table.options.responsiveLayout,this.collapseFormatter=this.table.options.responsiveLayoutCollapseFormatter||this.formatCollapsedData,this.collapseStartOpen=this.table.options.responsiveLayoutCollapseStartOpen,this.hiddenColumns=[],this.table.columnManager.columnsByIndex.forEach((function(i,n){i.modules.responsive&&i.modules.responsive.order&&i.modules.responsive.visible&&(i.modules.responsive.index=n,t.push(i),i.visible||"collapse"!==e.mode||e.hiddenColumns.push(i))})),t=(t=t.reverse()).sort((function(e,t){return t.modules.responsive.order-e.modules.responsive.order||t.modules.responsive.index-e.modules.responsive.index})),this.columns=t,"collapse"===this.mode&&this.generateCollapsedContent();var i,n=f(this.table.columnManager.columnsByIndex);try{for(n.s();!(i=n.n()).done;){var o=i.value;if("responsiveCollapse"==o.definition.formatter){this.collapseHandleColumn=o;break}}}catch(e){n.e(e)}finally{n.f()}this.collapseHandleColumn&&(this.hiddenColumns.length?this.collapseHandleColumn.show():this.collapseHandleColumn.hide())}},{key:"initializeColumn",value:function(e){var t=e.getDefinition();e.modules.responsive={order:void 0===t.responsive?1:t.responsive,visible:!1!==t.visible}}},{key:"initializeRow",value:function(e){var t;"calc"!==e.type&&((t=document.createElement("div")).classList.add("tabulator-responsive-collapse"),e.modules.responsiveLayout={element:t,open:this.collapseStartOpen},this.collapseStartOpen||(t.style.display="none"))}},{key:"layoutRow",value:function(e){var t=e.getElement();e.modules.responsiveLayout&&(t.appendChild(e.modules.responsiveLayout.element),this.generateCollapsedRowContent(e))}},{key:"updateColumnVisibility",value:function(e,t){!t&&e.modules.responsive&&(e.modules.responsive.visible=e.visible,this.initializeResponsivity())}},{key:"hideColumn",value:function(e){var t=this.hiddenColumns.length;e.hide(!1,!0),"collapse"===this.mode&&(this.hiddenColumns.unshift(e),this.generateCollapsedContent(),this.collapseHandleColumn&&!t&&this.collapseHandleColumn.show())}},{key:"showColumn",value:function(e){var t;e.show(!1,!0),e.setWidth(e.getWidth()),"collapse"===this.mode&&((t=this.hiddenColumns.indexOf(e))>-1&&this.hiddenColumns.splice(t,1),this.generateCollapsedContent(),this.collapseHandleColumn&&!this.hiddenColumns.length&&this.collapseHandleColumn.hide())}},{key:"update",value:function(){for(var e=this,t=!0;t;){var i="fitColumns"==e.table.modules.layout.getMode()?e.table.columnManager.getFlexBaseWidth():e.table.columnManager.getWidth(),n=(e.table.options.headerVisible?e.table.columnManager.element.clientWidth:e.table.element.clientWidth)-i;if(n<0){var o=e.columns[e.index];o?(e.hideColumn(o),e.index++):t=!1}else{var a=e.columns[e.index-1];a&&n>0&&n>=a.getWidth()?(e.showColumn(a),e.index--):t=!1}e.table.rowManager.activeRowsCount||e.table.rowManager.renderEmptyScroll()}}},{key:"generateCollapsedContent",value:function(){var e=this;this.table.rowManager.getDisplayRows().forEach((function(t){e.generateCollapsedRowContent(t)}))}},{key:"generateCollapsedRowContent",value:function(e){var t,i;if(e.modules.responsiveLayout){for(t=e.modules.responsiveLayout.element;t.firstChild;)t.removeChild(t.firstChild);(i=this.collapseFormatter(this.generateCollapsedRowData(e)))&&t.appendChild(i)}}},{key:"generateCollapsedRowData",value:function(e){var t,i=this,n=e.getData(),o=[];return this.hiddenColumns.forEach((function(a){var r=a.getFieldValue(n);if(a.definition.title&&a.field)if(a.modules.format&&i.table.options.responsiveLayoutCollapseUseFormatters){t={value:!1,data:{},getValue:function(){return r},getData:function(){return n},getElement:function(){return document.createElement("div")},getRow:function(){return e.getComponent()},getColumn:function(){return a.getComponent()}},o.push({field:a.field,title:a.definition.title,value:a.modules.format.formatter.call(i.table.modules.format,t,a.modules.format.params,(function(e){e()}))})}else o.push({field:a.field,title:a.definition.title,value:r})})),o}},{key:"formatCollapsedData",value:function(e){var t=document.createElement("table");return e.forEach((function(e){var i,n=document.createElement("tr"),o=document.createElement("td"),a=document.createElement("td"),r=document.createElement("strong");o.appendChild(r),this.langBind("columns|"+e.field,(function(t){r.innerHTML=t||e.title})),e.value instanceof Node?((i=document.createElement("div")).appendChild(e.value),a.appendChild(i)):a.innerHTML=e.value,n.appendChild(o),n.appendChild(a),t.appendChild(n)}),this),Object.keys(e).length?t:""}}]),n}(V);Ke.moduleName="responsiveLayout";var Je=function(i){a(r,i);var n=c(r);function r(e){var i;return t(this,r),(i=n.call(this,e)).selecting=!1,i.lastClickedRow=!1,i.selectPrev=[],i.selectedRows=[],i.headerCheckboxElement=null,i.registerTableOption("selectable","highlight"),i.registerTableOption("selectableRangeMode","drag"),i.registerTableOption("selectableRollingSelection",!0),i.registerTableOption("selectablePersistence",!0),i.registerTableOption("selectableCheck",(function(e,t){return!0})),i.registerTableFunction("selectRow",i.selectRows.bind(l(i))),i.registerTableFunction("deselectRow",i.deselectRows.bind(l(i))),i.registerTableFunction("toggleSelectRow",i.toggleRow.bind(l(i))),i.registerTableFunction("getSelectedRows",i.getSelectedRows.bind(l(i))),i.registerTableFunction("getSelectedData",i.getSelectedData.bind(l(i))),i.registerComponentFunction("row","select",i.selectRows.bind(l(i))),i.registerComponentFunction("row","deselect",i.deselectRows.bind(l(i))),i.registerComponentFunction("row","toggleSelect",i.toggleRow.bind(l(i))),i.registerComponentFunction("row","isSelected",i.isRowSelected.bind(l(i))),i}return o(r,[{key:"initialize",value:function(){!1!==this.table.options.selectable&&(this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-deleting",this.rowDeleted.bind(this)),this.subscribe("rows-wipe",this.clearSelectionData.bind(this)),this.subscribe("rows-retrieve",this.rowRetrieve.bind(this)),this.table.options.selectable&&!this.table.options.selectablePersistence&&this.subscribe("data-refreshing",this.deselectRows.bind(this)))}},{key:"rowRetrieve",value:function(e,t){return"selected"===e?this.selectedRows:t}},{key:"rowDeleted",value:function(e){this._deselectRow(e,!0)}},{key:"clearSelectionData",value:function(e){this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],!0!==e&&this._rowSelectionChanged()}},{key:"initializeRow",value:function(e){var t=this,i=e.getElement(),n=function e(){setTimeout((function(){t.selecting=!1}),50),document.body.removeEventListener("mouseup",e)};e.modules.select={selected:!1},t.table.options.selectableCheck.call(this.table,e.getComponent())?(i.classList.add("tabulator-selectable"),i.classList.remove("tabulator-unselectable"),t.table.options.selectable&&"highlight"!=t.table.options.selectable&&("click"===t.table.options.selectableRangeMode?i.addEventListener("click",this.handleComplexRowClick.bind(this,e)):(i.addEventListener("click",(function(i){t.table.modExists("edit")&&t.table.modules.edit.getCurrentCell()||t.table._clearSelection(),t.selecting||t.toggleRow(e)})),i.addEventListener("mousedown",(function(i){if(i.shiftKey)return t.table._clearSelection(),t.selecting=!0,t.selectPrev=[],document.body.addEventListener("mouseup",n),document.body.addEventListener("keyup",n),t.toggleRow(e),!1})),i.addEventListener("mouseenter",(function(i){t.selecting&&(t.table._clearSelection(),t.toggleRow(e),t.selectPrev[1]==e&&t.toggleRow(t.selectPrev[0]))})),i.addEventListener("mouseout",(function(i){t.selecting&&(t.table._clearSelection(),t.selectPrev.unshift(e))}))))):(i.classList.add("tabulator-unselectable"),i.classList.remove("tabulator-selectable"))}},{key:"handleComplexRowClick",value:function(e,t){var i=this;if(t.shiftKey){this.table._clearSelection(),this.lastClickedRow=this.lastClickedRow||e;var n=this.table.rowManager.getDisplayRowIndex(this.lastClickedRow),o=this.table.rowManager.getDisplayRowIndex(e),a=n<=o?n:o,r=n>=o?n:o,s=this.table.rowManager.getDisplayRows().slice(0).splice(a,r-a+1);t.ctrlKey||t.metaKey?(s.forEach((function(t){t!==i.lastClickedRow&&(!0===i.table.options.selectable||i.isRowSelected(e)||i.selectedRows.lengththis.table.options.selectable&&(s=s.slice(0,this.table.options.selectable)),this.selectRows(s)),this.table._clearSelection()}else t.ctrlKey||t.metaKey?(this.toggleRow(e),this.lastClickedRow=e):(this.deselectRows(void 0,!0),this.selectRows(e),this.lastClickedRow=e)}},{key:"toggleRow",value:function(e){this.table.options.selectableCheck.call(this.table,e.getComponent())&&(e.modules.select&&e.modules.select.selected?this._deselectRow(e):this._selectRow(e))}},{key:"selectRows",value:function(t){var i,n=this;switch(e(t)){case"undefined":this.table.rowManager.rows.forEach((function(e){n._selectRow(e,!0,!0)})),this._rowSelectionChanged();break;case"string":(i=this.table.rowManager.findRow(t))?this._selectRow(i,!0,!0):this.table.rowManager.getRows(t).forEach((function(e){n._selectRow(e,!0,!0)})),this._rowSelectionChanged();break;default:Array.isArray(t)?(t.forEach((function(e){n._selectRow(e,!0,!0)})),this._rowSelectionChanged()):this._selectRow(t,!1,!0)}}},{key:"_selectRow",value:function(e,t,i){if(!isNaN(this.table.options.selectable)&&!0!==this.table.options.selectable&&!i&&this.selectedRows.length>=this.table.options.selectable){if(!this.table.options.selectableRollingSelection)return!1;this._deselectRow(this.selectedRows[0])}var n=this.table.rowManager.findRow(e);n?-1==this.selectedRows.indexOf(n)&&(n.getElement().classList.add("tabulator-selected"),n.modules.select||(n.modules.select={}),n.modules.select.selected=!0,n.modules.select.checkboxEl&&(n.modules.select.checkboxEl.checked=!0),this.selectedRows.push(n),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(n,!0),this.dispatchExternal("rowSelected",n.getComponent()),this._rowSelectionChanged(t)):t||console.warn("Selection Error - No such row found, ignoring selection:"+e)}},{key:"isRowSelected",value:function(e){return-1!==this.selectedRows.indexOf(e)}},{key:"deselectRows",value:function(e,t){var i,n=this;if(void 0===e){i=n.selectedRows.length;for(var o=0;o-1&&(o.getElement().classList.remove("tabulator-selected"),o.modules.select||(o.modules.select={}),o.modules.select.selected=!1,o.modules.select.checkboxEl&&(o.modules.select.checkboxEl.checked=!1),n.selectedRows.splice(i,1),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(o,!1),this.dispatchExternal("rowDeselected",o.getComponent()),n._rowSelectionChanged(t)):t||console.warn("Deselection Error - No such row found, ignoring selection:"+e)}},{key:"getSelectedData",value:function(){var e=[];return this.selectedRows.forEach((function(t){e.push(t.getData())})),e}},{key:"getSelectedRows",value:function(){var e=[];return this.selectedRows.forEach((function(t){e.push(t.getComponent())})),e}},{key:"_rowSelectionChanged",value:function(e){this.headerCheckboxElement&&(0===this.selectedRows.length?(this.headerCheckboxElement.checked=!1,this.headerCheckboxElement.indeterminate=!1):this.table.rowManager.rows.length===this.selectedRows.length?(this.headerCheckboxElement.checked=!0,this.headerCheckboxElement.indeterminate=!1):(this.headerCheckboxElement.indeterminate=!0,this.headerCheckboxElement.checked=!1)),e||this.dispatchExternal("rowSelectionChanged",this.getSelectedData(),this.getSelectedRows())}},{key:"registerRowSelectCheckbox",value:function(e,t){e._row.modules.select||(e._row.modules.select={}),e._row.modules.select.checkboxEl=t}},{key:"registerHeaderSelectCheckbox",value:function(e){this.headerCheckboxElement=e}},{key:"childRowSelection",value:function(e,t){var i=this.table.modules.dataTree.getChildren(e,!0);if(t){var n,o=f(i);try{for(o.s();!(n=o.n()).done;){var a=n.value;this._selectRow(a,!0)}}catch(e){o.e(e)}finally{o.f()}}else{var r,s=f(i);try{for(s.s();!(r=s.n()).done;){var l=r.value;this._deselectRow(l,!0)}}catch(e){s.e(e)}finally{s.f()}}}}]),r}(V);function Ye(e,t,i,n,o,a,r){var s=window.DateTime||luxon.DateTime,l=r.format||"dd/MM/yyyy HH:mm:ss",u=r.alignEmptyValues,c=0;if(void 0!==s){if(e=s.isDateTime(e)?e:"iso"===l?s.fromISO(String(e)):s.fromFormat(String(e),l),t=s.isDateTime(t)?t:"iso"===l?s.fromISO(String(t)):s.fromFormat(String(t),l),e.isValid){if(t.isValid)return e-t;c=1}else c=t.isValid?-1:0;return("top"===u&&"desc"===a||"bottom"===u&&"asc"===a)&&(c*=-1),c}console.error("Sort Error - 'datetime' sorter is dependant on luxon.js")}Je.moduleName="selectRow";var $e={number:function(e,t,i,n,o,a,r){var s=r.alignEmptyValues,l=r.decimalSeparator,u=r.thousandSeparator,c=0;if(e=String(e),t=String(t),u&&(e=e.split(u).join(""),t=t.split(u).join("")),l&&(e=e.split(l).join("."),t=t.split(l).join(".")),e=parseFloat(e),t=parseFloat(t),isNaN(e))c=isNaN(t)?0:-1;else{if(!isNaN(t))return e-t;c=1}return("top"===s&&"desc"===a||"bottom"===s&&"asc"===a)&&(c*=-1),c},string:function(t,i,n,o,a,r,s){var l,u=s.alignEmptyValues,c=0;if(t){if(i){switch(e(s.locale)){case"boolean":s.locale&&(l=this.langLocale());break;case"string":l=s.locale}return String(t).toLowerCase().localeCompare(String(i).toLowerCase(),l)}c=1}else c=i?-1:0;return("top"===u&&"desc"===r||"bottom"===u&&"asc"===r)&&(c*=-1),c},date:function(e,t,i,n,o,a,r){return r.format||(r.format="dd/MM/yyyy"),Ye.call(this,e,t,i,n,o,a,r)},time:function(e,t,i,n,o,a,r){return r.format||(r.format="HH:mm"),Ye.call(this,e,t,i,n,o,a,r)},datetime:Ye,boolean:function(e,t,i,n,o,a,r){return(!0===e||"true"===e||"True"===e||1===e?1:0)-(!0===t||"true"===t||"True"===t||1===t?1:0)},array:function(e,t,i,n,o,a,r){var s=r.type||"length",l=r.alignEmptyValues,u=0;function c(e){switch(s){case"length":return e.length;case"sum":return e.reduce((function(e,t){return e+t}));case"max":return Math.max.apply(null,e);case"min":return Math.min.apply(null,e);case"avg":return e.reduce((function(e,t){return e+t}))/e.length}}if(Array.isArray(e)){if(Array.isArray(t))return(e?c(e):0)-(t?c(t):0);l=1}else l=Array.isArray(t)?-1:0;return("top"===l&&"desc"===a||"bottom"===l&&"asc"===a)&&(u*=-1),u},exists:function(e,t,i,n,o,a,r){return(void 0===e?0:1)-(void 0===t?0:1)},alphanum:function(e,t,i,n,o,a,r){var s,l,u,c,h,d=0,m=/(\d+)|(\D+)/g,p=/\d/,f=r.alignEmptyValues,g=0;if(e||0===e){if(t||0===t){if(isFinite(e)&&isFinite(t))return e-t;if((s=String(e).toLowerCase())===(l=String(t).toLowerCase()))return 0;if(!p.test(s)||!p.test(l))return s>l?1:-1;for(s=s.match(m),l=l.match(m),h=s.length>l.length?l.length:s.length;dc?1:-1;return s.length>l.length}g=1}else g=t||0===t?-1:0;return("top"===f&&"desc"===a||"bottom"===f&&"asc"===a)&&(g*=-1),g}},Ze=function(i){a(r,i);var n=c(r);function r(e){var i;return t(this,r),(i=n.call(this,e)).sortList=[],i.changed=!1,i.registerTableOption("sortMode","local"),i.registerTableOption("initialSort",!1),i.registerTableOption("columnHeaderSortMulti",!0),i.registerTableOption("sortOrderReverse",!1),i.registerTableOption("headerSortElement","
"),i.registerColumnOption("sorter"),i.registerColumnOption("sorterParams"),i.registerColumnOption("headerSort",!0),i.registerColumnOption("headerSortStartingDir"),i.registerColumnOption("headerSortTristate"),i}return o(r,[{key:"initialize",value:function(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("table-built",this.tableBuilt.bind(this)),this.registerDataHandler(this.sort.bind(this),20),this.registerTableFunction("setSort",this.userSetSort.bind(this)),this.registerTableFunction("getSorters",this.getSort.bind(this)),this.registerTableFunction("clearSort",this.clearSort.bind(this)),"remote"===this.table.options.sortMode&&this.subscribe("data-params",this.remoteSortParams.bind(this))}},{key:"tableBuilt",value:function(){this.table.options.initialSort&&this.setSort(this.table.options.initialSort)}},{key:"remoteSortParams",value:function(e,t,i,n){var o=this.getSort();return o.forEach((function(e){delete e.column})),n.sort=o,n}},{key:"userSetSort",value:function(e,t){this.setSort(e,t),this.refreshSort()}},{key:"clearSort",value:function(){this.clear(),this.refreshSort()}},{key:"initializeColumn",value:function(t){var i,n,o=this,a=!1;switch(e(t.definition.sorter)){case"string":r.sorters[t.definition.sorter]?a=r.sorters[t.definition.sorter]:console.warn("Sort Error - No such sorter found: ",t.definition.sorter);break;case"function":a=t.definition.sorter}t.modules.sort={sorter:a,dir:"none",params:t.definition.sorterParams||{},startingDir:t.definition.headerSortStartingDir||"asc",tristate:t.definition.headerSortTristate},!1!==t.definition.headerSort&&((i=t.getElement()).classList.add("tabulator-sortable"),(n=document.createElement("div")).classList.add("tabulator-col-sorter"),"object"==e(this.table.options.headerSortElement)?n.appendChild(this.table.options.headerSortElement):n.innerHTML=this.table.options.headerSortElement,t.titleHolderElement.appendChild(n),t.modules.sort.element=n,i.addEventListener("click",(function(e){var i="",n=[],a=!1;if(t.modules.sort){if(t.modules.sort.tristate)i="none"==t.modules.sort.dir?t.modules.sort.startingDir:t.modules.sort.dir==t.modules.sort.startingDir?"asc"==t.modules.sort.dir?"desc":"asc":"none";else switch(t.modules.sort.dir){case"asc":i="desc";break;case"desc":i="asc";break;default:i=t.modules.sort.startingDir}o.table.options.columnHeaderSortMulti&&(e.shiftKey||e.ctrlKey)?((a=(n=o.getSort()).findIndex((function(e){return e.field===t.getField()})))>-1?(n[a].dir=i,a!=n.length-1&&(a=n.splice(a,1)[0],"none"!=i&&n.push(a))):"none"!=i&&n.push({column:t,dir:i}),o.setSort(n)):"none"==i?o.clear():o.setSort(t,i),o.refreshSort()}})))}},{key:"refreshSort",value:function(){"remote"===this.table.options.sortMode?this.reloadData(null,!1,!1):this.refreshData(!0)}},{key:"hasChanged",value:function(){var e=this.changed;return this.changed=!1,e}},{key:"getSort",value:function(){var e=[];return this.sortList.forEach((function(t){t.column&&e.push({column:t.column.getComponent(),field:t.column.getField(),dir:t.dir})})),e}},{key:"setSort",value:function(e,t){var i=this,n=[];Array.isArray(e)||(e=[{column:e,dir:t}]),e.forEach((function(e){var t;(t=i.table.columnManager.findColumn(e.column))?(e.column=t,n.push(e),i.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",e.column)})),i.sortList=n,this.dispatch("sort-changed")}},{key:"clear",value:function(){this.setSort([])}},{key:"findSorter",value:function(t){var i,n=this.table.rowManager.activeRows[0],o="string";if(n&&(n=n.getData(),t.getField()))switch(e(i=t.getFieldValue(n))){case"undefined":o="string";break;case"boolean":o="boolean";break;default:isNaN(i)||""===i?i.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(o="alphanum"):o="number"}return r.sorters[o]}},{key:"sort",value:function(e){var t=this,i=this.table.options.sortOrderReverse?t.sortList.slice().reverse():t.sortList,n=[],o=[];return this.subscribedExternal("dataSorting")&&this.dispatchExternal("dataSorting",t.getSort()),t.clearColumnHeaders(),"remote"!==this.table.options.sortMode?(i.forEach((function(e,i){var o=e.column.modules.sort;e.column&&o&&(o.sorter||(o.sorter=t.findSorter(e.column)),e.params="function"==typeof o.params?o.params(e.column.getComponent(),e.dir):o.params,n.push(e)),t.setColumnHeader(e.column,e.dir)})),n.length&&t._sortItems(e,n)):i.forEach((function(e,i){t.setColumnHeader(e.column,e.dir)})),this.subscribedExternal("dataSorted")&&(e.forEach((function(e){o.push(e.getComponent())})),this.dispatchExternal("dataSorted",t.getSort(),o)),e}},{key:"clearColumnHeaders",value:function(){this.table.columnManager.getRealColumns().forEach((function(e){e.modules.sort&&(e.modules.sort.dir="none",e.getElement().setAttribute("aria-sort","none"))}))}},{key:"setColumnHeader",value:function(e,t){e.modules.sort.dir=t,e.getElement().setAttribute("aria-sort",t)}},{key:"_sortItems",value:function(e,t){var i=this,n=t.length-1;e.sort((function(e,o){for(var a,r=n;r>=0;r--){var s=t[r];if(0!==(a=i._sortRow(e,o,s.column,s.dir,s.params)))break}return a}))}},{key:"_sortRow",value:function(e,t,i,n,o){var a,r,s="asc"==n?e:t,l="asc"==n?t:e;return e=void 0!==(e=i.getFieldValue(s.getData()))?e:"",t=void 0!==(t=i.getFieldValue(l.getData()))?t:"",a=s.getComponent(),r=l.getComponent(),i.modules.sort.sorter.call(this,e,t,a,r,i.getComponent(),n,o)}}]),r}(V);Ze.moduleName="sort",Ze.sorters=$e;var Qe=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).tooltipSubscriber=null,o.headerSubscriber=null,o.timeout=null,o.popupInstance=null,o.registerTableOption("tooltipGenerationMode",void 0),o.registerTableOption("tooltipDelay",300),o.registerColumnOption("tooltip"),o.registerColumnOption("headerTooltip"),o}return o(n,[{key:"initialize",value:function(){this.deprecationCheck(),this.subscribe("column-init",this.initializeColumn.bind(this))}},{key:"deprecationCheck",value:function(){void 0!==this.table.options.tooltipGenerationMode&&console.warn("Use of the tooltipGenerationMode option is now deprecated. This option is no longer needed as tooltips are always generated on hover now")}},{key:"initializeColumn",value:function(e){e.definition.headerTooltip&&!this.headerSubscriber&&(this.headerSubscriber=!0,this.subscribe("column-mousemove",this.mousemoveCheck.bind(this,"headerTooltip")),this.subscribe("column-mouseout",this.mouseoutCheck.bind(this,"headerTooltip"))),e.definition.tooltip&&!this.tooltipSubscriber&&(this.tooltipSubscriber=!0,this.subscribe("cell-mousemove",this.mousemoveCheck.bind(this,"tooltip")),this.subscribe("cell-mouseout",this.mouseoutCheck.bind(this,"tooltip")))}},{key:"mousemoveCheck",value:function(e,t,i){var n="tooltip"===e?i.column.definition.tooltip:i.definition.headerTooltip;n&&(this.clearPopup(),this.timeout=setTimeout(this.loadTooltip.bind(this,t,i,n),this.table.options.tooltipDelay))}},{key:"mouseoutCheck",value:function(e,t,i){this.popupInstance||this.clearPopup()}},{key:"clearPopup",value:function(e,t,i){clearTimeout(this.timeout),this.timeout=null,this.popupInstance&&this.popupInstance.hide()}},{key:"loadTooltip",value:function(e,t,i){var n,o,a,r=this;"function"==typeof i&&(i=i(e,t.getComponent(),(function(e){o=e}))),i instanceof HTMLElement?n=i:(n=document.createElement("div"),!0===i&&(t instanceof w?i=t.value:t.definition.field?this.langBind("columns|"+t.definition.field,(function(e){n.innerHTML=i=e||t.definition.title})):i=t.definition.title),n.innerHTML=i),(i||0===i||"0"===i||!1===i)&&(n.classList.add("tabulator-tooltip"),n.addEventListener("mousemove",(function(e){return e.preventDefault()})),this.popupInstance=this.popup(n),"function"==typeof o&&this.popupInstance.renderCallback(o),a=this.popupInstance.containerEventCoords(e),this.popupInstance.show(a.x+15,a.y+15).hideOnBlur((function(){r.dispatchExternal("TooltipClosed",t.getComponent()),r.popupInstance=null})),this.dispatchExternal("TooltipOpened",t.getComponent()))}}]),n}(V);Qe.moduleName="tooltip";var et={integer:function(e,t,i){return""===t||null==t||"number"==typeof(t=Number(t))&&isFinite(t)&&Math.floor(t)===t},float:function(e,t,i){return""===t||null==t||"number"==typeof(t=Number(t))&&isFinite(t)&&t%1!=0},numeric:function(e,t,i){return""===t||null==t||!isNaN(t)},string:function(e,t,i){return""===t||null==t||isNaN(t)},max:function(e,t,i){return""===t||null==t||parseFloat(t)<=i},min:function(e,t,i){return""===t||null==t||parseFloat(t)>=i},starts:function(e,t,i){return""===t||null==t||String(t).toLowerCase().startsWith(String(i).toLowerCase())},ends:function(e,t,i){return""===t||null==t||String(t).toLowerCase().endsWith(String(i).toLowerCase())},minLength:function(e,t,i){return""===t||null==t||String(t).length>=i},maxLength:function(e,t,i){return""===t||null==t||String(t).length<=i},in:function(e,t,i){return""===t||null==t||("string"==typeof i&&(i=i.split("|")),""===t||i.indexOf(t)>-1)},regex:function(e,t,i){return""===t||null==t||new RegExp(i).test(t)},unique:function(e,t,i){if(""===t||null==t)return!0;var n=!0,o=e.getData(),a=e.getColumn()._getSelf();return this.table.rowManager.rows.forEach((function(e){var i=e.getData();i!==o&&t==a.getFieldValue(i)&&(n=!1)})),n},required:function(e,t,i){return""!==t&&null!=t}},tt=function(i){a(r,i);var n=c(r);function r(e){var i;return t(this,r),(i=n.call(this,e)).invalidCells=[],i.registerTableOption("validationMode","blocking"),i.registerColumnOption("validator"),i.registerTableFunction("getInvalidCells",i.getInvalidCells.bind(l(i))),i.registerTableFunction("clearCellValidation",i.userClearCellValidation.bind(l(i))),i.registerTableFunction("validate",i.userValidate.bind(l(i))),i.registerComponentFunction("cell","isValid",i.cellIsValid.bind(l(i))),i.registerComponentFunction("cell","clearValidation",i.clearValidation.bind(l(i))),i.registerComponentFunction("cell","validate",i.cellValidate.bind(l(i))),i.registerComponentFunction("column","validate",i.columnValidate.bind(l(i))),i.registerComponentFunction("row","validate",i.rowValidate.bind(l(i))),i}return o(r,[{key:"initialize",value:function(){this.subscribe("cell-delete",this.clearValidation.bind(this)),this.subscribe("column-layout",this.initializeColumnCheck.bind(this)),this.subscribe("edit-success",this.editValidate.bind(this)),this.subscribe("edit-editor-clear",this.editorClear.bind(this)),this.subscribe("edit-edited-clear",this.editedClear.bind(this))}},{key:"editValidate",value:function(e,t,i){var n=this,o="manual"===this.table.options.validationMode||this.validate(e.column.modules.validate,e,t);return!0!==o&&setTimeout((function(){e.getElement().classList.add("tabulator-validation-fail"),n.dispatchExternal("validationFailed",e.getComponent(),t,o)})),o}},{key:"editorClear",value:function(e,t){t&&e.column.modules.validate&&this.cellValidate(e),e.getElement().classList.remove("tabulator-validation-fail")}},{key:"editedClear",value:function(e){e.modules.validate&&(e.modules.validate.invalid=!1)}},{key:"cellIsValid",value:function(e){return e.modules.validate&&e.modules.validate.invalid||!0}},{key:"cellValidate",value:function(e){return this.validate(e.column.modules.validate,e,e.getValue())}},{key:"columnValidate",value:function(e){var t=this,i=[];return e.cells.forEach((function(e){!0!==t.cellValidate(e)&&i.push(e.getComponent())})),!i.length||i}},{key:"rowValidate",value:function(e){var t=this,i=[];return e.cells.forEach((function(e){!0!==t.cellValidate(e)&&i.push(e.getComponent())})),!i.length||i}},{key:"userClearCellValidation",value:function(e){var t=this;e||(e=this.getInvalidCells()),Array.isArray(e)||(e=[e]),e.forEach((function(e){t.clearValidation(e._getSelf())}))}},{key:"userValidate",value:function(e){var t=[];return this.table.rowManager.rows.forEach((function(e){var i=(e=e.getComponent()).validate();!0!==i&&(t=t.concat(i))})),!t.length||t}},{key:"initializeColumnCheck",value:function(e){void 0!==e.definition.validator&&this.initializeColumn(e)}},{key:"initializeColumn",value:function(e){var t,i=this,n=[];e.definition.validator&&(Array.isArray(e.definition.validator)?e.definition.validator.forEach((function(e){(t=i._extractValidator(e))&&n.push(t)})):(t=this._extractValidator(e.definition.validator))&&n.push(t),e.modules.validate=!!n.length&&n)}},{key:"_extractValidator",value:function(t){var i,n,o;switch(e(t)){case"string":return(o=t.indexOf(":"))>-1?(i=t.substring(0,o),n=t.substring(o+1)):i=t,this._buildValidator(i,n);case"function":return this._buildValidator(t);case"object":return this._buildValidator(t.type,t.parameters)}}},{key:"_buildValidator",value:function(e,t){var i="function"==typeof e?e:r.validators[e];return i?{type:"function"==typeof e?"function":e,func:i,params:t}:(console.warn("Validator Setup Error - No matching validator found:",e),!1)}},{key:"validate",value:function(e,t,i){var n=this,o=[],a=this.invalidCells.indexOf(t);return e&&e.forEach((function(e){e.func.call(n,t.getComponent(),i,e.params)||o.push({type:e.type,parameters:e.params})})),t.modules.validate||(t.modules.validate={}),o.length?(t.modules.validate.invalid=o,"manual"!==this.table.options.validationMode&&t.getElement().classList.add("tabulator-validation-fail"),-1==a&&this.invalidCells.push(t)):(t.modules.validate.invalid=!1,t.getElement().classList.remove("tabulator-validation-fail"),a>-1&&this.invalidCells.splice(a,1)),!o.length||o}},{key:"getInvalidCells",value:function(){var e=[];return this.invalidCells.forEach((function(t){e.push(t.getComponent())})),e}},{key:"clearValidation",value:function(e){var t;e.modules.validate&&e.modules.validate.invalid&&(e.getElement().classList.remove("tabulator-validation-fail"),e.modules.validate.invalid=!1,(t=this.invalidCells.indexOf(e))>-1&&this.invalidCells.splice(t,1))}}]),r}(V);tt.moduleName="validate",tt.validators=et;var it=Object.freeze({__proto__:null,AccessorModule:$,AjaxModule:ne,ClipboardModule:oe,ColumnCalcsModule:se,DataTreeModule:le,DownloadModule:ce,EditModule:pe,ExportModule:ve,FilterModule:ye,FormatModule:Ce,FrozenColumnsModule:ke,FrozenRowsModule:Ee,GroupRowsModule:Te,HistoryModule:Me,HtmlTableImportModule:Le,ImportModule:Se,InteractionModule:Pe,KeybindingsModule:ze,MenuModule:Fe,MoveColumnsModule:He,MoveRowsModule:_e,MutatorModule:Oe,PageModule:Be,PersistenceModule:Ve,PopupModule:We,PrintModule:je,ReactiveDataModule:Ge,ResizeColumnsModule:Ue,ResizeRowsModule:Xe,ResizeTableModule:qe,ResponsiveLayoutModule:Ke,SelectRowModule:Je,SortModule:Ze,TooltipModule:Qe,ValidateModule:tt}),nt=function(e){a(n,e);var i=c(n);function n(){return t(this,n),i.apply(this,arguments)}return n}(Y);return new K(nt,it),nt})); +/* Tabulator v5.2.5 (c) Oliver Folkerd 2022 */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Tabulator=t()}(this,(function(){"use strict";function e(t){return(e="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})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var i=0;ie.length)&&(t=e.length);for(var i=0,n=new Array(t);i=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 a,r=!0,s=!1;return{s:function(){i=e[Symbol.iterator]()},n:function(){var e=i.next();return r=e.done,e},e:function(e){s=!0,a=e},f:function(){try{r||null==i.return||i.return()}finally{if(s)throw a}}}}var g=function(){function e(i){t(this,e),this.table=i}return o(e,[{key:"reloadData",value:function(e,t,i){return this.table.dataLoader.load(e,void 0,void 0,void 0,t,i)}},{key:"langText",value:function(){var e;return(e=this.table.modules.localize).getText.apply(e,arguments)}},{key:"langBind",value:function(){var e;return(e=this.table.modules.localize).bind.apply(e,arguments)}},{key:"langLocale",value:function(){var e;return(e=this.table.modules.localize).getLocale.apply(e,arguments)}},{key:"commsConnections",value:function(){var e;return(e=this.table.modules.comms).getConnections.apply(e,arguments)}},{key:"commsSend",value:function(){var e;return(e=this.table.modules.comms).send.apply(e,arguments)}},{key:"layoutMode",value:function(){return this.table.modules.layout.getMode()}},{key:"layoutRefresh",value:function(){return this.table.modules.layout.layout()}},{key:"subscribe",value:function(){var e;return(e=this.table.eventBus).subscribe.apply(e,arguments)}},{key:"unsubscribe",value:function(){var e;return(e=this.table.eventBus).unsubscribe.apply(e,arguments)}},{key:"subscribed",value:function(e){return this.table.eventBus.subscribed(e)}},{key:"subscriptionChange",value:function(){var e;return(e=this.table.eventBus).subscriptionChange.apply(e,arguments)}},{key:"dispatch",value:function(){var e;return(e=this.table.eventBus).dispatch.apply(e,arguments)}},{key:"chain",value:function(){var e;return(e=this.table.eventBus).chain.apply(e,arguments)}},{key:"confirm",value:function(){var e;return(e=this.table.eventBus).confirm.apply(e,arguments)}},{key:"dispatchExternal",value:function(){var e;return(e=this.table.externalEvents).dispatch.apply(e,arguments)}},{key:"subscribedExternal",value:function(e){return this.table.externalEvents.subscribed(e)}},{key:"subscriptionChangeExternal",value:function(){var e;return(e=this.table.externalEvents).subscriptionChange.apply(e,arguments)}},{key:"options",value:function(e){return this.table.options[e]}},{key:"setOption",value:function(e,t){return void 0!==t&&(this.table.options[e]=t),this.table.options[e]}},{key:"module",value:function(e){return this.table.module(e)}}]),e}(),v=function(){function e(i){return t(this,e),this._column=i,this.type="ColumnComponent",new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._column.table.componentFunctionBinder.handle("column",e._column,t)}})}return o(e,[{key:"getElement",value:function(){return this._column.getElement()}},{key:"getDefinition",value:function(){return this._column.getDefinition()}},{key:"getField",value:function(){return this._column.getField()}},{key:"getTitleDownload",value:function(){return this._column.getTitleDownload()}},{key:"getCells",value:function(){var e=[];return this._column.cells.forEach((function(t){e.push(t.getComponent())})),e}},{key:"isVisible",value:function(){return this._column.visible}},{key:"show",value:function(){this._column.isGroup?this._column.columns.forEach((function(e){e.show()})):this._column.show()}},{key:"hide",value:function(){this._column.isGroup?this._column.columns.forEach((function(e){e.hide()})):this._column.hide()}},{key:"toggle",value:function(){this._column.visible?this.hide():this.show()}},{key:"delete",value:function(){return this._column.delete()}},{key:"getSubColumns",value:function(){var e=[];return this._column.columns.length&&this._column.columns.forEach((function(t){e.push(t.getComponent())})),e}},{key:"getParentColumn",value:function(){return this._column.parent instanceof C&&this._column.parent.getComponent()}},{key:"_getSelf",value:function(){return this._column}},{key:"scrollTo",value:function(){return this._column.table.columnManager.scrollToColumn(this._column)}},{key:"getTable",value:function(){return this._column.table}},{key:"move",value:function(e,t){var i=this._column.table.columnManager.findColumn(e);i?this._column.table.columnManager.moveColumn(this._column,i,t):console.warn("Move Error - No matching column found:",i)}},{key:"getNextColumn",value:function(){var e=this._column.nextColumn();return!!e&&e.getComponent()}},{key:"getPrevColumn",value:function(){var e=this._column.prevColumn();return!!e&&e.getComponent()}},{key:"updateDefinition",value:function(e){return this._column.updateDefinition(e)}},{key:"getWidth",value:function(){return this._column.getWidth()}},{key:"setWidth",value:function(e){var t;return t=!0===e?this._column.reinitializeWidth(!0):this._column.setWidth(e),this._column.table.columnManager.renderer.rerenderColumns(!0),t}}]),e}(),b={title:void 0,field:void 0,columns:void 0,visible:void 0,hozAlign:void 0,vertAlign:void 0,width:void 0,minWidth:40,maxWidth:void 0,maxInitialWidth:void 0,cssClass:void 0,variableHeight:void 0,headerVertical:void 0,headerHozAlign:void 0,editableTitle:void 0},y=function(){function e(i){return t(this,e),this._cell=i,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._cell.table.componentFunctionBinder.handle("cell",e._cell,t)}})}return o(e,[{key:"getValue",value:function(){return this._cell.getValue()}},{key:"getOldValue",value:function(){return this._cell.getOldValue()}},{key:"getInitialValue",value:function(){return this._cell.initialValue}},{key:"getElement",value:function(){return this._cell.getElement()}},{key:"getRow",value:function(){return this._cell.row.getComponent()}},{key:"getData",value:function(){return this._cell.row.getData()}},{key:"getField",value:function(){return this._cell.column.getField()}},{key:"getColumn",value:function(){return this._cell.column.getComponent()}},{key:"setValue",value:function(e,t){void 0===t&&(t=!0),this._cell.setValue(e,t)}},{key:"restoreOldValue",value:function(){this._cell.setValueActual(this._cell.getOldValue())}},{key:"restoreInitialValue",value:function(){this._cell.setValueActual(this._cell.initialValue)}},{key:"checkHeight",value:function(){this._cell.checkHeight()}},{key:"getTable",value:function(){return this._cell.table}},{key:"_getSelf",value:function(){return this._cell}}]),e}(),w=function(i){a(r,i);var n=c(r);function r(e,i){var o;return t(this,r),(o=n.call(this,e.table)).table=e.table,o.column=e,o.row=i,o.element=null,o.value=null,o.initialValue,o.oldValue=null,o.modules={},o.height=null,o.width=null,o.minWidth=null,o.component=null,o.loaded=!1,o.build(),o}return o(r,[{key:"build",value:function(){this.generateElement(),this.setWidth(),this._configureCell(),this.setValueActual(this.column.getFieldValue(this.row.data)),this.initialValue=this.value}},{key:"generateElement",value:function(){this.element=document.createElement("div"),this.element.className="tabulator-cell",this.element.setAttribute("role","gridcell"),this.element=this.element}},{key:"_configureCell",value:function(){var e=this.element,t=this.column.getField();(e.style.textAlign=this.column.hozAlign,this.column.vertAlign&&(e.style.display="inline-flex",e.style.alignItems={top:"flex-start",bottom:"flex-end",middle:"center"}[this.column.vertAlign]||"",this.column.hozAlign&&(e.style.justifyContent={left:"flex-start",right:"flex-end",center:"center"}[this.column.hozAlign]||"")),t&&e.setAttribute("tabulator-field",t),this.column.definition.cssClass)&&this.column.definition.cssClass.split(" ").forEach((function(t){e.classList.add(t)}));this.dispatch("cell-init",this),this.column.visible||this.hide()}},{key:"_generateContents",value:function(){var t,i=this;switch(e(t=this.chain("cell-format",this,null,(function(){return i.element.innerHTML=i.value})))){case"object":if(t instanceof Node){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.appendChild(t)}else this.element.innerHTML="",null!=t&&console.warn("Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",t);break;case"undefined":this.element.innerHTML="";break;default:this.element.innerHTML=t}}},{key:"cellRendered",value:function(){this.dispatch("cell-rendered",this)}},{key:"getElement",value:function(e){return this.loaded||(this.loaded=!0,e||this.layoutElement()),this.element}},{key:"getValue",value:function(){return this.value}},{key:"getOldValue",value:function(){return this.oldValue}},{key:"setValue",value:function(e,t,i){this.setValueProcessData(e,t,i)&&(this.dispatch("cell-value-updated",this),this.cellRendered(),this.column.definition.cellEdited&&this.column.definition.cellEdited.call(this.table,this.getComponent()),this.dispatchExternal("cellEdited",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()))}},{key:"setValueProcessData",value:function(e,t,i){var n=!1;return(this.value!==e||i)&&(n=!0,t&&(e=this.chain("cell-value-changing",[this,e],null,e))),this.setValueActual(e),n&&this.dispatch("cell-value-changed",this),n}},{key:"setValueActual",value:function(e){this.oldValue=this.value,this.value=e,this.dispatch("cell-value-save-before",this),this.column.setFieldValue(this.row.data,e),this.dispatch("cell-value-save-after",this),this.loaded&&this.layoutElement()}},{key:"layoutElement",value:function(){this._generateContents(),this.dispatch("cell-layout",this)}},{key:"setWidth",value:function(){this.width=this.column.width,this.element.style.width=this.column.widthStyled}},{key:"clearWidth",value:function(){this.width="",this.element.style.width=""}},{key:"getWidth",value:function(){return this.width||this.element.offsetWidth}},{key:"setMinWidth",value:function(){this.minWidth=this.column.minWidth,this.element.style.minWidth=this.column.minWidthStyled}},{key:"setMaxWidth",value:function(){this.maxWidth=this.column.maxWidth,this.element.style.maxWidth=this.column.maxWidthStyled}},{key:"checkHeight",value:function(){this.row.reinitializeHeight()}},{key:"clearHeight",value:function(){this.element.style.height="",this.height=null,this.dispatch("cell-height",this,"")}},{key:"setHeight",value:function(){this.height=this.row.height,this.element.style.height=this.row.heightStyled,this.dispatch("cell-height",this,this.row.heightStyled)}},{key:"getHeight",value:function(){return this.height||this.element.offsetHeight}},{key:"show",value:function(){this.element.style.display=this.column.vertAlign?"inline-flex":""}},{key:"hide",value:function(){this.element.style.display="none"}},{key:"delete",value:function(){this.dispatch("cell-delete",this),!this.table.rowManager.redrawBlock&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=!1,this.column.deleteCell(this),this.row.deleteCell(this),this.calcs={}}},{key:"getIndex",value:function(){return this.row.getCellIndex(this)}},{key:"getComponent",value:function(){return this.component||(this.component=new y(this)),this.component}}]),r}(g),C=function(i){a(r,i);var n=c(r);function r(e,i){var o;return t(this,r),(o=n.call(this,i.table)).definition=e,o.parent=i,o.type="column",o.columns=[],o.cells=[],o.element=o.createElement(),o.contentElement=!1,o.titleHolderElement=!1,o.titleElement=!1,o.groupElement=o.createGroupElement(),o.isGroup=!1,o.hozAlign="",o.vertAlign="",o.field="",o.fieldStructure="",o.getFieldValue="",o.setFieldValue="",o.titleDownload=null,o.titleFormatterRendered=!1,o.mapDefinitions(),o.setField(o.definition.field),o.modules={},o.width=null,o.widthStyled="",o.maxWidth=null,o.maxWidthStyled="",o.maxInitialWidth=null,o.minWidth=null,o.minWidthStyled="",o.widthFixed=!1,o.visible=!0,o.component=null,o.definition.columns?(o.isGroup=!0,o.definition.columns.forEach((function(e,t){var i=new r(e,l(o));o.attachColumn(i)})),o.checkColumnVisibility()):i.registerColumnField(l(o)),o._initialize(),o.bindModuleColumns(),o}return o(r,[{key:"createElement",value:function(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.setAttribute("role","columnheader"),e.setAttribute("aria-sort","none"),e}},{key:"createGroupElement",value:function(){var e=document.createElement("div");return e.classList.add("tabulator-col-group-cols"),e}},{key:"mapDefinitions",value:function(){var e=this.table.options.columnDefaults;if(e)for(var t in e)void 0===this.definition[t]&&(this.definition[t]=e[t]);this.definition=this.table.columnManager.optionsList.generate(r.defaultOptionList,this.definition)}},{key:"checkDefinition",value:function(){var e=this;Object.keys(this.definition).forEach((function(t){-1===r.defaultOptionList.indexOf(t)&&console.warn("Invalid column definition option in '"+(e.field||e.definition.title)+"' column:",t)}))}},{key:"setField",value:function(e){this.field=e,this.fieldStructure=e?this.table.options.nestedFieldSeparator?e.split(this.table.options.nestedFieldSeparator):[e]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData}},{key:"registerColumnPosition",value:function(e){this.parent.registerColumnPosition(e)}},{key:"registerColumnField",value:function(e){this.parent.registerColumnField(e)}},{key:"reRegisterPosition",value:function(){this.isGroup?this.columns.forEach((function(e){e.reRegisterPosition()})):this.registerColumnPosition(this)}},{key:"_mapDepricatedFunctionality",value:function(){}},{key:"_initialize",value:function(){for(var e=this.definition;this.element.firstChild;)this.element.removeChild(this.element.firstChild);e.headerVertical&&(this.element.classList.add("tabulator-col-vertical"),"flip"===e.headerVertical&&this.element.classList.add("tabulator-col-vertical-flip")),this.contentElement=this._buildColumnHeaderContent(),this.element.appendChild(this.contentElement),this.isGroup?this._buildGroupHeader():this._buildColumnHeader(),this.dispatch("column-init",this)}},{key:"_buildColumnHeader",value:function(){var e=this,t=this.definition;this.table;(this.dispatch("column-layout",this),void 0!==t.visible&&(t.visible?this.show(!0):this.hide(!0)),t.cssClass)&&t.cssClass.split(" ").forEach((function(t){e.element.classList.add(t)}));t.field&&this.element.setAttribute("tabulator-field",t.field),this.setMinWidth(parseInt(t.minWidth)),t.maxInitialWidth&&(this.maxInitialWidth=parseInt(t.maxInitialWidth)),t.maxWidth&&this.setMaxWidth(parseInt(t.maxWidth)),this.reinitializeWidth(),this.hozAlign=this.definition.hozAlign,this.vertAlign=this.definition.vertAlign,this.titleElement.style.textAlign=this.definition.headerHozAlign}},{key:"_buildColumnHeaderContent",value:function(){this.definition,this.table;var e=document.createElement("div");return e.classList.add("tabulator-col-content"),this.titleHolderElement=document.createElement("div"),this.titleHolderElement.classList.add("tabulator-col-title-holder"),e.appendChild(this.titleHolderElement),this.titleElement=this._buildColumnHeaderTitle(),this.titleHolderElement.appendChild(this.titleElement),e}},{key:"_buildColumnHeaderTitle",value:function(){var e=this,t=this.definition,i=document.createElement("div");if(i.classList.add("tabulator-col-title"),t.editableTitle){var n=document.createElement("input");n.classList.add("tabulator-title-editor"),n.addEventListener("click",(function(e){e.stopPropagation(),n.focus()})),n.addEventListener("change",(function(){t.title=n.value,e.dispatchExternal("columnTitleChanged",e.getComponent())})),i.appendChild(n),t.field?this.langBind("columns|"+t.field,(function(e){n.value=e||t.title||" "})):n.value=t.title||" "}else t.field?this.langBind("columns|"+t.field,(function(n){e._formatColumnHeaderTitle(i,n||t.title||" ")})):this._formatColumnHeaderTitle(i,t.title||" ");return i}},{key:"_formatColumnHeaderTitle",value:function(t,i){var n=this.chain("column-format",[this,i,t],null,(function(){return i}));switch(e(n)){case"object":n instanceof Node?t.appendChild(n):(t.innerHTML="",console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",n));break;case"undefined":t.innerHTML="";break;default:t.innerHTML=n}}},{key:"_buildGroupHeader",value:function(){var e=this;(this.element.classList.add("tabulator-col-group"),this.element.setAttribute("role","columngroup"),this.element.setAttribute("aria-title",this.definition.title),this.definition.cssClass)&&this.definition.cssClass.split(" ").forEach((function(t){e.element.classList.add(t)}));this.titleElement.style.textAlign=this.definition.headerHozAlign,this.element.appendChild(this.groupElement)}},{key:"_getFlatData",value:function(e){return e[this.field]}},{key:"_getNestedData",value:function(e){for(var t,i=e,n=this.fieldStructure,o=n.length,a=0;a-1&&this.columns.splice(t,1),this.columns.length||this.delete()}},{key:"setWidth",value:function(e){this.widthFixed=!0,this.setWidthActual(e)}},{key:"setWidthActual",value:function(e){isNaN(e)&&(e=Math.floor(this.table.element.clientWidth/100*parseInt(e))),e=Math.max(this.minWidth,e),this.maxWidth&&(e=Math.min(this.maxWidth,e)),this.width=e,this.widthStyled=e?e+"px":"",this.element.style.width=this.widthStyled,this.isGroup||this.cells.forEach((function(e){e.setWidth()})),this.parent.isGroup&&this.parent.matchChildWidths(),this.dispatch("column-width",this)}},{key:"checkCellHeights",value:function(){var e=[];this.cells.forEach((function(t){t.row.heightInitialized&&(null!==t.row.getElement().offsetParent?(e.push(t.row),t.row.clearCellHeight()):t.row.heightInitialized=!1)})),e.forEach((function(e){e.calcHeight()})),e.forEach((function(e){e.setCellHeight()}))}},{key:"getWidth",value:function(){var e=0;return this.isGroup?this.columns.forEach((function(t){t.visible&&(e+=t.getWidth())})):e=this.width,e}},{key:"getHeight",value:function(){return Math.ceil(this.element.getBoundingClientRect().height)}},{key:"setMinWidth",value:function(e){this.minWidth=e,this.minWidthStyled=e?e+"px":"",this.element.style.minWidth=this.minWidthStyled,this.cells.forEach((function(e){e.setMinWidth()}))}},{key:"setMaxWidth",value:function(e){this.maxWidth=e,this.maxWidthStyled=e?e+"px":"",this.element.style.maxWidth=this.maxWidthStyled,this.cells.forEach((function(e){e.setMaxWidth()}))}},{key:"delete",value:function(){var e=this;return new Promise((function(t,i){e.isGroup&&e.columns.forEach((function(e){e.delete()})),e.dispatch("column-delete",e);for(var n=e.cells.length,o=0;o-1&&this._nextVisibleColumn(e+1)}},{key:"_nextVisibleColumn",value:function(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._nextVisibleColumn(e+1)}},{key:"prevColumn",value:function(){var e=this.table.columnManager.findColumnIndex(this);return e>-1&&this._prevVisibleColumn(e-1)}},{key:"_prevVisibleColumn",value:function(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._prevVisibleColumn(e-1)}},{key:"reinitializeWidth",value:function(e){this.widthFixed=!1,void 0===this.definition.width||e||this.setWidth(this.definition.width),this.dispatch("column-width-fit-before",this),this.fitToData(e),this.dispatch("column-width-fit-after",this)}},{key:"fitToData",value:function(e){if(!this.isGroup){this.widthFixed||(this.element.style.width="",this.cells.forEach((function(e){e.clearWidth()})));var t=this.element.offsetWidth;if((!this.width||!this.widthFixed)&&(this.cells.forEach((function(e){var i=e.getWidth();i>t&&(t=i)})),t)){var i=t+1;this.maxInitialWidth&&!e&&(i=Math.min(i,this.maxInitialWidth)),this.setWidthActual(i)}}}},{key:"updateDefinition",value:function(e){var t,i=this;return this.isGroup||this.parent.isGroup?(console.error("Column Update Error - The updateDefinition function is only available on ungrouped columns"),Promise.reject("Column Update Error - The updateDefinition function is only available on columns, not column groups")):(t=Object.assign({},this.getDefinition()),t=Object.assign(t,e),this.table.columnManager.addColumn(t,!1,this).then((function(e){return t.field==i.field&&(i.field=!1),i.delete().then((function(){return e.getComponent()}))})))}},{key:"deleteCell",value:function(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}},{key:"getComponent",value:function(){return this.component||(this.component=new v(this)),this.component}}]),r}(g);C.defaultOptionList=b;var k=function(){function i(){t(this,i)}return o(i,null,[{key:"elVisible",value:function(e){return!(e.offsetWidth<=0&&e.offsetHeight<=0)}},{key:"elOffset",value:function(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}}},{key:"deepClone",value:function(t,i){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a={}.__proto__,r=[].__proto__;i||(i=Object.assign(Array.isArray(t)?[]:{},t));var s=function(){var s=t[l],u=void 0,c=void 0;null==s||"object"!==e(s)||s.__proto__!==a&&s.__proto__!==r||((u=o.findIndex((function(e){return e.subject===s})))>-1?i[l]=o[u].copy:(c=Object.assign(Array.isArray(s)?[]:{},s),o.unshift({subject:s,copy:c}),i[l]=n.deepClone(s,c,o)))};for(var l in t)s();return i}}]),i}(),E=function(){function i(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t(this,i),this.table=e,this.msgType=n,this.registeredDefaults=Object.assign({},o)}return o(i,[{key:"register",value:function(e,t){this.registeredDefaults[e]=t}},{key:"generate",value:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object.assign({},this.registeredDefaults);if(Object.assign(n,t),!1!==i.debugInvalidOptions||this.table.options.debugInvalidOptions)for(var o in i)n.hasOwnProperty(o)||console.warn("Invalid "+this.msgType+" option:",o);for(var o in n)o in i?n[o]=i[o]:Array.isArray(n[o])?n[o]=Object.assign([],n[o]):"object"===e(n[o])&&null!==n[o]?n[o]=Object.assign({},n[o]):void 0===n[o]&&delete n[o];return n}}]),i}(),R=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).elementVertical=e.rowManager.element,o.elementHorizontal=e.columnManager.element,o.tableElement=e.rowManager.tableElement,o.verticalFillMode="fit",o}return o(n,[{key:"initialize",value:function(){}},{key:"clearRows",value:function(){}},{key:"clearColumns",value:function(){}},{key:"reinitializeColumnWidths",value:function(e){}},{key:"renderRows",value:function(){}},{key:"renderColumns",value:function(){}},{key:"rerenderRows",value:function(e){e&&e()}},{key:"rerenderColumns",value:function(e,t){}},{key:"renderRowCells",value:function(e){}},{key:"rerenderRowCells",value:function(e,t){}},{key:"scrollColumns",value:function(e,t){}},{key:"scrollRows",value:function(e,t){}},{key:"resize",value:function(){}},{key:"scrollToRow",value:function(e){}},{key:"scrollToRowNearestTop",value:function(e){}},{key:"visibleRows",value:function(e){return[]}},{key:"rows",value:function(){return this.table.rowManager.getDisplayRows()}},{key:"styleRow",value:function(e,t){var i=e.getElement();t%2?(i.classList.add("tabulator-row-even"),i.classList.remove("tabulator-row-odd")):(i.classList.add("tabulator-row-odd"),i.classList.remove("tabulator-row-even"))}},{key:"clear",value:function(){this.clearRows(),this.clearColumns()}},{key:"render",value:function(){this.renderRows(),this.renderColumns()}},{key:"rerender",value:function(e){this.rerenderRows(),this.rerenderColumns()}},{key:"scrollToRowPosition",value:function(e,t,i){var n=this,o=this.rows().indexOf(e),a=e.getElement(),r=0;return new Promise((function(s,l){if(o>-1){if(void 0===i&&(i=n.table.options.scrollToRowIfVisible),!i&&k.elVisible(a)&&(r=k.elOffset(a).top-k.elOffset(n.elementVertical).top)>0&&re&&(e=i)}})),this.windowBuffer=2*e}},{key:"rerenderColumns",value:function(e,t){var i=this,n={cols:this.columns,leftCol:this.leftCol,rightCol:this.rightCol},o=0;e&&!this.initialized||(this.clear(),this.calcWindowBuffer(),this.scrollLeft=this.elementVertical.scrollLeft,this.vDomScrollPosLeft=this.scrollLeft-this.windowBuffer,this.vDomScrollPosRight=this.scrollLeft+this.elementVertical.clientWidth+this.windowBuffer,this.table.columnManager.columnsByIndex.forEach((function(e){var t={};if(e.visible){var n=e.getWidth();t.leftPos=o,t.rightPos=o+n,t.width=n,i.isFitData&&(t.fitDataCheck=!e.modules.vdomHoz||e.modules.vdomHoz.fitDataCheck),o+n>i.vDomScrollPosLeft&&othis.windowBuffer/2?this.rerenderColumns():e>0?(this.addColRight(),this.removeColLeft()):(this.addColLeft(),this.removeColRight())}},{key:"colPositionAdjust",value:function(e,t,i){for(var n=e;n=e.columns.length-1?e.vDomPadRight=0:e.vDomPadRight-=i.getWidth())):"break"};;){if("break"===i())break}t&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}},{key:"addColLeft",value:function(){for(var e=this,t=!1,i=function(){var i=e.columns[e.leftCol-1];if(!i)return"break";if(!(i.modules.vdomHoz.rightPos>=e.vDomScrollPosLeft))return"break";t=!0,e.getVisibleRows().forEach((function(e){if("group"!==e.type){var t=e.getCell(i);e.getElement().prepend(t.getElement()),t.cellRendered()}})),e.leftCol--,e.leftCol<=0?e.vDomPadLeft=0:e.vDomPadLeft-=i.getWidth();var n=e.fitDataColActualWidthCheck(i);n&&(e.scrollLeft=e.elementVertical.scrollLeft=e.elementVertical.scrollLeft+n,e.vDomPadRight-=n)};;){if("break"===i())break}t&&(this.tableElement.style.paddingLeft=this.vDomPadLeft+"px")}},{key:"removeColRight",value:function(){for(var e=this,t=!1,i=function(){var i=e.columns[e.rightCol];return i&&i.modules.vdomHoz.leftPos>e.vDomScrollPosRight?(t=!0,e.getVisibleRows().forEach((function(e){if("group"!==e.type){var t=e.getCell(i);try{e.getElement().removeChild(t.getElement())}catch(e){console.warn("Could not removeColRight",e.message)}}})),e.vDomPadRight+=i.getWidth(),void e.rightCol--):"break"};;){if("break"===i())break}t&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}},{key:"removeColLeft",value:function(){for(var e=this,t=!1,i=function(){var i=e.columns[e.leftCol];return i&&i.modules.vdomHoz.rightPosi?(t=e-i,this.element.style.marginLeft=-t+"px"):this.element.style.marginLeft=0,this.scrollLeft=e,this.renderer.scrollColumns(e)}},{key:"generateColumnsFromRowData",value:function(t){var i,n,o=[],a=this.table.options.autoColumnsDefinitions;if(t&&t.length){for(var r in i=t[0]){var s={field:r,title:r},l=i[r];switch(e(l)){case"undefined":n="string";break;case"boolean":n="boolean";break;case"object":n=Array.isArray(l)?"array":"string";break;default:n=isNaN(l)||""===l?l.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?"alphanum":"string":"number"}s.sorter=n,o.push(s)}if(a)switch(e(a)){case"function":this.table.options.columns=a.call(this.table,o);break;case"object":Array.isArray(a)?o.forEach((function(e){var t=a.find((function(t){return t.field===e.field}));t&&Object.assign(e,t)})):o.forEach((function(e){a[e.field]&&Object.assign(e,a[e.field])})),this.table.options.columns=o}else this.table.options.columns=o;this.setColumns(this.table.options.columns)}}},{key:"setColumns",value:function(e,t){for(var i=this;this.headersElement.firstChild;)this.headersElement.removeChild(this.headersElement.firstChild);this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.dispatch("columns-loading"),e.forEach((function(e,t){i._addColumn(e)})),this._reIndexColumns(),this.dispatch("columns-loaded"),this.renderer.rerenderColumns(!1,!0),this.redraw(!0)}},{key:"_addColumn",value:function(e,t,i){var n=new C(e,this),o=n.getElement(),a=i?this.findColumnIndex(i):i;if(i&&a>-1){var r=i.getTopColumn(),s=this.columns.indexOf(r),l=r.getElement();t?(this.columns.splice(s,0,n),l.parentNode.insertBefore(o,l)):(this.columns.splice(s+1,0,n),l.parentNode.insertBefore(o,l.nextSibling))}else t?(this.columns.unshift(n),this.headersElement.insertBefore(n.getElement(),this.headersElement.firstChild)):(this.columns.push(n),this.headersElement.appendChild(n.getElement()));return n.columnRendered(),n}},{key:"registerColumnField",value:function(e){e.definition.field&&(this.columnsByField[e.definition.field]=e)}},{key:"registerColumnPosition",value:function(e){this.columnsByIndex.push(e)}},{key:"_reIndexColumns",value:function(){this.columnsByIndex=[],this.columns.forEach((function(e){e.reRegisterPosition()}))}},{key:"verticalAlignHeaders",value:function(){var e=this,t=0;this.columns.forEach((function(e){var i;e.clearVerticalAlign(),(i=e.getHeight())>t&&(t=i)})),this.columns.forEach((function(i){i.verticalAlign(e.table.options.columnHeaderVertAlign,t)})),this.table.rowManager.adjustTableSize()}},{key:"findColumn",value:function(t){return"object"!=e(t)?this.columnsByField[t]||!1:t instanceof C?t:t instanceof v?t._getSelf()||!1:"undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&this.columns.find((function(e){return e.element===t}))||!1}},{key:"getColumnByField",value:function(e){return this.columnsByField[e]}},{key:"getColumnsByFieldRoot",value:function(e){var t=this,i=[];return Object.keys(this.columnsByField).forEach((function(n){n.split(".")[0]===e&&i.push(t.columnsByField[n])})),i}},{key:"getColumnByIndex",value:function(e){return this.columnsByIndex[e]}},{key:"getFirstVisibleColumn",value:function(e){return(e=this.columnsByIndex.findIndex((function(e){return e.visible})))>-1&&this.columnsByIndex[e]}},{key:"getColumns",value:function(){return this.columns}},{key:"findColumnIndex",value:function(e){return this.columnsByIndex.findIndex((function(t){return e===t}))}},{key:"getRealColumns",value:function(){return this.columnsByIndex}},{key:"traverse",value:function(e){this.columnsByIndex.forEach((function(t,i){e(t,i)}))}},{key:"getDefinitions",value:function(e){var t=[];return this.columnsByIndex.forEach((function(i){(!e||e&&i.visible)&&t.push(i.getDefinition())})),t}},{key:"getDefinitionTree",value:function(){var e=[];return this.columns.forEach((function(t){e.push(t.getDefinition(!0))})),e}},{key:"getComponents",value:function(e){var t=[];return(e?this.columns:this.columnsByIndex).forEach((function(e){t.push(e.getComponent())})),t}},{key:"getWidth",value:function(){var e=0;return this.columnsByIndex.forEach((function(t){t.visible&&(e+=t.getWidth())})),e}},{key:"moveColumn",value:function(e,t,i){this.moveColumnActual(e,t,i),t.element.parentNode.insertBefore(e.element,t.element),i&&t.element.parentNode.insertBefore(t.element,e.element),this.verticalAlignHeaders(),this.table.rowManager.reinitialize()}},{key:"moveColumnActual",value:function(e,t,i){e.parent.isGroup?this._moveColumnInArray(e.parent.columns,e,t,i):this._moveColumnInArray(this.columns,e,t,i),this._moveColumnInArray(this.columnsByIndex,e,t,i,!0),this.renderer.rerenderColumns(!0),this.dispatch("column-moved",e,t,i),this.subscribedExternal("columnMoved")&&this.dispatchExternal("columnMoved",e.getComponent(),this.table.columnManager.getComponents())}},{key:"_moveColumnInArray",value:function(e,t,i,n,o){var a,r=e.indexOf(t);r>-1&&(e.splice(r,1),(a=e.indexOf(i))>-1?n&&(a+=1):a=r,e.splice(a,0,t),o&&(this.chain("column-moving-rows",[t,i,n],null,[])||[]).concat(this.table.rowManager.rows).forEach((function(e){if(e.cells.length){var t=e.cells.splice(r,1)[0];e.cells.splice(a,0,t)}})))}},{key:"scrollToColumn",value:function(e,t,i){var n=this,o=0,a=0,r=0,s=e.getElement();return new Promise((function(l,u){if(void 0===t&&(t=n.table.options.scrollToColumnPosition),void 0===i&&(i=n.table.options.scrollToColumnIfVisible),e.visible){switch(t){case"middle":case"center":r=-n.element.clientWidth/2;break;case"right":r=s.clientWidth-n.headersElement.clientWidth}if(!i&&(a=s.offsetLeft)>0&&a+s.offsetWidththis.table.rowManager.element.clientHeight&&(e-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),this.columnsByIndex.forEach((function(i){var n,o,a;i.visible&&(n=i.definition.width||0,o=parseInt(i.minWidth),a="string"==typeof n?n.indexOf("%")>-1?e/100*parseInt(n):parseInt(n):n,t+=a>o?a:o)})),t}},{key:"addColumn",value:function(e,t,i){var n=this;return new Promise((function(o,a){var r=n._addColumn(e,t,i);n._reIndexColumns(),n.dispatch("column-add",e,t,i),"fitColumns"!=n.layoutMode()&&r.reinitializeWidth(),n.redraw(!0),n.table.rowManager.reinitialize(),n.renderer.rerenderColumns(),o(r)}))}},{key:"deregisterColumn",value:function(e){var t,i=e.getField();i&&delete this.columnsByField[i],(t=this.columnsByIndex.indexOf(e))>-1&&this.columnsByIndex.splice(t,1),(t=this.columns.indexOf(e))>-1&&this.columns.splice(t,1),this.verticalAlignHeaders(),this.redraw()}},{key:"redraw",value:function(e){k.elVisible(this.element)&&this.verticalAlignHeaders(),e&&(this.table.rowManager.resetScroll(),this.table.rowManager.reinitialize()),this.confirm("table-redrawing",e)||this.layoutRefresh(),this.dispatch("table-redraw",e),this.table.footerManager.redraw()}}]),r}(g),L=function(){function e(i){return t(this,e),this._row=i,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._row.table.componentFunctionBinder.handle("row",e._row,t)}})}return o(e,[{key:"getData",value:function(e){return this._row.getData(e)}},{key:"getElement",value:function(){return this._row.getElement()}},{key:"getCells",value:function(){var e=[];return this._row.getCells().forEach((function(t){e.push(t.getComponent())})),e}},{key:"getCell",value:function(e){var t=this._row.getCell(e);return!!t&&t.getComponent()}},{key:"getIndex",value:function(){return this._row.getData("data")[this._row.table.options.index]}},{key:"getPosition",value:function(e){return this._row.table.rowManager.getRowPosition(this._row,e)}},{key:"delete",value:function(){return this._row.delete()}},{key:"scrollTo",value:function(){return this._row.table.rowManager.scrollToRow(this._row)}},{key:"move",value:function(e,t){this._row.moveToRow(e,t)}},{key:"update",value:function(e){return this._row.updateData(e)}},{key:"normalizeHeight",value:function(){this._row.normalizeHeight(!0)}},{key:"_getSelf",value:function(){return this._row}},{key:"reformat",value:function(){return this._row.reinitialize()}},{key:"getTable",value:function(){return this._row.table}},{key:"getNextRow",value:function(){var e=this._row.nextRow();return e?e.getComponent():e}},{key:"getPrevRow",value:function(){var e=this._row.prevRow();return e?e.getComponent():e}}]),e}(),D=function(e){a(n,e);var i=c(n);function n(e,o){var a,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"row";return t(this,n),(a=i.call(this,o.table)).parent=o,a.data={},a.type=r,a.element=!1,a.modules={},a.cells=[],a.height=0,a.heightStyled="",a.manualHeight=!1,a.outerHeight=0,a.initialized=!1,a.heightInitialized=!1,a.component=null,a.created=!1,a.setData(e),a}return o(n,[{key:"create",value:function(){this.created||(this.created=!0,this.generateElement())}},{key:"createElement",value:function(){var e=document.createElement("div");e.classList.add("tabulator-row"),e.setAttribute("role","row"),this.element=e}},{key:"getElement",value:function(){return this.create(),this.element}},{key:"detachElement",value:function(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}},{key:"generateElement",value:function(){this.createElement(),this.dispatch("row-init",this)}},{key:"generateCells",value:function(){this.cells=this.table.columnManager.generateCells(this)}},{key:"initialize",value:function(e){if(this.create(),!this.initialized||e){for(this.deleteCells();this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.dispatch("row-layout-before",this),this.generateCells(),this.initialized=!0,this.table.columnManager.renderer.renderRowCells(this),e&&this.normalizeHeight(),this.dispatch("row-layout",this),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent()),this.dispatch("row-layout-after",this)}else this.table.columnManager.renderer.rerenderRowCells(this)}},{key:"reinitializeHeight",value:function(){this.heightInitialized=!1,this.element&&null!==this.element.offsetParent&&this.normalizeHeight(!0)}},{key:"deinitialize",value:function(){this.initialized=!1}},{key:"deinitializeHeight",value:function(){this.heightInitialized=!1}},{key:"reinitialize",value:function(e){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),this.element&&null!==this.element.offsetParent&&this.initialize(!0),this.dispatch("row-relayout",this)}},{key:"calcHeight",value:function(e){var t,i=0;this.table.options.rowHeight?this.height=this.table.options.rowHeight:(t=this.table.options.resizableRows?this.element.clientHeight:0,this.cells.forEach((function(e){var t=e.getHeight();t>i&&(i=t)})),this.height=e?Math.max(i,t):this.manualHeight?this.height:Math.max(i,t)),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight}},{key:"setCellHeight",value:function(){this.cells.forEach((function(e){e.setHeight()})),this.heightInitialized=!0}},{key:"clearCellHeight",value:function(){this.cells.forEach((function(e){e.clearHeight()}))}},{key:"normalizeHeight",value:function(e){e&&!this.table.options.rowHeight&&this.clearCellHeight(),this.calcHeight(e),this.setCellHeight()}},{key:"setHeight",value:function(e,t){(this.height!=e||t)&&(this.manualHeight=!0,this.height=e,this.heightStyled=e?e+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight)}},{key:"getHeight",value:function(){return this.outerHeight}},{key:"getWidth",value:function(){return this.element.offsetWidth}},{key:"deleteCell",value:function(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}},{key:"setData",value:function(e){this.data=this.chain("row-data-init-before",[this,e],void 0,e),this.dispatch("row-data-init-after",this)}},{key:"updateData",value:function(e){var t,i=this,n=this.element&&k.elVisible(this.element),o={};return new Promise((function(a,r){for(var s in"string"==typeof e&&(e=JSON.parse(e)),i.dispatch("row-data-save-before",i),i.subscribed("row-data-changing")&&(o=Object.assign(o,i.data),o=Object.assign(o,e)),t=i.chain("row-data-changing",[i,o,e],null,e))i.data[s]=t[s];for(var s in i.dispatch("row-data-save-after",i),e){i.table.columnManager.getColumnsByFieldRoot(s).forEach((function(e){var o=i.getCell(e.getField());if(o){var a=e.getFieldValue(t);o.getValue()!=a&&(o.setValueProcessData(a),n&&o.cellRendered())}}))}n?(i.normalizeHeight(!0),i.table.options.rowFormatter&&i.table.options.rowFormatter(i.getComponent())):(i.initialized=!1,i.height=0,i.heightStyled=""),i.dispatch("row-data-changed",i,n,e),i.dispatchExternal("rowUpdated",i.getComponent()),i.subscribedExternal("dataChanged")&&i.dispatchExternal("dataChanged",i.table.rowManager.getData()),a()}))}},{key:"getData",value:function(e){return e?this.chain("row-data-retrieve",[this,e],null,this.data):this.data}},{key:"getCell",value:function(e){return e=this.table.columnManager.findColumn(e),this.initialized||this.generateCells(),this.cells.find((function(t){return t.column===e}))}},{key:"getCellIndex",value:function(e){return this.cells.findIndex((function(t){return t===e}))}},{key:"findCell",value:function(e){return this.cells.find((function(t){return t.element===e}))}},{key:"getCells",value:function(){return this.initialized||this.generateCells(),this.cells}},{key:"nextRow",value:function(){return this.table.rowManager.nextDisplayRow(this,!0)||!1}},{key:"prevRow",value:function(){return this.table.rowManager.prevDisplayRow(this,!0)||!1}},{key:"moveToRow",value:function(e,t){var i=this.table.rowManager.findRow(e);i?(this.table.rowManager.moveRowActual(this,i,!t),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",e)}},{key:"delete",value:function(){return this.dispatch("row-delete",this),this.deleteActual(),Promise.resolve()}},{key:"deleteActual",value:function(e){this.table.rowManager.getRowIndex(this);this.detatchModules(),this.table.rowManager.deleteRow(this,e),this.deleteCells(),this.initialized=!1,this.heightInitialized=!1,this.element=!1,this.dispatch("row-deleted",this)}},{key:"detatchModules",value:function(){this.dispatch("row-deleting",this)}},{key:"deleteCells",value:function(){for(var e=this.cells.length,t=0;tMath.abs(this.elementVertical.scrollTop+this.elementVertical.clientHeight-t))}},{key:"scrollToRow",value:function(e){var t=e.getElement();this.elementVertical.scrollTop=k.elOffset(t).top-k.elOffset(this.elementVertical).top+this.elementVertical.scrollTop}},{key:"visibleRows",value:function(e){return this.rows()}}]),n}(R),P=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).verticalFillMode="fill",o.scrollTop=0,o.scrollLeft=0,o.vDomRowHeight=20,o.vDomTop=0,o.vDomBottom=0,o.vDomScrollPosTop=0,o.vDomScrollPosBottom=0,o.vDomTopPad=0,o.vDomBottomPad=0,o.vDomMaxRenderChain=90,o.vDomWindowBuffer=0,o.vDomWindowMinTotalRows=20,o.vDomWindowMinMarginRows=5,o.vDomTopNewRows=[],o.vDomBottomNewRows=[],o}return o(n,[{key:"clearRows",value:function(){for(var e=this.tableElement;e.firstChild;)e.removeChild(e.firstChild);e.style.paddingTop="",e.style.paddingBottom="",e.style.minHeight="",e.style.display="",e.style.visibility="",this.elementVertical.scrollTop=0,this.elementVertical.scrollLeft=0,this.scrollTop=0,this.scrollLeft=0,this.vDomTop=0,this.vDomBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0}},{key:"renderRows",value:function(){this._virtualRenderFill()}},{key:"rerenderRows",value:function(e){for(var t=this.elementVertical.scrollTop,i=!1,n=!1,o=this.table.rowManager.scrollLeft,a=this.rows(),r=this.vDomTop;r<=this.vDomBottom;r++)if(a[r]){var s=t-a[r].getElement().offsetTop;if(!(!1===n||Math.abs(s)o||n>o){var r=this.table.rowManager.scrollLeft;this._virtualRenderFill(Math.floor(this.elementVertical.scrollTop/this.elementVertical.scrollHeight*a.length)),this.scrollColumns(r)}else t?(i<0&&this._addTopRow(a,-i),n<0&&(this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer?this._removeBottomRow(a,-n):this.vDomScrollPosBottom=this.scrollTop)):(n>=0&&this._addBottomRow(a,n),i>=0&&(this.scrollTop>this.vDomWindowBuffer?this._removeTopRow(a,i):this.vDomScrollPosTop=this.scrollTop))}},{key:"resize",value:function(){this.vDomWindowBuffer=this.table.options.renderVerticalBuffer||this.elementVertical.clientHeight}},{key:"scrollToRowNearestTop",value:function(e){var t=this.rows().indexOf(e);return!(Math.abs(this.vDomTop-t)>Math.abs(this.vDomBottom-t))}},{key:"scrollToRow",value:function(e){var t=this.rows().indexOf(e);t>-1&&this._virtualRenderFill(t,!0)}},{key:"visibleRows",value:function(e){var t=this.elementVertical.scrollTop,i=this.elementVertical.clientHeight+t,n=!1,o=0,a=0,r=this.rows();if(e)o=this.vDomTop,a=this.vDomBottom;else for(var s=this.vDomTop;s<=this.vDomBottom;s++)if(r[s])if(n){if(!(i-r[s].getElement().offsetTop>=0))break;a=s}else if(t-r[s].getElement().offsetTop>=0)o=s;else{if(n=!0,!(i-r[s].getElement().offsetTop>=0))break;a=s}return r.slice(o,a+1)}},{key:"_virtualRenderFill",value:function(e,t,i){var n=this.tableElement,o=this.elementVertical,a=0,r=0,s=0,l=0,u=0,c=this.rows(),h=c.length,d=this.elementVertical.clientHeight;if(i=i||0,e=e||0){for(;n.firstChild;)n.removeChild(n.firstChild);(s=(h-e+1)*this.vDomRowHeight)this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*m),this.vDomBottom++,u++}e?(this.vDomTopPad=t?this.vDomRowHeight*this.vDomTop+i:this.scrollTop-l,this.vDomBottomPad=this.vDomBottom==h-1?0:Math.max(this.vDomScrollHeight-this.vDomTopPad-r-l,0)):(this.vDomTopPad=0,this.vDomRowHeight=Math.floor((r+l)/u),this.vDomBottomPad=this.vDomRowHeight*(h-this.vDomBottom-1),this.vDomScrollHeight=l+r+this.vDomBottomPad-d),n.style.paddingTop=this.vDomTopPad+"px",n.style.paddingBottom=this.vDomBottomPad+"px",t&&(this.scrollTop=this.vDomTopPad+l+i-(this.elementVertical.scrollWidth>this.elementVertical.clientWidth?this.elementVertical.offsetHeight-d:0)),this.scrollTop=Math.min(this.scrollTop,this.elementVertical.scrollHeight-d),this.elementVertical.scrollWidth>this.elementVertical.offsetWidth&&t&&(this.scrollTop+=this.elementVertical.offsetHeight-d),this.vDomScrollPosTop=this.scrollTop,this.vDomScrollPosBottom=this.scrollTop,o.scrollTop=this.scrollTop,this.dispatch("render-virtual-fill")}}},{key:"_addTopRow",value:function(e,t){for(var i=this.tableElement,n=[],o=0,a=this.vDomTop-1,r=0;this.vDomTop;){var s=e[a],l=void 0,u=void 0;if(!(s&&r=l))break;this.styleRow(s,a),i.insertBefore(s.getElement(),i.firstChild),s.initialized&&s.heightInitialized||n.push(s),s.initialize(),u||(l=s.getElement().offsetHeight)>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*l),t-=l,o+=l,this.vDomTop--,a--,r++}for(var c=0,h=n;c=(r=a.getHeight()||this.vDomRowHeight)))break;this.vDomTop++,t-=r,n+=r,i.push(a),o++}for(var s=0,l=i;s=l))break;this.styleRow(s,a),i.appendChild(s.getElement()),s.initialized&&s.heightInitialized||n.push(s),s.initialize(),u||(l=s.getElement().offsetHeight)>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*l),t-=l,o+=l,this.vDomBottom++,a++,r++}for(var c=0,h=n;c=(r=a.getHeight()||this.vDomRowHeight)))break;this.vDomBottom--,t-=r,n+=r,i.push(a),o++}for(var s=0,l=i;st,n=e.element.scrollTop,o=e.scrollTop>n;e.scrollLeft!=t&&(e.scrollLeft=t,e.dispatch("scroll-horizontal",t,i),e.dispatchExternal("scrollHorizontal",t,i),e._positionPlaceholder()),e.scrollTop!=n&&(e.scrollTop=n,e.renderer.scrollRows(n,o),e.dispatch("scroll-vertical",n,o),e.dispatchExternal("scrollVertical",n,o))}))}},{key:"findRow",value:function(t){var i=this;return"object"!=e(t)?null!=t&&(this.rows.find((function(e){return e.data[i.table.options.index]==t}))||!1):t instanceof D?t:t instanceof L?t._getSelf()||!1:"undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&this.rows.find((function(e){return e.getElement()===t}))||!1}},{key:"getRowFromDataObject",value:function(e){return this.rows.find((function(t){return t.data===e}))||!1}},{key:"getRowFromPosition",value:function(e,t){return t?this.activeRows[e]:this.rows[e]}},{key:"scrollToRow",value:function(e,t,i){return this.renderer.scrollToRowPosition(e,t,i)}},{key:"setData",value:function(e,t,i){var n=this;return new Promise((function(o,a){t&&n.getDisplayRows().length?n.table.options.pagination?n._setDataActual(e,!0):n.reRenderInPosition((function(){n._setDataActual(e)})):(n.table.options.autoColumns&&i&&n.table.initialized&&n.table.columnManager.generateColumnsFromRowData(e),n.resetScroll(),n._setDataActual(e)),o()}))}},{key:"_setDataActual",value:function(t,i){var n=this;this.dispatchExternal("dataProcessing",t),this._wipeElements(),Array.isArray(t)?(this.dispatch("data-processing",t),t.forEach((function(t,i){if(t&&"object"===e(t)){var o=new D(t,n);n.rows.push(o)}else console.warn("Data Loading Warning - Invalid row data detected and ignored, expecting object but received:",t)})),this.refreshActiveData(!1,!1,i),this.dispatch("data-processed",t),this.dispatchExternal("dataProcessed",t)):console.error("Data Loading Error - Unable to process data due to invalid data type \nExpecting: array \nReceived: ",e(t),"\nData: ",t)}},{key:"_wipeElements",value:function(){this.dispatch("rows-wipe"),this.rows.forEach((function(e){e.wipe()})),this.rows=[],this.activeRows=[],this.activeRowsPipeline=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.adjustTableSize()}},{key:"deleteRow",value:function(e,t){var i=this.rows.indexOf(e),n=this.activeRows.indexOf(e);n>-1&&this.activeRows.splice(n,1),i>-1&&this.rows.splice(i,1),this.setActiveRows(this.activeRows),this.displayRowIterator((function(t){var i=t.indexOf(e);i>-1&&t.splice(i,1)})),t||this.reRenderInPosition(),this.regenerateRowNumbers(),this.dispatchExternal("rowDeleted",e.getComponent()),this.displayRowsCount||this._showPlaceholder(),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.getData())}},{key:"addRow",value:function(e,t,i,n){return this.addRowActual(e,t,i,n)}},{key:"addRows",value:function(e,t,i){var n=this,o=[];return new Promise((function(a,r){t=n.findAddRowPos(t),Array.isArray(e)||(e=[e]),e.length,(void 0===i&&t||void 0!==i&&!t)&&e.reverse(),e.forEach((function(a,r){var s=n.addRow(a,t,i,!0);o.push(s),n.dispatch("row-added",s,e,t,i)})),n.refreshActiveData(!1,!1,!0),n.regenerateRowNumbers(),o.length&&n._clearPlaceholder(),a(o)}))}},{key:"findAddRowPos",value:function(e){return void 0===e&&(e=this.table.options.addRowPos),"pos"===e&&(e=!0),"bottom"===e&&(e=!1),e}},{key:"addRowActual",value:function(e,t,i,n){var o,a,r=e instanceof D?e:new D(e||{},this),s=this.findAddRowPos(t),l=-1;return i||(a=this.chain("row-adding-position",[r,s],null,{index:i,top:s}),i=a.index,s=a.top),void 0!==i&&(i=this.findRow(i)),(i=this.chain("row-adding-index",[r,i,s],null,i))&&(l=this.rows.indexOf(i)),i&&l>-1?(o=this.activeRows.indexOf(i),this.displayRowIterator((function(e){var t=e.indexOf(i);t>-1&&e.splice(s?t:t+1,0,r)})),o>-1&&this.activeRows.splice(s?o:o+1,0,r),this.rows.splice(s?l:l+1,0,r)):s?(this.displayRowIterator((function(e){e.unshift(r)})),this.activeRows.unshift(r),this.rows.unshift(r)):(this.displayRowIterator((function(e){e.push(r)})),this.activeRows.push(r),this.rows.push(r)),this.setActiveRows(this.activeRows),this.dispatchExternal("rowAdded",r.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),n||this.reRenderInPosition(),r}},{key:"moveRow",value:function(e,t,i){this.dispatch("row-move",e,t,i),this.moveRowActual(e,t,i),this.regenerateRowNumbers(),this.dispatch("row-moved",e,t,i),this.dispatchExternal("rowMoved",e.getComponent())}},{key:"moveRowActual",value:function(e,t,i){var n=this;this.moveRowInArray(this.rows,e,t,i),this.moveRowInArray(this.activeRows,e,t,i),this.displayRowIterator((function(o){n.moveRowInArray(o,e,t,i)})),this.dispatch("row-moving",e,t,i)}},{key:"moveRowInArray",value:function(e,t,i,n){var o,a,r;if(t!==i&&((o=e.indexOf(t))>-1&&(e.splice(o,1),(a=e.indexOf(i))>-1?n?e.splice(a+1,0,t):e.splice(a,0,t):e.splice(o,0,t)),e===this.getDisplayRows())){r=a>o?a:o+1;for(var s=o-1&&t}},{key:"nextDisplayRow",value:function(e,t){var i=this.getDisplayRowIndex(e),n=!1;return!1!==i&&i-1)&&i}},{key:"getData",value:function(e,t){var i=[];return this.getRows(e).forEach((function(e){"row"==e.type&&i.push(e.getData(t||"data"))})),i}},{key:"getComponents",value:function(e){var t=[];return this.getRows(e).forEach((function(e){t.push(e.getComponent())})),t}},{key:"getDataCount",value:function(e){return this.getRows(e).length}},{key:"scrollHorizontal",value:function(e){this.scrollLeft=e,this.element.scrollLeft=e,this.dispatch("scroll-horizontal",e)}},{key:"registerDataPipelineHandler",value:function(e,t){void 0!==t?(this.dataPipeline.push({handler:e,priority:t}),this.dataPipeline.sort((function(e,t){return e.priority-t.priority}))):console.error("Data pipeline handlers must have a priority in order to be registered")}},{key:"registerDisplayPipelineHandler",value:function(e,t){void 0!==t?(this.displayPipeline.push({handler:e,priority:t}),this.displayPipeline.sort((function(e,t){return e.priority-t.priority}))):console.error("Display pipeline handlers must have a priority in order to be registered")}},{key:"refreshActiveData",value:function(e,t,i){var n=this.table,o="",a=0,r=["all","dataPipeline","display","displayPipeline","end"];if("function"==typeof e)if((a=this.dataPipeline.findIndex((function(t){return t.handler===e})))>-1)o="dataPipeline",t&&(a==this.dataPipeline.length-1?o="display":a++);else{if(!((a=this.displayPipeline.findIndex((function(t){return t.handler===e})))>-1))return void console.error("Unable to refresh data, invalid handler provided",e);o="displayPipeline",t&&(a==this.displayPipeline.length-1?o="end":a++)}else o=e||"all",a=0;this.redrawBlock?(!this.redrawBlockRestoreConfig||this.redrawBlockRestoreConfig&&(this.redrawBlockRestoreConfig.stage===o&&a-1&&(n.splice(o,1),a=!0),"mouseenter"!==t&&"mouseleave"!==t||this.pseudoTracking||this.bindPseudoEvents(),a&&this.updateEventListeners()}},{key:"updateEventListeners",value:function(){for(var e in this.listeners){var t=this.listeners[e];t.components.length?t.handler||(t.handler=this.track.bind(this,e),this.el.addEventListener(e,t.handler)):t.handler&&(this.el.removeEventListener(e,t.handler),t.handler=null)}}},{key:"track",value:function(e,t){var i=t.composedPath&&t.composedPath()||t.path,n=this.findTargets(i);n=this.bindComponents(e,n),this.triggerEvents(e,t,n),!this.pseudoTracking||"mouseover"!=e&&"mouseleave"!=e||Object.keys(n).length||this.pseudoMouseLeave("none",t)}},{key:"findTargets",value:function(e){var t,i=this,n={},o=Object.keys(this.componentMap),a=f(e);try{for(a.s();!(t=a.n()).done;){var r=t.value,s=r.classList?d(r.classList):[];if(s.filter((function(e){return i.abortClasses.includes(e)})).length)break;var l,u=f(s.filter((function(e){return o.includes(e)})));try{for(u.s();!(l=u.n()).done;){var c=l.value;n[this.componentMap[c]]=r}}catch(e){u.e(e)}finally{u.f()}}}catch(e){a.e(e)}finally{a.f()}return n.group&&n.group===n.row&&delete n.row,n}},{key:"bindComponents",value:function(e,t){var i,n=this,o=Object.keys(t).reverse(),a=this.listeners[e],r={},s=f(o);try{var l=function(){var e=i.value,o=void 0,s=t[e],l=n.previousTargets[e];if(l&&l.target===s)o=l.component;else switch(e){case"row":case"group":if(a.components.includes("row")||a.components.includes("cell")||a.components.includes("group"))o=n.table.rowManager.getVisibleRows(!0).find((function(e){return e.getElement()===s})),t.row&&t.row.parentNode&&t.row.parentNode.closest(".tabulator-row")&&(t[e]=!1);break;case"column":a.components.includes("column")&&(o=n.table.columnManager.findColumn(s));break;case"cell":a.components.includes("cell")&&(t.row instanceof D?o=t.row.findCell(s):t.row&&console.warn("Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?"))}o&&(t[e]=o,r[e]={target:s,component:o})};for(s.s();!(i=s.n()).done;)l()}catch(e){s.e(e)}finally{s.f()}return this.previousTargets=r,t}},{key:"triggerEvents",value:function(e,t,i){var n=this.listeners[e];for(var o in i)i[o]&&n.components.includes(o)&&this.dispatch(o+"-"+e,t,i[o])}},{key:"clearWatchers",value:function(){for(var e in this.listeners){var t=this.listeners[e];t.handler&&(this.el.removeEventListener(e,t.handler),t.handler=null)}}}]),n}(g),_=function(){function e(i){t(this,e),this.table=i,this.bindings={}}return o(e,[{key:"bind",value:function(e,t,i){this.bindings[e]||(this.bindings[e]={}),this.bindings[e][t]?console.warn("Unable to bind component handler, a matching function name is already bound",e,t,i):this.bindings[e][t]=i}},{key:"handle",value:function(e,t,i){if(this.bindings[e]&&this.bindings[e][i]&&"function"==typeof this.bindings[e][i].bind)return this.bindings[e][i].bind(null,t);"then"===i||"string"!=typeof i||i.startsWith("_")||console.error("The "+e+" component does not have a "+i+" function, have you checked that you have the correct Tabulator module installed?")}}]),e}(),O=function(i){a(r,i);var n=c(r);function r(e){var i;return t(this,r),(i=n.call(this,e)).requestOrder=0,i.loading=!1,i}return o(r,[{key:"initialize",value:function(){}},{key:"load",value:function(t,i,n,o,a,r){var s=this,l=++this.requestOrder;return this.dispatchExternal("dataLoading",t),!t||0!=t.indexOf("{")&&0!=t.indexOf("[")||(t=JSON.parse(t)),this.confirm("data-loading",[t,i,n,a])?(this.loading=!0,a||this.alertLoader(),i=this.chain("data-params",[t,n,a],i||{},i||{}),i=this.mapParams(i,this.table.options.dataSendParams),this.chain("data-load",[t,i,n,a],!1,Promise.resolve([])).then((function(t){Array.isArray(t)||"object"!=e(t)||(t=s.mapParams(t,s.objectInvert(s.table.options.dataReceiveParams)));var i=s.chain("data-loaded",t,null,t);l==s.requestOrder?(s.clearAlert(),!1!==i&&(s.dispatchExternal("dataLoaded",i),s.table.rowManager.setData(i,o,void 0===r?!o:r))):console.warn("Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made")})).catch((function(e){console.error("Data Load Error: ",e),s.dispatchExternal("dataLoadError",e),a||s.alertError(),setTimeout((function(){s.clearAlert()}),s.table.options.dataLoaderErrorTimeout)})).finally((function(){s.loading=!1}))):(this.dispatchExternal("dataLoaded",t),t||(t=[]),this.table.rowManager.setData(t,o,void 0===r?!o:r),Promise.resolve())}},{key:"mapParams",value:function(e,t){var i={};for(var n in e)i[t.hasOwnProperty(n)?t[n]:n]=e[n];return i}},{key:"objectInvert",value:function(e){var t={};for(var i in e)t[e[i]]=i;return t}},{key:"blockActiveLoad",value:function(){this.requestOrder++}},{key:"alertLoader",value:function(){("function"==typeof this.table.options.dataLoader?this.table.options.dataLoader():this.table.options.dataLoader)&&this.table.alertManager.alert(this.table.options.dataLoaderLoading||this.langText("data|loading"))}},{key:"alertError",value:function(){this.table.alertManager.alert(this.table.options.dataLoaderError||this.langText("data|error"),"error")}},{key:"clearAlert",value:function(){this.table.alertManager.clear()}}]),r}(g),A=function(){function e(i,n,o){t(this,e),this.table=i,this.events={},this.optionsList=n||{},this.subscriptionNotifiers={},this.dispatch=o?this._debugDispatch.bind(this):this._dispatch.bind(this),this.debug=o}return o(e,[{key:"subscriptionChange",value:function(e,t){this.subscriptionNotifiers[e]||(this.subscriptionNotifiers[e]=[]),this.subscriptionNotifiers[e].push(t),this.subscribed(e)&&this._notifiySubscriptionChange(e,!0)}},{key:"subscribe",value:function(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t),this._notifiySubscriptionChange(e,!0)}},{key:"unsubscribe",value:function(e,t){var i;if(this.events[e]){if(t){if(!((i=this.events[e].findIndex((function(e){return e===t})))>-1))return void console.warn("Cannot remove event, no matching event found:",e,t);this.events[e].splice(i,1)}else delete this.events[e];this._notifiySubscriptionChange(e,!1)}else console.warn("Cannot remove event, no events set on:",e)}},{key:"subscribed",value:function(e){return this.events[e]&&this.events[e].length}},{key:"_notifiySubscriptionChange",value:function(e,t){var i=this.subscriptionNotifiers[e];i&&i.forEach((function(e){e(t)}))}},{key:"_dispatch",value:function(){var e,t=this,i=Array.from(arguments),n=i.shift();return this.events[n]&&this.events[n].forEach((function(n,o){var a=n.apply(t.table,i);o||(e=a)})),e}},{key:"_debugDispatch",value:function(){var e,t=Array.from(arguments),i=t[0];(t[0]="ExternalEvent:"+t[0],!0===this.debug||this.debug.includes(i))&&(e=console).log.apply(e,d(t));return this._dispatch.apply(this,arguments)}}]),e}(),B=function(){function e(i){t(this,e),this.events={},this.subscriptionNotifiers={},this.dispatch=i?this._debugDispatch.bind(this):this._dispatch.bind(this),this.chain=i?this._debugChain.bind(this):this._chain.bind(this),this.confirm=i?this._debugConfirm.bind(this):this._confirm.bind(this),this.debug=i}return o(e,[{key:"subscriptionChange",value:function(e,t){this.subscriptionNotifiers[e]||(this.subscriptionNotifiers[e]=[]),this.subscriptionNotifiers[e].push(t),this.subscribed(e)&&this._notifiySubscriptionChange(e,!0)}},{key:"subscribe",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e4;this.events[e]||(this.events[e]=[]),this.events[e].push({callback:t,priority:i}),this.events[e].sort((function(e,t){return e.priority-t.priority})),this._notifiySubscriptionChange(e,!0)}},{key:"unsubscribe",value:function(e,t){var i;if(this.events[e]){if(t){if(!((i=this.events[e].findIndex((function(e){return e.callback===t})))>-1))return void console.warn("Cannot remove event, no matching event found:",e,t);this.events[e].splice(i,1)}this._notifiySubscriptionChange(e,!1)}else console.warn("Cannot remove event, no events set on:",e)}},{key:"subscribed",value:function(e){return this.events[e]&&this.events[e].length}},{key:"_chain",value:function(e,t,i,n){var o=this,a=i;return Array.isArray(t)||(t=[t]),this.subscribed(e)?(this.events[e].forEach((function(e,i){a=e.callback.apply(o,t.concat([a]))})),a):"function"==typeof n?n():n}},{key:"_confirm",value:function(e,t){var i=this,n=!1;return Array.isArray(t)||(t=[t]),this.subscribed(e)&&this.events[e].forEach((function(e,o){e.callback.apply(i,t)&&(n=!0)})),n}},{key:"_notifiySubscriptionChange",value:function(e,t){var i=this.subscriptionNotifiers[e];i&&i.forEach((function(e){e(t)}))}},{key:"_dispatch",value:function(){var e=this,t=Array.from(arguments),i=t.shift();this.events[i]&&this.events[i].forEach((function(i){i.callback.apply(e,t)}))}},{key:"_debugDispatch",value:function(){var e,t=Array.from(arguments),i=t[0];(t[0]="InternalEvent:"+i,!0===this.debug||this.debug.includes(i))&&(e=console).log.apply(e,d(t));return this._dispatch.apply(this,arguments)}},{key:"_debugChain",value:function(){var e,t=Array.from(arguments),i=t[0];(t[0]="InternalEvent:"+i,!0===this.debug||this.debug.includes(i))&&(e=console).log.apply(e,d(t));return this._chain.apply(this,arguments)}},{key:"_debugConfirm",value:function(){var e,t=Array.from(arguments),i=t[0];(t[0]="InternalEvent:"+i,!0===this.debug||this.debug.includes(i))&&(e=console).log.apply(e,d(t));return this._confirm.apply(this,arguments)}}]),e}(),I=function(){function e(){t(this,e)}return o(e,null,[{key:"register",value:function(t){e.tables.push(t)}},{key:"deregister",value:function(t){var i=e.tables.indexOf(t);i>-1&&e.tables.splice(i,1)}},{key:"lookupTable",value:function(t,i){var n,o,a=[];if("string"==typeof t){if((n=document.querySelectorAll(t)).length)for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:this.table.element;return e===t||!!t.parentNode&&this._checkContainerIsParent(e,t.parentNode)}},{key:"renderCallback",value:function(e){this.renderedCallback=e}},{key:"containerEventCoords",value:function(e){var t=!(e instanceof MouseEvent),i=t?e.touches[0].pageX:e.pageX,n=t?e.touches[0].pageY:e.pageY;if(this.container!==document.body){var o=k.elOffset(this.container);i-=o.left,n-=o.top}return{x:i,y:n}}},{key:"elementPositionCoords",value:function(e){var t,i,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"right",a=k.elOffset(e);switch(this.container!==document.body&&(t=k.elOffset(this.container),a.left-=t.left,a.top-=t.top),o){case"right":i=a.left+e.offsetWidth,n=a.top-1;break;case"bottom":i=a.left,n=a.top+e.offsetHeight}return{x:i,y:n,offset:a}}},{key:"show",value:function(e,t){var i,n,o,a,r;return e instanceof HTMLElement?(o=e,a=(r=this.elementPositionCoords(e,t)).offset,i=r.x,n=r.y):"number"==typeof e?(a={top:0,left:0},i=e,n=t):(i=(r=this.containerEventCoords(e)).x,n=r.y,this.reversedX=!1),this.element.style.top=n+"px",this.element.style.left=i+"px",this.container.appendChild(this.element),"function"==typeof this.renderedCallback&&this.renderedCallback(),this._fitToScreen(i,n,o,a,t),this.visible=!0,this.subscribe("table-destroy",this.destroyBinding),this}},{key:"_fitToScreen",value:function(e,t,i,n,o){var a=this.container===document.body?document.documentElement.scrollTop:this.container.scrollTop;if((e+this.element.offsetWidth>=this.container.offsetWidth||this.reversedX)&&(this.element.style.left="",this.element.style.right=i?this.container.offsetWidth-n.left+"px":this.container.offsetWidth-e+"px",this.reversedX=!0),t+this.element.offsetHeight>Math.max(this.container.offsetHeight,a?this.container.scrollHeight:0))if(i)switch(o){case"bottom":this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight-i.offsetHeight-1+"px";break;default:this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+i.offsetHeight+1+"px"}else this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+"px"}},{key:"isVisible",value:function(){return this.visible}},{key:"hideOnBlur",value:function(e){var t=this;return this.blurable=!0,this.visible&&(setTimeout((function(){t.table.rowManager.element.addEventListener("scroll",t.blurEvent),t.subscribe("cell-editing",t.blurEvent),document.body.addEventListener("click",t.blurEvent),document.body.addEventListener("contextmenu",t.blurEvent),window.addEventListener("resize",t.blurEvent),document.body.addEventListener("keydown",t.escEvent)}),100),this.blurCallback=e),this}},{key:"_escapeCheck",value:function(e){27==e.keyCode&&this.hide()}},{key:"hide",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.visible&&(this.blurable&&(document.body.removeEventListener("keydown",this.escEvent),document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),window.removeEventListener("resize",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent),this.unsubscribe("cell-editing",this.blurEvent)),this.childPopup&&this.childPopup.hide(),this.parent&&(this.parent.childPopup=null),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.visible=!1,this.blurCallback&&!e&&this.blurCallback(),this.unsubscribe("table-destroy",this.destroyBinding)),this}},{key:"child",value:function(e){return this.childPopup&&this.childPopup.hide(),this.childPopup=new n(this.table,e,this),this.childPopup}}]),n}(g),V=function(e){a(n,e);var i=c(n);function n(e,o){var a;return t(this,n),(a=i.call(this,e))._handler=null,a}return o(n,[{key:"initialize",value:function(){}},{key:"registerTableOption",value:function(e,t){this.table.optionsList.register(e,t)}},{key:"registerColumnOption",value:function(e,t){this.table.columnManager.optionsList.register(e,t)}},{key:"registerTableFunction",value:function(e,t){var i=this;void 0===this.table[e]?this.table[e]=function(){return i.table.initGuard(e),t.apply(void 0,arguments)}:console.warn("Unable to bind table function, name already in use",e)}},{key:"registerComponentFunction",value:function(e,t,i){return this.table.componentFunctionBinder.bind(e,t,i)}},{key:"registerDataHandler",value:function(e,t){this.table.rowManager.registerDataPipelineHandler(e,t),this._handler=e}},{key:"registerDisplayHandler",value:function(e,t){this.table.rowManager.registerDisplayPipelineHandler(e,t),this._handler=e}},{key:"refreshData",value:function(e,t){t||(t=this._handler),t&&this.table.rowManager.refreshActiveData(t,!1,e)}},{key:"footerAppend",value:function(e){return this.table.footerManager.append(e)}},{key:"footerPrepend",value:function(e){return this.table.footerManager.prepend(e)}},{key:"footerRemove",value:function(e){return this.table.footerManager.remove(e)}},{key:"popup",value:function(e,t){return new N(this.table,e,t)}},{key:"alert",value:function(e,t){return this.table.alertManager.alert(e,t)}},{key:"clearAlert",value:function(){return this.table.alertManager.clear()}}]),n}(g);function W(e){e.forEach((function(e){e.reinitializeWidth()})),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()}var j={fitData:function(e){this.table.columnManager.renderer.reinitializeColumnWidths(e),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitDataFill:W,fitDataTable:W,fitDataStretch:function(e){var t=this,i=0,n=this.table.rowManager.element.clientWidth,o=0,a=!1;e.forEach((function(e,n){e.widthFixed||e.reinitializeWidth(),(t.table.options.responsiveLayout?e.modules.responsive.visible:e.visible)&&(a=e),e.visible&&(i+=e.getWidth())})),a?(o=n-i+a.getWidth(),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&(a.setWidth(0),this.table.modules.responsiveLayout.update()),o>0?a.setWidth(o):a.reinitializeWidth()):this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitColumns:function(e){var t,i,n=this.table.element.clientWidth,o=0,a=0,r=0,s=[],l=[],u=0,c=0;function h(e){return"string"==typeof e?e.indexOf("%")>-1?n/100*parseInt(e):parseInt(e):e}function d(e,t,i,n){var o=[],a=0,s=0,l=0,u=r,c=0,m=0,p=[];function f(e){return i*(e.column.definition.widthGrow||1)}function g(e){return h(e.width)-i*(e.column.definition.widthShrink||0)}return e.forEach((function(e,a){var r=n?g(e):f(e);e.column.minWidth>=r?o.push(e):e.column.maxWidth&&e.column.maxWidththis.table.rowManager.element.clientHeight&&(n-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),e.forEach((function(e){var t,i,n;e.visible&&(t=e.definition.width,i=parseInt(e.minWidth),t?(n=h(t),o+=n>i?n:i,e.definition.widthShrink&&(l.push({column:e,width:n>i?n:i}),u+=e.definition.widthShrink)):(s.push({column:e,width:0}),r+=e.definition.widthGrow||1))})),a=n-o,t=Math.floor(a/r),c=d(s,a,t,!1),s.length&&c>0&&(s[s.length-1].width+=+c),s.forEach((function(e){a-=e.width})),(i=Math.abs(c)+a)>0&&u&&(c=d(l,i,Math.floor(i/u),!0)),l.length&&(l[l.length-1].width-=c),s.forEach((function(e){e.column.setWidth(e.width)})),l.forEach((function(e){e.column.setWidth(e.width)}))}},G=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e,"layout")).mode=null,o.registerTableOption("layout","fitData"),o.registerTableOption("layoutColumnsOnNewData",!1),o.registerColumnOption("widthGrow"),o.registerColumnOption("widthShrink"),o}return o(n,[{key:"initialize",value:function(){var e=this.table.options.layout;n.modes[e]?this.mode=e:(console.warn("Layout Error - invalid mode set, defaulting to 'fitData' : "+e),this.mode="fitData"),this.table.element.setAttribute("tabulator-layout",this.mode)}},{key:"getMode",value:function(){return this.mode}},{key:"layout",value:function(){this.dispatch("layout-refreshing"),n.modes[this.mode].call(this,this.table.columnManager.columnsByIndex),this.dispatch("layout-refreshed")}}]),n}(V);G.moduleName="layout",G.modes=j;var U=function(i){a(r,i);var n=c(r);function r(e){var i;return t(this,r),(i=n.call(this,e)).locale="default",i.lang=!1,i.bindings={},i.langList={},i.registerTableOption("locale",!1),i.registerTableOption("langs",{}),i}return o(r,[{key:"initialize",value:function(){for(var e in this.langList=k.deepClone(r.langs),!1!==this.table.options.columnDefaults.headerFilterPlaceholder&&this.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder),this.table.options.langs)this.installLang(e,this.table.options.langs[e]);this.setLocale(this.table.options.locale),this.registerTableFunction("setLocale",this.setLocale.bind(this)),this.registerTableFunction("getLocale",this.getLocale.bind(this)),this.registerTableFunction("getLang",this.getLang.bind(this))}},{key:"setHeaderFilterPlaceholder",value:function(e){this.langList.default.headerFilters.default=e}},{key:"setHeaderFilterColumnPlaceholder",value:function(e,t){this.langList.default.headerFilters.columns[e]=t,this.lang&&!this.lang.headerFilters.columns[e]&&(this.lang.headerFilters.columns[e]=t)}},{key:"installLang",value:function(e,t){this.langList[e]?this._setLangProp(this.langList[e],t):this.langList[e]=t}},{key:"_setLangProp",value:function(t,i){for(var n in i)t[n]&&"object"==e(t[n])?this._setLangProp(t[n],i[n]):t[n]=i[n]}},{key:"setLocale",value:function(t){if(!0===(t=t||"default")&&navigator.language&&(t=navigator.language.toLowerCase()),t&&!this.langList[t]){var i=t.split("-")[0];this.langList[i]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",t,i),t=i):(console.warn("Localization Error - Matching locale not found, using default: ",t),t="default")}this.locale=t,this.lang=k.deepClone(this.langList.default||{}),"default"!=t&&function t(i,n){for(var o in i)"object"==e(i[o])?(n[o]||(n[o]={}),t(i[o],n[o])):n[o]=i[o]}(this.langList[t],this.lang),this.dispatchExternal("localized",this.locale,this.lang),this._executeBindings()}},{key:"getLocale",value:function(e){return this.locale}},{key:"getLang",value:function(e){return e?this.langList[e]:this.lang}},{key:"getText",value:function(e,t){var i=(e=t?e+"|"+t:e).split("|");return this._getLangElement(i,this.locale)||""}},{key:"_getLangElement",value:function(e,t){var i=this.lang;return e.forEach((function(e){var t;i&&(t=i[e],i=void 0!==t&&t)})),i}},{key:"bind",value:function(e,t){this.bindings[e]||(this.bindings[e]=[]),this.bindings[e].push(t),t(this.getText(e),this.lang)}},{key:"_executeBindings",value:function(){var e=this,t=function(t){e.bindings[t].forEach((function(i){i(e.getText(t),e.lang)}))};for(var i in this.bindings)t(i)}}]),r}(V);U.moduleName="localize",U.langs={default:{groups:{item:"item",items:"items"},columns:{},data:{loading:"Loading",error:"Error"},pagination:{page_size:"Page Size",page_title:"Show Page",first:"First",first_title:"First Page",last:"Last",last_title:"Last Page",prev:"Prev",prev_title:"Prev Page",next:"Next",next_title:"Next Page",all:"All",counter:{showing:"Showing",of:"of",rows:"rows",pages:"pages"}},headerFilters:{default:"filter column...",columns:{}}}};var X=function(e){a(n,e);var i=c(n);function n(e){return t(this,n),i.call(this,e)}return o(n,[{key:"initialize",value:function(){this.registerTableFunction("tableComms",this.receive.bind(this))}},{key:"getConnections",value:function(e){var t=this,i=[];return I.lookupTable(e).forEach((function(e){t.table!==e&&i.push(e)})),i}},{key:"send",value:function(e,t,i,n){var o=this,a=this.getConnections(e);a.forEach((function(e){e.tableComms(o.table.element,t,i,n)})),!a.length&&e&&console.warn("Table Connection Error - No tables matching selector found",e)}},{key:"receive",value:function(e,t,i,n){if(this.table.modExists(t))return this.table.modules[t].commsReceived(e,i,n);console.warn("Inter-table Comms Error - no such module:",t)}}]),n}(V);X.moduleName="comms";var q=Object.freeze({__proto__:null,LayoutModule:G,LocalizeModule:U,CommsModule:X}),K=function(){function i(e,n){t(this,i),this.bindStaticFuctionality(e),this.bindModules(e,q,!0),n&&this.bindModules(e,n)}return o(i,[{key:"bindStaticFuctionality",value:function(t){t.moduleBindings={},t.extendModule=function(i,n,o){if(t.moduleBindings[i]){var a=t.moduleBindings[i][n];if(a)if("object"==e(o))for(var r in o)a[r]=o[r];else console.warn("Module Error - Invalid value type, it must be an object");else console.warn("Module Error - property does not exist:",n)}else console.warn("Module Error - module does not exist:",i)},t.registerModule=function(e){Array.isArray(e)||(e=[e]),e.forEach((function(e){t.registerModuleBinding(e)}))},t.registerModuleBinding=function(e){t.moduleBindings[e.moduleName]=e},t.findTable=function(e){var t=I.lookupTable(e,!0);return!(Array.isArray(t)&&!t.length)&&t},t.prototype.bindModules=function(){var e=[],i=[],n=[];for(var o in this.modules={},t.moduleBindings){var a=t.moduleBindings[o],r=new a(this);this.modules[o]=r,a.prototype.moduleCore?this.modulesCore.push(r):a.moduleInitOrder?a.moduleInitOrder<0?e.push(r):i.push(r):n.push(r)}e.sort((function(e,t){return e.moduleInitOrder>t.moduleInitOrder?1:-1})),i.sort((function(e,t){return e.moduleInitOrder>t.moduleInitOrder?1:-1})),this.modulesRegular=e.concat(n.concat(i))}}},{key:"bindModules",value:function(e,t,i){var n=Object.values(t);i&&n.forEach((function(e){e.prototype.moduleCore=!0})),e.registerModule(n)}}]),i}(),J=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).element=o._createAlertElement(),o.msgElement=o._createMsgElement(),o.type=null,o.element.appendChild(o.msgElement),o}return o(n,[{key:"_createAlertElement",value:function(){var e=document.createElement("div");return e.classList.add("tabulator-alert"),e}},{key:"_createMsgElement",value:function(){var e=document.createElement("div");return e.classList.add("tabulator-alert-msg"),e.setAttribute("role","alert"),e}},{key:"_typeClass",value:function(){return"tabulator-alert-state-"+this.type}},{key:"alert",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"msg";if(e){for(this.clear(),this.type=t;this.msgElement.firstChild;)this.msgElement.removeChild(this.msgElement.firstChild);this.msgElement.classList.add(this._typeClass()),"function"==typeof e&&(e=e()),e instanceof HTMLElement?this.msgElement.appendChild(e):this.msgElement.innerHTML=e,this.table.element.appendChild(this.element)}}},{key:"clear",value:function(){this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.msgElement.classList.remove(this._typeClass())}}]),n}(g),Y=function(){function i(e,n){var o=this;t(this,i),this.options={},this.columnManager=null,this.rowManager=null,this.footerManager=null,this.alertManager=null,this.vdomHoz=null,this.externalEvents=null,this.eventBus=null,this.interactionMonitor=!1,this.browser="",this.browserSlow=!1,this.browserMobile=!1,this.rtl=!1,this.originalElement=null,this.componentFunctionBinder=new _(this),this.dataLoader=!1,this.modules={},this.modulesCore=[],this.modulesRegular=[],this.optionsList=new E(this,"table constructor"),this.initialized=!1,this.initializeElement(e)&&(this.initializeCoreSystems(n),setTimeout((function(){o._create()}))),I.register(this)}return o(i,[{key:"initializeElement",value:function(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement?(this.element=e,!0):"string"==typeof e?(this.element=document.querySelector(e),!!this.element||(console.error("Tabulator Creation Error - no element found matching selector: ",e),!1)):(console.error("Tabulator Creation Error - Invalid element provided:",e),!1)}},{key:"initializeCoreSystems",value:function(e){this.columnManager=new M(this),this.rowManager=new z(this),this.footerManager=new F(this),this.dataLoader=new O(this),this.alertManager=new J(this),this.bindModules(),this.options=this.optionsList.generate(i.defaultOptions,e),this._clearObjectPointers(),this._mapDeprecatedFunctionality(),this.externalEvents=new A(this,this.options,this.options.debugEventsExternal),this.eventBus=new B(this.options.debugEventsInternal),this.interactionMonitor=new H(this),this.dataLoader.initialize(),this.footerManager.initialize()}},{key:"_mapDeprecatedFunctionality",value:function(){}},{key:"_clearSelection",value:function(){this.element.classList.add("tabulator-block-select"),window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty(),this.element.classList.remove("tabulator-block-select")}},{key:"_create",value:function(){this.externalEvents.dispatch("tableBuilding"),this.eventBus.dispatch("table-building"),this._rtlCheck(),this._buildElement(),this._initializeTable(),this._loadInitialData(),this.initialized=!0,this.externalEvents.dispatch("tableBuilt")}},{key:"_rtlCheck",value:function(){var e=window.getComputedStyle(this.element);switch(this.options.textDirection){case"auto":if("rtl"!==e.direction)break;case"rtl":this.element.classList.add("tabulator-rtl"),this.rtl=!0;break;case"ltr":this.element.classList.add("tabulator-ltr");default:this.rtl=!1}}},{key:"_clearObjectPointers",value:function(){this.options.columns=this.options.columns.slice(0),Array.isArray(this.options.data)&&!this.options.reactiveData&&(this.options.data=this.options.data.slice(0))}},{key:"_buildElement",value:function(){var t,i=this.element,n=this.options;if("TABLE"===i.tagName){this.originalElement=this.element,t=document.createElement("div");var o=i.attributes;for(var a in o)"object"==e(o[a])&&t.setAttribute(o[a].name,o[a].value);i.parentNode.replaceChild(t,i),this.element=i=t}for(i.classList.add("tabulator"),i.setAttribute("role","grid");i.firstChild;)i.removeChild(i.firstChild);n.height&&(n.height=isNaN(n.height)?n.height:n.height+"px",i.style.height=n.height),!1!==n.minHeight&&(n.minHeight=isNaN(n.minHeight)?n.minHeight:n.minHeight+"px",i.style.minHeight=n.minHeight),!1!==n.maxHeight&&(n.maxHeight=isNaN(n.maxHeight)?n.maxHeight:n.maxHeight+"px",i.style.maxHeight=n.maxHeight)}},{key:"_initializeTable",value:function(){var e=this.element,t=this.options;this.interactionMonitor.initialize(),this.columnManager.initialize(),this.rowManager.initialize(),this._detectBrowser(),this.modulesCore.forEach((function(e){e.initialize()})),e.appendChild(this.columnManager.getElement()),e.appendChild(this.rowManager.getElement()),t.footerElement&&this.footerManager.activate(),t.autoColumns&&t.data&&this.columnManager.generateColumnsFromRowData(this.options.data),this.modulesRegular.forEach((function(e){e.initialize()})),this.columnManager.setColumns(t.columns),this.eventBus.dispatch("table-built")}},{key:"_loadInitialData",value:function(){this.dataLoader.load(this.options.data)}},{key:"destroy",value:function(){var e=this.element;for(I.deregister(this),this.eventBus.dispatch("table-destroy"),this.rowManager.rows.forEach((function(e){e.wipe()})),this.rowManager.rows=[],this.rowManager.activeRows=[],this.rowManager.displayRows=[];e.firstChild;)e.removeChild(e.firstChild);e.classList.remove("tabulator")}},{key:"_detectBrowser",value:function(){var e=navigator.userAgent||navigator.vendor||window.opera;e.indexOf("Trident")>-1?(this.browser="ie",this.browserSlow=!0):e.indexOf("Edge")>-1?(this.browser="edge",this.browserSlow=!0):e.indexOf("Firefox")>-1?(this.browser="firefox",this.browserSlow=!1):(this.browser="other",this.browserSlow=!1),this.browserMobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.slice(0,4))}},{key:"initGuard",value:function(e,t){var i,n;return this.options.debugInitialization&&!this.initialized&&(e||(e=" "==(n="Error"==(i=(new Error).stack.split("\n"))[0]?i[2]:i[1])[0]?n.trim().split(" ")[1].split(".")[1]:n.trim().split("@")[0]),console.warn("Table Not Initialized - Calling the "+e+" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function."+(t?" "+t:""))),this.initialized}},{key:"blockRedraw",value:function(){return this.initGuard(),this.rowManager.blockRedraw()}},{key:"restoreRedraw",value:function(){return this.initGuard(),this.rowManager.restoreRedraw()}},{key:"setData",value:function(e,t,i){return this.initGuard(!1,"To set initial data please use the 'data' property in the table constructor."),this.dataLoader.load(e,t,i,!1)}},{key:"clearData",value:function(){this.initGuard(),this.dataLoader.blockActiveLoad(),this.rowManager.clearData()}},{key:"getData",value:function(e){return this.rowManager.getData(e)}},{key:"getDataCount",value:function(e){return this.rowManager.getDataCount(e)}},{key:"replaceData",value:function(e,t,i){return this.initGuard(),this.dataLoader.load(e,t,i,!0,!0)}},{key:"updateData",value:function(e){var t=this,i=0;return this.initGuard(),new Promise((function(n,o){t.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e?e.forEach((function(e){var o=t.rowManager.findRow(e[t.options.index]);o&&(i++,o.updateData(e).then((function(){--i||n()})))})):(console.warn("Update Error - No data provided"),o("Update Error - No data provided"))}))}},{key:"addData",value:function(e,t,i){var n=this;return this.initGuard(),new Promise((function(o,a){n.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e?n.rowManager.addRows(e,t,i).then((function(e){var t=[];e.forEach((function(e){t.push(e.getComponent())})),o(t)})):(console.warn("Update Error - No data provided"),a("Update Error - No data provided"))}))}},{key:"updateOrAddData",value:function(e){var t=this,i=[],n=0;return this.initGuard(),new Promise((function(o,a){t.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e?e.forEach((function(e){var a=t.rowManager.findRow(e[t.options.index]);n++,a?a.updateData(e).then((function(){n--,i.push(a.getComponent()),n||o(i)})):t.rowManager.addRows(e).then((function(e){n--,i.push(e[0].getComponent()),n||o(i)}))})):(console.warn("Update Error - No data provided"),a("Update Error - No data provided"))}))}},{key:"getRow",value:function(e){var t=this.rowManager.findRow(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}},{key:"getRowFromPosition",value:function(e,t){var i=this.rowManager.getRowFromPosition(e,t);return i?i.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}},{key:"deleteRow",value:function(e){var t=this,i=[];this.initGuard(),Array.isArray(e)||(e=[e]);var n,o=f(e);try{for(o.s();!(n=o.n()).done;){var a=n.value,r=this.rowManager.findRow(a,!0);if(!r)return console.error("Delete Error - No matching row found:",a),Promise.reject("Delete Error - No matching row found");i.push(r)}}catch(e){o.e(e)}finally{o.f()}return i.sort((function(e,i){return t.rowManager.rows.indexOf(e)>t.rowManager.rows.indexOf(i)?1:-1})),i.forEach((function(e){e.delete()})),this.rowManager.reRenderInPosition(),Promise.resolve()}},{key:"addRow",value:function(e,t,i){return this.initGuard(),"string"==typeof e&&(e=JSON.parse(e)),this.rowManager.addRows(e,t,i).then((function(e){return e[0].getComponent()}))}},{key:"updateOrAddRow",value:function(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),"string"==typeof t&&(t=JSON.parse(t)),i?i.updateData(t).then((function(){return i.getComponent()})):this.rowManager.addRows(t).then((function(e){return e[0].getComponent()}))}},{key:"updateRow",value:function(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),"string"==typeof t&&(t=JSON.parse(t)),i?i.updateData(t).then((function(){return Promise.resolve(i.getComponent())})):(console.warn("Update Error - No matching row found:",e),Promise.reject("Update Error - No matching row found"))}},{key:"scrollToRow",value:function(e,t,i){var n=this.rowManager.findRow(e);return n?this.rowManager.scrollToRow(n,t,i):(console.warn("Scroll Error - No matching row found:",e),Promise.reject("Scroll Error - No matching row found"))}},{key:"moveRow",value:function(e,t,i){var n=this.rowManager.findRow(e);this.initGuard(),n?n.moveToRow(t,i):console.warn("Move Error - No matching row found:",e)}},{key:"getRows",value:function(e){return this.rowManager.getComponents(e)}},{key:"getRowPosition",value:function(e,t){var i=this.rowManager.findRow(e);return i?this.rowManager.getRowPosition(i,t):(console.warn("Position Error - No matching row found:",e),!1)}},{key:"setColumns",value:function(e){this.initGuard(!1,"To set initial columns please use the 'columns' property in the table constructor"),this.columnManager.setColumns(e)}},{key:"getColumns",value:function(e){return this.columnManager.getComponents(e)}},{key:"getColumn",value:function(e){var t=this.columnManager.findColumn(e);return t?t.getComponent():(console.warn("Find Error - No matching column found:",e),!1)}},{key:"getColumnDefinitions",value:function(){return this.columnManager.getDefinitionTree()}},{key:"showColumn",value:function(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Show Error - No matching column found:",e),!1;t.show()}},{key:"hideColumn",value:function(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Hide Error - No matching column found:",e),!1;t.hide()}},{key:"toggleColumn",value:function(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Visibility Toggle Error - No matching column found:",e),!1;t.visible?t.hide():t.show()}},{key:"addColumn",value:function(e,t,i){var n=this.columnManager.findColumn(i);return this.initGuard(),this.columnManager.addColumn(e,t,n).then((function(e){return e.getComponent()}))}},{key:"deleteColumn",value:function(e){var t=this.columnManager.findColumn(e);return this.initGuard(),t?t.delete():(console.warn("Column Delete Error - No matching column found:",e),Promise.reject())}},{key:"updateColumnDefinition",value:function(e,t){var i=this.columnManager.findColumn(e);return this.initGuard(),i?i.updateDefinition(t):(console.warn("Column Update Error - No matching column found:",e),Promise.reject())}},{key:"moveColumn",value:function(e,t,i){var n=this.columnManager.findColumn(e),o=this.columnManager.findColumn(t);this.initGuard(),n?o?this.columnManager.moveColumn(n,o,i):console.warn("Move Error - No matching column found:",o):console.warn("Move Error - No matching column found:",e)}},{key:"scrollToColumn",value:function(e,t,i){var n=this;return new Promise((function(o,a){var r=n.columnManager.findColumn(e);return r?n.columnManager.scrollToColumn(r,t,i):(console.warn("Scroll Error - No matching column found:",e),Promise.reject("Scroll Error - No matching column found"))}))}},{key:"redraw",value:function(e){this.initGuard(),this.columnManager.redraw(e),this.rowManager.redraw(e)}},{key:"setHeight",value:function(e){this.options.height=isNaN(e)?e:e+"px",this.element.style.height=this.options.height,this.rowManager.initializeRenderer(),this.rowManager.redraw()}},{key:"on",value:function(e,t){this.externalEvents.subscribe(e,t)}},{key:"off",value:function(e,t){this.externalEvents.unsubscribe(e,t)}},{key:"dispatchEvent",value:function(){var e,t=Array.from(arguments);t.shift();(e=this.externalEvents).dispatch.apply(e,arguments)}},{key:"alert",value:function(e,t){this.initGuard(),this.alertManager.alert(e,t)}},{key:"clearAlert",value:function(){this.initGuard(),this.alertManager.clear()}},{key:"modExists",value:function(e,t){return!!this.modules[e]||(t&&console.error("Tabulator Module Not Installed: "+e),!1)}},{key:"module",value:function(e){var t=this.modules[e];return t||console.error("Tabulator module not installed: "+e),t}}]),i}();Y.defaultOptions={debugEventsExternal:!1,debugEventsInternal:!1,debugInvalidOptions:!0,debugInitialization:!0,height:!1,minHeight:!1,maxHeight:!1,columnHeaderVertAlign:"top",popupContainer:!1,columns:[],columnDefaults:{},data:!1,autoColumns:!1,autoColumnsDefinitions:!1,nestedFieldSeparator:".",footerElement:!1,index:"id",textDirection:"auto",addRowPos:"bottom",headerVisible:!0,renderVertical:"virtual",renderHorizontal:"basic",renderVerticalBuffer:0,scrollToRowPosition:"top",scrollToRowIfVisible:!0,scrollToColumnPosition:"left",scrollToColumnIfVisible:!0,rowFormatter:!1,rowFormatterPrint:null,rowFormatterClipboard:null,rowFormatterHtmlOutput:null,rowHeight:null,placeholder:!1,dataLoader:!0,dataLoaderLoading:!1,dataLoaderError:!1,dataLoaderErrorTimeout:3e3,dataSendParams:{},dataReceiveParams:{}},new K(Y);var $=function(i){a(r,i);var n=c(r);function r(e){var i;return t(this,r),(i=n.call(this,e)).allowedTypes=["","data","download","clipboard","print","htmlOutput"],i.registerColumnOption("accessor"),i.registerColumnOption("accessorParams"),i.registerColumnOption("accessorData"),i.registerColumnOption("accessorDataParams"),i.registerColumnOption("accessorDownload"),i.registerColumnOption("accessorDownloadParams"),i.registerColumnOption("accessorClipboard"),i.registerColumnOption("accessorClipboardParams"),i.registerColumnOption("accessorPrint"),i.registerColumnOption("accessorPrintParams"),i.registerColumnOption("accessorHtmlOutput"),i.registerColumnOption("accessorHtmlOutputParams"),i}return o(r,[{key:"initialize",value:function(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-retrieve",this.transformRow.bind(this))}},{key:"initializeColumn",value:function(e){var t=this,i=!1,n={};this.allowedTypes.forEach((function(o){var a,r="accessor"+(o.charAt(0).toUpperCase()+o.slice(1));e.definition[r]&&(a=t.lookupAccessor(e.definition[r]))&&(i=!0,n[r]={accessor:a,params:e.definition[r+"Params"]||{}})})),i&&(e.modules.accessor=n)}},{key:"lookupAccessor",value:function(t){var i=!1;switch(e(t)){case"string":r.accessors[t]?i=r.accessors[t]:console.warn("Accessor Error - No such accessor found, ignoring: ",t);break;case"function":i=t}return i}},{key:"transformRow",value:function(e,t){var i="accessor"+(t.charAt(0).toUpperCase()+t.slice(1)),n=e.getComponent(),o=k.deepClone(e.data||{});return this.table.columnManager.traverse((function(e){var a,r,s,l;e.modules.accessor&&(r=e.modules.accessor[i]||e.modules.accessor.accessor||!1)&&"undefined"!=(a=e.getFieldValue(o))&&(l=e.getComponent(),s="function"==typeof r.params?r.params(a,o,t,l,n):r.params,e.setFieldValue(o,r.accessor(a,o,t,s,l,n)))})),o}}]),r}(V);$.moduleName="accessor",$.accessors={};function Z(t,i){var n=[];if(i=i||"",Array.isArray(t))t.forEach((function(e,t){n=n.concat(Z(e,i?i+"["+t+"]":t))}));else if("object"===e(t))for(var o in t)n=n.concat(Z(t[o],i?i+"["+o+"]":o));else n.push({key:i,value:t});return n}function Q(e){var t=Z(e),i=[];return t.forEach((function(e){i.push(encodeURIComponent(e.key)+"="+encodeURIComponent(e.value))})),i.join("&")}function ee(e,t,i){return e&&i&&Object.keys(i).length&&(t.method&&"get"!=t.method.toLowerCase()||(t.method="get",e+=(e.includes("?")?"&":"?")+Q(i))),e}function te(t,i){var n=[];if(i=i||"",Array.isArray(t))t.forEach((function(e,t){n=n.concat(te(e,i?i+"["+t+"]":t))}));else if("object"===e(t))for(var o in t)n=n.concat(te(t[o],i?i+"["+o+"]":o));else n.push({key:i,value:t});return n}var ie={json:{headers:{"Content-Type":"application/json"},body:function(e,t,i){return JSON.stringify(i)}},form:{headers:{},body:function(e,t,i){var n=te(i),o=new FormData;return n.forEach((function(e){o.append(e.key,e.value)})),o}}},ne=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).config={},o.url="",o.urlGenerator=!1,o.params=!1,o.loaderPromise=!1,o.registerTableOption("ajaxURL",!1),o.registerTableOption("ajaxURLGenerator",!1),o.registerTableOption("ajaxParams",{}),o.registerTableOption("ajaxConfig","get"),o.registerTableOption("ajaxContentType","form"),o.registerTableOption("ajaxRequestFunc",!1),o.registerTableOption("ajaxRequesting",(function(){})),o.registerTableOption("ajaxResponse",!1),o.contentTypeFormatters=n.contentTypeFormatters,o}return o(n,[{key:"initialize",value:function(){this.loaderPromise=this.table.options.ajaxRequestFunc||n.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||n.defaultURLGenerator,this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.setDefaultConfig(this.table.options.ajaxConfig),this.registerTableFunction("getAjaxUrl",this.getUrl.bind(this)),this.subscribe("data-loading",this.requestDataCheck.bind(this)),this.subscribe("data-params",this.requestParams.bind(this)),this.subscribe("data-load",this.requestData.bind(this))}},{key:"requestParams",value:function(e,t,i,n){var o=this.table.options.ajaxParams;return o&&("function"==typeof o&&(o=o.call(this.table)),n=Object.assign(n,o)),n}},{key:"requestDataCheck",value:function(e,t,i,n){return!((e||!this.url)&&"string"!=typeof e)}},{key:"requestData",value:function(e,t,i,n,o){var a;return!o&&this.requestDataCheck(e)?(e&&this.setUrl(e),a=this.generateConfig(i),this.sendRequest(this.url,t,a)):o}},{key:"setDefaultConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config=Object.assign({},n.defaultConfig),"string"==typeof e?this.config.method=e:Object.assign(this.config,e)}},{key:"generateConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign({},this.config);return"string"==typeof e?t.method=e:Object.assign(t,e),t}},{key:"setUrl",value:function(e){this.url=e}},{key:"getUrl",value:function(){return this.url}},{key:"sendRequest",value:function(e,t,i){var n=this;return!1!==this.table.options.ajaxRequesting.call(this.table,e,t)?this.loaderPromise(e,i,t).then((function(i){return n.table.options.ajaxResponse&&(i=n.table.options.ajaxResponse.call(n.table,e,t,i)),i})):Promise.reject()}}]),n}(V);ne.moduleName="ajax",ne.defaultConfig={method:"GET"},ne.defaultURLGenerator=ee,ne.defaultLoaderPromise=function(t,i,n){var o,a=this;return new Promise((function(r,s){if(t=a.urlGenerator.call(a.table,t,i,n),"GET"!=i.method.toUpperCase())if(o="object"===e(a.table.options.ajaxContentType)?a.table.options.ajaxContentType:a.contentTypeFormatters[a.table.options.ajaxContentType]){for(var l in o.headers)i.headers||(i.headers={}),void 0===i.headers[l]&&(i.headers[l]=o.headers[l]);i.body=o.body.call(a,t,i,n)}else console.warn("Ajax Error - Invalid ajaxContentType value:",a.table.options.ajaxContentType);t?(void 0===i.headers&&(i.headers={}),void 0===i.headers.Accept&&(i.headers.Accept="application/json"),void 0===i.headers["X-Requested-With"]&&(i.headers["X-Requested-With"]="XMLHttpRequest"),void 0===i.mode&&(i.mode="cors"),"cors"==i.mode?(void 0===i.headers.Origin&&(i.headers.Origin=window.location.origin),void 0===i.credentials&&(i.credentials="same-origin")):void 0===i.credentials&&(i.credentials="include"),fetch(t,i).then((function(e){e.ok?e.json().then((function(e){r(e)})).catch((function(e){s(e),console.warn("Ajax Load Error - Invalid JSON returned",e)})):(console.error("Ajax Load Error - Connection Error: "+e.status,e.statusText),s(e))})).catch((function(e){console.error("Ajax Load Error - Connection Error: ",e),s(e)}))):(console.warn("Ajax Load Error - No URL Set"),r([]))}))},ne.contentTypeFormatters=ie;var oe=function(i){a(r,i);var n=c(r);function r(e){var i;return t(this,r),(i=n.call(this,e)).mode=!0,i.pasteParser=function(){},i.pasteAction=function(){},i.customSelection=!1,i.rowRange=!1,i.blocked=!0,i.registerTableOption("clipboard",!1),i.registerTableOption("clipboardCopyStyled",!0),i.registerTableOption("clipboardCopyConfig",!1),i.registerTableOption("clipboardCopyFormatter",!1),i.registerTableOption("clipboardCopyRowRange","active"),i.registerTableOption("clipboardPasteParser","table"),i.registerTableOption("clipboardPasteAction","insert"),i.registerColumnOption("clipboard"),i.registerColumnOption("titleClipboard"),i}return o(r,[{key:"initialize",value:function(){var e=this;this.mode=this.table.options.clipboard,this.rowRange=this.table.options.clipboardCopyRowRange,!0!==this.mode&&"copy"!==this.mode||this.table.element.addEventListener("copy",(function(t){var i,n;if(!e.blocked){if(t.preventDefault(),e.customSelection)i=e.customSelection,e.table.options.clipboardCopyFormatter&&(i=e.table.options.clipboardCopyFormatter("plain",i));else{var o=e.table.modules.export.generateExportList(e.table.options.clipboardCopyConfig,e.table.options.clipboardCopyStyled,e.rowRange,"clipboard");i=(n=e.table.modules.export.genereateHTMLTable(o))?e.generatePlainContent(o):"",e.table.options.clipboardCopyFormatter&&(i=e.table.options.clipboardCopyFormatter("plain",i),n=e.table.options.clipboardCopyFormatter("html",n))}window.clipboardData&&window.clipboardData.setData?window.clipboardData.setData("Text",i):t.clipboardData&&t.clipboardData.setData?(t.clipboardData.setData("text/plain",i),n&&t.clipboardData.setData("text/html",n)):t.originalEvent&&t.originalEvent.clipboardData.setData&&(t.originalEvent.clipboardData.setData("text/plain",i),n&&t.originalEvent.clipboardData.setData("text/html",n)),e.dispatchExternal("clipboardCopied",i,n),e.reset()}})),!0!==this.mode&&"paste"!==this.mode||this.table.element.addEventListener("paste",(function(t){e.paste(t)})),this.setPasteParser(this.table.options.clipboardPasteParser),this.setPasteAction(this.table.options.clipboardPasteAction),this.registerTableFunction("copyToClipboard",this.copy.bind(this))}},{key:"reset",value:function(){this.blocked=!0,this.customSelection=!1}},{key:"generatePlainContent",value:function(t){var i=[];return t.forEach((function(t){var n=[];t.columns.forEach((function(i){var o="";if(i)if("group"===t.type&&(i.value=i.component.getKey()),null===i.value)o="";else switch(e(i.value)){case"object":o=JSON.stringify(i.value);break;case"undefined":o="";break;default:o=i.value}n.push(o)})),i.push(n.join("\t"))})),i.join("\n")}},{key:"copy",value:function(e,t){var i,n;this.blocked=!1,this.customSelection=!1,!0!==this.mode&&"copy"!==this.mode||(this.rowRange=e||this.table.options.clipboardCopyRowRange,void 0!==window.getSelection&&void 0!==document.createRange?((e=document.createRange()).selectNodeContents(this.table.element),(i=window.getSelection()).toString()&&t&&(this.customSelection=i.toString()),i.removeAllRanges(),i.addRange(e)):void 0!==document.selection&&void 0!==document.body.createTextRange&&((n=document.body.createTextRange()).moveToElementText(this.table.element),n.select()),document.execCommand("copy"),i&&i.removeAllRanges())}},{key:"setPasteAction",value:function(t){switch(e(t)){case"string":this.pasteAction=r.pasteActions[t],this.pasteAction||console.warn("Clipboard Error - No such paste action found:",t);break;case"function":this.pasteAction=t}}},{key:"setPasteParser",value:function(t){switch(e(t)){case"string":this.pasteParser=r.pasteParsers[t],this.pasteParser||console.warn("Clipboard Error - No such paste parser found:",t);break;case"function":this.pasteParser=t}}},{key:"paste",value:function(e){var t,i,n;this.checkPaseOrigin(e)&&(t=this.getPasteData(e),(i=this.pasteParser.call(this,t))?(e.preventDefault(),this.table.modExists("mutator")&&(i=this.mutateData(i)),n=this.pasteAction.call(this,i),this.dispatchExternal("clipboardPasted",t,i,n)):this.dispatchExternal("clipboardPasteError",t))}},{key:"mutateData",value:function(e){var t=this,i=[];return Array.isArray(e)?e.forEach((function(e){i.push(t.table.modules.mutator.transformRow(e,"clipboard"))})):i=e,i}},{key:"checkPaseOrigin",value:function(e){var t=!0;return("DIV"!=e.target.tagName||this.table.modules.edit.currentCell)&&(t=!1),t}},{key:"getPasteData",value:function(e){var t;return window.clipboardData&&window.clipboardData.getData?t=window.clipboardData.getData("Text"):e.clipboardData&&e.clipboardData.getData?t=e.clipboardData.getData("text/plain"):e.originalEvent&&e.originalEvent.clipboardData.getData&&(t=e.originalEvent.clipboardData.getData("text/plain")),t}}]),r}(V);oe.moduleName="clipboard",oe.pasteActions={replace:function(e){return this.table.setData(e)},update:function(e){return this.table.updateOrAddData(e)},insert:function(e){return this.table.addData(e)}},oe.pasteParsers={table:function(e){var t=[],i=!0,n=this.table.columnManager.columns,o=[],a=[];return(e=e.split("\n")).forEach((function(e){t.push(e.split("\t"))})),!(!t.length||1===t.length&&t[0].length<2)&&(t[0].forEach((function(e){var t=n.find((function(t){return e&&t.definition.title&&e.trim()&&t.definition.title.trim()===e.trim()}));t?o.push(t):i=!1})),i||(i=!0,o=[],t[0].forEach((function(e){var t=n.find((function(t){return e&&t.field&&e.trim()&&t.field.trim()===e.trim()}));t?o.push(t):i=!1})),i||(o=this.table.columnManager.columnsByIndex)),i&&t.shift(),t.forEach((function(e){var t={};e.forEach((function(e,i){o[i]&&(t[o[i].field]=e)})),a.push(t)})),a)}};var ae=function(){function e(i){return t(this,e),this._row=i,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._row.table.componentFunctionBinder.handle("row",e._row,t)}})}return o(e,[{key:"getData",value:function(e){return this._row.getData(e)}},{key:"getElement",value:function(){return this._row.getElement()}},{key:"getTable",value:function(){return this._row.table}},{key:"getCells",value:function(){var e=[];return this._row.getCells().forEach((function(t){e.push(t.getComponent())})),e}},{key:"getCell",value:function(e){var t=this._row.getCell(e);return!!t&&t.getComponent()}},{key:"_getSelf",value:function(){return this._row}}]),e}(),re={avg:function(e,t,i){var n=0,o=void 0!==i.precision?i.precision:2;return e.length&&(n=e.reduce((function(e,t){return Number(e)+Number(t)})),n/=e.length,n=!1!==o?n.toFixed(o):n),parseFloat(n).toString()},max:function(e,t,i){var n=null,o=void 0!==i.precision&&i.precision;return e.forEach((function(e){((e=Number(e))>n||null===n)&&(n=e)})),null!==n?!1!==o?n.toFixed(o):n:""},min:function(e,t,i){var n=null,o=void 0!==i.precision&&i.precision;return e.forEach((function(e){((e=Number(e))"),i.dataTreeExpandElement?"string"==typeof i.dataTreeExpandElement?((t=document.createElement("div")).innerHTML=i.dataTreeExpandElement,this.expandEl=t.firstChild):this.expandEl=i.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.tabIndex=0,this.expandEl.innerHTML="
"),e(i.dataTreeStartExpanded)){case"boolean":this.startOpen=function(e,t){return i.dataTreeStartExpanded};break;case"function":this.startOpen=i.dataTreeStartExpanded;break;default:this.startOpen=function(e,t){return i.dataTreeStartExpanded[t]}}this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("row-deleted",this.rowDelete.bind(this),0),this.subscribe("row-data-changed",this.rowDataChanged.bind(this),10),this.subscribe("cell-value-updated",this.cellValueChanged.bind(this)),this.subscribe("edit-cancelled",this.cellValueChanged.bind(this)),this.subscribe("column-moving-rows",this.columnMoving.bind(this)),this.subscribe("table-built",this.initializeElementField.bind(this)),this.subscribe("table-redrawing",this.tableRedrawing.bind(this)),this.registerDisplayHandler(this.getRows.bind(this),30)}}},{key:"tableRedrawing",value:function(e){var t=this;e&&this.table.rowManager.getRows().forEach((function(e){t.reinitializeRowChildren(e)}))}},{key:"initializeElementField",value:function(){var e=this.table.columnManager.getFirstVisibleColumn();this.elementField=this.table.options.dataTreeElementColumn||!!e&&e.field}},{key:"getRowChildren",value:function(e){return this.getTreeChildren(e,!0)}},{key:"columnMoving",value:function(){var e=this,t=[];return this.table.rowManager.rows.forEach((function(i){t=t.concat(e.getTreeChildren(i,!1,!0))})),t}},{key:"rowDataChanged",value:function(e,t,i){this.redrawNeeded(i)&&(this.initializeRow(e),t&&(this.layoutRow(e),this.refreshData(!0)))}},{key:"cellValueChanged",value:function(e){e.column.getField()===this.elementField&&this.layoutRow(e.row)}},{key:"initializeRow",value:function(t){var i=t.getData()[this.field],n=Array.isArray(i),o=n||!n&&"object"===e(i)&&null!==i;!o&&t.modules.dataTree&&t.modules.dataTree.branchEl&&t.modules.dataTree.branchEl.parentNode.removeChild(t.modules.dataTree.branchEl),!o&&t.modules.dataTree&&t.modules.dataTree.controlEl&&t.modules.dataTree.controlEl.parentNode.removeChild(t.modules.dataTree.controlEl),t.modules.dataTree={index:t.modules.dataTree?t.modules.dataTree.index:0,open:!!o&&(t.modules.dataTree?t.modules.dataTree.open:this.startOpen(t.getComponent(),0)),controlEl:!(!t.modules.dataTree||!o)&&t.modules.dataTree.controlEl,branchEl:!(!t.modules.dataTree||!o)&&t.modules.dataTree.branchEl,parent:!!t.modules.dataTree&&t.modules.dataTree.parent,children:o}}},{key:"reinitializeRowChildren",value:function(e){this.getTreeChildren(e,!1,!0).forEach((function(e){e.reinitialize(!0)}))}},{key:"layoutRow",value:function(e){var t=(this.elementField?e.getCell(this.elementField):e.getCells()[0]).getElement(),i=e.modules.dataTree;i.branchEl&&(i.branchEl.parentNode&&i.branchEl.parentNode.removeChild(i.branchEl),i.branchEl=!1),i.controlEl&&(i.controlEl.parentNode&&i.controlEl.parentNode.removeChild(i.controlEl),i.controlEl=!1),this.generateControlElement(e,t),e.getElement().classList.add("tabulator-tree-level-"+i.index),i.index&&(this.branchEl?(i.branchEl=this.branchEl.cloneNode(!0),t.insertBefore(i.branchEl,t.firstChild),this.table.rtl?i.branchEl.style.marginRight=(i.branchEl.offsetWidth+i.branchEl.style.marginLeft)*(i.index-1)+i.index*this.indent+"px":i.branchEl.style.marginLeft=(i.branchEl.offsetWidth+i.branchEl.style.marginRight)*(i.index-1)+i.index*this.indent+"px"):this.table.rtl?t.style.paddingRight=parseInt(window.getComputedStyle(t,null).getPropertyValue("padding-right"))+i.index*this.indent+"px":t.style.paddingLeft=parseInt(window.getComputedStyle(t,null).getPropertyValue("padding-left"))+i.index*this.indent+"px")}},{key:"generateControlElement",value:function(e,t){var i=this,n=e.modules.dataTree,o=(t=t||e.getCells()[0].getElement(),n.controlEl);!1!==n.children&&(n.open?(n.controlEl=this.collapseEl.cloneNode(!0),n.controlEl.addEventListener("click",(function(t){t.stopPropagation(),i.collapseRow(e)}))):(n.controlEl=this.expandEl.cloneNode(!0),n.controlEl.addEventListener("click",(function(t){t.stopPropagation(),i.expandRow(e)}))),n.controlEl.addEventListener("mousedown",(function(e){e.stopPropagation()})),o&&o.parentNode===t?o.parentNode.replaceChild(n.controlEl,o):t.insertBefore(n.controlEl,t.firstChild))}},{key:"setDisplayIndex",value:function(e){this.displayIndex=e}},{key:"getDisplayIndex",value:function(){return this.displayIndex}},{key:"getRows",value:function(e){var t=this,i=[];return e.forEach((function(e,n){var o;i.push(e),e instanceof D&&(e.create(),(o=e.modules.dataTree.children).index||!1===o.children||t.getChildren(e).forEach((function(e){e.create(),i.push(e)})))})),i}},{key:"getChildren",value:function(e,t){var i=this,n=e.modules.dataTree,o=[],a=[];return!1!==n.children&&(n.open||t)&&(Array.isArray(n.children)||(n.children=this.generateChildren(e)),o=this.table.modExists("filter")&&this.table.options.dataTreeFilter?this.table.modules.filter.filter(n.children):n.children,this.table.modExists("sort")&&this.table.options.dataTreeSort&&this.table.modules.sort.sort(o),o.forEach((function(e){a.push(e),i.getChildren(e).forEach((function(e){a.push(e)}))}))),a}},{key:"generateChildren",value:function(e){var t=this,i=[],n=e.getData()[this.field];return Array.isArray(n)||(n=[n]),n.forEach((function(n){var o=new D(n||{},t.table.rowManager);o.create(),o.modules.dataTree.index=e.modules.dataTree.index+1,o.modules.dataTree.parent=e,o.modules.dataTree.children&&(o.modules.dataTree.open=t.startOpen(o.getComponent(),o.modules.dataTree.index)),i.push(o)})),i}},{key:"expandRow",value:function(e,t){var i=e.modules.dataTree;!1!==i.children&&(i.open=!0,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowExpanded",e.getComponent(),e.modules.dataTree.index))}},{key:"collapseRow",value:function(e){var t=e.modules.dataTree;!1!==t.children&&(t.open=!1,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowCollapsed",e.getComponent(),e.modules.dataTree.index))}},{key:"toggleRow",value:function(e){var t=e.modules.dataTree;!1!==t.children&&(t.open?this.collapseRow(e):this.expandRow(e))}},{key:"isRowExpanded",value:function(e){return e.modules.dataTree.open}},{key:"getTreeParent",value:function(e){return!!e.modules.dataTree.parent&&e.modules.dataTree.parent.getComponent()}},{key:"getTreeParentRoot",value:function(e){return e.modules.dataTree.parent?this.getTreeParentRoot(e.modules.dataTree.parent):e}},{key:"getFilteredTreeChildren",value:function(e){var t=e.modules.dataTree,i=[];return t.children&&(Array.isArray(t.children)||(t.children=this.generateChildren(e)),(this.table.modExists("filter")&&this.table.options.dataTreeFilter?this.table.modules.filter.filter(t.children):t.children).forEach((function(e){e instanceof D&&i.push(e)}))),i}},{key:"rowDelete",value:function(e){var t,i=e.modules.dataTree.parent;i&&(!1!==(t=this.findChildIndex(e,i))&&i.data[this.field].splice(t,1),i.data[this.field].length||delete i.data[this.field],this.initializeRow(i),this.layoutRow(i)),this.refreshData(!0)}},{key:"addTreeChildRow",value:function(e,t,i,n){var o=!1;"string"==typeof t&&(t=JSON.parse(t)),Array.isArray(e.data[this.field])||(e.data[this.field]=[],e.modules.dataTree.open=this.startOpen(e.getComponent(),e.modules.dataTree.index)),void 0!==n&&!1!==(o=this.findChildIndex(n,e))&&e.data[this.field].splice(i?o:o+1,0,t),!1===o&&(i?e.data[this.field].unshift(t):e.data[this.field].push(t)),this.initializeRow(e),this.layoutRow(e),this.refreshData(!0)}},{key:"findChildIndex",value:function(t,i){var n=this,o=!1;return"object"==e(t)?t instanceof D?o=t.data:t instanceof RowComponent?o=t._getSelf().data:"undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&i.modules.dataTree&&(o=i.modules.dataTree.children.find((function(e){return e instanceof D&&e.element===t})))&&(o=o.data):o=null!=t&&i.data[this.field].find((function(e){return e.data[n.table.options.index]==t})),o&&(Array.isArray(i.data[this.field])&&(o=i.data[this.field].indexOf(o)),-1==o&&(o=!1)),o}},{key:"getTreeChildren",value:function(e,t,i){var n=this,o=e.modules.dataTree,a=[];return o.children&&(Array.isArray(o.children)||(o.children=this.generateChildren(e)),o.children.forEach((function(e){e instanceof D&&(a.push(t?e.getComponent():e),i&&(a=a.concat(n.getTreeChildren(e,t,i))))}))),a}},{key:"getChildField",value:function(){return this.field}},{key:"redrawNeeded",value:function(e){return!!this.field&&void 0!==e[this.field]||!!this.elementField&&void 0!==e[this.elementField]}}]),r}(V);le.moduleName="dataTree";var ue={csv:function(t,i,n){var o=i&&i.delimiter?i.delimiter:",",a=[],r=[];t.forEach((function(t){var i=[];switch(t.type){case"group":console.warn("Download Warning - CSV downloader cannot process row groups");break;case"calc":console.warn("Download Warning - CSV downloader cannot process column calculations");break;case"header":t.columns.forEach((function(e,t){e&&1===e.depth&&(r[t]=void 0===e.value||null===e.value?"":'"'+String(e.value).split('"').join('""')+'"')}));break;case"row":t.columns.forEach((function(t){if(t){switch(e(t.value)){case"object":t.value=null!==t.value?JSON.stringify(t.value):"";break;case"undefined":t.value=""}i.push('"'+String(t.value).split('"').join('""')+'"')}})),a.push(i.join(o))}})),r.length&&a.unshift(r.join(o)),a=a.join("\n"),i.bom&&(a="\ufeff"+a),n(a,"text/csv")},json:function(e,t,i){var n=[];e.forEach((function(e){var t={};switch(e.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":e.columns.forEach((function(e){e&&(t[e.component.getTitleDownload()||e.component.getField()]=e.value)})),n.push(t)}})),i(n=JSON.stringify(n,null,"\t"),"application/json")},jsonLines:function(e,t,i){var n=[];e.forEach((function(e){var t={};switch(e.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":e.columns.forEach((function(e){e&&(t[e.component.getTitleDownload()||e.component.getField()]=e.value)})),n.push(JSON.stringify(t))}})),i(n.join("\n"),"application/x-ndjson")},pdf:function(t,i,n){var o=[],a=[],r={},s=i.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},l=i.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},u=i.jsPDF||{},c=i&&i.title?i.title:"";function h(t,i){var n=[];return t.columns.forEach((function(t){var o;if(t){switch(e(t.value)){case"object":t.value=null!==t.value?JSON.stringify(t.value):"";break;case"undefined":t.value=""}o={content:t.value,colSpan:t.width,rowSpan:t.height},i&&(o.styles=i),n.push(o)}})),n}u.orientation||(u.orientation=i.orientation||"landscape"),u.unit||(u.unit="pt"),t.forEach((function(e){switch(e.type){case"header":o.push(h(e));break;case"group":a.push(h(e,s));break;case"calc":a.push(h(e,l));break;case"row":a.push(h(e))}}));var d=new jspdf.jsPDF(u);i&&i.autoTable&&(r="function"==typeof i.autoTable?i.autoTable(d)||{}:i.autoTable),c&&(r.didDrawPage=function(e){d.text(c,40,30)}),r.head=o,r.body=a,d.autoTable(r),i&&i.documentProcessing&&i.documentProcessing(d),n(d.output("arraybuffer"),"application/pdf")},xlsx:function(t,i,n){var o=i.sheetName||"Sheet1",a=XLSX.utils.book_new(),r=new g(this);function s(){var i=[],n=[],o={},a={s:{c:0,r:0},e:{c:t[0]?t[0].columns.reduce((function(e,t){return e+(t&&t.width?t.width:1)}),0):0,r:t.length}};return t.forEach((function(t,o){var a=[];t.columns.forEach((function(t,i){t?(a.push(t.value instanceof Date||"object"!==e(t.value)?t.value:JSON.stringify(t.value)),(t.width>1||t.height>-1)&&(t.height>1||t.width>1)&&n.push({s:{r:o,c:i},e:{r:o+t.height-1,c:i+t.width-1}})):a.push("")})),i.push(a)})),XLSX.utils.sheet_add_aoa(o,i),o["!ref"]=XLSX.utils.encode_range(a),n.length&&(o["!merges"]=n),o}if(a.SheetNames=[],a.Sheets={},i.sheetOnly)n(s());else{if(i.sheets)for(var l in i.sheets)!0===i.sheets[l]?(a.SheetNames.push(l),a.Sheets[l]=s()):(a.SheetNames.push(l),r.commsSend(i.sheets[l],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},active:this.active,intercept:function(e){a.Sheets[l]=e}}));else a.SheetNames.push(o),a.Sheets[o]=s();i.documentProcessing&&(a=i.documentProcessing(a)),n(function(e){for(var t=new ArrayBuffer(e.length),i=new Uint8Array(t),n=0;n!=e.length;++n)i[n]=255&e.charCodeAt(n);return t}(XLSX.write(a,{bookType:"xlsx",bookSST:!0,type:"binary"})),"application/octet-stream")}},html:function(e,t,i){this.modExists("export",!0)&&i(this.modules.export.genereateHTMLTable(e),"text/html")}},ce=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).registerTableOption("downloadReady",(function(e,t){return t})),o.registerTableOption("downloadConfig",{}),o.registerTableOption("downloadRowRange","active"),o.registerColumnOption("download"),o.registerColumnOption("titleDownload"),o}return o(n,[{key:"initialize",value:function(){this.registerTableFunction("download",this.download.bind(this)),this.registerTableFunction("downloadToTab",this.downloadToTab.bind(this))}},{key:"downloadToTab",value:function(e,t,i,n){this.download(e,t,i,n,!0)}},{key:"download",value:function(e,t,i,o,a){var r=!1;if("function"==typeof e?r=e:n.downloaders[e]?r=n.downloaders[e]:console.warn("Download Error - No such download type found: ",e),r){var s=this.generateExportList(o);r.call(this.table,s,i||{},function(i,n){a?!0===a?this.triggerDownload(i,n,e,t,!0):a(i):this.triggerDownload(i,n,e,t)}.bind(this))}}},{key:"generateExportList",value:function(e){var t=this.table.modules.export.generateExportList(this.table.options.downloadConfig,!1,e||this.table.options.downloadRowRange,"download"),i=this.table.options.groupHeaderDownload;return i&&!Array.isArray(i)&&(i=[i]),t.forEach((function(e){var t;"group"===e.type&&(t=e.columns[0],i&&i[e.indent]&&(t.value=i[e.indent](t.value,e.component._group.getRowCount(),e.component._group.getData(),e.component)))})),t}},{key:"triggerDownload",value:function(e,t,i,n,o){var a=document.createElement("a"),r=new Blob([e],{type:t});n=n||"Tabulator."+("function"==typeof i?"txt":i);(r=this.table.options.downloadReady(e,r))&&(o?window.open(window.URL.createObjectURL(r)):navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(r,n):(a.setAttribute("href",window.URL.createObjectURL(r)),a.setAttribute("download",n),a.style.display="none",document.body.appendChild(a),a.click(),document.body.removeChild(a)),this.dispatchExternal("downloadComplete"))}},{key:"commsReceived",value:function(e,t,i){switch(t){case"intercept":this.download(i.type,"",i.options,i.active,i.intercept)}}}]),n}(V);function he(e,t){var i=t.mask,n=void 0!==t.maskLetterChar?t.maskLetterChar:"A",o=void 0!==t.maskNumberChar?t.maskNumberChar:"9",a=void 0!==t.maskWildcardChar?t.maskWildcardChar:"*";function r(t){var s=i[t];void 0!==s&&s!==a&&s!==n&&s!==o&&(e.value=e.value+""+s,r(t+1))}e.addEventListener("keydown",(function(t){var r=e.value.length,s=t.key;if(t.keyCode>46){if(r>=i.length)return t.preventDefault(),t.stopPropagation(),!1;switch(i[r]){case n:if(s.toUpperCase()==s.toLowerCase())return t.preventDefault(),t.stopPropagation(),!1;break;case o:if(isNaN(s))return t.preventDefault(),t.stopPropagation(),!1;break;case a:break;default:if(s!==i[r])return t.preventDefault(),t.stopPropagation(),!1}}})),e.addEventListener("keyup",(function(i){i.keyCode>46&&t.maskAutoFill&&r(e.value.length)})),e.placeholder||(e.placeholder=i),t.maskAutoFill&&r(e.value.length)}ce.moduleName="download",ce.downloaders=ue;var de=function(){function i(e,n,o,a,r,s){t(this,i),this.edit=e,this.table=e.table,this.cell=n,this.params=this._initializeParams(s),this.data=[],this.displayItems=[],this.currentItems=[],this.focusedItem=null,this.input=this._createInputElement(),this.listEl=this._createListElement(),this.initialValues=null,this.isFilter=!n._getSelf,this.filterTimeout=null,this.filtered=!1,this.typing=!1,this.values=[],this.popup=null,this.listIteration=0,this.blurable=!0,this.actions={success:a,cancel:r},this._deprecationCheck(),this._initializeValue(),o(this._onRendered.bind(this))}return o(i,[{key:"_deprecationCheck",value:function(){this.params.listItemFormatter&&console.warn("The listItemFormatter editor param has been deprecated, please see the latest editor documentation for updated options"),this.params.sortValuesList&&console.warn("The sortValuesList editor param has been deprecated, please see the latest editor documentation for updated options"),this.params.searchFunc&&console.warn("The searchFunc editor param has been deprecated, please see the latest editor documentation for updated options"),this.params.searchingPlaceholder&&console.warn("The searchingPlaceholder editor param has been deprecated, please see the latest editor documentation for updated options")}},{key:"_initializeValue",value:function(){var e=this.cell.getValue();void 0===e&&void 0!==this.params.defaultValue&&(e=this.params.defaultValue),this.initialValues=this.params.multiselect?e:[e],this.isFilter&&(this.input.value=this.initialValues?this.initialValues.join(","):"",this.headerFilterInitialListGen())}},{key:"_onRendered",value:function(){var e=this.cell.getElement();function t(e){e.stopPropagation()}this.input.style.height="100%",this.input.focus({preventScroll:!0}),e.addEventListener("click",t),setTimeout((function(){e.removeEventListener("click",t)}),1e3)}},{key:"_createListElement",value:function(){var e=document.createElement("div");return e.classList.add("tabulator-edit-list"),e.addEventListener("mousedown",this._preventBlur.bind(this)),e.addEventListener("keydown",this._inputKeyDown.bind(this)),e}},{key:"_setListWidth",value:function(){var e=this.isFilter?this.input:this.cell.getElement();this.listEl.style.minWidth=e.offsetWidth+"px",this.params.maxWidth&&(!0===this.params.maxWidth?this.listEl.style.maxWidth=e.offsetWidth+"px":"number"==typeof this.params.maxWidth?this.listEl.style.maxWidth=this.params.maxWidth+"px":this.listEl.style.maxWidth=this.params.maxWidth)}},{key:"_createInputElement",value:function(){var t=this.params.elementAttributes,i=document.createElement("input");if(i.setAttribute("type",this.params.clearable?"search":"text"),i.style.padding="4px",i.style.width="100%",i.style.boxSizing="border-box",this.params.autocomplete||(i.style.cursor="default",i.style.caretColor="transparent"),t&&"object"==e(t))for(var n in t)"+"==n.charAt(0)?(n=n.slice(1),i.setAttribute(n,i.getAttribute(n)+t["+"+n])):i.setAttribute(n,t[n]);return this.params.mask&&he(i,this.params),this._bindInputEvents(i),i}},{key:"_initializeParams",value:function(t){var i,n=["values","valuesURL","valuesLookup"];return(t=Object.assign({},t)).verticalNavigation=t.verticalNavigation||"editor",t.placeholderLoading=void 0===t.placeholderLoading?"Searching ...":t.placeholderLoading,t.placeholderEmpty=void 0===t.placeholderEmpty?"No Results Found":t.placeholderEmpty,t.filterDelay=void 0===t.filterDelay?300:t.filterDelay,t.emptyValue=Object.keys(t).includes("emptyValue")?t.emptyValue:"",(i=Object.keys(t).filter((function(e){return n.includes(e)})).length)?i>1&&console.warn("list editor config error - only one of the values, valuesURL, or valuesLookup options can be set on the same editor"):console.warn("list editor config error - either the values, valuesURL, or valuesLookup option must be set"),t.autocomplete?t.multiselect&&(t.multiselect=!1,console.warn("list editor config error - multiselect option is not available when autocomplete is enabled")):(t.freetext&&(t.freetext=!1,console.warn("list editor config error - freetext option is only available when autocomplete is enabled")),t.filterFunc&&(t.filterFunc=!1,console.warn("list editor config error - filterFunc option is only available when autocomplete is enabled")),t.filterRemote&&(t.filterRemote=!1,console.warn("list editor config error - filterRemote option is only available when autocomplete is enabled")),t.mask&&(t.mask=!1,console.warn("list editor config error - mask option is only available when autocomplete is enabled")),t.allowEmpty&&(t.allowEmpty=!1,console.warn("list editor config error - allowEmpty option is only available when autocomplete is enabled")),t.listOnEmpty&&(t.listOnEmpty=!1,console.warn("list editor config error - listOnEmpty option is only available when autocomplete is enabled"))),t.filterRemote&&"function"!=typeof t.valuesLookup&&!e(t.valuesURL)&&(t.filterRemote=!1,console.warn("list editor config error - filterRemote option should only be used when values list is populated from a remote source")),t}},{key:"_bindInputEvents",value:function(e){e.addEventListener("focus",this._inputFocus.bind(this)),e.addEventListener("click",this._inputClick.bind(this)),e.addEventListener("blur",this._inputBlur.bind(this)),e.addEventListener("keydown",this._inputKeyDown.bind(this)),e.addEventListener("search",this._inputSearch.bind(this)),this.params.autocomplete&&e.addEventListener("keyup",this._inputKeyUp.bind(this))}},{key:"_inputFocus",value:function(e){this.rebuildOptionsList()}},{key:"_filter",value:function(){var e=this;this.params.filterRemote?(clearTimeout(this.filterTimeout),this.filterTimeout=setTimeout((function(){e.rebuildOptionsList()}),this.params.filterDelay)):this._filterList()}},{key:"_inputClick",value:function(e){e.stopPropagation()}},{key:"_inputBlur",value:function(e){this.blurable&&this.popup&&this.popup.hide()}},{key:"_inputSearch",value:function(){this._clearChoices()}},{key:"_inputKeyDown",value:function(e){switch(e.keyCode){case 38:this._keyUp(e);break;case 40:this._keyDown(e);break;case 37:case 39:this._keySide(e);break;case 13:this._keyEnter();break;case 27:this._keyEsc();break;case 36:case 35:this._keyHomeEnd(e);break;case 9:break;default:this._keySelectLetter(e)}}},{key:"_inputKeyUp",value:function(e){switch(e.keyCode){case 38:case 37:case 39:case 40:case 13:case 27:break;default:this._keyAutoCompLetter(e)}}},{key:"_preventBlur",value:function(){this.blurable=!1,setTimeout((function(){this.blurable=!0}),10)}},{key:"_keyUp",value:function(e){var t=this.displayItems.indexOf(this.focusedItem);("editor"==this.params.verticalNavigation||"hybrid"==this.params.verticalNavigation&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t>0&&this._focusItem(this.displayItems[t-1]))}},{key:"_keyDown",value:function(e){var t=this.displayItems.indexOf(this.focusedItem);("editor"==this.params.verticalNavigation||"hybrid"==this.params.verticalNavigation&&t=38&&e.keyCode<=90&&this._scrollToValue(e.keyCode))}},{key:"_keyAutoCompLetter",value:function(e){this._filter(),this.typing=!0}},{key:"_scrollToValue",value:function(e){var t=this;clearTimeout(this.filterTimeout);var i=String.fromCharCode(e).toLowerCase();this.filterTerm+=i.toLowerCase();var n=this.displayItems.find((function(e){return void 0!==e.label&&e.label.toLowerCase().startsWith(t.filterTerm)}));n&&this._focusItem(n),this.filterTimeout=setTimeout((function(){t.filterTerm=""}),800)}},{key:"_focusItem",value:function(e){this.focusedItem&&this.focusedItem.element&&this.focusedItem.element.classList.remove("focused"),this.focusedItem=e,e&&e.element&&(e.element.classList.add("focused"),e.element.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"}))}},{key:"headerFilterInitialListGen",value:function(){this._generateOptions(!0)}},{key:"rebuildOptionsList",value:function(){this._generateOptions().then(this._sortOptions.bind(this)).then(this._buildList.bind(this)).then(this._showList.bind(this)).catch((function(e){Number.isInteger(e)||console.error("List generation error",e)}))}},{key:"_filterList",value:function(){this._buildList(this._filterOptions()),this._showList()}},{key:"_generateOptions",value:function(e){var t=this,i=[],n=++this.listIteration;return this.filtered=!1,this.params.values?i=this.params.values:this.params.valuesURL?i=this._ajaxRequest(this.params.valuesURL,this.input.value):"function"==typeof this.params.valuesLookup?i=this.params.valuesLookup(this.cell,this.input.value):this.params.valuesLookup&&(i=this._uniqueColumnValues(this.params.valuesLookupField)),i instanceof Promise?(e||this._addPlaceholder(this.params.placeholderLoading),i.then().then((function(e){return t.listIteration===n?t._parseList(e):Promise.reject(n)}))):Promise.resolve(this._parseList(i))}},{key:"_addPlaceholder",value:function(e){var t=document.createElement("div");"function"==typeof e&&(e=e(cell.getComponent(),this.listEl)),e&&(this._clearList(),e instanceof HTMLElement?t=e:(t.classList.add("tabulator-edit-list-placeholder"),t.innerHTML=e),this.listEl.appendChild(t),this._showList())}},{key:"_ajaxRequest",value:function(e,t){return e=ee(e,{},this.params.filterRemote?{term:t}:{}),fetch(e).then((function(e){return e.ok?e.json().catch((function(e){return console.warn("List Ajax Load Error - Invalid JSON returned",e),Promise.reject(e)})):(console.error("List Ajax Load Error - Connection Error: "+e.status,e.statusText),Promise.reject(e))})).catch((function(e){return console.error("List Ajax Load Error - Connection Error: ",e),Promise.reject(e)}))}},{key:"_uniqueColumnValues",value:function(e){var t,i={},n=this.table.getData(this.params.valuesLookup);return(t=e?this.table.columnManager.getColumnByField(e):this.cell.getColumn()._getSelf())?n.forEach((function(e){var n=t.getFieldValue(e);null!=n&&""!==n&&(i[n]=!0)})):(console.warn("unable to find matching column to create select lookup list:",e),i=[]),Object.keys(i)}},{key:"_parseList",value:function(t){var i=this,n=[];return Array.isArray(t)||(t=Object.entries(t).map((function(e){var t=h(e,2),i=t[0];return{label:t[1],value:i}}))),t.forEach((function(t){"object"!==e(t)&&(t={label:t,value:t}),i._parseListItem(t,n,0)})),this.data=n,n}},{key:"_parseListItem",value:function(e,t,i){var n={};e.options?n=this._parseListGroup(e,i+1):(n={label:e.label,value:e.value,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1,selected:!1,visible:!0,level:i,original:e},this.initialValues&&this.initialValues.indexOf(e.value)>-1&&this._chooseItem(n,!0)),t.push(n)}},{key:"_parseListGroup",value:function(e,t){var i=this,n={label:e.label,group:!0,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1,visible:!0,level:t,options:[],original:e};return e.options.forEach((function(e){i._parseListItem(e,n.options,t)})),n}},{key:"_sortOptions",value:function(e){var t;return this.params.sort&&(t="function"==typeof this.params.sort?this.params.sort:this._defaultSortFunction.bind(this),this._sortGroup(t,e)),e}},{key:"_sortGroup",value:function(e,t){var i=this;t.sort((function(t,i){return e(t.label,i.label,t.value,i.value,t.original,i.original)})),t.forEach((function(t){t.group&&i._sortGroup(e,t.options)}))}},{key:"_defaultSortFunction",value:function(e,t){var i,n,o,a,r,s=0,l=/(\d+)|(\D+)/g,u=/\d/,c=0;if("desc"===this.params.sort){var h=[t,e];e=h[0],t=h[1]}if(e||0===e){if(t||0===t){if(isFinite(e)&&isFinite(t))return e-t;if((i=String(e).toLowerCase())===(n=String(t).toLowerCase()))return 0;if(!u.test(i)||!u.test(n))return i>n?1:-1;for(i=i.match(l),n=n.match(l),r=i.length>n.length?n.length:i.length;sa?1:-1;return i.length>n.length}c=1}else c=t||0===t?-1:0;return c}},{key:"_filterOptions",value:function(){var e=this,t=this.params.filterFunc||this._defaultFilterFunc,i=this.input.value;return i?(this.filtered=!0,this.data.forEach((function(n){e._filterItem(t,i,n)}))):this.filtered=!1,this.data}},{key:"_filterItem",value:function(e,t,i){var n=this,o=!1;return i.group?(i.options.forEach((function(i){n._filterItem(e,t,i)&&(o=!0)})),i.visible=o):i.visible=e(t,i.label,i.value,i.original),i.visible}},{key:"_defaultFilterFunc",value:function(e,t,i,n){e=String(e).toLowerCase();return(null!==t||void 0!==t)&&(String(t).toLowerCase().indexOf(e)>-1||String(i).toLowerCase(e).indexOf()>-1)}},{key:"_clearList",value:function(){for(;this.listEl.firstChild;)this.listEl.removeChild(this.listEl.firstChild);this.displayItems=[]}},{key:"_buildList",value:function(e){var t=this;this._clearList(),e.forEach((function(e){t._buildItem(e)})),this.displayItems.length||this._addPlaceholder(this.params.placeholderEmpty)}},{key:"_buildItem",value:function(t){var i,n=this,o=t.element;if(!this.filtered||t.visible){if(!o){if((o=document.createElement("div")).tabIndex=0,(i=this.params.itemFormatter?this.params.itemFormatter(t.label,t.value,t.original,o):t.label)instanceof HTMLElement?o.appendChild(i):o.innerHTML=i,t.group?o.classList.add("tabulator-edit-list-group"):o.classList.add("tabulator-edit-list-item"),o.classList.add("tabulator-edit-list-group-level-"+t.level),t.elementAttributes&&"object"==e(t.elementAttributes))for(var a in t.elementAttributes)"+"==a.charAt(0)?(a=a.slice(1),o.setAttribute(a,this.input.getAttribute(a)+t.elementAttributes["+"+a])):o.setAttribute(a,t.elementAttributes[a]);t.group?o.addEventListener("click",this._groupClick.bind(this,t)):o.addEventListener("click",this._itemClick.bind(this,t)),o.addEventListener("mousedown",this._preventBlur.bind(this)),t.element=o}this._styleItem(t),this.listEl.appendChild(o),t.group?t.options.forEach((function(e){n._buildItem(e)})):this.displayItems.push(t)}}},{key:"_showList",value:function(){var e=this.popup&&this.popup.isVisible();if(this.input.parentNode){if(this.params.autocomplete&&""===this.input.value&&!this.params.listOnEmpty&&this.popup)return void this.popup.hide(!0);this._setListWidth(),this.popup||(this.popup=this.edit.popup(this.listEl)),this.popup.show(this.cell.getElement(),"bottom"),e||this.popup.hideOnBlur(this._resolveValue.bind(this,!0))}}},{key:"_styleItem",value:function(e){e&&e.element&&(e.selected?e.element.classList.add("active"):e.element.classList.remove("active"))}},{key:"_itemClick",value:function(e,t){t.stopPropagation(),this._chooseItem(e)}},{key:"_groupClick",value:function(e,t){t.stopPropagation()}},{key:"_cancel",value:function(){this.popup.hide(!0),this.actions.cancel()}},{key:"_clearChoices",value:function(){var e=this;this.typing=!0,this.currentItems.forEach((function(t){t.selected=!1,e._styleItem(t)})),this.currentItems=[],this.focusedItem=null}},{key:"_chooseItem",value:function(e,t){var i;this.typing=!1,this.params.multiselect?((i=this.currentItems.indexOf(e))>-1?(this.currentItems.splice(i,1),e.selected=!1):(this.currentItems.push(e),e.selected=!0),this.input.value=this.currentItems.map((function(e){return e.label})).join(","),this._styleItem(e)):(this.currentItems=[e],e.selected=!0,this.input.value=e.label,this._styleItem(e),t||this._resolveValue()),this._focusItem(e)}},{key:"_resolveValue",value:function(e){var t,i;if(this.popup.hide(!0),this.params.multiselect)t=this.currentItems.map((function(e){return e.value}));else if(e&&this.params.autocomplete&&this.typing){if(!(this.params.freetext||this.params.allowEmpty&&""===this.input.value))return void this.actions.cancel();t=this.input.value}else t=this.currentItems[0]?this.currentItems[0].value:null==(i=this.initialValues[0])||""===i?i:this.params.emptyValue;""===t&&(t=this.params.emptyValue),this.actions.success(t),this.isFilter&&(this.initialValues=t&&!Array.isArray[t]?[t]:t)}}]),i}();var me={input:function(t,i,n,o,a){var r=t.getValue(),s=document.createElement("input");if(s.setAttribute("type",a.search?"search":"text"),s.style.padding="4px",s.style.width="100%",s.style.boxSizing="border-box",a.elementAttributes&&"object"==e(a.elementAttributes))for(var l in a.elementAttributes)"+"==l.charAt(0)?(l=l.slice(1),s.setAttribute(l,s.getAttribute(l)+a.elementAttributes["+"+l])):s.setAttribute(l,a.elementAttributes[l]);function u(e){null==r&&""!==s.value||s.value!==r?n(s.value)&&(r=s.value):o()}return s.value=void 0!==r?r:"",i((function(){s.focus({preventScroll:!0}),s.style.height="100%",a.selectContents&&s.select()})),s.addEventListener("change",u),s.addEventListener("blur",u),s.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:u();break;case 27:o();break;case 35:case 36:e.stopPropagation()}})),a.mask&&he(s,a),s},textarea:function(t,i,n,o,a){var r=t.getValue(),s=a.verticalNavigation||"hybrid",l=String(null!=r?r:""),u=((l.match(/(?:\r\n|\r|\n)/g)||[]).length,document.createElement("textarea")),c=0;if(u.style.display="block",u.style.padding="2px",u.style.height="100%",u.style.width="100%",u.style.boxSizing="border-box",u.style.whiteSpace="pre-wrap",u.style.resize="none",a.elementAttributes&&"object"==e(a.elementAttributes))for(var h in a.elementAttributes)"+"==h.charAt(0)?(h=h.slice(1),u.setAttribute(h,u.getAttribute(h)+a.elementAttributes["+"+h])):u.setAttribute(h,a.elementAttributes[h]);function d(e){null==r&&""!==u.value||u.value!==r?(n(u.value)&&(r=u.value),setTimeout((function(){t.getRow().normalizeHeight()}),300)):o()}return u.value=l,i((function(){u.focus({preventScroll:!0}),u.style.height="100%",u.scrollHeight,u.style.height=u.scrollHeight+"px",t.getRow().normalizeHeight(),a.selectContents&&u.select()})),u.addEventListener("change",d),u.addEventListener("blur",d),u.addEventListener("keyup",(function(){u.style.height="";var e=u.scrollHeight;u.style.height=e+"px",e!=c&&(c=e,t.getRow().normalizeHeight())})),u.addEventListener("keydown",(function(e){switch(e.keyCode){case 27:o();break;case 38:("editor"==s||"hybrid"==s&&u.selectionStart)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 40:("editor"==s||"hybrid"==s&&u.selectionStart!==u.value.length)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 35:case 36:e.stopPropagation()}})),a.mask&&he(u,a),u},number:function(t,i,n,o,a){var r=t.getValue(),s=a.verticalNavigation||"editor",l=document.createElement("input");if(l.setAttribute("type","number"),void 0!==a.max&&l.setAttribute("max",a.max),void 0!==a.min&&l.setAttribute("min",a.min),void 0!==a.step&&l.setAttribute("step",a.step),l.style.padding="4px",l.style.width="100%",l.style.boxSizing="border-box",a.elementAttributes&&"object"==e(a.elementAttributes))for(var u in a.elementAttributes)"+"==u.charAt(0)?(u=u.slice(1),l.setAttribute(u,l.getAttribute(u)+a.elementAttributes["+"+u])):l.setAttribute(u,a.elementAttributes[u]);l.value=r;var c=function(e){h()};function h(){var e=l.value;isNaN(e)||""===e||(e=Number(e)),e!==r?n(e)&&(r=e):o()}return i((function(){l.removeEventListener("blur",c),l.focus({preventScroll:!0}),l.style.height="100%",l.addEventListener("blur",c),a.selectContents&&l.select()})),l.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:h();break;case 27:o();break;case 38:case 40:"editor"==s&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 35:case 36:e.stopPropagation()}})),a.mask&&he(l,a),l},range:function(t,i,n,o,a){var r=t.getValue(),s=document.createElement("input");if(s.setAttribute("type","range"),void 0!==a.max&&s.setAttribute("max",a.max),void 0!==a.min&&s.setAttribute("min",a.min),void 0!==a.step&&s.setAttribute("step",a.step),s.style.padding="4px",s.style.width="100%",s.style.boxSizing="border-box",a.elementAttributes&&"object"==e(a.elementAttributes))for(var l in a.elementAttributes)"+"==l.charAt(0)?(l=l.slice(1),s.setAttribute(l,s.getAttribute(l)+a.elementAttributes["+"+l])):s.setAttribute(l,a.elementAttributes[l]);function u(){var e=s.value;isNaN(e)||""===e||(e=Number(e)),e!=r?n(e)&&(r=e):o()}return s.value=r,i((function(){s.focus({preventScroll:!0}),s.style.height="100%"})),s.addEventListener("blur",(function(e){u()})),s.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:u();break;case 27:o()}})),s},select:function(e,t,i,n,o){return console.warn("The select editor has been deprecated, please use the new list editor"),new de(this,e,t,i,n,o).input},list:function(e,t,i,n,o){return new de(this,e,t,i,n,o).input},autocomplete:function(e,t,i,n,o){return console.warn("The autocomplete editor has been deprecated, please use the new list editor with the 'autocomplete' editorParam"),o.autocomplete=!0,new de(this,e,t,i,n,o).input},star:function(t,i,n,o,a){var r=this,s=t.getElement(),l=t.getValue(),u=s.getElementsByTagName("svg").length||5,c=s.getElementsByTagName("svg")[0]?s.getElementsByTagName("svg")[0].getAttribute("width"):14,h=[],d=document.createElement("div"),m=document.createElementNS("http://www.w3.org/2000/svg","svg");function p(e){h.forEach((function(t,i){i'):("ie"==r.table.browser?t.setAttribute("class","tabulator-star-inactive"):t.classList.replace("tabulator-star-active","tabulator-star-inactive"),t.innerHTML='')}))}function f(e){var t=document.createElement("span"),i=m.cloneNode(!0);h.push(i),t.addEventListener("mouseenter",(function(t){t.stopPropagation(),t.stopImmediatePropagation(),p(e)})),t.addEventListener("mousemove",(function(e){e.stopPropagation(),e.stopImmediatePropagation()})),t.addEventListener("click",(function(t){t.stopPropagation(),t.stopImmediatePropagation(),n(e),s.blur()})),t.appendChild(i),d.appendChild(t)}function g(e){l=e,p(e)}if(s.style.whiteSpace="nowrap",s.style.overflow="hidden",s.style.textOverflow="ellipsis",d.style.verticalAlign="middle",d.style.display="inline-block",d.style.padding="4px",m.setAttribute("width",c),m.setAttribute("height",c),m.setAttribute("viewBox","0 0 512 512"),m.setAttribute("xml:space","preserve"),m.style.padding="0 1px",a.elementAttributes&&"object"==e(a.elementAttributes))for(var v in a.elementAttributes)"+"==v.charAt(0)?(v=v.slice(1),d.setAttribute(v,d.getAttribute(v)+a.elementAttributes["+"+v])):d.setAttribute(v,a.elementAttributes[v]);for(var b=1;b<=u;b++)f(b);return p(l=Math.min(parseInt(l),u)),d.addEventListener("mousemove",(function(e){p(0)})),d.addEventListener("click",(function(e){n(0)})),s.addEventListener("blur",(function(e){o()})),s.addEventListener("keydown",(function(e){switch(e.keyCode){case 39:g(l+1);break;case 37:g(l-1);break;case 13:n(l);break;case 27:o()}})),d},progress:function(t,i,n,o,a){var r,s,l=t.getElement(),u=void 0===a.max?l.getElementsByTagName("div")[0]&&l.getElementsByTagName("div")[0].getAttribute("max")||100:a.max,c=void 0===a.min?l.getElementsByTagName("div")[0]&&l.getElementsByTagName("div")[0].getAttribute("min")||0:a.min,h=(u-c)/100,d=t.getValue()||0,m=document.createElement("div"),p=document.createElement("div");function f(){var e=window.getComputedStyle(l,null),t=h*Math.round(p.offsetWidth/((l.clientWidth-parseInt(e.getPropertyValue("padding-left"))-parseInt(e.getPropertyValue("padding-right")))/100))+c;n(t),l.setAttribute("aria-valuenow",t),l.setAttribute("aria-label",d)}if(m.style.position="absolute",m.style.right="0",m.style.top="0",m.style.bottom="0",m.style.width="5px",m.classList.add("tabulator-progress-handle"),p.style.display="inline-block",p.style.position="relative",p.style.height="100%",p.style.backgroundColor="#488CE9",p.style.maxWidth="100%",p.style.minWidth="0%",a.elementAttributes&&"object"==e(a.elementAttributes))for(var g in a.elementAttributes)"+"==g.charAt(0)?(g=g.slice(1),p.setAttribute(g,p.getAttribute(g)+a.elementAttributes["+"+g])):p.setAttribute(g,a.elementAttributes[g]);return l.style.padding="4px 4px",d=Math.min(parseFloat(d),u),d=Math.max(parseFloat(d),c),d=Math.round((d-c)/h),p.style.width=d+"%",l.setAttribute("aria-valuemin",c),l.setAttribute("aria-valuemax",u),p.appendChild(m),m.addEventListener("mousedown",(function(e){r=e.screenX,s=p.offsetWidth})),m.addEventListener("mouseover",(function(){m.style.cursor="ew-resize"})),l.addEventListener("mousemove",(function(e){r&&(p.style.width=s+e.screenX-r+"px")})),l.addEventListener("mouseup",(function(e){r&&(e.stopPropagation(),e.stopImmediatePropagation(),r=!1,s=!1,f())})),l.addEventListener("keydown",(function(e){switch(e.keyCode){case 39:e.preventDefault(),p.style.width=p.clientWidth+l.clientWidth/100+"px";break;case 37:e.preventDefault(),p.style.width=p.clientWidth-l.clientWidth/100+"px";break;case 9:case 13:f();break;case 27:o()}})),l.addEventListener("blur",(function(){o()})),p},tickCross:function(t,i,n,o,a){var r=t.getValue(),s=document.createElement("input"),l=a.tristate,u=void 0===a.indeterminateValue?null:a.indeterminateValue,c=!1,h=Object.keys(a).includes("trueValue"),d=Object.keys(a).includes("falseValue");if(s.setAttribute("type","checkbox"),s.style.marginTop="5px",s.style.boxSizing="border-box",a.elementAttributes&&"object"==e(a.elementAttributes))for(var m in a.elementAttributes)"+"==m.charAt(0)?(m=m.slice(1),s.setAttribute(m,s.getAttribute(m)+a.elementAttributes["+"+m])):s.setAttribute(m,a.elementAttributes[m]);function p(e){var t=s.checked;return t=h&&t?a.trueValue:d&&!t?a.falseValue:t,l?e?c?u:t:s.checked&&!c?(s.checked=!1,s.indeterminate=!0,c=!0,u):(c=!1,t):t}return s.value=r,!l||void 0!==r&&r!==u&&""!==r||(c=!0,s.indeterminate=!0),"firefox"!=this.table.browser&&i((function(){s.focus({preventScroll:!0})})),s.checked=h?r===a.trueValue:!0===r||"true"===r||"True"===r||1===r,i((function(){s.focus()})),s.addEventListener("change",(function(e){n(p())})),s.addEventListener("blur",(function(e){n(p(!0))})),s.addEventListener("keydown",(function(e){13==e.keyCode&&n(p()),27==e.keyCode&&o()})),s}},pe=function(i){a(r,i);var n=c(r);function r(e){var i;return t(this,r),(i=n.call(this,e)).currentCell=!1,i.mouseClick=!1,i.recursionBlock=!1,i.invalidEdit=!1,i.editedCells=[],i.editors=r.editors,i.registerColumnOption("editable"),i.registerColumnOption("editor"),i.registerColumnOption("editorParams"),i.registerColumnOption("cellEditing"),i.registerColumnOption("cellEdited"),i.registerColumnOption("cellEditCancelled"),i.registerTableFunction("getEditedCells",i.getEditedCells.bind(l(i))),i.registerTableFunction("clearCellEdited",i.clearCellEdited.bind(l(i))),i.registerTableFunction("navigatePrev",i.navigatePrev.bind(l(i))),i.registerTableFunction("navigateNext",i.navigateNext.bind(l(i))),i.registerTableFunction("navigateLeft",i.navigateLeft.bind(l(i))),i.registerTableFunction("navigateRight",i.navigateRight.bind(l(i))),i.registerTableFunction("navigateUp",i.navigateUp.bind(l(i))),i.registerTableFunction("navigateDown",i.navigateDown.bind(l(i))),i.registerComponentFunction("cell","isEdited",i.cellisEdited.bind(l(i))),i.registerComponentFunction("cell","clearEdited",i.clearEdited.bind(l(i))),i.registerComponentFunction("cell","edit",i.editCell.bind(l(i))),i.registerComponentFunction("cell","cancelEdit",i.cellCancelEdit.bind(l(i))),i.registerComponentFunction("cell","navigatePrev",i.navigatePrev.bind(l(i))),i.registerComponentFunction("cell","navigateNext",i.navigateNext.bind(l(i))),i.registerComponentFunction("cell","navigateLeft",i.navigateLeft.bind(l(i))),i.registerComponentFunction("cell","navigateRight",i.navigateRight.bind(l(i))),i.registerComponentFunction("cell","navigateUp",i.navigateUp.bind(l(i))),i.registerComponentFunction("cell","navigateDown",i.navigateDown.bind(l(i))),i}return o(r,[{key:"initialize",value:function(){this.subscribe("cell-init",this.bindEditor.bind(this)),this.subscribe("cell-delete",this.clearEdited.bind(this)),this.subscribe("column-layout",this.initializeColumnCheck.bind(this)),this.subscribe("column-delete",this.columnDeleteCheck.bind(this)),this.subscribe("row-deleting",this.rowDeleteCheck.bind(this)),this.subscribe("data-refreshing",this.cancelEdit.bind(this)),this.subscribe("keybinding-nav-prev",this.navigatePrev.bind(this,void 0)),this.subscribe("keybinding-nav-next",this.keybindingNavigateNext.bind(this)),this.subscribe("keybinding-nav-left",this.navigateLeft.bind(this,void 0)),this.subscribe("keybinding-nav-right",this.navigateRight.bind(this,void 0)),this.subscribe("keybinding-nav-up",this.navigateUp.bind(this,void 0)),this.subscribe("keybinding-nav-down",this.navigateDown.bind(this,void 0))}},{key:"keybindingNavigateNext",value:function(e){var t=this.currentCell,i=this.options("tabEndNewRow");t&&(this.navigateNext(t,e)||i&&(t.getElement().firstChild.blur(),(i=!0===i?this.table.addRow({}):"function"==typeof i?this.table.addRow(i(t.row.getComponent())):this.table.addRow(Object.assign({},i))).then((function(){setTimeout((function(){t.getComponent().navigateNext()}))}))))}},{key:"cellisEdited",value:function(e){return!!e.modules.edit&&e.modules.edit.edited}},{key:"cellCancelEdit",value:function(e){e===this.currentCell?this.table.modules.edit.cancelEdit():console.warn("Cancel Editor Error - This cell is not currently being edited ")}},{key:"clearCellEdited",value:function(e){var t=this;e||(e=this.table.modules.edit.getEditedCells()),Array.isArray(e)||(e=[e]),e.forEach((function(e){t.table.modules.edit.clearEdited(e._getSelf())}))}},{key:"navigatePrev",value:function(){var e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentCell,n=arguments.length>1?arguments[1]:void 0;if(i){if(n&&n.preventDefault(),e=this.navigateLeft())return!0;if((t=this.table.rowManager.prevDisplayRow(i.row,!0))&&(e=this.findNextEditableCell(t,t.cells.length)))return e.getComponent().edit(),!0}return!1}},{key:"navigateNext",value:function(){var e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentCell,n=arguments.length>1?arguments[1]:void 0;if(i){if(n&&n.preventDefault(),e=this.navigateRight())return!0;if((t=this.table.rowManager.nextDisplayRow(i.row,!0))&&(e=this.findNextEditableCell(t,-1)))return e.getComponent().edit(),!0}return!1}},{key:"navigateLeft",value:function(){var e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentCell,n=arguments.length>1?arguments[1]:void 0;return!!(i&&(n&&n.preventDefault(),e=i.getIndex(),t=this.findPrevEditableCell(i.row,e)))&&(t.getComponent().edit(),!0)}},{key:"navigateRight",value:function(){var e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentCell,n=arguments.length>1?arguments[1]:void 0;return!!(i&&(n&&n.preventDefault(),e=i.getIndex(),t=this.findNextEditableCell(i.row,e)))&&(t.getComponent().edit(),!0)}},{key:"navigateUp",value:function(){var e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentCell,n=arguments.length>1?arguments[1]:void 0;return!!(i&&(n&&n.preventDefault(),e=i.getIndex(),t=this.table.rowManager.prevDisplayRow(i.row,!0)))&&(t.cells[e].getComponent().edit(),!0)}},{key:"navigateDown",value:function(){var e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentCell,n=arguments.length>1?arguments[1]:void 0;return!!(i&&(n&&n.preventDefault(),e=i.getIndex(),t=this.table.rowManager.nextDisplayRow(i.row,!0)))&&(t.cells[e].getComponent().edit(),!0)}},{key:"findNextEditableCell",value:function(e,t){var i=!1;if(t0)for(var n=t-1;n>=0;n--){var o=e.cells[n],a=!0;if(o.column.modules.edit&&k.elVisible(o.getElement())&&("function"==typeof o.column.modules.edit.check&&(a=o.column.modules.edit.check(o.getComponent())),a)){i=o;break}}return i}},{key:"initializeColumnCheck",value:function(e){void 0!==e.definition.editor&&this.initializeColumn(e)}},{key:"columnDeleteCheck",value:function(e){this.currentCell&&this.currentCell.column===e&&this.cancelEdit()}},{key:"rowDeleteCheck",value:function(e){this.currentCell&&this.currentCell.row===e&&this.cancelEdit()}},{key:"initializeColumn",value:function(t){var i={editor:!1,blocked:!1,check:t.definition.editable,params:t.definition.editorParams||{}};switch(e(t.definition.editor)){case"string":this.editors[t.definition.editor]?i.editor=this.editors[t.definition.editor]:console.warn("Editor Error - No such editor found: ",t.definition.editor);break;case"function":i.editor=t.definition.editor;break;case"boolean":!0===t.definition.editor&&("function"!=typeof t.definition.formatter?this.editors[t.definition.formatter]?i.editor=this.editors[t.definition.formatter]:i.editor=this.editors.input:console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",t.definition.formatter))}i.editor&&(t.modules.edit=i)}},{key:"getCurrentCell",value:function(){return!!this.currentCell&&this.currentCell.getComponent()}},{key:"clearEditor",value:function(e){var t,i=this.currentCell;if(this.invalidEdit=!1,i){for(this.currentCell=!1,t=i.getElement(),this.dispatch("edit-editor-clear",i,e),t.classList.remove("tabulator-editing");t.firstChild;)t.removeChild(t.firstChild);i.row.getElement().classList.remove("tabulator-row-editing")}}},{key:"cancelEdit",value:function(){if(this.currentCell){var e=this.currentCell,t=this.currentCell.getComponent();this.clearEditor(!0),e.setValueActual(e.getValue()),e.cellRendered(),("textarea"==e.column.definition.editor||e.column.definition.variableHeight)&&e.row.normalizeHeight(!0),e.column.definition.cellEditCancelled&&e.column.definition.cellEditCancelled.call(this.table,t),this.dispatch("edit-cancelled",e),this.dispatchExternal("cellEditCancelled",t)}}},{key:"bindEditor",value:function(e){if(e.column.modules.edit){var t=this,i=e.getElement(!0);i.setAttribute("tabindex",0),i.addEventListener("click",(function(e){i.classList.contains("tabulator-editing")||i.focus({preventScroll:!0})})),i.addEventListener("mousedown",(function(e){2===e.button?e.preventDefault():t.mouseClick=!0})),i.addEventListener("focus",(function(i){t.recursionBlock||t.edit(e,i,!1)}))}}},{key:"focusCellNoEvent",value:function(e,t){this.recursionBlock=!0,t&&"ie"===this.table.browser||e.getElement().focus({preventScroll:!0}),this.recursionBlock=!1}},{key:"editCell",value:function(e,t){this.focusCellNoEvent(e),this.edit(e,!1,t)}},{key:"focusScrollAdjust",value:function(e){if("virtual"==this.table.rowManager.getRenderMode()){var t=this.table.rowManager.element.scrollTop,i=this.table.rowManager.element.clientHeight+this.table.rowManager.element.scrollTop,n=e.row.getElement();n.offsetTop;n.offsetTopi&&(this.table.rowManager.element.scrollTop+=n.offsetTop+n.offsetHeight-i);var o=this.table.rowManager.element.scrollLeft,a=this.table.rowManager.element.clientWidth+this.table.rowManager.element.scrollLeft,r=e.getElement();r.offsetLeft;this.table.modExists("frozenColumns")&&(o+=parseInt(this.table.modules.frozenColumns.leftMargin),a-=parseInt(this.table.modules.frozenColumns.rightMargin)),"virtual"===this.table.options.renderHorizontal&&(o-=parseInt(this.table.columnManager.renderer.vDomPadLeft),a-=parseInt(this.table.columnManager.renderer.vDomPadLeft)),r.offsetLefta&&(this.table.rowManager.element.scrollLeft+=r.offsetLeft+r.offsetWidth-a)}}},{key:"edit",value:function(t,i,n){var o,a,r,s=this,l=!0,u=function(){},c=t.getElement();if(!this.currentCell){if(t.column.modules.edit.blocked)return this.mouseClick=!1,c.blur(),!1;switch(i&&i.stopPropagation(),e(t.column.modules.edit.check)){case"function":l=t.column.modules.edit.check(t.getComponent());break;case"boolean":l=t.column.modules.edit.check}if(l||n){if(s.cancelEdit(),s.currentCell=t,this.focusScrollAdjust(t),a=t.getComponent(),this.mouseClick&&(this.mouseClick=!1,t.column.definition.cellClick&&t.column.definition.cellClick.call(this.table,i,a)),t.column.definition.cellEditing&&t.column.definition.cellEditing.call(this.table,a),this.dispatch("cell-editing",t),this.dispatchExternal("cellEditing",a),r="function"==typeof t.column.modules.edit.params?t.column.modules.edit.params(a):t.column.modules.edit.params,!1===(o=t.column.modules.edit.editor.call(s,a,(function(e){u=e}),(function(e){if(s.currentCell===t){var i=s.chain("edit-success",[t,e],!0,!0);return!0===i||"highlight"===s.table.options.validationMode?(s.clearEditor(),t.modules.edit||(t.modules.edit={}),t.modules.edit.edited=!0,-1==s.editedCells.indexOf(t)&&s.editedCells.push(t),t.setValue(e,!0),!0===i):(s.invalidEdit=!0,s.focusCellNoEvent(t,!0),u(),!1)}}),(function(){s.currentCell===t&&s.cancelEdit()}),r)))return c.blur(),!1;if(!(o instanceof Node))return console.warn("Edit Error - Editor should return an instance of Node, the editor returned:",o),c.blur(),!1;for(c.classList.add("tabulator-editing"),t.row.getElement().classList.add("tabulator-row-editing");c.firstChild;)c.removeChild(c.firstChild);c.appendChild(o),u();for(var h=c.children,d=0;d-1&&this.editedCells.splice(t,1)}}]),r}(V);pe.moduleName="edit",pe.editors=me;var fe=function e(i,n,o,a){t(this,e),this.type=i,this.columns=n,this.component=o||!1,this.indent=a||0},ge=function e(i,n,o,a,r){t(this,e),this.value=i,this.component=n||!1,this.width=o,this.height=a,this.depth=r},ve=function(n){a(s,n);var r=c(s);function s(e){var i;return t(this,s),(i=r.call(this,e)).config={},i.cloneTableStyle=!0,i.colVisProp="",i.registerTableOption("htmlOutputConfig",!1),i.registerColumnOption("htmlOutput"),i.registerColumnOption("titleHtmlOutput"),i}return o(s,[{key:"initialize",value:function(){this.registerTableFunction("getHtml",this.getHtml.bind(this))}},{key:"generateExportList",value:function(e,t,i,n){this.cloneTableStyle=t,this.config=e||{},this.colVisProp=n;var o=!1!==this.config.columnHeaders?this.headersToExportRows(this.generateColumnGroupHeaders()):[],a=this.bodyToExportRows(this.rowLookup(i));return o.concat(a)}},{key:"genereateTable",value:function(e,t,i,n){var o=this.generateExportList(e,t,i,n);return this.genereateTableElement(o)}},{key:"rowLookup",value:function(e){var t=this,i=[];if("function"==typeof e)e.call(this.table).forEach((function(e){(e=t.table.rowManager.findRow(e))&&i.push(e)}));else switch(e){case!0:case"visible":i=this.table.rowManager.getVisibleRows(!1,!0);break;case"all":i=this.table.rowManager.rows;break;case"selected":i=this.table.modules.selectRow.selectedRows;break;case"active":default:i=this.table.options.pagination?this.table.rowManager.getDisplayRows(this.table.rowManager.displayRows.length-2):this.table.rowManager.getDisplayRows()}return Object.assign([],i)}},{key:"generateColumnGroupHeaders",value:function(){var e=this,t=[];return(!1!==this.config.columnGroups?this.table.columnManager.columns:this.table.columnManager.columnsByIndex).forEach((function(i){var n=e.processColumnGroup(i);n&&t.push(n)})),t}},{key:"processColumnGroup",value:function(e){var t=this,i=e.columns,n=0,o={title:e.definition["title"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))]||e.definition.title,column:e,depth:1};if(i.length){if(o.subGroups=[],o.width=0,i.forEach((function(e){var i=t.processColumnGroup(e);i&&(o.width+=i.width,o.subGroups.push(i),i.depth>n&&(n=i.depth))})),o.depth+=n,!o.width)return!1}else{if(!this.columnVisCheck(e))return!1;o.width=1}return o}},{key:"columnVisCheck",value:function(e){return!1!==e.definition[this.colVisProp]&&(e.visible||!e.visible&&e.definition[this.colVisProp])}},{key:"headersToExportRows",value:function(e){var t=[],i=0,n=[];function o(e,n){var a=i-n;if(void 0===t[n]&&(t[n]=[]),e.height=e.subGroups?1:a-e.depth+1,t[n].push(e),e.height>1)for(var r=1;r1)for(var s=1;si&&(i=e.depth)})),e.forEach((function(e){o(e,0)})),t.forEach((function(e){var t=[];e.forEach((function(e){if(e){var i=void 0===e.title?"":e.title;t.push(new ge(i,e.column.getComponent(),e.width,e.height,e.depth))}else t.push(null)})),n.push(new fe("header",t))})),n}},{key:"bodyToExportRows",value:function(e){var t=this,i=[],n=[];return this.table.columnManager.columnsByIndex.forEach((function(e){t.columnVisCheck(e)&&i.push(e.getComponent())})),!1!==this.config.columnCalcs&&this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&e.unshift(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&e.push(this.table.modules.columnCalcs.botRow)),(e=e.filter((function(e){switch(e.type){case"group":return!1!==t.config.rowGroups;case"calc":return!1!==t.config.columnCalcs;case"row":return!(t.table.options.dataTree&&!1===t.config.dataTree&&e.modules.dataTree.parent)}return!0}))).forEach((function(e,o){var a=e.getData(t.colVisProp),r=[],s=0;switch(e.type){case"group":s=e.level,r.push(new ge(e.key,e.getComponent(),i.length,1));break;case"calc":case"row":i.forEach((function(e){r.push(new ge(e._column.getFieldValue(a),e,1,1))})),t.table.options.dataTree&&!1!==t.config.dataTree&&(s=e.modules.dataTree.index)}n.push(new fe(e.type,r,e.getComponent(),s))})),n}},{key:"genereateTableElement",value:function(e){var t=this,i=document.createElement("table"),n=document.createElement("thead"),o=document.createElement("tbody"),a=this.lookupTableStyles(),r=this.table.options["rowFormatter"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],s={};return s.rowFormatter=null!==r?r:this.table.options.rowFormatter,this.table.options.dataTree&&!1!==this.config.dataTree&&this.table.modExists("columnCalcs")&&(s.treeElementField=this.table.modules.dataTree.elementField),s.groupHeader=this.table.options["groupHeader"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],s.groupHeader&&!Array.isArray(s.groupHeader)&&(s.groupHeader=[s.groupHeader]),i.classList.add("tabulator-print-table"),this.mapElementStyles(this.table.columnManager.getHeadersElement(),n,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),e.length>1e3&&console.warn("It may take a long time to render an HTML table with more than 1000 rows"),e.forEach((function(e,i){switch(e.type){case"header":n.appendChild(t.genereateHeaderElement(e,s,a));break;case"group":o.appendChild(t.genereateGroupElement(e,s,a));break;case"calc":o.appendChild(t.genereateCalcElement(e,s,a));break;case"row":var r=t.genereateRowElement(e,s,a);t.mapElementStyles(i%2&&a.evenRow?a.evenRow:a.oddRow,r,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),o.appendChild(r)}})),n.innerHTML&&i.appendChild(n),i.appendChild(o),this.mapElementStyles(this.table.element,i,["border-top","border-left","border-right","border-bottom"]),i}},{key:"lookupTableStyles",value:function(){var e={};return this.cloneTableStyle&&window.getComputedStyle&&(e.oddRow=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"),e.evenRow=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),e.calcRow=this.table.element.querySelector(".tabulator-row.tabulator-calcs"),e.firstRow=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),e.firstGroup=this.table.element.getElementsByClassName("tabulator-group")[0],e.firstRow&&(e.styleCells=e.firstRow.getElementsByClassName("tabulator-cell"),e.firstCell=e.styleCells[0],e.lastCell=e.styleCells[e.styleCells.length-1])),e}},{key:"genereateHeaderElement",value:function(e,t,i){var n=this,o=document.createElement("tr");return e.columns.forEach((function(e){if(e){var t=document.createElement("th"),i=e.component._column.definition.cssClass?e.component._column.definition.cssClass.split(" "):[];t.colSpan=e.width,t.rowSpan=e.height,t.innerHTML=e.value,n.cloneTableStyle&&(t.style.boxSizing="border-box"),i.forEach((function(e){t.classList.add(e)})),n.mapElementStyles(e.component.getElement(),t,["text-align","border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),n.mapElementStyles(e.component._column.contentElement,t,["padding-top","padding-left","padding-right","padding-bottom"]),e.component._column.visible?n.mapElementStyles(e.component.getElement(),t,["width"]):e.component._column.definition.width&&(t.style.width=e.component._column.definition.width+"px"),e.component._column.parent&&n.mapElementStyles(e.component._column.parent.groupElement,t,["border-top"]),o.appendChild(t)}})),o}},{key:"genereateGroupElement",value:function(e,t,i){var n=document.createElement("tr"),o=document.createElement("td"),a=e.columns[0];return n.classList.add("tabulator-print-table-row"),t.groupHeader&&t.groupHeader[e.indent]?a.value=t.groupHeader[e.indent](a.value,e.component._group.getRowCount(),e.component._group.getData(),e.component):!1===t.groupHeader?a.value=a.value:a.value=e.component._group.generator(a.value,e.component._group.getRowCount(),e.component._group.getData(),e.component),o.colSpan=a.width,o.innerHTML=a.value,n.classList.add("tabulator-print-table-group"),n.classList.add("tabulator-group-level-"+e.indent),a.component.isVisible()&&n.classList.add("tabulator-group-visible"),this.mapElementStyles(i.firstGroup,n,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),this.mapElementStyles(i.firstGroup,o,["padding-top","padding-left","padding-right","padding-bottom"]),n.appendChild(o),n}},{key:"genereateCalcElement",value:function(e,t,i){var n=this.genereateRowElement(e,t,i);return n.classList.add("tabulator-print-table-calcs"),this.mapElementStyles(i.calcRow,n,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),n}},{key:"genereateRowElement",value:function(t,n,o){var a=this,r=document.createElement("tr");return r.classList.add("tabulator-print-table-row"),t.columns.forEach((function(s){if(s){var l=document.createElement("td"),u=s.component._column,c=a.table.columnManager.findColumnIndex(u),h=s.value,d={modules:{},getValue:function(){return h},getField:function(){return u.definition.field},getElement:function(){return l},getColumn:function(){return u.getComponent()},getData:function(){return t.component.getData()},getRow:function(){return t.component},getComponent:function(){return d},column:u};if((u.definition.cssClass?u.definition.cssClass.split(" "):[]).forEach((function(e){l.classList.add(e)})),a.table.modExists("format")&&!1!==a.config.formatCells)h=a.table.modules.format.formatExportValue(d,a.colVisProp);else switch(e(h)){case"object":h=null!==h?JSON.stringify(h):"";break;case"undefined":h="";break;default:h=h}h instanceof Node?l.appendChild(h):l.innerHTML=h,(o.styleCells[c]||o.firstCell)&&(a.mapElementStyles(o.styleCells[c]||o.firstCell,l,["padding-top","padding-left","padding-right","padding-bottom","border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","text-align"]),u.definition.align&&(l.style.textAlign=u.definition.align)),a.table.options.dataTree&&!1!==a.config.dataTree&&(n.treeElementField&&n.treeElementField==u.field||!n.treeElementField&&0==i)&&(t.component._row.modules.dataTree.controlEl&&l.insertBefore(t.component._row.modules.dataTree.controlEl.cloneNode(!0),l.firstChild),t.component._row.modules.dataTree.branchEl&&l.insertBefore(t.component._row.modules.dataTree.branchEl.cloneNode(!0),l.firstChild)),r.appendChild(l),d.modules.format&&d.modules.format.renderedCallback&&d.modules.format.renderedCallback(),n.rowFormatter&&!1!==a.config.formatCells&&n.rowFormatter(t.component)}})),r}},{key:"genereateHTMLTable",value:function(e){var t=document.createElement("div");return t.appendChild(this.genereateTableElement(e)),t.innerHTML}},{key:"getHtml",value:function(e,t,i,n){var o=this.generateExportList(i||this.table.options.htmlOutputConfig,t,e,n||"htmlOutput");return this.genereateHTMLTable(o)}},{key:"mapElementStyles",value:function(e,t,i){if(this.cloneTableStyle&&e&&t){var n={"background-color":"backgroundColor",color:"fontColor",width:"width","font-weight":"fontWeight","font-family":"fontFamily","font-size":"fontSize","text-align":"textAlign","border-top":"borderTop","border-left":"borderLeft","border-right":"borderRight","border-bottom":"borderBottom","padding-top":"paddingTop","padding-left":"paddingLeft","padding-right":"paddingRight","padding-bottom":"paddingBottom"};if(window.getComputedStyle){var o=window.getComputedStyle(e);i.forEach((function(e){t.style[n[e]]=o.getPropertyValue(e)}))}}}}]),s}(V);ve.moduleName="export";var be={"=":function(e,t,i,n){return t==e},"<":function(e,t,i,n){return t":function(e,t,i,n){return t>e},">=":function(e,t,i,n){return t>=e},"!=":function(e,t,i,n){return t!=e},regex:function(e,t,i,n){return"string"==typeof e&&(e=new RegExp(e)),e.test(t)},like:function(e,t,i,n){return null==e?t===e:null!=t&&String(t).toLowerCase().indexOf(e.toLowerCase())>-1},keywords:function(e,t,i,n){var o=e.toLowerCase().split(void 0===n.separator?" ":n.separator),a=String(null==t?"":t).toLowerCase(),r=[];return o.forEach((function(e){a.includes(e)&&r.push(!0)})),n.matchAll?r.length===o.length:!!r.length},starts:function(e,t,i,n){return null==e?t===e:null!=t&&String(t).toLowerCase().startsWith(e.toLowerCase())},ends:function(e,t,i,n){return null==e?t===e:null!=t&&String(t).toLowerCase().endsWith(e.toLowerCase())},in:function(e,t,i,n){return Array.isArray(e)?!e.length||e.indexOf(t)>-1:(console.warn("Filter Error - filter value is not an array:",e),!1)}},ye=function(i){a(r,i);var n=c(r);function r(e){var i;return t(this,r),(i=n.call(this,e)).filterList=[],i.headerFilters={},i.headerFilterColumns=[],i.prevHeaderFilterChangeCheck="",i.prevHeaderFilterChangeCheck="{}",i.changed=!1,i.tableInitialized=!1,i.registerTableOption("filterMode","local"),i.registerTableOption("initialFilter",!1),i.registerTableOption("initialHeaderFilter",!1),i.registerTableOption("headerFilterLiveFilterDelay",300),i.registerColumnOption("headerFilter"),i.registerColumnOption("headerFilterPlaceholder"),i.registerColumnOption("headerFilterParams"),i.registerColumnOption("headerFilterEmptyCheck"),i.registerColumnOption("headerFilterFunc"),i.registerColumnOption("headerFilterFuncParams"),i.registerColumnOption("headerFilterLiveFilter"),i.registerTableFunction("searchRows",i.searchRows.bind(l(i))),i.registerTableFunction("searchData",i.searchData.bind(l(i))),i.registerTableFunction("setFilter",i.userSetFilter.bind(l(i))),i.registerTableFunction("refreshFilter",i.userRefreshFilter.bind(l(i))),i.registerTableFunction("addFilter",i.userAddFilter.bind(l(i))),i.registerTableFunction("getFilters",i.getFilters.bind(l(i))),i.registerTableFunction("setHeaderFilterFocus",i.userSetHeaderFilterFocus.bind(l(i))),i.registerTableFunction("getHeaderFilterValue",i.userGetHeaderFilterValue.bind(l(i))),i.registerTableFunction("setHeaderFilterValue",i.userSetHeaderFilterValue.bind(l(i))),i.registerTableFunction("getHeaderFilters",i.getHeaderFilters.bind(l(i))),i.registerTableFunction("removeFilter",i.userRemoveFilter.bind(l(i))),i.registerTableFunction("clearFilter",i.userClearFilter.bind(l(i))),i.registerTableFunction("clearHeaderFilter",i.userClearHeaderFilter.bind(l(i))),i.registerComponentFunction("column","headerFilterFocus",i.setHeaderFilterFocus.bind(l(i))),i.registerComponentFunction("column","reloadHeaderFilter",i.reloadHeaderFilter.bind(l(i))),i.registerComponentFunction("column","getHeaderFilterValue",i.getHeaderFilterValue.bind(l(i))),i.registerComponentFunction("column","setHeaderFilterValue",i.setHeaderFilterValue.bind(l(i))),i}return o(r,[{key:"initialize",value:function(){this.subscribe("column-init",this.initializeColumnHeaderFilter.bind(this)),this.subscribe("column-width-fit-before",this.hideHeaderFilterElements.bind(this)),this.subscribe("column-width-fit-after",this.showHeaderFilterElements.bind(this)),this.subscribe("table-built",this.tableBuilt.bind(this)),"remote"===this.table.options.filterMode&&this.subscribe("data-params",this.remoteFilterParams.bind(this)),this.registerDataHandler(this.filter.bind(this),10)}},{key:"tableBuilt",value:function(){var e=this;this.table.options.initialFilter&&this.setFilter(this.table.options.initialFilter),this.table.options.initialHeaderFilter&&this.table.options.initialHeaderFilter.forEach((function(t){var i=e.table.columnManager.findColumn(t.field);if(!i)return console.warn("Column Filter Error - No matching column found:",t.field),!1;e.setHeaderFilterValue(i,t.value)})),this.tableInitialized=!0}},{key:"remoteFilterParams",value:function(e,t,i,n){return n.filter=this.getFilters(!0,!0),n}},{key:"userSetFilter",value:function(e,t,i,n){this.setFilter(e,t,i,n),this.refreshFilter()}},{key:"userRefreshFilter",value:function(){this.refreshFilter()}},{key:"userAddFilter",value:function(e,t,i,n){this.addFilter(e,t,i,n),this.refreshFilter()}},{key:"userSetHeaderFilterFocus",value:function(e){var t=this.table.columnManager.findColumn(e);if(!t)return console.warn("Column Filter Focus Error - No matching column found:",e),!1;this.setHeaderFilterFocus(t)}},{key:"userGetHeaderFilterValue",value:function(e){var t=this.table.columnManager.findColumn(e);if(t)return this.getHeaderFilterValue(t);console.warn("Column Filter Error - No matching column found:",e)}},{key:"userSetHeaderFilterValue",value:function(e,t){var i=this.table.columnManager.findColumn(e);if(!i)return console.warn("Column Filter Error - No matching column found:",e),!1;this.setHeaderFilterValue(i,t)}},{key:"userRemoveFilter",value:function(e,t,i){this.removeFilter(e,t,i),this.refreshFilter()}},{key:"userClearFilter",value:function(e){this.clearFilter(e),this.refreshFilter()}},{key:"userClearHeaderFilter",value:function(){this.clearHeaderFilter(),this.refreshFilter()}},{key:"searchRows",value:function(e,t,i){return this.search("rows",e,t,i)}},{key:"searchData",value:function(e,t,i){return this.search("data",e,t,i)}},{key:"initializeColumnHeaderFilter",value:function(e){var t=e.definition;t.headerFilter&&(void 0!==t.headerFilterPlaceholder&&t.field&&this.module("localize").setHeaderFilterColumnPlaceholder(t.field,t.headerFilterPlaceholder),this.initializeColumn(e))}},{key:"initializeColumn",value:function(t,i){var n=this,o=t.getField();t.modules.filter={success:function(i){var a,s="input"==t.modules.filter.tagType&&"text"==t.modules.filter.attrType||"textarea"==t.modules.filter.tagType?"partial":"match",l="",u="";if(void 0===t.modules.filter.prevSuccess||t.modules.filter.prevSuccess!==i){if(t.modules.filter.prevSuccess=i,t.modules.filter.emptyFunc(i))delete n.headerFilters[o];else{switch(t.modules.filter.value=i,e(t.definition.headerFilterFunc)){case"string":r.filters[t.definition.headerFilterFunc]?(l=t.definition.headerFilterFunc,a=function(e){var n=t.definition.headerFilterFuncParams||{},o=t.getFieldValue(e);return n="function"==typeof n?n(i,o,e):n,r.filters[t.definition.headerFilterFunc](i,o,e,n)}):console.warn("Header Filter Error - Matching filter function not found: ",t.definition.headerFilterFunc);break;case"function":l=a=function(e){var n=t.definition.headerFilterFuncParams||{},o=t.getFieldValue(e);return n="function"==typeof n?n(i,o,e):n,t.definition.headerFilterFunc(i,o,e,n)}}if(!a)switch(s){case"partial":a=function(e){var n=t.getFieldValue(e);return null!=n&&String(n).toLowerCase().indexOf(String(i).toLowerCase())>-1},l="like";break;default:a=function(e){return t.getFieldValue(e)==i},l="="}n.headerFilters[o]={value:i,func:a,type:l,params:{}}}t.modules.filter.value=i,u=JSON.stringify(n.headerFilters),n.prevHeaderFilterChangeCheck!==u&&(n.prevHeaderFilterChangeCheck=u,n.trackChanges(),n.refreshFilter())}return!0},attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(t)}},{key:"generateHeaderFilterElement",value:function(t,i,n){var o,a,r,s,l,u,c,h=this,d=this,m=t.modules.filter.success,p=t.getField();if(t.modules.filter.value=i,t.modules.filter.headerElement&&t.modules.filter.headerElement.parentNode&&t.contentElement.removeChild(t.modules.filter.headerElement.parentNode),p){switch(t.modules.filter.emptyFunc=t.definition.headerFilterEmptyCheck||function(e){return!e&&"0"!==e&&0!==e},(o=document.createElement("div")).classList.add("tabulator-header-filter"),e(t.definition.headerFilter)){case"string":d.table.modules.edit.editors[t.definition.headerFilter]?(a=d.table.modules.edit.editors[t.definition.headerFilter],"tick"!==t.definition.headerFilter&&"tickCross"!==t.definition.headerFilter||t.definition.headerFilterEmptyCheck||(t.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):console.warn("Filter Error - Cannot build header filter, No such editor found: ",t.definition.editor);break;case"function":a=t.definition.headerFilter;break;case"boolean":t.modules.edit&&t.modules.edit.editor?a=t.modules.edit.editor:t.definition.formatter&&d.table.modules.edit.editors[t.definition.formatter]?(a=d.table.modules.edit.editors[t.definition.formatter],"tick"!==t.definition.formatter&&"tickCross"!==t.definition.formatter||t.definition.headerFilterEmptyCheck||(t.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):a=d.table.modules.edit.editors.input}if(a){if(s={getValue:function(){return void 0!==i?i:""},getField:function(){return t.definition.field},getElement:function(){return o},getColumn:function(){return t.getComponent()},getRow:function(){return{normalizeHeight:function(){}}}},c="function"==typeof(c=t.definition.headerFilterParams||{})?c.call(d.table,s):c,!(r=a.call(this.table.modules.edit,s,(function(){}),m,(function(){}),c)))return void console.warn("Filter Error - Cannot add filter to "+p+" column, editor returned a value of false");if(!(r instanceof Node))return void console.warn("Filter Error - Cannot add filter to "+p+" column, editor should return an instance of Node, the editor returned:",r);p?d.langBind("headerFilters|columns|"+t.definition.field,(function(e){r.setAttribute("placeholder",void 0!==e&&e?e:d.langText("headerFilters|default"))})):d.langBind("headerFilters|default",(function(e){r.setAttribute("placeholder",e)})),r.addEventListener("click",(function(e){e.stopPropagation(),r.focus()})),r.addEventListener("focus",(function(e){var t=h.table.columnManager.element.scrollLeft;t!==h.table.rowManager.element.scrollLeft+parseInt(h.table.columnManager.element.style.marginLeft)&&(h.table.rowManager.scrollHorizontal(t),h.table.columnManager.scrollHorizontal(t))})),l=!1,u=function(e){l&&clearTimeout(l),l=setTimeout((function(){m(r.value)}),d.table.options.headerFilterLiveFilterDelay)},t.modules.filter.headerElement=r,t.modules.filter.attrType=r.hasAttribute("type")?r.getAttribute("type").toLowerCase():"",t.modules.filter.tagType=r.tagName.toLowerCase(),!1!==t.definition.headerFilterLiveFilter&&("autocomplete"!==t.definition.headerFilter&&"tickCross"!==t.definition.headerFilter&&("autocomplete"!==t.definition.editor&&"tickCross"!==t.definition.editor||!0!==t.definition.headerFilter)&&(r.addEventListener("keyup",u),r.addEventListener("search",u),"number"==t.modules.filter.attrType&&r.addEventListener("change",(function(e){m(r.value)})),"text"==t.modules.filter.attrType&&"ie"!==this.table.browser&&r.setAttribute("type","search")),"input"!=t.modules.filter.tagType&&"select"!=t.modules.filter.tagType&&"textarea"!=t.modules.filter.tagType||r.addEventListener("mousedown",(function(e){e.stopPropagation()}))),o.appendChild(r),t.contentElement.appendChild(o),n||d.headerFilterColumns.push(t)}}else console.warn("Filter Error - Cannot add header filter, column has no field set:",t.definition.title)}},{key:"hideHeaderFilterElements",value:function(){this.headerFilterColumns.forEach((function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="none")}))}},{key:"showHeaderFilterElements",value:function(){this.headerFilterColumns.forEach((function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="")}))}},{key:"setHeaderFilterFocus",value:function(e){e.modules.filter&&e.modules.filter.headerElement?e.modules.filter.headerElement.focus():console.warn("Column Filter Focus Error - No header filter set on column:",e.getField())}},{key:"getHeaderFilterValue",value:function(e){if(e.modules.filter&&e.modules.filter.headerElement)return e.modules.filter.value;console.warn("Column Filter Error - No header filter set on column:",e.getField())}},{key:"setHeaderFilterValue",value:function(e,t){e&&(e.modules.filter&&e.modules.filter.headerElement?(this.generateHeaderFilterElement(e,t,!0),e.modules.filter.success(t)):console.warn("Column Filter Error - No header filter set on column:",e.getField()))}},{key:"reloadHeaderFilter",value:function(e){e&&(e.modules.filter&&e.modules.filter.headerElement?this.generateHeaderFilterElement(e,e.modules.filter.value,!0):console.warn("Column Filter Error - No header filter set on column:",e.getField()))}},{key:"refreshFilter",value:function(){this.tableInitialized&&("remote"===this.table.options.filterMode?this.reloadData(null,!1,!1):this.refreshData(!0))}},{key:"trackChanges",value:function(){this.changed=!0,this.dispatch("filter-changed")}},{key:"hasChanged",value:function(){var e=this.changed;return this.changed=!1,e}},{key:"setFilter",value:function(e,t,i,n){this.filterList=[],Array.isArray(e)||(e=[{field:e,type:t,value:i,params:n}]),this.addFilter(e)}},{key:"addFilter",value:function(e,t,i,n){var o=this,a=!1;Array.isArray(e)||(e=[{field:e,type:t,value:i,params:n}]),e.forEach((function(e){(e=o.findFilter(e))&&(o.filterList.push(e),a=!0)})),a&&this.trackChanges()}},{key:"findFilter",value:function(e){var t;if(Array.isArray(e))return this.findSubFilters(e);var i=!1;return"function"==typeof e.field?i=function(t){return e.field(t,e.type||{})}:r.filters[e.type]?i=(t=this.table.columnManager.getColumnByField(e.field))?function(i){return r.filters[e.type](e.value,t.getFieldValue(i),i,e.params||{})}:function(t){return r.filters[e.type](e.value,t[e.field],t,e.params||{})}:console.warn("Filter Error - No such filter type found, ignoring: ",e.type),e.func=i,!!e.func&&e}},{key:"findSubFilters",value:function(e){var t=this,i=[];return e.forEach((function(e){(e=t.findFilter(e))&&i.push(e)})),!!i.length&&i}},{key:"getFilters",value:function(e,t){var i=[];return e&&(i=this.getHeaderFilters()),t&&i.forEach((function(e){"function"==typeof e.type&&(e.type="function")})),i=i.concat(this.filtersToArray(this.filterList,t))}},{key:"filtersToArray",value:function(e,t){var i=this,n=[];return e.forEach((function(e){var o;Array.isArray(e)?n.push(i.filtersToArray(e,t)):(o={field:e.field,type:e.type,value:e.value},t&&"function"==typeof o.type&&(o.type="function"),n.push(o))})),n}},{key:"getHeaderFilters",value:function(){var e=[];for(var t in this.headerFilters)e.push({field:t,type:this.headerFilters[t].type,value:this.headerFilters[t].value});return e}},{key:"removeFilter",value:function(t,i,n){var o=this;Array.isArray(t)||(t=[{field:t,type:i,value:n}]),t.forEach((function(t){var i=-1;(i="object"==e(t.field)?o.filterList.findIndex((function(e){return t===e})):o.filterList.findIndex((function(e){return t.field===e.field&&t.type===e.type&&t.value===e.value})))>-1?o.filterList.splice(i,1):console.warn("Filter Error - No matching filter type found, ignoring: ",t.type)})),this.trackChanges()}},{key:"clearFilter",value:function(e){this.filterList=[],e&&this.clearHeaderFilter(),this.trackChanges()}},{key:"clearHeaderFilter",value:function(){var e=this;this.headerFilters={},this.prevHeaderFilterChangeCheck="{}",this.headerFilterColumns.forEach((function(t){void 0!==t.modules.filter.value&&delete t.modules.filter.value,t.modules.filter.prevSuccess=void 0,e.reloadHeaderFilter(t)})),this.trackChanges()}},{key:"search",value:function(e,t,i,n){var o=this,a=[],r=[];return Array.isArray(t)||(t=[{field:t,type:i,value:n}]),t.forEach((function(e){(e=o.findFilter(e))&&r.push(e)})),this.table.rowManager.rows.forEach((function(t){var i=!0;r.forEach((function(e){o.filterRecurse(e,t.getData())||(i=!1)})),i&&a.push("data"===e?t.getData("data"):t.getComponent())})),a}},{key:"filter",value:function(e,t){var i=this,n=[],o=[];return this.subscribedExternal("dataFiltering")&&this.dispatchExternal("dataFiltering",this.getFilters(!0)),"remote"!==this.table.options.filterMode&&(this.filterList.length||Object.keys(this.headerFilters).length)?e.forEach((function(e){i.filterRow(e)&&n.push(e)})):n=e.slice(0),this.subscribedExternal("dataFiltered")&&(n.forEach((function(e){o.push(e.getComponent())})),this.dispatchExternal("dataFiltered",this.getFilters(!0),o)),n}},{key:"filterRow",value:function(e,t){var i=this,n=!0,o=e.getData();for(var a in this.filterList.forEach((function(e){i.filterRecurse(e,o)||(n=!1)})),this.headerFilters)this.headerFilters[a].func(o)||(n=!1);return n}},{key:"filterRecurse",value:function(e,t){var i=this,n=!1;return Array.isArray(e)?e.forEach((function(e){i.filterRecurse(e,t)&&(n=!0)})):n=e.func(t),n}}]),r}(V);ye.moduleName="filter",ye.filters=be;var we={plaintext:function(e,t,i){return this.emptyToSpace(this.sanitizeHTML(e.getValue()))},html:function(e,t,i){return e.getValue()},textarea:function(e,t,i){return e.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(e.getValue()))},money:function(e,t,i){var n,o,a,r,s=parseFloat(e.getValue()),l="",u=t.decimal||".",c=t.thousand||",",h=t.negativeSign||"-",d=t.symbol||"",m=!!t.symbolAfter,p=void 0!==t.precision?t.precision:2;if(isNaN(s))return this.emptyToSpace(this.sanitizeHTML(e.getValue()));if(s<0&&(s=Math.abs(s),l=h),n=!1!==p?s.toFixed(p):s,o=(n=String(n).split("."))[0],a=n.length>1?u+n[1]:"",!1!==t.thousand)for(r=/(\d+)(\d{3})/;r.test(o);)o=o.replace(r,"$1"+c+"$2");return m?l+o+a+d:l+d+o+a},link:function(t,i,n){var o,a=t.getValue(),r=i.urlPrefix||"",s=i.download,l=a,u=document.createElement("a");if(i.labelField&&(o=t.getData(),l=function t(i,n){var o=n[i.shift()];return i.length&&"object"===e(o)?t(i,o):o}(i.labelField.split(this.table.options.nestedFieldSeparator),o)),i.label)switch(e(i.label)){case"string":l=i.label;break;case"function":l=i.label(t)}if(l){if(i.urlField&&(a=(o=t.getData())[i.urlField]),i.url)switch(e(i.url)){case"string":a=i.url;break;case"function":a=i.url(t)}return u.setAttribute("href",r+a),i.target&&u.setAttribute("target",i.target),i.download&&(s="function"==typeof s?s(t):!0===s?"":s,u.setAttribute("download",s)),u.innerHTML=this.emptyToSpace(this.sanitizeHTML(l)),u}return" "},image:function(t,i,n){var o=document.createElement("img"),a=t.getValue();switch(i.urlPrefix&&(a=i.urlPrefix+t.getValue()),i.urlSuffix&&(a+=i.urlSuffix),o.setAttribute("src",a),e(i.height)){case"number":o.style.height=i.height+"px";break;case"string":o.style.height=i.height}switch(e(i.width)){case"number":o.style.width=i.width+"px";break;case"string":o.style.width=i.width}return o.addEventListener("load",(function(){t.getRow().normalizeHeight()})),o},tickCross:function(e,t,i){var n=e.getValue(),o=e.getElement(),a=t.allowEmpty,r=t.allowTruthy,s=Object.keys(t).includes("trueValue"),l=void 0!==t.tickElement?t.tickElement:'',u=void 0!==t.crossElement?t.crossElement:'';return s&&n===t.trueValue||!s&&(r&&n||!0===n||"true"===n||"True"===n||1===n||"1"===n)?(o.setAttribute("aria-checked",!0),l||""):!a||"null"!==n&&""!==n&&null!=n?(o.setAttribute("aria-checked",!1),u||""):(o.setAttribute("aria-checked","mixed"),"")},datetime:function(e,t,i){var n,o=window.DateTime||luxon.DateTime,a=t.inputFormat||"yyyy-MM-dd HH:mm:ss",r=t.outputFormat||"dd/MM/yyyy HH:mm:ss",s=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",l=e.getValue();if(void 0!==o)return(n=o.isDateTime(l)?l:"iso"===a?o.fromISO(String(l)):o.fromFormat(String(l),a)).isValid?(t.timezone&&(n=n.setZone(t.timezone)),n.toFormat(r)):!0!==s&&l?"function"==typeof s?s(l):s:l;console.error("Format Error - 'datetime' formatter is dependant on luxon.js")},datetimediff:function(e,t,i){var n,o=window.DateTime||luxon.DateTime,a=t.inputFormat||"yyyy-MM-dd HH:mm:ss",r=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",s=void 0!==t.suffix&&t.suffix,l=void 0!==t.unit?t.unit:"days",u=void 0!==t.humanize&&t.humanize,c=void 0!==t.date?t.date:o.now(),h=e.getValue();if(void 0!==o)return(n=o.isDateTime(h)?h:"iso"===a?o.fromISO(String(h)):o.fromFormat(String(h),a)).isValid?u?n.diff(c,l).toHuman()+(s?" "+s:""):parseInt(n.diff(c,l)[l])+(s?" "+s:""):!0===r?h:"function"==typeof r?r(h):r;console.error("Format Error - 'datetimediff' formatter is dependant on luxon.js")},lookup:function(e,t,i){var n=e.getValue();return void 0===t[n]?(console.warn("Missing display value for "+n),n):t[n]},star:function(e,t,i){var n=e.getValue(),o=e.getElement(),a=t&&t.stars?t.stars:5,r=document.createElement("span"),s=document.createElementNS("http://www.w3.org/2000/svg","svg");r.style.verticalAlign="middle",s.setAttribute("width","14"),s.setAttribute("height","14"),s.setAttribute("viewBox","0 0 512 512"),s.setAttribute("xml:space","preserve"),s.style.padding="0 1px",n=n&&!isNaN(n)?parseInt(n):0,n=Math.max(0,Math.min(n,a));for(var l=1;l<=a;l++){var u=s.cloneNode(!0);u.innerHTML=l<=n?'':'',r.appendChild(u)}return o.style.whiteSpace="nowrap",o.style.overflow="hidden",o.style.textOverflow="ellipsis",o.setAttribute("aria-label",n),r},traffic:function(t,i,n){var o,a,r=this.sanitizeHTML(t.getValue())||0,s=document.createElement("span"),l=i&&i.max?i.max:100,u=i&&i.min?i.min:0,c=i&&void 0!==i.color?i.color:["red","orange","green"],h="#666666";if(!isNaN(r)&&void 0!==t.getValue()){switch(s.classList.add("tabulator-traffic-light"),a=parseFloat(r)<=l?parseFloat(r):l,a=parseFloat(a)>=u?parseFloat(a):u,o=(l-u)/100,a=Math.round((a-u)/o),e(c)){case"string":h=c;break;case"function":h=c(r);break;case"object":if(Array.isArray(c)){var d=100/c.length,m=Math.floor(a/d);m=Math.min(m,c.length-1),h=c[m=Math.max(m,0)];break}}return s.style.backgroundColor=h,s}},progress:function(t,i,n){var o,a,r,s,l,u=this.sanitizeHTML(t.getValue())||0,c=t.getElement(),h=i&&i.max?i.max:100,d=i&&i.min?i.min:0,m=i&&i.legendAlign?i.legendAlign:"center";switch(a=parseFloat(u)<=h?parseFloat(u):h,a=parseFloat(a)>=d?parseFloat(a):d,o=(h-d)/100,a=Math.round((a-d)/o),e(i.color)){case"string":r=i.color;break;case"function":r=i.color(u);break;case"object":if(Array.isArray(i.color)){var p=100/i.color.length,f=Math.floor(a/p);f=Math.min(f,i.color.length-1),f=Math.max(f,0),r=i.color[f];break}default:r="#2DC214"}switch(e(i.legend)){case"string":s=i.legend;break;case"function":s=i.legend(u);break;case"boolean":s=u;break;default:s=!1}switch(e(i.legendColor)){case"string":l=i.legendColor;break;case"function":l=i.legendColor(u);break;case"object":if(Array.isArray(i.legendColor)){p=100/i.legendColor.length,f=Math.floor(a/p);f=Math.min(f,i.legendColor.length-1),f=Math.max(f,0),l=i.legendColor[f]}break;default:l="#000"}c.style.minWidth="30px",c.style.position="relative",c.setAttribute("aria-label",a);var g=document.createElement("div");g.style.display="inline-block",g.style.position="absolute",g.style.width=a+"%",g.style.backgroundColor=r,g.style.height="100%",g.setAttribute("data-max",h),g.setAttribute("data-min",d);var v=document.createElement("div");if(v.style.position="relative",v.style.width="100%",v.style.height="100%",s){var b=document.createElement("div");b.style.position="absolute",b.style.top=0,b.style.left=0,b.style.textAlign=m,b.style.width="100%",b.style.color=l,b.innerHTML=s}return n((function(){if(!(t instanceof y)){var e=document.createElement("div");e.style.position="absolute",e.style.top="4px",e.style.bottom="4px",e.style.left="4px",e.style.right="4px",c.appendChild(e),c=e}c.appendChild(v),v.appendChild(g),s&&v.appendChild(b)})),""},color:function(e,t,i){return e.getElement().style.backgroundColor=this.sanitizeHTML(e.getValue()),""},buttonTick:function(e,t,i){return''},buttonCross:function(e,t,i){return''},rownum:function(e,t,i){return this.table.rowManager.activeRows.indexOf(e.getRow()._getSelf())+1||""},handle:function(e,t,i){return e.getElement().classList.add("tabulator-row-handle"),"
"},responsiveCollapse:function(e,t,i){var n=document.createElement("div"),o=e.getRow()._row.modules.responsiveLayout;function a(e){var t=o.element;o.open=e,t&&(o.open?(n.classList.add("open"),t.style.display=""):(n.classList.remove("open"),t.style.display="none"))}return n.classList.add("tabulator-responsive-collapse-toggle"),n.innerHTML="+-",e.getElement().classList.add("tabulator-row-handle"),n.addEventListener("click",(function(e){e.stopImmediatePropagation(),a(!o.open)})),a(o.open),n},rowSelection:function(e,t,i){var n=this,o=document.createElement("input"),a=!1;if(o.type="checkbox",o.setAttribute("aria-label","Select Row"),this.table.modExists("selectRow",!0))if(o.addEventListener("click",(function(e){e.stopPropagation()})),"function"==typeof e.getRow){var r=e.getRow();r instanceof L?(o.addEventListener("change",(function(e){"click"===n.table.options.selectableRangeMode&&a?a=!1:r.toggleSelect()})),"click"===this.table.options.selectableRangeMode&&o.addEventListener("click",(function(e){a=!0,n.table.modules.selectRow.handleComplexRowClick(r._row,e)})),o.checked=r.isSelected&&r.isSelected(),this.table.modules.selectRow.registerRowSelectCheckbox(r,o)):o=""}else o.addEventListener("change",(function(e){n.table.modules.selectRow.selectedRows.length?n.table.deselectRow():n.table.selectRow(t.rowRange)})),this.table.modules.selectRow.registerHeaderSelectCheckbox(o);return o}},Ce=function(i){a(r,i);var n=c(r);function r(e){var i;return t(this,r),(i=n.call(this,e)).registerColumnOption("formatter"),i.registerColumnOption("formatterParams"),i.registerColumnOption("formatterPrint"),i.registerColumnOption("formatterPrintParams"),i.registerColumnOption("formatterClipboard"),i.registerColumnOption("formatterClipboardParams"),i.registerColumnOption("formatterHtmlOutput"),i.registerColumnOption("formatterHtmlOutputParams"),i.registerColumnOption("titleFormatter"),i.registerColumnOption("titleFormatterParams"),i}return o(r,[{key:"initialize",value:function(){this.subscribe("cell-format",this.formatValue.bind(this)),this.subscribe("cell-rendered",this.cellRendered.bind(this)),this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("column-format",this.formatHeader.bind(this))}},{key:"initializeColumn",value:function(e){e.modules.format=this.lookupFormatter(e,""),void 0!==e.definition.formatterPrint&&(e.modules.format.print=this.lookupFormatter(e,"Print")),void 0!==e.definition.formatterClipboard&&(e.modules.format.clipboard=this.lookupFormatter(e,"Clipboard")),void 0!==e.definition.formatterHtmlOutput&&(e.modules.format.htmlOutput=this.lookupFormatter(e,"HtmlOutput"))}},{key:"lookupFormatter",value:function(t,i){var n={params:t.definition["formatter"+i+"Params"]||{}},o=t.definition["formatter"+i];switch(e(o)){case"string":r.formatters[o]?n.formatter=r.formatters[o]:(console.warn("Formatter Error - No such formatter found: ",o),n.formatter=r.formatters.plaintext);break;case"function":n.formatter=o;break;default:n.formatter=r.formatters.plaintext}return n}},{key:"cellRendered",value:function(e){e.modules.format&&e.modules.format.renderedCallback&&!e.modules.format.rendered&&(e.modules.format.renderedCallback(),e.modules.format.rendered=!0)}},{key:"formatHeader",value:function(e,t,i){var n,o,a,r;return e.definition.titleFormatter?(n=this.getFormatter(e.definition.titleFormatter),a=function(t){e.titleFormatterRendered=t},r={getValue:function(){return t},getElement:function(){return i}},o="function"==typeof(o=e.definition.titleFormatterParams||{})?o():o,n.call(this,r,o,a)):t}},{key:"formatValue",value:function(e){var t=e.getComponent(),i="function"==typeof e.column.modules.format.params?e.column.modules.format.params(t):e.column.modules.format.params;return e.column.modules.format.formatter.call(this,t,i,(function(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t,e.modules.format.rendered=!1}))}},{key:"formatExportValue",value:function(e,t){var i,n=e.column.modules.format[t];if(n){return i="function"==typeof n.params?n.params(component):n.params,n.formatter.call(this,e.getComponent(),i,(function(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t,e.modules.format.rendered=!1}))}return this.formatValue(e)}},{key:"sanitizeHTML",value:function(e){if(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(e).replace(/[&<>"'`=\/]/g,(function(e){return t[e]}))}return e}},{key:"emptyToSpace",value:function(e){return null==e||""===e?" ":e}},{key:"getFormatter",value:function(t){switch(e(t)){case"string":r.formatters[t]?t=r.formatters[t]:(console.warn("Formatter Error - No such formatter found: ",t),t=r.formatters.plaintext);break;case"function":t=t;break;default:t=r.formatters.plaintext}return t}}]),r}(V);Ce.moduleName="format",Ce.formatters=we;var ke=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).leftColumns=[],o.rightColumns=[],o.leftMargin=0,o.rightMargin=0,o.rightPadding=0,o.initializationMode="left",o.active=!1,o.blocked=!0,o.registerColumnOption("frozen"),o}return o(n,[{key:"reset",value:function(){this.initializationMode="left",this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightMargin=0,this.active=!1,this.table.columnManager.headersElement.style.marginLeft=0,this.table.columnManager.element.style.paddingRight=0}},{key:"initialize",value:function(){this.subscribe("cell-layout",this.layoutCell.bind(this)),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-width",this.layout.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("table-layout",this.layout.bind(this)),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("columns-loading",this.reset.bind(this)),this.subscribe("column-add",this.reinitializeColumns.bind(this)),this.subscribe("column-delete",this.reinitializeColumns.bind(this)),this.subscribe("table-redraw",this.layout.bind(this)),this.subscribe("layout-refreshing",this.blockLayout.bind(this)),this.subscribe("layout-refreshed",this.unblockLayout.bind(this))}},{key:"blockLayout",value:function(){this.blocked=!0}},{key:"unblockLayout",value:function(){this.blocked=!1}},{key:"layoutCell",value:function(e){this.layoutElement(e.element,e.column)}},{key:"reinitializeColumns",value:function(){var e=this;this.reset(),this.table.columnManager.columnsByIndex.forEach((function(t){e.initializeColumn(t)}))}},{key:"initializeColumn",value:function(e){var t={margin:0,edge:!1};e.isGroup||(this.frozenCheck(e)?(t.position=this.initializationMode,"left"==this.initializationMode?this.leftColumns.push(e):this.rightColumns.unshift(e),this.active=!0,e.modules.frozen=t):this.initializationMode="right")}},{key:"frozenCheck",value:function(e){return e.parent.isGroup&&e.definition.frozen&&console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups"),e.parent.isGroup?this.frozenCheck(e.parent):e.definition.frozen}},{key:"scrollHorizontal",value:function(){this.active&&(this.calcMargins(!0),this.layoutColumnPosition(),this.layoutCalcRows(),this.reinitializeRows())}},{key:"calcMargins",value:function(e){e||(this.leftMargin=this._calcSpace(this.leftColumns,this.leftColumns.length)+"px",this.rightMargin=this._calcSpace(this.rightColumns,this.rightColumns.length)+"px",this.table.rowManager.tableElement.style.marginRight=this.rightMargin),this.rightPadding=this.table.rowManager.element.clientWidth+this.table.columnManager.scrollLeft}},{key:"layoutCalcRows",value:function(){this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&this.table.modules.columnCalcs.topRow&&this.layoutRow(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&this.table.modules.columnCalcs.botRow&&this.layoutRow(this.table.modules.columnCalcs.botRow),this.table.modExists("groupRows")&&this.layoutGroupCalcs(this.table.modules.groupRows.getGroups()))}},{key:"layoutGroupCalcs",value:function(e){var t=this;e.forEach((function(e){e.calcs.top&&t.layoutRow(e.calcs.top),e.calcs.bottom&&t.layoutRow(e.calcs.bottom),e.groupList&&e.groupList.length&&t.layoutGroupCalcs(e.groupList&&e.groupList)}))}},{key:"layoutColumnPosition",value:function(e){var t=this,i=[],n=0,o=0;this.table.columnManager.headersElement.style.marginLeft=this.leftMargin,this.table.columnManager.element.style.paddingRight=this.rightMargin,this.leftColumns.forEach((function(o,a){if(o.modules.frozen.marginValue=n+t.table.columnManager.scrollLeft,o.modules.frozen.margin=o.modules.frozen.marginValue+"px",o.visible&&(n+=o.getWidth()),a==t.leftColumns.length-1?o.modules.frozen.edge=!0:o.modules.frozen.edge=!1,o.parent.isGroup){var r=t.getColGroupParentElement(o);i.includes(r)||(t.layoutElement(r,o),i.push(r)),o.modules.frozen.edge&&r.classList.add("tabulator-frozen-"+o.modules.frozen.position)}else t.layoutElement(o.getElement(),o);e&&o.cells.forEach((function(e){t.layoutElement(e.getElement(!0),o)}))})),this.rightColumns.forEach((function(i,n){i.visible&&(o+=i.getWidth()),i.modules.frozen.marginValue=t.rightPadding-o,i.modules.frozen.margin=i.modules.frozen.marginValue+"px",n==t.rightColumns.length-1?i.modules.frozen.edge=!0:i.modules.frozen.edge=!1,i.parent.isGroup?t.layoutElement(t.getColGroupParentElement(i),i):t.layoutElement(i.getElement(),i),e&&i.cells.forEach((function(e){t.layoutElement(e.getElement(!0),i)}))}))}},{key:"getColGroupParentElement",value:function(e){return e.parent.isGroup?this.getColGroupParentElement(e.parent):e.getElement()}},{key:"layout",value:function(){this.active&&!this.blocked&&(this.calcMargins(),this.layoutColumnPosition(),this.reinitializeRows(),this.layoutCalcRows())}},{key:"reinitializeRows",value:function(){var e=this,t=this.table.rowManager.getVisibleRows();this.table.rowManager.getRows().filter((function(e){return!t.includes(e)})).forEach((function(e){e.deinitialize()})),t.forEach((function(t){"row"===t.type&&e.layoutRow(t)}))}},{key:"layoutRow",value:function(e){var t=this;e.getElement().style.paddingLeft=this.leftMargin,"fitDataFill"===this.table.options.layout&&this.rightColumns.length&&(this.table.rowManager.getTableElement().style.minWidth="calc(100% - "+this.rightMargin+")"),this.leftColumns.forEach((function(i){var n=e.getCell(i);n&&t.layoutElement(n.getElement(!0),i)})),this.rightColumns.forEach((function(i){var n=e.getCell(i);n&&t.layoutElement(n.getElement(!0),i)}))}},{key:"layoutElement",value:function(e,t){t.modules.frozen&&(e.style.position="absolute",e.style.left=t.modules.frozen.margin,e.classList.add("tabulator-frozen"),t.modules.frozen.edge&&e.classList.add("tabulator-frozen-"+t.modules.frozen.position))}},{key:"_calcSpace",value:function(e,t){for(var i=0,n=0;n-1}},{key:"isFrozen",value:function(){return!!this.rows.length}},{key:"visibleRows",value:function(e,t){return this.rows.forEach((function(e){t.push(e)})),t}},{key:"getRows",value:function(e){var t=e.slice(0);return this.rows.forEach((function(e){var i=t.indexOf(e);i>-1&&t.splice(i,1)})),t}},{key:"freezeRow",value:function(e){e.modules.frozen?console.warn("Freeze Error - Row is already frozen"):(e.modules.frozen=!0,this.topElement.appendChild(e.getElement()),e.initialize(),e.normalizeHeight(),this.table.rowManager.adjustTableSize(),this.rows.push(e),this.refreshData(!1,"display"),this.styleRows())}},{key:"unfreezeRow",value:function(e){this.rows.indexOf(e);e.modules.frozen?(e.modules.frozen=!1,this.detachRow(e),this.table.rowManager.adjustTableSize(),this.refreshData(!1,"display"),this.rows.length&&this.styleRows()):console.warn("Freeze Error - Row is already unfrozen")}},{key:"detachRow",value:function(e){var t=this.rows.indexOf(e);if(t>-1){var i=e.getElement();i.parentNode&&i.parentNode.removeChild(i),this.rows.splice(t,1)}}},{key:"styleRows",value:function(e){var t=this;this.rows.forEach((function(e,i){t.table.rowManager.styleRow(e,i)}))}}]),n}(V);Ee.moduleName="frozenRows";var Re=function(){function e(i){return t(this,e),this._group=i,this.type="GroupComponent",new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._group.groupManager.table.componentFunctionBinder.handle("row",e._group,t)}})}return o(e,[{key:"getKey",value:function(){return this._group.key}},{key:"getField",value:function(){return this._group.field}},{key:"getElement",value:function(){return this._group.element}},{key:"getRows",value:function(){return this._group.getRows(!0)}},{key:"getSubGroups",value:function(){return this._group.getSubGroups(!0)}},{key:"getParentGroup",value:function(){return!!this._group.parent&&this._group.parent.getComponent()}},{key:"isVisible",value:function(){return this._group.visible}},{key:"show",value:function(){this._group.show()}},{key:"hide",value:function(){this._group.hide()}},{key:"toggle",value:function(){this._group.toggleVisibility()}},{key:"_getSelf",value:function(){return this._group}},{key:"getTable",value:function(){return this._group.groupManager.table}}]),e}(),xe=function(){function e(i,n,o,a,r,s,l){t(this,e),this.groupManager=i,this.parent=n,this.key=a,this.level=o,this.field=r,this.hasSubGroups=o-1?i?this.rows.splice(o+1,0,e):this.rows.splice(o,0,e):i?this.rows.push(e):this.rows.unshift(e),e.modules.group=this,this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this),this.groupManager.updateGroupRows(!0)}},{key:"scrollHeader",value:function(e){this.arrowElement&&(this.arrowElement.style.marginLeft=e,this.groupList.forEach((function(t){t.scrollHeader(e)})))}},{key:"getRowIndex",value:function(e){}},{key:"conformRowData",value:function(e){return this.field?e[this.field]=this.key:console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"),this.parent&&(e=this.parent.conformRowData(e)),e}},{key:"removeRow",value:function(e){var t=this.rows.indexOf(e),i=e.getElement();t>-1&&this.rows.splice(t,1),this.groupManager.table.options.groupValues||this.rows.length?(i.parentNode&&i.parentNode.removeChild(i),this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this)):(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this),this.groupManager.updateGroupRows(!0))}},{key:"removeGroup",value:function(e){var t,i=e.level+"_"+e.key;this.groups[i]&&(delete this.groups[i],(t=this.groupList.indexOf(e))>-1&&this.groupList.splice(t,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))}},{key:"getHeadersAndRows",value:function(e){var t=[];return t.push(this),this._visSet(),this.visible?this.groupList.length?this.groupList.forEach((function(i){t=t.concat(i.getHeadersAndRows(e))})):(!e&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),t.push(this.calcs.top)),t=t.concat(this.rows),!e&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),t.push(this.calcs.bottom))):this.groupList.length||"table"==this.groupManager.table.options.columnCalcs||this.groupManager.table.modExists("columnCalcs")&&(!e&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),t.push(this.calcs.top))),!e&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),t.push(this.calcs.bottom)))),t}},{key:"getData",value:function(e,t){var i=[];return this._visSet(),(!e||e&&this.visible)&&this.rows.forEach((function(e){i.push(e.getData(t||"data"))})),i}},{key:"getRowCount",value:function(){var e=0;return this.groupList.length?this.groupList.forEach((function(t){e+=t.getRowCount()})):e=this.rows.length,e}},{key:"toggleVisibility",value:function(){this.visible?this.hide():this.show()}},{key:"hide",value:function(){this.visible=!1,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination?this.groupManager.updateGroupRows(!0):(this.element.classList.remove("tabulator-group-visible"),this.groupList.length?this.groupList.forEach((function(e){e.getHeadersAndRows().forEach((function(e){e.detachElement()}))})):this.rows.forEach((function(e){var t=e.getElement();t.parentNode.removeChild(t)})),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()),this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!1)}},{key:"show",value:function(){if(this.visible=!0,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination)this.groupManager.updateGroupRows(!0);else{this.element.classList.add("tabulator-group-visible");var e=this.generateElement();this.groupList.length?this.groupList.forEach((function(t){t.getHeadersAndRows().forEach((function(t){var i=t.getElement();e.parentNode.insertBefore(i,e.nextSibling),t.initialize(),e=i}))})):this.rows.forEach((function(t){var i=t.getElement();e.parentNode.insertBefore(i,e.nextSibling),t.initialize(),e=i})),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()}this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!0)}},{key:"_visSet",value:function(){var e=[];"function"==typeof this.visible&&(this.rows.forEach((function(t){e.push(t.getData())})),this.visible=this.visible(this.key,this.getRowCount(),e,this.getComponent()))}},{key:"getRowGroup",value:function(e){var t=!1;return this.groupList.length?this.groupList.forEach((function(i){var n=i.getRowGroup(e);n&&(t=n)})):this.rows.find((function(t){return t===e}))&&(t=this),t}},{key:"getSubGroups",value:function(e){var t=[];return this.groupList.forEach((function(i){t.push(e?i.getComponent():i)})),t}},{key:"getRows",value:function(e){var t=[];return this.rows.forEach((function(i){t.push(e?i.getComponent():i)})),t}},{key:"generateGroupHeaderContents",value:function(){var e=[];for(this.rows.forEach((function(t){e.push(t.getData())})),this.elementContents=this.generator(this.key,this.getRowCount(),e,this.getComponent());this.element.firstChild;)this.element.removeChild(this.element.firstChild);"string"==typeof this.elementContents?this.element.innerHTML=this.elementContents:this.element.appendChild(this.elementContents),this.element.insertBefore(this.arrowElement,this.element.firstChild)}},{key:"getPath",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.unshift(this.key),this.parent&&this.parent.getPath(e),e}},{key:"getElement",value:function(){return this.elementContents?this.element:this.generateElement()}},{key:"generateElement",value:function(){this.addBindings=!1,this._visSet(),this.visible?this.element.classList.add("tabulator-group-visible"):this.element.classList.remove("tabulator-group-visible");for(var e=0;en.length&&console.warn("Error creating group headers, groupHeader array is shorter than groupBy array"),this.headerGenerator=[function(){return""}],this.startOpen=[function(){return!1}],this.langBind("groups|item",(function(t,i){e.headerGenerator[0]=function(e,n,o){return(void 0===e?"":e)+"("+n+" "+(1===n?t:i.groups.items)+")"}})),this.groupIDLookups=[],Array.isArray(t)||t)this.table.modExists("columnCalcs")&&"table"!=this.table.options.columnCalcs&&"both"!=this.table.options.columnCalcs&&this.table.modules.columnCalcs.removeCalcs();else if(this.table.modExists("columnCalcs")&&"group"!=this.table.options.columnCalcs)this.table.columnManager.getRealColumns().forEach((function(t){t.definition.topCalc&&e.table.modules.columnCalcs.initializeTopRow(),t.definition.bottomCalc&&e.table.modules.columnCalcs.initializeBottomRow()}));Array.isArray(t)||(t=[t]),t.forEach((function(t,i){var n,o;n="function"==typeof t?t:(o=e.table.columnManager.getColumnByField(t))?function(e){return o.getFieldValue(e)}:function(e){return e[t]},e.groupIDLookups.push({field:"function"!=typeof t&&t,func:n,values:!!e.allowedValues&&e.allowedValues[i]})})),i&&(Array.isArray(i)||(i=[i]),i.forEach((function(e){})),this.startOpen=i),n&&(this.headerGenerator=Array.isArray(n)?n:[n])}}},{key:"rowSample",value:function(e,t){var i=this.getGroups(!1)[0];return t.push(i.getRows(!1)[0]),t}},{key:"virtualRenderFill",value:function(){var e=this.table.rowManager.tableElement,t=this.table.rowManager.getVisibleRows();t=t.filter((function(e){return"group"!==e.type})),e.style.minWidth=t.length?"":this.table.columnManager.getWidth()+"px"}},{key:"rowAddingIndex",value:function(e,t,i){this.assignRowToGroup(e);var n=e.modules.group.rows;return n.length>1&&(!t||t&&-1==n.indexOf(t)?i?n[0]!==e&&(t=n[0],this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)):n[n.length-1]!==e&&(t=n[n.length-1],this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)):this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)),t}},{key:"trackChanges",value:function(){this.dispatch("group-changed")}},{key:"setGroupBy",value:function(e){this.table.options.groupBy=e,this.initialized?this.configureGroupSetup():this.initialize(),this.refreshData(),this.trackChanges()}},{key:"setGroupValues",value:function(e){this.table.options.groupValues=e,this.configureGroupSetup(),this.refreshData(),this.trackChanges()}},{key:"setGroupStartOpen",value:function(e){this.table.options.groupStartOpen=e,this.configureGroupSetup(),this.table.options.groupBy?(this.refreshData(),this.trackChanges()):console.warn("Grouping Update - cant refresh view, no groups have been set")}},{key:"setGroupHeader",value:function(e){this.table.options.groupHeader=e,this.configureGroupSetup(),this.table.options.groupBy?(this.refreshData(),this.trackChanges()):console.warn("Grouping Update - cant refresh view, no groups have been set")}},{key:"userGetGroups",value:function(e){return this.getGroups(!0)}},{key:"userGetGroupedData",value:function(){return this.table.options.groupBy?this.getGroupedData():this.getData()}},{key:"rowGetGroup",value:function(e){return!!e.modules.group&&e.modules.group.getComponent()}},{key:"rowMoving",value:function(e,t,i){!i&&t instanceof xe&&(t=this.table.rowManager.prevDisplayRow(e)||t);var n=t instanceof xe?t:t.modules.group,o=e instanceof xe?e:e.modules.group;n===o?this.table.rowManager.moveRowInArray(n.rows,e,t,i):(o&&o.removeRow(e),n.insertRow(e,t,i))}},{key:"rowDeleting",value:function(e){e.modules.group&&e.modules.group.removeRow(e)}},{key:"rowsUpdated",value:function(e){this.updateGroupRows(!0)}},{key:"cellUpdated",value:function(e){this.reassignRowToGroup(e.row)}},{key:"setDisplayIndex",value:function(e){this.displayIndex=e}},{key:"getDisplayIndex",value:function(){return this.displayIndex}},{key:"getRows",value:function(e){return this.table.options.groupBy&&this.groupIDLookups.length?(this.dispatchExternal("dataGrouping"),this.generateGroups(e),this.subscribedExternal("dataGrouped")&&this.dispatchExternal("dataGrouped",this.getGroups(!0)),this.updateGroupRows()):e.slice(0)}},{key:"getGroups",value:function(e){var t=[];return this.groupList.forEach((function(i){t.push(e?i.getComponent():i)})),t}},{key:"getChildGroups",value:function(e){var t=this,i=[];return e||(e=this),e.groupList.forEach((function(e){e.groupList.length?i=i.concat(t.getChildGroups(e)):i.push(e)})),i}},{key:"wipe",value:function(){this.groupList.forEach((function(e){e.wipe()}))}},{key:"pullGroupListData",value:function(e){var t=this,i=[];return e.forEach((function(e){var n={level:0,rowCount:0,headerContent:""},o=[];e.hasSubGroups?(o=t.pullGroupListData(e.groupList),n.level=e.level,n.rowCount=o.length-e.groupList.length,n.headerContent=e.generator(e.key,n.rowCount,e.rows,e),i.push(n),i=i.concat(o)):(n.level=e.level,n.headerContent=e.generator(e.key,e.rows.length,e.rows,e),n.rowCount=e.getRows().length,i.push(n),e.getRows().forEach((function(e){i.push(e.getData("data"))})))})),i}},{key:"getGroupedData",value:function(){return this.pullGroupListData(this.groupList)}},{key:"getRowGroup",value:function(e){var t=!1;return this.options("dataTree")&&(e=this.table.modules.dataTree.getTreeParentRoot(e)),this.groupList.forEach((function(i){var n=i.getRowGroup(e);n&&(t=n)})),t}},{key:"countGroups",value:function(){return this.groupList.length}},{key:"generateGroups",value:function(e){var t=this,i=this.groups;this.groups={},this.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach((function(e){t.createGroup(e,0,i)})),e.forEach((function(e){t.assignRowToExistingGroup(e,i)}))):e.forEach((function(e){t.assignRowToGroup(e,i)}))}},{key:"createGroup",value:function(e,t,i){var n,o=t+"_"+e;i=i||[],n=new xe(this,!1,t,e,this.groupIDLookups[0].field,this.headerGenerator[0],i[o]),this.groups[o]=n,this.groupList.push(n)}},{key:"assignRowToExistingGroup",value:function(e,t){var i="0_"+this.groupIDLookups[0].func(e.getData());this.groups[i]&&this.groups[i].addRow(e)}},{key:"assignRowToGroup",value:function(e,t){var i=this.groupIDLookups[0].func(e.getData()),n=!this.groups["0_"+i];return n&&this.createGroup(i,0,t),this.groups["0_"+i].addRow(e),!n}},{key:"reassignRowToGroup",value:function(e){if("row"===e.type){var t=e.modules.group,i=t.getPath(),n=this.getExpectedPath(e);i.length==n.length&&i.every((function(e,t){return e===n[t]}))||(t.removeRow(e),this.assignRowToGroup(e,this.groups),this.refreshData(!0))}}},{key:"getExpectedPath",value:function(e){var t=[],i=e.getData();return this.groupIDLookups.forEach((function(e){t.push(e.func(i))})),t}},{key:"updateGroupRows",value:function(e){var t=[];return this.groupList.forEach((function(e){t=t.concat(e.getHeadersAndRows())})),e&&this.refreshData(!0,this.displayHandler),t}},{key:"scrollHeaders",value:function(e){"virtual"===this.table.options.renderHorizontal&&(e-=this.table.columnManager.renderer.vDomPadLeft),e+="px",this.groupList.forEach((function(t){t.scrollHeader(e)}))}},{key:"removeGroup",value:function(e){var t,i=e.level+"_"+e.key;this.groups[i]&&(delete this.groups[i],(t=this.groupList.indexOf(e))>-1&&this.groupList.splice(t,1))}}]),n}(V);Te.moduleName="groupRows";var Me=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).history=[],o.index=-1,o.registerTableOption("history",!1),o}return o(n,[{key:"initialize",value:function(){this.table.options.history&&(this.subscribe("cell-value-updated",this.cellUpdated.bind(this)),this.subscribe("cell-delete",this.clearComponentHistory.bind(this)),this.subscribe("row-delete",this.rowDeleted.bind(this)),this.subscribe("rows-wipe",this.clear.bind(this)),this.subscribe("row-added",this.rowAdded.bind(this)),this.subscribe("row-move",this.rowMoved.bind(this))),this.registerTableFunction("undo",this.undo.bind(this)),this.registerTableFunction("redo",this.redo.bind(this)),this.registerTableFunction("getHistoryUndoSize",this.getHistoryUndoSize.bind(this)),this.registerTableFunction("getHistoryRedoSize",this.getHistoryRedoSize.bind(this)),this.registerTableFunction("clearHistory",this.clear.bind(this))}},{key:"rowMoved",value:function(e,t,i){this.action("rowMove",e,{posFrom:this.table.rowManager.getRowPosition(e),posTo:this.table.rowManager.getRowPosition(t),to:t,after:i})}},{key:"rowAdded",value:function(e,t,i,n){this.action("rowAdd",e,{data:t,pos:i,index:n})}},{key:"rowDeleted",value:function(e){var t,i;this.table.options.groupBy?(t=(i=e.getComponent().getGroup().rows).indexOf(e))&&(t=i[t-1]):(t=e.table.rowManager.getRowIndex(e))&&(t=e.table.rowManager.rows[t-1]),this.action("rowDelete",e,{data:e.getData(),pos:!t,index:t})}},{key:"cellUpdated",value:function(e){this.action("cellEdit",e,{oldValue:e.oldValue,newValue:e.value})}},{key:"clear",value:function(){this.history=[],this.index=-1}},{key:"action",value:function(e,t,i){this.history=this.history.slice(0,this.index+1),this.history.push({type:e,component:t,data:i}),this.index++}},{key:"getHistoryUndoSize",value:function(){return this.index+1}},{key:"getHistoryRedoSize",value:function(){return this.history.length-(this.index+1)}},{key:"clearComponentHistory",value:function(e){var t=this.history.findIndex((function(t){return t.component===e}));t>-1&&(this.history.splice(t,1),t<=this.index&&this.index--,this.clearComponentHistory(e))}},{key:"undo",value:function(){if(this.index>-1){var e=this.history[this.index];return n.undoers[e.type].call(this,e),this.index--,this.dispatchExternal("historyUndo",e.type,e.component.getComponent(),e.data),!0}return console.warn("History Undo Error - No more history to undo"),!1}},{key:"redo",value:function(){if(this.history.length-1>this.index){this.index++;var e=this.history[this.index];return n.redoers[e.type].call(this,e),this.dispatchExternal("historyRedo",e.type,e.component.getComponent(),e.data),!0}return console.warn("History Redo Error - No more history to redo"),!1}},{key:"_rebindRow",value:function(e,t){this.history.forEach((function(i){if(i.component instanceof D)i.component===e&&(i.component=t);else if(i.component instanceof w&&i.component.row===e){var n=i.component.column.getField();n&&(i.component=t.getCell(n))}}))}}]),n}(V);Me.moduleName="history",Me.undoers={cellEdit:function(e){e.component.setValueProcessData(e.data.oldValue),e.component.cellRendered()},rowAdd:function(e){e.component.deleteActual()},rowDelete:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t)},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.rows[e.data.posFrom],!e.data.after),this.table.rowManager.redraw()}},Me.redoers={cellEdit:function(e){e.component.setValueProcessData(e.data.newValue),e.component.cellRendered()},rowAdd:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t)},rowDelete:function(e){e.component.deleteActual()},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.rows[e.data.posTo],e.data.after),this.table.rowManager.redraw()}};var Le=function(i){a(r,i);var n=c(r);function r(e){var i;return t(this,r),(i=n.call(this,e)).fieldIndex=[],i.hasIndex=!1,i}return o(r,[{key:"initialize",value:function(){this.tableElementCheck()}},{key:"tableElementCheck",value:function(){this.table.originalElement&&"TABLE"===this.table.originalElement.tagName&&(this.table.originalElement.childNodes.length?this.parseTable():console.warn("Unable to parse data from empty table tag, Tabulator should be initialized on a div tag unless importing data from a table element."))}},{key:"parseTable",value:function(){var e=this.table.originalElement,t=this.table.options,i=(t.columns,e.getElementsByTagName("th")),n=e.getElementsByTagName("tbody")[0],o=[];this.hasIndex=!1,this.dispatchExternal("htmlImporting"),n=n?n.getElementsByTagName("tr"):[],this._extractOptions(e,t),i.length?this._extractHeaders(i,n):this._generateBlankHeaders(i,n);for(var a=0;a-1&&e.pressedKeys.splice(n,1)}},this.table.element.addEventListener("keydown",this.keyupBinding),this.table.element.addEventListener("keyup",this.keydownBinding)}},{key:"clearBindings",value:function(){this.keyupBinding&&this.table.element.removeEventListener("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.removeEventListener("keyup",this.keydownBinding)}},{key:"checkBinding",value:function(e,t){var i=this,n=!0;return e.ctrlKey==t.ctrl&&e.shiftKey==t.shift&&e.metaKey==t.meta&&(t.keys.forEach((function(e){-1==i.pressedKeys.indexOf(e)&&(n=!1)})),n&&t.action.call(this,e),!0)}}]),r}(V);ze.moduleName="keybindings",ze.bindings={navPrev:"shift + 9",navNext:9,navUp:38,navDown:40,scrollPageUp:33,scrollPageDown:34,scrollToStart:36,scrollToEnd:35,undo:["ctrl + 90","meta + 90"],redo:["ctrl + 89","meta + 89"],copyToClipboard:["ctrl + 67","meta + 89"]},ze.actions={keyBlock:function(e){e.stopPropagation(),e.preventDefault()},scrollPageUp:function(e){var t=this.table.rowManager,i=t.scrollTop-t.element.clientHeight;t.element.scrollHeight;e.preventDefault(),t.displayRowsCount&&(i>=0?t.element.scrollTop=i:t.scrollToRow(t.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(e){var t=this.table.rowManager,i=t.scrollTop+t.element.clientHeight,n=t.element.scrollHeight;e.preventDefault(),t.displayRowsCount&&(i<=n?t.element.scrollTop=i:t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1])),this.table.element.focus()},scrollToStart:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[0]),this.table.element.focus()},scrollToEnd:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1]),this.table.element.focus()},navPrev:function(e){this.dispatch("keybinding-nav-prev",e)},navNext:function(e){this.dispatch("keybinding-nav-next",e)},navLeft:function(e){this.dispatch("keybinding-nav-left",e)},navRight:function(e){this.dispatch("keybinding-nav-right",e)},navUp:function(e){this.dispatch("keybinding-nav-up",e)},navDown:function(e){this.dispatch("keybinding-nav-down",e)},undo:function(e){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(e.preventDefault(),this.table.modules.history.undo()))},redo:function(e){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(e.preventDefault(),this.table.modules.history.redo()))},copyToClipboard:function(e){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}};var Fe=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).menuContainer=null,o.nestedMenuBlock=!1,o.currentComponent=null,o.rootPopup=null,o.columnSubscribers={},o.registerTableOption("menuContainer",void 0),o.registerTableOption("rowContextMenu",!1),o.registerTableOption("rowClickMenu",!1),o.registerTableOption("groupContextMenu",!1),o.registerTableOption("groupClickMenu",!1),o.registerColumnOption("headerContextMenu"),o.registerColumnOption("headerClickMenu"),o.registerColumnOption("headerMenu"),o.registerColumnOption("headerMenuIcon"),o.registerColumnOption("contextMenu"),o.registerColumnOption("clickMenu"),o}return o(n,[{key:"initialize",value:function(){this.deprecationCheck(),this.initializeRowWatchers(),this.initializeGroupWatchers(),this.subscribe("column-init",this.initializeColumn.bind(this))}},{key:"deprecationCheck",value:function(){void 0!==this.table.options.menuContainer&&(console.warn("Use of the menuContainer option is now deprecated. Please use the popupContainer option instead"),this.table.options.popupContainer=this.table.options.menuContainer)}},{key:"initializeRowWatchers",value:function(){this.table.options.rowContextMenu&&(this.subscribe("row-contextmenu",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu)),this.table.on("rowTapHold",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu))),this.table.options.rowClickMenu&&this.subscribe("row-click",this.loadMenuEvent.bind(this,this.table.options.rowClickMenu))}},{key:"initializeGroupWatchers",value:function(){this.table.options.groupContextMenu&&(this.subscribe("group-contextmenu",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu)),this.table.on("groupTapHold",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu))),this.table.options.groupClickMenu&&this.subscribe("group-click",this.loadMenuEvent.bind(this,this.table.options.groupClickMenu))}},{key:"initializeColumn",value:function(e){var t=e.definition;t.headerContextMenu&&!this.columnSubscribers.headerContextMenu&&(this.columnSubscribers.headerContextMenu=this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"),this.subscribe("column-contextmenu",this.columnSubscribers.headerContextMenu),this.table.on("headerTapHold",this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"))),t.headerClickMenu&&!this.columnSubscribers.headerClickMenu&&(this.columnSubscribers.headerClickMenu=this.loadMenuTableColumnEvent.bind(this,"headerClickMenu"),this.subscribe("column-click",this.columnSubscribers.headerClickMenu)),t.headerMenu&&this.initializeColumnHeaderMenu(e),t.contextMenu&&!this.columnSubscribers.contextMenu&&(this.columnSubscribers.contextMenu=this.loadMenuTableCellEvent.bind(this,"contextMenu"),this.subscribe("cell-contextmenu",this.columnSubscribers.contextMenu),this.table.on("cellTapHold",this.loadMenuTableCellEvent.bind(this,"contextMenu"))),t.clickMenu&&!this.columnSubscribers.clickMenu&&(this.columnSubscribers.clickMenu=this.loadMenuTableCellEvent.bind(this,"clickMenu"),this.subscribe("cell-click",this.columnSubscribers.clickMenu))}},{key:"initializeColumnHeaderMenu",value:function(e){var t,i=this,n=e.definition.headerMenuIcon;(t=document.createElement("span")).classList.add("tabulator-header-popup-button"),n?("function"==typeof n&&(n=n(e.getComponent())),n instanceof HTMLElement?t.appendChild(n):t.innerHTML=n):t.innerHTML="⋮",t.addEventListener("click",(function(t){t.stopPropagation(),t.preventDefault(),i.loadMenuEvent(e.definition.headerMenu,t,e)})),e.titleElement.insertBefore(t,e.titleElement.firstChild)}},{key:"loadMenuTableCellEvent",value:function(e,t,i){i._cell&&(i=i._cell),i.column.definition[e]&&this.loadMenuEvent(i.column.definition[e],t,i)}},{key:"loadMenuTableColumnEvent",value:function(e,t,i){i._column&&(i=i._column),i.definition[e]&&this.loadMenuEvent(i.definition[e],t,i)}},{key:"loadMenuEvent",value:function(e,t,i){i._group?i=i._group:i._row&&(i=i._row),e="function"==typeof e?e.call(this.table,t,i.getComponent()):e,this.loadMenu(t,i,e)}},{key:"loadMenu",value:function(e,t,i,n,o){var a,r=this,s=!(e instanceof MouseEvent),l=document.createElement("div");if(l.classList.add("tabulator-menu"),s||e.preventDefault(),i&&i.length){if(n)a=o.child(l);else{if(this.nestedMenuBlock){if(this.rootPopup)return}else this.nestedMenuBlock=setTimeout((function(){r.nestedMenuBlock=!1}),100);this.rootPopup&&this.rootPopup.hide(),this.rootPopup=a=this.popup(l)}i.forEach((function(e){var i=document.createElement("div"),n=e.label,o=e.disabled;e.separator?i.classList.add("tabulator-menu-separator"):(i.classList.add("tabulator-menu-item"),"function"==typeof n&&(n=n.call(r.table,t.getComponent())),n instanceof Node?i.appendChild(n):i.innerHTML=n,"function"==typeof o&&(o=o.call(r.table,t.getComponent())),o?(i.classList.add("tabulator-menu-item-disabled"),i.addEventListener("click",(function(e){e.stopPropagation()}))):e.menu&&e.menu.length?i.addEventListener("click",(function(n){n.stopPropagation(),r.loadMenu(n,t,e.menu,i,a)})):e.action&&i.addEventListener("click",(function(i){e.action(i,t.getComponent())})),e.menu&&e.menu.length&&i.classList.add("tabulator-menu-item-submenu")),l.appendChild(i)})),l.addEventListener("click",(function(e){r.rootPopup.hide()})),a.show(n||e),a===this.rootPopup&&(this.rootPopup.hideOnBlur((function(){r.rootPopup=null,r.currentComponent&&(r.dispatchExternal("menuClosed",r.currentComponent.getComponent()),r.currentComponent=null)})),this.currentComponent=t,this.dispatchExternal("menuOpened",t.getComponent()))}}}]),n}(V);Fe.moduleName="menu";var He=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).placeholderElement=o.createPlaceholderElement(),o.hoverElement=!1,o.checkTimeout=!1,o.checkPeriod=250,o.moving=!1,o.toCol=!1,o.toColAfter=!1,o.startX=0,o.autoScrollMargin=40,o.autoScrollStep=5,o.autoScrollTimeout=!1,o.touchMove=!1,o.moveHover=o.moveHover.bind(l(o)),o.endMove=o.endMove.bind(l(o)),o.registerTableOption("movableColumns",!1),o}return o(n,[{key:"createPlaceholderElement",value:function(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.classList.add("tabulator-col-placeholder"),e}},{key:"initialize",value:function(){this.table.options.movableColumns&&this.subscribe("column-init",this.initializeColumn.bind(this))}},{key:"initializeColumn",value:function(e){var t,i=this,n={};e.modules.frozen||e.isGroup||(t=e.getElement(),n.mousemove=function(n){e.parent===i.moving.parent&&((i.touchMove?n.touches[0].pageX:n.pageX)-k.elOffset(t).left+i.table.columnManager.element.scrollLeft>e.getWidth()/2?i.toCol===e&&i.toColAfter||(t.parentNode.insertBefore(i.placeholderElement,t.nextSibling),i.moveColumn(e,!0)):(i.toCol!==e||i.toColAfter)&&(t.parentNode.insertBefore(i.placeholderElement,t),i.moveColumn(e,!1)))}.bind(i),t.addEventListener("mousedown",(function(t){i.touchMove=!1,1===t.which&&(i.checkTimeout=setTimeout((function(){i.startMove(t,e)}),i.checkPeriod))})),t.addEventListener("mouseup",(function(e){1===e.which&&i.checkTimeout&&clearTimeout(i.checkTimeout)})),i.bindTouchEvents(e)),e.modules.moveColumn=n}},{key:"bindTouchEvents",value:function(e){var t,i,n,o,a,r,s=this,l=e.getElement(),u=!1;l.addEventListener("touchstart",(function(l){s.checkTimeout=setTimeout((function(){s.touchMove=!0,t=e.nextColumn(),n=t?t.getWidth()/2:0,i=e.prevColumn(),o=i?i.getWidth()/2:0,a=0,r=0,u=!1,s.startMove(l,e)}),s.checkPeriod)}),{passive:!0}),l.addEventListener("touchmove",(function(l){var c,h;s.moving&&(s.moveHover(l),u||(u=l.touches[0].pageX),(c=l.touches[0].pageX-u)>0?t&&c-a>n&&(h=t)!==e&&(u=l.touches[0].pageX,h.getElement().parentNode.insertBefore(s.placeholderElement,h.getElement().nextSibling),s.moveColumn(h,!0)):i&&-c-r>o&&(h=i)!==e&&(u=l.touches[0].pageX,h.getElement().parentNode.insertBefore(s.placeholderElement,h.getElement()),s.moveColumn(h,!1)),h&&(t=h.nextColumn(),a=n,n=t?t.getWidth()/2:0,i=h.prevColumn(),r=o,o=i?i.getWidth()/2:0))}),{passive:!0}),l.addEventListener("touchend",(function(e){s.checkTimeout&&clearTimeout(s.checkTimeout),s.moving&&s.endMove(e)}))}},{key:"startMove",value:function(e,t){var i=t.getElement(),n=this.table.columnManager.getElement(),o=this.table.columnManager.getHeadersElement();this.moving=t,this.startX=(this.touchMove?e.touches[0].pageX:e.pageX)-k.elOffset(i).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",i.parentNode.insertBefore(this.placeholderElement,i),i.parentNode.removeChild(i),this.hoverElement=i.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.table.columnManager.getElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.bottom=n.clientHeight-o.offsetHeight+"px",this.touchMove||(this._bindMouseMove(),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove)),this.moveHover(e)}},{key:"_bindMouseMove",value:function(){this.table.columnManager.columnsByIndex.forEach((function(e){e.modules.moveColumn.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveColumn.mousemove)}))}},{key:"_unbindMouseMove",value:function(){this.table.columnManager.columnsByIndex.forEach((function(e){e.modules.moveColumn.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveColumn.mousemove)}))}},{key:"moveColumn",value:function(e,t){var i=this.moving.getCells();this.toCol=e,this.toColAfter=t,t?e.getCells().forEach((function(e,t){var n=e.getElement(!0);n.parentNode&&i[t]&&n.parentNode.insertBefore(i[t].getElement(),n.nextSibling)})):e.getCells().forEach((function(e,t){var n=e.getElement(!0);n.parentNode&&i[t]&&n.parentNode.insertBefore(i[t].getElement(),n)}))}},{key:"endMove",value:function(e){(1===e.which||this.touchMove)&&(this._unbindMouseMove(),this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toCol&&this.table.columnManager.moveColumnActual(this.moving,this.toCol,this.toColAfter),this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.touchMove||(document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove)))}},{key:"moveHover",value:function(e){var t,i=this,n=this.table.columnManager.getElement(),o=n.scrollLeft,a=(this.touchMove?e.touches[0].pageX:e.pageX)-k.elOffset(n).left+o;this.hoverElement.style.left=a-this.startX+"px",a-oe.getHeight()/2?t.toRow===e&&t.toRowAfter||((n=e.getElement()).parentNode.insertBefore(t.placeholderElement,n.nextSibling),t.moveRow(e,!0)):(t.toRow!==e||t.toRowAfter)&&(n=e.getElement()).previousSibling&&(n.parentNode.insertBefore(t.placeholderElement,n),t.moveRow(e,!1))}.bind(t),e.modules.moveRow=i}},{key:"initializeRow",value:function(e){var t,i=this,n={};n.mouseup=function(t){i.tableRowDrop(t,e)}.bind(i),n.mousemove=function(t){var n=e.getElement();t.pageY-k.elOffset(n).top+i.table.rowManager.element.scrollTop>e.getHeight()/2?i.toRow===e&&i.toRowAfter||(n.parentNode.insertBefore(i.placeholderElement,n.nextSibling),i.moveRow(e,!0)):(i.toRow!==e||i.toRowAfter)&&(n.parentNode.insertBefore(i.placeholderElement,n),i.moveRow(e,!1))}.bind(i),this.hasHandle||((t=e.getElement()).addEventListener("mousedown",(function(t){1===t.which&&(i.checkTimeout=setTimeout((function(){i.startMove(t,e)}),i.checkPeriod))})),t.addEventListener("mouseup",(function(e){1===e.which&&i.checkTimeout&&clearTimeout(i.checkTimeout)})),this.bindTouchEvents(e,e.getElement())),e.modules.moveRow=n}},{key:"initializeColumn",value:function(e){e.definition.rowHandle&&!1!==this.table.options.movableRows&&(this.hasHandle=!0)}},{key:"initializeCell",value:function(e){if(e.column.definition.rowHandle&&!1!==this.table.options.movableRows){var t=this,i=e.getElement(!0);i.addEventListener("mousedown",(function(i){1===i.which&&(t.checkTimeout=setTimeout((function(){t.startMove(i,e.row)}),t.checkPeriod))})),i.addEventListener("mouseup",(function(e){1===e.which&&t.checkTimeout&&clearTimeout(t.checkTimeout)})),this.bindTouchEvents(e.row,i)}}},{key:"bindTouchEvents",value:function(e,t){var i,n,o,a,r,s,l=this,u=!1;t.addEventListener("touchstart",(function(t){l.checkTimeout=setTimeout((function(){l.touchMove=!0,i=e.nextRow(),o=i?i.getHeight()/2:0,n=e.prevRow(),a=n?n.getHeight()/2:0,r=0,s=0,u=!1,l.startMove(t,e)}),l.checkPeriod)}),{passive:!0}),this.moving,this.toRow,this.toRowAfter,t.addEventListener("touchmove",(function(t){var c,h;l.moving&&(t.preventDefault(),l.moveHover(t),u||(u=t.touches[0].pageY),(c=t.touches[0].pageY-u)>0?i&&c-r>o&&(h=i)!==e&&(u=t.touches[0].pageY,h.getElement().parentNode.insertBefore(l.placeholderElement,h.getElement().nextSibling),l.moveRow(h,!0)):n&&-c-s>a&&(h=n)!==e&&(u=t.touches[0].pageY,h.getElement().parentNode.insertBefore(l.placeholderElement,h.getElement()),l.moveRow(h,!1)),h&&(i=h.nextRow(),r=o,o=i?i.getHeight()/2:0,n=h.prevRow(),s=a,a=n?n.getHeight()/2:0))})),t.addEventListener("touchend",(function(e){l.checkTimeout&&clearTimeout(l.checkTimeout),l.moving&&(l.endMove(e),l.touchMove=!1)}))}},{key:"_bindMouseMove",value:function(){this.table.rowManager.getDisplayRows().forEach((function(e){("row"===e.type||"group"===e.type)&&e.modules.moveRow&&e.modules.moveRow.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveRow.mousemove)}))}},{key:"_unbindMouseMove",value:function(){this.table.rowManager.getDisplayRows().forEach((function(e){("row"===e.type||"group"===e.type)&&e.modules.moveRow&&e.modules.moveRow.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveRow.mousemove)}))}},{key:"startMove",value:function(e,t){var i=t.getElement();this.setStartPosition(e,t),this.moving=t,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",this.connection?(this.table.element.classList.add("tabulator-movingrow-sending"),this.connectToTables(t)):(i.parentNode.insertBefore(this.placeholderElement,i),i.parentNode.removeChild(i)),this.hoverElement=i.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.connection?(document.body.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this.hoverElement.style.width=this.table.element.clientWidth+"px",this.hoverElement.style.whiteSpace="nowrap",this.hoverElement.style.overflow="hidden",this.hoverElement.style.pointerEvents="none"):(this.table.rowManager.getTableElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this._bindMouseMove()),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove),this.dispatchExternal("rowMoving",t.getComponent()),this.moveHover(e)}},{key:"setStartPosition",value:function(e,t){var i,n,o=this.touchMove?e.touches[0].pageX:e.pageX,a=this.touchMove?e.touches[0].pageY:e.pageY;i=t.getElement(),this.connection?(n=i.getBoundingClientRect(),this.startX=n.left-o+window.pageXOffset,this.startY=n.top-a+window.pageYOffset):this.startY=a-i.getBoundingClientRect().top}},{key:"endMove",value:function(e){e&&1!==e.which&&!this.touchMove||(this._unbindMouseMove(),this.connection||(this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement)),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toRow?this.table.rowManager.moveRow(this.moving,this.toRow,this.toRowAfter):this.dispatchExternal("rowMoveCancelled",this.moving.getComponent()),this.moving=!1,this.toRow=!1,this.toRowAfter=!1,document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove),this.connection&&(this.table.element.classList.remove("tabulator-movingrow-sending"),this.disconnectFromTables()))}},{key:"moveRow",value:function(e,t){this.toRow=e,this.toRowAfter=t}},{key:"moveHover",value:function(e){this.connection?this.moveHoverConnections.call(this,e):this.moveHoverTable.call(this,e)}},{key:"moveHoverTable",value:function(e){var t=this.table.rowManager.getElement(),i=t.scrollTop,n=(this.touchMove?e.touches[0].pageY:e.pageY)-t.getBoundingClientRect().top+i;this.hoverElement.style.top=n-this.startY+"px"}},{key:"moveHoverConnections",value:function(e){this.hoverElement.style.left=this.startX+(this.touchMove?e.touches[0].pageX:e.pageX)+"px",this.hoverElement.style.top=this.startY+(this.touchMove?e.touches[0].pageY:e.pageY)+"px"}},{key:"elementRowDrop",value:function(e,t,i){this.dispatchExternal("movableRowsElementDrop",e,t,!!i&&i.getComponent())}},{key:"connectToTables",value:function(e){var t,i=this;this.connectionSelectorsTables&&(t=this.commsConnections(this.connectionSelectorsTables),this.dispatchExternal("movableRowsSendingStart",t),this.commsSend(this.connectionSelectorsTables,"moveRow","connect",{row:e})),this.connectionSelectorsElements&&(this.connectionElements=[],Array.isArray(this.connectionSelectorsElements)||(this.connectionSelectorsElements=[this.connectionSelectorsElements]),this.connectionSelectorsElements.forEach((function(e){"string"==typeof e?i.connectionElements=i.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(e))):i.connectionElements.push(e)})),this.connectionElements.forEach((function(e){var t=function(t){i.elementRowDrop(t,e,i.moving)};e.addEventListener("mouseup",t),e.tabulatorElementDropEvent=t,e.classList.add("tabulator-movingrow-receiving")})))}},{key:"disconnectFromTables",value:function(){var e;this.connectionSelectorsTables&&(e=this.commsConnections(this.connectionSelectorsTables),this.dispatchExternal("movableRowsSendingStop",e),this.commsSend(this.connectionSelectorsTables,"moveRow","disconnect")),this.connectionElements.forEach((function(e){e.classList.remove("tabulator-movingrow-receiving"),e.removeEventListener("mouseup",e.tabulatorElementDropEvent),delete e.tabulatorElementDropEvent}))}},{key:"connect",value:function(e,t){return this.connectedTable?(console.warn("Move Row Error - Table cannot accept connection, already connected to table:",this.connectedTable),!1):(this.connectedTable=e,this.connectedRow=t,this.table.element.classList.add("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach((function(e){"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().addEventListener("mouseup",e.modules.moveRow.mouseup)})),this.tableRowDropEvent=this.tableRowDrop.bind(this),this.table.element.addEventListener("mouseup",this.tableRowDropEvent),this.dispatchExternal("movableRowsReceivingStart",t,e),!0)}},{key:"disconnect",value:function(e){e===this.connectedTable?(this.connectedTable=!1,this.connectedRow=!1,this.table.element.classList.remove("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach((function(e){"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().removeEventListener("mouseup",e.modules.moveRow.mouseup)})),this.table.element.removeEventListener("mouseup",this.tableRowDropEvent),this.dispatchExternal("movableRowsReceivingStop",e)):console.warn("Move Row Error - trying to disconnect from non connected table")}},{key:"dropComplete",value:function(t,i,n){var o=!1;if(n){switch(e(this.table.options.movableRowsSender)){case"string":o=this.senders[this.table.options.movableRowsSender];break;case"function":o=this.table.options.movableRowsSender}o?o.call(this,this.moving.getComponent(),i?i.getComponent():void 0,t):this.table.options.movableRowsSender&&console.warn("Mover Row Error - no matching sender found:",this.table.options.movableRowsSender),this.dispatchExternal("movableRowsSent",this.moving.getComponent(),i?i.getComponent():void 0,t)}else this.dispatchExternal("movableRowsSentFailed",this.moving.getComponent(),i?i.getComponent():void 0,t);this.endMove()}},{key:"tableRowDrop",value:function(t,i){var n=!1,o=!1;switch(t.stopImmediatePropagation(),e(this.table.options.movableRowsReceiver)){case"string":n=this.receivers[this.table.options.movableRowsReceiver];break;case"function":n=this.table.options.movableRowsReceiver}n?o=n.call(this,this.connectedRow.getComponent(),i?i.getComponent():void 0,this.connectedTable):console.warn("Mover Row Error - no matching receiver found:",this.table.options.movableRowsReceiver),o?this.dispatchExternal("movableRowsReceived",this.connectedRow.getComponent(),i?i.getComponent():void 0,this.connectedTable):this.dispatchExternal("movableRowsReceivedFailed",this.connectedRow.getComponent(),i?i.getComponent():void 0,this.connectedTable),this.commsSend(this.connectedTable,"moveRow","dropcomplete",{row:i,success:o})}},{key:"commsReceived",value:function(e,t,i){switch(t){case"connect":return this.connect(e,i.row);case"disconnect":return this.disconnect(e);case"dropcomplete":return this.dropComplete(e,i.row,i.success)}}}]),r}(V);_e.prototype.receivers={insert:function(e,t,i){return this.table.addRow(e.getData(),void 0,t),!0},add:function(e,t,i){return this.table.addRow(e.getData()),!0},update:function(e,t,i){return!!t&&(t.update(e.getData()),!0)},replace:function(e,t,i){return!!t&&(this.table.addRow(e.getData(),void 0,t),t.delete(),!0)}},_e.prototype.senders={delete:function(e,t,i){e.delete()}},_e.moduleName="moveRow";var Oe=function(i){a(r,i);var n=c(r);function r(e){var i;return t(this,r),(i=n.call(this,e)).allowedTypes=["","data","edit","clipboard"],i.enabled=!0,i.registerColumnOption("mutator"),i.registerColumnOption("mutatorParams"),i.registerColumnOption("mutatorData"),i.registerColumnOption("mutatorDataParams"),i.registerColumnOption("mutatorEdit"),i.registerColumnOption("mutatorEditParams"),i.registerColumnOption("mutatorClipboard"),i.registerColumnOption("mutatorClipboardParams"),i.registerColumnOption("mutateLink"),i}return o(r,[{key:"initialize",value:function(){this.subscribe("cell-value-changing",this.transformCell.bind(this)),this.subscribe("cell-value-changed",this.mutateLink.bind(this)),this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-init-before",this.rowDataChanged.bind(this)),this.subscribe("row-data-changing",this.rowDataChanged.bind(this))}},{key:"rowDataChanged",value:function(e,t,i){return this.transformRow(t,"data",i)}},{key:"initializeColumn",value:function(e){var t=this,i=!1,n={};this.allowedTypes.forEach((function(o){var a,r="mutator"+(o.charAt(0).toUpperCase()+o.slice(1));e.definition[r]&&(a=t.lookupMutator(e.definition[r]))&&(i=!0,n[r]={mutator:a,params:e.definition[r+"Params"]||{}})})),i&&(e.modules.mutate=n)}},{key:"lookupMutator",value:function(t){var i=!1;switch(e(t)){case"string":r.mutators[t]?i=r.mutators[t]:console.warn("Mutator Error - No such mutator found, ignoring: ",t);break;case"function":i=t}return i}},{key:"transformRow",value:function(e,t,i){var n,o="mutator"+(t.charAt(0).toUpperCase()+t.slice(1));return this.enabled&&this.table.columnManager.traverse((function(a){var r,s,l;a.modules.mutate&&(r=a.modules.mutate[o]||a.modules.mutate.mutator||!1)&&(n=a.getFieldValue(void 0!==i?i:e),"data"!=t&&void 0===n||(l=a.getComponent(),s="function"==typeof r.params?r.params(n,e,t,l):r.params,a.setFieldValue(e,r.mutator(n,e,t,s,l))))})),e}},{key:"transformCell",value:function(e,t){if(e.column.modules.mutate){var i=e.column.modules.mutate.mutatorEdit||e.column.modules.mutate.mutator||!1,n={};if(i)return n=Object.assign(n,e.row.getData()),e.column.setFieldValue(n,t),i.mutator(t,n,"edit",i.params,e.getComponent())}return t}},{key:"mutateLink",value:function(e){var t=e.column.definition.mutateLink;t&&(Array.isArray(t)||(t=[t]),t.forEach((function(t){var i=e.row.getCell(t);i&&i.setValue(i.getValue(),!0,!0)})))}},{key:"enable",value:function(){this.enabled=!0}},{key:"disable",value:function(){this.enabled=!1}}]),r}(V);Oe.moduleName="mutator",Oe.mutators={};var Ae={rows:function(e,t,i,n,o){var a=document.createElement("span"),r=document.createElement("span"),s=document.createElement("span"),l=document.createElement("span"),u=document.createElement("span"),c=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",(function(e){r.innerHTML=e})),this.table.modules.localize.langBind("pagination|counter|of",(function(e){l.innerHTML=e})),this.table.modules.localize.langBind("pagination|counter|rows",(function(e){c.innerHTML=e})),n?(s.innerHTML=" "+t+"-"+Math.min(t+e-1,n)+" ",u.innerHTML=" "+n+" ",a.appendChild(r),a.appendChild(s),a.appendChild(l),a.appendChild(u),a.appendChild(c)):(s.innerHTML=" 0 ",a.appendChild(r),a.appendChild(s),a.appendChild(c)),a},pages:function(e,t,i,n,o){var a=document.createElement("span"),r=document.createElement("span"),s=document.createElement("span"),l=document.createElement("span"),u=document.createElement("span"),c=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",(function(e){r.innerHTML=e})),s.innerHTML=" "+i+" ",this.table.modules.localize.langBind("pagination|counter|of",(function(e){l.innerHTML=e})),u.innerHTML=" "+o+" ",this.table.modules.localize.langBind("pagination|counter|pages",(function(e){c.innerHTML=e})),a.appendChild(r),a.appendChild(s),a.appendChild(l),a.appendChild(u),a.appendChild(c),a}},Be=function(i){a(r,i);var n=c(r);function r(e){var i;return t(this,r),(i=n.call(this,e)).mode="local",i.progressiveLoad=!1,i.element=null,i.pageCounterElement=null,i.pageCounter=null,i.size=0,i.page=1,i.count=5,i.max=1,i.remoteRowCountEstimate=null,i.displayIndex=0,i.initialLoad=!0,i.dataChanging=!1,i.pageSizes=[],i.registerTableOption("pagination",!1),i.registerTableOption("paginationMode","local"),i.registerTableOption("paginationSize",!1),i.registerTableOption("paginationInitialPage",1),i.registerTableOption("paginationCounter",!1),i.registerTableOption("paginationCounterElement",!1),i.registerTableOption("paginationButtonCount",5),i.registerTableOption("paginationSizeSelector",!1),i.registerTableOption("paginationElement",!1),i.registerTableOption("paginationAddRow","page"),i.registerTableOption("progressiveLoad",!1),i.registerTableOption("progressiveLoadDelay",0),i.registerTableOption("progressiveLoadScrollMargin",0),i.registerTableFunction("setMaxPage",i.setMaxPage.bind(l(i))),i.registerTableFunction("setPage",i.setPage.bind(l(i))),i.registerTableFunction("setPageToRow",i.userSetPageToRow.bind(l(i))),i.registerTableFunction("setPageSize",i.userSetPageSize.bind(l(i))),i.registerTableFunction("getPageSize",i.getPageSize.bind(l(i))),i.registerTableFunction("previousPage",i.previousPage.bind(l(i))),i.registerTableFunction("nextPage",i.nextPage.bind(l(i))),i.registerTableFunction("getPage",i.getPage.bind(l(i))),i.registerTableFunction("getPageMax",i.getPageMax.bind(l(i))),i.registerComponentFunction("row","pageTo",i.setPageToRow.bind(l(i))),i}return o(r,[{key:"initialize",value:function(){this.table.options.pagination?(this.subscribe("row-deleted",this.rowsUpdated.bind(this)),this.subscribe("row-added",this.rowsUpdated.bind(this)),this.subscribe("data-processed",this.initialLoadComplete.bind(this)),this.subscribe("table-built",this.calculatePageSizes.bind(this)),this.subscribe("footer-redraw",this.footerRedraw.bind(this)),"page"==this.table.options.paginationAddRow&&this.subscribe("row-adding-position",this.rowAddingPosition.bind(this)),"remote"===this.table.options.paginationMode&&(this.subscribe("data-params",this.remotePageParams.bind(this)),this.subscribe("data-loaded",this._parseRemoteData.bind(this))),this.table.options.progressiveLoad&&console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time"),this.registerDisplayHandler(this.restOnRenderBefore.bind(this),40),this.registerDisplayHandler(this.getRows.bind(this),50),this.createElements(),this.initializePageCounter(),this.initializePaginator()):this.table.options.progressiveLoad&&(this.subscribe("data-params",this.remotePageParams.bind(this)),this.subscribe("data-loaded",this._parseRemoteData.bind(this)),this.subscribe("table-built",this.calculatePageSizes.bind(this)),this.subscribe("data-processed",this.initialLoadComplete.bind(this)),this.initializeProgressive(this.table.options.progressiveLoad),"scroll"===this.table.options.progressiveLoad&&this.subscribe("scroll-vertical",this.scrollVertical.bind(this)))}},{key:"rowAddingPosition",value:function(e,t){var i,n=this.table.rowManager,o=n.getDisplayRows();return t?o.length?i=o[0]:n.activeRows.length&&(i=n.activeRows[n.activeRows.length-1],t=!1):o.length&&(i=o[o.length-1],t=!(o.lengththis.max&&(this.page=this.max)}},{key:"reset",value:function(e){this.initialLoad||("local"==this.mode||e)&&(this.page=1)}},{key:"setMaxPage",value:function(e){e=parseInt(e),this.max=e||1,this.page>this.max&&(this.page=this.max,this.trigger())}},{key:"setPage",value:function(e){switch(e){case"first":return this.setPage(1);case"prev":return this.previousPage();case"next":return this.nextPage();case"last":return this.setPage(this.max)}return(e=parseInt(e))>0&&e<=this.max||"local"!==this.mode?(this.page=e,this.trackChanges(),this.trigger()):(console.warn("Pagination Error - Requested page is out of range of 1 - "+this.max+":",e),Promise.reject())}},{key:"setPageToRow",value:function(e){var t=this.table.rowManager.getDisplayRows(this.displayIndex-1).indexOf(e);if(t>-1){var i=!0===this.size?1:Math.ceil((t+1)/this.size);return this.setPage(i)}return console.warn("Pagination Error - Requested row is not visible"),Promise.reject()}},{key:"setPageSize",value:function(e){!0!==e&&(e=parseInt(e)),e>0&&(this.size=e,this.dispatchExternal("pageSizeChanged",e)),this.pageSizeSelect&&this.generatePageSizeSelectList(),this.trackChanges()}},{key:"_setPageCounter",value:function(t,i,n){var o;if(this.pageCounter)switch("remote"===this.mode&&(i=this.size,n=(this.page-1)*this.size+1,t=this.remoteRowCountEstimate),e(o=this.pageCounter.call(this,i,n,this.page,t,this.max))){case"object":if(o instanceof Node){for(;this.pageCounterElement.firstChild;)this.pageCounterElement.removeChild(this.pageCounterElement.firstChild);this.pageCounterElement.appendChild(o)}else this.pageCounterElement.innerHTML="",null!=o&&console.warn("Page Counter Error - Page Counter has returned a type of object, the only valid page counter object return is an instance of Node, the page counter returned:",o);break;case"undefined":this.pageCounterElement.innerHTML="";break;default:this.pageCounterElement.innerHTML=o}}},{key:"_setPageButtons",value:function(){for(var e=Math.floor((this.count-1)/2),t=Math.ceil((this.count-1)/2),i=this.max-this.page+e+10&&o<=this.max&&this.pagesElement.appendChild(this._generatePageButton(o));this.footerRedraw()}},{key:"_generatePageButton",value:function(e){var t=this,i=document.createElement("button");return i.classList.add("tabulator-page"),e==this.page&&i.classList.add("active"),i.setAttribute("type","button"),i.setAttribute("role","button"),this.langBind("pagination|page_title",(function(t){i.setAttribute("aria-label",t+" "+e),i.setAttribute("title",t+" "+e)})),i.setAttribute("data-page",e),i.textContent=e,i.addEventListener("click",(function(i){t.setPage(e)})),i}},{key:"previousPage",value:function(){return this.page>1?(this.page--,this.trackChanges(),this.trigger()):(console.warn("Pagination Error - Previous page would be less than page 1:",0),Promise.reject())}},{key:"nextPage",value:function(){return this.page-1&&(o=o.slice(r),(i=o.indexOf(";"))>-1&&(o=o.slice(0,i)),n=o.replace(a+"=","")),!!n&&JSON.parse(n)}},Ne={local:function(e,t,i){localStorage.setItem(e+"-"+t,JSON.stringify(i))},cookie:function(e,t,i){var n=new Date;n.setDate(n.getDate()+1e4),document.cookie=e+"-"+t+"="+JSON.stringify(i)+"; expires="+n.toUTCString()}},Ve=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).mode="",o.id="",o.defWatcherBlock=!1,o.config={},o.readFunc=!1,o.writeFunc=!1,o.registerTableOption("persistence",!1),o.registerTableOption("persistenceID",""),o.registerTableOption("persistenceMode",!0),o.registerTableOption("persistenceReaderFunc",!1),o.registerTableOption("persistenceWriterFunc",!1),o}return o(n,[{key:"localStorageTest",value:function(){var e="_tabulator_test";try{return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}}},{key:"initialize",value:function(){if(this.table.options.persistence){var e,t=this.table.options.persistenceMode,i=this.table.options.persistenceID;this.mode=!0!==t?t:this.localStorageTest()?"local":"cookie",this.table.options.persistenceReaderFunc?"function"==typeof this.table.options.persistenceReaderFunc?this.readFunc=this.table.options.persistenceReaderFunc:n.readers[this.table.options.persistenceReaderFunc]?this.readFunc=n.readers[this.table.options.persistenceReaderFunc]:console.warn("Persistence Read Error - invalid reader set",this.table.options.persistenceReaderFunc):n.readers[this.mode]?this.readFunc=n.readers[this.mode]:console.warn("Persistence Read Error - invalid reader set",this.mode),this.table.options.persistenceWriterFunc?"function"==typeof this.table.options.persistenceWriterFunc?this.writeFunc=this.table.options.persistenceWriterFunc:n.writers[this.table.options.persistenceWriterFunc]?this.writeFunc=n.writers[this.table.options.persistenceWriterFunc]:console.warn("Persistence Write Error - invalid reader set",this.table.options.persistenceWriterFunc):n.writers[this.mode]?this.writeFunc=n.writers[this.mode]:console.warn("Persistence Write Error - invalid writer set",this.mode),this.id="tabulator-"+(i||this.table.element.getAttribute("id")||""),this.config={sort:!0===this.table.options.persistence||this.table.options.persistence.sort,filter:!0===this.table.options.persistence||this.table.options.persistence.filter,group:!0===this.table.options.persistence||this.table.options.persistence.group,page:!0===this.table.options.persistence||this.table.options.persistence.page,columns:!0===this.table.options.persistence?["title","width","visible"]:this.table.options.persistence.columns},this.config.page&&(e=this.retreiveData("page"))&&(void 0===e.paginationSize||!0!==this.config.page&&!this.config.page.size||(this.table.options.paginationSize=e.paginationSize),void 0===e.paginationInitialPage||!0!==this.config.page&&!this.config.page.page||(this.table.options.paginationInitialPage=e.paginationInitialPage)),this.config.group&&(e=this.retreiveData("group"))&&(void 0===e.groupBy||!0!==this.config.group&&!this.config.group.groupBy||(this.table.options.groupBy=e.groupBy),void 0===e.groupStartOpen||!0!==this.config.group&&!this.config.group.groupStartOpen||(this.table.options.groupStartOpen=e.groupStartOpen),void 0===e.groupHeader||!0!==this.config.group&&!this.config.group.groupHeader||(this.table.options.groupHeader=e.groupHeader)),this.config.columns&&(this.table.options.columns=this.load("columns",this.table.options.columns),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-show",this.save.bind(this,"columns")),this.subscribe("column-hide",this.save.bind(this,"columns")),this.subscribe("column-moved",this.save.bind(this,"columns"))),this.subscribe("table-built",this.tableBuilt.bind(this),0),this.subscribe("table-redraw",this.tableRedraw.bind(this)),this.subscribe("filter-changed",this.eventSave.bind(this,"filter")),this.subscribe("sort-changed",this.eventSave.bind(this,"sort")),this.subscribe("group-changed",this.eventSave.bind(this,"group")),this.subscribe("page-changed",this.eventSave.bind(this,"page")),this.subscribe("column-resized",this.eventSave.bind(this,"columns")),this.subscribe("layout-refreshed",this.eventSave.bind(this,"columns"))}this.registerTableFunction("getColumnLayout",this.getColumnLayout.bind(this)),this.registerTableFunction("setColumnLayout",this.setColumnLayout.bind(this))}},{key:"eventSave",value:function(e){this.config[e]&&this.save(e)}},{key:"tableBuilt",value:function(){var e,t;this.table.options;this.config.sort&&!1==!(e=this.load("sort"))&&(this.table.options.initialSort=e),this.config.filter&&!1==!(t=this.load("filter"))&&(this.table.options.initialFilter=t)}},{key:"tableRedraw",value:function(e){e&&this.config.columns&&this.save("columns")}},{key:"getColumnLayout",value:function(){return this.parseColumns(this.table.columnManager.getColumns())}},{key:"setColumnLayout",value:function(e){return this.table.columnManager.setColumns(this.mergeDefinition(this.table.options.columns,e)),!0}},{key:"initializeColumn",value:function(e){var t;this.config.columns&&(this.defWatcherBlock=!0,t=e.getDefinition(),(!0===this.config.columns?Object.keys(t):this.config.columns).forEach((function(e){var i=Object.getOwnPropertyDescriptor(t,e),n=t[e];i&&Object.defineProperty(t,e,{set:function(e){n=e,this.defWatcherBlock||this.save("columns"),i.set&&i.set(e)},get:function(){return i.get&&i.get(),n}})})),this.defWatcherBlock=!1)}},{key:"load",value:function(e,t){var i=this.retreiveData(e);return t&&(i=i?this.mergeDefinition(t,i):t),i}},{key:"retreiveData",value:function(e){return!!this.readFunc&&this.readFunc(this.id,e)}},{key:"mergeDefinition",value:function(e,t){var i=this,n=[];return(t=t||[]).forEach((function(t,o){var a,r=i._findColumn(e,t);r&&(!0===i.config.columns||null==i.config.columns?(a=Object.keys(r)).push("width"):a=i.config.columns,a.forEach((function(e){"columns"!==e&&void 0!==t[e]&&(r[e]=t[e])})),r.columns&&(r.columns=i.mergeDefinition(r.columns,t.columns)),n.push(r))})),e.forEach((function(e,o){i._findColumn(t,e)||(n.length>o?n.splice(o,0,e):n.push(e))})),n}},{key:"_findColumn",value:function(e,t){var i=t.columns?"group":t.field?"field":"object";return e.find((function(e){switch(i){case"group":return e.title===t.title&&e.columns.length===t.columns.length;case"field":return e.field===t.field;case"object":return e===t}}))}},{key:"save",value:function(e){var t={};switch(e){case"columns":t=this.parseColumns(this.table.columnManager.getColumns());break;case"filter":t=this.table.modules.filter.getFilters();break;case"sort":t=this.validateSorters(this.table.modules.sort.getSort());break;case"group":t=this.getGroupConfig();break;case"page":t=this.getPageConfig()}this.writeFunc&&this.writeFunc(this.id,e,t)}},{key:"validateSorters",value:function(e){return e.forEach((function(e){e.column=e.field,delete e.field})),e}},{key:"getGroupConfig",value:function(){var e={};return this.config.group&&((!0===this.config.group||this.config.group.groupBy)&&(e.groupBy=this.table.options.groupBy),(!0===this.config.group||this.config.group.groupStartOpen)&&(e.groupStartOpen=this.table.options.groupStartOpen),(!0===this.config.group||this.config.group.groupHeader)&&(e.groupHeader=this.table.options.groupHeader)),e}},{key:"getPageConfig",value:function(){var e={};return this.config.page&&((!0===this.config.page||this.config.page.size)&&(e.paginationSize=this.table.modules.page.getPageSize()),(!0===this.config.page||this.config.page.page)&&(e.paginationInitialPage=this.table.modules.page.getPage())),e}},{key:"parseColumns",value:function(e){var t=this,i=[],n=["headerContextMenu","headerMenu","contextMenu","clickMenu"];return e.forEach((function(e){var o,a={},r=e.getDefinition();e.isGroup?(a.title=r.title,a.columns=t.parseColumns(e.getColumns())):(a.field=e.getField(),!0===t.config.columns||null==t.config.columns?((o=Object.keys(r)).push("width"),o.push("visible")):o=t.config.columns,o.forEach((function(t){switch(t){case"width":a.width=e.getWidth();break;case"visible":a.visible=e.visible;break;default:"function"!=typeof r[t]&&-1===n.indexOf(t)&&(a[t]=r[t])}}))),i.push(a)})),i}}]),n}(V);Ve.moduleName="persistence",Ve.moduleInitOrder=-10,Ve.readers=Ie,Ve.writers=Ne;var We=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).columnSubscribers={},o.registerTableOption("rowContextPopup",!1),o.registerTableOption("rowClickPopup",!1),o.registerTableOption("groupContextPopup",!1),o.registerTableOption("groupClickPopup",!1),o.registerColumnOption("headerContextPopup"),o.registerColumnOption("headerClickPopup"),o.registerColumnOption("headerPopup"),o.registerColumnOption("headerPopupIcon"),o.registerColumnOption("contextPopup"),o.registerColumnOption("clickPopup"),o}return o(n,[{key:"initialize",value:function(){this.initializeRowWatchers(),this.initializeGroupWatchers(),this.subscribe("column-init",this.initializeColumn.bind(this))}},{key:"initializeRowWatchers",value:function(){this.table.options.rowContextPopup&&(this.subscribe("row-contextmenu",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup)),this.table.on("rowTapHold",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup))),this.table.options.rowClickPopup&&this.subscribe("row-click",this.loadPopupEvent.bind(this,this.table.options.rowClickPopup))}},{key:"initializeGroupWatchers",value:function(){this.table.options.groupContextPopup&&(this.subscribe("group-contextmenu",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup)),this.table.on("groupTapHold",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup))),this.table.options.groupClickPopup&&this.subscribe("group-click",this.loadPopupEvent.bind(this,this.table.options.groupClickPopup))}},{key:"initializeColumn",value:function(e){var t=e.definition;t.headerContextPopup&&!this.columnSubscribers.headerContextPopup&&(this.columnSubscribers.headerContextPopup=this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"),this.subscribe("column-contextmenu",this.columnSubscribers.headerContextPopup),this.table.on("headerTapHold",this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"))),t.headerClickPopup&&!this.columnSubscribers.headerClickPopup&&(this.columnSubscribers.headerClickPopup=this.loadPopupTableColumnEvent.bind(this,"headerClickPopup"),this.subscribe("column-click",this.columnSubscribers.headerClickPopup)),t.headerPopup&&this.initializeColumnHeaderPopup(e),t.contextPopup&&!this.columnSubscribers.contextPopup&&(this.columnSubscribers.contextPopup=this.loadPopupTableCellEvent.bind(this,"contextPopup"),this.subscribe("cell-contextmenu",this.columnSubscribers.contextPopup),this.table.on("cellTapHold",this.loadPopupTableCellEvent.bind(this,"contextPopup"))),t.clickPopup&&!this.columnSubscribers.clickPopup&&(this.columnSubscribers.clickPopup=this.loadPopupTableCellEvent.bind(this,"clickPopup"),this.subscribe("cell-click",this.columnSubscribers.clickPopup))}},{key:"initializeColumnHeaderPopup",value:function(e){var t,i=this,n=e.definition.headerPopupIcon;(t=document.createElement("span")).classList.add("tabulator-header-popup-button"),n?("function"==typeof n&&(n=n(e.getComponent())),n instanceof HTMLElement?t.appendChild(n):t.innerHTML=n):t.innerHTML="⋮",t.addEventListener("click",(function(t){t.stopPropagation(),t.preventDefault(),i.loadPopupEvent(e.definition.headerPopup,t,e)})),e.titleElement.insertBefore(t,e.titleElement.firstChild)}},{key:"loadPopupTableCellEvent",value:function(e,t,i){i._cell&&(i=i._cell),i.column.definition[e]&&this.loadPopupEvent(i.column.definition[e],t,i)}},{key:"loadPopupTableColumnEvent",value:function(e,t,i){i._column&&(i=i._column),i.definition[e]&&this.loadPopupEvent(i.definition[e],t,i)}},{key:"loadPopupEvent",value:function(e,t,i){var n;i._group?i=i._group:i._row&&(i=i._row),e="function"==typeof e?e.call(this.table,t,i.getComponent(),(function(e){n=e})):e,this.loadPopup(t,i,e,n)}},{key:"loadPopup",value:function(e,t,i,n){var o,a,r=this,s=!(e instanceof MouseEvent);i instanceof HTMLElement?o=i:(o=document.createElement("div")).innerHTML=i,o.classList.add("tabulator-popup"),o.addEventListener("click",(function(e){e.stopPropagation()})),s||e.preventDefault(),a=this.popup(o),"function"==typeof n&&a.renderCallback(n),a.show(e).hideOnBlur((function(){r.dispatchExternal("popupClosed",t.getComponent())})),this.dispatchExternal("popupOpened",t.getComponent())}}]),n}(V);We.moduleName="popup";var je=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).element=!1,o.manualBlock=!1,o.registerTableOption("printAsHtml",!1),o.registerTableOption("printFormatter",!1),o.registerTableOption("printHeader",!1),o.registerTableOption("printFooter",!1),o.registerTableOption("printStyled",!0),o.registerTableOption("printRowRange","visible"),o.registerTableOption("printConfig",{}),o.registerColumnOption("print"),o.registerColumnOption("titlePrint"),o}return o(n,[{key:"initialize",value:function(){this.table.options.printAsHtml&&(window.addEventListener("beforeprint",this.replaceTable.bind(this)),window.addEventListener("afterprint",this.cleanup.bind(this))),this.registerTableFunction("print",this.printFullscreen.bind(this))}},{key:"replaceTable",value:function(){this.manualBlock||(this.element=document.createElement("div"),this.element.classList.add("tabulator-print-table"),this.element.appendChild(this.table.modules.export.genereateTable(this.table.options.printConfig,this.table.options.printStyled,this.table.options.printRowRange,"print")),this.table.element.style.display="none",this.table.element.parentNode.insertBefore(this.element,this.table.element))}},{key:"cleanup",value:function(){document.body.classList.remove("tabulator-print-fullscreen-hide"),this.element&&this.element.parentNode&&(this.element.parentNode.removeChild(this.element),this.table.element.style.display="")}},{key:"printFullscreen",value:function(e,t,i){var n,o,a=window.scrollX,r=window.scrollY,s=document.createElement("div"),l=document.createElement("div"),u=this.table.modules.export.genereateTable(void 0!==i?i:this.table.options.printConfig,void 0!==t?t:this.table.options.printStyled,e||this.table.options.printRowRange,"print");this.manualBlock=!0,this.element=document.createElement("div"),this.element.classList.add("tabulator-print-fullscreen"),this.table.options.printHeader&&(s.classList.add("tabulator-print-header"),"string"==typeof(n="function"==typeof this.table.options.printHeader?this.table.options.printHeader.call(this.table):this.table.options.printHeader)?s.innerHTML=n:s.appendChild(n),this.element.appendChild(s)),this.element.appendChild(u),this.table.options.printFooter&&(l.classList.add("tabulator-print-footer"),"string"==typeof(o="function"==typeof this.table.options.printFooter?this.table.options.printFooter.call(this.table):this.table.options.printFooter)?l.innerHTML=o:l.appendChild(o),this.element.appendChild(l)),document.body.classList.add("tabulator-print-fullscreen-hide"),document.body.appendChild(this.element),this.table.options.printFormatter&&this.table.options.printFormatter(this.element,u),window.print(),this.cleanup(),window.scrollTo(a,r),this.manualBlock=!1}}]),n}(V);je.moduleName="print";var Ge=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).data=!1,o.blocked=!1,o.origFuncs={},o.currentVersion=0,o.registerTableOption("reactiveData",!1),o}return o(n,[{key:"initialize",value:function(){this.table.options.reactiveData&&(this.subscribe("cell-value-save-before",this.block.bind(this)),this.subscribe("cell-value-save-after",this.unblock.bind(this)),this.subscribe("row-data-save-before",this.block.bind(this)),this.subscribe("row-data-save-after",this.unblock.bind(this)),this.subscribe("row-data-init-after",this.watchRow.bind(this)),this.subscribe("data-processing",this.watchData.bind(this)),this.subscribe("table-destroy",this.unwatchData.bind(this)))}},{key:"watchData",value:function(e){var t,i=this;this.currentVersion++,t=this.currentVersion,this.unwatchData(),this.data=e,this.origFuncs.push=e.push,Object.defineProperty(this.data,"push",{enumerable:!1,configurable:!0,value:function(){var n=Array.from(arguments);return i.blocked||t!==i.currentVersion||n.forEach((function(e){i.table.rowManager.addRowActual(e,!1)})),i.origFuncs.push.apply(e,arguments)}}),this.origFuncs.unshift=e.unshift,Object.defineProperty(this.data,"unshift",{enumerable:!1,configurable:!0,value:function(){var n=Array.from(arguments);return i.blocked||t!==i.currentVersion||n.forEach((function(e){i.table.rowManager.addRowActual(e,!0)})),i.origFuncs.unshift.apply(e,arguments)}}),this.origFuncs.shift=e.shift,Object.defineProperty(this.data,"shift",{enumerable:!1,configurable:!0,value:function(){var n;return i.blocked||t!==i.currentVersion||i.data.length&&(n=i.table.rowManager.getRowFromDataObject(i.data[0]))&&n.deleteActual(),i.origFuncs.shift.call(e)}}),this.origFuncs.pop=e.pop,Object.defineProperty(this.data,"pop",{enumerable:!1,configurable:!0,value:function(){var n;return i.blocked||t!==i.currentVersion||i.data.length&&(n=i.table.rowManager.getRowFromDataObject(i.data[i.data.length-1]))&&n.deleteActual(),i.origFuncs.pop.call(e)}}),this.origFuncs.splice=e.splice,Object.defineProperty(this.data,"splice",{enumerable:!1,configurable:!0,value:function(){var n,o=Array.from(arguments),a=o[0]<0?e.length+o[0]:o[0],r=o[1],s=!!o[2]&&o.slice(2);if(!i.blocked&&t===i.currentVersion){if(s&&((n=!!e[a]&&i.table.rowManager.getRowFromDataObject(e[a]))?s.forEach((function(e){i.table.rowManager.addRowActual(e,!0,n,!0)})):(s=s.slice().reverse()).forEach((function(e){i.table.rowManager.addRowActual(e,!0,!1,!0)}))),0!==r){var l=e.slice(a,void 0===o[1]?o[1]:a+r);l.forEach((function(e,t){var n=i.table.rowManager.getRowFromDataObject(e);n&&n.deleteActual(t!==l.length-1)}))}(s||0!==r)&&i.table.rowManager.reRenderInPosition()}return i.origFuncs.splice.apply(e,arguments)}})}},{key:"unwatchData",value:function(){if(!1!==this.data)for(var e in this.origFuncs)Object.defineProperty(this.data,e,{enumerable:!0,configurable:!0,writable:!0,value:this.origFuncs.key})}},{key:"watchRow",value:function(e){var t=e.getData();for(var i in this.blocked=!0,t)this.watchKey(e,t,i);this.table.options.dataTree&&this.watchTreeChildren(e),this.blocked=!1}},{key:"watchTreeChildren",value:function(e){var t=arguments,i=e.getData()[this.table.options.dataTreeChildField],n={};function o(){this.table.modules.dataTree.initializeRow(e),this.table.modules.dataTree.layoutRow(e),this.table.rowManager.refreshActiveData("tree",!1,!0)}i&&(n.push=i.push,Object.defineProperty(i,"push",{enumerable:!1,configurable:!0,value:function(){var e=n.push.apply(i,t);return o(),e}}),n.unshift=i.unshift,Object.defineProperty(i,"unshift",{enumerable:!1,configurable:!0,value:function(){var e=n.unshift.apply(i,t);return o(),e}}),n.shift=i.shift,Object.defineProperty(i,"shift",{enumerable:!1,configurable:!0,value:function(){var e=n.shift.call(i);return o(),e}}),n.pop=i.pop,Object.defineProperty(i,"pop",{enumerable:!1,configurable:!0,value:function(){var e=n.pop.call(i);return o(),e}}),n.splice=i.splice,Object.defineProperty(i,"splice",{enumerable:!1,configurable:!0,value:function(){var e=n.splice.apply(i,t);return o(),e}}))}},{key:"watchKey",value:function(e,t,i){var n=this,o=Object.getOwnPropertyDescriptor(t,i),a=t[i],r=this.currentVersion;Object.defineProperty(t,i,{set:function(t){if(a=t,!n.blocked&&r===n.currentVersion){var s={};s[i]=t,e.updateData(s)}o.set&&o.set(t)},get:function(){return o.get&&o.get(),a}})}},{key:"unwatchRow",value:function(e){var t=e.getData();for(var i in t)Object.defineProperty(t,i,{value:t[i]})}},{key:"block",value:function(){this.blocked=!0}},{key:"unblock",value:function(){this.blocked=!1}}]),n}(V);Ge.moduleName="reactiveData";var Ue=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).startColumn=!1,o.startX=!1,o.startWidth=!1,o.latestX=!1,o.handle=null,o.initialNextColumn=null,o.nextColumn=null,o.initialized=!1,o.registerColumnOption("resizable",!0),o.registerTableOption("resizableColumnFit",!1),o}return o(n,[{key:"initialize",value:function(){this.subscribe("column-rendered",this.layoutColumnHeader.bind(this))}},{key:"initializeEventWatchers",value:function(){this.initialized||(this.subscribe("cell-rendered",this.layoutCellHandles.bind(this)),this.subscribe("cell-delete",this.deInitializeComponent.bind(this)),this.subscribe("cell-height",this.resizeHandle.bind(this)),this.subscribe("column-moved",this.columnLayoutUpdated.bind(this)),this.subscribe("column-hide",this.deInitializeColumn.bind(this)),this.subscribe("column-show",this.columnLayoutUpdated.bind(this)),this.subscribe("column-width",this.columnWidthUpdated.bind(this)),this.subscribe("column-delete",this.deInitializeComponent.bind(this)),this.subscribe("column-height",this.resizeHandle.bind(this)),this.initialized=!0)}},{key:"layoutCellHandles",value:function(e){"row"===e.row.type&&(this.deInitializeComponent(e),this.initializeColumn("cell",e,e.column,e.element))}},{key:"layoutColumnHeader",value:function(e){e.definition.resizable&&(this.initializeEventWatchers(),this.deInitializeComponent(e),this.initializeColumn("header",e,e,e.element))}},{key:"columnLayoutUpdated",value:function(e){var t=e.prevColumn();this.reinitializeColumn(e),t&&this.reinitializeColumn(t)}},{key:"columnWidthUpdated",value:function(e){var t=this;e.modules.frozen&&(this.table.modules.frozenColumns.leftColumns.includes(e)?this.table.modules.frozenColumns.leftColumns.forEach((function(e){t.reinitializeColumn(e)})):this.table.modules.frozenColumns.rightColumns.includes(e)&&this.table.modules.frozenColumns.rightColumns.forEach((function(e){t.reinitializeColumn(e)})))}},{key:"reinitializeColumn",value:function(e){var t=!!e.modules.frozen&&e.modules.frozen.marginValue+e.getWidth()+"px";e.cells.forEach((function(e){e.modules.resize&&e.modules.resize.handleEl&&(t&&(e.modules.resize.handleEl.style.left=t),e.element.after(e.modules.resize.handleEl))})),e.modules.resize&&e.modules.resize.handleEl&&(t&&(e.modules.resize.handleEl.style.left=t),e.element.after(e.modules.resize.handleEl))}},{key:"initializeColumn",value:function(e,t,i,n){var o=this,a=i.definition.resizable,r={},s=i.getLastColumn();if("header"===e&&(r={variableHeight:"textarea"==i.definition.formatter||i.definition.variableHeight}),(!0===a||a==e)&&this._checkResizability(s)){var l=document.createElement("span");l.className="tabulator-col-resize-handle",l.addEventListener("click",(function(e){e.stopPropagation()}));var u=function(e){o.startColumn=i,o.initialNextColumn=o.nextColumn=s.nextColumn(),o._mouseDown(e,s,l)};l.addEventListener("mousedown",u),l.addEventListener("touchstart",u,{passive:!0}),l.addEventListener("dblclick",(function(e){var t=s.getWidth();e.stopPropagation(),s.reinitializeWidth(!0),t!==s.getWidth()&&(o.dispatch("column-resized",s),o.table.externalEvents.dispatch("columnResized",s.getComponent()))})),i.modules.frozen&&(l.style.position="absolute",l.style.left=i.modules.frozen.marginValue+i.getWidth()+"px"),r.handleEl=l,n.parentNode&&i.visible&&n.after(l)}t.modules.resize=r}},{key:"deInitializeColumn",value:function(e){var t=this;this.deInitializeComponent(e),e.cells.forEach((function(e){t.deInitializeComponent(e)}))}},{key:"deInitializeComponent",value:function(e){var t;e.modules.resize&&(t=e.modules.resize.handleEl)&&t.parentElement&&t.parentElement.removeChild(t)}},{key:"resizeHandle",value:function(e,t){e.modules.resize&&e.modules.resize.handleEl&&(e.modules.resize.handleEl.style.height=t)}},{key:"_checkResizability",value:function(e){return e.definition.resizable}},{key:"_mouseDown",value:function(e,t,i){var n=this;function o(e){var i,o,a=void 0===e.screenX?e.touches[0].screenX:e.screenX,r=a-n.startX,s=a-n.latestX;if(n.latestX=a,n.table.rtl&&(r=-r,s=-s),i=t.width==t.minWidth||t.width==t.maxWidth,t.setWidth(n.startWidth+r),o=t.width==t.minWidth||t.width==t.maxWidth,s<0&&(n.nextColumn=n.initialNextColumn),n.table.options.resizableColumnFit&&n.nextColumn&&(!i||!o)){var l=n.nextColumn.getWidth();s>0&&l<=n.nextColumn.minWidth&&(n.nextColumn=n.nextColumn.nextColumn()),n.nextColumn&&n.nextColumn.setWidth(n.nextColumn.getWidth()-s)}n.table.columnManager.renderer.rerenderColumns(!0),!n.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights()}function a(e){n.startColumn.modules.edit&&(n.startColumn.modules.edit.blocked=!1),n.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights(),document.body.removeEventListener("mouseup",a),document.body.removeEventListener("mousemove",o),i.removeEventListener("touchmove",o),i.removeEventListener("touchend",a),n.table.element.classList.remove("tabulator-block-select"),n.startWidth!==t.getWidth()&&(n.dispatch("column-resized",t),n.table.externalEvents.dispatch("columnResized",t.getComponent()))}n.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),n.startColumn.modules.edit&&(n.startColumn.modules.edit.blocked=!0),n.startX=void 0===e.screenX?e.touches[0].screenX:e.screenX,n.latestX=n.startX,n.startWidth=t.getWidth(),document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",a),i.addEventListener("touchmove",o,{passive:!0}),i.addEventListener("touchend",a)}}]),n}(V);Ue.moduleName="resizeColumns";var Xe=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).startColumn=!1,o.startY=!1,o.startHeight=!1,o.handle=null,o.prevHandle=null,o.registerTableOption("resizableRows",!1),o}return o(n,[{key:"initialize",value:function(){this.table.options.resizableRows&&this.subscribe("row-layout-after",this.initializeRow.bind(this))}},{key:"initializeRow",value:function(e){var t=this,i=e.getElement(),n=document.createElement("div");n.className="tabulator-row-resize-handle";var o=document.createElement("div");o.className="tabulator-row-resize-handle prev",n.addEventListener("click",(function(e){e.stopPropagation()}));var a=function(i){t.startRow=e,t._mouseDown(i,e,n)};n.addEventListener("mousedown",a),n.addEventListener("touchstart",a,{passive:!0}),o.addEventListener("click",(function(e){e.stopPropagation()}));var r=function(i){var n=t.table.rowManager.prevDisplayRow(e);n&&(t.startRow=n,t._mouseDown(i,n,o))};o.addEventListener("mousedown",r),o.addEventListener("touchstart",r,{passive:!0}),i.appendChild(n),i.appendChild(o)}},{key:"_mouseDown",value:function(e,t,i){var n=this;function o(e){t.setHeight(n.startHeight+((void 0===e.screenY?e.touches[0].screenY:e.screenY)-n.startY))}function a(e){document.body.removeEventListener("mouseup",o),document.body.removeEventListener("mousemove",o),i.removeEventListener("touchmove",o),i.removeEventListener("touchend",a),n.table.element.classList.remove("tabulator-block-select"),n.dispatchExternal("rowResized",t.getComponent())}n.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),n.startY=void 0===e.screenY?e.touches[0].screenY:e.screenY,n.startHeight=t.getHeight(),document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",a),i.addEventListener("touchmove",o,{passive:!0}),i.addEventListener("touchend",a)}}]),n}(V);Xe.moduleName="resizeRows";var qe=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).binding=!1,o.observer=!1,o.containerObserver=!1,o.tableHeight=0,o.tableWidth=0,o.containerHeight=0,o.containerWidth=0,o.autoResize=!1,o.registerTableOption("autoResize",!0),o}return o(n,[{key:"initialize",value:function(){var e=this;if(this.table.options.autoResize){var t,i=this.table;this.tableHeight=i.element.clientHeight,this.tableWidth=i.element.clientWidth,i.element.parentNode&&(this.containerHeight=i.element.parentNode.clientHeight,this.containerWidth=i.element.parentNode.clientWidth),"undefined"!=typeof ResizeObserver&&"virtual"===i.rowManager.getRenderMode()?(this.autoResize=!0,this.observer=new ResizeObserver((function(t){if(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell){var n=Math.floor(t[0].contentRect.height),o=Math.floor(t[0].contentRect.width);e.tableHeight==n&&e.tableWidth==o||(e.tableHeight=n,e.tableWidth=o,i.element.parentNode&&(e.containerHeight=i.element.parentNode.clientHeight,e.containerWidth=i.element.parentNode.clientWidth),e.table.columnManager.renderer.rerenderColumns(!0),i.redraw())}})),this.observer.observe(i.element),t=window.getComputedStyle(i.element),this.table.element.parentNode&&!this.table.rowManager.fixedHeight&&(t.getPropertyValue("max-height")||t.getPropertyValue("min-height"))&&(this.containerObserver=new ResizeObserver((function(t){if(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell){var n=Math.floor(t[0].contentRect.height),o=Math.floor(t[0].contentRect.width);e.containerHeight==n&&e.containerWidth==o||(e.containerHeight=n,e.containerWidth=o,e.tableHeight=i.element.clientHeight,e.tableWidth=i.element.clientWidth),i.columnManager.renderer.rerenderColumns(!0),i.redraw()}})),this.containerObserver.observe(this.table.element.parentNode)),this.subscribe("table-resize",this.tableResized.bind(this))):(this.binding=function(){(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell)&&(i.columnManager.renderer.rerenderColumns(!0),i.redraw())},window.addEventListener("resize",this.binding)),this.subscribe("table-destroy",this.clearBindings.bind(this))}}},{key:"tableResized",value:function(){this.table.rowManager.redraw()}},{key:"clearBindings",value:function(){this.binding&&window.removeEventListener("resize",this.binding),this.observer&&this.observer.unobserve(this.table.element),this.containerObserver&&this.containerObserver.unobserve(this.table.element.parentNode)}}]),n}(V);qe.moduleName="resizeTable";var Ke=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).columns=[],o.hiddenColumns=[],o.mode="",o.index=0,o.collapseFormatter=[],o.collapseStartOpen=!0,o.collapseHandleColumn=!1,o.registerTableOption("responsiveLayout",!1),o.registerTableOption("responsiveLayoutCollapseStartOpen",!0),o.registerTableOption("responsiveLayoutCollapseUseFormatters",!0),o.registerTableOption("responsiveLayoutCollapseFormatter",!1),o.registerColumnOption("responsive"),o}return o(n,[{key:"initialize",value:function(){this.table.options.responsiveLayout&&(this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("column-show",this.updateColumnVisibility.bind(this)),this.subscribe("column-hide",this.updateColumnVisibility.bind(this)),this.subscribe("columns-loaded",this.initializeResponsivity.bind(this)),this.subscribe("column-moved",this.initializeResponsivity.bind(this)),this.subscribe("column-add",this.initializeResponsivity.bind(this)),this.subscribe("column-delete",this.initializeResponsivity.bind(this)),this.subscribe("table-redrawing",this.tableRedraw.bind(this)),"collapse"===this.table.options.responsiveLayout&&(this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout",this.layoutRow.bind(this))))}},{key:"tableRedraw",value:function(e){-1===["fitColumns","fitDataStretch"].indexOf(this.layoutMode())&&(e||this.update())}},{key:"initializeResponsivity",value:function(){var e=this,t=[];this.mode=this.table.options.responsiveLayout,this.collapseFormatter=this.table.options.responsiveLayoutCollapseFormatter||this.formatCollapsedData,this.collapseStartOpen=this.table.options.responsiveLayoutCollapseStartOpen,this.hiddenColumns=[],this.table.columnManager.columnsByIndex.forEach((function(i,n){i.modules.responsive&&i.modules.responsive.order&&i.modules.responsive.visible&&(i.modules.responsive.index=n,t.push(i),i.visible||"collapse"!==e.mode||e.hiddenColumns.push(i))})),t=(t=t.reverse()).sort((function(e,t){return t.modules.responsive.order-e.modules.responsive.order||t.modules.responsive.index-e.modules.responsive.index})),this.columns=t,"collapse"===this.mode&&this.generateCollapsedContent();var i,n=f(this.table.columnManager.columnsByIndex);try{for(n.s();!(i=n.n()).done;){var o=i.value;if("responsiveCollapse"==o.definition.formatter){this.collapseHandleColumn=o;break}}}catch(e){n.e(e)}finally{n.f()}this.collapseHandleColumn&&(this.hiddenColumns.length?this.collapseHandleColumn.show():this.collapseHandleColumn.hide())}},{key:"initializeColumn",value:function(e){var t=e.getDefinition();e.modules.responsive={order:void 0===t.responsive?1:t.responsive,visible:!1!==t.visible}}},{key:"initializeRow",value:function(e){var t;"calc"!==e.type&&((t=document.createElement("div")).classList.add("tabulator-responsive-collapse"),e.modules.responsiveLayout={element:t,open:this.collapseStartOpen},this.collapseStartOpen||(t.style.display="none"))}},{key:"layoutRow",value:function(e){var t=e.getElement();e.modules.responsiveLayout&&(t.appendChild(e.modules.responsiveLayout.element),this.generateCollapsedRowContent(e))}},{key:"updateColumnVisibility",value:function(e,t){!t&&e.modules.responsive&&(e.modules.responsive.visible=e.visible,this.initializeResponsivity())}},{key:"hideColumn",value:function(e){var t=this.hiddenColumns.length;e.hide(!1,!0),"collapse"===this.mode&&(this.hiddenColumns.unshift(e),this.generateCollapsedContent(),this.collapseHandleColumn&&!t&&this.collapseHandleColumn.show())}},{key:"showColumn",value:function(e){var t;e.show(!1,!0),e.setWidth(e.getWidth()),"collapse"===this.mode&&((t=this.hiddenColumns.indexOf(e))>-1&&this.hiddenColumns.splice(t,1),this.generateCollapsedContent(),this.collapseHandleColumn&&!this.hiddenColumns.length&&this.collapseHandleColumn.hide())}},{key:"update",value:function(){for(var e=this,t=!0;t;){var i="fitColumns"==e.table.modules.layout.getMode()?e.table.columnManager.getFlexBaseWidth():e.table.columnManager.getWidth(),n=(e.table.options.headerVisible?e.table.columnManager.element.clientWidth:e.table.element.clientWidth)-i;if(n<0){var o=e.columns[e.index];o?(e.hideColumn(o),e.index++):t=!1}else{var a=e.columns[e.index-1];a&&n>0&&n>=a.getWidth()?(e.showColumn(a),e.index--):t=!1}e.table.rowManager.activeRowsCount||e.table.rowManager.renderEmptyScroll()}}},{key:"generateCollapsedContent",value:function(){var e=this;this.table.rowManager.getDisplayRows().forEach((function(t){e.generateCollapsedRowContent(t)}))}},{key:"generateCollapsedRowContent",value:function(e){var t,i;if(e.modules.responsiveLayout){for(t=e.modules.responsiveLayout.element;t.firstChild;)t.removeChild(t.firstChild);(i=this.collapseFormatter(this.generateCollapsedRowData(e)))&&t.appendChild(i)}}},{key:"generateCollapsedRowData",value:function(e){var t,i=this,n=e.getData(),o=[];return this.hiddenColumns.forEach((function(a){var r=a.getFieldValue(n);if(a.definition.title&&a.field)if(a.modules.format&&i.table.options.responsiveLayoutCollapseUseFormatters){t={value:!1,data:{},getValue:function(){return r},getData:function(){return n},getElement:function(){return document.createElement("div")},getRow:function(){return e.getComponent()},getColumn:function(){return a.getComponent()}},o.push({field:a.field,title:a.definition.title,value:a.modules.format.formatter.call(i.table.modules.format,t,a.modules.format.params,(function(e){e()}))})}else o.push({field:a.field,title:a.definition.title,value:r})})),o}},{key:"formatCollapsedData",value:function(e){var t=document.createElement("table");return e.forEach((function(e){var i,n=document.createElement("tr"),o=document.createElement("td"),a=document.createElement("td"),r=document.createElement("strong");o.appendChild(r),this.langBind("columns|"+e.field,(function(t){r.innerHTML=t||e.title})),e.value instanceof Node?((i=document.createElement("div")).appendChild(e.value),a.appendChild(i)):a.innerHTML=e.value,n.appendChild(o),n.appendChild(a),t.appendChild(n)}),this),Object.keys(e).length?t:""}}]),n}(V);Ke.moduleName="responsiveLayout";var Je=function(i){a(r,i);var n=c(r);function r(e){var i;return t(this,r),(i=n.call(this,e)).selecting=!1,i.lastClickedRow=!1,i.selectPrev=[],i.selectedRows=[],i.headerCheckboxElement=null,i.registerTableOption("selectable","highlight"),i.registerTableOption("selectableRangeMode","drag"),i.registerTableOption("selectableRollingSelection",!0),i.registerTableOption("selectablePersistence",!0),i.registerTableOption("selectableCheck",(function(e,t){return!0})),i.registerTableFunction("selectRow",i.selectRows.bind(l(i))),i.registerTableFunction("deselectRow",i.deselectRows.bind(l(i))),i.registerTableFunction("toggleSelectRow",i.toggleRow.bind(l(i))),i.registerTableFunction("getSelectedRows",i.getSelectedRows.bind(l(i))),i.registerTableFunction("getSelectedData",i.getSelectedData.bind(l(i))),i.registerComponentFunction("row","select",i.selectRows.bind(l(i))),i.registerComponentFunction("row","deselect",i.deselectRows.bind(l(i))),i.registerComponentFunction("row","toggleSelect",i.toggleRow.bind(l(i))),i.registerComponentFunction("row","isSelected",i.isRowSelected.bind(l(i))),i}return o(r,[{key:"initialize",value:function(){!1!==this.table.options.selectable&&(this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-deleting",this.rowDeleted.bind(this)),this.subscribe("rows-wipe",this.clearSelectionData.bind(this)),this.subscribe("rows-retrieve",this.rowRetrieve.bind(this)),this.table.options.selectable&&!this.table.options.selectablePersistence&&this.subscribe("data-refreshing",this.deselectRows.bind(this)))}},{key:"rowRetrieve",value:function(e,t){return"selected"===e?this.selectedRows:t}},{key:"rowDeleted",value:function(e){this._deselectRow(e,!0)}},{key:"clearSelectionData",value:function(e){this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],!0!==e&&this._rowSelectionChanged()}},{key:"initializeRow",value:function(e){var t=this,i=e.getElement(),n=function e(){setTimeout((function(){t.selecting=!1}),50),document.body.removeEventListener("mouseup",e)};e.modules.select={selected:!1},t.table.options.selectableCheck.call(this.table,e.getComponent())?(i.classList.add("tabulator-selectable"),i.classList.remove("tabulator-unselectable"),t.table.options.selectable&&"highlight"!=t.table.options.selectable&&("click"===t.table.options.selectableRangeMode?i.addEventListener("click",this.handleComplexRowClick.bind(this,e)):(i.addEventListener("click",(function(i){t.table.modExists("edit")&&t.table.modules.edit.getCurrentCell()||t.table._clearSelection(),t.selecting||t.toggleRow(e)})),i.addEventListener("mousedown",(function(i){if(i.shiftKey)return t.table._clearSelection(),t.selecting=!0,t.selectPrev=[],document.body.addEventListener("mouseup",n),document.body.addEventListener("keyup",n),t.toggleRow(e),!1})),i.addEventListener("mouseenter",(function(i){t.selecting&&(t.table._clearSelection(),t.toggleRow(e),t.selectPrev[1]==e&&t.toggleRow(t.selectPrev[0]))})),i.addEventListener("mouseout",(function(i){t.selecting&&(t.table._clearSelection(),t.selectPrev.unshift(e))}))))):(i.classList.add("tabulator-unselectable"),i.classList.remove("tabulator-selectable"))}},{key:"handleComplexRowClick",value:function(e,t){var i=this;if(t.shiftKey){this.table._clearSelection(),this.lastClickedRow=this.lastClickedRow||e;var n=this.table.rowManager.getDisplayRowIndex(this.lastClickedRow),o=this.table.rowManager.getDisplayRowIndex(e),a=n<=o?n:o,r=n>=o?n:o,s=this.table.rowManager.getDisplayRows().slice(0).splice(a,r-a+1);t.ctrlKey||t.metaKey?(s.forEach((function(t){t!==i.lastClickedRow&&(!0===i.table.options.selectable||i.isRowSelected(e)||i.selectedRows.lengththis.table.options.selectable&&(s=s.slice(0,this.table.options.selectable)),this.selectRows(s)),this.table._clearSelection()}else t.ctrlKey||t.metaKey?(this.toggleRow(e),this.lastClickedRow=e):(this.deselectRows(void 0,!0),this.selectRows(e),this.lastClickedRow=e)}},{key:"toggleRow",value:function(e){this.table.options.selectableCheck.call(this.table,e.getComponent())&&(e.modules.select&&e.modules.select.selected?this._deselectRow(e):this._selectRow(e))}},{key:"selectRows",value:function(t){var i,n=this;switch(e(t)){case"undefined":this.table.rowManager.rows.forEach((function(e){n._selectRow(e,!0,!0)})),this._rowSelectionChanged();break;case"string":(i=this.table.rowManager.findRow(t))?this._selectRow(i,!0,!0):this.table.rowManager.getRows(t).forEach((function(e){n._selectRow(e,!0,!0)})),this._rowSelectionChanged();break;default:Array.isArray(t)?(t.forEach((function(e){n._selectRow(e,!0,!0)})),this._rowSelectionChanged()):this._selectRow(t,!1,!0)}}},{key:"_selectRow",value:function(e,t,i){if(!isNaN(this.table.options.selectable)&&!0!==this.table.options.selectable&&!i&&this.selectedRows.length>=this.table.options.selectable){if(!this.table.options.selectableRollingSelection)return!1;this._deselectRow(this.selectedRows[0])}var n=this.table.rowManager.findRow(e);n?-1==this.selectedRows.indexOf(n)&&(n.getElement().classList.add("tabulator-selected"),n.modules.select||(n.modules.select={}),n.modules.select.selected=!0,n.modules.select.checkboxEl&&(n.modules.select.checkboxEl.checked=!0),this.selectedRows.push(n),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(n,!0),this.dispatchExternal("rowSelected",n.getComponent()),this._rowSelectionChanged(t)):t||console.warn("Selection Error - No such row found, ignoring selection:"+e)}},{key:"isRowSelected",value:function(e){return-1!==this.selectedRows.indexOf(e)}},{key:"deselectRows",value:function(e,t){var i,n=this;if(void 0===e){i=n.selectedRows.length;for(var o=0;o-1&&(o.getElement().classList.remove("tabulator-selected"),o.modules.select||(o.modules.select={}),o.modules.select.selected=!1,o.modules.select.checkboxEl&&(o.modules.select.checkboxEl.checked=!1),n.selectedRows.splice(i,1),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(o,!1),this.dispatchExternal("rowDeselected",o.getComponent()),n._rowSelectionChanged(t)):t||console.warn("Deselection Error - No such row found, ignoring selection:"+e)}},{key:"getSelectedData",value:function(){var e=[];return this.selectedRows.forEach((function(t){e.push(t.getData())})),e}},{key:"getSelectedRows",value:function(){var e=[];return this.selectedRows.forEach((function(t){e.push(t.getComponent())})),e}},{key:"_rowSelectionChanged",value:function(e){this.headerCheckboxElement&&(0===this.selectedRows.length?(this.headerCheckboxElement.checked=!1,this.headerCheckboxElement.indeterminate=!1):this.table.rowManager.rows.length===this.selectedRows.length?(this.headerCheckboxElement.checked=!0,this.headerCheckboxElement.indeterminate=!1):(this.headerCheckboxElement.indeterminate=!0,this.headerCheckboxElement.checked=!1)),e||this.dispatchExternal("rowSelectionChanged",this.getSelectedData(),this.getSelectedRows())}},{key:"registerRowSelectCheckbox",value:function(e,t){e._row.modules.select||(e._row.modules.select={}),e._row.modules.select.checkboxEl=t}},{key:"registerHeaderSelectCheckbox",value:function(e){this.headerCheckboxElement=e}},{key:"childRowSelection",value:function(e,t){var i=this.table.modules.dataTree.getChildren(e,!0);if(t){var n,o=f(i);try{for(o.s();!(n=o.n()).done;){var a=n.value;this._selectRow(a,!0)}}catch(e){o.e(e)}finally{o.f()}}else{var r,s=f(i);try{for(s.s();!(r=s.n()).done;){var l=r.value;this._deselectRow(l,!0)}}catch(e){s.e(e)}finally{s.f()}}}}]),r}(V);function Ye(e,t,i,n,o,a,r){var s=window.DateTime||luxon.DateTime,l=r.format||"dd/MM/yyyy HH:mm:ss",u=r.alignEmptyValues,c=0;if(void 0!==s){if(e=s.isDateTime(e)?e:"iso"===l?s.fromISO(String(e)):s.fromFormat(String(e),l),t=s.isDateTime(t)?t:"iso"===l?s.fromISO(String(t)):s.fromFormat(String(t),l),e.isValid){if(t.isValid)return e-t;c=1}else c=t.isValid?-1:0;return("top"===u&&"desc"===a||"bottom"===u&&"asc"===a)&&(c*=-1),c}console.error("Sort Error - 'datetime' sorter is dependant on luxon.js")}Je.moduleName="selectRow";var $e={number:function(e,t,i,n,o,a,r){var s=r.alignEmptyValues,l=r.decimalSeparator,u=r.thousandSeparator,c=0;if(e=String(e),t=String(t),u&&(e=e.split(u).join(""),t=t.split(u).join("")),l&&(e=e.split(l).join("."),t=t.split(l).join(".")),e=parseFloat(e),t=parseFloat(t),isNaN(e))c=isNaN(t)?0:-1;else{if(!isNaN(t))return e-t;c=1}return("top"===s&&"desc"===a||"bottom"===s&&"asc"===a)&&(c*=-1),c},string:function(t,i,n,o,a,r,s){var l,u=s.alignEmptyValues,c=0;if(t){if(i){switch(e(s.locale)){case"boolean":s.locale&&(l=this.langLocale());break;case"string":l=s.locale}return String(t).toLowerCase().localeCompare(String(i).toLowerCase(),l)}c=1}else c=i?-1:0;return("top"===u&&"desc"===r||"bottom"===u&&"asc"===r)&&(c*=-1),c},date:function(e,t,i,n,o,a,r){return r.format||(r.format="dd/MM/yyyy"),Ye.call(this,e,t,i,n,o,a,r)},time:function(e,t,i,n,o,a,r){return r.format||(r.format="HH:mm"),Ye.call(this,e,t,i,n,o,a,r)},datetime:Ye,boolean:function(e,t,i,n,o,a,r){return(!0===e||"true"===e||"True"===e||1===e?1:0)-(!0===t||"true"===t||"True"===t||1===t?1:0)},array:function(e,t,i,n,o,a,r){var s=r.type||"length",l=r.alignEmptyValues,u=0;function c(e){switch(s){case"length":return e.length;case"sum":return e.reduce((function(e,t){return e+t}));case"max":return Math.max.apply(null,e);case"min":return Math.min.apply(null,e);case"avg":return e.reduce((function(e,t){return e+t}))/e.length}}if(Array.isArray(e)){if(Array.isArray(t))return(e?c(e):0)-(t?c(t):0);l=1}else l=Array.isArray(t)?-1:0;return("top"===l&&"desc"===a||"bottom"===l&&"asc"===a)&&(u*=-1),u},exists:function(e,t,i,n,o,a,r){return(void 0===e?0:1)-(void 0===t?0:1)},alphanum:function(e,t,i,n,o,a,r){var s,l,u,c,h,d=0,m=/(\d+)|(\D+)/g,p=/\d/,f=r.alignEmptyValues,g=0;if(e||0===e){if(t||0===t){if(isFinite(e)&&isFinite(t))return e-t;if((s=String(e).toLowerCase())===(l=String(t).toLowerCase()))return 0;if(!p.test(s)||!p.test(l))return s>l?1:-1;for(s=s.match(m),l=l.match(m),h=s.length>l.length?l.length:s.length;dc?1:-1;return s.length>l.length}g=1}else g=t||0===t?-1:0;return("top"===f&&"desc"===a||"bottom"===f&&"asc"===a)&&(g*=-1),g}},Ze=function(i){a(r,i);var n=c(r);function r(e){var i;return t(this,r),(i=n.call(this,e)).sortList=[],i.changed=!1,i.registerTableOption("sortMode","local"),i.registerTableOption("initialSort",!1),i.registerTableOption("columnHeaderSortMulti",!0),i.registerTableOption("sortOrderReverse",!1),i.registerTableOption("headerSortElement","
"),i.registerColumnOption("sorter"),i.registerColumnOption("sorterParams"),i.registerColumnOption("headerSort",!0),i.registerColumnOption("headerSortStartingDir"),i.registerColumnOption("headerSortTristate"),i}return o(r,[{key:"initialize",value:function(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("table-built",this.tableBuilt.bind(this)),this.registerDataHandler(this.sort.bind(this),20),this.registerTableFunction("setSort",this.userSetSort.bind(this)),this.registerTableFunction("getSorters",this.getSort.bind(this)),this.registerTableFunction("clearSort",this.clearSort.bind(this)),"remote"===this.table.options.sortMode&&this.subscribe("data-params",this.remoteSortParams.bind(this))}},{key:"tableBuilt",value:function(){this.table.options.initialSort&&this.setSort(this.table.options.initialSort)}},{key:"remoteSortParams",value:function(e,t,i,n){var o=this.getSort();return o.forEach((function(e){delete e.column})),n.sort=o,n}},{key:"userSetSort",value:function(e,t){this.setSort(e,t),this.refreshSort()}},{key:"clearSort",value:function(){this.clear(),this.refreshSort()}},{key:"initializeColumn",value:function(t){var i,n,o=this,a=!1;switch(e(t.definition.sorter)){case"string":r.sorters[t.definition.sorter]?a=r.sorters[t.definition.sorter]:console.warn("Sort Error - No such sorter found: ",t.definition.sorter);break;case"function":a=t.definition.sorter}t.modules.sort={sorter:a,dir:"none",params:t.definition.sorterParams||{},startingDir:t.definition.headerSortStartingDir||"asc",tristate:t.definition.headerSortTristate},!1!==t.definition.headerSort&&((i=t.getElement()).classList.add("tabulator-sortable"),(n=document.createElement("div")).classList.add("tabulator-col-sorter"),"object"==e(this.table.options.headerSortElement)?n.appendChild(this.table.options.headerSortElement):n.innerHTML=this.table.options.headerSortElement,t.titleHolderElement.appendChild(n),t.modules.sort.element=n,i.addEventListener("click",(function(e){var i="",n=[],a=!1;if(t.modules.sort){if(t.modules.sort.tristate)i="none"==t.modules.sort.dir?t.modules.sort.startingDir:t.modules.sort.dir==t.modules.sort.startingDir?"asc"==t.modules.sort.dir?"desc":"asc":"none";else switch(t.modules.sort.dir){case"asc":i="desc";break;case"desc":i="asc";break;default:i=t.modules.sort.startingDir}o.table.options.columnHeaderSortMulti&&(e.shiftKey||e.ctrlKey)?((a=(n=o.getSort()).findIndex((function(e){return e.field===t.getField()})))>-1?(n[a].dir=i,a!=n.length-1&&(a=n.splice(a,1)[0],"none"!=i&&n.push(a))):"none"!=i&&n.push({column:t,dir:i}),o.setSort(n)):"none"==i?o.clear():o.setSort(t,i),o.refreshSort()}})))}},{key:"refreshSort",value:function(){"remote"===this.table.options.sortMode?this.reloadData(null,!1,!1):this.refreshData(!0)}},{key:"hasChanged",value:function(){var e=this.changed;return this.changed=!1,e}},{key:"getSort",value:function(){var e=[];return this.sortList.forEach((function(t){t.column&&e.push({column:t.column.getComponent(),field:t.column.getField(),dir:t.dir})})),e}},{key:"setSort",value:function(e,t){var i=this,n=[];Array.isArray(e)||(e=[{column:e,dir:t}]),e.forEach((function(e){var t;(t=i.table.columnManager.findColumn(e.column))?(e.column=t,n.push(e),i.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",e.column)})),i.sortList=n,this.dispatch("sort-changed")}},{key:"clear",value:function(){this.setSort([])}},{key:"findSorter",value:function(t){var i,n=this.table.rowManager.activeRows[0],o="string";if(n&&(n=n.getData(),t.getField()))switch(e(i=t.getFieldValue(n))){case"undefined":o="string";break;case"boolean":o="boolean";break;default:isNaN(i)||""===i?i.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(o="alphanum"):o="number"}return r.sorters[o]}},{key:"sort",value:function(e){var t=this,i=this.table.options.sortOrderReverse?t.sortList.slice().reverse():t.sortList,n=[],o=[];return this.subscribedExternal("dataSorting")&&this.dispatchExternal("dataSorting",t.getSort()),t.clearColumnHeaders(),"remote"!==this.table.options.sortMode?(i.forEach((function(e,i){var o=e.column.modules.sort;e.column&&o&&(o.sorter||(o.sorter=t.findSorter(e.column)),e.params="function"==typeof o.params?o.params(e.column.getComponent(),e.dir):o.params,n.push(e)),t.setColumnHeader(e.column,e.dir)})),n.length&&t._sortItems(e,n)):i.forEach((function(e,i){t.setColumnHeader(e.column,e.dir)})),this.subscribedExternal("dataSorted")&&(e.forEach((function(e){o.push(e.getComponent())})),this.dispatchExternal("dataSorted",t.getSort(),o)),e}},{key:"clearColumnHeaders",value:function(){this.table.columnManager.getRealColumns().forEach((function(e){e.modules.sort&&(e.modules.sort.dir="none",e.getElement().setAttribute("aria-sort","none"))}))}},{key:"setColumnHeader",value:function(e,t){e.modules.sort.dir=t,e.getElement().setAttribute("aria-sort","asc"===t?"ascending":"descending")}},{key:"_sortItems",value:function(e,t){var i=this,n=t.length-1;e.sort((function(e,o){for(var a,r=n;r>=0;r--){var s=t[r];if(0!==(a=i._sortRow(e,o,s.column,s.dir,s.params)))break}return a}))}},{key:"_sortRow",value:function(e,t,i,n,o){var a,r,s="asc"==n?e:t,l="asc"==n?t:e;return e=void 0!==(e=i.getFieldValue(s.getData()))?e:"",t=void 0!==(t=i.getFieldValue(l.getData()))?t:"",a=s.getComponent(),r=l.getComponent(),i.modules.sort.sorter.call(this,e,t,a,r,i.getComponent(),n,o)}}]),r}(V);Ze.moduleName="sort",Ze.sorters=$e;var Qe=function(e){a(n,e);var i=c(n);function n(e){var o;return t(this,n),(o=i.call(this,e)).tooltipSubscriber=null,o.headerSubscriber=null,o.timeout=null,o.popupInstance=null,o.registerTableOption("tooltipGenerationMode",void 0),o.registerTableOption("tooltipDelay",300),o.registerColumnOption("tooltip"),o.registerColumnOption("headerTooltip"),o}return o(n,[{key:"initialize",value:function(){this.deprecationCheck(),this.subscribe("column-init",this.initializeColumn.bind(this))}},{key:"deprecationCheck",value:function(){void 0!==this.table.options.tooltipGenerationMode&&console.warn("Use of the tooltipGenerationMode option is now deprecated. This option is no longer needed as tooltips are always generated on hover now")}},{key:"initializeColumn",value:function(e){e.definition.headerTooltip&&!this.headerSubscriber&&(this.headerSubscriber=!0,this.subscribe("column-mousemove",this.mousemoveCheck.bind(this,"headerTooltip")),this.subscribe("column-mouseout",this.mouseoutCheck.bind(this,"headerTooltip"))),e.definition.tooltip&&!this.tooltipSubscriber&&(this.tooltipSubscriber=!0,this.subscribe("cell-mousemove",this.mousemoveCheck.bind(this,"tooltip")),this.subscribe("cell-mouseout",this.mouseoutCheck.bind(this,"tooltip")))}},{key:"mousemoveCheck",value:function(e,t,i){var n="tooltip"===e?i.column.definition.tooltip:i.definition.headerTooltip;n&&(this.clearPopup(),this.timeout=setTimeout(this.loadTooltip.bind(this,t,i,n),this.table.options.tooltipDelay))}},{key:"mouseoutCheck",value:function(e,t,i){this.popupInstance||this.clearPopup()}},{key:"clearPopup",value:function(e,t,i){clearTimeout(this.timeout),this.timeout=null,this.popupInstance&&this.popupInstance.hide()}},{key:"loadTooltip",value:function(e,t,i){var n,o,a,r=this;"function"==typeof i&&(i=i(e,t.getComponent(),(function(e){o=e}))),i instanceof HTMLElement?n=i:(n=document.createElement("div"),!0===i&&(t instanceof w?i=t.value:t.definition.field?this.langBind("columns|"+t.definition.field,(function(e){n.innerHTML=i=e||t.definition.title})):i=t.definition.title),n.innerHTML=i),(i||0===i||"0"===i||!1===i)&&(n.classList.add("tabulator-tooltip"),n.addEventListener("mousemove",(function(e){return e.preventDefault()})),this.popupInstance=this.popup(n),"function"==typeof o&&this.popupInstance.renderCallback(o),a=this.popupInstance.containerEventCoords(e),this.popupInstance.show(a.x+15,a.y+15).hideOnBlur((function(){r.dispatchExternal("TooltipClosed",t.getComponent()),r.popupInstance=null})),this.dispatchExternal("TooltipOpened",t.getComponent()))}}]),n}(V);Qe.moduleName="tooltip";var et={integer:function(e,t,i){return""===t||null==t||"number"==typeof(t=Number(t))&&isFinite(t)&&Math.floor(t)===t},float:function(e,t,i){return""===t||null==t||"number"==typeof(t=Number(t))&&isFinite(t)&&t%1!=0},numeric:function(e,t,i){return""===t||null==t||!isNaN(t)},string:function(e,t,i){return""===t||null==t||isNaN(t)},max:function(e,t,i){return""===t||null==t||parseFloat(t)<=i},min:function(e,t,i){return""===t||null==t||parseFloat(t)>=i},starts:function(e,t,i){return""===t||null==t||String(t).toLowerCase().startsWith(String(i).toLowerCase())},ends:function(e,t,i){return""===t||null==t||String(t).toLowerCase().endsWith(String(i).toLowerCase())},minLength:function(e,t,i){return""===t||null==t||String(t).length>=i},maxLength:function(e,t,i){return""===t||null==t||String(t).length<=i},in:function(e,t,i){return""===t||null==t||("string"==typeof i&&(i=i.split("|")),""===t||i.indexOf(t)>-1)},regex:function(e,t,i){return""===t||null==t||new RegExp(i).test(t)},unique:function(e,t,i){if(""===t||null==t)return!0;var n=!0,o=e.getData(),a=e.getColumn()._getSelf();return this.table.rowManager.rows.forEach((function(e){var i=e.getData();i!==o&&t==a.getFieldValue(i)&&(n=!1)})),n},required:function(e,t,i){return""!==t&&null!=t}},tt=function(i){a(r,i);var n=c(r);function r(e){var i;return t(this,r),(i=n.call(this,e)).invalidCells=[],i.registerTableOption("validationMode","blocking"),i.registerColumnOption("validator"),i.registerTableFunction("getInvalidCells",i.getInvalidCells.bind(l(i))),i.registerTableFunction("clearCellValidation",i.userClearCellValidation.bind(l(i))),i.registerTableFunction("validate",i.userValidate.bind(l(i))),i.registerComponentFunction("cell","isValid",i.cellIsValid.bind(l(i))),i.registerComponentFunction("cell","clearValidation",i.clearValidation.bind(l(i))),i.registerComponentFunction("cell","validate",i.cellValidate.bind(l(i))),i.registerComponentFunction("column","validate",i.columnValidate.bind(l(i))),i.registerComponentFunction("row","validate",i.rowValidate.bind(l(i))),i}return o(r,[{key:"initialize",value:function(){this.subscribe("cell-delete",this.clearValidation.bind(this)),this.subscribe("column-layout",this.initializeColumnCheck.bind(this)),this.subscribe("edit-success",this.editValidate.bind(this)),this.subscribe("edit-editor-clear",this.editorClear.bind(this)),this.subscribe("edit-edited-clear",this.editedClear.bind(this))}},{key:"editValidate",value:function(e,t,i){var n=this,o="manual"===this.table.options.validationMode||this.validate(e.column.modules.validate,e,t);return!0!==o&&setTimeout((function(){e.getElement().classList.add("tabulator-validation-fail"),n.dispatchExternal("validationFailed",e.getComponent(),t,o)})),o}},{key:"editorClear",value:function(e,t){t&&e.column.modules.validate&&this.cellValidate(e),e.getElement().classList.remove("tabulator-validation-fail")}},{key:"editedClear",value:function(e){e.modules.validate&&(e.modules.validate.invalid=!1)}},{key:"cellIsValid",value:function(e){return e.modules.validate&&e.modules.validate.invalid||!0}},{key:"cellValidate",value:function(e){return this.validate(e.column.modules.validate,e,e.getValue())}},{key:"columnValidate",value:function(e){var t=this,i=[];return e.cells.forEach((function(e){!0!==t.cellValidate(e)&&i.push(e.getComponent())})),!i.length||i}},{key:"rowValidate",value:function(e){var t=this,i=[];return e.cells.forEach((function(e){!0!==t.cellValidate(e)&&i.push(e.getComponent())})),!i.length||i}},{key:"userClearCellValidation",value:function(e){var t=this;e||(e=this.getInvalidCells()),Array.isArray(e)||(e=[e]),e.forEach((function(e){t.clearValidation(e._getSelf())}))}},{key:"userValidate",value:function(e){var t=[];return this.table.rowManager.rows.forEach((function(e){var i=(e=e.getComponent()).validate();!0!==i&&(t=t.concat(i))})),!t.length||t}},{key:"initializeColumnCheck",value:function(e){void 0!==e.definition.validator&&this.initializeColumn(e)}},{key:"initializeColumn",value:function(e){var t,i=this,n=[];e.definition.validator&&(Array.isArray(e.definition.validator)?e.definition.validator.forEach((function(e){(t=i._extractValidator(e))&&n.push(t)})):(t=this._extractValidator(e.definition.validator))&&n.push(t),e.modules.validate=!!n.length&&n)}},{key:"_extractValidator",value:function(t){var i,n,o;switch(e(t)){case"string":return(o=t.indexOf(":"))>-1?(i=t.substring(0,o),n=t.substring(o+1)):i=t,this._buildValidator(i,n);case"function":return this._buildValidator(t);case"object":return this._buildValidator(t.type,t.parameters)}}},{key:"_buildValidator",value:function(e,t){var i="function"==typeof e?e:r.validators[e];return i?{type:"function"==typeof e?"function":e,func:i,params:t}:(console.warn("Validator Setup Error - No matching validator found:",e),!1)}},{key:"validate",value:function(e,t,i){var n=this,o=[],a=this.invalidCells.indexOf(t);return e&&e.forEach((function(e){e.func.call(n,t.getComponent(),i,e.params)||o.push({type:e.type,parameters:e.params})})),t.modules.validate||(t.modules.validate={}),o.length?(t.modules.validate.invalid=o,"manual"!==this.table.options.validationMode&&t.getElement().classList.add("tabulator-validation-fail"),-1==a&&this.invalidCells.push(t)):(t.modules.validate.invalid=!1,t.getElement().classList.remove("tabulator-validation-fail"),a>-1&&this.invalidCells.splice(a,1)),!o.length||o}},{key:"getInvalidCells",value:function(){var e=[];return this.invalidCells.forEach((function(t){e.push(t.getComponent())})),e}},{key:"clearValidation",value:function(e){var t;e.modules.validate&&e.modules.validate.invalid&&(e.getElement().classList.remove("tabulator-validation-fail"),e.modules.validate.invalid=!1,(t=this.invalidCells.indexOf(e))>-1&&this.invalidCells.splice(t,1))}}]),r}(V);tt.moduleName="validate",tt.validators=et;var it=Object.freeze({__proto__:null,AccessorModule:$,AjaxModule:ne,ClipboardModule:oe,ColumnCalcsModule:se,DataTreeModule:le,DownloadModule:ce,EditModule:pe,ExportModule:ve,FilterModule:ye,FormatModule:Ce,FrozenColumnsModule:ke,FrozenRowsModule:Ee,GroupRowsModule:Te,HistoryModule:Me,HtmlTableImportModule:Le,ImportModule:Se,InteractionModule:Pe,KeybindingsModule:ze,MenuModule:Fe,MoveColumnsModule:He,MoveRowsModule:_e,MutatorModule:Oe,PageModule:Be,PersistenceModule:Ve,PopupModule:We,PrintModule:je,ReactiveDataModule:Ge,ResizeColumnsModule:Ue,ResizeRowsModule:Xe,ResizeTableModule:qe,ResponsiveLayoutModule:Ke,SelectRowModule:Je,SortModule:Ze,TooltipModule:Qe,ValidateModule:tt}),nt=function(e){a(n,e);var i=c(n);function n(){return t(this,n),i.apply(this,arguments)}return n}(Y);return new K(nt,it),nt})); //# sourceMappingURL=tabulator.min.js.map diff --git a/dist/js/tabulator.min.js.map b/dist/js/tabulator.min.js.map index 4ce91e20c..8f674c471 100644 --- a/dist/js/tabulator.min.js.map +++ b/dist/js/tabulator.min.js.map @@ -1 +1 @@ -{"version":3,"file":"tabulator.min.js","sources":["../../src/js/core/CoreFeature.js","../../src/js/core/column/ColumnComponent.js","../../src/js/core/column/defaults/options.js","../../src/js/core/cell/CellComponent.js","../../src/js/core/cell/Cell.js","../../src/js/core/column/Column.js","../../src/js/core/tools/Helpers.js","../../src/js/core/tools/OptionsList.js","../../src/js/core/rendering/Renderer.js","../../src/js/core/rendering/renderers/BasicHorizontal.js","../../src/js/core/rendering/renderers/VirtualDomHorizontal.js","../../src/js/core/ColumnManager.js","../../src/js/core/row/RowComponent.js","../../src/js/core/row/Row.js","../../src/js/core/rendering/renderers/BasicVertical.js","../../src/js/core/rendering/renderers/VirtualDomVertical.js","../../src/js/core/RowManager.js","../../src/js/core/FooterManager.js","../../src/js/core/tools/InteractionMonitor.js","../../src/js/core/tools/ComponentFunctionBinder.js","../../src/js/core/tools/DataLoader.js","../../src/js/core/tools/ExternalEventBus.js","../../src/js/core/tools/InternalEventBus.js","../../src/js/core/tools/TableRegistry.js","../../src/js/core/tools/Popup.js","../../src/js/core/Module.js","../../src/js/modules/Layout/defaults/modes/fitDataGeneral.js","../../src/js/modules/Layout/defaults/modes.js","../../src/js/modules/Layout/defaults/modes/fitData.js","../../src/js/modules/Layout/defaults/modes/fitDataStretch.js","../../src/js/modules/Layout/defaults/modes/fitColumns.js","../../src/js/modules/Layout/Layout.js","../../src/js/modules/Localize/Localize.js","../../src/js/modules/Localize/defaults/langs.js","../../src/js/modules/Comms/Comms.js","../../src/js/core/tools/ModuleBinder.js","../../src/js/core/tools/Alert.js","../../src/js/core/Tabulator.js","../../src/js/core/defaults/options.js","../../src/js/modules/Accessor/Accessor.js","../../src/js/modules/Accessor/defaults/accessors.js","../../src/js/modules/Ajax/defaults/urlGenerator.js","../../src/js/modules/Ajax/defaults/contentTypeFormatters.js","../../src/js/modules/Ajax/Ajax.js","../../src/js/modules/Ajax/defaults/config.js","../../src/js/modules/Ajax/defaults/loaderPromise.js","../../src/js/modules/Clipboard/Clipboard.js","../../src/js/modules/Clipboard/defaults/pasteActions.js","../../src/js/modules/Clipboard/defaults/pasteParsers.js","../../src/js/modules/ColumnCalcs/CalcComponent.js","../../src/js/modules/ColumnCalcs/defaults/calculations.js","../../src/js/modules/ColumnCalcs/ColumnCalcs.js","../../src/js/modules/DataTree/DataTree.js","../../src/js/modules/Download/defaults/downloaders.js","../../src/js/modules/Download/defaults/downloaders/csv.js","../../src/js/modules/Download/defaults/downloaders/json.js","../../src/js/modules/Download/defaults/downloaders/jsonLines.js","../../src/js/modules/Download/defaults/downloaders/pdf.js","../../src/js/modules/Download/defaults/downloaders/xlsx.js","../../src/js/modules/Download/defaults/downloaders/html.js","../../src/js/modules/Download/Download.js","../../src/js/modules/Edit/inputMask.js","../../src/js/modules/Edit/List.js","../../src/js/modules/Edit/defaults/editors.js","../../src/js/modules/Edit/defaults/editors/input.js","../../src/js/modules/Edit/defaults/editors/textarea.js","../../src/js/modules/Edit/defaults/editors/number.js","../../src/js/modules/Edit/defaults/editors/range.js","../../src/js/modules/Edit/defaults/editors/select.js","../../src/js/modules/Edit/defaults/editors/list.js","../../src/js/modules/Edit/defaults/editors/autocomplete.js","../../src/js/modules/Edit/defaults/editors/star.js","../../src/js/modules/Edit/defaults/editors/progress.js","../../src/js/modules/Edit/defaults/editors/tickCross.js","../../src/js/modules/Edit/Edit.js","../../src/js/modules/Export/ExportRow.js","../../src/js/modules/Export/ExportColumn.js","../../src/js/modules/Export/Export.js","../../src/js/modules/Filter/defaults/filters.js","../../src/js/modules/Filter/Filter.js","../../src/js/modules/Format/defaults/formatters.js","../../src/js/modules/Format/defaults/formatters/plaintext.js","../../src/js/modules/Format/defaults/formatters/html.js","../../src/js/modules/Format/defaults/formatters/textarea.js","../../src/js/modules/Format/defaults/formatters/money.js","../../src/js/modules/Format/defaults/formatters/link.js","../../src/js/modules/Format/defaults/formatters/image.js","../../src/js/modules/Format/defaults/formatters/tickCross.js","../../src/js/modules/Format/defaults/formatters/datetime.js","../../src/js/modules/Format/defaults/formatters/datetimediff.js","../../src/js/modules/Format/defaults/formatters/lookup.js","../../src/js/modules/Format/defaults/formatters/star.js","../../src/js/modules/Format/defaults/formatters/traffic.js","../../src/js/modules/Format/defaults/formatters/progress.js","../../src/js/modules/Format/defaults/formatters/color.js","../../src/js/modules/Format/defaults/formatters/buttonTick.js","../../src/js/modules/Format/defaults/formatters/buttonCross.js","../../src/js/modules/Format/defaults/formatters/rownum.js","../../src/js/modules/Format/defaults/formatters/handle.js","../../src/js/modules/Format/defaults/formatters/responsiveCollapse.js","../../src/js/modules/Format/defaults/formatters/rowSelection.js","../../src/js/modules/Format/Format.js","../../src/js/modules/FrozenColumns/FrozenColumns.js","../../src/js/modules/FrozenRows/FrozenRows.js","../../src/js/modules/GroupRows/GroupComponent.js","../../src/js/modules/GroupRows/Group.js","../../src/js/modules/GroupRows/GroupRows.js","../../src/js/modules/History/History.js","../../src/js/modules/History/defaults/undoers.js","../../src/js/modules/History/defaults/redoers.js","../../src/js/modules/HtmlTableImport/HtmlTableImport.js","../../src/js/modules/Import/defaults/importers.js","../../src/js/modules/Import/defaults/importers/csv.js","../../src/js/modules/Import/defaults/importers/json.js","../../src/js/modules/Import/Import.js","../../src/js/modules/Interaction/Interaction.js","../../src/js/modules/Keybindings/Keybindings.js","../../src/js/modules/Keybindings/defaults/bindings.js","../../src/js/modules/Keybindings/defaults/actions.js","../../src/js/modules/Menu/Menu.js","../../src/js/modules/MoveColumns/MoveColumns.js","../../src/js/modules/MoveRows/MoveRows.js","../../src/js/modules/Mutator/Mutator.js","../../src/js/modules/Mutator/defaults/mutators.js","../../src/js/modules/Page/defaults/pageCounters.js","../../src/js/modules/Page/defaults/pageCounters/rows.js","../../src/js/modules/Page/defaults/pageCounters/pages.js","../../src/js/modules/Page/Page.js","../../src/js/modules/Persistence/defaults/readers.js","../../src/js/modules/Persistence/defaults/writers.js","../../src/js/modules/Persistence/Persistence.js","../../src/js/modules/Popup/Popup.js","../../src/js/modules/Print/Print.js","../../src/js/modules/ReactiveData/ReactiveData.js","../../src/js/modules/ResizeColumns/ResizeColumns.js","../../src/js/modules/ResizeRows/ResizeRows.js","../../src/js/modules/ResizeTable/ResizeTable.js","../../src/js/modules/ResponsiveLayout/ResponsiveLayout.js","../../src/js/modules/SelectRow/SelectRow.js","../../src/js/modules/Sort/defaults/sorters/datetime.js","../../src/js/modules/Sort/defaults/sorters.js","../../src/js/modules/Sort/defaults/sorters/number.js","../../src/js/modules/Sort/defaults/sorters/string.js","../../src/js/modules/Sort/defaults/sorters/date.js","../../src/js/modules/Sort/defaults/sorters/time.js","../../src/js/modules/Sort/defaults/sorters/boolean.js","../../src/js/modules/Sort/defaults/sorters/array.js","../../src/js/modules/Sort/defaults/sorters/exists.js","../../src/js/modules/Sort/defaults/sorters/alphanum.js","../../src/js/modules/Sort/Sort.js","../../src/js/modules/Tooltip/Tooltip.js","../../src/js/modules/Validate/defaults/validators.js","../../src/js/modules/Validate/Validate.js","../../src/js/core/TabulatorFull.js"],"sourcesContent":["export default class CoreFeature{\r\n\r\n\tconstructor(table){\r\n\t\tthis.table = table;\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t/////////////// DataLoad /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\treloadData(data, silent, columnsChanged){\r\n\t\treturn this.table.dataLoader.load(data, undefined, undefined, undefined, silent, columnsChanged);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t///////////// Localization ///////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tlangText(){\r\n\t\treturn this.table.modules.localize.getText(...arguments);\r\n\t}\r\n\r\n\tlangBind(){\r\n\t\treturn this.table.modules.localize.bind(...arguments);\r\n\t}\r\n\r\n\tlangLocale(){\r\n\t\treturn this.table.modules.localize.getLocale(...arguments);\r\n\t}\r\n\r\n\r\n\t//////////////////////////////////////////\r\n\t////////// Inter Table Comms /////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tcommsConnections(){\r\n\t\treturn this.table.modules.comms.getConnections(...arguments);\r\n\t}\r\n\r\n\tcommsSend(){\r\n\t\treturn this.table.modules.comms.send(...arguments);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t//////////////// Layout /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tlayoutMode(){\r\n\t\treturn this.table.modules.layout.getMode();\r\n\t}\r\n\r\n\tlayoutRefresh(){\r\n\t\treturn this.table.modules.layout.layout();\r\n\t}\r\n\r\n\r\n\t//////////////////////////////////////////\r\n\t/////////////// Event Bus ////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tsubscribe(){\r\n\t\treturn this.table.eventBus.subscribe(...arguments);\r\n\t}\r\n\r\n\tunsubscribe(){\r\n\t\treturn this.table.eventBus.unsubscribe(...arguments);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.table.eventBus.subscribed(key);\r\n\t}\r\n\r\n\tsubscriptionChange(){\r\n\t\treturn this.table.eventBus.subscriptionChange(...arguments);\r\n\t}\r\n\r\n\tdispatch(){\r\n\t\treturn this.table.eventBus.dispatch(...arguments);\r\n\t}\r\n\r\n\tchain(){\r\n\t\treturn this.table.eventBus.chain(...arguments);\r\n\t}\r\n\r\n\tconfirm(){\r\n\t\treturn this.table.eventBus.confirm(...arguments);\r\n\t}\r\n\r\n\tdispatchExternal(){\r\n\t\treturn this.table.externalEvents.dispatch(...arguments);\r\n\t}\r\n\r\n\tsubscribedExternal(key){\r\n\t\treturn this.table.externalEvents.subscribed(key);\r\n\t}\r\n\r\n\tsubscriptionChangeExternal(){\r\n\t\treturn this.table.externalEvents.subscriptionChange(...arguments);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t//////////////// Options /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\toptions(key){\r\n\t\treturn this.table.options[key];\r\n\t}\r\n\r\n\tsetOption(key, value){\r\n\t\tif(typeof value !== \"undefined\"){\r\n\t\t\tthis.table.options[key] = value;\r\n\t\t}\r\n\r\n\t\treturn this.table.options[key];\r\n\t}\r\n\r\n\r\n\t//////////////////////////////////////////\r\n\t//////////////// Modules /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tmodule(key){\r\n\t\treturn this.table.module(key);\r\n\t}\r\n}","import Column from './Column.js';\r\n\r\n//public column object\r\nexport default class ColumnComponent {\r\n\tconstructor (column){\r\n\t\tthis._column = column;\r\n\t\tthis.type = \"ColumnComponent\";\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._column.table.componentFunctionBinder.handle(\"column\", target._column, name)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._column.getElement();\r\n\t}\r\n\r\n\tgetDefinition(){\r\n\t\treturn this._column.getDefinition();\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._column.getField();\r\n\t}\r\n\r\n\tgetTitleDownload() {\r\n\t\treturn this._column.getTitleDownload();\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._column.cells.forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tisVisible(){\r\n\t\treturn this._column.visible;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tif(this._column.isGroup){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\tcolumn.show();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis._column.show();\r\n\t\t}\r\n\t}\r\n\r\n\thide(){\r\n\t\tif(this._column.isGroup){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\tcolumn.hide();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis._column.hide();\r\n\t\t}\r\n\t}\r\n\r\n\ttoggle(){\r\n\t\tif(this._column.visible){\r\n\t\t\tthis.hide();\r\n\t\t}else{\r\n\t\t\tthis.show();\r\n\t\t}\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn this._column.delete();\r\n\t}\r\n\r\n\tgetSubColumns(){\r\n\t\tvar output = [];\r\n\r\n\t\tif(this._column.columns.length){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\toutput.push(column.getComponent());\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetParentColumn(){\r\n\t\treturn this._column.parent instanceof Column ? this._column.parent.getComponent() : false;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._column;\r\n\t}\r\n\r\n\tscrollTo(){\r\n\t\treturn this._column.table.columnManager.scrollToColumn(this._column);\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._column.table;\r\n\t}\r\n\r\n\tmove(to, after){\r\n\t\tvar toColumn = this._column.table.columnManager.findColumn(to);\r\n\r\n\t\tif(toColumn){\r\n\t\t\tthis._column.table.columnManager.moveColumn(this._column, toColumn, after)\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching column found:\", toColumn);\r\n\t\t}\r\n\t}\r\n\r\n\tgetNextColumn(){\r\n\t\tvar nextCol = this._column.nextColumn();\r\n\r\n\t\treturn nextCol ? nextCol.getComponent() : false;\r\n\t}\r\n\r\n\tgetPrevColumn(){\r\n\t\tvar prevCol = this._column.prevColumn();\r\n\r\n\t\treturn prevCol ? prevCol.getComponent() : false;\r\n\t}\r\n\r\n\tupdateDefinition(updates){\r\n\t\treturn this._column.updateDefinition(updates);\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\treturn this._column.getWidth();\r\n\t}\r\n\r\n\tsetWidth(width){\r\n\t\tvar result;\r\n\r\n\t\tif(width === true){\r\n\t\t\tresult = this._column.reinitializeWidth(true);\r\n\t\t}else{\r\n\t\t\tresult = this._column.setWidth(width);\r\n\t\t}\r\n\r\n\t\tthis._column.table.columnManager.renderer.rerenderColumns(true);\r\n\r\n\t\treturn result;\r\n\t}\r\n}","export default {\r\n\t\"title\": undefined,\r\n\t\"field\": undefined,\r\n\t\"columns\": undefined,\r\n\t\"visible\": undefined,\r\n\t\"hozAlign\": undefined,\r\n\t\"vertAlign\": undefined,\r\n\t\"width\": undefined,\r\n\t\"minWidth\": 40,\r\n\t\"maxWidth\": undefined,\r\n\t\"maxInitialWidth\": undefined,\r\n\t\"cssClass\": undefined,\r\n\t\"variableHeight\": undefined,\r\n\t\"headerVertical\": undefined,\r\n\t\"headerHozAlign\": undefined,\r\n\t\"editableTitle\": undefined,\r\n}","//public cell object\r\nexport default class CellComponent {\r\n\r\n\tconstructor (cell){\r\n\t\tthis._cell = cell;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._cell.table.componentFunctionBinder.handle(\"cell\", target._cell, name)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\tgetValue(){\r\n\t\treturn this._cell.getValue();\r\n\t}\r\n\r\n\tgetOldValue(){\r\n\t\treturn this._cell.getOldValue();\r\n\t}\r\n\r\n\tgetInitialValue(){\r\n\t\treturn this._cell.initialValue;\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._cell.getElement();\r\n\t}\r\n\r\n\tgetRow(){\r\n\t\treturn this._cell.row.getComponent();\r\n\t}\r\n\r\n\tgetData(){\r\n\t\treturn this._cell.row.getData();\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._cell.column.getField();\r\n\t}\r\n\r\n\tgetColumn(){\r\n\t\treturn this._cell.column.getComponent();\r\n\t}\r\n\r\n\tsetValue(value, mutate){\r\n\t\tif(typeof mutate == \"undefined\"){\r\n\t\t\tmutate = true;\r\n\t\t}\r\n\r\n\t\tthis._cell.setValue(value, mutate);\r\n\t}\r\n\r\n\trestoreOldValue(){\r\n\t\tthis._cell.setValueActual(this._cell.getOldValue());\r\n\t}\r\n\r\n\trestoreInitialValue(){\r\n\t\tthis._cell.setValueActual(this._cell.initialValue);\r\n\t}\r\n\r\n\tcheckHeight(){\r\n\t\tthis._cell.checkHeight();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._cell.table;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._cell;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport CellComponent from './CellComponent.js';\r\n\r\nexport default class Cell extends CoreFeature{\r\n\tconstructor(column, row){\r\n\t\tsuper(column.table);\r\n\r\n\t\tthis.table = column.table;\r\n\t\tthis.column = column;\r\n\t\tthis.row = row;\r\n\t\tthis.element = null;\r\n\t\tthis.value = null;\r\n\t\tthis.initialValue;\r\n\t\tthis.oldValue = null;\r\n\t\tthis.modules = {};\r\n\r\n\t\tthis.height = null;\r\n\t\tthis.width = null;\r\n\t\tthis.minWidth = null;\r\n\r\n\t\tthis.component = null;\r\n\r\n\t\tthis.loaded = false; //track if the cell has been added to the DOM yet\r\n\r\n\t\tthis.build();\r\n\t}\r\n\r\n\t//////////////// Setup Functions /////////////////\r\n\t//generate element\r\n\tbuild(){\r\n\t\tthis.generateElement();\r\n\r\n\t\tthis.setWidth();\r\n\r\n\t\tthis._configureCell();\r\n\r\n\t\tthis.setValueActual(this.column.getFieldValue(this.row.data));\r\n\r\n\t\tthis.initialValue = this.value;\r\n\t}\r\n\r\n\tgenerateElement(){\r\n\t\tthis.element = document.createElement('div');\r\n\t\tthis.element.className = \"tabulator-cell\";\r\n\t\tthis.element.setAttribute(\"role\", \"gridcell\");\r\n\t\tthis.element = this.element;\r\n\t}\r\n\r\n\t_configureCell(){\r\n\t\tvar element = this.element,\r\n\t\tfield = this.column.getField(),\r\n\t\tvertAligns = {\r\n\t\t\ttop:\"flex-start\",\r\n\t\t\tbottom:\"flex-end\",\r\n\t\t\tmiddle:\"center\",\r\n\t\t},\r\n\t\thozAligns = {\r\n\t\t\tleft:\"flex-start\",\r\n\t\t\tright:\"flex-end\",\r\n\t\t\tcenter:\"center\",\r\n\t\t};\r\n\r\n\t\t//set text alignment\r\n\t\telement.style.textAlign = this.column.hozAlign;\r\n\r\n\t\tif(this.column.vertAlign){\r\n\t\t\telement.style.display = \"inline-flex\";\r\n\r\n\t\t\telement.style.alignItems = vertAligns[this.column.vertAlign] || \"\";\r\n\r\n\t\t\tif(this.column.hozAlign){\r\n\t\t\t\telement.style.justifyContent = hozAligns[this.column.hozAlign] || \"\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(field){\r\n\t\t\telement.setAttribute(\"tabulator-field\", field);\r\n\t\t}\r\n\r\n\t\t//add class to cell if needed\r\n\t\tif(this.column.definition.cssClass){\r\n\t\t\tvar classNames = this.column.definition.cssClass.split(\" \")\r\n\t\t\tclassNames.forEach((className) => {\r\n\t\t\t\telement.classList.add(className)\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"cell-init\", this);\r\n\r\n\t\t//hide cell if not visible\r\n\t\tif(!this.column.visible){\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\t//generate cell contents\r\n\t_generateContents(){\r\n\t\tvar val;\r\n\r\n\t\tval = this.chain(\"cell-format\", this, null, () => {\r\n\t\t\treturn this.element.innerHTML = this.value;\r\n\t\t});\r\n\r\n\t\tswitch(typeof val){\r\n\t\t\tcase \"object\":\r\n\t\t\tif(val instanceof Node){\r\n\r\n\t\t\t\t//clear previous cell contents\r\n\t\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\r\n\t\t\t\tthis.element.appendChild(val);\r\n\t\t\t}else{\r\n\t\t\t\tthis.element.innerHTML = \"\";\r\n\r\n\t\t\t\tif(val != null){\r\n\t\t\t\t\tconsole.warn(\"Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:\", val);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\tcase \"undefined\":\r\n\t\t\tcase \"null\":\r\n\t\t\tthis.element.innerHTML = \"\";\r\n\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\tthis.element.innerHTML = val;\r\n\t\t}\r\n\t}\r\n\r\n\tcellRendered(){\r\n\t\tthis.dispatch(\"cell-rendered\", this);\r\n\t}\r\n\r\n\t//////////////////// Getters ////////////////////\r\n\tgetElement(containerOnly){\r\n\t\tif(!this.loaded){\r\n\t\t\tthis.loaded = true;\r\n\t\t\tif(!containerOnly){\r\n\t\t\t\tthis.layoutElement();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\tgetValue(){\r\n\t\treturn this.value;\r\n\t}\r\n\r\n\tgetOldValue(){\r\n\t\treturn this.oldValue;\r\n\t}\r\n\r\n\t//////////////////// Actions ////////////////////\r\n\tsetValue(value, mutate, force){\r\n\t\tvar changed = this.setValueProcessData(value, mutate, force);\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.dispatch(\"cell-value-updated\", this);\r\n\r\n\t\t\tthis.cellRendered();\r\n\r\n\t\t\tif(this.column.definition.cellEdited){\r\n\t\t\t\tthis.column.definition.cellEdited.call(this.table, this.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"cellEdited\", this.getComponent());\r\n\r\n\t\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tsetValueProcessData(value, mutate, force){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(this.value !== value || force){\r\n\r\n\t\t\tchanged = true;\r\n\r\n\t\t\tif(mutate){\r\n\t\t\t\tvalue = this.chain(\"cell-value-changing\", [this, value], null, value);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.setValueActual(value);\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.dispatch(\"cell-value-changed\", this);\r\n\t\t}\r\n\r\n\t\treturn changed;\r\n\t}\r\n\r\n\tsetValueActual(value){\r\n\t\tthis.oldValue = this.value;\r\n\r\n\t\tthis.value = value;\r\n\r\n\t\tthis.dispatch(\"cell-value-save-before\", this);\r\n\r\n\t\tthis.column.setFieldValue(this.row.data, value);\r\n\r\n\t\tthis.dispatch(\"cell-value-save-after\", this);\r\n\r\n\t\tif(this.loaded){\r\n\t\t\tthis.layoutElement();\r\n\t\t}\r\n\t}\r\n\r\n\tlayoutElement(){\r\n\t\tthis._generateContents();\r\n\r\n\t\tthis.dispatch(\"cell-layout\", this);\r\n\t}\r\n\r\n\tsetWidth(){\r\n\t\tthis.width = this.column.width;\r\n\t\tthis.element.style.width = this.column.widthStyled;\r\n\t}\r\n\r\n\tclearWidth(){\r\n\t\tthis.width = \"\";\r\n\t\tthis.element.style.width = \"\";\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\treturn this.width || this.element.offsetWidth;\r\n\t}\r\n\r\n\tsetMinWidth(){\r\n\t\tthis.minWidth = this.column.minWidth;\r\n\t\tthis.element.style.minWidth = this.column.minWidthStyled;\r\n\t}\r\n\r\n\tsetMaxWidth(){\r\n\t\tthis.maxWidth = this.column.maxWidth;\r\n\t\tthis.element.style.maxWidth = this.column.maxWidthStyled;\r\n\t}\r\n\r\n\tcheckHeight(){\r\n\t\t// var height = this.element.css(\"height\");\r\n\t\tthis.row.reinitializeHeight();\r\n\t}\r\n\r\n\tclearHeight(){\r\n\t\tthis.element.style.height = \"\";\r\n\t\tthis.height = null;\r\n\r\n\t\tthis.dispatch(\"cell-height\", this, \"\");\r\n\t}\r\n\r\n\tsetHeight(){\r\n\t\tthis.height = this.row.height;\r\n\t\tthis.element.style.height = this.row.heightStyled;\r\n\r\n\t\tthis.dispatch(\"cell-height\", this, this.row.heightStyled);\r\n\t}\r\n\r\n\tgetHeight(){\r\n\t\treturn this.height || this.element.offsetHeight;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tthis.element.style.display = this.column.vertAlign ? \"inline-flex\" : \"\";\r\n\t}\r\n\r\n\thide(){\r\n\t\tthis.element.style.display = \"none\";\r\n\t}\r\n\r\n\tdelete(){\r\n\t\tthis.dispatch(\"cell-delete\", this);\r\n\r\n\t\tif(!this.table.rowManager.redrawBlock && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\r\n\t\tthis.element = false;\r\n\t\tthis.column.deleteCell(this);\r\n\t\tthis.row.deleteCell(this);\r\n\t\tthis.calcs = {};\r\n\t}\r\n\r\n\tgetIndex(){\r\n\t\treturn this.row.getCellIndex(this);\r\n\t}\r\n\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new CellComponent(this);\r\n\t\t}\r\n\r\n\t\treturn this.component;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport ColumnComponent from './ColumnComponent.js';\r\nimport defaultOptions from './defaults/options.js';\r\n\r\nimport Cell from '../cell/Cell.js';\r\n\r\nclass Column extends CoreFeature{\r\n\r\n\tconstructor(def, parent){\r\n\t\tsuper(parent.table);\r\n\r\n\t\tthis.definition = def; //column definition\r\n\t\tthis.parent = parent; //hold parent object\r\n\t\tthis.type = \"column\"; //type of element\r\n\t\tthis.columns = []; //child columns\r\n\t\tthis.cells = []; //cells bound to this column\r\n\t\tthis.element = this.createElement(); //column header element\r\n\t\tthis.contentElement = false;\r\n\t\tthis.titleHolderElement = false;\r\n\t\tthis.titleElement = false;\r\n\t\tthis.groupElement = this.createGroupElement(); //column group holder element\r\n\t\tthis.isGroup = false;\r\n\t\tthis.hozAlign = \"\"; //horizontal text alignment\r\n\t\tthis.vertAlign = \"\"; //vert text alignment\r\n\r\n\t\t//multi dimensional filed handling\r\n\t\tthis.field =\"\";\r\n\t\tthis.fieldStructure = \"\";\r\n\t\tthis.getFieldValue = \"\";\r\n\t\tthis.setFieldValue = \"\";\r\n\r\n\t\tthis.titleDownload = null;\r\n\t\tthis.titleFormatterRendered = false;\r\n\r\n\t\tthis.mapDefinitions();\r\n\r\n\t\tthis.setField(this.definition.field);\r\n\r\n\t\tthis.modules = {}; //hold module variables;\r\n\r\n\t\tthis.width = null; //column width\r\n\t\tthis.widthStyled = \"\"; //column width prestyled to improve render efficiency\r\n\t\tthis.maxWidth = null; //column maximum width\r\n\t\tthis.maxWidthStyled = \"\"; //column maximum prestyled to improve render efficiency\r\n\t\tthis.maxInitialWidth = null;\r\n\t\tthis.minWidth = null; //column minimum width\r\n\t\tthis.minWidthStyled = \"\"; //column minimum prestyled to improve render efficiency\r\n\t\tthis.widthFixed = false; //user has specified a width for this column\r\n\r\n\t\tthis.visible = true; //default visible state\r\n\r\n\t\tthis.component = null;\r\n\r\n\t\t//initialize column\r\n\t\tif(this.definition.columns){\r\n\r\n\t\t\tthis.isGroup = true;\r\n\r\n\t\t\tthis.definition.columns.forEach((def, i) => {\r\n\t\t\t\tvar newCol = new Column(def, this);\r\n\t\t\t\tthis.attachColumn(newCol);\r\n\t\t\t});\r\n\r\n\t\t\tthis.checkColumnVisibility();\r\n\t\t}else{\r\n\t\t\tparent.registerColumnField(this);\r\n\t\t}\r\n\r\n\t\tthis._initialize();\r\n\r\n\t\tthis.bindModuleColumns();\r\n\t}\r\n\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-col\");\r\n\t\tel.setAttribute(\"role\", \"columnheader\");\r\n\t\tel.setAttribute(\"aria-sort\", \"none\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tcreateGroupElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-col-group-cols\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tmapDefinitions(){\r\n\t\tvar defaults = this.table.options.columnDefaults;\r\n\r\n\t\t//map columnDefaults onto column definitions\r\n\t\tif(defaults){\r\n\t\t\tfor(let key in defaults){\r\n\t\t\t\tif(typeof this.definition[key] === \"undefined\"){\r\n\t\t\t\t\tthis.definition[key] = defaults[key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.definition = this.table.columnManager.optionsList.generate(Column.defaultOptionList, this.definition)\r\n\t}\r\n\r\n\tcheckDefinition(){\r\n\t\tObject.keys(this.definition).forEach((key) => {\r\n\t\t\tif(Column.defaultOptionList.indexOf(key) === -1){\r\n\t\t\t\tconsole.warn(\"Invalid column definition option in '\" + (this.field || this.definition.title) + \"' column:\", key)\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tsetField(field){\r\n\t\tthis.field = field;\r\n\t\tthis.fieldStructure = field ? (this.table.options.nestedFieldSeparator ? field.split(this.table.options.nestedFieldSeparator) : [field]) : [];\r\n\t\tthis.getFieldValue = this.fieldStructure.length > 1 ? this._getNestedData : this._getFlatData;\r\n\t\tthis.setFieldValue = this.fieldStructure.length > 1 ? this._setNestedData : this._setFlatData;\r\n\t}\r\n\r\n\t//register column position with column manager\r\n\tregisterColumnPosition(column){\r\n\t\tthis.parent.registerColumnPosition(column);\r\n\t}\r\n\r\n\t//register column position with column manager\r\n\tregisterColumnField(column){\r\n\t\tthis.parent.registerColumnField(column);\r\n\t}\r\n\r\n\t//trigger position registration\r\n\treRegisterPosition(){\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tcolumn.reRegisterPosition();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.registerColumnPosition(this);\r\n\t\t}\r\n\t}\r\n\r\n\t_mapDepricatedFunctionality(){\r\n\t\t//all previously deprecated functionality removed in the 5.0 release\r\n\t}\r\n\r\n\t//build header element\r\n\t_initialize(){\r\n\t\tvar def = this.definition;\r\n\r\n\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\r\n\t\tif(def.headerVertical){\r\n\t\t\tthis.element.classList.add(\"tabulator-col-vertical\");\r\n\r\n\t\t\tif(def.headerVertical === \"flip\"){\r\n\t\t\t\tthis.element.classList.add(\"tabulator-col-vertical-flip\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.contentElement = this._bindEvents();\r\n\r\n\t\tthis.contentElement = this._buildColumnHeaderContent();\r\n\r\n\t\tthis.element.appendChild(this.contentElement);\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis._buildGroupHeader();\r\n\t\t}else{\r\n\t\t\tthis._buildColumnHeader();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-init\", this);\r\n\t}\r\n\r\n\t_bindEvents(){\r\n\t\tvar def = this.definition,\r\n\t\tdblTap,\ttapHold, tap;\r\n\r\n\t\t//setup header click event bindings\r\n\t\tif(typeof(def.headerClick) == \"function\"){\r\n\t\t\tthis.element.addEventListener(\"click\", (e) => {def.headerClick(e, this.getComponent());});\r\n\t\t}\r\n\r\n\t\tif(typeof(def.headerDblClick) == \"function\"){\r\n\t\t\tthis.element.addEventListener(\"dblclick\", (e) => {def.headerDblClick(e, this.getComponent());});\r\n\t\t}\r\n\r\n\t\tif(typeof(def.headerContext) == \"function\"){\r\n\t\t\tthis.element.addEventListener(\"contextmenu\", (e) => {def.headerContext(e, this.getComponent());});\r\n\t\t}\r\n\r\n\t\t//setup header tap event bindings\r\n\t\tif(typeof(def.headerTap) == \"function\"){\r\n\t\t\ttap = false;\r\n\r\n\t\t\tthis.element.addEventListener(\"touchstart\", (e) => {\r\n\t\t\t\ttap = true;\r\n\t\t\t}, {passive: true});\r\n\r\n\t\t\tthis.element.addEventListener(\"touchend\", (e) => {\r\n\t\t\t\tif(tap){\r\n\t\t\t\t\tdef.headerTap(e, this.getComponent());\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttap = false;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(typeof(def.headerDblTap) == \"function\"){\r\n\t\t\tdblTap = null;\r\n\r\n\t\t\tthis.element.addEventListener(\"touchend\", (e) => {\r\n\r\n\t\t\t\tif(dblTap){\r\n\t\t\t\t\tclearTimeout(dblTap);\r\n\t\t\t\t\tdblTap = null;\r\n\r\n\t\t\t\t\tdef.headerDblTap(e, this.getComponent());\r\n\t\t\t\t}else{\r\n\r\n\t\t\t\t\tdblTap = setTimeout(() => {\r\n\t\t\t\t\t\tclearTimeout(dblTap);\r\n\t\t\t\t\t\tdblTap = null;\r\n\t\t\t\t\t}, 300);\r\n\t\t\t\t}\r\n\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(typeof(def.headerTapHold) == \"function\"){\r\n\t\t\ttapHold = null;\r\n\r\n\t\t\tthis.element.addEventListener(\"touchstart\", (e) => {\r\n\t\t\t\tclearTimeout(tapHold);\r\n\r\n\t\t\t\ttapHold = setTimeout(function(){\r\n\t\t\t\t\tclearTimeout(tapHold);\r\n\t\t\t\t\ttapHold = null;\r\n\t\t\t\t\ttap = false;\r\n\t\t\t\t\tdef.headerTapHold(e, this.getComponent());\r\n\t\t\t\t}, 1000);\r\n\r\n\t\t\t}, {passive: true});\r\n\r\n\t\t\tthis.element.addEventListener(\"touchend\", (e) => {\r\n\t\t\t\tclearTimeout(tapHold);\r\n\t\t\t\ttapHold = null;\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t//build header element for header\r\n\t_buildColumnHeader(){\r\n\t\tvar def = this.definition,\r\n\t\ttable = this.table;\r\n\r\n\t\tthis.dispatch(\"column-layout\", this);\r\n\r\n\t\t//set column visibility\r\n\t\tif(typeof def.visible != \"undefined\"){\r\n\t\t\tif(def.visible){\r\n\t\t\t\tthis.show(true);\r\n\t\t\t}else{\r\n\t\t\t\tthis.hide(true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//asign additional css classes to column header\r\n\t\tif(def.cssClass){\r\n\t\t\tvar classeNames = def.cssClass.split(\" \");\r\n\t\t\tclasseNames.forEach((className) => {\r\n\t\t\t\tthis.element.classList.add(className);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(def.field){\r\n\t\t\tthis.element.setAttribute(\"tabulator-field\", def.field);\r\n\t\t}\r\n\r\n\t\t//set min width if present\r\n\t\tthis.setMinWidth(parseInt(def.minWidth));\r\n\r\n\t\tif (def.maxInitialWidth) {\r\n\t\t\tthis.maxInitialWidth = parseInt(def.maxInitialWidth);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.maxWidth){\r\n\t\t\tthis.setMaxWidth(parseInt(def.maxWidth));\r\n\t\t}\r\n\r\n\t\tthis.reinitializeWidth();\r\n\r\n\t\t//set orizontal text alignment\r\n\t\tthis.hozAlign = this.definition.hozAlign;\r\n\t\tthis.vertAlign = this.definition.vertAlign;\r\n\r\n\t\tthis.titleElement.style.textAlign = this.definition.headerHozAlign;\r\n\t}\r\n\r\n\t_buildColumnHeaderContent(){\r\n\t\tvar def = this.definition,\r\n\t\ttable = this.table;\r\n\r\n\t\tvar contentElement = document.createElement(\"div\");\r\n\t\tcontentElement.classList.add(\"tabulator-col-content\");\r\n\r\n\t\tthis.titleHolderElement = document.createElement(\"div\");\r\n\t\tthis.titleHolderElement.classList.add(\"tabulator-col-title-holder\");\r\n\r\n\t\tcontentElement.appendChild(this.titleHolderElement);\r\n\r\n\t\tthis.titleElement = this._buildColumnHeaderTitle();\r\n\r\n\t\tthis.titleHolderElement.appendChild(this.titleElement);\r\n\r\n\t\treturn contentElement;\r\n\t}\r\n\r\n\t//build title element of column\r\n\t_buildColumnHeaderTitle(){\r\n\t\tvar def = this.definition,\r\n\t\ttitle;\r\n\r\n\t\tvar titleHolderElement = document.createElement(\"div\");\r\n\t\ttitleHolderElement.classList.add(\"tabulator-col-title\");\r\n\r\n\t\tif(def.editableTitle){\r\n\t\t\tvar titleElement = document.createElement(\"input\");\r\n\t\t\ttitleElement.classList.add(\"tabulator-title-editor\");\r\n\r\n\t\t\ttitleElement.addEventListener(\"click\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\ttitleElement.focus();\r\n\t\t\t});\r\n\r\n\t\t\ttitleElement.addEventListener(\"change\", () => {\r\n\t\t\t\tdef.title = titleElement.value;\r\n\t\t\t\tthis.dispatchExternal(\"columnTitleChanged\", this.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\ttitleHolderElement.appendChild(titleElement);\r\n\r\n\t\t\tif(def.field){\r\n\t\t\t\tthis.langBind(\"columns|\" + def.field, (text) => {\r\n\t\t\t\t\ttitleElement.value = text || (def.title || \" \");\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\ttitleElement.value = def.title || \" \";\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tif(def.field){\r\n\t\t\t\tthis.langBind(\"columns|\" + def.field, (text) => {\r\n\t\t\t\t\tthis._formatColumnHeaderTitle(titleHolderElement, text || (def.title || \" \"));\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tthis._formatColumnHeaderTitle(titleHolderElement, def.title || \" \");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn titleHolderElement;\r\n\t}\r\n\r\n\t_formatColumnHeaderTitle(el, title){\r\n\t\tvar contents = this.chain(\"column-format\", [this, title, el], null, () => {\r\n\t\t\treturn title;\r\n\t\t});\r\n\r\n\t\tswitch(typeof contents){\r\n\t\t\tcase \"object\":\r\n\t\t\tif(contents instanceof Node){\r\n\t\t\t\tel.appendChild(contents);\r\n\t\t\t}else{\r\n\t\t\t\tel.innerHTML = \"\";\r\n\t\t\t\tconsole.warn(\"Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:\", contents);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\tcase \"undefined\":\r\n\t\t\tcase \"null\":\r\n\t\t\tel.innerHTML = \"\";\r\n\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\tel.innerHTML = contents;\r\n\t\t}\r\n\t}\r\n\r\n\t//build header element for column group\r\n\t_buildGroupHeader(){\r\n\t\tthis.element.classList.add(\"tabulator-col-group\");\r\n\t\tthis.element.setAttribute(\"role\", \"columngroup\");\r\n\t\tthis.element.setAttribute(\"aria-title\", this.definition.title);\r\n\r\n\t\t//asign additional css classes to column header\r\n\t\tif(this.definition.cssClass){\r\n\t\t\tvar classeNames = this.definition.cssClass.split(\" \");\r\n\t\t\tclasseNames.forEach((className) => {\r\n\t\t\t\tthis.element.classList.add(className);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.titleElement.style.textAlign = this.definition.headerHozAlign;\r\n\r\n\t\tthis.element.appendChild(this.groupElement);\r\n\t}\r\n\r\n\t//flat field lookup\r\n\t_getFlatData(data){\r\n\t\treturn data[this.field];\r\n\t}\r\n\r\n\t//nested field lookup\r\n\t_getNestedData(data){\r\n\t\tvar dataObj = data,\r\n\t\tstructure = this.fieldStructure,\r\n\t\tlength = structure.length,\r\n\t\toutput;\r\n\r\n\t\tfor(let i = 0; i < length; i++){\r\n\r\n\t\t\tdataObj = dataObj[structure[i]];\r\n\r\n\t\t\toutput = dataObj;\r\n\r\n\t\t\tif(!dataObj){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//flat field set\r\n\t_setFlatData(data, value){\r\n\t\tif(this.field){\r\n\t\t\tdata[this.field] = value;\r\n\t\t}\r\n\t}\r\n\r\n\t//nested field set\r\n\t_setNestedData(data, value){\r\n\t\tvar dataObj = data,\r\n\t\tstructure = this.fieldStructure,\r\n\t\tlength = structure.length;\r\n\r\n\t\tfor(let i = 0; i < length; i++){\r\n\r\n\t\t\tif(i == length -1){\r\n\t\t\t\tdataObj[structure[i]] = value;\r\n\t\t\t}else{\r\n\t\t\t\tif(!dataObj[structure[i]]){\r\n\t\t\t\t\tif(typeof value !== \"undefined\"){\r\n\t\t\t\t\t\tdataObj[structure[i]] = {};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdataObj = dataObj[structure[i]];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//attach column to this group\r\n\tattachColumn(column){\r\n\t\tif(this.groupElement){\r\n\t\t\tthis.columns.push(column);\r\n\t\t\tthis.groupElement.appendChild(column.getElement());\r\n\r\n\t\t\tcolumn.columnRendered();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Warning - Column being attached to another column instead of column group\");\r\n\t\t}\r\n\t}\r\n\r\n\t//vertically align header in column\r\n\tverticalAlign(alignment, height){\r\n\r\n\t\t//calculate height of column header and group holder element\r\n\t\tvar parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : (height || this.parent.getHeadersElement().clientHeight);\r\n\t\t// var parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : this.parent.getHeadersElement().clientHeight;\r\n\r\n\t\tthis.element.style.height = parentHeight + \"px\";\r\n\r\n\t\tthis.dispatch(\"column-height\", this, this.element.style.height);\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.groupElement.style.minHeight = (parentHeight - this.contentElement.offsetHeight) + \"px\";\r\n\t\t}\r\n\r\n\t\t//vertically align cell contents\r\n\t\tif(!this.isGroup && alignment !== \"top\"){\r\n\t\t\tif(alignment === \"bottom\"){\r\n\t\t\t\tthis.element.style.paddingTop = (this.element.clientHeight - this.contentElement.offsetHeight) + \"px\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.element.style.paddingTop = ((this.element.clientHeight - this.contentElement.offsetHeight) / 2) + \"px\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.verticalAlign(alignment);\r\n\t\t});\r\n\t}\r\n\r\n\t//clear vertical alignmenet\r\n\tclearVerticalAlign(){\r\n\t\tthis.element.style.paddingTop = \"\";\r\n\t\tthis.element.style.height = \"\";\r\n\t\tthis.element.style.minHeight = \"\";\r\n\t\tthis.groupElement.style.minHeight = \"\";\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.clearVerticalAlign();\r\n\t\t});\r\n\r\n\t\tthis.dispatch(\"column-height\", this, \"\");\r\n\t}\r\n\r\n\tbindModuleColumns (){\r\n\t\t//check if rownum formatter is being used on a column\r\n\t\tif(this.definition.formatter == \"rownum\"){\r\n\t\t\tthis.table.rowManager.rowNumColumn = this;\r\n\t\t}\r\n\t}\r\n\r\n\t//// Retreive Column Information ////\r\n\t//return column header element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\t//return colunm group element\r\n\tgetGroupElement(){\r\n\t\treturn this.groupElement;\r\n\t}\r\n\r\n\t//return field name\r\n\tgetField(){\r\n\t\treturn this.field;\r\n\t}\r\n\r\n\tgetTitleDownload() {\r\n\t\treturn this.titleDownload;\r\n\t}\r\n\r\n\t//return the first column in a group\r\n\tgetFirstColumn(){\r\n\t\tif(!this.isGroup){\r\n\t\t\treturn this;\r\n\t\t}else{\r\n\t\t\tif(this.columns.length){\r\n\t\t\t\treturn this.columns[0].getFirstColumn();\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//return the last column in a group\r\n\tgetLastColumn(){\r\n\t\tif(!this.isGroup){\r\n\t\t\treturn this;\r\n\t\t}else{\r\n\t\t\tif(this.columns.length){\r\n\t\t\t\treturn this.columns[this.columns.length -1].getLastColumn();\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//return all columns in a group\r\n\tgetColumns(){\r\n\t\treturn this.columns;\r\n\t}\r\n\r\n\t//return all columns in a group\r\n\tgetCells(){\r\n\t\treturn this.cells;\r\n\t}\r\n\r\n\t//retreive the top column in a group of columns\r\n\tgetTopColumn(){\r\n\t\tif(this.parent.isGroup){\r\n\t\t\treturn this.parent.getTopColumn();\r\n\t\t}else{\r\n\t\t\treturn this;\r\n\t\t}\r\n\t}\r\n\r\n\t//return column definition object\r\n\tgetDefinition(updateBranches){\r\n\t\tvar colDefs = [];\r\n\r\n\t\tif(this.isGroup && updateBranches){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tcolDefs.push(column.getDefinition(true));\r\n\t\t\t});\r\n\r\n\t\t\tthis.definition.columns = colDefs;\r\n\t\t}\r\n\r\n\t\treturn this.definition;\r\n\t}\r\n\r\n\t//////////////////// Actions ////////////////////\r\n\tcheckColumnVisibility(){\r\n\t\tvar visible = false;\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvisible = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(visible){\r\n\t\t\tthis.show();\r\n\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), false);\r\n\t\t}else{\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\t//show column\r\n\tshow(silent, responsiveToggle){\r\n\t\tif(!this.visible){\r\n\t\t\tthis.visible = true;\r\n\r\n\t\t\tthis.element.style.display = \"\";\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.checkColumnVisibility();\r\n\t\t\t}\r\n\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.show();\r\n\t\t\t});\r\n\r\n\t\t\tif(!this.isGroup && this.width === null){\r\n\t\t\t\tthis.reinitializeWidth();\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.columnManager.verticalAlignHeaders();\r\n\r\n\t\t\tthis.dispatch(\"column-show\", this, responsiveToggle);\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), true);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\r\n\t\t\tif(!this.silent){\r\n\t\t\t\tthis.table.columnManager.renderer.rerenderColumns();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//hide column\r\n\thide(silent, responsiveToggle){\r\n\t\tif(this.visible){\r\n\t\t\tthis.visible = false;\r\n\r\n\t\t\tthis.element.style.display = \"none\";\r\n\r\n\t\t\tthis.table.columnManager.verticalAlignHeaders();\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.checkColumnVisibility();\r\n\t\t\t}\r\n\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.hide();\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatch(\"column-hide\", this, responsiveToggle);\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), false);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\r\n\t\t\tif(!this.silent){\r\n\t\t\t\tthis.table.columnManager.renderer.rerenderColumns();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmatchChildWidths(){\r\n\t\tvar childWidth = 0;\r\n\r\n\t\tif(this.contentElement && this.columns.length){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tif(column.visible){\r\n\t\t\t\t\tchildWidth += column.getWidth();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.contentElement.style.maxWidth = (childWidth - 1) + \"px\";\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tremoveChild(child){\r\n\t\tvar index = this.columns.indexOf(child);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.columns.splice(index, 1);\r\n\t\t}\r\n\r\n\t\tif(!this.columns.length){\r\n\t\t\tthis.delete();\r\n\t\t}\r\n\t}\r\n\r\n\tsetWidth(width){\r\n\t\tthis.widthFixed = true;\r\n\t\tthis.setWidthActual(width);\r\n\t}\r\n\r\n\tsetWidthActual(width){\r\n\t\tif(isNaN(width)){\r\n\t\t\twidth = Math.floor((this.table.element.clientWidth/100) * parseInt(width));\r\n\t\t}\r\n\r\n\t\twidth = Math.max(this.minWidth, width);\r\n\r\n\t\tif(this.maxWidth){\r\n\t\t\twidth = Math.min(this.maxWidth, width);\r\n\t\t}\r\n\r\n\t\tthis.width = width;\r\n\t\tthis.widthStyled = width ? width + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.width = this.widthStyled;\r\n\r\n\t\tif(!this.isGroup){\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.setWidth();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.parent.isGroup){\r\n\t\t\tthis.parent.matchChildWidths();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-width\", this);\r\n\t}\r\n\r\n\tcheckCellHeights(){\r\n\t\tvar rows = [];\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tif(cell.row.heightInitialized){\r\n\t\t\t\tif(cell.row.getElement().offsetParent !== null){\r\n\t\t\t\t\trows.push(cell.row);\r\n\t\t\t\t\tcell.row.clearCellHeight();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcell.row.heightInitialized = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\trow.calcHeight();\r\n\t\t});\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\trow.setCellHeight();\r\n\t\t});\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\tvar width = 0;\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tif(column.visible){\r\n\t\t\t\t\twidth += column.getWidth();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\twidth = this.width;\r\n\t\t}\r\n\r\n\t\treturn width;\r\n\t}\r\n\r\n\tgetHeight(){\r\n\t\treturn Math.ceil(this.element.getBoundingClientRect().height);\r\n\t}\r\n\r\n\tsetMinWidth(minWidth){\r\n\t\tthis.minWidth = minWidth;\r\n\t\tthis.minWidthStyled = minWidth ? minWidth + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.minWidth = this.minWidthStyled;\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setMinWidth();\r\n\t\t});\r\n\t}\r\n\r\n\tsetMaxWidth(maxWidth){\r\n\t\tthis.maxWidth = maxWidth;\r\n\t\tthis.maxWidthStyled = maxWidth ? maxWidth + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.maxWidth = this.maxWidthStyled;\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setMaxWidth();\r\n\t\t});\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar index;\r\n\r\n\t\t\tif(this.isGroup){\r\n\t\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\t\tcolumn.delete();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatch(\"column-delete\", this);\r\n\r\n\t\t\tvar cellCount = this.cells.length;\r\n\r\n\t\t\tfor(let i = 0; i < cellCount; i++){\r\n\t\t\t\tthis.cells[0].delete();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.element.parentNode){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element = false;\r\n\t\t\tthis.contentElement = false;\r\n\t\t\tthis.titleElement = false;\r\n\t\t\tthis.groupElement = false;\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.removeChild(this);\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.columnManager.deregisterColumn(this);\r\n\r\n\t\t\tthis.table.columnManager.renderer.rerenderColumns(true);\r\n\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\r\n\tcolumnRendered(){\r\n\t\tif(this.titleFormatterRendered){\r\n\t\t\tthis.titleFormatterRendered();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-rendered\", this);\r\n\t}\r\n\r\n\t//////////////// Cell Management /////////////////\r\n\t//generate cell for this column\r\n\tgenerateCell(row){\r\n\t\tvar cell = new Cell(this, row);\r\n\r\n\t\tthis.cells.push(cell);\r\n\r\n\t\treturn cell;\r\n\t}\r\n\r\n\tnextColumn(){\r\n\t\tvar index = this.table.columnManager.findColumnIndex(this);\r\n\t\treturn index > -1 ? this._nextVisibleColumn(index + 1) : false;\r\n\t}\r\n\r\n\t_nextVisibleColumn(index){\r\n\t\tvar column = this.table.columnManager.getColumnByIndex(index);\r\n\t\treturn !column || column.visible ? column : this._nextVisibleColumn(index + 1);\r\n\t}\r\n\r\n\tprevColumn(){\r\n\t\tvar index = this.table.columnManager.findColumnIndex(this);\r\n\t\treturn index > -1 ? this._prevVisibleColumn(index - 1) : false;\r\n\t}\r\n\r\n\t_prevVisibleColumn(index){\r\n\t\tvar column = this.table.columnManager.getColumnByIndex(index);\r\n\t\treturn !column || column.visible ? column : this._prevVisibleColumn(index - 1);\r\n\t}\r\n\r\n\treinitializeWidth(force){\r\n\t\tthis.widthFixed = false;\r\n\r\n\t\t//set width if present\r\n\t\tif(typeof this.definition.width !== \"undefined\" && !force){\r\n\t\t\t// maxInitialWidth ignored here as width specified\r\n\t\t\tthis.setWidth(this.definition.width);\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-width-fit-before\", this);\r\n\r\n\t\tthis.fitToData(force);\r\n\r\n\t\tthis.dispatch(\"column-width-fit-after\", this);\r\n\t}\r\n\r\n\t//set column width to maximum cell width for non group columns\r\n\tfitToData(force){\r\n\t\tif(this.isGroup){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(!this.widthFixed){\r\n\t\t\tthis.element.style.width = \"\";\r\n\r\n\t\t\tthis.cells.forEach((cell) => {\r\n\t\t\t\tcell.clearWidth();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tvar maxWidth = this.element.offsetWidth;\r\n\r\n\t\tif(!this.width || !this.widthFixed){\r\n\t\t\tthis.cells.forEach((cell) => {\r\n\t\t\t\tvar width = cell.getWidth();\r\n\r\n\t\t\t\tif(width > maxWidth){\r\n\t\t\t\t\tmaxWidth = width;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(maxWidth){\r\n\t\t\t\tvar setTo = maxWidth + 1;\r\n\t\t\t\tif (this.maxInitialWidth && !force) {\r\n\t\t\t\t\tsetTo = Math.min(setTo, this.maxInitialWidth);\r\n\t\t\t\t}\r\n\t\t\t\tthis.setWidthActual(setTo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdateDefinition(updates){\r\n\t\tvar definition;\r\n\r\n\t\tif(!this.isGroup){\r\n\t\t\tif(!this.parent.isGroup){\r\n\t\t\t\tdefinition = Object.assign({}, this.getDefinition());\r\n\t\t\t\tdefinition = Object.assign(definition, updates);\r\n\r\n\t\t\t\treturn this.table.columnManager.addColumn(definition, false, this)\r\n\t\t\t\t.then((column) => {\r\n\r\n\t\t\t\t\tif(definition.field == this.field){\r\n\t\t\t\t\t\tthis.field = false; //cleair field name to prevent deletion of duplicate column from arrays\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn this.delete()\r\n\t\t\t\t\t.then(() => {\r\n\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Column Update Error - The updateDefinition function is only available on ungrouped columns\");\r\n\t\t\t\treturn Promise.reject(\"Column Update Error - The updateDefinition function is only available on columns, not column groups\");\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Column Update Error - The updateDefinition function is only available on ungrouped columns\");\r\n\t\t\treturn Promise.reject(\"Column Update Error - The updateDefinition function is only available on columns, not column groups\");\r\n\t\t}\r\n\t}\r\n\r\n\tdeleteCell(cell){\r\n\t\tvar index = this.cells.indexOf(cell);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.cells.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new ColumnComponent(this);\r\n\t\t}\r\n\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n\r\nColumn.defaultOptionList = defaultOptions;\r\n\r\nexport default Column;","export default class Helpers{\r\n\r\n\tstatic elVisible(el){\r\n\t\treturn !(el.offsetWidth <= 0 && el.offsetHeight <= 0);\r\n\t}\r\n\r\n\tstatic elOffset(el){\r\n\t\tvar box = el.getBoundingClientRect();\r\n\r\n\t\treturn {\r\n\t\t\ttop: box.top + window.pageYOffset - document.documentElement.clientTop,\r\n\t\t\tleft: box.left + window.pageXOffset - document.documentElement.clientLeft\r\n\t\t};\r\n\t}\r\n\r\n\tstatic deepClone(obj, clone, list = []){\r\n\t\tvar objectProto = {}.__proto__,\r\n\t\tarrayProto = [].__proto__;\r\n\r\n\t\tif (!clone){\r\n\t\t\tclone = Object.assign(Array.isArray(obj) ? [] : {}, obj);\r\n\t\t}\r\n\r\n\t\tfor(var i in obj) {\r\n\t\t\tlet subject = obj[i],\r\n\t\t\tmatch, copy;\r\n\r\n\t\t\tif(subject != null && typeof subject === \"object\" && (subject.__proto__ === objectProto || subject.__proto__ === arrayProto)){\r\n\t\t\t\tmatch = list.findIndex((item) => {\r\n\t\t\t\t\treturn item.subject === subject;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(match > -1){\r\n\t\t\t\t\tclone[i] = list[match].copy;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcopy = Object.assign(Array.isArray(subject) ? [] : {}, subject);\r\n\r\n\t\t\t\t\tlist.unshift({subject, copy});\r\n\r\n\t\t\t\t\tclone[i] = this.deepClone(subject, copy, list);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn clone;\r\n\t}\r\n}","export default class OptionsList {\r\n\tconstructor(table, msgType, defaults = {}){\r\n\t\tthis.table = table;\r\n\t\tthis.msgType = msgType;\r\n\t\tthis.registeredDefaults = Object.assign({}, defaults)\r\n\t}\r\n\r\n\tregister(option, value){\r\n\t\tthis.registeredDefaults[option] = value;\r\n\t}\r\n\r\n\tgenerate(defaultOptions, userOptions = {}){\r\n\t\tvar output = Object.assign({}, this.registeredDefaults);\r\n\r\n\t\tObject.assign(output, defaultOptions);\r\n\r\n\t\tif(userOptions.debugInvalidOptions !== false || this.table.options.debugInvalidOptions){\r\n\t\t\tfor (var key in userOptions){\r\n\t\t\t\tif(!output.hasOwnProperty(key)){\r\n\t\t\t\t\tconsole.warn(\"Invalid \" + this.msgType + \" option:\", key)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (var key in output){\r\n\t\t\tif(key in userOptions){\r\n\t\t\t\toutput[key] = userOptions[key];\r\n\t\t\t}else{\r\n\t\t\t\tif(Array.isArray(output[key])){\r\n\t\t\t\t\toutput[key] = Object.assign([], output[key]);\r\n\t\t\t\t}else if(typeof output[key] === \"object\" && output[key] !== null){\r\n\t\t\t\t\toutput[key] = Object.assign({}, output[key]);\r\n\t\t\t\t}else if (typeof output[key] === \"undefined\"){\r\n\t\t\t\t\tdelete output[key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from '../tools/Helpers.js';\r\n\r\nexport default class Renderer extends CoreFeature{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.elementVertical = table.rowManager.element;\r\n\t\tthis.elementHorizontal = table.columnManager.element;\r\n\t\tthis.tableElement = table.rowManager.tableElement;\r\n\r\n\t\tthis.verticalFillMode = \"fit\"; // used by row manager to determin how to size the render area (\"fit\" - fits container to the contents, \"fill\" - fills the contianer without resizing it)\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t/////// Internal Bindings /////////\r\n\t///////////////////////////////////\r\n\r\n\tinitialize(){\r\n\t\t//initialize core functionality\r\n\t}\r\n\r\n\tclearRows(){\r\n\t\t//clear down existing rows layout\r\n\t}\r\n\r\n\tclearColumns(){\r\n\t\t//clear down existing columns layout\r\n\t}\r\n\r\n\r\n\treinitializeColumnWidths(columns){\r\n\t\t//resize columns to fit data\r\n\t}\r\n\r\n\r\n\trenderRows(){\r\n\t\t//render rows from a clean slate\r\n\t}\r\n\r\n\trenderColumns(){\r\n\t\t//render columns from a clean slate\r\n\t}\r\n\r\n\trerenderRows(callback){\r\n\t\t// rerender rows and keep position\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\t}\r\n\r\n\trerenderColumns(update, blockRedraw){\r\n\t\t//rerender columns\r\n\t}\r\n\r\n\trenderRowCells(row){\r\n\t\t//render the cells in a row\r\n\t}\r\n\r\n\trerenderRowCells(row, force){\r\n\t\t//rerender the cells in a row\r\n\t}\r\n\r\n\tscrollColumns(left, dir){\r\n\t\t//handle horizontal scrolling\r\n\t}\r\n\r\n\tscrollRows(top, dir){\r\n\t\t//handle vertical scolling\r\n\t}\r\n\r\n\tresize(){\r\n\t\t//container has rezied, carry out any needed recalculations (DO NOT RERENDER IN THIS FUNCTION)\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\t//scroll to a specific row\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\t//determine weather the row is nearest the top or bottom of the table, retur true for top or false for bottom\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\t//return the visible rows\r\n\t\treturn [];\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t//////// Helper Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\trows(){\r\n\t\treturn this.table.rowManager.getDisplayRows();\r\n\t}\r\n\r\n\tstyleRow(row, index){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tif(index % 2){\r\n\t\t\trowEl.classList.add(\"tabulator-row-even\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-odd\");\r\n\t\t}else{\r\n\t\t\trowEl.classList.add(\"tabulator-row-odd\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-even\");\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t/////// External Triggers /////////\r\n\t/////// (DO NOT OVERRIDE) /////////\r\n\t///////////////////////////////////\r\n\r\n\tclear(){\r\n\t\t//clear down existing layout\r\n\t\tthis.clearRows();\r\n\t\tthis.clearColumns();\r\n\t}\r\n\r\n\trender(){\r\n\t\t//render from a clean slate\r\n\t\tthis.renderRows();\r\n\t\tthis.renderColumns();\r\n\t}\r\n\r\n\trerender(callback){\r\n\t\t// rerender and keep position\r\n\t\tthis.rerenderRows();\r\n\t\tthis.rerenderColumns();\r\n\t}\r\n\r\n\tscrollToRowPosition(row, position, ifVisible){\r\n\t\tvar rowIndex = this.rows().indexOf(row),\r\n\t\trowEl = row.getElement(),\r\n\t\toffset = 0;\r\n\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tif(rowIndex > -1){\r\n\r\n\t\t\t\tif(typeof ifVisible === \"undefined\"){\r\n\t\t\t\t\tifVisible = this.table.options.scrollToRowIfVisible;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//check row visibility\r\n\t\t\t\tif(!ifVisible){\r\n\t\t\t\t\tif(Helpers.elVisible(rowEl)){\r\n\t\t\t\t\t\toffset = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(offset > 0 && offset < this.elementVertical.clientHeight - rowEl.offsetHeight){\r\n\t\t\t\t\t\t\tresolve();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(typeof position === \"undefined\"){\r\n\t\t\t\t\tposition = this.table.options.scrollToRowPosition;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(position === \"nearest\"){\r\n\t\t\t\t\tposition = this.scrollToRowNearestTop(row) ? \"top\" : \"bottom\"\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//scroll to row\r\n\t\t\t\tthis.scrollToRow(row);\r\n\r\n\t\t\t\t//align to correct position\r\n\t\t\t\tswitch(position){\r\n\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\tcase \"center\":\r\n\r\n\t\t\t\t\tif(this.elementVertical.scrollHeight - this.elementVertical.scrollTop == this.elementVertical.clientHeight){\r\n\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop + (rowEl.offsetTop - this.elementVertical.scrollTop) - ((this.elementVertical.scrollHeight - rowEl.offsetTop) / 2);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - (this.elementVertical.clientHeight / 2);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"bottom\":\r\n\r\n\t\t\t\t\tif(this.elementVertical.scrollHeight - this.elementVertical.scrollTop == this.elementVertical.clientHeight){\r\n\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - (this.elementVertical.scrollHeight - rowEl.offsetTop) + rowEl.offsetHeight;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - this.elementVertical.clientHeight + rowEl.offsetHeight;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tcase \"top\":\r\n\t\t\t\t\tthis.elementVertical.scrollTop = rowEl.offsetTop;\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tresolve();\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - Row not visible\");\r\n\t\t\t\treject(\"Scroll Error - Row not visible\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class BaiscHorizontal extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t}\r\n\r\n\trenderRowCells(row){\r\n\t\trow.cells.forEach((cell) => {\r\n\t\t\trow.element.appendChild(cell.getElement());\r\n\t\t\tcell.cellRendered();\r\n\t\t});\r\n\t}\r\n\r\n\treinitializeColumnWidths(columns){\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t});\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class VirtualDomHorizontal extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.leftCol = 0;\r\n\t\tthis.rightCol = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = 0;\r\n\t\tthis.vDomScrollPosRight = 0;\r\n\t\t\r\n\t\tthis.vDomPadLeft = 0;\r\n\t\tthis.vDomPadRight = 0;\r\n\t\t\r\n\t\tthis.fitDataColAvg = 0;\r\n\t\t\r\n\t\tthis.windowBuffer = 200; //pixel margin to make column visible before it is shown on screen\r\n\t\t\r\n\t\tthis.visibleRows = null;\r\n\r\n\t\tthis.initialized = false;\r\n\t\tthis.isFitData = false;\r\n\t\t\r\n\t\tthis.columns = [];\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.compatibilityCheck();\r\n\t\tthis.layoutCheck();\r\n\t\tthis.vertScrollListen();\r\n\t}\r\n\t\r\n\tcompatibilityCheck(){\r\n\t\tvar columns = this.options(\"columns\"),\r\n\t\tfrozen = false,\r\n\t\tok = true;\r\n\t\t\r\n\t\tif(this.options(\"layout\") == \"fitDataTable\"){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with fitDataTable layout mode\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.options(\"responsiveLayout\")){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with responsive columns\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.options(\"rtl\")){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not currently compatible with RTL text direction\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(columns){\r\n\t\t\tfrozen = columns.find((col) => {\r\n\t\t\t\treturn col.frozen;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(frozen){\r\n\t\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with frozen columns\");\r\n\t\t\t\tok = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// if(!ok){\r\n\t\t// \toptions.virtualDomHoz = false;\r\n\t\t// }\r\n\t\t\r\n\t\treturn ok;\r\n\t}\r\n\t\r\n\tlayoutCheck(){\r\n\t\tthis.isFitData = this.options(\"layout\").startsWith('fitData');\r\n\t}\r\n\r\n\tvertScrollListen(){\r\n\t\tthis.subscribe(\"scroll-vertical\", this.clearVisRowCache.bind(this));\r\n\t\tthis.subscribe(\"data-refreshed\", this.clearVisRowCache.bind(this));\r\n\t}\r\n\r\n\tclearVisRowCache(){\r\n\t\tthis.visibleRows = null;\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t///////// Public Functions ///////////\r\n\t//////////////////////////////////////\r\n\t\r\n\trenderColumns(row, force){\r\n\t\tthis.dataChange();\r\n\t}\r\n\r\n\t\r\n\tscrollColumns(left, dir){\r\n\t\tif(this.scrollLeft != left){\r\n\t\t\tthis.scrollLeft = left;\r\n\t\t\t\r\n\t\t\tthis.scroll(left - (this.vDomScrollPosLeft + this.windowBuffer));\r\n\t\t}\r\n\t}\r\n\t\r\n\tcalcWindowBuffer(){\r\n\t\tvar buffer = this.elementVertical.clientWidth;\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvar width = column.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tif(width > buffer){\r\n\t\t\t\t\tbuffer = width;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.windowBuffer = buffer * 2;\r\n\t}\r\n\t\r\n\trerenderColumns(update, blockRedraw){\t\t\r\n\t\tvar old = {\r\n\t\t\tcols:this.columns,\r\n\t\t\tleftCol:this.leftCol,\r\n\t\t\trightCol:this.rightCol,\r\n\t\t},\r\n\t\tcolPos = 0;\r\n\t\t\r\n\t\t\r\n\t\tif(update && !this.initialized){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tthis.clear();\r\n\t\t\r\n\t\tthis.calcWindowBuffer();\r\n\t\t\r\n\t\tthis.scrollLeft = this.elementVertical.scrollLeft;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = this.scrollLeft - this.windowBuffer;\r\n\t\tthis.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.windowBuffer;\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tvar config = {};\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvar width = column.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tconfig.leftPos = colPos;\r\n\t\t\t\tconfig.rightPos = colPos + width;\r\n\t\t\t\t\r\n\t\t\t\tconfig.width = width;\r\n\t\t\t\t\r\n\t\t\t\tif (this.isFitData) {\r\n\t\t\t\t\tconfig.fitDataCheck = column.modules.vdomHoz ? column.modules.vdomHoz.fitDataCheck : true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif((colPos + width > this.vDomScrollPosLeft) && (colPos < this.vDomScrollPosRight)){\r\n\t\t\t\t\t//column is visible\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.leftCol == -1){\r\n\t\t\t\t\t\tthis.leftCol = this.columns.length;\r\n\t\t\t\t\t\tthis.vDomPadLeft = colPos;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.rightCol = this.columns.length;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t// column is hidden\r\n\t\t\t\t\tif(this.leftCol !== -1){\r\n\t\t\t\t\t\tthis.vDomPadRight += width;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.columns.push(column);\r\n\t\t\t\t\r\n\t\t\t\tcolumn.modules.vdomHoz = config;\r\n\t\t\t\t\r\n\t\t\t\tcolPos += width;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t\r\n\t\tthis.initialized = true;\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tif(!update || this.reinitChanged(old)){\r\n\t\t\t\tthis.reinitializeRows();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.elementVertical.scrollLeft = this.scrollLeft;\r\n\t}\r\n\t\r\n\trenderRowCells(row){\r\n\t\tif(this.initialized){\r\n\t\t\tthis.initializeRow(row);\r\n\t\t}else{\r\n\t\t\trow.cells.forEach((cell) => {\r\n\t\t\t\trow.element.appendChild(cell.getElement());\r\n\t\t\t\tcell.cellRendered();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\trerenderRowCells(row, force){\r\n\t\tthis.reinitializeRow(row, force);\r\n\t}\r\n\t\r\n\treinitializeColumnWidths(columns){\r\n\t\tfor(let i = this.leftCol; i <= this.rightCol; i++){\r\n\t\t\tthis.columns[i].reinitializeWidth();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t//////// Internal Rendering //////////\r\n\t//////////////////////////////////////\r\n\t\r\n\tdeinitialize(){\r\n\t\tthis.initialized = false;\r\n\t}\r\n\t\r\n\tclear(){\r\n\t\tthis.columns = [];\r\n\t\t\r\n\t\tthis.leftCol = -1;\r\n\t\tthis.rightCol = 0;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = 0;\r\n\t\tthis.vDomScrollPosRight = 0;\r\n\t\tthis.vDomPadLeft = 0;\r\n\t\tthis.vDomPadRight = 0;\r\n\t}\r\n\t\r\n\tdataChange(){\r\n\t\tvar change = false,\r\n\t\tcollsWidth = 0,\r\n\t\tcolEnd = 0,\r\n\t\tgroup, row, rowEl;\r\n\t\t\r\n\t\tif(this.isFitData){\r\n\t\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\t\tif(!column.definition.width && column.visible){\r\n\t\t\t\t\tchange = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(change){\r\n\t\t\t\tif(change && this.table.rowManager.getDisplayRows().length){\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.windowBuffer;\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar row = this.chain(\"rows-sample\", [1], [], () => {\r\n\t\t\t\t\t\treturn this.table.rowManager.getDisplayRows();\r\n\t\t\t\t\t})[0];\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trowEl = row.getElement();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trow.generateCells();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.tableElement.appendChild(rowEl);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor(var colEnd = 0; colEnd < row.cells.length; colEnd++){\r\n\t\t\t\t\t\t\tlet cell = row.cells[colEnd];\r\n\t\t\t\t\t\t\trowEl.appendChild(cell.getElement());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcell.column.reinitializeWidth();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcollsWidth += cell.column.getWidth();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// if(collsWidth > this.vDomScrollPosRight){\r\n\t\t\t\t\t\t\t// \tbreak;\r\n\t\t\t\t\t\t\t// }\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// this.fitDataColAvg = Math.floor(collsWidth / (colEnd + 1));\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// for(colEnd; colEnd < this.table.columnManager.columnsByIndex.length; colEnd++){\r\n\t\t\t\t\t\t// \tthis.table.columnManager.columnsByIndex[colEnd].setWidth(this.fitDataColAvg);\r\n\t\t\t\t\t\t// }\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.rerenderColumns(false, true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.options(\"layout\") === \"fitColumns\"){\r\n\t\t\t\tthis.layoutRefresh();\r\n\t\t\t\tthis.rerenderColumns(false, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitChanged(old){\r\n\t\tvar match = true;\r\n\t\t\r\n\t\tif(old.cols.length !== this.columns.length || old.leftCol !== this.leftCol || old.rightCol !== this.rightCol){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\told.cols.forEach((col, i) => {\r\n\t\t\tif(col !== this.columns[i]){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn !match;\r\n\t}\r\n\t\r\n\treinitializeRows(){\r\n\t\tvar rows = this.getVisibleRows();\r\n\t\trows.forEach((row) => {\r\n\t\t\tthis.reinitializeRow(row, true);\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetVisibleRows(){\r\n\t\tif (!this.visibleRows){\r\n\t\t\tthis.visibleRows = this.table.rowManager.getVisibleRows();\r\n\t\t}\r\n\r\n\t\treturn this.visibleRows;\t\r\n\t}\r\n\t\r\n\tscroll(diff){\r\n\t\tthis.vDomScrollPosLeft += diff;\r\n\t\tthis.vDomScrollPosRight += diff;\r\n\r\n\t\tif(Math.abs(diff) > (this.windowBuffer / 2)){\r\n\t\t\tthis.rerenderColumns();\r\n\t\t}else{\r\n\t\t\tif(diff > 0){\r\n\t\t\t\t//scroll right\r\n\t\t\t\tthis.addColRight();\r\n\t\t\t\tthis.removeColLeft();\r\n\t\t\t}else{\r\n\t\t\t\t//scroll left\r\n\t\t\t\tthis.addColLeft();\r\n\t\t\t\tthis.removeColRight();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolPositionAdjust (start, end, diff){\r\n\t\tfor(let i = start; i < end; i++){\r\n\t\t\tlet column = this.columns[i];\r\n\t\t\t\r\n\t\t\tcolumn.modules.vdomHoz.leftPos += diff;\r\n\t\t\tcolumn.modules.vdomHoz.rightPos += diff;\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColRight(){\r\n\t\tvar changes = false;\r\n\t\t\r\n\t\twhile(true){\r\n\t\t\t\r\n\t\t\tlet column = this.columns[this.rightCol + 1];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.leftPos <= this.vDomScrollPosRight){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\trow.getElement().appendChild(cell.getElement());\r\n\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.fitDataColActualWidthCheck(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.rightCol++; // Don't move this below the >= check below\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.rightCol >= (this.columns.length - 1)){\r\n\t\t\t\t\t\tthis.vDomPadRight = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomPadRight -= column.getWidth();\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColLeft(){\r\n\t\tvar changes = false;\r\n\t\t\r\n\t\twhile(true){\r\n\t\t\tlet column = this.columns[this.leftCol - 1];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.rightPos >= this.vDomScrollPosLeft){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\trow.getElement().prepend(cell.getElement());\r\n\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.leftCol--; // don't move this below the <= check below\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.leftCol <= 0){ // replicating logic in addColRight\r\n\t\t\t\t\t\tthis.vDomPadLeft = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomPadLeft -= column.getWidth();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tlet diff = this.fitDataColActualWidthCheck(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(diff){\r\n\t\t\t\t\t\tthis.scrollLeft = this.elementVertical.scrollLeft = this.elementVertical.scrollLeft + diff;\r\n\t\t\t\t\t\tthis.vDomPadRight -= diff;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveColRight(){\r\n\t\tvar changes = false;\r\n\t\t\r\n\t\twhile(true){\r\n\t\t\tlet column = this.columns[this.rightCol];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.leftPos > this.vDomScrollPosRight){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\trow.getElement().removeChild(cell.getElement());\r\n\t\t\t\t\t\t\t} catch (ex) {\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Could not removeColRight\", ex.message)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.vDomPadRight += column.getWidth();\r\n\t\t\t\t\tthis.rightCol --;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveColLeft(){\r\n\t\tvar changes = false;\r\n\t\t\r\n\t\twhile(true){\r\n\t\t\tlet column = this.columns[this.leftCol];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.rightPos < this.vDomScrollPosLeft){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\t\t\t\t\t\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\trow.getElement().removeChild(cell.getElement());\r\n\t\t\t\t\t\t\t} catch (ex) {\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Could not removeColLeft\", ex.message)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.vDomPadLeft += column.getWidth();\r\n\t\t\t\t\tthis.leftCol ++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\tfitDataColActualWidthCheck(column){\r\n\t\tvar newWidth, widthDiff;\r\n\t\t\r\n\t\tif(column.modules.vdomHoz.fitDataCheck){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t\t\r\n\t\t\tnewWidth = column.getWidth();\r\n\t\t\twidthDiff = newWidth - column.modules.vdomHoz.width;\r\n\t\t\t\r\n\t\t\tif(widthDiff){\r\n\t\t\t\tcolumn.modules.vdomHoz.rightPos += widthDiff;\r\n\t\t\t\tcolumn.modules.vdomHoz.width = newWidth;\r\n\t\t\t\tthis.colPositionAdjust(this.columns.indexOf(column) + 1, this.columns.length, widthDiff);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.vdomHoz.fitDataCheck = false;\r\n\t\t}\r\n\t\t\r\n\t\treturn widthDiff;\r\n\t}\r\n\t\r\n\tinitializeRow(row){\r\n\t\tif(row.type !== \"group\"){\r\n\t\t\trow.modules.vdomHoz = {\r\n\t\t\t\tleftCol:this.leftCol,\r\n\t\t\t\trightCol:this.rightCol,\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tfor(let i = this.leftCol; i <= this.rightCol; i++){\r\n\t\t\t\tlet column = this.columns[i];\r\n\t\t\t\t\r\n\t\t\t\tif(column && column.visible){\r\n\t\t\t\t\tlet cell = row.getCell(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\trow.getElement().appendChild(cell.getElement());\r\n\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeRow(row, force){\r\n\t\tif(row.type !== \"group\"){\r\n\t\t\tif(force || !row.modules.vdomHoz || row.modules.vdomHoz.leftCol !== this.leftCol || row.modules.vdomHoz.rightCol !== this.rightCol){\r\n\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\twhile(rowEl.firstChild) rowEl.removeChild(rowEl.firstChild);\r\n\t\t\t\t\r\n\t\t\t\tthis.initializeRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Column from './column/Column.js';\r\nimport ColumnComponent from './column/ColumnComponent.js';\r\nimport Helpers from './tools/Helpers.js';\r\nimport OptionsList from './tools/OptionsList.js';\r\n\r\nimport RendererBasicHorizontal from './rendering/renderers/BasicHorizontal.js';\r\nimport RendererVirtualDomHorizontal from './rendering/renderers/VirtualDomHorizontal.js';\r\n\r\nimport defaultColumnOptions from './column/defaults/options.js';\r\n\r\nexport default class ColumnManager extends CoreFeature {\r\n\r\n\tconstructor (table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.blockHozScrollEvent = false;\r\n\t\tthis.headersElement = null;\r\n\t\tthis.element = null ; //containing element\r\n\t\tthis.columns = []; // column definition object\r\n\t\tthis.columnsByIndex = []; //columns by index\r\n\t\tthis.columnsByField = {}; //columns by field\r\n\t\tthis.scrollLeft = 0;\r\n\t\tthis.optionsList = new OptionsList(this.table, \"column definition\", defaultColumnOptions);\r\n\r\n\t\tthis.renderer = null;\r\n\t}\r\n\r\n\t////////////// Setup Functions /////////////////\r\n\r\n\tinitialize(){\r\n\t\tthis.initializeRenderer();\r\n\r\n\t\tthis.headersElement = this.createHeadersElement();\r\n\t\tthis.element = this.createHeaderElement();\r\n\r\n\t\tthis.element.insertBefore(this.headersElement, this.element.firstChild);\r\n\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t}\r\n\r\n\tinitializeRenderer(){\r\n\t\tvar renderClass;\r\n\r\n\t\tvar renderers = {\r\n\t\t\t\"virtual\": RendererVirtualDomHorizontal,\r\n\t\t\t\"basic\": RendererBasicHorizontal,\r\n\t\t};\r\n\r\n\t\tif(typeof this.table.options.renderHorizontal === \"string\"){\r\n\t\t\trenderClass = renderers[this.table.options.renderHorizontal];\r\n\t\t}else{\r\n\t\t\trenderClass = this.table.options.renderHorizontal;\r\n\t\t}\r\n\r\n\t\tif(renderClass){\r\n\t\t\tthis.renderer = new renderClass(this.table, this.element, this.tableElement);\r\n\t\t\tthis.renderer.initialize();\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Unable to find matching renderer:\", table.options.renderHorizontal);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tcreateHeadersElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-headers\");\r\n\t\tel.setAttribute(\"role\", \"row\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tcreateHeaderElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-header\");\r\n\t\tel.setAttribute(\"role\", \"rowgroup\");\r\n\r\n\t\tif(!this.table.options.headerVisible){\r\n\t\t\tel.classList.add(\"tabulator-header-hidden\");\r\n\t\t}\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\t//return containing element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\t//return header containing element\r\n\tgetHeadersElement(){\r\n\t\treturn this.headersElement;\r\n\t}\r\n\r\n\t//scroll horizontally to match table body\r\n\tscrollHorizontal(left){\r\n\t\tvar hozAdjust = 0,\r\n\t\tscrollWidth = this.element.scrollWidth - this.table.element.clientWidth;\r\n\r\n\t\t// this.tempScrollBlock();\r\n\t\tthis.element.scrollLeft = left;\r\n\r\n\t\t//adjust for vertical scrollbar moving table when present\r\n\t\tif(left > scrollWidth){\r\n\t\t\thozAdjust = left - scrollWidth;\r\n\t\t\tthis.element.style.marginLeft = (-(hozAdjust)) + \"px\";\r\n\t\t}else{\r\n\t\t\tthis.element.style.marginLeft = 0;\r\n\t\t}\r\n\r\n\t\tthis.scrollLeft = left;\r\n\r\n\t\tthis.renderer.scrollColumns(left);\r\n\t}\r\n\r\n\t///////////// Column Setup Functions /////////////\r\n\tgenerateColumnsFromRowData(data){\r\n\t\tvar cols = [],\r\n\t\tdefinitions = this.table.options.autoColumnsDefinitions,\r\n\t\trow, sorter;\r\n\r\n\t\tif(data && data.length){\r\n\r\n\t\t\trow = data[0];\r\n\r\n\t\t\tfor(var key in row){\r\n\t\t\t\tlet col = {\r\n\t\t\t\t\tfield:key,\r\n\t\t\t\t\ttitle:key,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tlet value = row[key];\r\n\r\n\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\tsorter = \"boolean\";\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\tif(Array.isArray(value)){\r\n\t\t\t\t\t\tsorter = \"array\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\tif(!isNaN(value) && value !== \"\"){\r\n\t\t\t\t\t\tsorter = \"number\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)){\r\n\t\t\t\t\t\t\tsorter = \"alphanum\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcol.sorter = sorter;\r\n\r\n\t\t\t\tcols.push(col);\r\n\t\t\t}\r\n\r\n\t\t\tif(definitions){\r\n\r\n\t\t\t\tswitch(typeof definitions){\r\n\t\t\t\t\tcase \"function\":\r\n\t\t\t\t\tthis.table.options.columns = definitions.call(this.table, cols);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\tif(Array.isArray(definitions)){\r\n\t\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\t\tvar match = definitions.find((def) => {\r\n\t\t\t\t\t\t\t\treturn def.field === col.field;\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\tif(match){\r\n\t\t\t\t\t\t\t\tObject.assign(col, match);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\t\tif(definitions[col.field]){\r\n\t\t\t\t\t\t\t\tObject.assign(col, definitions[col.field]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.table.options.columns = cols;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.table.options.columns = cols;\r\n\t\t\t}\r\n\r\n\t\t\tthis.setColumns(this.table.options.columns);\r\n\t\t}\r\n\t}\r\n\r\n\tsetColumns(cols, row){\r\n\t\twhile(this.headersElement.firstChild) this.headersElement.removeChild(this.headersElement.firstChild);\r\n\r\n\t\tthis.columns = [];\r\n\t\tthis.columnsByIndex = [];\r\n\t\tthis.columnsByField = {};\r\n\r\n\t\tthis.dispatch(\"columns-loading\");\r\n\r\n\t\tcols.forEach((def, i) => {\r\n\t\t\tthis._addColumn(def);\r\n\t\t});\r\n\r\n\t\tthis._reIndexColumns();\r\n\r\n\t\tthis.dispatch(\"columns-loaded\");\r\n\r\n\t\tthis.renderer.rerenderColumns(false, true);\r\n\r\n\t\tthis.redraw(true);\r\n\t}\r\n\r\n\t_addColumn(definition, before, nextToColumn){\r\n\t\tvar column = new Column(definition, this),\r\n\t\tcolEl = column.getElement(),\r\n\t\tindex = nextToColumn ? this.findColumnIndex(nextToColumn) : nextToColumn;\r\n\r\n\t\tif(nextToColumn && index > -1){\r\n\t\t\tvar topColumn = nextToColumn.getTopColumn()\r\n\t\t\tvar parentIndex = this.columns.indexOf(topColumn);\r\n\t\t\tvar nextEl = topColumn.getElement();\r\n\r\n\t\t\tif(before){\r\n\t\t\t\tthis.columns.splice(parentIndex, 0, column);\r\n\t\t\t\tnextEl.parentNode.insertBefore(colEl, nextEl);\r\n\t\t\t}else{\r\n\t\t\t\tthis.columns.splice(parentIndex + 1, 0, column);\r\n\t\t\t\tnextEl.parentNode.insertBefore(colEl, nextEl.nextSibling);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(before){\r\n\t\t\t\tthis.columns.unshift(column);\r\n\t\t\t\tthis.headersElement.insertBefore(column.getElement(), this.headersElement.firstChild);\r\n\t\t\t}else{\r\n\t\t\t\tthis.columns.push(column);\r\n\t\t\t\tthis.headersElement.appendChild(column.getElement());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcolumn.columnRendered();\r\n\r\n\t\treturn column;\r\n\t}\r\n\r\n\tregisterColumnField(col){\r\n\t\tif(col.definition.field){\r\n\t\t\tthis.columnsByField[col.definition.field] = col;\r\n\t\t}\r\n\t}\r\n\r\n\tregisterColumnPosition(col){\r\n\t\tthis.columnsByIndex.push(col);\r\n\t}\r\n\r\n\t_reIndexColumns(){\r\n\t\tthis.columnsByIndex = [];\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.reRegisterPosition();\r\n\t\t});\r\n\t}\r\n\r\n\t//ensure column headers take up the correct amount of space in column groups\r\n\tverticalAlignHeaders(){\r\n\t\tvar minHeight = 0;\r\n\r\n\t\tthis.columns.forEach((column) => {\r\n\t\t\tvar height;\r\n\r\n\t\t\tcolumn.clearVerticalAlign();\r\n\r\n\t\t\theight = column.getHeight();\r\n\r\n\t\t\tif(height > minHeight){\r\n\t\t\t\tminHeight = height;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.columns.forEach((column) => {\r\n\t\t\tcolumn.verticalAlign(this.table.options.columnHeaderVertAlign, minHeight);\r\n\t\t});\r\n\r\n\t\tthis.table.rowManager.adjustTableSize();\r\n\t}\r\n\r\n\t//////////////// Column Details /////////////////\r\n\tfindColumn(subject){\r\n\t\tif(typeof subject == \"object\"){\r\n\r\n\t\t\tif(subject instanceof Column){\r\n\t\t\t\t//subject is column element\r\n\t\t\t\treturn subject;\r\n\t\t\t}else if(subject instanceof ColumnComponent){\r\n\t\t\t\t//subject is public column component\r\n\t\t\t\treturn subject._getSelf() || false;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\t\t\t\t//subject is a HTML element of the column header\r\n\t\t\t\tlet match = this.columns.find((column) => {\r\n\t\t\t\t\treturn column.element === subject;\r\n\t\t\t\t});\r\n\r\n\t\t\t\treturn match || false;\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the field name of the column\r\n\t\t\treturn this.columnsByField[subject] || false;\r\n\t\t}\r\n\r\n\t\t//catch all for any other type of input\r\n\t\treturn false;\r\n\t}\r\n\r\n\tgetColumnByField(field){\r\n\t\treturn this.columnsByField[field];\r\n\t}\r\n\r\n\tgetColumnsByFieldRoot(root){\r\n\t\tvar matches = [];\r\n\r\n\t\tObject.keys(this.columnsByField).forEach((field) => {\r\n\t\t\tvar fieldRoot = field.split(\".\")[0];\r\n\t\t\tif(fieldRoot === root){\r\n\t\t\t\tmatches.push(this.columnsByField[field]);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn matches;\r\n\t}\r\n\r\n\tgetColumnByIndex(index){\r\n\t\treturn this.columnsByIndex[index];\r\n\t}\r\n\r\n\tgetFirstVisibleColumn(index){\r\n\t\tvar index = this.columnsByIndex.findIndex((col) => {\r\n\t\t\treturn col.visible;\r\n\t\t});\r\n\r\n\t\treturn index > -1 ? this.columnsByIndex[index] : false;\r\n\t}\r\n\r\n\tgetColumns(){\r\n\t\treturn this.columns;\r\n\t}\r\n\r\n\tfindColumnIndex(column){\r\n\t\treturn this.columnsByIndex.findIndex((col) => {\r\n\t\t\treturn column === col;\r\n\t\t});\r\n\t}\r\n\r\n\t//return all columns that are not groups\r\n\tgetRealColumns(){\r\n\t\treturn this.columnsByIndex;\r\n\t}\r\n\r\n\t//travers across columns and call action\r\n\ttraverse(callback){\r\n\t\tthis.columnsByIndex.forEach((column,i) =>{\r\n\t\t\tcallback(column, i);\r\n\t\t});\r\n\t}\r\n\r\n\t//get defintions of actual columns\r\n\tgetDefinitions(active){\r\n\t\tvar output = [];\r\n\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tif(!active || (active && column.visible)){\r\n\t\t\t\toutput.push(column.getDefinition());\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//get full nested definition tree\r\n\tgetDefinitionTree(){\r\n\t\tvar output = [];\r\n\r\n\t\tthis.columns.forEach((column) => {\r\n\t\t\toutput.push(column.getDefinition(true));\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetComponents(structured){\r\n\t\tvar output = [],\r\n\t\tcolumns = structured ? this.columns : this.columnsByIndex;\r\n\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\toutput.push(column.getComponent());\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\tvar width = 0;\r\n\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tif(column.visible){\r\n\t\t\t\twidth += column.getWidth();\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn width;\r\n\t}\r\n\r\n\tmoveColumn(from, to, after){\r\n\t\tthis.moveColumnActual(from, to, after);\r\n\r\n\t\tto.element.parentNode.insertBefore(from.element, to.element);\r\n\r\n\t\tif(after){\r\n\t\t\tto.element.parentNode.insertBefore(to.element, from.element);\r\n\t\t}\r\n\r\n\t\tthis.verticalAlignHeaders();\r\n\r\n\t\tthis.table.rowManager.reinitialize();\r\n\t}\r\n\r\n\tmoveColumnActual(from, to, after){\r\n\t\tif(from.parent.isGroup){\r\n\t\t\tthis._moveColumnInArray(from.parent.columns, from, to, after);\r\n\t\t}else{\r\n\t\t\tthis._moveColumnInArray(this.columns, from, to, after);\r\n\t\t}\r\n\r\n\t\tthis._moveColumnInArray(this.columnsByIndex, from, to, after, true);\r\n\r\n\t\tthis.renderer.rerenderColumns(true);\r\n\r\n\t\tthis.dispatch(\"column-moved\", from, to, after);\r\n\r\n\t\tif(this.subscribedExternal(\"columnMoved\")){\r\n\t\t\tthis.dispatchExternal(\"columnMoved\", from.getComponent(), this.table.columnManager.getComponents());\r\n\t\t}\r\n\t}\r\n\r\n\t_moveColumnInArray(columns, from, to, after, updateRows){\r\n\t\tvar\tfromIndex = columns.indexOf(from),\r\n\t\ttoIndex, rows = [];\r\n\r\n\t\tif (fromIndex > -1) {\r\n\r\n\t\t\tcolumns.splice(fromIndex, 1);\r\n\r\n\t\t\ttoIndex = columns.indexOf(to);\r\n\r\n\t\t\tif (toIndex > -1) {\r\n\r\n\t\t\t\tif(after){\r\n\t\t\t\t\ttoIndex = toIndex+1;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\ttoIndex = fromIndex;\r\n\t\t\t}\r\n\r\n\t\t\tcolumns.splice(toIndex, 0, from);\r\n\r\n\t\t\tif(updateRows){\r\n\r\n\t\t\t\trows = this.chain(\"column-moving-rows\", [from, to, after], null, []) || [];\r\n\r\n\t\t\t\trows = rows.concat(this.table.rowManager.rows);\r\n\r\n\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\tif(row.cells.length){\r\n\t\t\t\t\t\tvar cell = row.cells.splice(fromIndex, 1)[0];\r\n\t\t\t\t\t\trow.cells.splice(toIndex, 0, cell);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tscrollToColumn(column, position, ifVisible){\r\n\t\tvar left = 0,\r\n\t\toffset = 0,\r\n\t\tadjust = 0,\r\n\t\tcolEl = column.getElement();\r\n\r\n\t\treturn new Promise((resolve, reject) => {\r\n\r\n\t\t\tif(typeof position === \"undefined\"){\r\n\t\t\t\tposition = this.table.options.scrollToColumnPosition;\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof ifVisible === \"undefined\"){\r\n\t\t\t\tifVisible = this.table.options.scrollToColumnIfVisible;\r\n\t\t\t}\r\n\r\n\t\t\tif(column.visible){\r\n\r\n\t\t\t\t//align to correct position\r\n\t\t\t\tswitch(position){\r\n\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\tcase \"center\":\r\n\t\t\t\t\tadjust = -this.element.clientWidth / 2;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"right\":\r\n\t\t\t\t\tadjust = colEl.clientWidth - this.headersElement.clientWidth;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//check column visibility\r\n\t\t\t\tif(!ifVisible){\r\n\r\n\t\t\t\t\toffset = colEl.offsetLeft;\r\n\r\n\t\t\t\t\tif(offset > 0 && offset + colEl.offsetWidth < this.element.clientWidth){\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//calculate scroll position\r\n\t\t\t\tleft = colEl.offsetLeft + adjust;\r\n\r\n\t\t\t\tleft = Math.max(Math.min(left, this.table.rowManager.element.scrollWidth - this.table.rowManager.element.clientWidth),0);\r\n\r\n\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\tthis.scrollHorizontal(left);\r\n\r\n\t\t\t\tresolve();\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - Column not visible\");\r\n\t\t\t\treject(\"Scroll Error - Column not visible\");\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t}\r\n\r\n\t//////////////// Cell Management /////////////////\r\n\tgenerateCells(row){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tcells.push(column.generateCell(row));\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\t//////////////// Column Management /////////////////\r\n\tgetFlexBaseWidth(){\r\n\t\tvar totalWidth = this.table.element.clientWidth, //table element width\r\n\t\tfixedWidth = 0;\r\n\r\n\t\t//adjust for vertical scrollbar if present\r\n\t\tif(this.table.rowManager.element.scrollHeight > this.table.rowManager.element.clientHeight){\r\n\t\t\ttotalWidth -= this.table.rowManager.element.offsetWidth - this.table.rowManager.element.clientWidth;\r\n\t\t}\r\n\r\n\t\tthis.columnsByIndex.forEach(function(column){\r\n\t\t\tvar width, minWidth, colWidth;\r\n\r\n\t\t\tif(column.visible){\r\n\r\n\t\t\t\twidth = column.definition.width || 0;\r\n\r\n\t\t\t\tminWidth = parseInt(column.minWidth);\r\n\r\n\t\t\t\tif(typeof(width) == \"string\"){\r\n\t\t\t\t\tif(width.indexOf(\"%\") > -1){\r\n\t\t\t\t\t\tcolWidth = (totalWidth / 100) * parseInt(width) ;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tcolWidth = parseInt(width);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolWidth = width;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfixedWidth += colWidth > minWidth ? colWidth : minWidth;\r\n\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn fixedWidth;\r\n\t}\r\n\r\n\taddColumn(definition, before, nextToColumn){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar column = this._addColumn(definition, before, nextToColumn);\r\n\r\n\t\t\tthis._reIndexColumns();\r\n\r\n\t\t\tthis.dispatch(\"column-add\", definition, before, nextToColumn);\r\n\r\n\t\t\tif(this.layoutMode() != \"fitColumns\"){\r\n\t\t\t\tcolumn.reinitializeWidth();\r\n\t\t\t}\r\n\r\n\t\t\tthis.redraw(true);\r\n\r\n\t\t\tthis.table.rowManager.reinitialize();\r\n\r\n\t\t\tthis.renderer.rerenderColumns();\r\n\r\n\t\t\tresolve(column);\r\n\t\t});\r\n\t}\r\n\r\n\t//remove column from system\r\n\tderegisterColumn(column){\r\n\t\tvar field = column.getField(),\r\n\t\tindex;\r\n\r\n\t\t//remove from field list\r\n\t\tif(field){\r\n\t\t\tdelete this.columnsByField[field];\r\n\t\t}\r\n\r\n\t\t//remove from index list\r\n\t\tindex = this.columnsByIndex.indexOf(column);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.columnsByIndex.splice(index, 1);\r\n\t\t}\r\n\r\n\t\t//remove from column list\r\n\t\tindex = this.columns.indexOf(column);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.columns.splice(index, 1);\r\n\t\t}\r\n\r\n\t\tthis.verticalAlignHeaders();\r\n\r\n\t\tthis.redraw();\r\n\t}\r\n\r\n\t//redraw columns\r\n\tredraw(force){\r\n\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\tthis.verticalAlignHeaders();\r\n\t\t}\r\n\r\n\t\tif(force){\r\n\t\t\tthis.table.rowManager.resetScroll();\r\n\t\t\tthis.table.rowManager.reinitialize();\r\n\t\t}\r\n\r\n\t\tif(!this.confirm(\"table-redrawing\", force)){\r\n\t\t\tthis.layoutRefresh();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"table-redraw\", force);\r\n\r\n\t\tthis.table.footerManager.redraw();\r\n\t}\r\n}","//public row object\r\nexport default class RowComponent {\r\n\r\n\tconstructor (row){\r\n\t\tthis._row = row;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._row.table.componentFunctionBinder.handle(\"row\", target._row, name)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\tgetData(transform){\r\n\t\treturn this._row.getData(transform);\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._row.getElement();\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._row.getCells().forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tgetCell(column){\r\n\t\tvar cell = this._row.getCell(column);\r\n\t\treturn cell ? cell.getComponent() : false;\r\n\t}\r\n\r\n\tgetIndex(){\r\n\t\treturn this._row.getData(\"data\")[this._row.table.options.index];\r\n\t}\r\n\r\n\tgetPosition(active){\r\n\t\treturn this._row.table.rowManager.getRowPosition(this._row, active);\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn this._row.delete();\r\n\t}\r\n\r\n\tscrollTo(){\r\n\t\treturn this._row.table.rowManager.scrollToRow(this._row);\r\n\t}\r\n\r\n\tmove(to, after){\r\n\t\tthis._row.moveToRow(to, after);\r\n\t}\r\n\r\n\tupdate(data){\r\n\t\treturn this._row.updateData(data);\r\n\t}\r\n\r\n\tnormalizeHeight(){\r\n\t\tthis._row.normalizeHeight(true);\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._row;\r\n\t}\r\n\r\n\treformat(){\r\n\t\treturn this._row.reinitialize();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._row.table;\r\n\t}\r\n\r\n\tgetNextRow(){\r\n\t\tvar row = this._row.nextRow();\r\n\t\treturn row ? row.getComponent() : row;\r\n\t}\r\n\r\n\tgetPrevRow(){\r\n\t\tvar row = this._row.prevRow();\r\n\t\treturn row ? row.getComponent() : row;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport RowComponent from './RowComponent.js';\r\nimport Helpers from '../tools/Helpers.js';\r\n\r\nexport default class Row extends CoreFeature{\r\n\tconstructor (data, parent, type = \"row\"){\r\n\t\tsuper(parent.table);\r\n\t\t\r\n\t\tthis.parent = parent;\r\n\t\tthis.data = {};\r\n\t\tthis.type = type; //type of element\r\n\t\tthis.element = false;\r\n\t\tthis.modules = {}; //hold module variables;\r\n\t\tthis.cells = [];\r\n\t\tthis.height = 0; //hold element height\r\n\t\tthis.heightStyled = \"\"; //hold element height prestyled to improve render efficiency\r\n\t\tthis.manualHeight = false; //user has manually set row height\r\n\t\tthis.outerHeight = 0; //hold elements outer height\r\n\t\tthis.initialized = false; //element has been rendered\r\n\t\tthis.heightInitialized = false; //element has resized cells to fit\r\n\t\t\r\n\t\tthis.component = null;\r\n\t\t\r\n\t\tthis.created = false;\r\n\t\t\r\n\t\tthis.setData(data);\r\n\t}\r\n\t\r\n\tcreate(){\r\n\t\tif(!this.created){\r\n\t\t\tthis.created = true;\r\n\t\t\tthis.generateElement();\r\n\t\t}\r\n\t}\r\n\t\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-row\");\r\n\t\tel.setAttribute(\"role\", \"row\");\r\n\t\t\r\n\t\tthis.element = el;\r\n\t}\r\n\t\r\n\tgetElement(){\r\n\t\tthis.create();\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\tdetachElement(){\r\n\t\tif (this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgenerateElement(){\r\n\t\tthis.createElement();\r\n\t\tthis.dispatch(\"row-init\", this);\r\n\t}\r\n\t\r\n\tgenerateCells(){\r\n\t\tthis.cells = this.table.columnManager.generateCells(this);\r\n\t}\r\n\t\r\n\t//functions to setup on first render\r\n\tinitialize(force){\r\n\t\tthis.create();\r\n\t\t\r\n\t\tif(!this.initialized || force){\r\n\t\t\t\r\n\t\t\tthis.deleteCells();\r\n\t\t\t\r\n\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout-before\", this);\r\n\t\t\t\r\n\t\t\tthis.generateCells();\r\n\t\t\t\r\n\t\t\tthis.initialized = true;\r\n\t\t\t\r\n\t\t\tthis.table.columnManager.renderer.renderRowCells(this);\r\n\t\t\t\r\n\t\t\tif(force){\r\n\t\t\t\tthis.normalizeHeight();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout\", this);\r\n\t\t\t\r\n\t\t\tif(this.table.options.rowFormatter){\r\n\t\t\t\tthis.table.options.rowFormatter(this.getComponent());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout-after\", this);\r\n\t\t}else{\r\n\t\t\tthis.table.columnManager.renderer.rerenderRowCells(this);\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeHeight(){\r\n\t\tthis.heightInitialized = false;\r\n\t\t\r\n\t\tif(this.element && this.element.offsetParent !== null){\r\n\t\t\tthis.normalizeHeight(true);\r\n\t\t}\r\n\t}\r\n\r\n\tdeinitialize(){\r\n\t\tthis.initialized = false;\r\n\t}\r\n\t\r\n\tdeinitializeHeight(){\r\n\t\tthis.heightInitialized = false;\r\n\t}\r\n\t\r\n\treinitialize(children){\r\n\t\tthis.initialized = false;\r\n\t\tthis.heightInitialized = false;\r\n\t\t\r\n\t\tif(!this.manualHeight){\r\n\t\t\tthis.height = 0;\r\n\t\t\tthis.heightStyled = \"\";\r\n\t\t}\r\n\t\t\r\n\t\tif(this.element && this.element.offsetParent !== null){\r\n\t\t\tthis.initialize(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatch(\"row-relayout\", this);\r\n\t}\r\n\t\r\n\t//get heights when doing bulk row style calcs in virtual DOM\r\n\tcalcHeight(force){\r\n\t\tvar maxHeight = 0,\r\n\t\tminHeight;\r\n\t\t\r\n\t\tif(this.table.options.rowHeight){\r\n\t\t\tthis.height = this.table.options.rowHeight;\r\n\t\t}else{\r\n\t\t\tminHeight = this.table.options.resizableRows ? this.element.clientHeight : 0;\r\n\t\t\t\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tvar height = cell.getHeight();\r\n\t\t\t\tif(height > maxHeight){\r\n\t\t\t\t\tmaxHeight = height;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(force){\r\n\t\t\t\tthis.height = Math.max(maxHeight, minHeight);\r\n\t\t\t}else{\r\n\t\t\t\tthis.height = this.manualHeight ? this.height : Math.max(maxHeight, minHeight);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.heightStyled = this.height ? this.height + \"px\" : \"\";\r\n\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t}\r\n\t\r\n\t//set of cells\r\n\tsetCellHeight(){\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setHeight();\r\n\t\t});\r\n\t\t\r\n\t\tthis.heightInitialized = true;\r\n\t}\r\n\t\r\n\tclearCellHeight(){\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.clearHeight();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//normalize the height of elements in the row\r\n\tnormalizeHeight(force){\r\n\t\tif(force && !this.table.options.rowHeight){\r\n\t\t\tthis.clearCellHeight();\r\n\t\t}\r\n\t\t\r\n\t\tthis.calcHeight(force);\r\n\t\t\r\n\t\tthis.setCellHeight();\r\n\t}\r\n\t\r\n\t//set height of rows\r\n\tsetHeight(height, force){\r\n\t\tif(this.height != height || force){\r\n\t\t\t\r\n\t\t\tthis.manualHeight = true;\r\n\t\t\t\r\n\t\t\tthis.height = height;\r\n\t\t\tthis.heightStyled = height ? height + \"px\" : \"\";\r\n\t\t\t\r\n\t\t\tthis.setCellHeight();\r\n\t\t\t\r\n\t\t\t// this.outerHeight = this.element.outerHeight();\r\n\t\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return rows outer height\r\n\tgetHeight(){\r\n\t\treturn this.outerHeight;\r\n\t}\r\n\t\r\n\t//return rows outer Width\r\n\tgetWidth(){\r\n\t\treturn this.element.offsetWidth;\r\n\t}\r\n\t\r\n\t//////////////// Cell Management /////////////////\r\n\tdeleteCell(cell){\r\n\t\tvar index = this.cells.indexOf(cell);\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.cells.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////// Data Management /////////////////\r\n\tsetData(data){\r\n\t\tthis.data = this.chain(\"row-data-init-before\", [this, data], undefined, data);\r\n\t\t\r\n\t\tthis.dispatch(\"row-data-init-after\", this);\r\n\t}\r\n\t\r\n\t//update the rows data\r\n\tupdateData(updatedData){\r\n\t\tvar visible = this.element && Helpers.elVisible(this.element),\r\n\t\ttempData = {},\r\n\t\tnewRowData;\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\r\n\t\t\tif(typeof updatedData === \"string\"){\r\n\t\t\t\tupdatedData = JSON.parse(updatedData);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-save-before\", this);\r\n\t\t\t\r\n\t\t\tif(this.subscribed(\"row-data-changing\")){\r\n\t\t\t\ttempData = Object.assign(tempData, this.data);\r\n\t\t\t\ttempData = Object.assign(tempData, updatedData);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tnewRowData = this.chain(\"row-data-changing\", [this, tempData, updatedData], null, updatedData);\r\n\t\t\t\r\n\t\t\t//set data\r\n\t\t\tfor (var attrname in newRowData) {\r\n\t\t\t\tthis.data[attrname] = newRowData[attrname];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-save-after\", this);\r\n\t\t\t\r\n\t\t\t//update affected cells only\r\n\t\t\tfor (var attrname in updatedData) {\r\n\t\t\t\t\r\n\t\t\t\tlet columns = this.table.columnManager.getColumnsByFieldRoot(attrname);\r\n\t\t\t\t\r\n\t\t\t\tcolumns.forEach((column) => {\r\n\t\t\t\t\tlet cell = this.getCell(column.getField());\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(cell){\r\n\t\t\t\t\t\tlet value = column.getFieldValue(newRowData);\r\n\t\t\t\t\t\tif(cell.getValue() != value){\r\n\t\t\t\t\t\t\tcell.setValueProcessData(value);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(visible){\r\n\t\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Partial reinitialization if visible\r\n\t\t\tif(visible){\r\n\t\t\t\tthis.normalizeHeight(true);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.rowFormatter){\r\n\t\t\t\t\tthis.table.options.rowFormatter(this.getComponent());\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.initialized = false;\r\n\t\t\t\tthis.height = 0;\r\n\t\t\t\tthis.heightStyled = \"\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-changed\", this, visible, updatedData);\r\n\t\t\t\r\n\t\t\t//this.reinitialize();\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"rowUpdated\", this.getComponent());\r\n\t\t\t\r\n\t\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetData(transform){\r\n\t\tif(transform){\r\n\t\t\treturn this.chain(\"row-data-retrieve\", [this, transform], null, this.data);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.data;\r\n\t}\r\n\t\r\n\tgetCell(column){\r\n\t\tvar match = false;\r\n\t\t\r\n\t\tcolumn = this.table.columnManager.findColumn(column);\r\n\t\t\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.generateCells();\r\n\t\t}\r\n\t\t\r\n\t\tmatch = this.cells.find(function(cell){\r\n\t\t\treturn cell.column === column;\r\n\t\t});\r\n\t\t\r\n\t\treturn match;\r\n\t}\r\n\t\r\n\tgetCellIndex(findCell){\r\n\t\treturn this.cells.findIndex(function(cell){\r\n\t\t\treturn cell === findCell;\r\n\t\t});\r\n\t}\r\n\t\r\n\tfindCell(subject){\r\n\t\treturn this.cells.find((cell) => {\r\n\t\t\treturn cell.element === subject;\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetCells(){\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.generateCells();\r\n\t\t}\r\n\t\t\r\n\t\treturn this.cells;\r\n\t}\r\n\t\r\n\tnextRow(){\r\n\t\tvar row = this.table.rowManager.nextDisplayRow(this, true);\r\n\t\treturn row || false;\r\n\t}\r\n\t\r\n\tprevRow(){\r\n\t\tvar row = this.table.rowManager.prevDisplayRow(this, true);\r\n\t\treturn row || false;\r\n\t}\r\n\t\r\n\tmoveToRow(to, before){\r\n\t\tvar toRow = this.table.rowManager.findRow(to);\r\n\t\t\r\n\t\tif(toRow){\r\n\t\t\tthis.table.rowManager.moveRowActual(this, toRow, !before);\r\n\t\t\tthis.table.rowManager.refreshActiveData(\"display\", false, true);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching row found:\", to);\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////// Actions /////////////////////\r\n\tdelete(){\r\n\t\tthis.dispatch(\"row-delete\", this);\r\n\t\t\r\n\t\tthis.deleteActual();\r\n\t\t\r\n\t\treturn Promise.resolve();\r\n\t}\r\n\t\r\n\tdeleteActual(blockRedraw){\r\n\t\tvar index = this.table.rowManager.getRowIndex(this);\r\n\t\t\r\n\t\tthis.detatchModules();\r\n\t\t\r\n\t\tthis.table.rowManager.deleteRow(this, blockRedraw);\r\n\t\t\r\n\t\tthis.deleteCells();\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.heightInitialized = false;\r\n\t\tthis.element = false;\r\n\t\t\r\n\t\tthis.dispatch(\"row-deleted\", this);\r\n\t}\r\n\t\r\n\tdetatchModules(){\r\n\t\tthis.dispatch(\"row-deleting\", this);\r\n\t}\r\n\t\r\n\tdeleteCells(){\r\n\t\tvar cellCount = this.cells.length;\r\n\t\t\r\n\t\tfor(let i = 0; i < cellCount; i++){\r\n\t\t\tthis.cells[0].delete();\r\n\t\t}\r\n\t}\r\n\t\r\n\twipe(){\r\n\t\tthis.detatchModules();\r\n\t\tthis.deleteCells();\r\n\t\t\r\n\t\tif(this.element){\r\n\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\t\r\n\t\t\tif(this.element.parentNode){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.element = false;\r\n\t\tthis.modules = {};\r\n\t}\r\n\t\r\n\tgetGroup(){\r\n\t\treturn this.modules.group || false;\r\n\t}\r\n\t\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new RowComponent(this);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.component;\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class BaiscVertical extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.verticalFillMode = \"fill\";\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t}\r\n\r\n\tclearRows(){\r\n\t\tvar element = this.tableElement;\r\n\r\n\t\t// element.children.detach();\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\telement.scrollTop = 0;\r\n\t\telement.scrollLeft = 0;\r\n\r\n\t\telement.style.minWidth = \"\";\r\n\t\telement.style.minHeight = \"\";\r\n\t\telement.style.display = \"\";\r\n\t\telement.style.visibility = \"\";\r\n\t}\r\n\r\n\trenderRows(){\r\n\t\tvar element = this.tableElement,\r\n\t\tonlyGroupHeaders = true;\r\n\r\n\t\tthis.rows().forEach((row, index) => {\r\n\t\t\tthis.styleRow(row, index);\r\n\t\t\telement.appendChild(row.getElement());\r\n\t\t\trow.initialize(true);\r\n\r\n\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\tonlyGroupHeaders = false;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(onlyGroupHeaders){\r\n\t\t\telement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t}else{\r\n\t\t\telement.style.minWidth = \"\";\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trerenderRows(callback){\r\n\t\tthis.clearRows();\r\n\t\tthis.renderRows();\r\n\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\tvar rowTop = Helpers.elOffset(row.getElement()).top;\r\n\r\n\t\treturn !(Math.abs(this.elementVertical.scrollTop - rowTop) > Math.abs(this.elementVertical.scrollTop + this.elementVertical.clientHeight - rowTop));\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tthis.elementVertical.scrollTop = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top + this.elementVertical.scrollTop;\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\treturn this.rows();\r\n\t}\r\n\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class VirtualDomVertical extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.verticalFillMode = \"fill\";\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.vDomRowHeight = 20; //approximation of row heights for padding\r\n\r\n\t\tthis.vDomTop = 0; //hold position for first rendered row in the virtual DOM\r\n\t\tthis.vDomBottom = 0; //hold possition for last rendered row in the virtual DOM\r\n\r\n\t\tthis.vDomScrollPosTop = 0; //last scroll position of the vDom top;\r\n\t\tthis.vDomScrollPosBottom = 0; //last scroll position of the vDom bottom;\r\n\r\n\t\tthis.vDomTopPad = 0; //hold value of padding for top of virtual DOM\r\n\t\tthis.vDomBottomPad = 0; //hold value of padding for bottom of virtual DOM\r\n\r\n\t\tthis.vDomMaxRenderChain = 90; //the maximum number of dom elements that can be rendered in 1 go\r\n\r\n\t\tthis.vDomWindowBuffer = 0; //window row buffer before removing elements, to smooth scrolling\r\n\r\n\t\tthis.vDomWindowMinTotalRows = 20; //minimum number of rows to be generated in virtual dom (prevent buffering issues on tables with tall rows)\r\n\t\tthis.vDomWindowMinMarginRows = 5; //minimum number of rows to be generated in virtual dom margin\r\n\r\n\t\tthis.vDomTopNewRows = []; //rows to normalize after appending to optimize render speed\r\n\t\tthis.vDomBottomNewRows = []; //rows to normalize after appending to optimize render speed\r\n\t}\r\n\r\n\t//////////////////////////////////////\r\n\t///////// Public Functions ///////////\r\n\t//////////////////////////////////////\r\n\r\n\tclearRows(){\r\n\t\tvar element = this.tableElement;\r\n\r\n\t\t// element.children.detach();\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\telement.style.paddingTop = \"\";\r\n\t\telement.style.paddingBottom = \"\";\r\n\t\t// element.style.minWidth = \"\";\r\n\t\telement.style.minHeight = \"\";\r\n\t\telement.style.display = \"\";\r\n\t\telement.style.visibility = \"\";\r\n\r\n\t\tthis.elementVertical.scrollTop = 0;\r\n\t\tthis.elementVertical.scrollLeft = 0;\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.vDomTop = 0;\r\n\t\tthis.vDomBottom = 0;\r\n\t\tthis.vDomTopPad = 0;\r\n\t\tthis.vDomBottomPad = 0;\r\n\t\tthis.vDomScrollPosTop = 0;\r\n\t\tthis.vDomScrollPosBottom = 0;\r\n\t}\r\n\r\n\trenderRows(){\r\n\t\tthis._virtualRenderFill();\r\n\t}\r\n\r\n\trerenderRows(callback){\r\n\t\tvar scrollTop = this.elementVertical.scrollTop;\r\n\t\tvar topRow = false;\r\n\t\tvar topOffset = false;\r\n\r\n\t\tvar left = this.table.rowManager.scrollLeft;\r\n\r\n\t\tvar rows = this.rows();\r\n\r\n\t\tfor(var i = this.vDomTop; i <= this.vDomBottom; i++){\r\n\r\n\t\t\tif(rows[i]){\r\n\t\t\t\tvar diff = scrollTop - rows[i].getElement().offsetTop;\r\n\r\n\t\t\t\tif(topOffset === false || Math.abs(diff) < topOffset){\r\n\t\t\t\t\ttopOffset = diff;\r\n\t\t\t\t\ttopRow = i;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\trows.forEach((row) => {\r\n\t\t\trow.deinitializeHeight();\r\n\t\t});\r\n\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\r\n\t\tthis._virtualRenderFill((topRow === false ? this.rows.length - 1 : topRow), true, topOffset || 0);\r\n\r\n\t\tthis.scrollColumns(left);\r\n\t}\r\n\r\n\tscrollColumns(left){\r\n\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t}\r\n\r\n\tscrollRows(top, dir){\r\n\t\tvar topDiff = top - this.vDomScrollPosTop;\r\n\t\tvar bottomDiff = top - this.vDomScrollPosBottom;\r\n\t\tvar margin = this.vDomWindowBuffer * 2;\r\n\t\tvar rows = this.rows();\r\n\r\n\t\tthis.scrollTop = top;\r\n\r\n\t\tif(-topDiff > margin || bottomDiff > margin){\r\n\t\t\t//if big scroll redraw table;\r\n\t\t\tvar left = this.table.rowManager.scrollLeft;\r\n\t\t\tthis._virtualRenderFill(Math.floor((this.elementVertical.scrollTop / this.elementVertical.scrollHeight) * rows.length));\r\n\t\t\tthis.scrollColumns(left);\r\n\t\t}else{\r\n\r\n\t\t\tif(dir){\r\n\t\t\t\t//scrolling up\r\n\t\t\t\tif(topDiff < 0){\r\n\t\t\t\t\tthis._addTopRow(rows, -topDiff);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(bottomDiff < 0){\r\n\t\t\t\t\t//hide bottom row if needed\r\n\t\t\t\t\tif(this.vDomScrollHeight - this.scrollTop > this.vDomWindowBuffer){\r\n\t\t\t\t\t\tthis._removeBottomRow(rows, -bottomDiff);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomScrollPosBottom = this.scrollTop;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\r\n\t\t\t\tif(bottomDiff >= 0){\r\n\t\t\t\t\tthis._addBottomRow(rows, bottomDiff);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//scrolling down\r\n\t\t\t\tif(topDiff >= 0){\r\n\t\t\t\t\t//hide top row if needed\r\n\t\t\t\t\tif(this.scrollTop > this.vDomWindowBuffer){\r\n\t\t\t\t\t\tthis._removeTopRow(rows, topDiff);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomScrollPosTop = this.scrollTop;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tresize(){\r\n\t\tthis.vDomWindowBuffer = this.table.options.renderVerticalBuffer || this.elementVertical.clientHeight;\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\tvar rowIndex = this.rows().indexOf(row);\r\n\r\n\t\treturn !(Math.abs(this.vDomTop - rowIndex) > Math.abs(this.vDomBottom - rowIndex));\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\tvar index = this.rows().indexOf(row);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis._virtualRenderFill(index, true);\r\n\t\t}\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\tvar topEdge = this.elementVertical.scrollTop,\r\n\t\tbottomEdge = this.elementVertical.clientHeight + topEdge,\r\n\t\ttopFound = false,\r\n\t\ttopRow = 0,\r\n\t\tbottomRow = 0,\r\n\t\trows = this.rows();\r\n\r\n\t\tif(includingBuffer){\r\n\t\t\ttopRow = this.vDomTop;\r\n\t\t\tbottomRow = this.vDomBottom;\r\n\t\t}else{\r\n\t\t\tfor(var i = this.vDomTop; i <= this.vDomBottom; i++){\r\n\t\t\t\tif(rows[i]){\r\n\t\t\t\t\tif(!topFound){\r\n\t\t\t\t\t\tif((topEdge - rows[i].getElement().offsetTop) >= 0){\r\n\t\t\t\t\t\t\ttopRow = i;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\ttopFound = true;\r\n\r\n\t\t\t\t\t\t\tif(bottomEdge - rows[i].getElement().offsetTop >= 0){\r\n\t\t\t\t\t\t\t\tbottomRow = i;\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(bottomEdge - rows[i].getElement().offsetTop >= 0){\r\n\t\t\t\t\t\t\tbottomRow = i;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn rows.slice(topRow, bottomRow + 1);\r\n\t}\r\n\r\n\t//////////////////////////////////////\r\n\t//////// Internal Rendering //////////\r\n\t//////////////////////////////////////\r\n\r\n\t//full virtual render\r\n\t_virtualRenderFill(position, forceMove, offset){\r\n\t\tvar\telement = this.tableElement,\r\n\t\tholder = this.elementVertical,\r\n\t\ttopPad = 0,\r\n\t\trowsHeight = 0,\r\n\t\theightOccupied = 0,\r\n\t\ttopPadHeight = 0,\r\n\t\ti = 0,\r\n\t\trows = this.rows(),\r\n\t\trowsCount = rows.length,\r\n\t\tcontainerHeight = this.elementVertical.clientHeight;\r\n\r\n\t\tposition = position || 0;\r\n\r\n\t\toffset = offset || 0;\r\n\r\n\t\tif(!position){\r\n\t\t\tthis.clear();\r\n\t\t}else{\r\n\t\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\t\t//check if position is too close to bottom of table\r\n\t\t\theightOccupied = (rowsCount - position + 1) * this.vDomRowHeight;\r\n\r\n\t\t\tif(heightOccupied < containerHeight){\r\n\t\t\t\tposition -= Math.ceil((containerHeight - heightOccupied) / this.vDomRowHeight);\r\n\t\t\t\tif(position < 0){\r\n\t\t\t\t\tposition = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//calculate initial pad\r\n\t\t\ttopPad = Math.min(Math.max(Math.floor(this.vDomWindowBuffer / this.vDomRowHeight), this.vDomWindowMinMarginRows), position);\r\n\t\t\tposition -= topPad;\r\n\t\t}\r\n\r\n\t\tif(rowsCount && Helpers.elVisible(this.elementVertical)){\r\n\t\t\tthis.vDomTop = position;\r\n\r\n\t\t\tthis.vDomBottom = position -1;\r\n\r\n\t\t\twhile ((rowsHeight <= containerHeight + this.vDomWindowBuffer || i < this.vDomWindowMinTotalRows) && this.vDomBottom < rowsCount -1){\r\n\t\t\t\tvar index = this.vDomBottom + 1,\r\n\t\t\t\trow = rows[index],\r\n\t\t\t\trowHeight = 0;\r\n\r\n\t\t\t\tthis.styleRow(row, index);\r\n\r\n\t\t\t\telement.appendChild(row.getElement());\r\n\r\n\t\t\t\trow.initialize();\r\n\r\n\t\t\t\tif(!row.heightInitialized){\r\n\t\t\t\t\trow.normalizeHeight(true);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowHeight = row.getHeight();\r\n\r\n\t\t\t\tif(i < topPad){\r\n\t\t\t\t\ttopPadHeight += rowHeight;\r\n\t\t\t\t}else{\r\n\t\t\t\t\trowsHeight += rowHeight;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.vDomBottom ++;\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\r\n\t\t\tif(!position){\r\n\t\t\t\tthis.vDomTopPad = 0;\r\n\t\t\t\t//adjust rowheight to match average of rendered elements\r\n\t\t\t\tthis.vDomRowHeight = Math.floor((rowsHeight + topPadHeight) / i);\r\n\t\t\t\tthis.vDomBottomPad = this.vDomRowHeight * (rowsCount - this.vDomBottom -1);\r\n\r\n\t\t\t\tthis.vDomScrollHeight = topPadHeight + rowsHeight + this.vDomBottomPad - containerHeight;\r\n\t\t\t}else{\r\n\t\t\t\tthis.vDomTopPad = !forceMove ? this.scrollTop - topPadHeight : (this.vDomRowHeight * this.vDomTop) + offset;\r\n\t\t\t\tthis.vDomBottomPad = this.vDomBottom == rowsCount-1 ? 0 : Math.max(this.vDomScrollHeight - this.vDomTopPad - rowsHeight - topPadHeight, 0);\r\n\t\t\t}\r\n\r\n\t\t\telement.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\telement.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\r\n\t\t\tif(forceMove){\r\n\t\t\t\tthis.scrollTop = this.vDomTopPad + (topPadHeight) + offset - (this.elementVertical.scrollWidth > this.elementVertical.clientWidth ? this.elementVertical.offsetHeight - containerHeight : 0);\r\n\t\t\t}\r\n\r\n\t\t\tthis.scrollTop = Math.min(this.scrollTop, this.elementVertical.scrollHeight - containerHeight);\r\n\r\n\t\t\t//adjust for horizontal scrollbar if present (and not at top of table)\r\n\t\t\tif(this.elementVertical.scrollWidth > this.elementVertical.offsetWidth && forceMove){\r\n\t\t\t\tthis.scrollTop += this.elementVertical.offsetHeight - containerHeight;\r\n\t\t\t}\r\n\r\n\t\t\tthis.vDomScrollPosTop = this.scrollTop;\r\n\t\t\tthis.vDomScrollPosBottom = this.scrollTop;\r\n\r\n\t\t\tholder.scrollTop = this.scrollTop;\r\n\r\n\t\t\tthis.dispatch(\"render-virtual-fill\");\r\n\t\t}\r\n\t}\r\n\r\n\t_addTopRow(rows, fillableSpace){\r\n\t\tvar table = this.tableElement,\r\n\t\taddedRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\tindex = this.vDomTop -1,\r\n\t\ti = 0;\r\n\r\n\t\twhile(true){\r\n\t\t\tif(this.vDomTop){\r\n\t\t\t\tlet row = rows[index],\r\n\t\t\t\trowHeight, initialized;\r\n\r\n\t\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\t\t\t\t\tinitialized = row.initialized;\r\n\r\n\t\t\t\t\tif(fillableSpace >= rowHeight){\r\n\r\n\t\t\t\t\t\tthis.styleRow(row, index);\r\n\t\t\t\t\t\ttable.insertBefore(row.getElement(), table.firstChild);\r\n\r\n\t\t\t\t\t\tif(!row.initialized || !row.heightInitialized){\r\n\t\t\t\t\t\t\taddedRows.push(row);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\trow.initialize();\r\n\r\n\t\t\t\t\t\tif(!initialized){\r\n\t\t\t\t\t\t\trowHeight = row.getElement().offsetHeight;\r\n\r\n\t\t\t\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\t\tthis.vDomTop--;\r\n\t\t\t\t\t\tindex--;\r\n\t\t\t\t\t\ti++;\r\n\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of addedRows){\r\n\t\t\trow.clearCellHeight();\r\n\t\t}\r\n\r\n\t\tthis._quickNormalizeRowHeight(addedRows);\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomTopPad -= paddingAdjust;\r\n\r\n\t\t\tif(this.vDomTopPad < 0){\r\n\t\t\t\tthis.vDomTopPad = index * this.vDomRowHeight;\r\n\t\t\t}\r\n\r\n\t\t\tif(index < 1){\r\n\t\t\t\tthis.vDomTopPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\ttable.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\tthis.vDomScrollPosTop -= paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_removeTopRow(rows, fillableSpace){\r\n\t\tvar removableRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\ti = 0;\r\n\r\n\t\twhile(true){\r\n\t\t\tlet row = rows[this.vDomTop],\r\n\t\t\trowHeight, diff;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\t\t\t\t\tthis.vDomTop++;\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tremovableRows.push(row);\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of removableRows){\r\n\t\t\tlet rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomTopPad += paddingAdjust;\r\n\t\t\tthis.tableElement.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\tthis.vDomScrollPosTop += this.vDomTop ? paddingAdjust : paddingAdjust + this.vDomWindowBuffer;\r\n\t\t}\r\n\t}\r\n\r\n\t_addBottomRow(rows, fillableSpace){\r\n\t\tvar table = this.tableElement,\r\n\t\taddedRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\tindex = this.vDomBottom + 1,\r\n\t\ti = 0;\r\n\r\n\t\twhile(true){\r\n\t\t\tlet row = rows[index],\r\n\t\t\trowHeight, initialized;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\t\t\t\tinitialized = row.initialized;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\r\n\t\t\t\t\tthis.styleRow(row, index);\r\n\t\t\t\t\ttable.appendChild(row.getElement());\r\n\r\n\t\t\t\t\tif(!row.initialized || !row.heightInitialized){\r\n\t\t\t\t\t\taddedRows.push(row);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\trow.initialize();\r\n\r\n\t\t\t\t\tif(!initialized){\r\n\t\t\t\t\t\trowHeight = row.getElement().offsetHeight;\r\n\r\n\t\t\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tthis.vDomBottom++;\r\n\t\t\t\t\tindex++;\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of addedRows){\r\n\t\t\trow.clearCellHeight();\r\n\t\t}\r\n\r\n\t\tthis._quickNormalizeRowHeight(addedRows);\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomBottomPad -= paddingAdjust;\r\n\r\n\t\t\tif(this.vDomBottomPad < 0 || index == rows.length -1){\r\n\t\t\t\tthis.vDomBottomPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\ttable.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\t\t\tthis.vDomScrollPosBottom += paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_removeBottomRow(rows, fillableSpace){\r\n\t\tvar removableRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\ti = 0;\r\n\r\n\t\twhile(true){\r\n\t\t\tlet row = rows[this.vDomBottom],\r\n\t\t\trowHeight, diff;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\t\t\t\t\tthis.vDomBottom --;\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tremovableRows.push(row);\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of removableRows){\r\n\t\t\tlet rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomBottomPad += paddingAdjust;\r\n\r\n\t\t\tif(this.vDomBottomPad < 0){\r\n\t\t\t\tthis.vDomBottomPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\tthis.tableElement.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\t\t\tthis.vDomScrollPosBottom -= paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_quickNormalizeRowHeight(rows){\r\n\t\tfor(let row of rows){\r\n\t\t\trow.calcHeight();\r\n\t\t}\r\n\r\n\t\tfor(let row of rows){\r\n\t\t\trow.setCellHeight();\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Row from './row/Row.js';\r\nimport RowComponent from './row/RowComponent.js';\r\nimport Helpers from './tools/Helpers.js';\r\n\r\nimport RendererBasicVertical from './rendering/renderers/BasicVertical.js';\r\nimport RendererVirtualDomVertical from './rendering/renderers/VirtualDomVertical.js';\r\n\r\nexport default class RowManager extends CoreFeature{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.element = this.createHolderElement(); //containing element\r\n\t\tthis.tableElement = this.createTableElement(); //table element\r\n\t\tthis.heightFixer = this.createTableElement(); //table element\r\n\t\tthis.placeholder = null; //placeholder element\r\n\t\tthis.placeholderContents = null; //placeholder element\r\n\t\t\r\n\t\tthis.firstRender = false; //handle first render\r\n\t\tthis.renderMode = \"virtual\"; //current rendering mode\r\n\t\tthis.fixedHeight = false; //current rendering mode\r\n\t\t\r\n\t\tthis.rows = []; //hold row data objects\r\n\t\tthis.activeRowsPipeline = []; //hold calculation of active rows\r\n\t\tthis.activeRows = []; //rows currently available to on display in the table\r\n\t\tthis.activeRowsCount = 0; //count of active rows\r\n\t\t\r\n\t\tthis.displayRows = []; //rows currently on display in the table\r\n\t\tthis.displayRowsCount = 0; //count of display rows\r\n\t\t\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.rowNumColumn = false; //hold column component for row number column\r\n\t\t\r\n\t\tthis.redrawBlock = false; //prevent redraws to allow multiple data manipulations before continuing\r\n\t\tthis.redrawBlockRestoreConfig = false; //store latest redraw function calls for when redraw is needed\r\n\t\tthis.redrawBlockRenderInPosition = false; //store latest redraw function calls for when redraw is needed\r\n\t\t\r\n\t\tthis.dataPipeline = []; //hold data pipeline tasks\r\n\t\tthis.displayPipeline = []; //hold data display pipeline tasks\r\n\t\t\r\n\t\tthis.renderer = null;\r\n\t}\r\n\t\r\n\t//////////////// Setup Functions /////////////////\r\n\t\r\n\tcreateHolderElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-tableholder\");\r\n\t\tel.setAttribute(\"tabindex\", 0);\r\n\t\tel.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tcreateTableElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-table\");\r\n\t\tel.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tinitializePlaceholder(){\r\n\t\t//configure placeholder element\r\n\t\tif(typeof this.table.options.placeholder == \"string\"){\r\n\t\t\tlet el = document.createElement(\"div\");\r\n\t\t\tel.classList.add(\"tabulator-placeholder\");\r\n\t\t\t\r\n\t\t\tlet contents = document.createElement(\"div\");\r\n\t\t\tcontents.classList.add(\"tabulator-placeholder-contents\");\r\n\t\t\tcontents.innerHTML = this.table.options.placeholder;\r\n\t\t\t\r\n\t\t\tel.appendChild(contents);\r\n\t\t\t\r\n\t\t\tthis.placeholderContents = contents;\r\n\t\t\tthis.placeholder = el;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return containing element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\t//return table element\r\n\tgetTableElement(){\r\n\t\treturn this.tableElement;\r\n\t}\r\n\t\r\n\t//return position of row in table\r\n\tgetRowPosition(row, active){\r\n\t\tif(active){\r\n\t\t\treturn this.activeRows.indexOf(row);\r\n\t\t}else{\r\n\t\t\treturn this.rows.indexOf(row);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.initializePlaceholder()\r\n\t\tthis.initializeRenderer();\r\n\t\t\r\n\t\t//initialize manager\r\n\t\tthis.element.appendChild(this.tableElement);\r\n\t\t\r\n\t\tthis.firstRender = true;\r\n\t\t\r\n\t\t//scroll header along with table body\r\n\t\tthis.element.addEventListener(\"scroll\", () => {\r\n\t\t\tvar left = this.element.scrollLeft,\r\n\t\t\tleftDir = this.scrollLeft > left,\r\n\t\t\ttop = this.element.scrollTop,\r\n\t\t\ttopDir = this.scrollTop > top;\r\n\t\t\t\r\n\t\t\t//handle horizontal scrolling\r\n\t\t\tif(this.scrollLeft != left){\r\n\t\t\t\tthis.scrollLeft = left;\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"scroll-horizontal\", left, leftDir);\r\n\t\t\t\tthis.dispatchExternal(\"scrollHorizontal\", left, leftDir);\r\n\r\n\t\t\t\tthis._positionPlaceholder();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//handle vertical scrolling\r\n\t\t\tif(this.scrollTop != top){\r\n\t\t\t\tthis.scrollTop = top;\r\n\t\t\t\t\r\n\t\t\t\tthis.renderer.scrollRows(top, topDir);\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"scroll-vertical\", top, topDir);\r\n\t\t\t\tthis.dispatchExternal(\"scrollVertical\", top, topDir);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t////////////////// Row Manipulation //////////////////\r\n\tfindRow(subject){\r\n\t\tif(typeof subject == \"object\"){\r\n\t\t\tif(subject instanceof Row){\r\n\t\t\t\t//subject is row element\r\n\t\t\t\treturn subject;\r\n\t\t\t}else if(subject instanceof RowComponent){\r\n\t\t\t\t//subject is public row component\r\n\t\t\t\treturn subject._getSelf() || false;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\t\t\t\t//subject is a HTML element of the row\r\n\t\t\t\tlet match = this.rows.find((row) => {\r\n\t\t\t\t\treturn row.getElement() === subject;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\treturn match || false;\r\n\t\t\t}\r\n\t\t}else if(typeof subject == \"undefined\" || subject === null){\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the index of the row\r\n\t\t\tlet match = this.rows.find((row) => {\r\n\t\t\t\treturn row.data[this.table.options.index] == subject;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\treturn match || false;\r\n\t\t}\r\n\t\t\r\n\t\t//catch all for any other type of input\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tgetRowFromDataObject(data){\r\n\t\tvar match = this.rows.find((row) => {\r\n\t\t\treturn row.data === data;\r\n\t\t});\r\n\t\t\r\n\t\treturn match || false;\r\n\t}\r\n\t\r\n\tgetRowFromPosition(position, active){\r\n\t\tif(active){\r\n\t\t\treturn this.activeRows[position];\r\n\t\t}else{\r\n\t\t\treturn this.rows[position];\r\n\t\t}\r\n\t}\r\n\t\r\n\tscrollToRow(row, position, ifVisible){\r\n\t\treturn this.renderer.scrollToRowPosition(row, position, ifVisible);\r\n\t}\r\n\t\r\n\t////////////////// Data Handling //////////////////\r\n\tsetData(data, renderInPosition, columnsChanged){\r\n\t\treturn new Promise((resolve, reject)=>{\r\n\t\t\tif(renderInPosition && this.getDisplayRows().length){\r\n\t\t\t\tif(this.table.options.pagination){\r\n\t\t\t\t\tthis._setDataActual(data, true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.reRenderInPosition(() => {\r\n\t\t\t\t\t\tthis._setDataActual(data);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.options.autoColumns && columnsChanged && this.table.initialized){\r\n\t\t\t\t\tthis.table.columnManager.generateColumnsFromRowData(data);\r\n\t\t\t\t}\r\n\t\t\t\tthis.resetScroll();\r\n\t\t\t\t\r\n\t\t\t\tthis._setDataActual(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\t\r\n\t_setDataActual(data, renderInPosition){\r\n\t\tthis.dispatchExternal(\"dataProcessing\", data);\r\n\t\t\r\n\t\tthis._wipeElements();\r\n\t\t\r\n\t\tif(Array.isArray(data)){\r\n\t\t\tthis.dispatch(\"data-processing\", data);\r\n\t\t\t\r\n\t\t\tdata.forEach((def, i) => {\r\n\t\t\t\tif(def && typeof def === \"object\"){\r\n\t\t\t\t\tvar row = new Row(def, this);\r\n\t\t\t\t\tthis.rows.push(row);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Data Loading Warning - Invalid row data detected and ignored, expecting object but received:\", def);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.refreshActiveData(false, false, renderInPosition);\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"data-processed\", data);\r\n\t\t\tthis.dispatchExternal(\"dataProcessed\", data);\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Data Loading Error - Unable to process data due to invalid data type \\nExpecting: array \\nReceived: \", typeof data, \"\\nData: \", data);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_wipeElements(){\r\n\t\tthis.dispatch(\"rows-wipe\");\r\n\t\t\r\n\t\tthis.rows.forEach((row) => {\r\n\t\t\trow.wipe();\r\n\t\t});\r\n\t\t\r\n\t\tthis.rows = [];\r\n\t\tthis.activeRows = [];\r\n\t\tthis.activeRowsPipeline = [];\r\n\t\tthis.activeRowsCount = 0;\r\n\t\tthis.displayRows = [];\r\n\t\tthis.displayRowsCount = 0;\r\n\t\t\r\n\t\tthis.adjustTableSize();\r\n\t}\r\n\t\r\n\tdeleteRow(row, blockRedraw){\r\n\t\tvar allIndex = this.rows.indexOf(row),\r\n\t\tactiveIndex = this.activeRows.indexOf(row);\r\n\t\t\r\n\t\tif(activeIndex > -1){\r\n\t\t\tthis.activeRows.splice(activeIndex, 1);\r\n\t\t}\r\n\t\t\r\n\t\tif(allIndex > -1){\r\n\t\t\tthis.rows.splice(allIndex, 1);\r\n\t\t}\r\n\t\t\r\n\t\tthis.setActiveRows(this.activeRows);\r\n\t\t\r\n\t\tthis.displayRowIterator((rows) => {\r\n\t\t\tvar displayIndex = rows.indexOf(row);\r\n\t\t\t\r\n\t\t\tif(displayIndex > -1){\r\n\t\t\t\trows.splice(displayIndex, 1);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t}\r\n\t\t\r\n\t\tthis.regenerateRowNumbers();\r\n\t\t\r\n\t\tthis.dispatchExternal(\"rowDeleted\", row.getComponent());\r\n\t\t\r\n\t\tif(!this.displayRowsCount){\r\n\t\t\tthis._showPlaceholder();\r\n\t\t}\r\n\t\t\r\n\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\tthis.dispatchExternal(\"dataChanged\", this.getData());\r\n\t\t}\r\n\t}\r\n\t\r\n\taddRow(data, pos, index, blockRedraw){\r\n\t\tvar row = this.addRowActual(data, pos, index, blockRedraw);\r\n\t\treturn row;\r\n\t}\r\n\t\r\n\t//add multiple rows\r\n\taddRows(data, pos, index){\r\n\t\tvar length = 0,\r\n\t\trows = [];\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tpos = this.findAddRowPos(pos);\r\n\t\t\t\r\n\t\t\tif(!Array.isArray(data)){\r\n\t\t\t\tdata = [data];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tlength = data.length - 1;\r\n\t\t\t\r\n\t\t\tif((typeof index == \"undefined\" && pos) || (typeof index !== \"undefined\" && !pos)){\r\n\t\t\t\tdata.reverse();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdata.forEach((item, i) => {\r\n\t\t\t\tvar row = this.addRow(item, pos, index, true);\r\n\t\t\t\trows.push(row);\r\n\t\t\t\tthis.dispatch(\"row-added\", row, data, pos, index);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.refreshActiveData(false, false, true);\r\n\t\t\t\r\n\t\t\tthis.regenerateRowNumbers();\r\n\t\t\t\r\n\t\t\tif(rows.length){\r\n\t\t\t\tthis._clearPlaceholder();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve(rows);\r\n\t\t});\r\n\t}\r\n\t\r\n\tfindAddRowPos(pos){\r\n\t\tif(typeof pos === \"undefined\"){\r\n\t\t\tpos = this.table.options.addRowPos;\r\n\t\t}\r\n\t\t\r\n\t\tif(pos === \"pos\"){\r\n\t\t\tpos = true;\r\n\t\t}\r\n\t\t\r\n\t\tif(pos === \"bottom\"){\r\n\t\t\tpos = false;\r\n\t\t}\r\n\t\t\r\n\t\treturn pos;\r\n\t}\r\n\t\r\n\taddRowActual(data, pos, index, blockRedraw){\r\n\t\tvar row = data instanceof Row ? data : new Row(data || {}, this),\r\n\t\ttop = this.findAddRowPos(pos),\r\n\t\tallIndex = -1,\r\n\t\tactiveIndex, chainResult;\r\n\t\t\r\n\t\tif(!index){\r\n\t\t\tchainResult = this.chain(\"row-adding-position\", [row, top], null, {index, top});\r\n\t\t\t\r\n\t\t\tindex = chainResult.index;\r\n\t\t\ttop = chainResult.top;\r\n\t\t}\r\n\t\t\r\n\t\tif(typeof index !== \"undefined\"){\r\n\t\t\tindex = this.findRow(index);\r\n\t\t}\r\n\t\t\r\n\t\tindex = this.chain(\"row-adding-index\", [row, index, top], null, index);\r\n\t\t\r\n\t\tif(index){\r\n\t\t\tallIndex = this.rows.indexOf(index);\r\n\t\t}\r\n\t\t\r\n\t\tif(index && allIndex > -1){\r\n\t\t\tactiveIndex = this.activeRows.indexOf(index);\r\n\t\t\t\r\n\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\tvar displayIndex = rows.indexOf(index);\r\n\t\t\t\t\r\n\t\t\t\tif(displayIndex > -1){\r\n\t\t\t\t\trows.splice((top ? displayIndex : displayIndex + 1), 0, row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(activeIndex > -1){\r\n\t\t\t\tthis.activeRows.splice((top ? activeIndex : activeIndex + 1), 0, row);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.rows.splice((top ? allIndex : allIndex + 1), 0, row);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tif(top){\r\n\t\t\t\t\r\n\t\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\t\trows.unshift(row);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.activeRows.unshift(row);\r\n\t\t\t\tthis.rows.unshift(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\t\trows.push(row);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.activeRows.push(row);\r\n\t\t\t\tthis.rows.push(row);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.setActiveRows(this.activeRows);\r\n\t\t\r\n\t\tthis.dispatchExternal(\"rowAdded\", row.getComponent());\r\n\t\t\r\n\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t}\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t}\r\n\t\t\r\n\t\treturn row;\r\n\t}\r\n\t\r\n\tmoveRow(from, to, after){\r\n\t\tthis.dispatch(\"row-move\", from, to, after);\r\n\t\t\r\n\t\tthis.moveRowActual(from, to, after);\r\n\t\t\r\n\t\tthis.regenerateRowNumbers();\r\n\t\t\r\n\t\tthis.dispatch(\"row-moved\", from, to, after);\r\n\t\tthis.dispatchExternal(\"rowMoved\", from.getComponent());\r\n\t}\r\n\t\r\n\tmoveRowActual(from, to, after){\r\n\t\tthis.moveRowInArray(this.rows, from, to, after);\r\n\t\tthis.moveRowInArray(this.activeRows, from, to, after);\r\n\t\t\r\n\t\tthis.displayRowIterator((rows) => {\r\n\t\t\tthis.moveRowInArray(rows, from, to, after);\r\n\t\t});\r\n\t\t\r\n\t\tthis.dispatch(\"row-moving\", from, to, after);\r\n\t}\r\n\t\r\n\tmoveRowInArray(rows, from, to, after){\r\n\t\tvar\tfromIndex, toIndex, start, end;\r\n\t\t\r\n\t\tif(from !== to){\r\n\t\t\t\r\n\t\t\tfromIndex = rows.indexOf(from);\r\n\t\t\t\r\n\t\t\tif (fromIndex > -1) {\r\n\t\t\t\t\r\n\t\t\t\trows.splice(fromIndex, 1);\r\n\t\t\t\t\r\n\t\t\t\ttoIndex = rows.indexOf(to);\r\n\t\t\t\t\r\n\t\t\t\tif (toIndex > -1) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(after){\r\n\t\t\t\t\t\trows.splice(toIndex+1, 0, from);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trows.splice(toIndex, 0, from);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\trows.splice(fromIndex, 0, from);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//restyle rows\r\n\t\t\tif(rows === this.getDisplayRows()){\r\n\t\t\t\t\r\n\t\t\t\tstart = fromIndex < toIndex ? fromIndex : toIndex;\r\n\t\t\t\tend = toIndex > fromIndex ? toIndex : fromIndex +1;\r\n\t\t\t\t\r\n\t\t\t\tfor(let i = start; i <= end; i++){\r\n\t\t\t\t\tif(rows[i]){\r\n\t\t\t\t\t\tthis.styleRow(rows[i], i);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearData(){\r\n\t\tthis.setData([]);\r\n\t}\r\n\t\r\n\tgetRowIndex(row){\r\n\t\treturn this.findRowIndex(row, this.rows);\r\n\t}\r\n\t\r\n\tgetDisplayRowIndex(row){\r\n\t\tvar index = this.getDisplayRows().indexOf(row);\r\n\t\treturn index > -1 ? index : false;\r\n\t}\r\n\t\r\n\tnextDisplayRow(row, rowOnly){\r\n\t\tvar index = this.getDisplayRowIndex(row),\r\n\t\tnextRow = false;\r\n\t\t\r\n\t\t\r\n\t\tif(index !== false && index < this.displayRowsCount -1){\r\n\t\t\tnextRow = this.getDisplayRows()[index+1];\r\n\t\t}\r\n\t\t\r\n\t\tif(nextRow && (!(nextRow instanceof Row) || nextRow.type != \"row\")){\r\n\t\t\treturn this.nextDisplayRow(nextRow, rowOnly);\r\n\t\t}\r\n\t\t\r\n\t\treturn nextRow;\r\n\t}\r\n\t\r\n\tprevDisplayRow(row, rowOnly){\r\n\t\tvar index = this.getDisplayRowIndex(row),\r\n\t\tprevRow = false;\r\n\t\t\r\n\t\tif(index){\r\n\t\t\tprevRow = this.getDisplayRows()[index-1];\r\n\t\t}\r\n\t\t\r\n\t\tif(rowOnly && prevRow && (!(prevRow instanceof Row) || prevRow.type != \"row\")){\r\n\t\t\treturn this.prevDisplayRow(prevRow, rowOnly);\r\n\t\t}\r\n\t\t\r\n\t\treturn prevRow;\r\n\t}\r\n\t\r\n\tfindRowIndex(row, list){\r\n\t\tvar rowIndex;\r\n\t\t\r\n\t\trow = this.findRow(row);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\trowIndex = list.indexOf(row);\r\n\t\t\t\r\n\t\t\tif(rowIndex > -1){\r\n\t\t\t\treturn rowIndex;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tgetData(active, transform){\r\n\t\tvar output = [],\r\n\t\trows = this.getRows(active);\r\n\t\t\r\n\t\trows.forEach(function(row){\r\n\t\t\tif(row.type == \"row\"){\r\n\t\t\t\toutput.push(row.getData(transform || \"data\"));\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetComponents(active){\r\n\t\tvar\toutput = [],\r\n\t\trows = this.getRows(active);\r\n\t\t\r\n\t\trows.forEach(function(row){\r\n\t\t\toutput.push(row.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetDataCount(active){\r\n\t\tvar rows = this.getRows(active);\r\n\t\t\r\n\t\treturn rows.length;\r\n\t}\r\n\t\r\n\tscrollHorizontal(left){\r\n\t\tthis.scrollLeft = left;\r\n\t\tthis.element.scrollLeft = left;\r\n\t\t\r\n\t\tthis.dispatch(\"scroll-horizontal\", left);\r\n\t}\r\n\t\r\n\tregisterDataPipelineHandler(handler, priority){\r\n\t\tif(typeof priority !== \"undefined\"){\r\n\t\t\tthis.dataPipeline.push({handler, priority})\r\n\t\t\tthis.dataPipeline.sort((a, b) => {\r\n\t\t\t\treturn a.priority - b.priority;\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Data pipeline handlers must have a priority in order to be registered\")\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterDisplayPipelineHandler(handler, priority){\r\n\t\tif(typeof priority !== \"undefined\"){\r\n\t\t\tthis.displayPipeline.push({handler, priority})\r\n\t\t\tthis.displayPipeline.sort((a, b) => {\r\n\t\t\t\treturn a.priority - b.priority;\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Display pipeline handlers must have a priority in order to be registered\")\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set active data set\r\n\trefreshActiveData(handler, skipStage, renderInPosition){\r\n\t\tvar table = this.table,\r\n\t\tstage = \"\",\r\n\t\tindex = 0,\r\n\t\tcascadeOrder = [\"all\", \"dataPipeline\", \"display\", \"displayPipeline\", \"end\"],\r\n\t\tdisplayIndex;\r\n\t\t\r\n\t\t\r\n\t\tif(typeof handler === \"function\"){\r\n\t\t\tindex = this.dataPipeline.findIndex((item) => {\r\n\t\t\t\treturn item.handler === handler;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tstage = \"dataPipeline\";\r\n\t\t\t\t\r\n\t\t\t\tif(skipStage){\r\n\t\t\t\t\tif(index == this.dataPipeline.length - 1){\r\n\t\t\t\t\t\tstage = \"display\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tindex = this.displayPipeline.findIndex((item) => {\r\n\t\t\t\t\treturn item.handler === handler;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tstage = \"displayPipeline\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(skipStage){\r\n\t\t\t\t\t\tif(index == this.displayPipeline.length - 1){\r\n\t\t\t\t\t\t\tstage = \"end\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.error(\"Unable to refresh data, invalid handler provided\", handler)\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tstage = handler || \"all\";\r\n\t\t\tindex = 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.redrawBlock){\r\n\t\t\tif(!this.redrawBlockRestoreConfig || (this.redrawBlockRestoreConfig && ((this.redrawBlockRestoreConfig.stage === stage && index < this.redrawBlockRestoreConfig.index) || (cascadeOrder.indexOf(stage) < cascadeOrder.indexOf(this.redrawBlockRestoreConfig.stage))))){\r\n\t\t\t\tthis.redrawBlockRestoreConfig = {\r\n\t\t\t\t\thandler: handler,\r\n\t\t\t\t\tskipStage: skipStage,\r\n\t\t\t\t\trenderInPosition: renderInPosition,\r\n\t\t\t\t\tstage:stage,\r\n\t\t\t\t\tindex:index,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn;\r\n\t\t}else{\r\n\t\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\t\tif(renderInPosition){\r\n\t\t\t\t\tthis.reRenderInPosition(this.refreshPipelines.bind(this, handler, stage, index, renderInPosition));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!handler){\r\n\t\t\t\t\t\tthis.table.columnManager.renderer.renderColumns();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.renderTable();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(table.options.layoutColumnsOnNewData){\r\n\t\t\t\t\t\tthis.table.columnManager.redraw(true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"data-refreshed\");\r\n\t\t}\r\n\t}\r\n\t\r\n\trefreshPipelines(handler, stage, index, renderInPosition){\r\n\t\tthis.dispatch(\"data-refreshing\");\r\n\t\t\r\n\t\tif(!handler){\r\n\t\t\tthis.activeRowsPipeline[0] = this.rows.slice(0);\r\n\t\t}\r\n\t\t\r\n\t\t//cascade through data refresh stages\r\n\t\tswitch(stage){\r\n\t\t\tcase \"all\":\r\n\t\t\t//handle case where alldata needs refreshing\r\n\t\t\t\r\n\t\t\tcase \"dataPipeline\":\r\n\t\t\t\r\n\t\t\tfor(let i = index; i < this.dataPipeline.length; i++){\r\n\t\t\t\tlet result = this.dataPipeline[i].handler(this.activeRowsPipeline[i].slice(0));\r\n\t\t\t\t\r\n\t\t\t\tthis.activeRowsPipeline[i + 1] = result || this.activeRowsPipeline[i].slice(0);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.setActiveRows(this.activeRowsPipeline[this.dataPipeline.length]);\r\n\t\t\t\r\n\t\t\tthis.regenerateRowNumbers();\r\n\t\t\t\r\n\t\t\tcase \"display\":\r\n\t\t\tindex = 0;\r\n\t\t\tthis.resetDisplayRows();\r\n\t\t\t\r\n\t\t\tcase \"displayPipeline\":\r\n\t\t\tfor(let i = index; i < this.displayPipeline.length; i++){\r\n\t\t\t\tlet result = this.displayPipeline[i].handler((i ? this.getDisplayRows(i - 1) : this.activeRows).slice(0), renderInPosition);\r\n\t\t\t\t\r\n\t\t\t\tthis.setDisplayRows(result || this.getDisplayRows(i - 1).slice(0), i);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase \"end\":\r\n\t\t\t//case to handle scenario when trying to skip past end stage\r\n\t\t}\r\n\t}\r\n\t\r\n\t//regenerate row numbers for row number formatter if in use\r\n\tregenerateRowNumbers(){\r\n\t\tif(this.rowNumColumn){\r\n\t\t\tthis.activeRows.forEach((row) => {\r\n\t\t\t\tvar cell = row.getCell(this.rowNumColumn);\r\n\t\t\t\t\r\n\t\t\t\tif(cell){\r\n\t\t\t\t\tcell._generateContents();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetActiveRows(activeRows){\r\n\t\tthis.activeRows = activeRows;\r\n\t\tthis.activeRowsCount = this.activeRows.length;\r\n\t}\r\n\t\r\n\t//reset display rows array\r\n\tresetDisplayRows(){\r\n\t\tthis.displayRows = [];\r\n\t\t\r\n\t\tthis.displayRows.push(this.activeRows.slice(0));\r\n\t\t\r\n\t\tthis.displayRowsCount = this.displayRows[0].length;\r\n\t}\r\n\t\r\n\tgetNextDisplayIndex(){\r\n\t\treturn this.displayRows.length;\r\n\t}\r\n\t\r\n\t//set display row pipeline data\r\n\tsetDisplayRows(displayRows, index){\r\n\t\t\r\n\t\tvar output = true;\r\n\t\t\r\n\t\tif(index && typeof this.displayRows[index] != \"undefined\"){\r\n\t\t\tthis.displayRows[index] = displayRows;\r\n\t\t\toutput = true;\r\n\t\t}else{\r\n\t\t\tthis.displayRows.push(displayRows)\r\n\t\t\toutput = index = this.displayRows.length -1;\r\n\t\t}\r\n\t\t\r\n\t\tif(index == this.displayRows.length -1){\r\n\t\t\tthis.displayRowsCount = this.displayRows[this.displayRows.length -1].length;\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetDisplayRows(index){\r\n\t\tif(typeof index == \"undefined\"){\r\n\t\t\treturn this.displayRows.length ? this.displayRows[this.displayRows.length -1] : [];\r\n\t\t}else{\r\n\t\t\treturn this.displayRows[index] || [];\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetVisibleRows(chain, viewable){\r\n\t\tvar rows = Object.assign([], this.renderer.visibleRows(!viewable));\r\n\t\t\r\n\t\tif(chain){\r\n\t\t\trows = this.chain(\"rows-visible\", [viewable], rows, rows);\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t//repeat action accross display rows\r\n\tdisplayRowIterator(callback){\r\n\t\tthis.activeRowsPipeline.forEach(callback);\r\n\t\tthis.displayRows.forEach(callback);\r\n\t\t\r\n\t\tthis.displayRowsCount = this.displayRows[this.displayRows.length -1].length;\r\n\t}\r\n\t\r\n\t//return only actual rows (not group headers etc)\r\n\tgetRows(type){\r\n\t\tvar rows;\r\n\t\t\r\n\t\tswitch(type){\r\n\t\t\tcase \"active\":\r\n\t\t\trows = this.activeRows;\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"display\":\r\n\t\t\trows = this.table.rowManager.getDisplayRows();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"visible\":\r\n\t\t\trows = this.getVisibleRows(false, true);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\trows = this.chain(\"rows-retrieve\", type, null, this.rows) || this.rows;\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t///////////////// Table Rendering /////////////////\r\n\t//trigger rerender of table in current position\r\n\treRenderInPosition(callback){\r\n\t\tif(this.redrawBlock){\r\n\t\t\tif(callback){\r\n\t\t\t\tcallback();\r\n\t\t\t}else{\r\n\t\t\t\tthis.redrawBlockRenderInPosition = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"renderStarted\");\r\n\t\t\tthis.renderer.rerenderRows(callback);\r\n\t\t\tthis.dispatchExternal(\"renderComplete\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeRenderer(){\r\n\t\tvar renderClass;\r\n\t\t\r\n\t\tvar renderers = {\r\n\t\t\t\"virtual\": RendererVirtualDomVertical,\r\n\t\t\t\"basic\": RendererBasicVertical,\r\n\t\t};\r\n\t\t\r\n\t\tif(typeof this.table.options.renderVertical === \"string\"){\r\n\t\t\trenderClass = renderers[this.table.options.renderVertical];\r\n\t\t}else{\r\n\t\t\trenderClass = this.table.options.renderVertical;\r\n\t\t}\r\n\t\t\r\n\t\tif(renderClass){\r\n\t\t\tthis.renderer = new renderClass(this.table, this.element, this.tableElement);\r\n\t\t\tthis.renderer.initialize();\r\n\t\t\t\r\n\t\t\tif((this.table.element.clientHeight || this.table.options.height)){\r\n\t\t\t\tthis.fixedHeight = true;\r\n\t\t\t}else{\r\n\t\t\t\tthis.fixedHeight = false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Unable to find matching renderer:\", table.options.renderVertical);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRenderMode(){\r\n\t\treturn this.renderMode;\r\n\t}\r\n\t\r\n\trenderTable(){\r\n\t\tthis.dispatchExternal(\"renderStarted\");\r\n\t\t\r\n\t\tthis.element.scrollTop = 0;\r\n\t\t\r\n\t\tthis._clearTable();\r\n\t\t\r\n\t\tif(this.displayRowsCount){\r\n\t\t\tthis.renderer.renderRows();\r\n\t\t\t\r\n\t\t\tif(this.firstRender){\r\n\t\t\t\tthis.firstRender = false;\r\n\t\t\t\tthis.layoutRefresh();\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.renderEmptyScroll();\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.fixedHeight){\r\n\t\t\tthis.adjustTableSize();\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatch(\"table-layout\");\r\n\t\t\r\n\t\tif(!this.displayRowsCount){\r\n\t\t\tthis._showPlaceholder();\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatchExternal(\"renderComplete\");\r\n\t}\r\n\t\r\n\t//show scrollbars on empty table div\r\n\trenderEmptyScroll(){\r\n\t\tif(this.placeholder){\r\n\t\t\tthis.tableElement.style.display = \"none\";\r\n\t\t}else{\r\n\t\t\tthis.tableElement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t\t// this.tableElement.style.minHeight = \"1px\";\r\n\t\t\t// this.tableElement.style.visibility = \"hidden\";\r\n\t\t}\r\n\t}\r\n\t\r\n\t_clearTable(){\r\n\t\tvar element = this.tableElement;\r\n\t\t\r\n\t\tthis._clearPlaceholder();\r\n\t\t\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.renderer.clearRows();\r\n\t}\r\n\t\r\n\t_showPlaceholder(){\r\n\t\tif(this.placeholder){\r\n\t\t\tthis.placeholder.setAttribute(\"tabulator-render-mode\", this.renderMode);\r\n\t\t\t\r\n\t\t\tthis.getElement().appendChild(this.placeholder);\r\n\t\t\tthis._positionPlaceholder();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_clearPlaceholder(){\r\n\t\tif(this.placeholder && this.placeholder.parentNode){\r\n\t\t\tthis.placeholder.parentNode.removeChild(this.placeholder);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_positionPlaceholder(){\r\n\t\tif(this.placeholder && this.placeholder.parentNode){\r\n\t\t\tthis.placeholder.style.width = this.table.columnManager.getWidth() + \"px\";\r\n\t\t\tthis.placeholderContents.style.width = this.table.rowManager.element.clientWidth + \"px\";\r\n\t\t\tthis.placeholderContents.style.marginLeft = this.scrollLeft + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tstyleRow(row, index){\r\n\t\tvar rowEl = row.getElement();\r\n\t\t\r\n\t\tif(index % 2){\r\n\t\t\trowEl.classList.add(\"tabulator-row-even\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-odd\");\r\n\t\t}else{\r\n\t\t\trowEl.classList.add(\"tabulator-row-odd\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-even\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t//normalize height of active rows\r\n\tnormalizeHeight(){\r\n\t\tthis.activeRows.forEach(function(row){\r\n\t\t\trow.normalizeHeight();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//adjust the height of the table holder to fit in the Tabulator element\r\n\tadjustTableSize(){\r\n\t\tvar initialHeight = this.element.clientHeight,\r\n\t\tmodExists;\r\n\t\t\r\n\t\tif(this.renderer.verticalFillMode === \"fill\"){\r\n\t\t\tlet otherHeight = Math.floor(this.table.columnManager.getElement().getBoundingClientRect().height + (this.table.footerManager && this.table.footerManager.active && !this.table.footerManager.external ? this.table.footerManager.getElement().getBoundingClientRect().height : 0));\r\n\t\t\t\r\n\t\t\tif(this.fixedHeight){\r\n\t\t\t\tthis.element.style.minHeight = \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t\tthis.element.style.height = \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t\tthis.element.style.maxHeight = \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.element.style.height = \"\";\r\n\t\t\t\tthis.element.style.height = (this.table.element.clientHeight - otherHeight) + \"px\";\r\n\t\t\t\tthis.element.scrollTop = this.scrollTop;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.renderer.resize();\r\n\t\t\t\r\n\t\t\t//check if the table has changed size when dealing with variable height tables\r\n\t\t\tif(!this.fixedHeight && initialHeight != this.element.clientHeight){\r\n\t\t\t\tif(this.subscribed(\"table-resize\")){\r\n\t\t\t\t\tthis.dispatch(\"table-resize\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.redraw();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis._positionPlaceholder();\r\n\t}\r\n\t\r\n\t//renitialize all rows\r\n\treinitialize(){\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\trow.reinitialize(true);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//prevent table from being redrawn\r\n\tblockRedraw (){\r\n\t\tthis.redrawBlock = true;\r\n\t\tthis.redrawBlockRestoreConfig = false;\r\n\t}\r\n\t\r\n\t//restore table redrawing\r\n\trestoreRedraw (){\r\n\t\tthis.redrawBlock = false;\r\n\t\t\r\n\t\tif(this.redrawBlockRestoreConfig){\r\n\t\t\tthis.refreshActiveData(this.redrawBlockRestoreConfig.handler, this.redrawBlockRestoreConfig.skipStage, this.redrawBlockRestoreConfig.renderInPosition)\r\n\t\t\t\r\n\t\t\tthis.redrawBlockRestoreConfig = false;\r\n\t\t}else{\r\n\t\t\tif(this.redrawBlockRenderInPosition){\r\n\t\t\t\tthis.reRenderInPosition();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.redrawBlockRenderInPosition = false;\r\n\t}\r\n\t\r\n\t//redraw table\r\n\tredraw (force){\r\n\t\tvar pos = 0,\r\n\t\tleft = this.scrollLeft;\r\n\t\t\r\n\t\tthis.adjustTableSize();\r\n\t\t\r\n\t\tthis.table.tableWidth = this.table.element.clientWidth;\r\n\t\t\r\n\t\tif(!force){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t\tthis.scrollHorizontal(left);\r\n\t\t}else{\r\n\t\t\tthis.renderTable();\r\n\t\t}\r\n\t}\r\n\t\r\n\tresetScroll(){\r\n\t\tthis.element.scrollLeft = 0;\r\n\t\tthis.element.scrollTop = 0;\r\n\t\t\r\n\t\tif(this.table.browser === \"ie\"){\r\n\t\t\tvar event = document.createEvent(\"Event\");\r\n\t\t\tevent.initEvent(\"scroll\", false, true);\r\n\t\t\tthis.element.dispatchEvent(event);\r\n\t\t}else{\r\n\t\t\tthis.element.dispatchEvent(new Event('scroll'));\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\n\r\nexport default class FooterManager extends CoreFeature{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.active = false;\r\n\t\tthis.element = this.createElement(); //containing element\r\n\t\tthis.containerElement = this.createContainerElement(); //containing element\r\n\t\tthis.external = false;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.initializeElement();\r\n\t}\r\n\r\n\tcreateElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-footer\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\t\r\n\tcreateContainerElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-footer-contents\");\r\n\r\n\t\tthis.element.appendChild(el);\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitializeElement(){\r\n\t\tif(this.table.options.footerElement){\r\n\r\n\t\t\tswitch(typeof this.table.options.footerElement){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tif(this.table.options.footerElement[0] === \"<\"){\r\n\t\t\t\t\tthis.containerElement.innerHTML = this.table.options.footerElement;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.external = true;\r\n\t\t\t\t\tthis.containerElement = document.querySelector(this.table.options.footerElement);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\tthis.element = this.table.options.footerElement;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\tappend(element){\r\n\t\tthis.activate();\r\n\r\n\t\tthis.containerElement.appendChild(element);\r\n\t\tthis.table.rowManager.adjustTableSize();\r\n\t}\r\n\r\n\tprepend(element){\r\n\t\tthis.activate();\r\n\r\n\t\tthis.element.insertBefore(element, this.element.firstChild);\r\n\t\tthis.table.rowManager.adjustTableSize();\r\n\t}\r\n\r\n\tremove(element){\r\n\t\telement.parentNode.removeChild(element);\r\n\t\tthis.deactivate();\r\n\t}\r\n\r\n\tdeactivate(force){\r\n\t\tif(!this.element.firstChild || force){\r\n\t\t\tif(!this.external){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\t\t\tthis.active = false;\r\n\t\t}\r\n\t}\r\n\r\n\tactivate(){\r\n\t\tif(!this.active){\r\n\t\t\tthis.active = true;\r\n\t\t\tif(!this.external){\r\n\t\t\t\tthis.table.element.appendChild(this.getElement());\r\n\t\t\t\tthis.table.element.style.display = '';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tredraw(){\r\n\t\tthis.dispatch(\"footer-redraw\")\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from './Helpers.js';\r\nimport Row from '../row/Row.js';\r\n\r\nexport default class InteractionManager extends CoreFeature {\r\n\t\r\n\tconstructor (table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.el = null;\r\n\t\t\r\n\t\tthis.abortClasses = [\"tabulator-headers\", \"tabulator-table\"];\r\n\t\t\r\n\t\tthis.previousTargets = {};\r\n\t\t\r\n\t\tthis.listeners = [\r\n\t\t\t\"click\",\r\n\t\t\t\"dblclick\",\r\n\t\t\t\"contextmenu\",\r\n\t\t\t\"mouseenter\",\r\n\t\t\t\"mouseleave\",\r\n\t\t\t\"mouseover\",\r\n\t\t\t\"mouseout\",\r\n\t\t\t\"mousemove\",\r\n\t\t\t\"touchstart\",\r\n\t\t\t\"touchend\",\r\n\t\t];\r\n\t\t\r\n\t\tthis.componentMap = {\r\n\t\t\t\"tabulator-cell\":\"cell\",\r\n\t\t\t\"tabulator-row\":\"row\",\r\n\t\t\t\"tabulator-group\":\"group\",\r\n\t\t\t\"tabulator-col\":\"column\",\r\n\t\t};\r\n\t\t\r\n\t\tthis.pseudoTrackers = {\r\n\t\t\t\"row\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"cell\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"group\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"column\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t}\r\n\t\t\r\n\t\tthis.pseudoTracking = false;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.el = this.table.element;\r\n\t\t\r\n\t\tthis.buildListenerMap();\r\n\t\tthis.bindSubscriptionWatchers();\r\n\t}\r\n\t\r\n\tbuildListenerMap(){\r\n\t\tvar listenerMap = {};\r\n\t\t\r\n\t\tthis.listeners.forEach((listener) => {\r\n\t\t\tlistenerMap[listener] = {\r\n\t\t\t\thandler:null,\r\n\t\t\t\tcomponents:[],\r\n\t\t\t}\r\n\t\t})\r\n\t\t\r\n\t\tthis.listeners = listenerMap;\r\n\t}\r\n\t\r\n\tbindPseudoEvents(){\r\n\t\tObject.keys(this.pseudoTrackers).forEach((key) => {\r\n\t\t\tthis.pseudoTrackers[key].subscriber = this.pseudoMouseEnter.bind(this, key);\r\n\t\t\tthis.subscribe(key + \"-mouseover\", this.pseudoTrackers[key].subscriber);\r\n\t\t});\r\n\t\t\r\n\t\tthis.pseudoTracking = true;\r\n\t}\r\n\t\r\n\tpseudoMouseEnter(key, e, target){\r\n\t\tif(this.pseudoTrackers[key].target !== target){\r\n\t\t\t\r\n\t\t\tif(this.pseudoTrackers[key].target){\r\n\t\t\t\tthis.dispatch(key + \"-mouseleave\", e, this.pseudoTrackers[key].target);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.pseudoMouseLeave(key, e);\r\n\t\t\t\r\n\t\t\tthis.pseudoTrackers[key].target = target;\r\n\t\t\t\r\n\t\t\tthis.dispatch(key + \"-mouseenter\", e, target);\r\n\t\t}\r\n\t}\r\n\t\r\n\tpseudoMouseLeave(key, e){\r\n\t\tvar leaveList = Object.keys(this.pseudoTrackers),\r\n\t\tlinkedKeys = {\r\n\t\t\t\"row\":[\"cell\"],\r\n\t\t\t\"cell\":[\"row\"],\r\n\t\t};\r\n\t\t\r\n\t\tleaveList = leaveList.filter((item) => {\r\n\t\t\tvar links = linkedKeys[key];\r\n\t\t\treturn item !== key && (!links || (links && !links.includes(item)));\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\tleaveList.forEach((key) => {\r\n\t\t\tvar target = this.pseudoTrackers[key].target;\r\n\t\t\t\r\n\t\t\tif(this.pseudoTrackers[key].target){\r\n\t\t\t\tthis.dispatch(key + \"-mouseleave\", e, target);\r\n\t\t\t\t\r\n\t\t\t\tthis.pseudoTrackers[key].target = null;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t\r\n\tbindSubscriptionWatchers(){\r\n\t\tvar listeners = Object.keys(this.listeners),\r\n\t\tcomponents = Object.values(this.componentMap);\r\n\t\t\r\n\t\tfor(let comp of components){\r\n\t\t\tfor(let listener of listeners){\r\n\t\t\t\tlet key = comp + \"-\" + listener;\r\n\t\t\t\t\r\n\t\t\t\tthis.subscriptionChange(key, this.subscriptionChanged.bind(this, comp, listener));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.subscribe(\"table-destroy\", this.clearWatchers.bind(this))\r\n\t}\r\n\t\r\n\tsubscriptionChanged(component, key, added){\r\n\t\tvar listener = this.listeners[key].components,\r\n\t\tindex = listener.indexOf(component),\r\n\t\tchanged = false;\r\n\t\t\r\n\t\tif(added){\r\n\t\t\tif(index === -1){\r\n\t\t\t\tlistener.push(component);\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!this.subscribed(component + \"-\" + key)){\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tlistener.splice(index, 1);\r\n\t\t\t\t\tchanged = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif((key === \"mouseenter\" || key === \"mouseleave\") && !this.pseudoTracking){\r\n\t\t\tthis.bindPseudoEvents();\r\n\t\t}\r\n\t\t\r\n\t\tif(changed){\r\n\t\t\tthis.updateEventListeners();\r\n\t\t}\r\n\t}\r\n\t\r\n\tupdateEventListeners(){\r\n\t\tfor(let key in this.listeners){\r\n\t\t\tlet listener = this.listeners[key];\r\n\t\t\t\r\n\t\t\tif(listener.components.length){\r\n\t\t\t\tif(!listener.handler){\r\n\t\t\t\t\tlistener.handler = this.track.bind(this, key);\r\n\t\t\t\t\tthis.el.addEventListener(key, listener.handler)\r\n\t\t\t\t\t// this.el.addEventListener(key, listener.handler, {passive: true})\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(listener.handler){\r\n\t\t\t\t\tthis.el.removeEventListener(key, listener.handler)\r\n\t\t\t\t\tlistener.handler = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\ttrack(type, e){\r\n\t\tvar path = (e.composedPath && e.composedPath()) || e.path;\r\n\t\t\r\n\t\tvar targets = this.findTargets(path);\r\n\t\ttargets = this.bindComponents(type, targets);\r\n\t\t\r\n\t\tthis.triggerEvents(type, e, targets);\r\n\t\t\r\n\t\tif(this.pseudoTracking && (type == \"mouseover\" || type == \"mouseleave\") && !Object.keys(targets).length){\r\n\t\t\tthis.pseudoMouseLeave(\"none\", e);\r\n\t\t}\r\n\t}\r\n\t\r\n\tfindTargets(path){\r\n\t\tvar targets = {};\r\n\t\t\r\n\t\tlet componentMap = Object.keys(this.componentMap);\r\n\t\t\r\n\t\tfor (let el of path) {\r\n\t\t\tlet classList = el.classList ? [...el.classList] : [];\r\n\t\t\t\r\n\t\t\tlet abort = classList.filter((item) => {\r\n\t\t\t\treturn this.abortClasses.includes(item);\r\n\t\t\t})\r\n\t\t\t\r\n\t\t\tif(abort.length){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tlet elTargets = classList.filter((item) => {\r\n\t\t\t\treturn componentMap.includes(item);\r\n\t\t\t})\r\n\t\t\t\r\n\t\t\tfor (let target of elTargets) {\r\n\t\t\t\ttargets[this.componentMap[target]] = el;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(targets.group && targets.group === targets.row){\r\n\t\t\tdelete targets.row;\r\n\t\t}\r\n\t\t\r\n\t\treturn targets;\r\n\t}\r\n\t\r\n\tbindComponents(type, targets){\r\n\t\t//ensure row component is looked up before cell\r\n\t\tvar keys = Object.keys(targets).reverse(),\r\n\t\tlistener = this.listeners[type],\r\n\t\ttargetMatches = {};\r\n\t\t\r\n\t\tfor(let key of keys){\r\n\t\t\tlet component;\r\n\t\t\tlet target = targets[key];\r\n\t\t\tlet previousTarget = this.previousTargets[key];\r\n\t\t\t\r\n\t\t\tif(previousTarget && previousTarget.target === target){\r\n\t\t\t\tcomponent = previousTarget.component;\r\n\t\t\t}else{\r\n\t\t\t\tswitch(key){\r\n\t\t\t\t\tcase \"row\":\r\n\t\t\t\t\tcase \"group\":\r\n\t\t\t\t\tif(listener.components.includes(\"row\") || listener.components.includes(\"cell\") || listener.components.includes(\"group\")){\r\n\t\t\t\t\t\tlet rows = this.table.rowManager.getVisibleRows(true);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcomponent = rows.find((row) => {\r\n\t\t\t\t\t\t\treturn row.getElement() === target;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(targets[\"row\"] && targets[\"row\"].parentNode && targets[\"row\"].parentNode.closest(\".tabulator-row\")){\r\n\t\t\t\t\t\t\ttargets[key] = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"column\":\r\n\t\t\t\t\tif(listener.components.includes(\"column\")){\r\n\t\t\t\t\t\tcomponent = this.table.columnManager.findColumn(target);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"cell\":\r\n\t\t\t\t\tif(listener.components.includes(\"cell\")){\r\n\t\t\t\t\t\tif(targets[\"row\"] instanceof Row){\r\n\t\t\t\t\t\t\tcomponent = targets[\"row\"].findCell(target);\r\n\t\t\t\t\t\t}else{\t\r\n\t\t\t\t\t\t\tif(targets[\"row\"]){\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?\")\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(component){\r\n\t\t\t\ttargets[key] = component;\r\n\t\t\t\ttargetMatches[key] = {\r\n\t\t\t\t\ttarget:target,\r\n\t\t\t\t\tcomponent:component,\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.previousTargets = targetMatches;\r\n\t\t\r\n\t\treturn targets;\r\n\t}\r\n\t\r\n\ttriggerEvents(type, e, targets){\r\n\t\tvar listener = this.listeners[type];\r\n\t\t\r\n\t\tfor(let key in targets){\r\n\t\t\tif(targets[key] && listener.components.includes(key)){\r\n\t\t\t\tthis.dispatch(key + \"-\" + type, e, targets[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearWatchers(){\r\n\t\tfor(let key in this.listeners){\r\n\t\t\tlet listener = this.listeners[key];\r\n\t\t\t\r\n\t\t\tif(listener.handler){\r\n\t\t\t\tthis.el.removeEventListener(key, listener.handler)\r\n\t\t\t\tlistener.handler = null;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}","export default class ComponentFunctionBinder{\r\n\r\n\tconstructor(table){\r\n\t\tthis.table = table;\r\n\r\n\t\tthis.bindings = {};\r\n\t}\r\n\r\n\tbind(type, funcName, handler){\r\n\t\tif(!this.bindings[type]){\r\n\t\t\tthis.bindings[type] = {};\r\n\t\t}\r\n\r\n\t\tif(this.bindings[type][funcName]){\r\n\t\t\tconsole.warn(\"Unable to bind component handler, a matching function name is already bound\", type, funcName, handler)\r\n\t\t}else{\r\n\t\t\tthis.bindings[type][funcName] = handler;\r\n\t\t}\r\n\t}\r\n\r\n\thandle(type, component, name){\r\n\t\tif(this.bindings[type] && this.bindings[type][name] && typeof this.bindings[type][name].bind === 'function'){\r\n\t\t\treturn this.bindings[type][name].bind(null, component);\r\n\t\t}else{\r\n\t\t\tif(name !== \"then\" && typeof name === \"string\" && !name.startsWith(\"_\")){\r\n\t\t\t\t\tconsole.error(\"The \" + type + \" component does not have a \" + name + \" function, have you checked that you have the correct Tabulator module installed?\")\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n","import CoreFeature from '../CoreFeature.js';\r\n\r\nexport default class DataLoader extends CoreFeature{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.requestOrder = 0; //prevent requests coming out of sequence if overridden by another load request\r\n\t\tthis.loading = false;\r\n\t}\r\n\r\n\tinitialize(){}\r\n\r\n\tload(data, params, config, replace, silent, columnsChanged){\r\n\t\tvar requestNo = ++this.requestOrder;\r\n\r\n\t\tthis.dispatchExternal(\"dataLoading\", data);\r\n\r\n\t\t//parse json data to array\r\n\t\tif (data && (data.indexOf(\"{\") == 0 || data.indexOf(\"[\") == 0)){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\r\n\t\tif(this.confirm(\"data-loading\", [data, params, config, silent])){\r\n\t\t\tthis.loading = true;\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.alertLoader();\r\n\t\t\t}\r\n\r\n\t\t\t//get params for request\r\n\t\t\tparams = this.chain(\"data-params\", [data, config, silent], params || {}, params || {});\r\n\r\n\t\t\tparams = this.mapParams(params, this.table.options.dataSendParams);\r\n\r\n\t\t\tvar result = this.chain(\"data-load\", [data, params, config, silent], false, Promise.resolve([]));\r\n\t\t\t\r\n\t\t\treturn result.then((response) => {\r\n\t\t\t\tif(!Array.isArray(response) && typeof response == \"object\"){\r\n\t\t\t\t\tresponse = this.mapParams(response, this.objectInvert(this.table.options.dataReceiveParams));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar rowData = this.chain(\"data-loaded\", response, null, response);\r\n\r\n\t\t\t\tif(requestNo == this.requestOrder){\r\n\t\t\t\t\tthis.clearAlert();\r\n\r\n\t\t\t\t\tif(rowData !== false){\r\n\t\t\t\t\t\tthis.dispatchExternal(\"dataLoaded\", rowData);\r\n\t\t\t\t\t\tthis.table.rowManager.setData(rowData, replace, typeof columnsChanged === \"undefined\" ? !replace : columnsChanged);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made\");\r\n\t\t\t\t}\r\n\t\t\t}).catch((error) => {\r\n\t\t\t\tconsole.error(\"Data Load Error: \", error);\r\n\t\t\t\tthis.dispatchExternal(\"dataLoadError\", error);\r\n\r\n\t\t\t\tif(!silent){\r\n\t\t\t\t\tthis.alertError();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tthis.clearAlert();\r\n\t\t\t\t}, this.table.options.dataLoaderErrorTimeout);\r\n\t\t\t})\r\n\t\t\t.finally(() => {\r\n\t\t\t\tthis.loading = false;\r\n\t\t\t})\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"dataLoaded\", data);\r\n\r\n\t\t\tif(!data){\r\n\t\t\t\tdata = [];\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.rowManager.setData(data, replace, typeof columnsChanged === \"undefined\" ? !replace : columnsChanged);\r\n\t\t\treturn Promise.resolve();\r\n\t\t}\r\n\t}\r\n\r\n\tmapParams(params, map){\r\n\t\tvar output = {};\r\n\r\n\t\tfor(let key in params){\r\n\t\t\toutput[map.hasOwnProperty(key) ? map[key] : key] = params[key];\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tobjectInvert(obj){\r\n\t\tvar output = {};\r\n\r\n\t\tfor(let key in obj){\r\n\t\t\toutput[obj[key]] = key;\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tblockActiveLoad(){\r\n\t\tthis.requestOrder++;\r\n\t}\r\n\r\n\talertLoader(){\r\n\t\tvar shouldLoad = typeof this.table.options.dataLoader === \"function\" ? this.table.options.dataLoader() : this.table.options.dataLoader;\r\n\r\n\t\tif(shouldLoad){\r\n\t\t\tthis.table.alertManager.alert(this.table.options.dataLoaderLoading || this.langText(\"data|loading\"));\r\n\t\t}\r\n\t}\r\n\r\n\talertError(){\r\n\t\tthis.table.alertManager.alert(this.table.options.dataLoaderError || this.langText(\"data|error\"), \"error\");\r\n\t}\r\n\r\n\tclearAlert(){\r\n\t\tthis.table.alertManager.clear();\r\n\t}\r\n}","export default class ExternalEventBus {\r\n\r\n\tconstructor(table, optionsList, debug){\r\n\t\tthis.table = table;\r\n\t\tthis.events = {};\r\n\t\tthis.optionsList = optionsList || {};\r\n\t\tthis.subscriptionNotifiers = {};\r\n\r\n\t\tthis.dispatch = debug ? this._debugDispatch.bind(this) : this._dispatch.bind(this);\r\n\t\tthis.debug = debug;\r\n\t}\r\n\r\n\tsubscriptionChange(key, callback){\r\n\t\tif(!this.subscriptionNotifiers[key]){\r\n\t\t\tthis.subscriptionNotifiers[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.subscriptionNotifiers[key].push(callback);\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis._notifiySubscriptionChange(key, true);\r\n\t\t}\r\n\t}\r\n\r\n\tsubscribe(key, callback){\r\n\t\tif(!this.events[key]){\r\n\t\t\tthis.events[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.events[key].push(callback);\r\n\r\n\t\tthis._notifiySubscriptionChange(key, true);\r\n\t}\r\n\r\n\tunsubscribe(key, callback){\r\n\t\tvar index;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tif(callback){\r\n\t\t\t\tindex = this.events[key].findIndex((item) => {\r\n\t\t\t\t\treturn item === callback;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tthis.events[key].splice(index, 1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Cannot remove event, no matching event found:\", key, callback);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tdelete this.events[key];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cannot remove event, no events set on:\", key);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._notifiySubscriptionChange(key, false);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.events[key] && this.events[key].length;\r\n\t}\r\n\r\n\t_notifiySubscriptionChange(key, subscribed){\r\n\t\tvar notifiers = this.subscriptionNotifiers[key];\r\n\r\n\t\tif(notifiers){\r\n\t\t\tnotifiers.forEach((callback)=>{\r\n\t\t\t\tcallback(subscribed);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_dispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args.shift(),\r\n\t\tresult;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tthis.events[key].forEach((callback, i) => {\r\n\t\t\t\tlet callResult = callback.apply(this.table, args);\r\n\r\n\t\t\t\tif(!i){\r\n\t\t\t\t\tresult = callResult;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\t_debugDispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"ExternalEvent:\" + args[0];\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._dispatch(...arguments)\r\n\t}\r\n}","export default class InternalEventBus {\r\n\r\n\tconstructor(debug){\r\n\t\tthis.events = {};\r\n\t\tthis.subscriptionNotifiers = {};\r\n\r\n\t\tthis.dispatch = debug ? this._debugDispatch.bind(this) : this._dispatch.bind(this);\r\n\t\tthis.chain = debug ? this._debugChain.bind(this) : this._chain.bind(this);\r\n\t\tthis.confirm = debug ? this._debugConfirm.bind(this) : this._confirm.bind(this);\r\n\t\tthis.debug = debug;\r\n\t}\r\n\r\n\tsubscriptionChange(key, callback){\r\n\t\tif(!this.subscriptionNotifiers[key]){\r\n\t\t\tthis.subscriptionNotifiers[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.subscriptionNotifiers[key].push(callback);\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis._notifiySubscriptionChange(key, true);\r\n\t\t}\r\n\t}\r\n\r\n\tsubscribe(key, callback, priority = 10000){\r\n\t\tif(!this.events[key]){\r\n\t\t\tthis.events[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.events[key].push({callback, priority});\r\n\r\n\t\tthis.events[key].sort((a, b) => {\r\n\t\t\treturn a.priority - b.priority;\r\n\t\t});\r\n\r\n\t\tthis._notifiySubscriptionChange(key, true);\r\n\t}\r\n\r\n\tunsubscribe(key, callback){\r\n\t\tvar index;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tif(callback){\r\n\t\t\t\tindex = this.events[key].findIndex((item) => {\r\n\t\t\t\t\treturn item.callback === callback;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tthis.events[key].splice(index, 1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Cannot remove event, no matching event found:\", key, callback);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cannot remove event, no events set on:\", key);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._notifiySubscriptionChange(key, false);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.events[key] && this.events[key].length;\r\n\t}\r\n\r\n\t_chain(key, args, initialValue, fallback){\r\n\t\tvar value = initialValue;\r\n\r\n\t\tif(!Array.isArray(args)){\r\n\t\t\targs = [args];\r\n\t\t}\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis.events[key].forEach((subscriber, i) => {\r\n\t\t\t\tvalue = subscriber.callback.apply(this, args.concat([value]));\r\n\t\t\t});\r\n\r\n\t\t\treturn value;\r\n\t\t}else{\r\n\t\t\treturn typeof fallback === \"function\" ? fallback() : fallback;\r\n\t\t}\r\n\t}\r\n\r\n\t_confirm(key, args){\r\n\t\tvar confirmed = false;\r\n\r\n\t\tif(!Array.isArray(args)){\r\n\t\t\targs = [args];\r\n\t\t}\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis.events[key].forEach((subscriber, i) => {\r\n\t\t\t\tif(subscriber.callback.apply(this, args)){\r\n\t\t\t\t\tconfirmed = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn confirmed;\r\n\t}\r\n\r\n\t_notifiySubscriptionChange(key, subscribed){\r\n\t\tvar notifiers = this.subscriptionNotifiers[key];\r\n\r\n\t\tif(notifiers){\r\n\t\t\tnotifiers.forEach((callback)=>{\r\n\t\t\t\tcallback(subscribed);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_dispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args.shift();\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tthis.events[key].forEach((subscriber) => {\r\n\t\t\t\tlet callResult = subscriber.callback.apply(this, args);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_debugDispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._dispatch(...arguments);\r\n\t}\r\n\r\n\t_debugChain(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._chain(...arguments);\r\n\t}\r\n\r\n\t_debugConfirm(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._confirm(...arguments);\r\n\t}\r\n}","import Tabulator from '../Tabulator.js';\r\n\r\nclass TableRegistry {\r\n\r\n\tstatic register(table){\r\n\t\tTableRegistry.tables.push(table);\r\n\t}\r\n\r\n\tstatic deregister(table){\r\n\t\tvar index = TableRegistry.tables.indexOf(table);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tTableRegistry.tables.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\tstatic lookupTable(query, silent){\r\n\t\tvar results = [],\r\n\t\tmatches, match;\r\n\r\n\t\tif(typeof query === \"string\"){\r\n\t\t\tmatches = document.querySelectorAll(query);\r\n\r\n\t\t\tif(matches.length){\r\n\t\t\t\tfor(var i = 0; i < matches.length; i++){\r\n\t\t\t\t\tmatch = TableRegistry.matchElement(matches[i]);\r\n\r\n\t\t\t\t\tif(match){\r\n\t\t\t\t\t\tresults.push(match);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}else if((typeof HTMLElement !== \"undefined\" && query instanceof HTMLElement) || query instanceof Tabulator){\r\n\t\t\tmatch = TableRegistry.matchElement(query);\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tresults.push(match);\r\n\t\t\t}\r\n\t\t}else if(Array.isArray(query)){\r\n\t\t\tquery.forEach(function(item){\r\n\t\t\t\tresults = results.concat(TableRegistry.lookupTable(item));\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Table Connection Error - Invalid Selector\", query);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\tstatic matchElement(element){\r\n\t\treturn TableRegistry.tables.find(function(table){\r\n\t\t\treturn element instanceof Tabulator ? table === element : table.element === element;\r\n\t\t});\r\n\t}\r\n}\r\n\r\nTableRegistry.tables = [];\r\n\r\nexport default TableRegistry;","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from './Helpers.js';\r\n\r\nexport default class Popup extends CoreFeature{\r\n constructor(table, element, parent){\r\n super(table);\r\n \r\n this.element = element;\r\n this.container = this._lookupContainer();\r\n \r\n this.parent = parent;\r\n \r\n this.reversedX = false;\r\n this.childPopup = null;\r\n this.blurable = false;\r\n this.blurCallback = null;\r\n this.renderedCallback = null;\r\n \r\n this.visible = false;\r\n \r\n this.element.classList.add(\"tabulator-popup-container\");\r\n \r\n this.blurEvent = this.hide.bind(this, false);\r\n this.escEvent = this._escapeCheck.bind(this);\r\n }\r\n \r\n _lookupContainer(){\r\n var container = this.table.options.popupContainer;\r\n \r\n if(typeof container === \"string\"){\r\n container = document.querySelector(container);\r\n \r\n if(!container){\r\n console.warn(\"Menu Error - no container element found matching selector:\", this.table.options.popupContainer , \"(defaulting to document body)\");\r\n }\r\n }else if (container === true){\r\n container = this.table.element;\r\n }\r\n \r\n if(container && !this._checkContainerIsParent(container)){\r\n container = false;\r\n console.warn(\"Menu Error - container element does not contain this table:\", this.table.options.popupContainer , \"(defaulting to document body)\");\r\n }\r\n \r\n if(!container){\r\n container = document.body;\r\n }\r\n \r\n return container;\r\n }\r\n \r\n _checkContainerIsParent(container, element = this.table.element){\r\n if(container === element){\r\n return true;\r\n }else{\r\n return element.parentNode ? this._checkContainerIsParent(container, element.parentNode) : false;\r\n }\r\n }\r\n \r\n renderCallback(callback){\r\n this.renderedCallback = callback;\r\n }\r\n \r\n containerEventCoords(e){\r\n var touch = !(e instanceof MouseEvent);\r\n \r\n var x = touch ? e.touches[0].pageX : e.pageX;\r\n var y = touch ? e.touches[0].pageY : e.pageY;\r\n \r\n if(this.container !== document.body){\r\n let parentOffset = Helpers.elOffset(this.container);\r\n \r\n x -= parentOffset.left;\r\n y -= parentOffset.top;\r\n }\r\n \r\n return {x, y};\r\n }\r\n \r\n elementPositionCoords(element, position = \"right\"){\r\n var offset = Helpers.elOffset(element),\r\n containerOffset, x, y;\r\n \r\n if(this.container !== document.body){\r\n containerOffset = Helpers.elOffset(this.container);\r\n \r\n offset.left -= containerOffset.left;\r\n offset.top -= containerOffset.top;\r\n }\r\n \r\n switch(position){\r\n case \"right\":\r\n x = offset.left + element.offsetWidth;\r\n y = offset.top - 1;\r\n break;\r\n \r\n case \"bottom\":\r\n x = offset.left;\r\n y = offset.top + element.offsetHeight;\r\n break;\r\n }\r\n \r\n return {x, y, offset};\r\n }\r\n \r\n show(origin, position){\r\n var x, y, parentEl, parentOffset, containerOffset, coords;\r\n \r\n if(origin instanceof HTMLElement){\r\n parentEl = origin;\r\n coords = this.elementPositionCoords(origin, position);\r\n \r\n parentOffset = coords.offset;\r\n x = coords.x;\r\n y = coords.y;\r\n \r\n }else if(typeof origin === \"number\"){\r\n parentOffset = {top:0, left:0};\r\n x = origin;\r\n y = position;\r\n }else{\r\n coords = this.containerEventCoords(origin);\r\n \r\n x = coords.x;\r\n y = coords.y;\r\n \r\n this.reversedX = false;\r\n }\r\n \r\n this.element.style.top = y + \"px\";\r\n this.element.style.left = x + \"px\";\r\n \r\n this.container.appendChild(this.element);\r\n \r\n if(typeof this.renderedCallback === \"function\"){\r\n this.renderedCallback();\r\n }\r\n \r\n this._fitToScreen(x, y, parentEl, parentOffset, position);\r\n \r\n this.visible = true;\r\n \r\n return this;\r\n }\r\n \r\n _fitToScreen(x, y, parentEl, parentOffset, position){\r\n var scrollTop = this.container === document.body ? document.documentElement.scrollTop : this.container.scrollTop;\r\n\r\n //move menu to start on right edge if it is too close to the edge of the screen\r\n if((x + this.element.offsetWidth) >= this.container.offsetWidth || this.reversedX){\r\n this.element.style.left = \"\";\r\n \r\n if(parentEl){\r\n this.element.style.right = (this.container.offsetWidth - parentOffset.left) + \"px\";\r\n }else{\r\n this.element.style.right = (this.container.offsetWidth - x) + \"px\";\r\n }\r\n \r\n this.reversedX = true;\r\n }\r\n\r\n //move menu to start on bottom edge if it is too close to the edge of the screen\r\n if((y + this.element.offsetHeight) > Math.max(this.container.offsetHeight, scrollTop ? this.container.scrollHeight : 0)) {\r\n if(parentEl){\r\n switch(position){\r\n case \"bottom\":\r\n this.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight - parentEl.offsetHeight - 1) + \"px\";\r\n break;\r\n\r\n default:\r\n this.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight + parentEl.offsetHeight + 1) + \"px\";\r\n }\r\n \r\n }else{\r\n this.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight) + \"px\";\r\n }\r\n }\r\n }\r\n \r\n isVisible(){\r\n return this.visible;\r\n }\r\n \r\n hideOnBlur(callback){\r\n this.blurable = true;\r\n \r\n if(this.visible){\r\n setTimeout(() => {\r\n this.table.rowManager.element.addEventListener(\"scroll\", this.blurEvent);\r\n this.subscribe(\"cell-editing\", this.blurEvent);\r\n document.body.addEventListener(\"click\", this.blurEvent);\r\n document.body.addEventListener(\"contextmenu\", this.blurEvent);\r\n window.addEventListener(\"resize\", this.blurEvent);\r\n document.body.addEventListener(\"keydown\", this.escEvent);\r\n }, 100);\r\n \r\n this.blurCallback = callback;\r\n }\r\n \r\n return this;\r\n }\r\n \r\n _escapeCheck(e){\r\n if(e.keyCode == 27){\r\n this.hide();\r\n }\r\n }\r\n \r\n hide(silent = false){\r\n if(this.visible){\r\n if(this.blurable){\r\n document.body.removeEventListener(\"keydown\", this.escEvent);\r\n document.body.removeEventListener(\"click\", this.blurEvent);\r\n document.body.removeEventListener(\"contextmenu\", this.blurEvent);\r\n window.removeEventListener(\"resize\", this.blurEvent);\r\n this.table.rowManager.element.removeEventListener(\"scroll\", this.blurEvent);\r\n this.unsubscribe(\"cell-editing\", this.blurEvent);\r\n }\r\n \r\n if(this.childPopup){\r\n this.childPopup.hide();\r\n }\r\n \r\n if(this.parent){\r\n this.parent.childPopup = null;\r\n }\r\n \r\n if(this.element.parentNode){\r\n this.element.parentNode.removeChild(this.element);\r\n }\r\n\r\n this.visible = false;\r\n\r\n if(this.blurCallback && !silent){\r\n this.blurCallback();\r\n }\r\n }\r\n \r\n return this;\r\n }\r\n \r\n child(element){\r\n if(this.childPopup){\r\n this.childPopup.hide();\r\n }\r\n \r\n this.childPopup = new Popup(this.table, element, this);\r\n \r\n return this.childPopup;\r\n }\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Popup from './tools/Popup.js';\r\n\r\nclass Module extends CoreFeature{\r\n\r\n\tconstructor(table, name){\r\n\t\tsuper(table);\r\n\r\n\t\tthis._handler = null;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\t// setup module when table is initialized, to be overriden in module\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t////// Options Registration ///////\r\n\t///////////////////////////////////\r\n\r\n\tregisterTableOption(key, value){\r\n\t\tthis.table.optionsList.register(key, value);\r\n\t}\r\n\r\n\tregisterColumnOption(key, value){\r\n\t\tthis.table.columnManager.optionsList.register(key, value);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t/// Public Function Registration ///\r\n\t///////////////////////////////////\r\n\r\n\tregisterTableFunction(name, func){\r\n\t\tif(typeof this.table[name] === \"undefined\"){\r\n\t\t\tthis.table[name] = (...args) => {\r\n\t\t\t\tthis.table.initGuard(name);\r\n\r\n\t\t\t\treturn func(...args);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Unable to bind table function, name already in use\", name)\r\n\t\t}\r\n\t}\r\n\r\n\tregisterComponentFunction(component, func, handler){\r\n\t\treturn this.table.componentFunctionBinder.bind(component, func, handler);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t////////// Data Pipeline //////////\r\n\t///////////////////////////////////\r\n\r\n\tregisterDataHandler(handler, priority){\r\n\t\tthis.table.rowManager.registerDataPipelineHandler(handler, priority)\r\n\t\tthis._handler = handler;\r\n\t}\r\n\r\n\tregisterDisplayHandler(handler, priority){\r\n\t\tthis.table.rowManager.registerDisplayPipelineHandler(handler, priority)\r\n\t\tthis._handler = handler;\r\n\t}\r\n\r\n\trefreshData(renderInPosition, handler){\r\n\t\tif(!handler){\r\n\t\t\thandler = this._handler;\r\n\t\t}\r\n\r\n\t\tif(handler){\r\n\t\t\tthis.table.rowManager.refreshActiveData(handler, false, renderInPosition);\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t//////// Footer Management ////////\r\n\t///////////////////////////////////\r\n\r\n\tfooterAppend(element){\r\n\t\treturn this.table.footerManager.append(element)\r\n\t}\r\n\r\n\tfooterPrepend(element){\r\n\t\treturn this.table.footerManager.prepend(element)\r\n\t}\r\n\r\n\tfooterRemove(element){\r\n\t\treturn this.table.footerManager.remove(element)\r\n\t} \r\n\r\n\t///////////////////////////////////\r\n\t//////// Popups Management ////////\r\n\t///////////////////////////////////\r\n\t\r\n\tpopup(menuEl, menuContainer){\r\n\t\treturn new Popup(this.table, menuEl, menuContainer);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t//////// Alert Management ////////\r\n\t///////////////////////////////////\r\n\r\n\talert(content, type){\r\n\t\treturn this.table.alertManager.alert(content, type);\r\n\t}\r\n\r\n\tclearAlert(){\r\n\t\treturn this.table.alertManager.clear();\r\n\t}\r\n\t\r\n}\r\n\r\nexport default Module;","//resize columns to fit data they contain and stretch row to fill table, also used for fitDataTable\r\nexport default function(columns){\r\n\tcolumns.forEach(function(column){\r\n\t\tcolumn.reinitializeWidth();\r\n\t});\r\n\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n};","import fitData from './modes/fitData.js';\r\nimport fitDataGeneral from './modes/fitDataGeneral.js';\r\nimport fitDataStretch from './modes/fitDataStretch.js';\r\nimport fitColumns from './modes/fitColumns.js';\r\n\r\nexport default {\r\n\tfitData:fitData,\r\n\tfitDataFill:fitDataGeneral,\r\n\tfitDataTable:fitDataGeneral,\r\n\tfitDataStretch:fitDataStretch,\r\n\tfitColumns:fitColumns ,\r\n};","//resize columns to fit data they contain\r\nexport default function(columns){\r\n\tthis.table.columnManager.renderer.reinitializeColumnWidths(columns);\r\n\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n};","//resize columns to fit data the contain and stretch last column to fill table\r\nexport default function(columns){\r\n\tvar colsWidth = 0,\r\n\ttableWidth = this.table.rowManager.element.clientWidth,\r\n\tgap = 0,\r\n\tlastCol = false;\r\n\r\n\tcolumns.forEach((column, i) => {\r\n\t\tif(!column.widthFixed){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t}\r\n\r\n\t\tif(this.table.options.responsiveLayout ? column.modules.responsive.visible : column.visible){\r\n\t\t\tlastCol = column;\r\n\t\t}\r\n\r\n\t\tif(column.visible){\r\n\t\t\tcolsWidth += column.getWidth();\r\n\t\t}\r\n\t});\r\n\r\n\tif(lastCol){\r\n\t\tgap = tableWidth - colsWidth + lastCol.getWidth();\r\n\r\n\t\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\t\tlastCol.setWidth(0);\r\n\t\t\tthis.table.modules.responsiveLayout.update();\r\n\t\t}\r\n\r\n\t\tif(gap > 0){\r\n\t\t\tlastCol.setWidth(gap);\r\n\t\t}else{\r\n\t\t\tlastCol.reinitializeWidth();\r\n\t\t}\r\n\t}else{\r\n\t\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\t\tthis.table.modules.responsiveLayout.update();\r\n\t\t}\r\n\t}\r\n};","//resize columns to fit\r\nexport default function(columns){\r\n\tvar totalWidth = this.table.element.clientWidth; //table element width\r\n\tvar fixedWidth = 0; //total width of columns with a defined width\r\n\tvar flexWidth = 0; //total width available to flexible columns\r\n\tvar flexGrowUnits = 0; //total number of widthGrow blocks accross all columns\r\n\tvar flexColWidth = 0; //desired width of flexible columns\r\n\tvar flexColumns = []; //array of flexible width columns\r\n\tvar fixedShrinkColumns = []; //array of fixed width columns that can shrink\r\n\tvar flexShrinkUnits = 0; //total number of widthShrink blocks accross all columns\r\n\tvar overflowWidth = 0; //horizontal overflow width\r\n\tvar gapFill=0; //number of pixels to be added to final column to close and half pixel gaps\r\n\r\n\tfunction calcWidth(width){\r\n\t\tvar colWidth;\r\n\r\n\t\tif(typeof(width) == \"string\"){\r\n\t\t\tif(width.indexOf(\"%\") > -1){\r\n\t\t\t\tcolWidth = (totalWidth / 100) * parseInt(width);\r\n\t\t\t}else{\r\n\t\t\t\tcolWidth = parseInt(width);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcolWidth = width;\r\n\t\t}\r\n\r\n\t\treturn colWidth;\r\n\t}\r\n\r\n\t//ensure columns resize to take up the correct amount of space\r\n\tfunction scaleColumns(columns, freeSpace, colWidth, shrinkCols){\r\n\r\n\t\tvar oversizeCols = [],\r\n\t\toversizeSpace = 0,\r\n\t\tremainingSpace = 0,\r\n\t\tnextColWidth = 0,\r\n\t\tremainingFlexGrowUnits = flexGrowUnits,\r\n\t\tgap = 0,\r\n\t\tchangeUnits = 0,\r\n\t\tundersizeCols = [];\r\n\r\n\t\tfunction calcGrow(col){\r\n\t\t\treturn (colWidth * (col.column.definition.widthGrow || 1));\r\n\t\t}\r\n\r\n\t\tfunction calcShrink(col){\r\n\t\t\treturn (calcWidth(col.width) - (colWidth * (col.column.definition.widthShrink || 0)))\r\n\t\t}\r\n\r\n\t\tcolumns.forEach(function(col, i){\r\n\t\t\tvar width = shrinkCols ? calcShrink(col) : calcGrow(col);\r\n\t\t\tif(col.column.minWidth >= width){\r\n\t\t\t\toversizeCols.push(col);\r\n\t\t\t}else{\r\n\t\t\t\tif(col.column.maxWidth && col.column.maxWidth < width){\r\n\t\t\t\t\tcol.width = col.column.maxWidth;\r\n\t\t\t\t\tfreeSpace -= col.column.maxWidth;\r\n\r\n\t\t\t\t\tremainingFlexGrowUnits -= shrinkCols ? (col.column.definition.widthShrink || 1) : (col.column.definition.widthGrow || 1);\r\n\r\n\t\t\t\t\tif(remainingFlexGrowUnits){\r\n\t\t\t\t\t\tcolWidth = Math.floor(freeSpace/remainingFlexGrowUnits);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tundersizeCols.push(col);\r\n\t\t\t\t\tchangeUnits += shrinkCols ? (col.column.definition.widthShrink || 1) : (col.column.definition.widthGrow || 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(oversizeCols.length){\r\n\t\t\toversizeCols.forEach(function(col){\r\n\t\t\t\toversizeSpace += shrinkCols ? col.width - col.column.minWidth : col.column.minWidth;\r\n\t\t\t\tcol.width = col.column.minWidth;\r\n\t\t\t});\r\n\r\n\t\t\tremainingSpace = freeSpace - oversizeSpace;\r\n\r\n\t\t\tnextColWidth = changeUnits ? Math.floor(remainingSpace/changeUnits) : remainingSpace;\r\n\r\n\t\t\tgap = remainingSpace - (nextColWidth * changeUnits);\r\n\r\n\t\t\tgap += scaleColumns(undersizeCols, remainingSpace, nextColWidth, shrinkCols);\r\n\t\t}else{\r\n\t\t\tgap = changeUnits ? freeSpace - (Math.floor(freeSpace/changeUnits) * changeUnits) : freeSpace;\r\n\r\n\t\t\tundersizeCols.forEach(function(column){\r\n\t\t\t\tcolumn.width = shrinkCols ? calcShrink(column) : calcGrow(column);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn gap;\r\n\t}\r\n\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n\r\n\t//adjust for vertical scrollbar if present\r\n\tif(this.table.rowManager.element.scrollHeight > this.table.rowManager.element.clientHeight){\r\n\t\ttotalWidth -= this.table.rowManager.element.offsetWidth - this.table.rowManager.element.clientWidth;\r\n\t}\r\n\r\n\tcolumns.forEach(function(column){\r\n\t\tvar width, minWidth, colWidth;\r\n\r\n\t\tif(column.visible){\r\n\r\n\t\t\twidth = column.definition.width;\r\n\t\t\tminWidth = parseInt(column.minWidth);\r\n\r\n\t\t\tif(width){\r\n\r\n\t\t\t\tcolWidth = calcWidth(width);\r\n\r\n\t\t\t\tfixedWidth += colWidth > minWidth ? colWidth : minWidth;\r\n\r\n\t\t\t\tif(column.definition.widthShrink){\r\n\t\t\t\t\tfixedShrinkColumns.push({\r\n\t\t\t\t\t\tcolumn:column,\r\n\t\t\t\t\t\twidth:colWidth > minWidth ? colWidth : minWidth\r\n\t\t\t\t\t});\r\n\t\t\t\t\tflexShrinkUnits += column.definition.widthShrink;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tflexColumns.push({\r\n\t\t\t\t\tcolumn:column,\r\n\t\t\t\t\twidth:0,\r\n\t\t\t\t});\r\n\t\t\t\tflexGrowUnits += column.definition.widthGrow || 1;\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\t//calculate available space\r\n\tflexWidth = totalWidth - fixedWidth;\r\n\r\n\t//calculate correct column size\r\n\tflexColWidth = Math.floor(flexWidth / flexGrowUnits)\r\n\r\n\t//generate column widths\r\n\tvar gapFill = scaleColumns(flexColumns, flexWidth, flexColWidth, false);\r\n\r\n\t//increase width of last column to account for rounding errors\r\n\tif(flexColumns.length && gapFill > 0){\r\n\t\tflexColumns[flexColumns.length-1].width += + gapFill;\r\n\t}\r\n\r\n\t//caculate space for columns to be shrunk into\r\n\tflexColumns.forEach(function(col){\r\n\t\tflexWidth -= col.width;\r\n\t});\r\n\r\n\toverflowWidth = Math.abs(gapFill) + flexWidth;\r\n\r\n\t//shrink oversize columns if there is no available space\r\n\tif(overflowWidth > 0 && flexShrinkUnits){\r\n\t\tgapFill = scaleColumns(fixedShrinkColumns, overflowWidth, Math.floor(overflowWidth / flexShrinkUnits), true);\r\n\t}\r\n\r\n\t//decrease width of last column to account for rounding errors\r\n\tif(fixedShrinkColumns.length){\r\n\t\tfixedShrinkColumns[fixedShrinkColumns.length-1].width -= gapFill;\r\n\t}\r\n\r\n\tflexColumns.forEach(function(col){\r\n\t\tcol.column.setWidth(col.width);\r\n\t});\r\n\r\n\tfixedShrinkColumns.forEach(function(col){\r\n\t\tcol.column.setWidth(col.width);\r\n\t});\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultModes from './defaults/modes.js';\r\n\r\nclass Layout extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table, \"layout\");\r\n\r\n\t\tthis.mode = null;\r\n\r\n\t\tthis.registerTableOption(\"layout\", \"fitData\"); //layout type\r\n\t\tthis.registerTableOption(\"layoutColumnsOnNewData\", false); //update column widths on setData\r\n\r\n\t\tthis.registerColumnOption(\"widthGrow\");\r\n\t\tthis.registerColumnOption(\"widthShrink\");\r\n\t}\r\n\r\n\t//initialize layout system\r\n\tinitialize(){\r\n\t\tvar layout = this.table.options.layout;\r\n\r\n\t\tif(Layout.modes[layout]){\r\n\t\t\tthis.mode = layout;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Layout Error - invalid mode set, defaulting to 'fitData' : \" + layout);\r\n\t\t\tthis.mode = 'fitData';\r\n\t\t}\r\n\r\n\t\tthis.table.element.setAttribute(\"tabulator-layout\", this.mode);\r\n\t}\r\n\r\n\tgetMode(){\r\n\t\treturn this.mode;\r\n\t}\r\n\r\n\t//trigger table layout\r\n\tlayout(){\r\n\t\tthis.dispatch(\"layout-refreshing\")\r\n\t\tLayout.modes[this.mode].call(this, this.table.columnManager.columnsByIndex);\r\n\r\n\t\tthis.dispatch(\"layout-refreshed\")\r\n\t}\r\n}\r\n\r\nLayout.moduleName = \"layout\";\r\n\r\n//load defaults\r\nLayout.modes = defaultModes;\r\n\r\nexport default Layout;","import Module from '../../core/Module.js';\r\n\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defaultLangs from './defaults/langs.js';\r\n\r\nclass Localize extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.locale = \"default\"; //current locale\r\n\t\tthis.lang = false; //current language\r\n\t\tthis.bindings = {}; //update events to call when locale is changed\r\n\t\tthis.langList = {};\r\n\r\n\t\tthis.registerTableOption(\"locale\", false); //current system language\r\n\t\tthis.registerTableOption(\"langs\", {});\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.langList = Helpers.deepClone(Localize.langs);\r\n\r\n\t\tif(this.table.options.columnDefaults.headerFilterPlaceholder !== false){\r\n\t\t\tthis.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder);\r\n\t\t}\r\n\r\n\t\tfor(let locale in this.table.options.langs){\r\n\t\t\tthis.installLang(locale, this.table.options.langs[locale]);\r\n\t\t}\r\n\r\n\t\tthis.setLocale(this.table.options.locale);\r\n\r\n\t\tthis.registerTableFunction(\"setLocale\", this.setLocale.bind(this));\r\n\t\tthis.registerTableFunction(\"getLocale\", this.getLocale.bind(this));\r\n\t\tthis.registerTableFunction(\"getLang\", this.getLang.bind(this));\r\n\t}\r\n\r\n\t//set header placehoder\r\n\tsetHeaderFilterPlaceholder(placeholder){\r\n\t\tthis.langList.default.headerFilters.default = placeholder;\r\n\t}\r\n\r\n\t//set header filter placeholder by column\r\n\tsetHeaderFilterColumnPlaceholder(column, placeholder){\r\n\t\tthis.langList.default.headerFilters.columns[column] = placeholder;\r\n\r\n\t\tif(this.lang && !this.lang.headerFilters.columns[column]){\r\n\t\t\tthis.lang.headerFilters.columns[column] = placeholder;\r\n\t\t}\r\n\t}\r\n\r\n\t//setup a lang description object\r\n\tinstallLang(locale, lang){\r\n\t\tif(this.langList[locale]){\r\n\t\t\tthis._setLangProp(this.langList[locale], lang);\r\n\t\t}else{\r\n\t\t\tthis.langList[locale] = lang;\r\n\t\t}\r\n\t}\r\n\r\n\t_setLangProp(lang, values){\r\n\t\tfor(let key in values){\r\n\t\t\tif(lang[key] && typeof lang[key] == \"object\"){\r\n\t\t\t\tthis._setLangProp(lang[key], values[key])\r\n\t\t\t}else{\r\n\t\t\t\tlang[key] = values[key];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//set current locale\r\n\tsetLocale(desiredLocale){\r\n\t\tdesiredLocale = desiredLocale || \"default\";\r\n\r\n\t\t//fill in any matching languge values\r\n\t\tfunction traverseLang(trans, path){\r\n\t\t\tfor(var prop in trans){\r\n\t\t\t\tif(typeof trans[prop] == \"object\"){\r\n\t\t\t\t\tif(!path[prop]){\r\n\t\t\t\t\t\tpath[prop] = {};\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttraverseLang(trans[prop], path[prop]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tpath[prop] = trans[prop];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//determing correct locale to load\r\n\t\tif(desiredLocale === true && navigator.language){\r\n\t\t\t//get local from system\r\n\t\t\tdesiredLocale = navigator.language.toLowerCase();\r\n\t\t}\r\n\r\n\t\tif(desiredLocale){\r\n\t\t\t//if locale is not set, check for matching top level locale else use default\r\n\t\t\tif(!this.langList[desiredLocale]){\r\n\t\t\t\tlet prefix = desiredLocale.split(\"-\")[0];\r\n\r\n\t\t\t\tif(this.langList[prefix]){\r\n\t\t\t\t\tconsole.warn(\"Localization Error - Exact matching locale not found, using closest match: \", desiredLocale, prefix);\r\n\t\t\t\t\tdesiredLocale = prefix;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Localization Error - Matching locale not found, using default: \", desiredLocale);\r\n\t\t\t\t\tdesiredLocale = \"default\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.locale = desiredLocale;\r\n\r\n\t\t//load default lang template\r\n\t\tthis.lang = Helpers.deepClone(this.langList.default || {});\r\n\r\n\t\tif(desiredLocale != \"default\"){\r\n\t\t\ttraverseLang(this.langList[desiredLocale], this.lang);\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(\"localized\", this.locale, this.lang);\r\n\r\n\t\tthis._executeBindings();\r\n\t}\r\n\r\n\t//get current locale\r\n\tgetLocale(locale){\r\n\t\treturn this.locale;\r\n\t}\r\n\r\n\t//get lang object for given local or current if none provided\r\n\tgetLang(locale){\r\n\t\treturn locale ? this.langList[locale] : this.lang;\r\n\t}\r\n\r\n\t//get text for current locale\r\n\tgetText(path, value){\r\n\t\tvar path = value ? path + \"|\" + value : path,\r\n\t\tpathArray = path.split(\"|\"),\r\n\t\ttext = this._getLangElement(pathArray, this.locale);\r\n\r\n\t\t// if(text === false){\r\n\t\t// \tconsole.warn(\"Localization Error - Matching localized text not found for given path: \", path);\r\n\t\t// }\r\n\r\n\t\treturn text || \"\";\r\n\t}\r\n\r\n\t//traverse langs object and find localized copy\r\n\t_getLangElement(path, locale){\r\n\t\tvar root = this.lang;\r\n\r\n\t\tpath.forEach(function(level){\r\n\t\t\tvar rootPath;\r\n\r\n\t\t\tif(root){\r\n\t\t\t\trootPath = root[level];\r\n\r\n\t\t\t\tif(typeof rootPath != \"undefined\"){\r\n\t\t\t\t\troot = rootPath;\r\n\t\t\t\t}else{\r\n\t\t\t\t\troot = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn root;\r\n\t}\r\n\r\n\t//set update binding\r\n\tbind(path, callback){\r\n\t\tif(!this.bindings[path]){\r\n\t\t\tthis.bindings[path] = [];\r\n\t\t}\r\n\r\n\t\tthis.bindings[path].push(callback);\r\n\r\n\t\tcallback(this.getText(path), this.lang);\r\n\t}\r\n\r\n\t//itterate through bindings and trigger updates\r\n\t_executeBindings(){\r\n\t\tfor(let path in this.bindings){\r\n\t\t\tthis.bindings[path].forEach((binding) => {\r\n\t\t\t\tbinding(this.getText(path), this.lang);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n}\r\n\r\nLocalize.moduleName = \"localize\";\r\n\r\n//load defaults\r\nLocalize.langs = defaultLangs;\r\n\r\nexport default Localize;","export default {\r\n\t\"default\":{ //hold default locale text\r\n\t\t\"groups\":{\r\n\t\t\t\"item\":\"item\",\r\n\t\t\t\"items\":\"items\",\r\n\t\t},\r\n\t\t\"columns\":{\r\n\t\t},\r\n\t\t\"data\":{\r\n\t\t\t\"loading\":\"Loading\",\r\n\t\t\t\"error\":\"Error\",\r\n\t\t},\r\n\t\t\"pagination\":{\r\n\t\t\t\"page_size\":\"Page Size\",\r\n\t\t\t\"page_title\":\"Show Page\",\r\n\t\t\t\"first\":\"First\",\r\n\t\t\t\"first_title\":\"First Page\",\r\n\t\t\t\"last\":\"Last\",\r\n\t\t\t\"last_title\":\"Last Page\",\r\n\t\t\t\"prev\":\"Prev\",\r\n\t\t\t\"prev_title\":\"Prev Page\",\r\n\t\t\t\"next\":\"Next\",\r\n\t\t\t\"next_title\":\"Next Page\",\r\n\t\t\t\"all\":\"All\",\r\n\t\t\t\"counter\":{\r\n\t\t\t\t\"showing\": \"Showing\",\r\n\t\t\t\t\"of\": \"of\",\r\n\t\t\t\t\"rows\": \"rows\",\r\n\t\t\t\t\"pages\": \"pages\",\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"headerFilters\":{\r\n\t\t\t\"default\":\"filter column...\",\r\n\t\t\t\"columns\":{}\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\nimport TableRegistry from '../../core/tools/TableRegistry.js';\r\n\r\nclass Comms extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"tableComms\", this.receive.bind(this));\r\n\t}\r\n\r\n\tgetConnections(selectors){\r\n\t\tvar connections = [],\r\n\t\tconnection;\r\n\r\n\t\tconnection = TableRegistry.lookupTable(selectors);\r\n\r\n\t\tconnection.forEach((con) =>{\r\n\t\t\tif(this.table !== con){\r\n\t\t\t\tconnections.push(con);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn connections;\r\n\t}\r\n\r\n\tsend(selectors, module, action, data){\r\n\t\tvar connections = this.getConnections(selectors);\r\n\r\n\t\tconnections.forEach((connection) => {\r\n\t\t\tconnection.tableComms(this.table.element, module, action, data);\r\n\t\t});\r\n\r\n\t\tif(!connections.length && selectors){\r\n\t\t\tconsole.warn(\"Table Connection Error - No tables matching selector found\", selectors);\r\n\t\t}\r\n\t}\r\n\r\n\treceive(table, module, action, data){\r\n\t\tif(this.table.modExists(module)){\r\n\t\t\treturn this.table.modules[module].commsReceived(table, action, data);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Inter-table Comms Error - no such module:\", module);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nComms.moduleName = \"comms\";\r\n\r\nexport default Comms;","import * as coreModules from '../modules/core.js';\r\nimport TableRegistry from './TableRegistry.js';\r\n\r\nexport default class ModuleBinder {\r\n\t\r\n\tconstructor(tabulator, modules){\r\n\t\tthis.bindStaticFuctionality(tabulator);\r\n\t\tthis.bindModules(tabulator, coreModules, true);\r\n\t\t\r\n\t\tif(modules){\r\n\t\t\tthis.bindModules(tabulator, modules);\r\n\t\t}\r\n\t}\r\n\t\r\n\tbindStaticFuctionality(tabulator){\r\n\t\ttabulator.moduleBindings = {};\r\n\t\t\r\n\t\ttabulator.extendModule = function(name, property, values){\r\n\t\t\tif(tabulator.moduleBindings[name]){\r\n\t\t\t\tvar source = tabulator.moduleBindings[name][property];\r\n\t\t\t\t\r\n\t\t\t\tif(source){\r\n\t\t\t\t\tif(typeof values == \"object\"){\r\n\t\t\t\t\t\tfor(let key in values){\r\n\t\t\t\t\t\t\tsource[key] = values[key];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Module Error - Invalid value type, it must be an object\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Module Error - property does not exist:\", property);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Module Error - module does not exist:\", name);\r\n\t\t\t}\r\n\t\t};\r\n\t\t\r\n\t\ttabulator.registerModule = function(modules){\r\n\t\t\tif(!Array.isArray(modules)){\r\n\t\t\t\tmodules = [modules];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmodules.forEach((mod) => {\r\n\t\t\t\ttabulator.registerModuleBinding(mod)\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\ttabulator.registerModuleBinding = function(mod){\r\n\t\t\ttabulator.moduleBindings[mod.moduleName] = mod;\r\n\t\t};\r\n\t\t\r\n\t\ttabulator.findTable = function(query){\r\n\t\t\tvar results = TableRegistry.lookupTable(query, true);\r\n\t\t\treturn Array.isArray(results) && !results.length ? false : results;\r\n\t\t}\r\n\t\t\r\n\t\t//ensure that module are bound to instantiated function\r\n\t\ttabulator.prototype.bindModules = function(){\r\n\t\t\tvar orderedStartMods = [],\r\n\t\t\torderedEndMods = [],\r\n\t\t\tunOrderedMods = [];\r\n\t\t\t\r\n\t\t\tthis.modules = {};\r\n\t\t\t\r\n\t\t\tfor(var name in tabulator.moduleBindings){\r\n\t\t\t\tlet mod = tabulator.moduleBindings[name];\r\n\t\t\t\tlet module = new mod(this);\r\n\t\t\t\t\r\n\t\t\t\tthis.modules[name] = module;\r\n\t\t\t\t\r\n\t\t\t\tif(mod.prototype.moduleCore){\r\n\t\t\t\t\tthis.modulesCore.push(module);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(mod.moduleInitOrder){\r\n\t\t\t\t\t\tif(mod.moduleInitOrder < 0){\r\n\t\t\t\t\t\t\torderedStartMods.push(module);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\torderedEndMods.push(module);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tunOrderedMods.push(module);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\torderedStartMods.sort((a, b) => a.moduleInitOrder > b.moduleInitOrder ? 1 : -1);\r\n\t\t\torderedEndMods.sort((a, b) => a.moduleInitOrder > b.moduleInitOrder ? 1 : -1);\r\n\t\t\t\r\n\t\t\tthis.modulesRegular = orderedStartMods.concat(unOrderedMods.concat(orderedEndMods));\r\n\t\t}\r\n\t}\r\n\t\r\n\tbindModules(tabulator, modules, core){\r\n\t\tvar mods = Object.values(modules);\r\n\t\t\r\n\t\tif(core){\r\n\t\t\tmods.forEach((mod) => {\r\n\t\t\t\tmod.prototype.moduleCore = true;\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\ttabulator.registerModule(mods);\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from './Helpers.js';\r\n\r\nexport default class Alert extends CoreFeature{\r\n constructor(table){\r\n super(table);\r\n \r\n this.element = this._createAlertElement();\r\n this.msgElement = this._createMsgElement();\r\n this.type = null;\r\n \r\n this.element.appendChild(this.msgElement);\r\n }\r\n \r\n _createAlertElement(){\r\n var el = document.createElement(\"div\");\r\n el.classList.add(\"tabulator-alert\");\r\n return el;\r\n }\r\n \r\n _createMsgElement(){\r\n var el = document.createElement(\"div\");\r\n el.classList.add(\"tabulator-alert-msg\");\r\n el.setAttribute(\"role\", \"alert\");\r\n return el;\r\n }\r\n \r\n _typeClass(){\r\n return \"tabulator-alert-state-\" + this.type;\r\n }\r\n \r\n alert(content, type = \"msg\"){\r\n if(content){\r\n this.clear();\r\n \r\n this.type = type;\r\n \r\n while(this.msgElement.firstChild) this.msgElement.removeChild(this.msgElement.firstChild);\r\n \r\n this.msgElement.classList.add(this._typeClass());\r\n \r\n if(typeof content === \"function\"){\r\n content = content();\r\n }\r\n \r\n if(content instanceof HTMLElement){\r\n this.msgElement.appendChild(content);\r\n }else{\r\n this.msgElement.innerHTML = content;\r\n }\r\n \r\n this.table.element.appendChild(this.element);\r\n }\r\n }\r\n \r\n clear(){\r\n if(this.element.parentNode){\r\n this.element.parentNode.removeChild(this.element);\r\n }\r\n \r\n this.msgElement.classList.remove(this._typeClass());\r\n }\r\n}","'use strict';\r\n\r\nimport defaultOptions from './defaults/options.js';\r\n\r\nimport ColumnManager from './ColumnManager.js';\r\nimport RowManager from './RowManager.js';\r\nimport FooterManager from './FooterManager.js';\r\n\r\nimport InteractionMonitor from './tools/InteractionMonitor.js';\r\nimport ComponentFunctionBinder from './tools/ComponentFunctionBinder.js';\r\nimport DataLoader from './tools/DataLoader.js';\r\n\r\nimport ExternalEventBus from './tools/ExternalEventBus.js';\r\nimport InternalEventBus from './tools/InternalEventBus.js';\r\n\r\nimport TableRegistry from './tools/TableRegistry.js';\r\nimport ModuleBinder from './tools/ModuleBinder.js';\r\n\r\nimport OptionsList from './tools/OptionsList.js';\r\n\r\nimport Alert from './tools/Alert.js';\r\n\r\nclass Tabulator {\r\n\t\r\n\tconstructor(element, options){\r\n\t\t\r\n\t\tthis.options = {};\r\n\t\t\r\n\t\tthis.columnManager = null; // hold Column Manager\r\n\t\tthis.rowManager = null; //hold Row Manager\r\n\t\tthis.footerManager = null; //holder Footer Manager\r\n\t\tthis.alertManager = null; //hold Alert Manager\r\n\t\tthis.vdomHoz = null; //holder horizontal virtual dom\r\n\t\tthis.externalEvents = null; //handle external event messaging\r\n\t\tthis.eventBus = null; //handle internal event messaging\r\n\t\tthis.interactionMonitor = false; //track user interaction\r\n\t\tthis.browser = \"\"; //hold current browser type\r\n\t\tthis.browserSlow = false; //handle reduced functionality for slower browsers\r\n\t\tthis.browserMobile = false; //check if running on mobile, prevent resize cancelling edit on keyboard appearance\r\n\t\tthis.rtl = false; //check if the table is in RTL mode\r\n\t\tthis.originalElement = null; //hold original table element if it has been replaced\r\n\t\t\r\n\t\tthis.componentFunctionBinder = new ComponentFunctionBinder(this); //bind component functions\r\n\t\tthis.dataLoader = false; //bind component functions\r\n\t\t\r\n\t\tthis.modules = {}; //hold all modules bound to this table\r\n\t\tthis.modulesCore = []; //hold core modules bound to this table (for initialization purposes)\r\n\t\tthis.modulesRegular = []; //hold regular modules bound to this table (for initialization purposes)\r\n\t\t\r\n\t\tthis.optionsList = new OptionsList(this, \"table constructor\");\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\t\r\n\t\tif(this.initializeElement(element)){\r\n\t\t\t\r\n\t\t\tthis.initializeCoreSystems(options);\r\n\t\t\t\r\n\t\t\t//delay table creation to allow event bindings immediately after the constructor\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tthis._create();\r\n\t\t\t})\r\n\t\t}\r\n\t\t\r\n\t\tTableRegistry.register(this); //register table for inter-device communication\r\n\t}\r\n\t\r\n\tinitializeElement(element){\r\n\t\tif(typeof HTMLElement !== \"undefined\" && element instanceof HTMLElement){\r\n\t\t\tthis.element = element;\r\n\t\t\treturn true;\r\n\t\t}else if(typeof element === \"string\"){\r\n\t\t\tthis.element = document.querySelector(element);\r\n\t\t\t\r\n\t\t\tif(this.element){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Tabulator Creation Error - no element found matching selector: \", element);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Tabulator Creation Error - Invalid element provided:\", element);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeCoreSystems(options){\r\n\t\tthis.columnManager = new ColumnManager(this);\r\n\t\tthis.rowManager = new RowManager(this);\r\n\t\tthis.footerManager = new FooterManager(this);\r\n\t\tthis.dataLoader = new DataLoader(this);\r\n\t\tthis.alertManager = new Alert(this);\r\n\t\t\r\n\t\tthis.bindModules();\r\n\t\t\r\n\t\tthis.options = this.optionsList.generate(Tabulator.defaultOptions, options)\r\n\t\t\r\n\t\tthis._clearObjectPointers();\r\n\t\t\r\n\t\tthis._mapDeprecatedFunctionality();\r\n\t\t\r\n\t\tthis.externalEvents = new ExternalEventBus(this, this.options, this.options.debugEventsExternal);\r\n\t\tthis.eventBus = new InternalEventBus(this.options.debugEventsInternal);\r\n\t\t\r\n\t\tthis.interactionMonitor = new InteractionMonitor(this);\r\n\t\t\r\n\t\tthis.dataLoader.initialize();\r\n\t\t// this.columnManager.initialize();\r\n\t\t// this.rowManager.initialize();\r\n\t\tthis.footerManager.initialize();\r\n\t}\r\n\t\r\n\t//convert deprecated functionality to new functions\r\n\t_mapDeprecatedFunctionality(){\r\n\t\t//all previously deprecated functionality removed in the 5.0 release\r\n\t}\r\n\t\r\n\t_clearSelection(){\r\n\t\t\r\n\t\tthis.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\tif (window.getSelection) {\r\n\t\t\tif (window.getSelection().empty) { // Chrome\r\n\t\t\t\twindow.getSelection().empty();\r\n\t\t\t} else if (window.getSelection().removeAllRanges) { // Firefox\r\n\t\t\t\twindow.getSelection().removeAllRanges();\r\n\t\t\t}\r\n\t\t} else if (document.selection) { // IE?\r\n\t\t\tdocument.selection.empty();\r\n\t\t}\r\n\t\t\r\n\t\tthis.element.classList.remove(\"tabulator-block-select\");\r\n\t}\r\n\t\r\n\t//create table\r\n\t_create(){\r\n\t\tthis.externalEvents.dispatch(\"tableBuilding\");\r\n\t\tthis.eventBus.dispatch(\"table-building\");\r\n\t\t\r\n\t\tthis._rtlCheck();\r\n\t\t\r\n\t\tthis._buildElement();\r\n\t\t\r\n\t\tthis._initializeTable();\r\n\t\t\r\n\t\tthis._loadInitialData();\r\n\t\t\r\n\t\tthis.initialized = true;\r\n\t\t\r\n\t\tthis.externalEvents.dispatch(\"tableBuilt\");\r\n\t}\r\n\t\r\n\t_rtlCheck(){\r\n\t\tvar style = window.getComputedStyle(this.element);\r\n\t\t\r\n\t\tswitch(this.options.textDirection){\r\n\t\t\tcase\"auto\":\r\n\t\t\tif(style.direction !== \"rtl\"){\r\n\t\t\t\tbreak;\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tcase \"rtl\":\r\n\t\t\tthis.element.classList.add(\"tabulator-rtl\");\r\n\t\t\tthis.rtl = true;\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"ltr\":\r\n\t\t\tthis.element.classList.add(\"tabulator-ltr\");\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\tthis.rtl = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//clear pointers to objects in default config object\r\n\t_clearObjectPointers(){\r\n\t\tthis.options.columns = this.options.columns.slice(0);\r\n\t\t\r\n\t\tif(Array.isArray(this.options.data) && !this.options.reactiveData){\r\n\t\t\tthis.options.data = this.options.data.slice(0);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//build tabulator element\r\n\t_buildElement(){\r\n\t\tvar element = this.element,\r\n\t\toptions = this.options,\r\n\t\tnewElement;\r\n\t\t\r\n\t\tif(element.tagName === \"TABLE\"){\r\n\t\t\tthis.originalElement = this.element;\r\n\t\t\tnewElement = document.createElement(\"div\");\r\n\t\t\t\r\n\t\t\t//transfer attributes to new element\r\n\t\t\tvar attributes = element.attributes;\r\n\t\t\t\r\n\t\t\t// loop through attributes and apply them on div\r\n\t\t\tfor(var i in attributes){\r\n\t\t\t\tif(typeof attributes[i] == \"object\"){\r\n\t\t\t\t\tnewElement.setAttribute(attributes[i].name, attributes[i].value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// replace table with div element\r\n\t\t\telement.parentNode.replaceChild(newElement, element);\r\n\t\t\t\r\n\t\t\tthis.element = element = newElement;\r\n\t\t}\r\n\t\t\r\n\t\telement.classList.add(\"tabulator\");\r\n\t\telement.setAttribute(\"role\", \"grid\");\r\n\t\t\r\n\t\t//empty element\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\t\r\n\t\t//set table height\r\n\t\tif(options.height){\r\n\t\t\toptions.height = isNaN(options.height) ? options.height : options.height + \"px\";\r\n\t\t\telement.style.height = options.height;\r\n\t\t}\r\n\t\t\r\n\t\t//set table min height\r\n\t\tif(options.minHeight !== false){\r\n\t\t\toptions.minHeight = isNaN(options.minHeight) ? options.minHeight : options.minHeight + \"px\";\r\n\t\t\telement.style.minHeight = options.minHeight;\r\n\t\t}\r\n\t\t\r\n\t\t//set table maxHeight\r\n\t\tif(options.maxHeight !== false){\r\n\t\t\toptions.maxHeight = isNaN(options.maxHeight) ? options.maxHeight : options.maxHeight + \"px\";\r\n\t\t\telement.style.maxHeight = options.maxHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//initialize core systems and modules\r\n\t_initializeTable(){\r\n\t\tvar element = this.element,\r\n\t\toptions = this.options;\r\n\t\t\r\n\t\tthis.interactionMonitor.initialize();\r\n\t\t\r\n\t\tthis.columnManager.initialize();\r\n\t\tthis.rowManager.initialize();\r\n\t\t\r\n\t\tthis._detectBrowser();\r\n\t\t\r\n\t\t//initialize core modules\r\n\t\tthis.modulesCore.forEach((mod) => {\r\n\t\t\tmod.initialize();\r\n\t\t})\r\n\t\t\r\n\t\t//build table elements\r\n\t\telement.appendChild(this.columnManager.getElement());\r\n\t\telement.appendChild(this.rowManager.getElement());\r\n\t\t\r\n\t\tif(options.footerElement){\r\n\t\t\tthis.footerManager.activate();\r\n\t\t}\r\n\t\t\r\n\t\tif(options.autoColumns && options.data){\r\n\t\t\t\r\n\t\t\tthis.columnManager.generateColumnsFromRowData(this.options.data);\r\n\t\t}\r\n\t\t\r\n\t\t//initialize regular modules\r\n\t\tthis.modulesRegular.forEach((mod) => {\r\n\t\t\tmod.initialize();\r\n\t\t});\r\n\t\t\r\n\t\tthis.columnManager.setColumns(options.columns);\r\n\t\t\r\n\t\tthis.eventBus.dispatch(\"table-built\");\r\n\t}\r\n\t\r\n\t_loadInitialData(){\r\n\t\tthis.dataLoader.load(this.options.data);\r\n\t}\r\n\t\r\n\t//deconstructor\r\n\tdestroy(){\r\n\t\tvar element = this.element;\r\n\t\t\r\n\t\tTableRegistry.deregister(this); //deregister table from inter-device communication\r\n\t\t\r\n\t\tthis.eventBus.dispatch(\"table-destroy\");\r\n\t\t\r\n\t\t//clear row data\r\n\t\tthis.rowManager.rows.forEach(function(row){\r\n\t\t\trow.wipe();\r\n\t\t});\r\n\t\t\r\n\t\tthis.rowManager.rows = [];\r\n\t\tthis.rowManager.activeRows = [];\r\n\t\tthis.rowManager.displayRows = [];\r\n\t\t\r\n\t\t//clear DOM\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\telement.classList.remove(\"tabulator\");\r\n\t}\r\n\t\r\n\t_detectBrowser(){\r\n\t\tvar ua = navigator.userAgent||navigator.vendor||window.opera;\r\n\t\t\r\n\t\tif(ua.indexOf(\"Trident\") > -1){\r\n\t\t\tthis.browser = \"ie\";\r\n\t\t\tthis.browserSlow = true;\r\n\t\t}else if(ua.indexOf(\"Edge\") > -1){\r\n\t\t\tthis.browser = \"edge\";\r\n\t\t\tthis.browserSlow = true;\r\n\t\t}else if(ua.indexOf(\"Firefox\") > -1){\r\n\t\t\tthis.browser = \"firefox\";\r\n\t\t\tthis.browserSlow = false;\r\n\t\t}else{\r\n\t\t\tthis.browser = \"other\";\r\n\t\t\tthis.browserSlow = false;\r\n\t\t}\r\n\t\t\r\n\t\tthis.browserMobile = /(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ua)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(ua.slice(0,4));\r\n\t}\r\n\t\r\n\tinitGuard(func, msg){\r\n\t\tvar stack, line;\r\n\t\t\r\n\t\tif(this.options.debugInitialization && !this.initialized){\r\n\t\t\tif(!func){\r\n\t\t\t\tstack = new Error().stack.split(\"\\n\");\r\n\t\t\t\t\r\n\t\t\t\tline = stack[0] == \"Error\" ? stack[2] : stack[1];\r\n\t\t\t\t\r\n\t\t\t\tif(line[0] == \" \"){\r\n\t\t\t\t\tfunc = line.trim().split(\" \")[1].split(\".\")[1];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfunc = line.trim().split(\"@\")[0];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconsole.warn(\"Table Not Initialized - Calling the \" + func + \" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function.\" + (msg ? \" \" + msg : \"\"));\r\n\t\t}\r\n\t\t\r\n\t\treturn this.initialized;\r\n\t}\r\n\t\r\n\t////////////////// Data Handling //////////////////\r\n\t//block table redrawing\r\n\tblockRedraw(){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.rowManager.blockRedraw();\r\n\t}\r\n\t\r\n\t//restore table redrawing\r\n\trestoreRedraw(){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.rowManager.restoreRedraw();\r\n\t}\r\n\t\r\n\t//load data\r\n\tsetData(data, params, config){\r\n\t\tthis.initGuard(false, \"To set initial data please use the 'data' property in the table constructor.\");\r\n\t\t\r\n\t\treturn this.dataLoader.load(data, params, config, false);\r\n\t}\r\n\t\r\n\t//clear data\r\n\tclearData(){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tthis.dataLoader.blockActiveLoad();\r\n\t\tthis.rowManager.clearData();\r\n\t}\r\n\t\r\n\t//get table data array\r\n\tgetData(active){\r\n\t\treturn this.rowManager.getData(active);\r\n\t}\r\n\t\r\n\t//get table data array count\r\n\tgetDataCount(active){\r\n\t\treturn this.rowManager.getDataCount(active);\r\n\t}\r\n\t\r\n\t//replace data, keeping table in position with same sort\r\n\treplaceData(data, params, config){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.dataLoader.load(data, params, config, true, true);\r\n\t}\r\n\t\r\n\t//update table data\r\n\tupdateData(data){\r\n\t\tvar responses = 0;\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data){\r\n\t\t\t\tdata.forEach((item) => {\r\n\t\t\t\t\tvar row = this.rowManager.findRow(item[this.options.index]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(row){\r\n\t\t\t\t\t\tresponses++;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trow.updateData(item)\r\n\t\t\t\t\t\t.then(()=>{\r\n\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\tresolve();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\taddData(data, pos, index){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data){\r\n\t\t\t\tthis.rowManager.addRows(data, pos, index)\r\n\t\t\t\t.then((rows) => {\r\n\t\t\t\t\tvar output = [];\r\n\t\t\t\t\t\r\n\t\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\t\toutput.push(row.getComponent());\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tresolve(output);\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//update table data\r\n\tupdateOrAddData(data){\r\n\t\tvar rows = [],\r\n\t\tresponses = 0;\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data){\r\n\t\t\t\tdata.forEach((item) => {\r\n\t\t\t\t\tvar row = this.rowManager.findRow(item[this.options.index]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tresponses++;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(row){\r\n\t\t\t\t\t\trow.updateData(item)\r\n\t\t\t\t\t\t.then(()=>{\r\n\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\trows.push(row.getComponent());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\tresolve(rows);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.rowManager.addRows(item)\r\n\t\t\t\t\t\t.then((newRows)=>{\r\n\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\trows.push(newRows[0].getComponent());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\tresolve(rows);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//get row object\r\n\tgetRow(index){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching row found:\", index);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//get row object\r\n\tgetRowFromPosition(position, active){\r\n\t\tvar row = this.rowManager.getRowFromPosition(position, active);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching row found:\", position);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//delete row from table\r\n\tdeleteRow(index){\r\n\t\tvar foundRows = [];\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(!Array.isArray(index)){\r\n\t\t\tindex = [index];\r\n\t\t}\r\n\t\t\r\n\t\t//find matching rows\r\n\t\tfor(let item of index){\r\n\t\t\tlet row = this.rowManager.findRow(item, true);\r\n\t\t\t\r\n\t\t\tif(row){\r\n\t\t\t\tfoundRows.push(row);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Delete Error - No matching row found:\", item);\r\n\t\t\t\treturn Promise.reject(\"Delete Error - No matching row found\")\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//sort rows into correct order to ensure smooth delete from table\r\n\t\tfoundRows.sort((a, b) => {\r\n\t\t\treturn this.rowManager.rows.indexOf(a) > this.rowManager.rows.indexOf(b) ? 1 : -1;\r\n\t\t});\r\n\t\t\r\n\t\t//delete rows\r\n\t\tfoundRows.forEach((row) =>{\r\n\t\t\trow.delete()\r\n\t\t});\r\n\t\t\r\n\t\tthis.rowManager.reRenderInPosition();\r\n\t\t\r\n\t\treturn Promise.resolve();\r\n\t}\r\n\t\r\n\t//add row to table\r\n\taddRow(data, pos, index){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.rowManager.addRows(data, pos, index)\r\n\t\t.then((rows)=>{\r\n\t\t\treturn rows[0].getComponent();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//update a row if it exitsts otherwise create it\r\n\tupdateOrAddRow(index, data){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.updateData(data)\r\n\t\t\t.then(()=>{\r\n\t\t\t\treturn row.getComponent();\r\n\t\t\t})\r\n\t\t}else{\r\n\t\t\treturn this.rowManager.addRows(data)\r\n\t\t\t.then((rows)=>{\r\n\t\t\t\treturn rows[0].getComponent();\r\n\t\t\t})\r\n\t\t}\r\n\t}\r\n\t\r\n\t//update row data\r\n\tupdateRow(index, data){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.updateData(data)\r\n\t\t\t.then(()=>{\r\n\t\t\t\treturn Promise.resolve(row.getComponent());\r\n\t\t\t})\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Update Error - No matching row found:\", index);\r\n\t\t\treturn Promise.reject(\"Update Error - No matching row found\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t//scroll to row in DOM\r\n\tscrollToRow(index, position, ifVisible){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn this.rowManager.scrollToRow(row, position, ifVisible)\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Scroll Error - No matching row found:\", index);\r\n\t\t\treturn Promise.reject(\"Scroll Error - No matching row found\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveRow(from, to, after){\r\n\t\tvar fromRow = this.rowManager.findRow(from);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(fromRow){\r\n\t\t\tfromRow.moveToRow(to, after);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching row found:\", from);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRows(active){\r\n\t\treturn this.rowManager.getComponents(active);\t\r\n\t}\r\n\t\r\n\t//get position of row in table\r\n\tgetRowPosition(index, active){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn this.rowManager.getRowPosition(row, active);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Position Error - No matching row found:\", index);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t/////////////// Column Functions ///////////////\r\n\tsetColumns(definition){\r\n\t\tthis.initGuard(false, \"To set initial columns please use the 'columns' property in the table constructor\");\r\n\t\t\r\n\t\tthis.columnManager.setColumns(definition);\r\n\t}\r\n\t\r\n\tgetColumns(structured){\r\n\t\treturn this.columnManager.getComponents(structured);\r\n\t}\r\n\t\r\n\tgetColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetColumnDefinitions(){\r\n\t\treturn this.columnManager.getDefinitionTree();\r\n\t}\r\n\t\r\n\tshowColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tcolumn.show();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Show Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\thideColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field); \r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tcolumn.hide();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Hide Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\ttoggleColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tif(column.visible){\r\n\t\t\t\tcolumn.hide();\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.show();\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Visibility Toggle Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColumn(definition, before, field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.columnManager.addColumn(definition, before, column)\r\n\t\t.then((column) => {\r\n\t\t\treturn column.getComponent();\r\n\t\t});\r\n\t}\r\n\t\r\n\tdeleteColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.delete();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Delete Error - No matching column found:\", field);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tupdateColumnDefinition(field, definition){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.updateDefinition(definition)\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Update Error - No matching column found:\", field);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveColumn(from, to, after){\r\n\t\tvar fromColumn = this.columnManager.findColumn(from),\r\n\t\ttoColumn = this.columnManager.findColumn(to);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(fromColumn){\r\n\t\t\tif(toColumn){\r\n\t\t\t\tthis.columnManager.moveColumn(fromColumn, toColumn, after)\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Move Error - No matching column found:\", toColumn);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching column found:\", from);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//scroll to column in DOM\r\n\tscrollToColumn(field, position, ifVisible){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\treturn this.columnManager.scrollToColumn(column, position, ifVisible)\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - No matching column found:\", field);\r\n\t\t\t\treturn Promise.reject(\"Scroll Error - No matching column found\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//////////// General Public Functions ////////////\r\n\t//redraw list without updating data\r\n\tredraw(force){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.columnManager.redraw(force);\r\n\t\tthis.rowManager.redraw(force);\r\n\t}\r\n\t\r\n\tsetHeight(height){\r\n\t\tthis.options.height = isNaN(height) ? height : height + \"px\";\r\n\t\tthis.element.style.height = this.options.height;\r\n\t\tthis.rowManager.initializeRenderer();\r\n\t\tthis.rowManager.redraw();\r\n\t}\r\n\t\r\n\t//////////////////// Event Bus ///////////////////\r\n\t\r\n\ton(key, callback){\r\n\t\tthis.externalEvents.subscribe(key, callback);\r\n\t}\r\n\t\r\n\toff(key, callback){\r\n\t\tthis.externalEvents.unsubscribe(key, callback);\r\n\t}\r\n\t\r\n\tdispatchEvent(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args.shift();\r\n\t\t\r\n\t\tthis.externalEvents.dispatch(...arguments)\r\n\t}\r\n\r\n\t//////////////////// Alerts ///////////////////\r\n\r\n\talert(contents, type){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.alertManager.alert(contents, type);\r\n\t}\r\n\r\n\tclearAlert(){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.alertManager.clear();\r\n\t}\r\n\t\r\n\t////////////// Extension Management //////////////\r\n\tmodExists(plugin, required){\r\n\t\tif(this.modules[plugin]){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tif(required){\r\n\t\t\t\tconsole.error(\"Tabulator Module Not Installed: \" + plugin);\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tmodule(key){\r\n\t\tvar mod = this.modules[key];\r\n\t\t\r\n\t\tif(!mod){\r\n\t\t\tconsole.error(\"Tabulator module not installed: \" + key);\r\n\t\t}\r\n\t\t\r\n\t\treturn mod;\r\n\t}\r\n}\r\n\r\n//default setup options\r\nTabulator.defaultOptions = defaultOptions;\r\n\r\n//bind modules and static functionality\r\nnew ModuleBinder(Tabulator);\r\n\r\nexport default Tabulator;\r\n","export default {\r\n\r\n\tdebugEventsExternal:false, //flag to console log events\r\n\tdebugEventsInternal:false, //flag to console log events\r\n\tdebugInvalidOptions:true, //allow toggling of invalid option warnings\r\n\tdebugInitialization:true, //allow toggling of invalid option warnings\r\n\r\n\theight:false, //height of tabulator\r\n\tminHeight:false, //minimum height of tabulator\r\n\tmaxHeight:false, //maximum height of tabulator\r\n\r\n\tcolumnHeaderVertAlign:\"top\", //vertical alignment of column headers\r\n\r\n\tpopupContainer:false,\r\n\r\n\tcolumns:[],//store for colum header info\r\n\tcolumnDefaults:{}, //store column default props\r\n\r\n\tdata:false, //default starting data\r\n\r\n\tautoColumns:false, //build columns from data row structure\r\n\tautoColumnsDefinitions:false,\r\n\r\n\tnestedFieldSeparator:\".\", //separator for nested data\r\n\r\n\tfooterElement:false, //hold footer element\r\n\r\n\tindex:\"id\", //filed for row index\r\n\r\n\ttextDirection:\"auto\",\r\n\r\n\taddRowPos:\"bottom\", //position to insert blank rows, top|bottom\r\n\r\n\theaderVisible:true, //hide header\r\n\r\n\trenderVertical:\"virtual\",\r\n\trenderHorizontal:\"basic\",\r\n\trenderVerticalBuffer:0, // set virtual DOM buffer size\r\n\r\n\tscrollToRowPosition:\"top\",\r\n\tscrollToRowIfVisible:true,\r\n\r\n\tscrollToColumnPosition:\"left\",\r\n\tscrollToColumnIfVisible:true,\r\n\r\n\trowFormatter:false,\r\n\trowFormatterPrint:null,\r\n\trowFormatterClipboard:null,\r\n\trowFormatterHtmlOutput:null,\r\n\r\n\trowHeight:null,\r\n\r\n\tplaceholder:false,\r\n\r\n\tdataLoader:true,\r\n\tdataLoaderLoading:false,\r\n\tdataLoaderError:false,\r\n\tdataLoaderErrorTimeout:3000,\r\n\r\n\tdataSendParams:{},\r\n\r\n\tdataReceiveParams:{},\r\n}\r\n","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defautlAccessors from './defaults/accessors.js';\r\n\r\nclass Accessor extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.allowedTypes = [\"\", \"data\", \"download\", \"clipboard\", \"print\", \"htmlOutput\"] //list of accessor types\r\n\r\n\t\tthis.registerColumnOption(\"accessor\");\r\n\t\tthis.registerColumnOption(\"accessorParams\");\r\n\t\tthis.registerColumnOption(\"accessorData\");\r\n\t\tthis.registerColumnOption(\"accessorDataParams\");\r\n\t\tthis.registerColumnOption(\"accessorDownload\");\r\n\t\tthis.registerColumnOption(\"accessorDownloadParams\");\r\n\t\tthis.registerColumnOption(\"accessorClipboard\");\r\n\t\tthis.registerColumnOption(\"accessorClipboardParams\");\r\n\t\tthis.registerColumnOption(\"accessorPrint\");\r\n\t\tthis.registerColumnOption(\"accessorPrintParams\");\r\n\t\tthis.registerColumnOption(\"accessorHtmlOutput\");\r\n\t\tthis.registerColumnOption(\"accessorHtmlOutputParams\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"row-data-retrieve\", this.transformRow.bind(this));\r\n\t}\r\n\r\n\t//initialize column accessor\r\n\tinitializeColumn(column){\r\n\t\tvar match = false,\r\n\t\tconfig = {};\r\n\r\n\t\tthis.allowedTypes.forEach((type) => {\r\n\t\t\tvar key = \"accessor\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\t\taccessor;\r\n\r\n\t\t\tif(column.definition[key]){\r\n\t\t\t\taccessor = this.lookupAccessor(column.definition[key]);\r\n\r\n\t\t\t\tif(accessor){\r\n\t\t\t\t\tmatch = true;\r\n\r\n\t\t\t\t\tconfig[key] = {\r\n\t\t\t\t\t\taccessor:accessor,\r\n\t\t\t\t\t\tparams: column.definition[key + \"Params\"] || {},\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(match){\r\n\t\t\tcolumn.modules.accessor = config;\r\n\t\t}\r\n\t}\r\n\r\n\tlookupAccessor(value){\r\n\t\tvar accessor = false;\r\n\r\n\t\t//set column accessor\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(Accessor.accessors[value]){\r\n\t\t\t\taccessor = Accessor.accessors[value]\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Accessor Error - No such accessor found, ignoring: \", value);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\taccessor = value;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn accessor;\r\n\t}\r\n\r\n\t//apply accessor to row\r\n\ttransformRow(row, type){\r\n\t\tvar key = \"accessor\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\trowComponent = row.getComponent();\r\n\r\n\t\t//clone data object with deep copy to isolate internal data from returned result\r\n\t\tvar data = Helpers.deepClone(row.data || {});\r\n\r\n\t\tthis.table.columnManager.traverse(function(column){\r\n\t\t\tvar value, accessor, params, colCompnent;\r\n\r\n\t\t\tif(column.modules.accessor){\r\n\r\n\t\t\t\taccessor = column.modules.accessor[key] || column.modules.accessor.accessor || false;\r\n\r\n\t\t\t\tif(accessor){\r\n\t\t\t\t\tvalue = column.getFieldValue(data);\r\n\r\n\t\t\t\t\tif(value != \"undefined\"){\r\n\t\t\t\t\t\tcolCompnent = column.getComponent();\r\n\t\t\t\t\t\tparams = typeof accessor.params === \"function\" ? accessor.params(value, data, type, colCompnent, rowComponent) : accessor.params;\r\n\t\t\t\t\t\tcolumn.setFieldValue(data, accessor.accessor(value, data, type, params, colCompnent, rowComponent));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n}\r\n\r\n//load defaults\r\nAccessor.moduleName = \"accessor\";\r\nAccessor.accessors = defautlAccessors;\r\n\r\nexport default Accessor;","export default {}","function generateParamsList(data, prefix){\r\n\tvar output = [];\r\n\r\n\tprefix = prefix || \"\";\r\n\r\n\tif(Array.isArray(data)){\r\n\t\tdata.forEach((item, i) => {\r\n\t\t\toutput = output.concat(generateParamsList(item, prefix ? prefix + \"[\" + i + \"]\" : i));\r\n\t\t});\r\n\t}else if (typeof data === \"object\"){\r\n\t\tfor (var key in data){\r\n\t\t\toutput = output.concat(generateParamsList(data[key], prefix ? prefix + \"[\" + key + \"]\" : key));\r\n\t\t}\r\n\t}else{\r\n\t\toutput.push({key:prefix, value:data});\r\n\t}\r\n\r\n\treturn output;\r\n}\r\n\r\nfunction serializeParams(params){\r\n\tvar output = generateParamsList(params),\r\n\tencoded = [];\r\n\r\n\toutput.forEach(function(item){\r\n\t\tencoded.push(encodeURIComponent(item.key) + \"=\" + encodeURIComponent(item.value));\r\n\t});\r\n\r\n\treturn encoded.join(\"&\");\r\n}\r\n\r\nexport default function(url, config, params){\r\n\tif(url){\r\n\t\tif(params && Object.keys(params).length){\r\n\t\t\tif(!config.method || config.method.toLowerCase() == \"get\"){\r\n\t\t\t\tconfig.method = \"get\";\r\n\r\n\t\t\t\turl += (url.includes(\"?\") ? \"&\" : \"?\") + serializeParams(params);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn url;\r\n};","function generateParamsList(data, prefix){\r\n\tvar output = [];\r\n\r\n\tprefix = prefix || \"\";\r\n\r\n\tif(Array.isArray(data)){\r\n\t\tdata.forEach((item, i) => {\r\n\t\t\toutput = output.concat(generateParamsList(item, prefix ? prefix + \"[\" + i + \"]\" : i));\r\n\t\t});\r\n\t}else if (typeof data === \"object\"){\r\n\t\tfor (var key in data){\r\n\t\t\toutput = output.concat(generateParamsList(data[key], prefix ? prefix + \"[\" + key + \"]\" : key));\r\n\t\t}\r\n\t}else{\r\n\t\toutput.push({key:prefix, value:data});\r\n\t}\r\n\r\n\treturn output;\r\n}\r\n\r\nexport default {\r\n\t\"json\":{\r\n\t\theaders:{\r\n\t\t\t'Content-Type': 'application/json',\r\n\t\t},\r\n\t\tbody:function(url, config, params){\r\n\t\t\treturn JSON.stringify(params);\r\n\t\t},\r\n\t},\r\n\t\"form\":{\r\n\t\theaders:{\r\n\t\t},\r\n\t\tbody:function(url, config, params){\r\n\r\n\t\t\tvar output = generateParamsList(params),\r\n\t\t\tform = new FormData();\r\n\r\n\t\t\toutput.forEach(function(item){\r\n\t\t\t\tform.append(item.key, item.value);\r\n\t\t\t});\r\n\r\n\t\t\treturn form;\r\n\t\t},\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultConfig from './defaults/config.js';\r\nimport defaultURLGenerator from './defaults/urlGenerator.js';\r\nimport defaultLoaderPromise from './defaults/loaderPromise.js';\r\nimport defaultContentTypeFormatters from './defaults/contentTypeFormatters.js';\r\n\r\nclass Ajax extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.config = {}; //hold config object for ajax request\r\n\t\tthis.url = \"\"; //request URL\r\n\t\tthis.urlGenerator = false;\r\n\t\tthis.params = false; //request parameters\r\n\t\t\r\n\t\tthis.loaderPromise = false;\r\n\t\t\r\n\t\tthis.registerTableOption(\"ajaxURL\", false); //url for ajax loading\r\n\t\tthis.registerTableOption(\"ajaxURLGenerator\", false);\r\n\t\tthis.registerTableOption(\"ajaxParams\", {}); //params for ajax loading\r\n\t\tthis.registerTableOption(\"ajaxConfig\", \"get\"); //ajax request type\r\n\t\tthis.registerTableOption(\"ajaxContentType\", \"form\"); //ajax request type\r\n\t\tthis.registerTableOption(\"ajaxRequestFunc\", false); //promise function\r\n\t\t\r\n\t\tthis.registerTableOption(\"ajaxRequesting\", function(){});\r\n\t\tthis.registerTableOption(\"ajaxResponse\", false);\r\n\t\t\r\n\t\tthis.contentTypeFormatters = Ajax.contentTypeFormatters;\r\n\t}\r\n\t\r\n\t//initialize setup options\r\n\tinitialize(){\r\n\t\tthis.loaderPromise = this.table.options.ajaxRequestFunc || Ajax.defaultLoaderPromise;\r\n\t\tthis.urlGenerator = this.table.options.ajaxURLGenerator || Ajax.defaultURLGenerator;\r\n\t\t\r\n\t\tif(this.table.options.ajaxURL){\r\n\t\t\tthis.setUrl(this.table.options.ajaxURL);\r\n\t\t}\r\n\r\n\r\n\t\tthis.setDefaultConfig(this.table.options.ajaxConfig);\r\n\t\t\r\n\t\tthis.registerTableFunction(\"getAjaxUrl\", this.getUrl.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"data-loading\", this.requestDataCheck.bind(this));\r\n\t\tthis.subscribe(\"data-params\", this.requestParams.bind(this));\r\n\t\tthis.subscribe(\"data-load\", this.requestData.bind(this));\r\n\t}\r\n\t\r\n\trequestParams(data, config, silent, params){\r\n\t\tvar ajaxParams = this.table.options.ajaxParams;\r\n\t\t\r\n\t\tif(ajaxParams){\r\n\t\t\tif(typeof ajaxParams === \"function\"){\r\n\t\t\t\tajaxParams = ajaxParams.call(this.table);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tparams = Object.assign(params, ajaxParams);\r\n\t\t}\t\t\r\n\t\t\r\n\t\treturn params;\r\n\t}\r\n\t\r\n\trequestDataCheck(data, params, config, silent){\r\n\t\treturn !!((!data && this.url) || typeof data === \"string\");\r\n\t}\r\n\t\r\n\trequestData(url, params, config, silent, previousData){\r\n\t\tvar ajaxConfig;\r\n\t\t\r\n\t\tif(!previousData && this.requestDataCheck(url)){\r\n\t\t\tif(url){\r\n\t\t\t\tthis.setUrl(url);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tajaxConfig = this.generateConfig(config);\r\n\t\t\t\r\n\t\t\treturn this.sendRequest(this.url, params, ajaxConfig);\r\n\t\t}else{\r\n\t\t\treturn previousData;\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetDefaultConfig(config = {}){\r\n\t\tthis.config = Object.assign({}, Ajax.defaultConfig);\r\n\r\n\t\tif(typeof config == \"string\"){\r\n\t\t\tthis.config.method = config;\r\n\t\t}else{\r\n\t\t\tObject.assign(this.config, config);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//load config object\r\n\tgenerateConfig(config = {}){\r\n\t\tvar ajaxConfig = Object.assign({}, this.config)\r\n\t\t\r\n\t\tif(typeof config == \"string\"){\r\n\t\t\tajaxConfig.method = config;\r\n\t\t}else{\r\n\t\t\tObject.assign(ajaxConfig, config);\r\n\t\t}\r\n\t\t\r\n\t\treturn ajaxConfig;\r\n\t}\r\n\t\r\n\t//set request url\r\n\tsetUrl(url){\r\n\t\tthis.url = url;\r\n\t}\r\n\t\r\n\t//get request url\r\n\tgetUrl(){\r\n\t\treturn this.url;\r\n\t}\r\n\t\r\n\t//send ajax request\r\n\tsendRequest(url, params, config){\r\n\t\tif(this.table.options.ajaxRequesting.call(this.table, url, params) !== false){\r\n\t\t\treturn this.loaderPromise(url, config, params)\r\n\t\t\t.then((data)=>{\r\n\t\t\t\tif(this.table.options.ajaxResponse){\r\n\t\t\t\t\tdata = this.table.options.ajaxResponse.call(this.table, url, params, data);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn data;\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n}\r\n\r\nAjax.moduleName = \"ajax\";\r\n\r\n//load defaults\r\nAjax.defaultConfig = defaultConfig;\r\nAjax.defaultURLGenerator = defaultURLGenerator;\r\nAjax.defaultLoaderPromise = defaultLoaderPromise;\r\nAjax.contentTypeFormatters = defaultContentTypeFormatters;\r\n\r\nexport default Ajax;","export default {\r\n\tmethod: \"GET\",\r\n};","export default function(url, config, params){\r\n\tvar contentType;\r\n\r\n\treturn new Promise((resolve, reject) => {\r\n\t\t//set url\r\n\t\turl = this.urlGenerator.call(this.table, url, config, params);\r\n\r\n\t\t//set body content if not GET request\r\n\t\tif(config.method.toUpperCase() != \"GET\"){\r\n\t\t\tcontentType = typeof this.table.options.ajaxContentType === \"object\" ? this.table.options.ajaxContentType : this.contentTypeFormatters[this.table.options.ajaxContentType];\r\n\t\t\tif(contentType){\r\n\r\n\t\t\t\tfor(var key in contentType.headers){\r\n\t\t\t\t\tif(!config.headers){\r\n\t\t\t\t\t\tconfig.headers = {};\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(typeof config.headers[key] === \"undefined\"){\r\n\t\t\t\t\t\tconfig.headers[key] = contentType.headers[key];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconfig.body = contentType.body.call(this, url, config, params);\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Ajax Error - Invalid ajaxContentType value:\", this.table.options.ajaxContentType);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(url){\r\n\t\t\t//configure headers\r\n\t\t\tif(typeof config.headers === \"undefined\"){\r\n\t\t\t\tconfig.headers = {};\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.headers.Accept === \"undefined\"){\r\n\t\t\t\tconfig.headers.Accept = \"application/json\";\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.headers[\"X-Requested-With\"] === \"undefined\"){\r\n\t\t\t\tconfig.headers[\"X-Requested-With\"] = \"XMLHttpRequest\";\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.mode === \"undefined\"){\r\n\t\t\t\tconfig.mode = \"cors\";\r\n\t\t\t}\r\n\r\n\t\t\tif(config.mode == \"cors\"){\r\n\t\t\t\tif(typeof config.headers[\"Origin\"] === \"undefined\"){\r\n\t\t\t\t\tconfig.headers[\"Origin\"] = window.location.origin;\r\n\t\t\t\t}\r\n \r\n\t\t\t\tif(typeof config.credentials === \"undefined\"){\r\n\t\t\t\t\tconfig.credentials = 'same-origin';\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(typeof config.credentials === \"undefined\"){\r\n\t\t\t\t\tconfig.credentials = 'include';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//send request\r\n\t\t\tfetch(url, config)\r\n\t\t\t.then((response)=>{\r\n\t\t\t\tif(response.ok) {\r\n\t\t\t\t\tresponse.json()\r\n\t\t\t\t\t.then((data)=>{\r\n\t\t\t\t\t\tresolve(data);\r\n\t\t\t\t\t}).catch((error)=>{\r\n\t\t\t\t\t\treject(error);\r\n\t\t\t\t\t\tconsole.warn(\"Ajax Load Error - Invalid JSON returned\", error);\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.error(\"Ajax Load Error - Connection Error: \" + response.status, response.statusText);\r\n\t\t\t\t\treject(response);\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.catch((error)=>{\r\n\t\t\t\tconsole.error(\"Ajax Load Error - Connection Error: \", error);\r\n\t\t\t\treject(error);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Ajax Load Error - No URL Set\");\r\n\t\t\tresolve([]);\r\n\t\t}\r\n\t});\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultPasteActions from './defaults/pasteActions.js';\r\nimport defaultPasteParsers from './defaults/pasteParsers.js';\r\n\r\nclass Clipboard extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.mode = true;\r\n\t\tthis.pasteParser = function(){};\r\n\t\tthis.pasteAction = function(){};\r\n\t\tthis.customSelection = false;\r\n\t\tthis.rowRange = false;\r\n\t\tthis.blocked = true; //block copy actions not originating from this command\r\n\r\n\t\tthis.registerTableOption(\"clipboard\", false); //enable clipboard\r\n\t\tthis.registerTableOption(\"clipboardCopyStyled\", true); //formatted table data\r\n\t\tthis.registerTableOption(\"clipboardCopyConfig\", false); //clipboard config\r\n\t\tthis.registerTableOption(\"clipboardCopyFormatter\", false); //DEPRICATED - REMOVE in 5.0\r\n\t\tthis.registerTableOption(\"clipboardCopyRowRange\", \"active\"); //restrict clipboard to visible rows only\r\n\t\tthis.registerTableOption(\"clipboardPasteParser\", \"table\"); //convert pasted clipboard data to rows\r\n\t\tthis.registerTableOption(\"clipboardPasteAction\", \"insert\"); //how to insert pasted data into the table\r\n\r\n\t\tthis.registerColumnOption(\"clipboard\");\r\n\t\tthis.registerColumnOption(\"titleClipboard\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.mode = this.table.options.clipboard;\r\n\r\n\t\tthis.rowRange = this.table.options.clipboardCopyRowRange;\r\n\r\n\t\tif(this.mode === true || this.mode === \"copy\"){\r\n\t\t\tthis.table.element.addEventListener(\"copy\", (e) => {\r\n\t\t\t\tvar plain, html, list;\r\n\r\n\t\t\t\tif(!this.blocked){\r\n\t\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\t\tif(this.customSelection){\r\n\t\t\t\t\t\tplain = this.customSelection;\r\n\r\n\t\t\t\t\t\tif(this.table.options.clipboardCopyFormatter){\r\n\t\t\t\t\t\t\tplain = this.table.options.clipboardCopyFormatter(\"plain\", plain);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\r\n\t\t\t\t\t\tvar list = this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig, this.table.options.clipboardCopyStyled, this.rowRange, \"clipboard\");\r\n\r\n\t\t\t\t\t\thtml = this.table.modules.export.genereateHTMLTable(list);\r\n\t\t\t\t\t\tplain = html ? this.generatePlainContent(list) : \"\";\r\n\r\n\t\t\t\t\t\tif(this.table.options.clipboardCopyFormatter){\r\n\t\t\t\t\t\t\tplain = this.table.options.clipboardCopyFormatter(\"plain\", plain);\r\n\t\t\t\t\t\t\thtml = this.table.options.clipboardCopyFormatter(\"html\", html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (window.clipboardData && window.clipboardData.setData) {\r\n\t\t\t\t\t\twindow.clipboardData.setData('Text', plain);\r\n\t\t\t\t\t} else if (e.clipboardData && e.clipboardData.setData) {\r\n\t\t\t\t\t\te.clipboardData.setData('text/plain', plain);\r\n\t\t\t\t\t\tif(html){\r\n\t\t\t\t\t\t\te.clipboardData.setData('text/html', html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (e.originalEvent && e.originalEvent.clipboardData.setData) {\r\n\t\t\t\t\t\te.originalEvent.clipboardData.setData('text/plain', plain);\r\n\t\t\t\t\t\tif(html){\r\n\t\t\t\t\t\t\te.originalEvent.clipboardData.setData('text/html', html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.dispatchExternal(\"clipboardCopied\", plain, html);\r\n\r\n\t\t\t\t\tthis.reset();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.mode === true || this.mode === \"paste\"){\r\n\t\t\tthis.table.element.addEventListener(\"paste\", (e) => {\r\n\t\t\t\tthis.paste(e);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.setPasteParser(this.table.options.clipboardPasteParser);\r\n\t\tthis.setPasteAction(this.table.options.clipboardPasteAction);\r\n\r\n\t\tthis.registerTableFunction(\"copyToClipboard\", this.copy.bind(this));\r\n\t}\r\n\r\n\treset(){\r\n\t\tthis.blocked = true;\r\n\t\tthis.customSelection = false;\r\n\t}\r\n\r\n\tgeneratePlainContent (list) {\r\n\t\tvar output = [];\r\n\r\n\t\tlist.forEach((row) => {\r\n\t\t\tvar rowData = [];\r\n\r\n\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\tvar value = \"\";\r\n\r\n\t\t\t\tif(col){\r\n\r\n\t\t\t\t\tif(row.type === \"group\"){\r\n\t\t\t\t\t\tcol.value = col.component.getKey();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(col.value === null){\r\n\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\t\tvalue = JSON.stringify(col.value);\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tvalue = col.value;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowData.push(value);\r\n\t\t\t});\r\n\r\n\t\t\toutput.push(rowData.join(\"\\t\"));\r\n\t\t});\r\n\r\n\t\treturn output.join(\"\\n\");\r\n\t}\r\n\r\n\tcopy (range, internal) {\r\n\t\tvar range, sel, textRange;\r\n\t\tthis.blocked = false;\r\n\t\tthis.customSelection = false;\r\n\r\n\t\tif (this.mode === true || this.mode === \"copy\") {\r\n\r\n\t\t\tthis.rowRange = range || this.table.options.clipboardCopyRowRange;\r\n\r\n\t\t\tif (typeof window.getSelection != \"undefined\" && typeof document.createRange != \"undefined\") {\r\n\t\t\t\trange = document.createRange();\r\n\t\t\t\trange.selectNodeContents(this.table.element);\r\n\t\t\t\tsel = window.getSelection();\r\n\r\n\t\t\t\tif (sel.toString() && internal) {\r\n\t\t\t\t\tthis.customSelection = sel.toString();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tsel.removeAllRanges();\r\n\t\t\t\tsel.addRange(range);\r\n\t\t\t} else if (typeof document.selection != \"undefined\" && typeof document.body.createTextRange != \"undefined\") {\r\n\t\t\t\ttextRange = document.body.createTextRange();\r\n\t\t\t\ttextRange.moveToElementText(this.table.element);\r\n\t\t\t\ttextRange.select();\r\n\t\t\t}\r\n\r\n\t\t\tdocument.execCommand('copy');\r\n\r\n\t\t\tif (sel) {\r\n\t\t\t\tsel.removeAllRanges();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//PASTE EVENT HANDLING\r\n\tsetPasteAction(action){\r\n\r\n\t\tswitch(typeof action){\r\n\t\t\tcase \"string\":\r\n\t\t\tthis.pasteAction = Clipboard.pasteActions[action];\r\n\r\n\t\t\tif(!this.pasteAction){\r\n\t\t\t\tconsole.warn(\"Clipboard Error - No such paste action found:\", action);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tthis.pasteAction = action;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tsetPasteParser(parser){\r\n\t\tswitch(typeof parser){\r\n\t\t\tcase \"string\":\r\n\t\t\tthis.pasteParser = Clipboard.pasteParsers[parser];\r\n\r\n\t\t\tif(!this.pasteParser){\r\n\t\t\t\tconsole.warn(\"Clipboard Error - No such paste parser found:\", parser);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tthis.pasteParser = parser;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tpaste(e){\r\n\t\tvar data, rowData, rows;\r\n\r\n\t\tif(this.checkPaseOrigin(e)){\r\n\r\n\t\t\tdata = this.getPasteData(e);\r\n\r\n\t\t\trowData = this.pasteParser.call(this, data);\r\n\r\n\t\t\tif(rowData){\r\n\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\t\t\trowData = this.mutateData(rowData);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trows = this.pasteAction.call(this, rowData);\r\n\r\n\t\t\t\tthis.dispatchExternal(\"clipboardPasted\", data, rowData, rows);\r\n\t\t\t}else{\r\n\t\t\t\tthis.dispatchExternal(\"clipboardPasteError\", data);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmutateData(data){\r\n\t\tvar output = [];\r\n\r\n\t\tif(Array.isArray(data)){\r\n\t\t\tdata.forEach((row) => {\r\n\t\t\t\toutput.push(this.table.modules.mutator.transformRow(row, \"clipboard\"));\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\toutput = data;\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\r\n\tcheckPaseOrigin(e){\r\n\t\tvar valid = true;\r\n\r\n\t\tif(e.target.tagName != \"DIV\" || this.table.modules.edit.currentCell){\r\n\t\t\tvalid = false;\r\n\t\t}\r\n\r\n\t\treturn valid;\r\n\t}\r\n\r\n\tgetPasteData(e){\r\n\t\tvar data;\r\n\r\n\t\tif (window.clipboardData && window.clipboardData.getData) {\r\n\t\t\tdata = window.clipboardData.getData('Text');\r\n\t\t} else if (e.clipboardData && e.clipboardData.getData) {\r\n\t\t\tdata = e.clipboardData.getData('text/plain');\r\n\t\t} else if (e.originalEvent && e.originalEvent.clipboardData.getData) {\r\n\t\t\tdata = e.originalEvent.clipboardData.getData('text/plain');\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n}\r\n\r\nClipboard.moduleName = \"clipboard\";\r\n\r\n//load defaults\r\nClipboard.pasteActions = defaultPasteActions;\r\nClipboard.pasteParsers = defaultPasteParsers;\r\n\r\nexport default Clipboard;","export default {\r\n\treplace:function(rows){\r\n\t\treturn this.table.setData(rows);\r\n\t},\r\n\tupdate:function(rows){\r\n\t\treturn this.table.updateOrAddData(rows);\r\n\t},\r\n\tinsert:function(rows){\r\n\t\treturn this.table.addData(rows);\r\n\t},\r\n};","export default {\r\n\ttable:function(clipboard){\r\n\t\tvar data = [],\r\n\t\tsuccess = false,\r\n\t\theaderFindSuccess = true,\r\n\t\tcolumns = this.table.columnManager.columns,\r\n\t\tcolumnMap = [],\r\n\t\trows = [];\r\n\r\n\t\t//get data from clipboard into array of columns and rows.\r\n\t\tclipboard = clipboard.split(\"\\n\");\r\n\r\n\t\tclipboard.forEach(function(row){\r\n\t\t\tdata.push(row.split(\"\\t\"));\r\n\t\t});\r\n\r\n\t\tif(data.length && !(data.length === 1 && data[0].length < 2)){\r\n\t\t\tsuccess = true;\r\n\r\n\t\t\t//check if headers are present by title\r\n\t\t\tdata[0].forEach(function(value){\r\n\t\t\t\tvar column = columns.find(function(column){\r\n\t\t\t\t\treturn value && column.definition.title && value.trim() && column.definition.title.trim() === value.trim();\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tcolumnMap.push(column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\theaderFindSuccess = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t//check if column headers are present by field\r\n\t\t\tif(!headerFindSuccess){\r\n\t\t\t\theaderFindSuccess = true;\r\n\t\t\t\tcolumnMap = [];\r\n\r\n\t\t\t\tdata[0].forEach(function(value){\r\n\t\t\t\t\tvar column = columns.find(function(column){\r\n\t\t\t\t\t\treturn value && column.field && value.trim() && column.field.trim() === value.trim();\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(column){\r\n\t\t\t\t\t\tcolumnMap.push(column);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\theaderFindSuccess = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(!headerFindSuccess){\r\n\t\t\t\t\tcolumnMap = this.table.columnManager.columnsByIndex;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//remove header row if found\r\n\t\t\tif(headerFindSuccess){\r\n\t\t\t\tdata.shift();\r\n\t\t\t}\r\n\r\n\t\t\tdata.forEach(function(item){\r\n\t\t\t\tvar row = {};\r\n\r\n\t\t\t\titem.forEach(function(value, i){\r\n\t\t\t\t\tif(columnMap[i]){\r\n\t\t\t\t\t\trow[columnMap[i].field] = value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\trows.push(row);\r\n\t\t\t});\r\n\r\n\t\t\treturn rows;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n};","class CalcComponent{\r\n\tconstructor (row){\r\n\t\tthis._row = row;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._row.table.componentFunctionBinder.handle(\"row\", target._row, name)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\tgetData(transform){\r\n\t\treturn this._row.getData(transform);\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._row.getElement();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._row.table;\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._row.getCells().forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tgetCell(column){\r\n\t\tvar cell = this._row.getCell(column);\r\n\t\treturn cell ? cell.getComponent() : false;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._row;\r\n\t}\r\n}\r\n\r\nexport default CalcComponent;","export default {\r\n\t\"avg\":function(values, data, calcParams){\r\n\t\tvar output = 0,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : 2\r\n\r\n\t\tif(values.length){\r\n\t\t\toutput = values.reduce(function(sum, value){\r\n\t\t\t\treturn Number(sum) + Number(value);\r\n\t\t\t});\r\n\r\n\t\t\toutput = output / values.length;\r\n\r\n\t\t\toutput = precision !== false ? output.toFixed(precision) : output;\r\n\t\t}\r\n\r\n\t\treturn parseFloat(output).toString();\r\n\t},\r\n\t\"max\":function(values, data, calcParams){\r\n\t\tvar output = null,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tvalues.forEach(function(value){\r\n\r\n\t\t\tvalue = Number(value);\r\n\r\n\t\t\tif(value > output || output === null){\r\n\t\t\t\toutput = value;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output !== null ? (precision !== false ? output.toFixed(precision) : output) : \"\";\r\n\t},\r\n\t\"min\":function(values, data, calcParams){\r\n\t\tvar output = null,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tvalues.forEach(function(value){\r\n\r\n\t\t\tvalue = Number(value);\r\n\r\n\t\t\tif(value < output || output === null){\r\n\t\t\t\toutput = value;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output !== null ? (precision !== false ? output.toFixed(precision) : output) : \"\";\r\n\t},\r\n\t\"sum\":function(values, data, calcParams){\r\n\t\tvar output = 0,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tif(values.length){\r\n\t\t\tvalues.forEach(function(value){\r\n\t\t\t\tvalue = Number(value);\r\n\r\n\t\t\t\toutput += !isNaN(value) ? Number(value) : 0;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn precision !== false ? output.toFixed(precision) : output;\r\n\t},\r\n\t\"concat\":function(values, data, calcParams){\r\n\t\tvar output = 0;\r\n\r\n\t\tif(values.length){\r\n\t\t\toutput = values.reduce(function(sum, value){\r\n\t\t\t\treturn String(sum) + String(value);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t},\r\n\t\"count\":function(values, data, calcParams){\r\n\t\tvar output = 0;\r\n\r\n\t\tif(values.length){\r\n\t\t\tvalues.forEach(function(value){\r\n\t\t\t\tif(value){\r\n\t\t\t\t\toutput ++;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport CalcComponent from './CalcComponent.js';\r\n\r\nimport Cell from '../../core/cell/Cell.js';\r\nimport Column from '../../core/column/Column.js';\r\nimport Row from '../../core/row/Row.js';\r\n\r\nimport defaultCalculations from './defaults/calculations.js';\r\n\r\nclass ColumnCalcs extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.topCalcs = [];\r\n\t\tthis.botCalcs = [];\r\n\t\tthis.genColumn = false;\r\n\t\tthis.topElement = this.createElement();\r\n\t\tthis.botElement = this.createElement();\r\n\t\tthis.topRow = false;\r\n\t\tthis.botRow = false;\r\n\t\tthis.topInitialized = false;\r\n\t\tthis.botInitialized = false;\r\n\r\n\t\tthis.registerTableOption(\"columnCalcs\", true);\r\n\r\n\t\tthis.registerColumnOption(\"topCalc\");\r\n\t\tthis.registerColumnOption(\"topCalcParams\");\r\n\t\tthis.registerColumnOption(\"topCalcFormatter\");\r\n\t\tthis.registerColumnOption(\"topCalcFormatterParams\");\r\n\t\tthis.registerColumnOption(\"bottomCalc\");\r\n\t\tthis.registerColumnOption(\"bottomCalcParams\");\r\n\t\tthis.registerColumnOption(\"bottomCalcFormatter\");\r\n\t\tthis.registerColumnOption(\"bottomCalcFormatterParams\");\r\n\t}\r\n\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tel.classList.add(\"tabulator-calcs-holder\");\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.genColumn = new Column({field:\"value\"}, this);\r\n\r\n\t\tthis.subscribe(\"cell-value-changed\", this.cellValueChanged.bind(this));\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumnCheck.bind(this));\r\n\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"row-added\", this.rowsUpdated.bind(this));\r\n\t\tthis.subscribe(\"column-moved\", this.recalcActiveRows.bind(this));\r\n\t\tthis.subscribe(\"column-add\", this.recalcActiveRows.bind(this));\r\n\t\tthis.subscribe(\"data-refreshed\", this.recalcActiveRowsRefresh.bind(this));\r\n\t\tthis.subscribe(\"table-redraw\", this.tableRedraw.bind(this));\r\n\t\tthis.subscribe(\"rows-visible\", this.visibleRows.bind(this));\r\n\r\n\t\tthis.registerTableFunction(\"getCalcResults\", this.getResults.bind(this));\r\n\t\tthis.registerTableFunction(\"recalc\", this.userRecalc.bind(this));\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\r\n\t\tif(force){\r\n\t\t\tthis.redraw();\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\tuserRecalc(){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tvisibleRows(viewable, rows){\r\n\t\tif(this.topRow){\r\n\t\t\trows.unshift(this.topRow);\r\n\t\t}\r\n\r\n\t\tif(this.botRow){\r\n\t\t\trows.push(this.botRow);\r\n\t\t}\r\n\t\r\n\t\treturn rows;\r\n\t}\r\n\r\n\trowsUpdated(row){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.recalcRowGroup(this);\r\n\t\t}else{\r\n\t\t\tthis.recalcActiveRows();\r\n\t\t}\r\n\t}\r\n\r\n\trecalcActiveRowsRefresh(){\r\n\t\tif(this.table.options.groupBy && this.table.options.dataTreeStartExpanded && this.table.options.dataTree){\r\n\t\t\tthis.recalcAll();\r\n\t\t}else{\r\n\t\t\tthis.recalcActiveRows();\r\n\t\t}\r\n\t}\r\n\r\n\trecalcActiveRows(){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\t}\r\n\r\n\tcellValueChanged(cell){\r\n\t\tif(cell.column.definition.topCalc || cell.column.definition.bottomCalc){\r\n\t\t\tif(this.table.options.groupBy){\r\n\t\t\t\tif(this.table.options.columnCalcs == \"table\" || this.table.options.columnCalcs == \"both\"){\r\n\t\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"table\"){\r\n\t\t\t\t\tthis.recalcRowGroup(cell.row);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeColumnCheck(column){\r\n\t\tif(column.definition.topCalc || column.definition.bottomCalc){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\r\n\t//initialize column calcs\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.definition\r\n\r\n\t\tvar config = {\r\n\t\t\ttopCalcParams:def.topCalcParams || {},\r\n\t\t\tbotCalcParams:def.bottomCalcParams || {},\r\n\t\t};\r\n\r\n\t\tif(def.topCalc){\r\n\r\n\t\t\tswitch(typeof def.topCalc){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tif(ColumnCalcs.calculations[def.topCalc]){\r\n\t\t\t\t\tconfig.topCalc = ColumnCalcs.calculations[def.topCalc]\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Column Calc Error - No such calculation found, ignoring: \", def.topCalc);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tconfig.topCalc = def.topCalc;\r\n\t\t\t\tbreak\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(config.topCalc){\r\n\t\t\t\tcolumn.modules.columnCalcs = config;\r\n\t\t\t\tthis.topCalcs.push(column);\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"group\"){\r\n\t\t\t\t\tthis.initializeTopRow();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tif(def.bottomCalc){\r\n\t\t\tswitch(typeof def.bottomCalc){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tif(ColumnCalcs.calculations[def.bottomCalc]){\r\n\t\t\t\t\tconfig.botCalc = ColumnCalcs.calculations[def.bottomCalc]\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Column Calc Error - No such calculation found, ignoring: \", def.bottomCalc);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tconfig.botCalc = def.bottomCalc;\r\n\t\t\t\tbreak\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(config.botCalc){\r\n\t\t\t\tcolumn.modules.columnCalcs = config;\r\n\t\t\t\tthis.botCalcs.push(column);\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"group\"){\r\n\t\t\t\t\tthis.initializeBottomRow();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t//dummy functions to handle being mock column manager\r\n\tregisterColumnField(){};\r\n\r\n\tremoveCalcs(){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(this.topInitialized){\r\n\t\t\tthis.topInitialized = false;\r\n\t\t\tthis.topElement.parentNode.removeChild(this.topElement);\r\n\t\t\tchanged = true;\r\n\t\t}\r\n\r\n\t\tif(this.botInitialized){\r\n\t\t\tthis.botInitialized = false;\r\n\t\t\tthis.footerRemove(this.botElement);\r\n\t\t\tchanged = true;\r\n\t\t}\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeTopRow(){\r\n\t\tif(!this.topInitialized){\r\n\t\t\tthis.table.columnManager.getElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling);\r\n\t\t\tthis.topInitialized = true;\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeBottomRow(){\r\n\t\tif(!this.botInitialized){\r\n\t\t\tthis.footerPrepend(this.botElement);\r\n\t\t\tthis.botInitialized = true;\r\n\t\t}\r\n\t}\r\n\r\n\tscrollHorizontal(left){\r\n\t\tif(this.botInitialized && this.botRow){\r\n\t\t\tthis.botRow.getElement().style.marginLeft = (-left) + \"px\";\r\n\t\t}\r\n\t}\r\n\r\n\trecalc(rows){\r\n\t\tvar data, row;\r\n\r\n\t\tif(this.topInitialized || this.botInitialized){\r\n\t\t\tdata = this.rowsToData(rows);\r\n\r\n\t\t\tif(this.topInitialized){\r\n\t\t\t\tif(this.topRow){\r\n\t\t\t\t\tthis.topRow.deleteCells();\r\n\t\t\t\t}\r\n\r\n\t\t\t\trow = this.generateRow(\"top\", this.rowsToData(rows))\r\n\t\t\t\tthis.topRow = row;\r\n\t\t\t\twhile(this.topElement.firstChild) this.topElement.removeChild(this.topElement.firstChild);\r\n\t\t\t\tthis.topElement.appendChild(row.getElement());\r\n\t\t\t\trow.initialize(true);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.botInitialized){\r\n\t\t\t\tif(this.botRow){\r\n\t\t\t\t\tthis.botRow.deleteCells();\r\n\t\t\t\t}\r\n\r\n\t\t\t\trow = this.generateRow(\"bottom\", this.rowsToData(rows))\r\n\t\t\t\tthis.botRow = row;\r\n\t\t\t\twhile(this.botElement.firstChild) this.botElement.removeChild(this.botElement.firstChild);\r\n\t\t\t\tthis.botElement.appendChild(row.getElement());\r\n\t\t\t\trow.initialize(true);\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\t//set resizable handles\r\n\t\t\tif(this.table.modExists(\"frozenColumns\")){\r\n\t\t\t\tthis.table.modules.frozenColumns.layout();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trecalcRowGroup(row){\r\n\t\tthis.recalcGroup(this.table.modules.groupRows.getRowGroup(row));\r\n\t}\r\n\r\n\trecalcAll(){\r\n\t\tif(this.topCalcs.length || this.botCalcs.length){\r\n\t\t\tif(this.table.options.columnCalcs !== \"group\"){\r\n\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.options.groupBy && this.table.options.columnCalcs !== \"table\"){\r\n\r\n\t\t\t\tvar groups = this.table.modules.groupRows.getChildGroups();\r\n\r\n\t\t\t\tgroups.forEach((group) => {\r\n\t\t\t\t\tthis.recalcGroup(group);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trecalcGroup(group){\r\n\t\tvar data, rowData;\r\n\r\n\t\tif(group){\r\n\t\t\tif(group.calcs){\r\n\t\t\t\tif(group.calcs.bottom){\r\n\t\t\t\t\tdata = this.rowsToData(group.rows);\r\n\t\t\t\t\trowData = this.generateRowData(\"bottom\", data);\r\n\r\n\t\t\t\t\tgroup.calcs.bottom.updateData(rowData);\r\n\t\t\t\t\tgroup.calcs.bottom.reinitialize();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(group.calcs.top){\r\n\t\t\t\t\tdata = this.rowsToData(group.rows);\r\n\t\t\t\t\trowData = this.generateRowData(\"top\", data);\r\n\r\n\t\t\t\t\tgroup.calcs.top.updateData(rowData);\r\n\t\t\t\t\tgroup.calcs.top.reinitialize();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//generate top stats row\r\n\tgenerateTopRow(rows){\r\n\t\treturn this.generateRow(\"top\", this.rowsToData(rows));\r\n\t}\r\n\t//generate bottom stats row\r\n\tgenerateBottomRow(rows){\r\n\t\treturn this.generateRow(\"bottom\", this.rowsToData(rows));\r\n\t}\r\n\r\n\trowsToData(rows){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\trows.forEach((row) => {\r\n\t\t\tdata.push(row.getData());\r\n\r\n\t\t\tif(this.table.options.dataTree && this.table.options.dataTreeChildColumnCalcs){\r\n\t\t\t\tif(row.modules.dataTree && row.modules.dataTree.open){\r\n\t\t\t\t\tvar children = this.rowsToData(this.table.modules.dataTree.getFilteredTreeChildren(row));\r\n\t\t\t\t\tdata = data.concat(children);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//generate stats row\r\n\tgenerateRow(pos, data){\r\n\t\tvar rowData = this.generateRowData(pos, data),\r\n\t\trow;\r\n\r\n\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\tthis.table.modules.mutator.disable();\r\n\t\t}\r\n\r\n\t\trow = new Row(rowData, this, \"calc\");\r\n\r\n\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\tthis.table.modules.mutator.enable();\r\n\t\t}\r\n\r\n\t\trow.getElement().classList.add(\"tabulator-calcs\", \"tabulator-calcs-\" + pos);\r\n\r\n\t\trow.component = false;\r\n\r\n\t\trow.getComponent = () => {\r\n\t\t\tif(!row.component){\r\n\t\t\t\trow.component = new CalcComponent(row);\r\n\t\t\t}\r\n\r\n\t\t\treturn row.component;\r\n\t\t};\r\n\r\n\t\trow.generateCells = () => {\r\n\r\n\t\t\tvar cells = [];\r\n\r\n\t\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\r\n\t\t\t\t\t//set field name of mock column\r\n\t\t\t\t\tthis.genColumn.setField(column.getField());\r\n\t\t\t\t\tthis.genColumn.hozAlign = column.hozAlign;\r\n\r\n\t\t\t\t\tif(column.definition[pos + \"CalcFormatter\"] && this.table.modExists(\"format\")){\r\n\t\t\t\t\t\tthis.genColumn.modules.format = {\r\n\t\t\t\t\t\t\tformatter: this.table.modules.format.getFormatter(column.definition[pos + \"CalcFormatter\"]),\r\n\t\t\t\t\t\t\tparams: column.definition[pos + \"CalcFormatterParams\"] || {},\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.genColumn.modules.format = {\r\n\t\t\t\t\t\t\tformatter: this.table.modules.format.getFormatter(\"plaintext\"),\r\n\t\t\t\t\t\t\tparams:{}\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//ensure css class defintion is replicated to calculation cell\r\n\t\t\t\t\tthis.genColumn.definition.cssClass = column.definition.cssClass;\r\n\r\n\t\t\t\t\t//generate cell and assign to correct column\r\n\t\t\t\t\tvar cell = new Cell(this.genColumn, row);\r\n\t\t\t\t\tcell.getElement();\r\n\t\t\t\t\tcell.column = column;\r\n\t\t\t\t\tcell.setWidth();\r\n\r\n\t\t\t\t\tcolumn.cells.push(cell);\r\n\t\t\t\t\tcells.push(cell);\r\n\r\n\t\t\t\t\tif(!column.visible){\r\n\t\t\t\t\t\tcell.hide();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\trow.cells = cells;\r\n\t\t};\r\n\r\n\t\treturn row;\r\n\t}\r\n\r\n\t//generate stats row\r\n\tgenerateRowData(pos, data){\r\n\t\tvar rowData = {},\r\n\t\tcalcs = pos == \"top\" ? this.topCalcs : this.botCalcs,\r\n\t\ttype = pos == \"top\" ? \"topCalc\" : \"botCalc\",\r\n\t\tparams, paramKey;\r\n\r\n\t\tcalcs.forEach(function(column){\r\n\t\t\tvar values = [];\r\n\r\n\t\t\tif(column.modules.columnCalcs && column.modules.columnCalcs[type]){\r\n\t\t\t\tdata.forEach(function(item){\r\n\t\t\t\t\tvalues.push(column.getFieldValue(item));\r\n\t\t\t\t});\r\n\r\n\t\t\t\tparamKey = type + \"Params\";\r\n\t\t\t\tparams = typeof column.modules.columnCalcs[paramKey] === \"function\" ? column.modules.columnCalcs[paramKey](values, data) : column.modules.columnCalcs[paramKey];\r\n\r\n\t\t\t\tcolumn.setFieldValue(rowData, column.modules.columnCalcs[type](values, data, params));\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowData;\r\n\t}\r\n\r\n\thasTopCalcs(){\r\n\t\treturn\t!!(this.topCalcs.length);\r\n\t}\r\n\r\n\thasBottomCalcs(){\r\n\t\treturn\t!!(this.botCalcs.length);\r\n\t}\r\n\r\n\t//handle table redraw\r\n\tredraw(){\r\n\t\tif(this.topRow){\r\n\t\t\tthis.topRow.normalizeHeight(true);\r\n\t\t}\r\n\t\tif(this.botRow){\r\n\t\t\tthis.botRow.normalizeHeight(true);\r\n\t\t}\r\n\t}\r\n\r\n\t//return the calculated\r\n\tgetResults(){\r\n\t\tvar results = {},\r\n\t\tgroups;\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tgroups = this.table.modules.groupRows.getGroups(true);\r\n\r\n\t\t\tgroups.forEach((group) => {\r\n\t\t\t\tresults[group.getKey()] = this.getGroupResults(group);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tresults = {\r\n\t\t\t\ttop: this.topRow ? this.topRow.getData() : {},\r\n\t\t\t\tbottom: this.botRow ? this.botRow.getData() : {},\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\t//get results from a group\r\n\tgetGroupResults(group){\r\n\t\tvar groupObj = group._getSelf(),\r\n\t\tsubGroups = group.getSubGroups(),\r\n\t\tsubGroupResults = {},\r\n\t\tresults = {};\r\n\r\n\t\tsubGroups.forEach((subgroup) => {\r\n\t\t\tsubGroupResults[subgroup.getKey()] = this.getGroupResults(subgroup);\r\n\t\t});\r\n\r\n\t\tresults = {\r\n\t\t\ttop: groupObj.calcs.top ? groupObj.calcs.top.getData() : {},\r\n\t\t\tbottom: groupObj.calcs.bottom ? groupObj.calcs.bottom.getData() : {},\r\n\t\t\tgroups: subGroupResults,\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n}\r\n\r\nColumnCalcs.moduleName = \"columnCalcs\";\r\n\r\n//load defaults\r\nColumnCalcs.calculations = defaultCalculations;\r\n\r\nexport default ColumnCalcs;","import Module from '../../core/Module.js';\r\n\r\nimport Row from '../../core/row/Row.js';\r\n\r\nclass DataTree extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.indent = 10;\r\n\t\tthis.field = \"\";\r\n\t\tthis.collapseEl = null;\r\n\t\tthis.expandEl = null;\r\n\t\tthis.branchEl = null;\r\n\t\tthis.elementField = false;\r\n\r\n\t\tthis.startOpen = function(){};\r\n\r\n\t\tthis.displayIndex = 0;\r\n\r\n\t\tthis.registerTableOption(\"dataTree\", false); //enable data tree\r\n\t\tthis.registerTableOption(\"dataTreeFilter\", true); //filter child rows\r\n\t\tthis.registerTableOption(\"dataTreeSort\", true); //sort child rows\r\n\t\tthis.registerTableOption(\"dataTreeElementColumn\", false);\r\n\t\tthis.registerTableOption(\"dataTreeBranchElement\", true);//show data tree branch element\r\n\t\tthis.registerTableOption(\"dataTreeChildIndent\", 9); //data tree child indent in px\r\n\t\tthis.registerTableOption(\"dataTreeChildField\", \"_children\");//data tre column field to look for child rows\r\n\t\tthis.registerTableOption(\"dataTreeCollapseElement\", false);//data tree row collapse element\r\n\t\tthis.registerTableOption(\"dataTreeExpandElement\", false);//data tree row expand element\r\n\t\tthis.registerTableOption(\"dataTreeStartExpanded\", false);\r\n\t\tthis.registerTableOption(\"dataTreeChildColumnCalcs\", false);//include visible data tree rows in column calculations\r\n\t\tthis.registerTableOption(\"dataTreeSelectPropagate\", false);//seleccting a parent row selects its children\r\n\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"treeCollapse\", this.collapseRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"treeExpand\", this.expandRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"treeToggle\", this.toggleRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"getTreeParent\", this.getTreeParent.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"getTreeChildren\", this.getRowChildren.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"addTreeChild\", this.addTreeChildRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isTreeExpanded\", this.isRowExpanded.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.dataTree){\r\n\t\t\tvar dummyEl = null,\r\n\t\t\toptions = this.table.options;\r\n\r\n\t\t\tthis.field = options.dataTreeChildField;\r\n\t\t\tthis.indent = options.dataTreeChildIndent;\r\n\r\n\t\t\tif(options.dataTreeBranchElement){\r\n\r\n\t\t\t\tif(options.dataTreeBranchElement === true){\r\n\t\t\t\t\tthis.branchEl = document.createElement(\"div\");\r\n\t\t\t\t\tthis.branchEl.classList.add(\"tabulator-data-tree-branch\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(typeof options.dataTreeBranchElement === \"string\"){\r\n\t\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\t\tdummyEl.innerHTML = options.dataTreeBranchElement;\r\n\t\t\t\t\t\tthis.branchEl = dummyEl.firstChild;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.branchEl = options.dataTreeBranchElement;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(options.dataTreeCollapseElement){\r\n\t\t\t\tif(typeof options.dataTreeCollapseElement === \"string\"){\r\n\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\tdummyEl.innerHTML = options.dataTreeCollapseElement;\r\n\t\t\t\t\tthis.collapseEl = dummyEl.firstChild;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.collapseEl = options.dataTreeCollapseElement;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.collapseEl = document.createElement(\"div\");\r\n\t\t\t\tthis.collapseEl.classList.add(\"tabulator-data-tree-control\");\r\n\t\t\t\tthis.collapseEl.tabIndex = 0;\r\n\t\t\t\tthis.collapseEl.innerHTML = \"
\";\r\n\t\t\t}\r\n\r\n\t\t\tif(options.dataTreeExpandElement){\r\n\t\t\t\tif(typeof options.dataTreeExpandElement === \"string\"){\r\n\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\tdummyEl.innerHTML = options.dataTreeExpandElement;\r\n\t\t\t\t\tthis.expandEl = dummyEl.firstChild;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.expandEl = options.dataTreeExpandElement;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.expandEl = document.createElement(\"div\");\r\n\t\t\t\tthis.expandEl.classList.add(\"tabulator-data-tree-control\");\r\n\t\t\t\tthis.expandEl.tabIndex = 0;\r\n\t\t\t\tthis.expandEl.innerHTML = \"
\";\r\n\t\t\t}\r\n\r\n\r\n\t\t\tswitch(typeof options.dataTreeStartExpanded){\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\tthis.startOpen = function(row, index){\r\n\t\t\t\t\treturn options.dataTreeStartExpanded;\r\n\t\t\t\t};\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tthis.startOpen = options.dataTreeStartExpanded;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\tthis.startOpen = function(row, index){\r\n\t\t\t\t\treturn options.dataTreeStartExpanded[index];\r\n\t\t\t\t};\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-layout-after\", this.layoutRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowDelete.bind(this),0);\r\n\t\t\tthis.subscribe(\"row-data-changed\", this.rowDataChanged.bind(this), 10);\r\n\t\t\tthis.subscribe(\"cell-value-updated\", this.cellValueChanged.bind(this));\r\n\t\t\tthis.subscribe(\"edit-cancelled\", this.cellValueChanged.bind(this));\r\n\t\t\tthis.subscribe(\"column-moving-rows\", this.columnMoving.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.initializeElementField.bind(this));\r\n\t\t\tthis.subscribe(\"table-redrawing\", this.tableRedrawing.bind(this));\r\n\r\n\t\t\tthis.registerDisplayHandler(this.getRows.bind(this), 30);\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedrawing(force){\r\n\t\tvar rows;\r\n\r\n\t\tif(force){\r\n\t\t\trows = this.table.rowManager.getRows();\r\n\t\t\t\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.reinitializeRowChildren(row);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeElementField(){\r\n\t\tvar firstCol = this.table.columnManager.getFirstVisibleColumn();\r\n\r\n\t\tthis.elementField = this.table.options.dataTreeElementColumn || (firstCol ? firstCol.field : false);\r\n\t}\r\n\t\r\n\tgetRowChildren(row){\r\n\t\treturn this.getTreeChildren(row, true);\r\n\t}\r\n\r\n\tcolumnMoving(){\r\n\t\tvar rows = [];\r\n\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\trows = rows.concat(this.getTreeChildren(row, false, true));\r\n\t\t});\r\n\r\n\t\treturn rows;\r\n\t}\r\n\r\n\trowDataChanged(row, visible, updatedData){\r\n\t\tif(this.redrawNeeded(updatedData)){\r\n\t\t\tthis.initializeRow(row);\r\n\r\n\t\t\tif(visible){\r\n\t\t\t\tthis.layoutRow(row);\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tcellValueChanged(cell){\r\n\t\tvar field = cell.column.getField();\r\n\r\n\t\tif(field === this.elementField){\r\n\t\t\tthis.layoutRow(cell.row);\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar childArray = row.getData()[this.field];\r\n\t\tvar isArray = Array.isArray(childArray);\r\n\r\n\t\tvar children = isArray || (!isArray && typeof childArray === \"object\" && childArray !== null);\r\n\r\n\t\tif(!children && row.modules.dataTree && row.modules.dataTree.branchEl){\r\n\t\t\trow.modules.dataTree.branchEl.parentNode.removeChild(row.modules.dataTree.branchEl);\r\n\t\t}\r\n\r\n\t\tif(!children && row.modules.dataTree && row.modules.dataTree.controlEl){\r\n\t\t\trow.modules.dataTree.controlEl.parentNode.removeChild(row.modules.dataTree.controlEl);\r\n\t\t}\r\n\r\n\t\trow.modules.dataTree = {\r\n\t\t\tindex: row.modules.dataTree ? row.modules.dataTree.index : 0,\r\n\t\t\topen: children ? (row.modules.dataTree ? row.modules.dataTree.open : this.startOpen(row.getComponent(), 0)) : false,\r\n\t\t\tcontrolEl: row.modules.dataTree && children ? row.modules.dataTree.controlEl : false,\r\n\t\t\tbranchEl: row.modules.dataTree && children ? row.modules.dataTree.branchEl : false,\r\n\t\t\tparent: row.modules.dataTree ? row.modules.dataTree.parent : false,\r\n\t\t\tchildren:children,\r\n\t\t};\r\n\t}\r\n\r\n\treinitializeRowChildren(row){\r\n\t\tvar children = this.getTreeChildren(row, false, true);\r\n\r\n\t\tchildren.forEach(function(child){\r\n\t\t\tchild.reinitialize(true);\r\n\t\t});\r\n\t}\r\n\r\n\tlayoutRow(row){\r\n\t\tvar cell = this.elementField ? row.getCell(this.elementField) : row.getCells()[0],\r\n\t\tel = cell.getElement(),\r\n\t\tconfig = row.modules.dataTree;\r\n\r\n\t\tif(config.branchEl){\r\n\t\t\tif(config.branchEl.parentNode){\r\n\t\t\t\tconfig.branchEl.parentNode.removeChild(config.branchEl);\r\n\t\t\t}\r\n\t\t\tconfig.branchEl = false;\r\n\t\t}\r\n\r\n\t\tif(config.controlEl){\r\n\t\t\tif(config.controlEl.parentNode){\r\n\t\t\t\tconfig.controlEl.parentNode.removeChild(config.controlEl);\r\n\t\t\t}\r\n\t\t\tconfig.controlEl = false;\r\n\t\t}\r\n\r\n\t\tthis.generateControlElement(row, el);\r\n\r\n\t\trow.getElement().classList.add(\"tabulator-tree-level-\" + config.index);\r\n\r\n\t\tif(config.index){\r\n\t\t\tif(this.branchEl){\r\n\t\t\t\tconfig.branchEl = this.branchEl.cloneNode(true);\r\n\t\t\t\tel.insertBefore(config.branchEl, el.firstChild);\r\n\r\n\t\t\t\tif(this.table.rtl){\r\n\t\t\t\t\tconfig.branchEl.style.marginRight = (((config.branchEl.offsetWidth + config.branchEl.style.marginLeft) * (config.index - 1)) + (config.index * this.indent)) + \"px\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconfig.branchEl.style.marginLeft = (((config.branchEl.offsetWidth + config.branchEl.style.marginRight) * (config.index - 1)) + (config.index * this.indent)) + \"px\";\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\r\n\t\t\t\tif(this.table.rtl){\r\n\t\t\t\t\tel.style.paddingRight = parseInt(window.getComputedStyle(el, null).getPropertyValue('padding-right')) + (config.index * this.indent) + \"px\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.style.paddingLeft = parseInt(window.getComputedStyle(el, null).getPropertyValue('padding-left')) + (config.index * this.indent) + \"px\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateControlElement(row, el){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\tel = el || row.getCells()[0].getElement(),\r\n\t\toldControl = config.controlEl;\r\n\r\n\t\tif(config.children !== false){\r\n\r\n\t\t\tif(config.open){\r\n\t\t\t\tconfig.controlEl = this.collapseEl.cloneNode(true);\r\n\t\t\t\tconfig.controlEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\tthis.collapseRow(row);\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconfig.controlEl = this.expandEl.cloneNode(true);\r\n\t\t\t\tconfig.controlEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\tthis.expandRow(row);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tconfig.controlEl.addEventListener(\"mousedown\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t});\r\n\r\n\t\t\tif(oldControl && oldControl.parentNode === el){\r\n\t\t\t\toldControl.parentNode.replaceChild(config.controlEl,oldControl);\r\n\t\t\t}else{\r\n\t\t\t\tel.insertBefore(config.controlEl, el.firstChild);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tsetDisplayIndex (index) {\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\r\n\tgetDisplayIndex () {\r\n\t\treturn this.displayIndex;\r\n\t}\r\n\r\n\tgetRows(rows){\r\n\t\tvar output = [];\r\n\r\n\t\trows.forEach((row, i) => {\r\n\t\t\tvar config, children;\r\n\r\n\t\t\toutput.push(row);\r\n\r\n\t\t\tif(row instanceof Row){\r\n\r\n\t\t\t\trow.create();\r\n\r\n\t\t\t\tconfig = row.modules.dataTree.children;\r\n\r\n\t\t\t\tif(!config.index && config.children !== false){\r\n\t\t\t\t\tchildren = this.getChildren(row);\r\n\r\n\t\t\t\t\tchildren.forEach((child) => {\r\n\t\t\t\t\t\tchild.create();\r\n\t\t\t\t\t\toutput.push(child);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetChildren(row, allChildren){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\tchildren = [],\r\n\t\toutput = [];\r\n\r\n\t\tif(config.children !== false && (config.open || allChildren)){\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"filter\") && this.table.options.dataTreeFilter){\r\n\t\t\t\tchildren = this.table.modules.filter.filter(config.children);\r\n\t\t\t}else{\r\n\t\t\t\tchildren = config.children;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"sort\") && this.table.options.dataTreeSort){\r\n\t\t\t\tthis.table.modules.sort.sort(children);\r\n\t\t\t}\r\n\r\n\t\t\tchildren.forEach((child) => {\r\n\t\t\t\toutput.push(child);\r\n\r\n\t\t\t\tvar subChildren = this.getChildren(child);\r\n\r\n\t\t\t\tsubChildren.forEach((sub) => {\r\n\t\t\t\t\toutput.push(sub);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgenerateChildren(row){\r\n\t\tvar children = [];\r\n\r\n\t\tvar childArray = row.getData()[this.field];\r\n\r\n\t\tif(!Array.isArray(childArray)){\r\n\t\t\tchildArray = [childArray];\r\n\t\t}\r\n\r\n\t\tchildArray.forEach((childData) => {\r\n\t\t\tvar childRow = new Row(childData || {}, this.table.rowManager);\r\n\r\n\t\t\tchildRow.create();\r\n\r\n\t\t\tchildRow.modules.dataTree.index = row.modules.dataTree.index + 1;\r\n\t\t\tchildRow.modules.dataTree.parent = row;\r\n\r\n\t\t\tif(childRow.modules.dataTree.children){\r\n\t\t\t\tchildRow.modules.dataTree.open = this.startOpen(childRow.getComponent(), childRow.modules.dataTree.index);\r\n\t\t\t}\r\n\t\t\tchildren.push(childRow);\r\n\t\t});\r\n\r\n\t\treturn children;\r\n\t}\r\n\r\n\texpandRow(row, silent){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tconfig.open = true;\r\n\r\n\t\t\trow.reinitialize();\r\n\r\n\t\t\tthis.refreshData(true);\r\n\r\n\t\t\tthis.dispatchExternal(\"dataTreeRowExpanded\", row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\t}\r\n\r\n\tcollapseRow(row){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tconfig.open = false;\r\n\r\n\t\t\trow.reinitialize();\r\n\r\n\t\t\tthis.refreshData(true);\r\n\r\n\t\t\tthis.dispatchExternal(\"dataTreeRowCollapsed\", row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\t}\r\n\r\n\ttoggleRow(row){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tif(config.open){\r\n\t\t\t\tthis.collapseRow(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.expandRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tisRowExpanded(row){\r\n\t\treturn row.modules.dataTree.open;\r\n\t}\r\n\r\n\tgetTreeParent(row){\r\n\t\treturn row.modules.dataTree.parent ? row.modules.dataTree.parent.getComponent() : false;\r\n\t}\r\n\r\n\tgetTreeParentRoot(row){\r\n\t\treturn row.modules.dataTree.parent ? this.getTreeParentRoot(row.modules.dataTree.parent) : row;\r\n\t}\r\n\r\n\tgetFilteredTreeChildren(row){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\toutput = [], children;\r\n\r\n\t\tif(config.children){\r\n\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"filter\") && this.table.options.dataTreeFilter){\r\n\t\t\t\tchildren = this.table.modules.filter.filter(config.children);\r\n\t\t\t}else{\r\n\t\t\t\tchildren = config.children;\r\n\t\t\t}\r\n\r\n\t\t\tchildren.forEach((childRow) => {\r\n\t\t\t\tif(childRow instanceof Row){\r\n\t\t\t\t\toutput.push(childRow);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\trowDelete(row){\r\n\t\tvar parent = row.modules.dataTree.parent,\r\n\t\tchildIndex;\r\n\r\n\t\tif(parent){\r\n\t\t\tchildIndex = this.findChildIndex(row, parent);\r\n\r\n\t\t\tif(childIndex !== false){\r\n\t\t\t\tparent.data[this.field].splice(childIndex, 1);\r\n\t\t\t}\r\n\r\n\t\t\tif(!parent.data[this.field].length){\r\n\t\t\t\tdelete parent.data[this.field];\r\n\t\t\t}\r\n\r\n\t\t\tthis.initializeRow(parent);\r\n\t\t\tthis.layoutRow(parent);\r\n\t\t}\r\n\r\n\t\tthis.refreshData(true);\r\n\t}\r\n\r\n\taddTreeChildRow(row, data, top, index){\r\n\t\tvar childIndex = false;\r\n\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\r\n\t\tif(!Array.isArray(row.data[this.field])){\r\n\t\t\trow.data[this.field] = [];\r\n\r\n\t\t\trow.modules.dataTree.open = this.startOpen(row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\r\n\t\tif(typeof index !== \"undefined\"){\r\n\t\t\tchildIndex = this.findChildIndex(index, row);\r\n\r\n\t\t\tif(childIndex !== false){\r\n\t\t\t\trow.data[this.field].splice((top ? childIndex : childIndex + 1), 0, data);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(childIndex === false){\r\n\t\t\tif(top){\r\n\t\t\t\trow.data[this.field].unshift(data);\r\n\t\t\t}else{\r\n\t\t\t\trow.data[this.field].push(data);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.initializeRow(row);\r\n\t\tthis.layoutRow(row);\r\n\r\n\t\tthis.refreshData(true);\r\n\t}\r\n\r\n\tfindChildIndex(subject, parent){\r\n\t\tvar match = false;\r\n\r\n\t\tif(typeof subject == \"object\"){\r\n\r\n\t\t\tif(subject instanceof Row){\r\n\t\t\t\t//subject is row element\r\n\t\t\t\tmatch = subject.data;\r\n\t\t\t}else if(subject instanceof RowComponent){\r\n\t\t\t\t//subject is public row component\r\n\t\t\t\tmatch = subject._getSelf().data;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\t\t\t\tif(parent.modules.dataTree){\r\n\t\t\t\t\tmatch = parent.modules.dataTree.children.find((childRow) => {\r\n\t\t\t\t\t\treturn childRow instanceof Row ? childRow.element === subject : false;\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(match){\r\n\t\t\t\t\t\tmatch = match.data;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}else if(typeof subject == \"undefined\" || subject === null){\r\n\t\t\tmatch = false\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the index of the row\r\n\t\t\tmatch = parent.data[this.field].find((row) => {\r\n\t\t\t\treturn row.data[this.table.options.index] == subject;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(match){\r\n\r\n\t\t\tif(Array.isArray(parent.data[this.field])){\r\n\t\t\t\tmatch = parent.data[this.field].indexOf(match);\r\n\t\t\t}\r\n\r\n\t\t\tif(match == -1){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//catch all for any other type of input\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tgetTreeChildren(row, component, recurse){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\toutput = [];\r\n\r\n\t\tif(config.children){\r\n\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tconfig.children.forEach((childRow) => {\r\n\t\t\t\tif(childRow instanceof Row){\r\n\t\t\t\t\toutput.push(component ? childRow.getComponent() : childRow);\r\n\r\n\t\t\t\t\tif(recurse){\r\n\t\t\t\t\t\toutput = output.concat(this.getTreeChildren(childRow, component, recurse));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetChildField(){\r\n\t\treturn this.field;\r\n\t}\r\n\r\n\tredrawNeeded(data){\r\n\t\treturn (this.field ? typeof data[this.field] !== \"undefined\" : false) || (this.elementField ? typeof data[this.elementField] !== \"undefined\" : false);\r\n\t}\r\n}\r\n\r\nDataTree.moduleName = \"dataTree\";\r\n\r\nexport default DataTree;","import csv from './downloaders/csv.js';\r\nimport json from './downloaders/json.js';\r\nimport pdf from './downloaders/pdf.js';\r\nimport xlsx from './downloaders/xlsx.js';\r\nimport html from './downloaders/html.js';\r\nimport jsonLines from './downloaders/jsonLines.js';\r\n\r\nexport default {\r\n\tcsv:csv,\r\n\tjson:json,\r\n\tjsonLines:jsonLines,\r\n\tpdf:pdf,\r\n\txlsx:xlsx,\r\n\thtml:html,\r\n};","export default function(list, options, setFileContents){\r\n\tvar delimiter = options && options.delimiter ? options.delimiter : \",\",\r\n\tfileContents = [],\r\n\theaders = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tvar item = [];\r\n\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"group\":\r\n\t\t\tconsole.warn(\"Download Warning - CSV downloader cannot process row groups\");\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\tconsole.warn(\"Download Warning - CSV downloader cannot process column calculations\");\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"header\":\r\n\t\t\trow.columns.forEach((col, i) => {\r\n\t\t\t\tif(col && col.depth === 1){\r\n\t\t\t\t\theaders[i] = typeof col.value == \"undefined\" || col.value === null ? \"\" : ('\"' + String(col.value).split('\"').join('\"\"') + '\"');\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\trow.columns.forEach((col) => {\r\n\r\n\t\t\t\tif(col){\r\n\r\n\t\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\tcol.value = JSON.stringify(col.value);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\tcase \"null\":\r\n\t\t\t\t\t\tcol.value = \"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\titem.push('\"' + String(col.value).split('\"').join('\"\"') + '\"');\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tfileContents.push(item.join(delimiter));\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(headers.length){\r\n\t\tfileContents.unshift(headers.join(delimiter));\r\n\t}\r\n\r\n\tfileContents = fileContents.join(\"\\n\");\r\n\r\n\tif(options.bom){\r\n\t\tfileContents = \"\\ufeff\" + fileContents;\r\n\t}\r\n\r\n\tsetFileContents(fileContents, \"text/csv\");\r\n};","export default function(list, options, setFileContents){\r\n\tvar fileContents = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tvar item = {};\r\n\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"header\":\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process row groups\");\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process column calculations\");\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\tif(col){\r\n\t\t\t\t\titem[col.component.getTitleDownload() || col.component.getField()] = col.value;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tfileContents.push(item);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tfileContents = JSON.stringify(fileContents, null, '\\t');\r\n\r\n\tsetFileContents(fileContents, \"application/json\");\r\n};","export default function (list, options, setFileContents) {\r\n\tconst fileContents = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tconst item = {};\r\n\r\n\t\tswitch (row.type) {\r\n\t\t\tcase \"header\":\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process row groups\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process column calculations\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\t\tif (col) {\r\n\t\t\t\t\t\titem[col.component.getTitleDownload() || col.component.getField()] = col.value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tfileContents.push(JSON.stringify(item));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tsetFileContents(fileContents.join(\"\\n\"), \"application/x-ndjson\");\r\n};","export default function(list, options, setFileContents){\r\n\tvar header = [],\r\n\tbody = [],\r\n\tautoTableParams = {},\r\n\trowGroupStyles = options.rowGroupStyles || {\r\n\t\tfontStyle: \"bold\",\r\n\t\tfontSize: 12,\r\n\t\tcellPadding: 6,\r\n\t\tfillColor: 220,\r\n\t},\r\n\trowCalcStyles = options.rowCalcStyles || {\r\n\t\tfontStyle: \"bold\",\r\n\t\tfontSize: 10,\r\n\t\tcellPadding: 4,\r\n\t\tfillColor: 232,\r\n\t},\r\n\tjsPDFParams = options.jsPDF || {},\r\n\ttitle = options && options.title ? options.title : \"\";\r\n\r\n\tif(!jsPDFParams.orientation){\r\n\t\tjsPDFParams.orientation = options.orientation || \"landscape\";\r\n\t}\r\n\r\n\tif(!jsPDFParams.unit){\r\n\t\tjsPDFParams.unit = \"pt\";\r\n\t}\r\n\r\n\t//parse row list\r\n\tlist.forEach((row) => {\r\n\t\tvar item = {};\r\n\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"header\":\r\n\t\t\theader.push(parseRow(row));\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\tbody.push(parseRow(row, rowGroupStyles));\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\tbody.push(parseRow(row, rowCalcStyles));\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\tbody.push(parseRow(row));\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tfunction parseRow(row, styles){\r\n\t\tvar rowData = [];\r\n\r\n\t\trow.columns.forEach((col) =>{\r\n\t\t\tvar cell;\r\n\r\n\t\t\tif(col){\r\n\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\tcol.value = JSON.stringify(col.value);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\tcase \"null\":\r\n\t\t\t\t\tcol.value = \"\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcell = {\r\n\t\t\t\t\tcontent:col.value,\r\n\t\t\t\t\tcolSpan:col.width,\r\n\t\t\t\t\trowSpan:col.height,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tif(styles){\r\n\t\t\t\t\tcell.styles = styles;\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowData.push(cell);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowData;\r\n\t}\r\n\r\n\r\n\t//configure PDF\r\n\tvar doc = new jspdf.jsPDF(jsPDFParams); //set document to landscape, better for most tables\r\n\r\n\tif(options && options.autoTable){\r\n\t\tif(typeof options.autoTable === \"function\"){\r\n\t\t\tautoTableParams = options.autoTable(doc) || {};\r\n\t\t}else{\r\n\t\t\tautoTableParams = options.autoTable;\r\n\t\t}\r\n\t}\r\n\r\n\tif(title){\r\n\t\tautoTableParams.didDrawPage = function(data) {\r\n\t\t\tdoc.text(title, 40, 30);\r\n\t\t};\r\n\t}\r\n\r\n\tautoTableParams.head = header;\r\n\tautoTableParams.body = body;\r\n\r\n\tdoc.autoTable(autoTableParams);\r\n\r\n\tif(options && options.documentProcessing){\r\n\t\toptions.documentProcessing(doc);\r\n\t}\r\n\r\n\tsetFileContents(doc.output(\"arraybuffer\"), \"application/pdf\");\r\n};","import CoreFeature from '../../../../core/CoreFeature.js';\r\n\r\nexport default function(list, options, setFileContents){\r\n\tvar self = this,\r\n\tsheetName = options.sheetName || \"Sheet1\",\r\n\tworkbook = XLSX.utils.book_new(),\r\n\ttableFeatures = new CoreFeature(this),\r\n\toutput;\r\n\r\n\tworkbook.SheetNames = [];\r\n\tworkbook.Sheets = {};\r\n\r\n\tfunction generateSheet(){\r\n\t\tvar rows = [],\r\n\t\tmerges = [],\r\n\t\tworksheet = {},\r\n\t\trange = {s: {c:0, r:0}, e: {c:(list[0] ? list[0].columns.reduce((a, b) => a + (b && b.width ? b.width : 1), 0) : 0), r:list.length }};\r\n\r\n\t\t//parse row list\r\n\t\tlist.forEach((row, i) => {\r\n\t\t\tvar rowData = [];\r\n\r\n\t\t\trow.columns.forEach(function(col, j){\r\n\r\n\t\t\t\tif(col){\r\n\t\t\t\t\trowData.push(!(col.value instanceof Date) && typeof col.value === \"object\" ? JSON.stringify(col.value) : col.value);\r\n\r\n\t\t\t\t\tif(col.width > 1 || col.height > -1){\r\n\t\t\t\t\t\tif(col.height > 1 || col.width > 1){\r\n\t\t\t\t\t\t\tmerges.push({s:{r:i,c:j},e:{r:i + col.height - 1,c:j + col.width - 1}});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\trowData.push(\"\");\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trows.push(rowData);\r\n\t\t});\r\n\r\n\t\t//convert rows to worksheet\r\n\t\tXLSX.utils.sheet_add_aoa(worksheet, rows);\r\n\r\n\t\tworksheet['!ref'] = XLSX.utils.encode_range(range);\r\n\r\n\t\tif(merges.length){\r\n\t\t\tworksheet[\"!merges\"] = merges;\r\n\t\t}\r\n\r\n\t\treturn worksheet;\r\n\t}\r\n\r\n\tif(options.sheetOnly){\r\n\t\tsetFileContents(generateSheet());\r\n\t\treturn;\r\n\t}\r\n\r\n\tif(options.sheets){\r\n\t\tfor(var sheet in options.sheets){\r\n\r\n\t\t\tif(options.sheets[sheet] === true){\r\n\t\t\t\tworkbook.SheetNames.push(sheet);\r\n\t\t\t\tworkbook.Sheets[sheet] = generateSheet();\r\n\t\t\t}else{\r\n\r\n\t\t\t\tworkbook.SheetNames.push(sheet);\r\n\r\n\t\t\t\ttableFeatures.commsSend(options.sheets[sheet], \"download\", \"intercept\",{\r\n\t\t\t\t\ttype:\"xlsx\",\r\n\t\t\t\t\toptions:{sheetOnly:true},\r\n\t\t\t\t\tactive:self.active,\r\n\t\t\t\t\tintercept:function(data){\r\n\t\t\t\t\t\tworkbook.Sheets[sheet] = data;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tworkbook.SheetNames.push(sheetName);\r\n\t\tworkbook.Sheets[sheetName] = generateSheet();\r\n\t}\r\n\r\n\tif(options.documentProcessing){\r\n\t\tworkbook = options.documentProcessing(workbook);\r\n\t}\r\n\r\n\t//convert workbook to binary array\r\n\tfunction s2ab(s) {\r\n\t\tvar buf = new ArrayBuffer(s.length);\r\n\t\tvar view = new Uint8Array(buf);\r\n\t\tfor (var i=0; i!=s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;\r\n\t\t\treturn buf;\r\n\t}\r\n\r\n\toutput = XLSX.write(workbook, {bookType:'xlsx', bookSST:true, type: 'binary'});\r\n\r\n\tsetFileContents(s2ab(output), \"application/octet-stream\");\r\n};","export default function(list, options, setFileContents){\r\n\tif(this.modExists(\"export\", true)){\r\n\t\tsetFileContents(this.modules.export.genereateHTMLTable(list), \"text/html\");\r\n\t}\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultDownloaders from './defaults/downloaders.js';\r\n\r\nclass Download extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.registerTableOption(\"downloadReady\", function(data, blob){return blob;}); //function to manipulate download data\r\n\t\tthis.registerTableOption(\"downloadConfig\", {}); //download config\r\n\t\tthis.registerTableOption(\"downloadRowRange\", \"active\"); //restrict download to active rows only\r\n\r\n\t\tthis.registerColumnOption(\"download\");\r\n\t\tthis.registerColumnOption(\"titleDownload\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"download\", this.download.bind(this));\r\n\t\tthis.registerTableFunction(\"downloadToTab\", this.downloadToTab.bind(this));\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tdownloadToTab(type, filename, options, active){\r\n\t\tthis.download(type, filename, options, active, true);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\t//trigger file download\r\n\tdownload(type, filename, options, range, interceptCallback){\r\n\t\tvar downloadFunc = false;\r\n\r\n\t\tfunction buildLink(data, mime){\r\n\t\t\tif(interceptCallback){\r\n\t\t\t\tif(interceptCallback === true){\r\n\t\t\t\t\tthis.triggerDownload(data, mime, type, filename, true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tinterceptCallback(data);\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tthis.triggerDownload(data, mime, type, filename);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(typeof type == \"function\"){\r\n\t\t\tdownloadFunc = type;\r\n\t\t}else{\r\n\t\t\tif(Download.downloaders[type]){\r\n\t\t\t\tdownloadFunc = Download.downloaders[type];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Download Error - No such download type found: \", type);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(downloadFunc){\r\n\t\t\tvar list = this.generateExportList(range);\r\n\r\n\t\t\tdownloadFunc.call(this.table, list , options || {}, buildLink.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateExportList(range){\r\n\t\tvar list = this.table.modules.export.generateExportList(this.table.options.downloadConfig, false, range || this.table.options.downloadRowRange, \"download\");\r\n\r\n\t\t//assign group header formatter\r\n\t\tvar groupHeader = this.table.options.groupHeaderDownload;\r\n\r\n\t\tif(groupHeader && !Array.isArray(groupHeader)){\r\n\t\t\tgroupHeader = [groupHeader];\r\n\t\t}\r\n\r\n\t\tlist.forEach((row) => {\r\n\t\t\tvar group;\r\n\r\n\t\t\tif(row.type === \"group\"){\r\n\t\t\t\tgroup = row.columns[0];\r\n\r\n\t\t\t\tif(groupHeader && groupHeader[row.indent]){\r\n\t\t\t\t\tgroup.value = groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn list;\r\n\t}\r\n\r\n\ttriggerDownload(data, mime, type, filename, newTab){\r\n\t\tvar element = document.createElement('a'),\r\n\t\tblob = new Blob([data],{type:mime}),\r\n\t\tfilename = filename || \"Tabulator.\" + (typeof type === \"function\" ? \"txt\" : type);\r\n\r\n\t\tblob = this.table.options.downloadReady(data, blob);\r\n\r\n\t\tif(blob){\r\n\r\n\t\t\tif(newTab){\r\n\t\t\t\twindow.open(window.URL.createObjectURL(blob));\r\n\t\t\t}else{\r\n\t\t\t\tif(navigator.msSaveOrOpenBlob){\r\n\t\t\t\t\tnavigator.msSaveOrOpenBlob(blob, filename);\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.setAttribute('href', window.URL.createObjectURL(blob));\r\n\r\n\t\t\t\t\t//set file title\r\n\t\t\t\t\telement.setAttribute('download', filename);\r\n\r\n\t\t\t\t\t//trigger download\r\n\t\t\t\t\telement.style.display = 'none';\r\n\t\t\t\t\tdocument.body.appendChild(element);\r\n\t\t\t\t\telement.click();\r\n\r\n\t\t\t\t\t//remove temporary link element\r\n\t\t\t\t\tdocument.body.removeChild(element);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"downloadComplete\");\r\n\t\t}\r\n\t}\r\n\r\n\tcommsReceived(table, action, data){\r\n\t\tswitch(action){\r\n\t\t\tcase \"intercept\":\r\n\t\t\tthis.download(data.type, \"\", data.options, data.active, data.intercept);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nDownload.moduleName = \"download\";\r\n\r\n//load defaults\r\nDownload.downloaders = defaultDownloaders;\r\n\r\nexport default Download;","export default function maskInput(el, options){\r\n\tvar mask = options.mask,\r\n\tmaskLetter = typeof options.maskLetterChar !== \"undefined\" ? options.maskLetterChar : \"A\",\r\n\tmaskNumber = typeof options.maskNumberChar !== \"undefined\" ? options.maskNumberChar : \"9\",\r\n\tmaskWildcard = typeof options.maskWildcardChar !== \"undefined\" ? options.maskWildcardChar : \"*\",\r\n\tsuccess = false;\r\n\r\n\tfunction fillSymbols(index){\r\n\t\tvar symbol = mask[index];\r\n\t\tif(typeof symbol !== \"undefined\" && symbol !== maskWildcard && symbol !== maskLetter && symbol !== maskNumber){\r\n\t\t\tel.value = el.value + \"\" + symbol;\r\n\t\t\tfillSymbols(index+1);\r\n\t\t}\r\n\t}\r\n\r\n\tel.addEventListener(\"keydown\", (e) => {\r\n\t\tvar index = el.value.length,\r\n\t\tchar = e.key;\r\n\r\n\t\tif(e.keyCode > 46){\r\n\t\t\tif(index >= mask.length){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tsuccess = false;\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\tswitch(mask[index]){\r\n\t\t\t\t\tcase maskLetter:\r\n\t\t\t\t\tif(char.toUpperCase() == char.toLowerCase()){\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\tsuccess = false;\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase maskNumber:\r\n\t\t\t\t\tif(isNaN(char)){\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\tsuccess = false;\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase maskWildcard:\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\tif(char !== mask[index]){\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\tsuccess = false;\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tsuccess = true;\r\n\t\t}\r\n\r\n\t\treturn;\r\n\t});\r\n\r\n\tel.addEventListener(\"keyup\", (e) => {\r\n\t\tif(e.keyCode > 46){\r\n\t\t\tif(options.maskAutoFill){\r\n\t\t\t\tfillSymbols(el.value.length);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\r\n\tif(!el.placeholder){\r\n\t\tel.placeholder = mask;\r\n\t}\r\n\r\n\tif(options.maskAutoFill){\r\n\t\tfillSymbols(el.value.length);\r\n\t}\r\n}","import maskInput from './inputMask.js';\r\nimport urlBuilder from '../Ajax/defaults/urlGenerator.js';\r\n\r\nexport default class Edit{\r\n constructor(editor, cell, onRendered, success, cancel, editorParams){\r\n this.edit = editor;\r\n this.table = editor.table;\r\n this.cell = cell;\r\n this.params = this._initializeParams(editorParams);\r\n \r\n this.data = [];\r\n this.displayItems = [];\r\n this.currentItems = [];\r\n this.focusedItem = null;\r\n \r\n this.input = this._createInputElement();\r\n this.listEl = this._createListElement();\r\n \r\n this.initialValues = null; \r\n \r\n this.isFilter = !cell._getSelf;\r\n \r\n this.filterTimeout = null;\r\n this.filtered = false;\r\n this.typing = false;\r\n \r\n this.values = []; \r\n this.popup = null; \r\n \r\n this.listIteration = 0;\r\n \r\n this.blurable = true;\r\n \r\n this.actions = {\r\n success:success,\r\n cancel:cancel\r\n }\r\n \r\n this._deprecationCheck();\r\n this._initializeValue();\r\n \r\n onRendered(this._onRendered.bind(this));\r\n }\r\n \r\n _deprecationCheck(){\r\n if(this.params.listItemFormatter){\r\n console.warn(\"The listItemFormatter editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n }\r\n \r\n if(this.params.sortValuesList){\r\n console.warn(\"The sortValuesList editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n }\r\n \r\n if(this.params.searchFunc){\r\n console.warn(\"The searchFunc editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n }\r\n \r\n if(this.params.searchingPlaceholder){\r\n console.warn(\"The searchingPlaceholder editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n }\r\n }\r\n \r\n _initializeValue(){\r\n var initialValue = this.cell.getValue();\r\n \r\n if(typeof initialValue === \"undefined\" && typeof this.params.defaultValue !== \"undefined\"){\r\n initialValue = this.params.defaultValue;\r\n }\r\n \r\n this.initialValues = this.params.multiselect ? initialValue : [initialValue];\r\n \r\n if(this.isFilter){\r\n this.input.value = this.initialValues.join(\",\");\r\n this.headerFilterInitialListGen(); \r\n }\r\n }\r\n \r\n _onRendered(){\r\n var cellEl = this.cell.getElement();\r\n \r\n function clickStop(e){\r\n e.stopPropagation();\r\n }\r\n \r\n this.input.style.height = \"100%\";\r\n this.input.focus({preventScroll: true});\r\n \r\n \r\n cellEl.addEventListener(\"click\", clickStop);\r\n \r\n setTimeout(() => {\r\n cellEl.removeEventListener(\"click\", clickStop);\r\n }, 1000)\r\n }\r\n \r\n _createListElement(){\r\n var listEl = document.createElement(\"div\");\r\n listEl.classList.add(\"tabulator-edit-list\");\r\n \r\n listEl.addEventListener(\"mousedown\", this._preventBlur.bind(this));\r\n listEl.addEventListener(\"keydown\", this._inputKeyDown.bind(this))\r\n \r\n return listEl;\r\n }\r\n \r\n _setListWidth(){\r\n var element = this.isFilter ? this.input : this.cell.getElement();\r\n \r\n this.listEl.style.minWidth = element.offsetWidth + \"px\";\r\n \r\n if(this.params.maxWidth){\r\n if(this.params.maxWidth === true){\r\n this.listEl.style.maxWidth = element.offsetWidth + \"px\";\r\n }else if(typeof this.params.maxWidth === \"number\"){\r\n this.listEl.style.maxWidth = this.params.maxWidth + \"px\";\r\n }else{\r\n this.listEl.style.maxWidth = this.params.maxWidth;\r\n }\r\n }\r\n \r\n }\r\n \r\n _createInputElement(){\r\n var attribs = this.params.elementAttributes;\r\n var input = document.createElement(\"input\");\r\n \r\n input.setAttribute(\"type\", this.params.clearable ? \"search\" : \"text\");\r\n \r\n input.style.padding = \"4px\";\r\n input.style.width = \"100%\";\r\n input.style.boxSizing = \"border-box\";\r\n \r\n if(!this.params.autocomplete){\r\n input.style.cursor = \"default\";\r\n input.style.caretColor = \"transparent\";\r\n // input.readOnly = (this.edit.currentCell != false);\r\n }\r\n \r\n if(attribs && typeof attribs == \"object\"){\r\n for (let key in attribs){\r\n if(key.charAt(0) == \"+\"){\r\n key = key.slice(1);\r\n input.setAttribute(key, input.getAttribute(key) + attribs[\"+\" + key]);\r\n }else{\r\n input.setAttribute(key, attribs[key]);\r\n }\r\n }\r\n }\r\n \r\n if(this.params.mask){\r\n maskInput(input, this.params);\r\n }\r\n \r\n this._bindInputEvents(input);\r\n \r\n return input;\r\n }\r\n \r\n _initializeParams(params){\r\n var valueKeys = [\"values\", \"valuesURL\", \"valuesLookup\"],\r\n valueCheck;\r\n\r\n params = Object.assign({}, params);\r\n \r\n params.verticalNavigation = params.verticalNavigation || \"editor\";\r\n params.placeholderLoading = typeof params.placeholderLoading === \"undefined\" ? \"Searching ...\" : params.placeholderLoading;\r\n params.placeholderEmpty = typeof params.placeholderEmpty === \"undefined\" ? \"No Results Found\" : params.placeholderEmpty;\r\n params.filterDelay = typeof params.filterDelay === \"undefined\" ? 300 : params.filterDelay;\r\n \r\n params.emptyValue = Object.keys(params).includes(\"emptyValue\") ? params.emptyValue : \"\";\r\n\r\n valueCheck = Object.keys(params).filter(key => valueKeys.includes(key)).length;\r\n\r\n if(!valueCheck){\r\n console.warn(\"list editor config error - either the values, valuesURL, or valuesLookup option must be set\")\r\n }else if(valueCheck > 1){\r\n console.warn(\"list editor config error - only one of the values, valuesURL, or valuesLookup options can be set on the same editor\")\r\n }\r\n \r\n if(params.autocomplete){\r\n if(params.multiselect){\r\n params.multiselect = false;\r\n console.warn(\"list editor config error - multiselect option is not available when autocomplete is enabled\")\r\n }\r\n }else{\r\n if(params.freetext){\r\n params.freetext = false;\r\n console.warn(\"list editor config error - freetext option is only available when autocomplete is enabled\");\r\n }\r\n \r\n if(params.filterFunc){\r\n params.filterFunc = false;\r\n console.warn(\"list editor config error - filterFunc option is only available when autocomplete is enabled\");\r\n }\r\n \r\n if(params.filterRemote){\r\n params.filterRemote = false;\r\n console.warn(\"list editor config error - filterRemote option is only available when autocomplete is enabled\");\r\n }\r\n \r\n if(params.mask){\r\n params.mask = false;\r\n console.warn(\"list editor config error - mask option is only available when autocomplete is enabled\");\r\n }\r\n \r\n if(params.allowEmpty){\r\n params.allowEmpty = false;\r\n console.warn(\"list editor config error - allowEmpty option is only available when autocomplete is enabled\");\r\n }\r\n \r\n if(params.listOnEmpty){\r\n params.listOnEmpty = false;\r\n console.warn(\"list editor config error - listOnEmpty option is only available when autocomplete is enabled\");\r\n }\r\n }\r\n \r\n if(params.filterRemote && !(typeof params.valuesLookup === \"function\" || typeof params.valuesURL)){\r\n params.filterRemote = false;\r\n console.warn(\"list editor config error - filterRemote option should only be used when values list is populated from a remote source\");\r\n }\r\n return params;\r\n }\r\n //////////////////////////////////////\r\n ////////// Event Handling ////////////\r\n //////////////////////////////////////\r\n \r\n _bindInputEvents(input){\r\n input.addEventListener(\"focus\", this._inputFocus.bind(this))\r\n input.addEventListener(\"click\", this._inputClick.bind(this))\r\n input.addEventListener(\"blur\", this._inputBlur.bind(this))\r\n input.addEventListener(\"keydown\", this._inputKeyDown.bind(this))\r\n input.addEventListener(\"search\", this._inputSearch.bind(this))\r\n \r\n if(this.params.autocomplete){\r\n input.addEventListener(\"keyup\", this._inputKeyUp.bind(this))\r\n }\r\n }\r\n \r\n \r\n _inputFocus(e){\r\n this.rebuildOptionsList();\r\n }\r\n \r\n _filter(){\r\n if(this.params.filterRemote){\r\n clearTimeout(this.filterTimeout);\r\n \r\n this.filterTimeout = setTimeout(() => {\r\n this.rebuildOptionsList();\r\n }, this.params.filterDelay);\r\n }else{\r\n this._filterList();\r\n }\r\n }\r\n \r\n _inputClick(e){\r\n e.stopPropagation();\r\n }\r\n \r\n _inputBlur(e){\r\n if(this.blurable && this.popup){\r\n this.popup.hide();\r\n }\r\n }\r\n \r\n _inputSearch(){\r\n this._clearChoices();\r\n }\r\n \r\n _inputKeyDown(e){\r\n switch(e.keyCode){\r\n \r\n case 38: //up arrow\r\n this._keyUp(e);\r\n break\r\n \r\n case 40: //down arrow\r\n this._keyDown(e);\r\n break;\r\n \r\n case 37: //left arrow\r\n case 39: //right arrow\r\n this._keySide(e);\r\n break;\r\n \r\n case 13: //enter\r\n this._keyEnter();\r\n break;\r\n \r\n case 27: //escape\r\n this._keyEsc();\r\n break;\r\n \r\n case 36: //home\r\n case 35: //end\r\n this._keyHomeEnd(e);\r\n break;\r\n \r\n case 9: //tab\r\n break;\r\n \r\n default:\r\n this._keySelectLetter(e);\r\n }\r\n }\r\n \r\n _inputKeyUp(e){\r\n switch(e.keyCode){\r\n case 38: //up arrow\r\n case 37: //left arrow\r\n case 39: //up arrow\r\n case 40: //right arrow\r\n case 13: //enter\r\n case 27: //escape\r\n break;\r\n \r\n default:\r\n this._keyAutoCompLetter(e);\r\n }\r\n }\r\n \r\n _preventBlur(){\r\n this.blurable = false;\r\n \r\n setTimeout(function(){\r\n this.blurable = true;\r\n }, 10);\r\n }\r\n \r\n //////////////////////////////////////\r\n //////// Keyboard Navigation /////////\r\n //////////////////////////////////////\r\n \r\n _keyUp(e){\r\n var index = this.displayItems.indexOf(this.focusedItem);\r\n \r\n if(this.params.verticalNavigation == \"editor\" || (this.params.verticalNavigation == \"hybrid\" && index)){\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n e.preventDefault();\r\n \r\n if(index > 0){\r\n this._focusItem(this.displayItems[index - 1]);\r\n }\r\n }\r\n }\r\n \r\n _keyDown(e){\r\n var index = this.displayItems.indexOf(this.focusedItem);\r\n \r\n if(this.params.verticalNavigation == \"editor\" || (this.params.verticalNavigation == \"hybrid\" && index < this.displayItems.length - 1)){\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n e.preventDefault();\r\n \r\n if(index < this.displayItems.length - 1){\r\n if(index == -1){\r\n this._focusItem(this.displayItems[0]);\r\n }else{\r\n this._focusItem(this.displayItems[index + 1]);\r\n }\r\n }\r\n }\r\n }\r\n \r\n _keySide(e){\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n e.preventDefault();\r\n }\r\n \r\n _keyEnter(e){\r\n if(this.focusedItem){\r\n this._chooseItem(this.focusedItem);\r\n }else{\r\n this._cancel();\r\n }\r\n }\r\n \r\n _keyEsc(e){\r\n this._cancel();\r\n }\r\n \r\n _keyHomeEnd(e){\r\n if(this.params.autocomplete){\r\n //prevent table navigation while using input element\r\n e.stopImmediatePropagation();\r\n }\r\n }\r\n \r\n _keySelectLetter(e){\r\n if(!this.params.autocomplete){\r\n // if(this.edit.currentCell === false){\r\n e.preventDefault();\r\n // }\r\n \r\n if(e.keyCode >= 38 && e.keyCode <= 90){\r\n this._scrollToValue(e.keyCode);\r\n }\r\n }\r\n }\r\n \r\n _keyAutoCompLetter(e){\r\n this._filter();\r\n this.typing = true;\r\n }\r\n \r\n \r\n _scrollToValue(char){\r\n clearTimeout(this.filterTimeout);\r\n \r\n var character = String.fromCharCode(char).toLowerCase();\r\n this.filterTerm += character.toLowerCase();\r\n \r\n var match = this.displayItems.find((item) => {\r\n return typeof item.label !== \"undefined\" && item.label.toLowerCase().startsWith(this.filterTerm);\r\n });\r\n \r\n if(match){\r\n this._focusItem(match);\r\n }\r\n \r\n this.filterTimeout = setTimeout(() => {\r\n this.filterTerm = \"\";\r\n }, 800)\r\n }\r\n \r\n _focusItem(item){\r\n if(this.focusedItem && this.focusedItem.element){\r\n this.focusedItem.element.classList.remove(\"focused\");\r\n }\r\n \r\n this.focusedItem = item;\r\n \r\n if(item && item.element){\r\n item.element.classList.add(\"focused\");\r\n item.element.scrollIntoView({behavior: 'smooth', block: 'nearest', inline: 'start'});\r\n }\r\n }\r\n \r\n \r\n //////////////////////////////////////\r\n /////// Data List Generation /////////\r\n //////////////////////////////////////\r\n headerFilterInitialListGen(){\r\n this._generateOptions(true);\r\n }\r\n \r\n rebuildOptionsList(){\r\n this._generateOptions()\r\n .then(this._sortOptions.bind(this))\r\n .then(this._buildList.bind(this))\r\n .then(this._showList.bind(this))\r\n .catch((e) => {\r\n if(!Number.isInteger(e)){\r\n console.error(\"List generation error\", e);\r\n }\r\n })\r\n }\r\n \r\n _filterList(){\r\n this._buildList(this._filterOptions());\r\n this._showList();\r\n }\r\n \r\n _generateOptions(silent){\r\n var values = [];\r\n var itteration = ++ this.listIteration;\r\n \r\n this.filtered = false;\r\n \r\n if(this.params.values){\r\n values = this.params.values;\r\n }else if (this.params.valuesURL){\r\n values = this._ajaxRequest(this.params.valuesURL, this.input.value);\r\n }else{\r\n if(typeof this.params.valuesLookup === \"function\"){\r\n values = this.params.valuesLookup(this.cell, this.input.value);\r\n }else if(this.params.valuesLookup){\r\n values = this._uniqueColumnValues(this.params.valuesLookupField);\r\n }\r\n }\r\n \r\n if(values instanceof Promise){\r\n if(!silent){\r\n this._addPlaceholder(this.params.placeholderLoading);\r\n }\r\n \r\n return values.then()\r\n .then((responseValues) => {\r\n if(this.listIteration === itteration){\r\n return this._parseList(responseValues);\r\n }else{\r\n return Promise.reject(itteration);\r\n }\r\n });\r\n }else{\r\n return Promise.resolve(this._parseList(values))\r\n }\r\n }\r\n \r\n _addPlaceholder(contents){\r\n var placeholder = document.createElement(\"div\");\r\n \r\n if(typeof contents === \"function\"){\r\n contents = contents(cell.getComponent(), this.listEl);\r\n }\r\n \r\n if(contents){\r\n this._clearList();\r\n \r\n if(contents instanceof HTMLElement){\r\n placeholder = contents;\r\n }else{\r\n placeholder.classList.add(\"tabulator-edit-list-placeholder\")\r\n placeholder.innerHTML = contents;\r\n }\r\n \r\n this.listEl.appendChild(placeholder);\r\n \r\n this._showList();\r\n }\r\n }\r\n \r\n _ajaxRequest(url, term){\r\n var params = this.params.filterRemote ? {term:term} : {};\r\n url = urlBuilder(url, {}, params);\r\n \r\n return fetch(url)\r\n .then((response)=>{\r\n if(response.ok) {\r\n return response.json()\r\n .catch((error)=>{\r\n console.warn(\"List Ajax Load Error - Invalid JSON returned\", error);\r\n return Promise.reject(error);\r\n });\r\n }else{\r\n console.error(\"List Ajax Load Error - Connection Error: \" + response.status, response.statusText);\r\n return Promise.reject(response);\r\n }\r\n })\r\n .catch((error)=>{\r\n console.error(\"List Ajax Load Error - Connection Error: \", error);\r\n return Promise.reject(error);\r\n });\r\n }\r\n \r\n _uniqueColumnValues(field){\r\n var output = {},\r\n data = this.table.getData(this.params.valuesLookup),\r\n column;\r\n \r\n if(field){\r\n column = this.table.columnManager.getColumnByField(field);\r\n }else{\r\n column = this.cell.getColumn()._getSelf();\r\n }\r\n \r\n if(column){\r\n data.forEach((row) => {\r\n var val = column.getFieldValue(row);\r\n \r\n if(val !== null && typeof val !== \"undefined\" && val !== \"\"){\r\n output[val] = true;\r\n }\r\n });\r\n }else{\r\n console.warn(\"unable to find matching column to create select lookup list:\", field);\r\n output = [];\r\n }\r\n \r\n return Object.keys(output);\r\n }\r\n \r\n \r\n _parseList(inputValues){\r\n var data = [];\r\n \r\n if(!Array.isArray(inputValues)){\r\n inputValues = Object.entries(inputValues).map(([key, value]) => {\r\n return {\r\n label:value,\r\n value:key,\r\n };\r\n });\r\n }\r\n \r\n inputValues.forEach((value) => {\r\n if(typeof value !== \"object\"){\r\n value = {\r\n label:value,\r\n value:value,\r\n };\r\n }\r\n \r\n this._parseListItem(value, data, 0);\r\n });\r\n \r\n this.data = data;\r\n \r\n return data; \r\n }\r\n \r\n _parseListItem(option, data, level){\r\n var item = {};\r\n \r\n if(option.options){\r\n item = this._parseListGroup(option, level + 1);\r\n }else{\r\n item = {\r\n label:option.label,\r\n value:option.value,\r\n itemParams:option.itemParams,\r\n elementAttributes: option.elementAttributes,\r\n element:false,\r\n selected:false,\r\n visible:true,\r\n level:level,\r\n original:option,\r\n };\r\n \r\n if(this.initialValues && this.initialValues.indexOf(option.value) > -1){\r\n this._chooseItem(item, true);\r\n }\r\n }\r\n \r\n data.push(item);\r\n }\r\n \r\n _parseListGroup(option, level){\r\n var item = {\r\n label:option.label,\r\n group:true,\r\n itemParams:option.itemParams,\r\n elementAttributes:option.elementAttributes,\r\n element:false,\r\n visible:true,\r\n level:level,\r\n options:[],\r\n original:option,\r\n };\r\n \r\n option.options.forEach((child) => {\r\n this._parseListItem(child, item.options, level);\r\n });\r\n \r\n return item;\r\n }\r\n \r\n _sortOptions(options){\r\n var sorter;\r\n \r\n if(this.params.sort){\r\n sorter = typeof this.params.sort === \"function\" ? this.params.sort : this._defaultSortFunction.bind(this);\r\n \r\n this._sortGroup(sorter, options);\r\n }\r\n \r\n return options;\r\n }\r\n \r\n _sortGroup(sorter, options){\r\n options.sort((a,b) => {\r\n return sorter(a.label, b.label, a.value, b.value, a.original, b.original);\r\n });\r\n \r\n options.forEach((option) => {\r\n if(option.group){\r\n this._sortGroup(sorter, option.options);\r\n }\r\n })\r\n }\r\n \r\n _defaultSortFunction(as, bs){\r\n var a, b, a1, b1, i= 0, L, rx = /(\\d+)|(\\D+)/g, rd = /\\d/;\r\n var emptyAlign = 0;\r\n \r\n if(this.params.sort === \"desc\"){\r\n [as, bs] = [bs, as];\r\n }\r\n \r\n //handle empty values\r\n if(!as && as!== 0){\r\n emptyAlign = !bs && bs!== 0 ? 0 : -1;\r\n }else if(!bs && bs!== 0){\r\n emptyAlign = 1;\r\n }else{\r\n if(isFinite(as) && isFinite(bs)) return as - bs;\r\n a = String(as).toLowerCase();\r\n b = String(bs).toLowerCase();\r\n if(a === b) return 0;\r\n if(!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1;\r\n a = a.match(rx);\r\n b = b.match(rx);\r\n L = a.length > b.length ? b.length : a.length;\r\n while(i < L){\r\n a1= a[i];\r\n b1= b[i++];\r\n if(a1 !== b1){\r\n if(isFinite(a1) && isFinite(b1)){\r\n if(a1.charAt(0) === \"0\") a1 = \".\" + a1;\r\n if(b1.charAt(0) === \"0\") b1 = \".\" + b1;\r\n return a1 - b1;\r\n }\r\n else return a1 > b1 ? 1 : -1;\r\n }\r\n }\r\n \r\n return a.length > b.length;\r\n }\r\n \r\n return emptyAlign;\r\n }\r\n \r\n _filterOptions(){\r\n var filterFunc = this.params.filterFunc || this._defaultFilterFunc;\r\n var term = this.input.value;\r\n var results = [];\r\n \r\n if(term){\r\n this.filtered = true;\r\n \r\n this.data.forEach((item) => {\r\n this._filterItem(filterFunc, term, item);\r\n });\r\n }else{\r\n this.filtered = false;\r\n }\r\n \r\n return this.data;\r\n }\r\n \r\n _filterItem(func, term, item){\r\n var matches = false;\r\n \r\n if(!item.group){\r\n item.visible = func(term, item.label, item.value, item.original);\r\n }else{\r\n item.options.forEach((option) => {\r\n if(this._filterItem(func, term, option)){\r\n matches = true;\r\n }\r\n });\r\n \r\n item.visible = matches;\r\n }\r\n \r\n return item.visible;\r\n }\r\n \r\n _defaultFilterFunc(term, label, value, item){\r\n var term = String(term).toLowerCase();\r\n \r\n if(label !== null || typeof label !== \"undefined\"){\r\n if(String(label).toLowerCase().indexOf(term) > -1 || String(value).toLowerCase(term).indexOf() > -1){\r\n return true;\r\n }\r\n }\r\n \r\n return false;\r\n }\r\n \r\n //////////////////////////////////////\r\n /////////// Display List /////////////\r\n //////////////////////////////////////\r\n \r\n _clearList(){\r\n while(this.listEl.firstChild) this.listEl.removeChild(this.listEl.firstChild);\r\n \r\n this.displayItems = [];\r\n }\r\n \r\n _buildList(data){\r\n this._clearList();\r\n \r\n data.forEach((option) => {\r\n this._buildItem(option);\r\n });\r\n \r\n if(!this.displayItems.length){\r\n this._addPlaceholder(this.params.placeholderEmpty);\r\n } \r\n }\r\n \r\n _buildItem(item){\r\n var el = item.element,\r\n contents;\r\n \r\n if(!this.filtered || item.visible){\r\n \r\n if(!el){\r\n el = document.createElement(\"div\");\r\n el.tabIndex = 0;\r\n \r\n contents = this.params.itemFormatter ? this.params.itemFormatter(item.label, item.value, item.original, el) : item.label;\r\n \r\n if(contents instanceof HTMLElement){\r\n el.appendChild(contents)\r\n }else{\r\n el.innerHTML = contents;\r\n }\r\n \r\n if(item.group){\r\n el.classList.add(\"tabulator-edit-list-group\");\r\n }else{\r\n el.classList.add(\"tabulator-edit-list-item\");\r\n }\r\n \r\n el.classList.add(\"tabulator-edit-list-group-level-\" + item.level);\r\n \r\n if(item.elementAttributes && typeof item.elementAttributes == \"object\"){\r\n for (let key in item.elementAttributes){\r\n if(key.charAt(0) == \"+\"){\r\n key = key.slice(1);\r\n el.setAttribute(key, this.input.getAttribute(key) + item.elementAttributes[\"+\" + key]);\r\n }else{\r\n el.setAttribute(key, item.elementAttributes[key]);\r\n }\r\n }\r\n }\r\n \r\n if(item.group){\r\n el.addEventListener(\"click\", this._groupClick.bind(this, item));\r\n }else{\r\n el.addEventListener(\"click\", this._itemClick.bind(this, item));\r\n }\r\n \r\n el.addEventListener(\"mousedown\", this._preventBlur.bind(this));\r\n \r\n item.element = el;\r\n }\r\n \r\n this._styleItem(item);\r\n \r\n this.listEl.appendChild(el);\r\n \r\n if(item.group){\r\n item.options.forEach((option) => {\r\n this._buildItem(option);\r\n });\r\n }else{\r\n this.displayItems.push(item);\r\n }\r\n }\r\n }\r\n \r\n _showList(){\r\n var startVis = this.popup && this.popup.isVisible();\r\n \r\n if(this.input.parentNode){\r\n if(this.params.autocomplete && this.input.value === \"\" && !this.params.listOnEmpty){\r\n if(this.popup){\r\n this.popup.hide(true);\r\n return;\r\n }\r\n }\r\n \r\n this._setListWidth();\r\n \r\n if(!this.popup){\r\n this.popup = this.edit.popup(this.listEl);\r\n }\r\n \r\n this.popup.show(this.cell.getElement(), \"bottom\")\r\n \r\n if(!startVis){\r\n this.popup.hideOnBlur(this._resolveValue.bind(this, true));\r\n }\r\n }\r\n }\r\n \r\n _styleItem(item){\r\n if(item && item.element){\r\n if(item.selected){\r\n item.element.classList.add(\"active\");\r\n }else{\r\n item.element.classList.remove(\"active\");\r\n }\r\n }\r\n }\r\n \r\n //////////////////////////////////////\r\n ///////// User Interaction ///////////\r\n //////////////////////////////////////\r\n \r\n _itemClick(item, e){\r\n e.stopPropagation();\r\n \r\n this._chooseItem(item);\r\n }\r\n \r\n _groupClick(item, e){\r\n e.stopPropagation();\r\n }\r\n \r\n \r\n //////////////////////////////////////\r\n ////// Current Item Management ///////\r\n //////////////////////////////////////\r\n \r\n _cancel(){\r\n this.popup.hide(true);\r\n this.actions.cancel();\r\n }\r\n \r\n _clearChoices(){\r\n this.typing = true;\r\n \r\n this.currentItems.forEach((item) => {\r\n item.selected = false;\r\n this._styleItem(item);\r\n });\r\n \r\n this.currentItems = [];\r\n \r\n this.focusedItem = null;\r\n }\r\n \r\n _chooseItem(item, silent){\r\n var index;\r\n \r\n this.typing = false;\r\n \r\n if(this.params.multiselect){\r\n index = this.currentItems.indexOf(item);\r\n \r\n if(index > -1){\r\n this.currentItems.splice(index, 1);\r\n item.selected = false;\r\n }else{\r\n this.currentItems.push(item);\r\n item.selected = true;\r\n }\r\n \r\n this.input.value = this.currentItems.map(item => item.label).join(\",\");\r\n \r\n this._styleItem(item);\r\n \r\n }else{\r\n this.currentItems = [item];\r\n item.selected = true;\r\n \r\n this.input.value = item.label;\r\n \r\n this._styleItem(item);\r\n \r\n if(!silent){\r\n this._resolveValue();\r\n }\r\n }\r\n \r\n this._focusItem(item);\r\n }\r\n \r\n _resolveValue(blur){\r\n var output, initialValue;\r\n \r\n this.popup.hide(true);\r\n \r\n if(this.params.multiselect){\r\n output = this.currentItems.map(item => item.value);\r\n }else{\r\n if(blur && this.params.autocomplete && this.typing){\r\n if(this.params.freetext || (this.params.allowEmpty && this.input.value === \"\")){\r\n output = this.input.value;\r\n }else{\r\n this.actions.cancel();\r\n return;\r\n }\r\n }else{\r\n if(this.currentItems[0]){\r\n output = this.currentItems[0].value;\r\n }else{\r\n initialValue = this.initialValues[0];\r\n \r\n if(initialValue === null || typeof initialValue === \"undefined\" || initialValue === \"\"){\r\n output = initialValue;\r\n }else{\r\n output = this.params.emptyValue;\r\n }\r\n }\r\n \r\n }\r\n }\r\n \r\n if(output === \"\"){\r\n output = this.params.emptyValue;\r\n }\r\n \r\n this.actions.success(output);\r\n \r\n if(this.isFilter){\r\n this.initialValues = output && !Array.isArray[output] ? [output] : output;\r\n }\r\n }\r\n \r\n}\r\n","import input from './editors/input.js';\r\nimport textarea from './editors/textarea.js';\r\nimport number from './editors/number.js';\r\nimport range from './editors/range.js';\r\nimport select from './editors/select.js';\r\nimport list from './editors/list.js';\r\nimport autocomplete from './editors/autocomplete.js';\r\nimport star from './editors/star.js';\r\nimport progress from './editors/progress.js';\r\nimport tickCross from './editors/tickCross.js';\r\n\r\nexport default {\r\n\tinput:input,\r\n\ttextarea:textarea,\r\n number:number,\r\n range:range,\r\n\tselect:select,\r\n\tlist:list,\r\n\tautocomplete:autocomplete,\r\n\tstar:star,\r\n\tprogress:progress,\r\n\ttickCross:tickCross,\r\n};","import maskInput from '../../inputMask.js';\r\n\r\n//input element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\t//create and style input\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", editorParams.search ? \"search\" : \"text\");\r\n\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = typeof cellValue !== \"undefined\" ? cellValue : \"\";\r\n\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\r\n\tfunction onChange(e){\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && input.value !== \"\") || input.value !== cellValue){\r\n\t\t\tif(success(input.value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t// case 9:\r\n\t\t\tcase 13:\r\n\t\t\tonChange(e);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\tcancel();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\te.stopPropagation();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(editorParams.mask){\r\n\t\tmaskInput(input, editorParams);\r\n\t}\r\n\r\n\treturn input;\r\n};","import maskInput from '../../inputMask.js';\r\n\r\n//resizable text area element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n var self = this,\r\n cellValue = cell.getValue(),\r\n vertNav = editorParams.verticalNavigation || \"hybrid\",\r\n value = String(cellValue !== null && typeof cellValue !== \"undefined\" ? cellValue : \"\"),\r\n count = (value.match(/(?:\\r\\n|\\r|\\n)/g) || []).length + 1,\r\n input = document.createElement(\"textarea\"),\r\n scrollHeight = 0;\r\n\r\n //create and style input\r\n input.style.display = \"block\";\r\n input.style.padding = \"2px\";\r\n input.style.height = \"100%\";\r\n input.style.width = \"100%\";\r\n input.style.boxSizing = \"border-box\";\r\n input.style.whiteSpace = \"pre-wrap\";\r\n input.style.resize = \"none\";\r\n\r\n if(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n for (let key in editorParams.elementAttributes){\r\n if(key.charAt(0) == \"+\"){\r\n key = key.slice(1);\r\n input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n }else{\r\n input.setAttribute(key, editorParams.elementAttributes[key]);\r\n }\r\n }\r\n }\r\n\r\n input.value = value;\r\n\r\n onRendered(function(){\r\n input.focus({preventScroll: true});\r\n input.style.height = \"100%\";\r\n\r\n input.scrollHeight;\r\n input.style.height = input.scrollHeight + \"px\";\r\n cell.getRow().normalizeHeight();\r\n\r\n if(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n });\r\n\r\n function onChange(e){\r\n\r\n if(((cellValue === null || typeof cellValue === \"undefined\") && input.value !== \"\") || input.value !== cellValue){\r\n\r\n if(success(input.value)){\r\n cellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n }\r\n\r\n setTimeout(function(){\r\n cell.getRow().normalizeHeight();\r\n },300)\r\n }else{\r\n cancel();\r\n }\r\n }\r\n\r\n //submit new value on blur or change\r\n input.addEventListener(\"change\", onChange);\r\n input.addEventListener(\"blur\", onChange);\r\n\r\n input.addEventListener(\"keyup\", function(){\r\n\r\n input.style.height = \"\";\r\n\r\n var heightNow = input.scrollHeight;\r\n\r\n input.style.height = heightNow + \"px\";\r\n\r\n if(heightNow != scrollHeight){\r\n scrollHeight = heightNow;\r\n cell.getRow().normalizeHeight();\r\n }\r\n });\r\n\r\n input.addEventListener(\"keydown\", function(e){\r\n\r\n switch(e.keyCode){\r\n case 27:\r\n cancel();\r\n break;\r\n\r\n case 38: //up arrow\r\n if(vertNav == \"editor\" || (vertNav == \"hybrid\" && input.selectionStart)){\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n }\r\n\r\n break;\r\n\r\n case 40: //down arrow\r\n if(vertNav == \"editor\" || (vertNav == \"hybrid\" && input.selectionStart !== input.value.length)){\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n }\r\n break;\r\n\r\n case 35:\r\n case 36:\r\n e.stopPropagation();\r\n break;\r\n }\r\n });\r\n\r\n if(editorParams.mask){\r\n maskInput(input, editorParams);\r\n }\r\n\r\n return input;\r\n};","import maskInput from '../../inputMask.js';\r\n\r\n//input element with type of number\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar cellValue = cell.getValue(),\r\n\tvertNav = editorParams.verticalNavigation || \"editor\",\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", \"number\");\r\n\r\n\tif(typeof editorParams.max != \"undefined\"){\r\n\t\tinput.setAttribute(\"max\", editorParams.max);\r\n\t}\r\n\r\n\tif(typeof editorParams.min != \"undefined\"){\r\n\t\tinput.setAttribute(\"min\", editorParams.min);\r\n\t}\r\n\r\n\tif(typeof editorParams.step != \"undefined\"){\r\n\t\tinput.setAttribute(\"step\", editorParams.step);\r\n\t}\r\n\r\n\t//create and style input\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\r\n\tvar blurFunc = function(e){\r\n\t\tonChange();\r\n\t};\r\n\r\n\tonRendered(function () {\r\n\t\t//submit new value on blur\r\n\t\tinput.removeEventListener(\"blur\", blurFunc);\r\n\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\r\n\t\t//submit new value on blur\r\n\t\tinput.addEventListener(\"blur\", blurFunc);\r\n\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\r\n\tfunction onChange(){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(!isNaN(value) && value !==\"\"){\r\n\t\t\tvalue = Number(value);\r\n\t\t}\r\n\r\n\t\tif(value !== cellValue){\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 13:\r\n\t\t\t// case 9:\r\n\t\t\tonChange();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\tcancel();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 38: //up arrow\r\n\t\t\tcase 40: //down arrow\r\n\t\t\tif(vertNav == \"editor\"){\r\n\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\te.stopPropagation();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(editorParams.mask){\r\n\t\tmaskInput(input, editorParams);\r\n\t}\r\n\r\n\treturn input;\r\n};","//input element with type of number\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", \"range\");\r\n\r\n\tif (typeof editorParams.max != \"undefined\") {\r\n\t\tinput.setAttribute(\"max\", editorParams.max);\r\n\t}\r\n\r\n\tif (typeof editorParams.min != \"undefined\") {\r\n\t\tinput.setAttribute(\"min\", editorParams.min);\r\n\t}\r\n\r\n\tif (typeof editorParams.step != \"undefined\") {\r\n\t\tinput.setAttribute(\"step\", editorParams.step);\r\n\t}\r\n\r\n\t//create and style input\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\r\n\tonRendered(function () {\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\t});\r\n\r\n\tfunction onChange(){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(!isNaN(value) && value !==\"\"){\r\n\t\t\tvalue = Number(value);\r\n\t\t}\r\n\r\n\t\tif(value != cellValue){\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur\r\n\tinput.addEventListener(\"blur\", function(e){\r\n\t\tonChange();\r\n\t});\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 13:\r\n\t\t\t// case 9:\r\n\t\t\tonChange();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\tcancel();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\treturn input;\r\n};","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\r\n\t console.warn(\"The select editor has been deprecated, please use the new list editor\");\r\n\r\n var list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n return list.input;\r\n}","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n var list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n return list.input;\r\n}","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\r\n\tconsole.warn(\"The autocomplete editor has been deprecated, please use the new list editor with the 'autocomplete' editorParam\");\r\n\r\n\teditorParams.autocomplete = true;\r\n\r\n var list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n return list.input;\r\n}","//star rating\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar self = this,\r\n\telement = cell.getElement(),\r\n\tvalue = cell.getValue(),\r\n\tmaxStars = element.getElementsByTagName(\"svg\").length || 5,\r\n\tsize = element.getElementsByTagName(\"svg\")[0] ? element.getElementsByTagName(\"svg\")[0].getAttribute(\"width\") : 14,\r\n\tstars = [],\r\n\tstarsHolder = document.createElement(\"div\"),\r\n\tstar = document.createElementNS('http://www.w3.org/2000/svg', \"svg\");\r\n\r\n\r\n\t//change star type\r\n\tfunction starChange(val){\r\n\t\tstars.forEach(function(star, i){\r\n\t\t\tif(i < val){\r\n\t\t\t\tif(self.table.browser == \"ie\"){\r\n\t\t\t\t\tstar.setAttribute(\"class\", \"tabulator-star-active\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tstar.classList.replace(\"tabulator-star-inactive\", \"tabulator-star-active\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstar.innerHTML = '';\r\n\t\t\t}else{\r\n\t\t\t\tif(self.table.browser == \"ie\"){\r\n\t\t\t\t\tstar.setAttribute(\"class\", \"tabulator-star-inactive\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tstar.classList.replace(\"tabulator-star-active\", \"tabulator-star-inactive\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstar.innerHTML = '';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//build stars\r\n\tfunction buildStar(i){\r\n\r\n\t\tvar starHolder = document.createElement(\"span\");\r\n\t\tvar nextStar = star.cloneNode(true);\r\n\r\n\t\tstars.push(nextStar);\r\n\r\n\t\tstarHolder.addEventListener(\"mouseenter\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\tstarChange(i);\r\n\t\t});\r\n\r\n\t\tstarHolder.addEventListener(\"mousemove\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t});\r\n\r\n\t\tstarHolder.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\tsuccess(i);\r\n\t\t\telement.blur();\r\n\t\t});\r\n\r\n\t\tstarHolder.appendChild(nextStar);\r\n\t\tstarsHolder.appendChild(starHolder);\r\n\r\n\t}\r\n\r\n\t//handle keyboard navigation value change\r\n\tfunction changeValue(val){\r\n\t\tvalue = val;\r\n\t\tstarChange(val);\r\n\t}\r\n\r\n\t//style cell\r\n\telement.style.whiteSpace = \"nowrap\";\r\n\telement.style.overflow = \"hidden\";\r\n\telement.style.textOverflow = \"ellipsis\";\r\n\r\n\t//style holding element\r\n\tstarsHolder.style.verticalAlign = \"middle\";\r\n\tstarsHolder.style.display = \"inline-block\";\r\n\tstarsHolder.style.padding = \"4px\";\r\n\r\n\t//style star\r\n\tstar.setAttribute(\"width\", size);\r\n\tstar.setAttribute(\"height\", size);\r\n\tstar.setAttribute(\"viewBox\", \"0 0 512 512\");\r\n\tstar.setAttribute(\"xml:space\", \"preserve\");\r\n\tstar.style.padding = \"0 1px\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tstarsHolder.setAttribute(key, starsHolder.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tstarsHolder.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//create correct number of stars\r\n\tfor(var i=1;i<= maxStars;i++){\r\n\t\tbuildStar(i);\r\n\t}\r\n\r\n\t//ensure value does not exceed number of stars\r\n\tvalue = Math.min(parseInt(value), maxStars);\r\n\r\n\t// set initial styling of stars\r\n\tstarChange(value);\r\n\r\n\tstarsHolder.addEventListener(\"mousemove\", function(e){\r\n\t\tstarChange(0);\r\n\t});\r\n\r\n\tstarsHolder.addEventListener(\"click\", function(e){\r\n\t\tsuccess(0);\r\n\t});\r\n\r\n\telement.addEventListener(\"blur\", function(e){\r\n\t\tcancel();\r\n\t});\r\n\r\n\t//allow key based navigation\r\n\telement.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 39: //right arrow\r\n\t\t\tchangeValue(value + 1);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 37: //left arrow\r\n\t\t\tchangeValue(value - 1);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 13: //enter\r\n\t\t\tsuccess(value);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 27: //escape\r\n\t\t\tcancel();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\treturn starsHolder;\r\n};","//draggable progress bar\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar element = cell.getElement(),\r\n\tmax = typeof editorParams.max === \"undefined\" ? ((element.getElementsByTagName(\"div\")[0] && element.getElementsByTagName(\"div\")[0].getAttribute(\"max\")) || 100) : editorParams.max,\r\n\tmin = typeof editorParams.min === \"undefined\" ? ((element.getElementsByTagName(\"div\")[0] && element.getElementsByTagName(\"div\")[0].getAttribute(\"min\")) || 0) : editorParams.min,\r\n\tpercent = (max - min) / 100,\r\n\tvalue = cell.getValue() || 0,\r\n\thandle = document.createElement(\"div\"),\r\n\tbar = document.createElement(\"div\"),\r\n\tmouseDrag, mouseDragWidth;\r\n\r\n\t//set new value\r\n\tfunction updateValue(){\r\n\t\tvar style = window.getComputedStyle(element, null);\r\n\r\n\t\tvar calcVal = (percent * Math.round(bar.offsetWidth / ((element.clientWidth - parseInt(style.getPropertyValue(\"padding-left\")) - parseInt(style.getPropertyValue(\"padding-right\")))/100))) + min;\r\n\t\tsuccess(calcVal);\r\n\t\telement.setAttribute(\"aria-valuenow\", calcVal);\r\n\t\telement.setAttribute(\"aria-label\", value);\r\n\t}\r\n\r\n\t//style handle\r\n\thandle.style.position = \"absolute\";\r\n\thandle.style.right = \"0\";\r\n\thandle.style.top = \"0\";\r\n\thandle.style.bottom = \"0\";\r\n\thandle.style.width = \"5px\";\r\n\thandle.classList.add(\"tabulator-progress-handle\");\r\n\r\n\t//style bar\r\n\tbar.style.display = \"inline-block\";\r\n\tbar.style.position = \"relative\";\r\n\t// bar.style.top = \"8px\";\r\n\t// bar.style.bottom = \"8px\";\r\n\t// bar.style.left = \"4px\";\r\n\t// bar.style.marginRight = \"4px\";\r\n\tbar.style.height = \"100%\";\r\n\tbar.style.backgroundColor = \"#488CE9\";\r\n\tbar.style.maxWidth = \"100%\";\r\n\tbar.style.minWidth = \"0%\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tbar.setAttribute(key, bar.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tbar.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//style cell\r\n\telement.style.padding = \"4px 4px\";\r\n\r\n\t//make sure value is in range\r\n\tvalue = Math.min(parseFloat(value), max);\r\n\tvalue = Math.max(parseFloat(value), min);\r\n\r\n\t//workout percentage\r\n\tvalue = Math.round((value - min) / percent);\r\n\t// bar.style.right = value + \"%\";\r\n\tbar.style.width = value + \"%\";\r\n\r\n\telement.setAttribute(\"aria-valuemin\", min);\r\n\telement.setAttribute(\"aria-valuemax\", max);\r\n\r\n\tbar.appendChild(handle);\r\n\r\n\thandle.addEventListener(\"mousedown\", function(e){\r\n\t\tmouseDrag = e.screenX;\r\n\t\tmouseDragWidth = bar.offsetWidth;\r\n\t});\r\n\r\n\thandle.addEventListener(\"mouseover\", function(){\r\n\t\thandle.style.cursor = \"ew-resize\";\r\n\t});\r\n\r\n\telement.addEventListener(\"mousemove\", function(e){\r\n\t\tif(mouseDrag){\r\n\t\t\tbar.style.width = (mouseDragWidth + e.screenX - mouseDrag) + \"px\";\r\n\t\t}\r\n\t});\r\n\r\n\telement.addEventListener(\"mouseup\", function(e){\r\n\t\tif(mouseDrag){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\r\n\t\t\tmouseDrag = false;\r\n\t\t\tmouseDragWidth = false;\r\n\r\n\t\t\tupdateValue();\r\n\t\t}\r\n\t});\r\n\r\n\t//allow key based navigation\r\n\telement.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 39: //right arrow\r\n\t\t\te.preventDefault();\r\n\t\t\tbar.style.width = (bar.clientWidth + element.clientWidth/100) + \"px\";\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 37: //left arrow\r\n\t\t\te.preventDefault();\r\n\t\t\tbar.style.width = (bar.clientWidth - element.clientWidth/100) + \"px\";\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 9: //tab\r\n\t\t\tcase 13: //enter\r\n\t\t\tupdateValue();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 27: //escape\r\n\t\t\tcancel();\r\n\t\t\tbreak;\r\n\r\n\t\t}\r\n\t});\r\n\r\n\telement.addEventListener(\"blur\", function(){\r\n\t\tcancel();\r\n\t});\r\n\r\n\treturn bar;\r\n};","//checkbox\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar value = cell.getValue(),\r\n\tinput = document.createElement(\"input\"),\r\n\ttristate = editorParams.tristate,\r\n\tindetermValue = typeof editorParams.indeterminateValue === \"undefined\" ? null : editorParams.indeterminateValue,\r\n\tindetermState = false,\r\n\ttrueValueSet = Object.keys(editorParams).includes(\"trueValue\"),\r\n\tfalseValueSet = Object.keys(editorParams).includes(\"falseValue\");\r\n\r\n\tinput.setAttribute(\"type\", \"checkbox\");\r\n\tinput.style.marginTop = \"5px\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = value;\r\n\r\n\tif(tristate && (typeof value === \"undefined\" || value === indetermValue || value === \"\")){\r\n\t\tindetermState = true;\r\n\t\tinput.indeterminate = true;\r\n\t}\r\n\r\n\tif(this.table.browser != \"firefox\"){ //prevent blur issue on mac firefox\r\n\t\tonRendered(function(){\r\n\t\t\tinput.focus({preventScroll: true});\r\n\t\t});\r\n\t}\r\n\r\n\tinput.checked = trueValueSet ? value === editorParams.trueValue : (value === true || value === \"true\" || value === \"True\" || value === 1);\r\n\r\n\tonRendered(function(){\r\n\t\tinput.focus();\r\n\t});\r\n\r\n\tfunction setValue(blur){\r\n\t\tvar checkedValue = input.checked;\r\n\r\n\t\tif(trueValueSet && checkedValue){\r\n\t\t\tcheckedValue = editorParams.trueValue;\r\n\t\t}else if(falseValueSet && !checkedValue){\r\n\t\t\tcheckedValue = editorParams.falseValue;\r\n\t\t}else{\r\n\t\t\tcheckedValue = checkedValue;\r\n\t\t}\r\n\r\n\t\tif(tristate){\r\n\t\t\tif(!blur){\r\n\t\t\t\tif(input.checked && !indetermState){\r\n\t\t\t\t\tinput.checked = false;\r\n\t\t\t\t\tinput.indeterminate = true;\r\n\t\t\t\t\tindetermState = true;\r\n\t\t\t\t\treturn indetermValue;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tindetermState = false;\r\n\t\t\t\t\treturn checkedValue;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(indetermState){\r\n\t\t\t\t\treturn indetermValue;\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn checkedValue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn checkedValue;\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur\r\n\tinput.addEventListener(\"change\", function(e){\r\n\t\tsuccess(setValue());\r\n\t});\r\n\r\n\tinput.addEventListener(\"blur\", function(e){\r\n\t\tsuccess(setValue(true));\r\n\t});\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tif(e.keyCode == 13){\r\n\t\t\tsuccess(setValue());\r\n\t\t}\r\n\t\tif(e.keyCode == 27){\r\n\t\t\tcancel();\r\n\t\t}\r\n\t});\r\n\r\n\treturn input;\r\n};","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defaultEditors from './defaults/editors.js';\r\n\r\nclass Edit extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.currentCell = false; //hold currently editing cell\r\n\t\tthis.mouseClick = false; //hold mousedown state to prevent click binding being overriden by editor opening\r\n\t\tthis.recursionBlock = false; //prevent focus recursion\r\n\t\tthis.invalidEdit = false;\r\n\t\tthis.editedCells = [];\r\n\r\n\t\tthis.editors = Edit.editors;\r\n\r\n\t\tthis.registerColumnOption(\"editable\");\r\n\t\tthis.registerColumnOption(\"editor\");\r\n\t\tthis.registerColumnOption(\"editorParams\");\r\n\r\n\t\tthis.registerColumnOption(\"cellEditing\");\r\n\t\tthis.registerColumnOption(\"cellEdited\");\r\n\t\tthis.registerColumnOption(\"cellEditCancelled\");\r\n\r\n\t\tthis.registerTableFunction(\"getEditedCells\", this.getEditedCells.bind(this));\r\n\t\tthis.registerTableFunction(\"clearCellEdited\", this.clearCellEdited.bind(this));\r\n\t\tthis.registerTableFunction(\"navigatePrev\", this.navigatePrev.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateNext\", this.navigateNext.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateLeft\", this.navigateLeft.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateRight\", this.navigateRight.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateUp\", this.navigateUp.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateDown\", this.navigateDown.bind(this));\r\n\r\n\t\tthis.registerComponentFunction(\"cell\", \"isEdited\", this.cellisEdited.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"clearEdited\", this.clearEdited.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"edit\", this.editCell.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"cancelEdit\", this.cellCancelEdit.bind(this));\r\n\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigatePrev\", this.navigatePrev.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateNext\", this.navigateNext.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateLeft\", this.navigateLeft.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateRight\", this.navigateRight.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateUp\", this.navigateUp.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateDown\", this.navigateDown.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-init\", this.bindEditor.bind(this));\r\n\t\tthis.subscribe(\"cell-delete\", this.clearEdited.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumnCheck.bind(this));\r\n\t\tthis.subscribe(\"column-delete\", this.columnDeleteCheck.bind(this));\r\n\t\tthis.subscribe(\"row-deleting\", this.rowDeleteCheck.bind(this));\r\n\t\tthis.subscribe(\"data-refreshing\", this.cancelEdit.bind(this));\r\n\r\n\t\tthis.subscribe(\"keybinding-nav-prev\", this.navigatePrev.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-next\", this.keybindingNavigateNext.bind(this));\r\n\t\tthis.subscribe(\"keybinding-nav-left\", this.navigateLeft.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-right\", this.navigateRight.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-up\", this.navigateUp.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-down\", this.navigateDown.bind(this, undefined));\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t////// Keybinding Functions ///////\r\n\t///////////////////////////////////\r\n\r\n\tkeybindingNavigateNext(e){\r\n\t\tvar cell = this.currentCell,\r\n\t\tnewRow = this.options(\"tabEndNewRow\");\r\n\r\n\t\tif(cell){\r\n\t\t\tif(!this.navigateNext(cell, e)){\r\n\t\t\t\tif(newRow){\r\n\t\t\t\t\tcell.getElement().firstChild.blur();\r\n\r\n\t\t\t\t\tif(newRow === true){\r\n\t\t\t\t\t\tnewRow = this.table.addRow({})\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(typeof newRow == \"function\"){\r\n\t\t\t\t\t\t\tnewRow = this.table.addRow(newRow(cell.row.getComponent()))\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnewRow = this.table.addRow(Object.assign({}, newRow));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tnewRow.then(() => {\r\n\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\tcell.getComponent().navigateNext();\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Cell Functions //////////\r\n\t///////////////////////////////////\r\n\r\n\tcellisEdited(cell){\r\n\t\treturn !! cell.modules.edit && cell.modules.edit.edited;\r\n\t}\r\n\r\n\tcellCancelEdit(cell){\r\n\t\tif(cell === this.currentCell){\r\n\t\t\tthis.table.modules.edit.cancelEdit();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cancel Editor Error - This cell is not currently being edited \");\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\tclearCellEdited(cells){\r\n\t\tif(!cells){\r\n\t\t\tcells = this.table.modules.edit.getEditedCells();\r\n\t\t}\r\n\r\n\t\tif(!Array.isArray(cells)){\r\n\t\t\tcells = [cells];\r\n\t\t}\r\n\r\n\t\tcells.forEach((cell) => {\r\n\t\t\tthis.table.modules.edit.clearEdited(cell._getSelf());\r\n\t\t});\r\n\t}\r\n\r\n\tnavigatePrev(cell = this.currentCell, e){\r\n\t\tvar nextCell, prevRow;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tnextCell = this.navigateLeft();\r\n\r\n\t\t\tif(nextCell){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tprevRow = this.table.rowManager.prevDisplayRow(cell.row, true);\r\n\r\n\t\t\t\tif(prevRow){\r\n\t\t\t\t\tnextCell = this.findNextEditableCell(prevRow, prevRow.cells.length);\r\n\r\n\t\t\t\t\tif(nextCell){\r\n\t\t\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tnavigateNext(cell = this.currentCell, e){\r\n\t\tvar nextCell, nextRow;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tnextCell = this.navigateRight();\r\n\r\n\t\t\tif(nextCell){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tnextRow = this.table.rowManager.nextDisplayRow(cell.row, true);\r\n\r\n\t\t\t\tif(nextRow){\r\n\t\t\t\t\tnextCell = this.findNextEditableCell(nextRow, -1);\r\n\r\n\t\t\t\t\tif(nextCell){\r\n\t\t\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tnavigateLeft(cell = this.currentCell, e){\r\n\t\tvar index, nextCell;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextCell = this.findPrevEditableCell(cell.row, index);\r\n\r\n\t\t\tif(nextCell){\r\n\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tnavigateRight(cell = this.currentCell, e){\r\n\t\tvar index, nextCell;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextCell = this.findNextEditableCell(cell.row, index);\r\n\r\n\t\t\tif(nextCell){\r\n\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tnavigateUp(cell = this.currentCell, e){\r\n\t\tvar index, nextRow;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextRow = this.table.rowManager.prevDisplayRow(cell.row, true);\r\n\r\n\t\t\tif(nextRow){\r\n\t\t\t\tnextRow.cells[index].getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tnavigateDown(cell = this.currentCell, e){\r\n\t\tvar index, nextRow;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextRow = this.table.rowManager.nextDisplayRow(cell.row, true);\r\n\r\n\t\t\tif(nextRow){\r\n\t\t\t\tnextRow.cells[index].getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfindNextEditableCell(row, index){\r\n\t\tvar nextCell = false;\r\n\r\n\t\tif(index < row.cells.length-1){\r\n\t\t\tfor(var i = index+1; i < row.cells.length; i++){\r\n\t\t\t\tlet cell = row.cells[i];\r\n\r\n\t\t\t\tif(cell.column.modules.edit && Helpers.elVisible(cell.getElement())){\r\n\t\t\t\t\tlet allowEdit = true;\r\n\r\n\t\t\t\t\tif(typeof cell.column.modules.edit.check == \"function\"){\r\n\t\t\t\t\t\tallowEdit = cell.column.modules.edit.check(cell.getComponent());\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(allowEdit){\r\n\t\t\t\t\t\tnextCell = cell;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn nextCell;\r\n\t}\r\n\r\n\tfindPrevEditableCell(row, index){\r\n\t\tvar prevCell = false;\r\n\r\n\t\tif(index > 0){\r\n\t\t\tfor(var i = index-1; i >= 0; i--){\r\n\t\t\t\tlet cell = row.cells[i],\r\n\t\t\t\tallowEdit = true;\r\n\r\n\t\t\t\tif(cell.column.modules.edit && Helpers.elVisible(cell.getElement())){\r\n\t\t\t\t\tif(typeof cell.column.modules.edit.check == \"function\"){\r\n\t\t\t\t\t\tallowEdit = cell.column.modules.edit.check(cell.getComponent());\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(allowEdit){\r\n\t\t\t\t\t\tprevCell = cell;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn prevCell;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tinitializeColumnCheck(column){\r\n\t\tif(typeof column.definition.editor !== \"undefined\"){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\r\n\tcolumnDeleteCheck(column){\r\n\t\tif(this.currentCell && this.currentCell.column === column){\r\n\t\t\tthis.cancelEdit();\r\n\t\t}\r\n\t}\r\n\r\n\trowDeleteCheck(row){\r\n\t\tif(this.currentCell && this.currentCell.row === row){\r\n\t\t\tthis.cancelEdit();\r\n\t\t}\r\n\t}\r\n\r\n\t//initialize column editor\r\n\tinitializeColumn(column){\r\n\t\tvar self = this,\r\n\t\tconfig = {\r\n\t\t\teditor:false,\r\n\t\t\tblocked:false,\r\n\t\t\tcheck:column.definition.editable,\r\n\t\t\tparams:column.definition.editorParams || {}\r\n\t\t};\r\n\r\n\t\t//set column editor\r\n\t\tswitch(typeof column.definition.editor){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(this.editors[column.definition.editor]){\r\n\t\t\t\tconfig.editor = this.editors[column.definition.editor];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Editor Error - No such editor found: \", column.definition.editor);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tconfig.editor = column.definition.editor;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"boolean\":\r\n\t\t\tif(column.definition.editor === true){\r\n\t\t\t\tif(typeof column.definition.formatter !== \"function\"){\r\n\t\t\t\t\tif(this.editors[column.definition.formatter]){\r\n\t\t\t\t\t\tconfig.editor = this.editors[column.definition.formatter];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconfig.editor = this.editors[\"input\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Editor Error - Cannot auto lookup editor for a custom formatter: \", column.definition.formatter);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(config.editor){\r\n\t\t\tcolumn.modules.edit = config;\r\n\t\t}\r\n\t}\r\n\r\n\tgetCurrentCell(){\r\n\t\treturn this.currentCell ? this.currentCell.getComponent() : false;\r\n\t}\r\n\r\n\tclearEditor(cancel){\r\n\t\tvar cell = this.currentCell,\r\n\t\tcellEl;\r\n\r\n\t\tthis.invalidEdit = false;\r\n\r\n\t\tif(cell){\r\n\t\t\tthis.currentCell = false;\r\n\r\n\t\t\tcellEl = cell.getElement();\r\n\r\n\t\t\tthis.dispatch(\"edit-editor-clear\", cell, cancel);\r\n\r\n\t\t\tcellEl.classList.remove(\"tabulator-editing\");\r\n\r\n\t\t\twhile(cellEl.firstChild) cellEl.removeChild(cellEl.firstChild);\r\n\r\n\t\t\tcell.row.getElement().classList.remove(\"tabulator-row-editing\");\r\n\t\t}\r\n\t}\r\n\r\n\tcancelEdit(){\r\n\t\tif(this.currentCell){\r\n\t\t\tvar cell = this.currentCell;\r\n\t\t\tvar component = this.currentCell.getComponent();\r\n\r\n\t\t\tthis.clearEditor(true);\r\n\t\t\tcell.setValueActual(cell.getValue());\r\n\t\t\tcell.cellRendered();\r\n\r\n\t\t\tif(cell.column.definition.editor == \"textarea\" || cell.column.definition.variableHeight){\r\n\t\t\t\tcell.row.normalizeHeight(true);\r\n\t\t\t}\r\n\r\n\t\t\tif(cell.column.definition.cellEditCancelled){\r\n\t\t\t\tcell.column.definition.cellEditCancelled.call(this.table, component);\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatch(\"edit-cancelled\", cell);\r\n\t\t\tthis.dispatchExternal(\"cellEditCancelled\", component);\r\n\t\t}\r\n\t}\r\n\r\n\t//return a formatted value for a cell\r\n\tbindEditor(cell){\r\n\t\tif(cell.column.modules.edit){\r\n\t\t\tvar self = this,\r\n\t\t\telement = cell.getElement(true);\r\n\r\n\t\t\telement.setAttribute(\"tabindex\", 0);\r\n\r\n\t\t\telement.addEventListener(\"click\", function(e){\r\n\t\t\t\tif(!element.classList.contains(\"tabulator-editing\")){\r\n\t\t\t\t\telement.focus({preventScroll: true});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\telement.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif (e.button === 2) {\r\n\t\t\t\t\te.preventDefault();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself.mouseClick = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\telement.addEventListener(\"focus\", function(e){\r\n\t\t\t\tif(!self.recursionBlock){\r\n\t\t\t\t\tself.edit(cell, e, false);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tfocusCellNoEvent(cell, block){\r\n\t\tthis.recursionBlock = true;\r\n\r\n\t\tif(!(block && this.table.browser === \"ie\")){\r\n\t\t\tcell.getElement().focus({preventScroll: true});\r\n\t\t}\r\n\r\n\t\tthis.recursionBlock = false;\r\n\t}\r\n\r\n\teditCell(cell, forceEdit){\r\n\t\tthis.focusCellNoEvent(cell);\r\n\t\tthis.edit(cell, false, forceEdit);\r\n\t}\r\n\r\n\tfocusScrollAdjust(cell){\r\n\t\tif(this.table.rowManager.getRenderMode() == \"virtual\"){\r\n\t\t\tvar topEdge = this.table.rowManager.element.scrollTop,\r\n\t\t\tbottomEdge = this.table.rowManager.element.clientHeight + this.table.rowManager.element.scrollTop,\r\n\t\t\trowEl = cell.row.getElement(),\r\n\t\t\toffset = rowEl.offsetTop;\r\n\r\n\t\t\tif(rowEl.offsetTop < topEdge){\r\n\t\t\t\tthis.table.rowManager.element.scrollTop -= (topEdge - rowEl.offsetTop);\r\n\t\t\t}else{\r\n\t\t\t\tif(rowEl.offsetTop + rowEl.offsetHeight > bottomEdge){\r\n\t\t\t\t\tthis.table.rowManager.element.scrollTop += (rowEl.offsetTop + rowEl.offsetHeight - bottomEdge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar leftEdge = this.table.rowManager.element.scrollLeft,\r\n\t\t\trightEdge = this.table.rowManager.element.clientWidth + this.table.rowManager.element.scrollLeft,\r\n\t\t\tcellEl = cell.getElement(),\r\n\t\t\toffset = cellEl.offsetLeft;\r\n\r\n\t\t\tif(this.table.modExists(\"frozenColumns\")){\r\n\t\t\t\tleftEdge += parseInt(this.table.modules.frozenColumns.leftMargin);\r\n\t\t\t\trightEdge -= parseInt(this.table.modules.frozenColumns.rightMargin);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.options.renderHorizontal === \"virtual\"){\r\n\t\t\t\tleftEdge -= parseInt(this.table.columnManager.renderer.vDomPadLeft);\r\n\t\t\t\trightEdge -= parseInt(this.table.columnManager.renderer.vDomPadLeft);\r\n\t\t\t}\r\n\r\n\t\t\tif(cellEl.offsetLeft < leftEdge){\r\n\r\n\t\t\t\tthis.table.rowManager.element.scrollLeft -= (leftEdge - cellEl.offsetLeft);\r\n\t\t\t}else{\r\n\t\t\t\tif(cellEl.offsetLeft + cellEl.offsetWidth > rightEdge){\r\n\t\t\t\t\tthis.table.rowManager.element.scrollLeft += (cellEl.offsetLeft + cellEl.offsetWidth - rightEdge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tedit(cell, e, forceEdit){\r\n\t\tvar self = this,\r\n\t\tallowEdit = true,\r\n\t\trendered = function(){},\r\n\t\telement = cell.getElement(),\r\n\t\tcellEditor, component, params;\r\n\r\n\t\t//prevent editing if another cell is refusing to leave focus (eg. validation fail)\r\n\t\tif(this.currentCell){\r\n\t\t\tif(!this.invalidEdit){\r\n\t\t\t\tthis.cancelEdit();\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//handle successful value change\r\n\t\tfunction success(value){\r\n\t\t\tif(self.currentCell === cell){\r\n\t\t\t\tvar valid = self.chain(\"edit-success\", [cell, value], true, true);\r\n\r\n\t\t\t\tif(valid === true || self.table.options.validationMode === \"highlight\"){\r\n\t\t\t\t\tself.clearEditor();\r\n\r\n\r\n\t\t\t\t\tif(!cell.modules.edit){\r\n\t\t\t\t\t\tcell.modules.edit = {};\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tcell.modules.edit.edited = true;\r\n\r\n\t\t\t\t\tif(self.editedCells.indexOf(cell) == -1){\r\n\t\t\t\t\t\tself.editedCells.push(cell);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tcell.setValue(value, true);\r\n\r\n\t\t\t\t\treturn valid === true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself.invalidEdit = true;\r\n\t\t\t\t\tself.focusCellNoEvent(cell, true);\r\n\t\t\t\t\trendered();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t// console.warn(\"Edit Success Error - cannot call success on a cell that is no longer being edited\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//handle aborted edit\r\n\t\tfunction cancel(){\r\n\t\t\tif(self.currentCell === cell){\r\n\t\t\t\tself.cancelEdit();\r\n\t\t\t}else{\r\n\t\t\t\t// console.warn(\"Edit Success Error - cannot call cancel on a cell that is no longer being edited\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\trendered = callback;\r\n\t\t}\r\n\r\n\t\tif(!cell.column.modules.edit.blocked){\r\n\t\t\tif(e){\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t}\r\n\r\n\t\t\tswitch(typeof cell.column.modules.edit.check){\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tallowEdit = cell.column.modules.edit.check(cell.getComponent());\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\tallowEdit = cell.column.modules.edit.check;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(allowEdit || forceEdit){\r\n\r\n\t\t\t\tself.cancelEdit();\r\n\r\n\t\t\t\tself.currentCell = cell;\r\n\r\n\t\t\t\tthis.focusScrollAdjust(cell);\r\n\r\n\t\t\t\tcomponent = cell.getComponent();\r\n\r\n\t\t\t\tif(this.mouseClick){\r\n\t\t\t\t\tthis.mouseClick = false;\r\n\r\n\t\t\t\t\tif(cell.column.definition.cellClick){\r\n\t\t\t\t\t\tcell.column.definition.cellClick.call(this.table, e, component);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(cell.column.definition.cellEditing){\r\n\t\t\t\t\tcell.column.definition.cellEditing.call(this.table, component);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.dispatch(\"cell-editing\", cell);\r\n\t\t\t\tthis.dispatchExternal(\"cellEditing\", component);\r\n\r\n\t\t\t\tparams = typeof cell.column.modules.edit.params === \"function\" ? cell.column.modules.edit.params(component) : cell.column.modules.edit.params;\r\n\r\n\t\t\t\tcellEditor = cell.column.modules.edit.editor.call(self, component, onRendered, success, cancel, params);\r\n\r\n\t\t\t\t//if editor returned, add to DOM, if false, abort edit\r\n\t\t\t\tif(cellEditor !== false){\r\n\r\n\t\t\t\t\tif(cellEditor instanceof Node){\r\n\t\t\t\t\t\telement.classList.add(\"tabulator-editing\");\r\n\t\t\t\t\t\tcell.row.getElement().classList.add(\"tabulator-row-editing\");\r\n\t\t\t\t\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\t\t\t\t\telement.appendChild(cellEditor);\r\n\r\n\t\t\t\t\t\t//trigger onRendered Callback\r\n\t\t\t\t\t\trendered();\r\n\r\n\t\t\t\t\t\t//prevent editing from triggering rowClick event\r\n\t\t\t\t\t\tvar children = element.children;\r\n\r\n\t\t\t\t\t\tfor (var i = 0; i < children.length; i++) {\r\n\t\t\t\t\t\t\tchildren[i].addEventListener(\"click\", function(e){\r\n\t\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Edit Error - Editor should return an instance of Node, the editor returned:\", cellEditor);\r\n\t\t\t\t\t\telement.blur();\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.blur();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tthis.mouseClick = false;\r\n\t\t\t\telement.blur();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.mouseClick = false;\r\n\t\t\telement.blur();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tgetEditedCells(){\r\n\t\tvar output = [];\r\n\r\n\t\tthis.editedCells.forEach((cell) => {\r\n\t\t\toutput.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tclearEdited(cell){\r\n\t\tvar editIndex;\r\n\r\n\t\tif(cell.modules.edit && cell.modules.edit.edited){\r\n\t\t\tcell.modules.edit.edited = false;\r\n\r\n\t\t\tthis.dispatch(\"edit-edited-clear\", cell);\r\n\t\t}\r\n\r\n\t\teditIndex = this.editedCells.indexOf(cell);\r\n\r\n\t\tif(editIndex > -1){\r\n\t\t\tthis.editedCells.splice(editIndex, 1);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nEdit.moduleName = \"edit\";\r\n\r\n//load defaults\r\nEdit.editors = defaultEditors;\r\n\r\n\r\nexport default Edit;\r\n","class ExportRow{\r\n\tconstructor(type, columns, component, indent){\r\n\t\tthis.type = type;\r\n\t\tthis.columns = columns;\r\n\t\tthis.component = component || false;\r\n\t\tthis.indent = indent || 0;\r\n\t}\r\n}\r\n\r\nexport default ExportRow;","class ExportColumn{\r\n\tconstructor(value, component, width, height, depth){\r\n\t\tthis.value = value;\r\n\t\tthis.component = component || false;\r\n\t\tthis.width = width;\r\n\t\tthis.height = height;\r\n\t\tthis.depth = depth;\r\n\t}\r\n}\r\n\r\nexport default ExportColumn;","import Module from '../../core/Module.js';\r\n\r\nimport ExportRow from './ExportRow.js';\r\nimport ExportColumn from './ExportColumn.js';\r\n\r\nclass Export extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.config = {};\r\n\t\tthis.cloneTableStyle = true;\r\n\t\tthis.colVisProp = \"\";\r\n\r\n\t\tthis.registerTableOption(\"htmlOutputConfig\", false); //html outypu config\r\n\r\n\t\tthis.registerColumnOption(\"htmlOutput\");\r\n\t\tthis.registerColumnOption(\"titleHtmlOutput\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"getHtml\", this.getHtml.bind(this));\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tgenerateExportList(config, style, range, colVisProp){\r\n\t\tthis.cloneTableStyle = style;\r\n\t\tthis.config = config || {};\r\n\t\tthis.colVisProp = colVisProp;\r\n\r\n\t\tvar headers = this.config.columnHeaders !== false ? this.headersToExportRows(this.generateColumnGroupHeaders()) : [];\r\n\t\tvar body = this.bodyToExportRows(this.rowLookup(range));\r\n\r\n\t\treturn headers.concat(body);\r\n\t}\r\n\r\n\tgenereateTable(config, style, range, colVisProp){\r\n\t\tvar list = this.generateExportList(config, style, range, colVisProp);\r\n\r\n\t\treturn this.genereateTableElement(list);\r\n\t}\r\n\r\n\trowLookup(range){\r\n\t\tvar rows = [];\r\n\r\n\t\tif(typeof range == \"function\"){\r\n\t\t\trange.call(this.table).forEach((row) =>{\r\n\t\t\t\trow = this.table.rowManager.findRow(row);\r\n\r\n\t\t\t\tif(row){\r\n\t\t\t\t\trows.push(row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tswitch(range){\r\n\t\t\t\tcase true:\r\n\t\t\t\tcase \"visible\":\r\n\t\t\t\trows = this.table.rowManager.getVisibleRows(false, true);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"all\":\r\n\t\t\t\trows = this.table.rowManager.rows;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"selected\":\r\n\t\t\t\trows = this.table.modules.selectRow.selectedRows;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"active\":\r\n\t\t\t\tdefault:\r\n\t\t\t\tif(this.table.options.pagination){\r\n\t\t\t\t\trows = this.table.rowManager.getDisplayRows(this.table.rowManager.displayRows.length - 2);\r\n\t\t\t\t}else{\r\n\t\t\t\t\trows = this.table.rowManager.getDisplayRows();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Object.assign([], rows);\r\n\t}\r\n\r\n\tgenerateColumnGroupHeaders(){\r\n\t\tvar output = [];\r\n\r\n\t\tvar columns = this.config.columnGroups !== false ? this.table.columnManager.columns : this.table.columnManager.columnsByIndex;\r\n\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\tvar colData = this.processColumnGroup(column);\r\n\r\n\t\t\tif(colData){\r\n\t\t\t\toutput.push(colData);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tprocessColumnGroup(column){\r\n\t\tvar subGroups = column.columns,\r\n\t\tmaxDepth = 0,\r\n\t\ttitle = column.definition[\"title\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))] || column.definition.title;\r\n\r\n\t\tvar groupData = {\r\n\t\t\ttitle:title,\r\n\t\t\tcolumn:column,\r\n\t\t\tdepth:1,\r\n\t\t};\r\n\r\n\t\tif(subGroups.length){\r\n\t\t\tgroupData.subGroups = [];\r\n\t\t\tgroupData.width = 0;\r\n\r\n\t\t\tsubGroups.forEach((subGroup) => {\r\n\t\t\t\tvar subGroupData = this.processColumnGroup(subGroup);\r\n\r\n\t\t\t\tif(subGroupData){\r\n\t\t\t\t\tgroupData.width += subGroupData.width;\r\n\t\t\t\t\tgroupData.subGroups.push(subGroupData);\r\n\r\n\t\t\t\t\tif(subGroupData.depth > maxDepth){\r\n\t\t\t\t\t\tmaxDepth = subGroupData.depth;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tgroupData.depth += maxDepth;\r\n\r\n\t\t\tif(!groupData.width){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.columnVisCheck(column)){\r\n\t\t\t\tgroupData.width = 1;\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn groupData;\r\n\t}\r\n\r\n\tcolumnVisCheck(column){\r\n\t\treturn column.definition[this.colVisProp] !== false && (column.visible || (!column.visible && column.definition[this.colVisProp]));\r\n\t}\r\n\r\n\theadersToExportRows(columns){\r\n\t\tvar headers = [],\r\n\t\theaderDepth = 0,\r\n\t\texportRows = [];\r\n\r\n\t\tfunction parseColumnGroup(column, level){\r\n\r\n\t\t\tvar depth = headerDepth - level;\r\n\r\n\t\t\tif(typeof headers[level] === \"undefined\"){\r\n\t\t\t\theaders[level] = [];\r\n\t\t\t}\r\n\r\n\t\t\tcolumn.height = column.subGroups ? 1 : (depth - column.depth) + 1;\r\n\r\n\t\t\theaders[level].push(column);\r\n\r\n\t\t\tif(column.height > 1){\r\n\t\t\t\tfor(let i = 1; i < column.height; i ++){\r\n\r\n\t\t\t\t\tif(typeof headers[level + i] === \"undefined\"){\r\n\t\t\t\t\t\theaders[level + i] = [];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\theaders[level + i].push(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(column.width > 1){\r\n\t\t\t\tfor(let i = 1; i < column.width; i ++){\r\n\t\t\t\t\theaders[level].push(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(column.subGroups){\r\n\t\t\t\tcolumn.subGroups.forEach(function(subGroup){\r\n\t\t\t\t\tparseColumnGroup(subGroup, level+1);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//calculate maximum header debth\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tif(column.depth > headerDepth){\r\n\t\t\t\theaderDepth = column.depth;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tparseColumnGroup(column,0);\r\n\t\t});\r\n\r\n\t\theaders.forEach((header) => {\r\n\t\t\tvar columns = [];\r\n\r\n\t\t\theader.forEach((col) => {\r\n\t\t\t\tif(col){\r\n\t\t\t\t\tlet title = typeof col.title === \"undefined\" ? \"\" : col.title;\r\n\t\t\t\t\tcolumns.push(new ExportColumn(title, col.column.getComponent(), col.width, col.height, col.depth));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolumns.push(null);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\texportRows.push(new ExportRow(\"header\", columns));\r\n\t\t});\r\n\r\n\t\treturn exportRows;\r\n\t}\r\n\r\n\tbodyToExportRows(rows){\r\n\r\n\t\tvar columns = [];\r\n\t\tvar exportRows = [];\r\n\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tif (this.columnVisCheck(column)) {\r\n\t\t\t\tcolumns.push(column.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(this.config.columnCalcs !== false && this.table.modExists(\"columnCalcs\")){\r\n\t\t\tif(this.table.modules.columnCalcs.topInitialized){\r\n\t\t\t\trows.unshift(this.table.modules.columnCalcs.topRow);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modules.columnCalcs.botInitialized){\r\n\t\t\t\trows.push(this.table.modules.columnCalcs.botRow);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\trows = rows.filter((row) => {\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\treturn this.config.rowGroups !== false;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"calc\":\r\n\t\t\t\treturn this.config.columnCalcs !== false;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"row\":\r\n\t\t\t\treturn !(this.table.options.dataTree && this.config.dataTree === false && row.modules.dataTree.parent);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\trows.forEach((row, i) => {\r\n\t\t\tvar rowData = row.getData(this.colVisProp);\r\n\t\t\tvar exportCols = [];\r\n\t\t\tvar indent = 0;\r\n\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\tindent = row.level;\r\n\t\t\t\texportCols.push(new ExportColumn(row.key, row.getComponent(), columns.length, 1));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"calc\" :\r\n\t\t\t\tcase \"row\" :\r\n\t\t\t\tcolumns.forEach((col) => {\r\n\t\t\t\t\texportCols.push(new ExportColumn(col._column.getFieldValue(rowData), col, 1, 1));\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(this.table.options.dataTree && this.config.dataTree !== false){\r\n\t\t\t\t\tindent = row.modules.dataTree.index;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\texportRows.push(new ExportRow(row.type, exportCols, row.getComponent(), indent));\r\n\t\t});\r\n\r\n\t\treturn exportRows;\r\n\t}\r\n\r\n\tgenereateTableElement(list){\r\n\t\tvar table = document.createElement(\"table\"),\r\n\t\theaderEl = document.createElement(\"thead\"),\r\n\t\tbodyEl = document.createElement(\"tbody\"),\r\n\t\tstyles = this.lookupTableStyles(),\r\n\t\trowFormatter = this.table.options[\"rowFormatter\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))],\r\n\t\tsetup = {};\r\n\r\n\t\tsetup.rowFormatter = rowFormatter !== null ? rowFormatter : this.table.options.rowFormatter;\r\n\r\n\t\tif(this.table.options.dataTree &&this.config.dataTree !== false && this.table.modExists(\"columnCalcs\")){\r\n\t\t\tsetup.treeElementField = this.table.modules.dataTree.elementField;\r\n\t\t}\r\n\r\n\t\t//assign group header formatter\r\n\t\tsetup.groupHeader = this.table.options[\"groupHeader\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))];\r\n\r\n\t\tif(setup.groupHeader && !Array.isArray(setup.groupHeader)){\r\n\t\t\tsetup.groupHeader = [setup.groupHeader];\r\n\t\t}\r\n\r\n\t\ttable.classList.add(\"tabulator-print-table\");\r\n\r\n\t\tthis.mapElementStyles(this.table.columnManager.getHeadersElement(), headerEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"background-color\", \"color\", \"font-weight\", \"font-family\", \"font-size\"]);\r\n\r\n\r\n\t\tif(list.length > 1000){\r\n\t\t\tconsole.warn(\"It may take a long time to render an HTML table with more than 1000 rows\");\r\n\t\t}\r\n\r\n\t\tlist.forEach((row, i) => {\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"header\":\r\n\t\t\t\theaderEl.appendChild(this.genereateHeaderElement(row, setup, styles));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\tbodyEl.appendChild(this.genereateGroupElement(row, setup, styles));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"calc\":\r\n\t\t\t\tbodyEl.appendChild(this.genereateCalcElement(row, setup, styles));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"row\":\r\n\t\t\t\tlet rowEl = this.genereateRowElement(row, setup, styles);\r\n\t\t\t\tthis.mapElementStyles(((i % 2) && styles.evenRow) ? styles.evenRow : styles.oddRow, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\t\t\t\tbodyEl.appendChild(rowEl);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(headerEl.innerHTML){\r\n\t\t\ttable.appendChild(headerEl);\r\n\t\t}\r\n\r\n\t\ttable.appendChild(bodyEl);\r\n\r\n\r\n\t\tthis.mapElementStyles(this.table.element, table, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\"]);\r\n\t\treturn table;\r\n\t}\r\n\r\n\tlookupTableStyles(){\r\n\t\tvar styles = {};\r\n\r\n\t\t//lookup row styles\r\n\t\tif(this.cloneTableStyle && window.getComputedStyle){\r\n\t\t\tstyles.oddRow = this.table.element.querySelector(\".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.evenRow = this.table.element.querySelector(\".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.calcRow = this.table.element.querySelector(\".tabulator-row.tabulator-calcs\");\r\n\t\t\tstyles.firstRow = this.table.element.querySelector(\".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.firstGroup = this.table.element.getElementsByClassName(\"tabulator-group\")[0];\r\n\r\n\t\t\tif(styles.firstRow){\r\n\t\t\t\tstyles.styleCells = styles.firstRow.getElementsByClassName(\"tabulator-cell\");\r\n\t\t\t\tstyles.firstCell = styles.styleCells[0];\r\n\t\t\t\tstyles.lastCell = styles.styleCells[styles.styleCells.length - 1];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn styles;\r\n\t}\r\n\r\n\tgenereateHeaderElement(row, setup, styles){\r\n\t\tvar rowEl = document.createElement(\"tr\");\r\n\r\n\t\trow.columns.forEach((column) => {\r\n\t\t\tif(column){\r\n\t\t\t\tvar cellEl = document.createElement(\"th\");\r\n\t\t\t\tvar classNames = column.component._column.definition.cssClass ? column.component._column.definition.cssClass.split(\" \") : [];\r\n\r\n\t\t\t\tcellEl.colSpan = column.width;\r\n\t\t\t\tcellEl.rowSpan = column.height;\r\n\r\n\t\t\t\tcellEl.innerHTML = column.value;\r\n\r\n\t\t\t\tif(this.cloneTableStyle){\r\n\t\t\t\t\tcellEl.style.boxSizing = \"border-box\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\tclassNames.forEach(function(className) {\r\n\t\t\t\t\tcellEl.classList.add(className);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.mapElementStyles(column.component.getElement(), cellEl, [\"text-align\", \"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"background-color\", \"color\", \"font-weight\", \"font-family\", \"font-size\"]);\r\n\t\t\t\tthis.mapElementStyles(column.component._column.contentElement, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\"]);\r\n\r\n\t\t\t\tif(column.component._column.visible){\r\n\t\t\t\t\tthis.mapElementStyles(column.component.getElement(), cellEl, [\"width\"]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(column.component._column.definition.width){\r\n\t\t\t\t\t\tcellEl.style.width = column.component._column.definition.width + \"px\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(column.component._column.parent){\r\n\t\t\t\t\tthis.mapElementStyles(column.component._column.parent.groupElement, cellEl, [\"border-top\"]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowEl.appendChild(cellEl);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenereateGroupElement(row, setup, styles){\r\n\r\n\t\tvar rowEl = document.createElement(\"tr\"),\r\n\t\tcellEl = document.createElement(\"td\"),\r\n\t\tgroup = row.columns[0];\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-row\");\r\n\r\n\t\tif(setup.groupHeader && setup.groupHeader[row.indent]){\r\n\t\t\tgroup.value = setup.groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t}else{\r\n\t\t\tif(setup.groupHeader === false){\r\n\t\t\t\tgroup.value = group.value;\r\n\t\t\t}else{\r\n\t\t\t\tgroup.value = row.component._group.generator(group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcellEl.colSpan = group.width;\r\n\t\tcellEl.innerHTML = group.value;\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-group\");\r\n\t\trowEl.classList.add(\"tabulator-group-level-\" + row.indent);\r\n\r\n\t\tif(group.component.isVisible()){\r\n\t\t\trowEl.classList.add(\"tabulator-group-visible\");\r\n\t\t}\r\n\r\n\t\tthis.mapElementStyles(styles.firstGroup, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\t\tthis.mapElementStyles(styles.firstGroup, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\"]);\r\n\r\n\t\trowEl.appendChild(cellEl);\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenereateCalcElement(row, setup, styles){\r\n\t\tvar rowEl = this.genereateRowElement(row, setup, styles);\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-calcs\");\r\n\t\tthis.mapElementStyles(styles.calcRow, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenereateRowElement(row, setup, styles){\r\n\t\tvar rowEl = document.createElement(\"tr\");\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-row\");\r\n\r\n\t\trow.columns.forEach((col) => {\r\n\t\t\tif(col){\r\n\t\t\t\tvar cellEl = document.createElement(\"td\"),\r\n\t\t\t\tcolumn = col.component._column,\r\n\t\t\t\tindex = this.table.columnManager.findColumnIndex(column),\r\n\t\t\t\tvalue = col.value;\r\n\r\n\t\t\t\tvar cellWrapper = {\r\n\t\t\t\t\tmodules:{},\r\n\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetField:function(){\r\n\t\t\t\t\t\treturn column.definition.field;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\treturn cellEl;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetData:function(){\r\n\t\t\t\t\t\treturn row.component.getData();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\treturn row.component;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetComponent:function(){\r\n\t\t\t\t\t\treturn cellWrapper;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tcolumn:column,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tvar classNames = column.definition.cssClass ? column.definition.cssClass.split(\" \") : [];\r\n\r\n\t\t\t\tclassNames.forEach(function(className) {\r\n\t\t\t\t\tcellEl.classList.add(className);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(this.table.modExists(\"format\") && this.config.formatCells !== false){\r\n\t\t\t\t\tvalue = this.table.modules.format.formatExportValue(cellWrapper, this.colVisProp);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\tvalue = JSON.stringify(value);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\tcase \"null\":\r\n\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tvalue = value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(value instanceof Node){\r\n\t\t\t\t\tcellEl.appendChild(value);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcellEl.innerHTML = value;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(styles.styleCells[index] || styles.firstCell){\r\n\t\t\t\t\tthis.mapElementStyles(styles.styleCells[index] || styles.firstCell, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\", \"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"text-align\"]);\r\n\r\n\t\t\t\t\tif(column.definition.align){\r\n\t\t\t\t\t\tcellEl.style.textAlign = column.definition.align;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(this.table.options.dataTree && this.config.dataTree !== false){\r\n\t\t\t\t\tif((setup.treeElementField && setup.treeElementField == column.field) || (!setup.treeElementField && i == 0)){\r\n\t\t\t\t\t\tif(row.component._row.modules.dataTree.controlEl){\r\n\t\t\t\t\t\t\tcellEl.insertBefore(row.component._row.modules.dataTree.controlEl.cloneNode(true), cellEl.firstChild);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(row.component._row.modules.dataTree.branchEl){\r\n\t\t\t\t\t\t\tcellEl.insertBefore(row.component._row.modules.dataTree.branchEl.cloneNode(true), cellEl.firstChild);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowEl.appendChild(cellEl);\r\n\r\n\t\t\t\tif(cellWrapper.modules.format && cellWrapper.modules.format.renderedCallback){\r\n\t\t\t\t\tcellWrapper.modules.format.renderedCallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(setup.rowFormatter && this.config.formatCells !== false){\r\n\t\t\t\t\tsetup.rowFormatter(row.component);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenereateHTMLTable(list){\r\n\t\tvar holder = document.createElement(\"div\");\r\n\r\n\t\tholder.appendChild(this.genereateTableElement(list));\r\n\r\n\t\treturn holder.innerHTML;\r\n\t}\r\n\r\n\tgetHtml(visible, style, config, colVisProp){\r\n\t\tvar list = this.generateExportList(config || this.table.options.htmlOutputConfig, style, visible, colVisProp || \"htmlOutput\");\r\n\r\n\t\treturn this.genereateHTMLTable(list);\r\n\t}\r\n\r\n\tmapElementStyles(from, to, props){\r\n\t\tif(this.cloneTableStyle && from && to){\r\n\r\n\t\t\tvar lookup = {\r\n\t\t\t\t\"background-color\" : \"backgroundColor\",\r\n\t\t\t\t\"color\" : \"fontColor\",\r\n\t\t\t\t\"width\" : \"width\",\r\n\t\t\t\t\"font-weight\" : \"fontWeight\",\r\n\t\t\t\t\"font-family\" : \"fontFamily\",\r\n\t\t\t\t\"font-size\" : \"fontSize\",\r\n\t\t\t\t\"text-align\" : \"textAlign\",\r\n\t\t\t\t\"border-top\" : \"borderTop\",\r\n\t\t\t\t\"border-left\" : \"borderLeft\",\r\n\t\t\t\t\"border-right\" : \"borderRight\",\r\n\t\t\t\t\"border-bottom\" : \"borderBottom\",\r\n\t\t\t\t\"padding-top\" : \"paddingTop\",\r\n\t\t\t\t\"padding-left\" : \"paddingLeft\",\r\n\t\t\t\t\"padding-right\" : \"paddingRight\",\r\n\t\t\t\t\"padding-bottom\" : \"paddingBottom\",\r\n\t\t\t};\r\n\r\n\t\t\tif(window.getComputedStyle){\r\n\t\t\t\tvar fromStyle = window.getComputedStyle(from);\r\n\r\n\t\t\t\tprops.forEach(function(prop){\r\n\t\t\t\t\tto.style[lookup[prop]] = fromStyle.getPropertyValue(prop);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nExport.moduleName = \"export\";\r\n\r\nexport default Export;\r\n","export default {\r\n\r\n\t//equal to\r\n\t\"=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal == filterVal ? true : false;\r\n\t},\r\n\r\n\t//less than\r\n\t\"<\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal < filterVal ? true : false;\r\n\t},\r\n\r\n\t//less than or equal to\r\n\t\"<=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal <= filterVal ? true : false;\r\n\t},\r\n\r\n\t//greater than\r\n\t\">\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal > filterVal ? true : false;\r\n\t},\r\n\r\n\t//greater than or equal to\r\n\t\">=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal >= filterVal ? true : false;\r\n\t},\r\n\r\n\t//not equal to\r\n\t\"!=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal != filterVal ? true : false;\r\n\t},\r\n\r\n\t\"regex\":function(filterVal, rowVal, rowData, filterParams){\r\n\r\n\t\tif(typeof filterVal == \"string\"){\r\n\t\t\tfilterVal = new RegExp(filterVal);\r\n\t\t}\r\n\r\n\t\treturn filterVal.test(rowVal);\r\n\t},\r\n\r\n\t//contains the string\r\n\t\"like\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().indexOf(filterVal.toLowerCase()) > -1;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//contains the keywords\r\n\t\"keywords\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tvar keywords = filterVal.toLowerCase().split(typeof filterParams.separator === \"undefined\" ? \" \" : filterParams.separator),\r\n\t\tvalue = String(rowVal === null || typeof rowVal === \"undefined\" ? \"\" : rowVal).toLowerCase(),\r\n\t\tmatches = [];\r\n\r\n\t\tkeywords.forEach((keyword) =>{\r\n\t\t\tif(value.includes(keyword)){\r\n\t\t\t\tmatches.push(true);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn filterParams.matchAll ? matches.length === keywords.length : !!matches.length;\r\n\t},\r\n\r\n\t//starts with the string\r\n\t\"starts\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().startsWith(filterVal.toLowerCase());\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//ends with the string\r\n\t\"ends\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().endsWith(filterVal.toLowerCase());\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//in array\r\n\t\"in\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(Array.isArray(filterVal)){\r\n\t\t\treturn filterVal.length ? filterVal.indexOf(rowVal) > -1 : true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Filter Error - filter value is not an array:\", filterVal);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultFilters from './defaults/filters.js';\r\n\r\nclass Filter extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.filterList = []; //hold filter list\r\n\t\tthis.headerFilters = {}; //hold column filters\r\n\t\tthis.headerFilterColumns = []; //hold columns that use header filters\r\n\r\n\t\tthis.prevHeaderFilterChangeCheck = \"\";\r\n\t\tthis.prevHeaderFilterChangeCheck = \"{}\";\r\n\r\n\t\tthis.changed = false; //has filtering changed since last render\r\n\t\tthis.tableInitialized = false;\r\n\r\n\t\tthis.registerTableOption(\"filterMode\", \"local\"); //local or remote filtering\r\n\r\n\t\tthis.registerTableOption(\"initialFilter\", false); //initial filtering criteria\r\n\t\tthis.registerTableOption(\"initialHeaderFilter\", false); //initial header filtering criteria\r\n\t\tthis.registerTableOption(\"headerFilterLiveFilterDelay\", 300); //delay before updating column after user types in header filter\r\n\r\n\t\tthis.registerColumnOption(\"headerFilter\");\r\n\t\tthis.registerColumnOption(\"headerFilterPlaceholder\");\r\n\t\tthis.registerColumnOption(\"headerFilterParams\");\r\n\t\tthis.registerColumnOption(\"headerFilterEmptyCheck\");\r\n\t\tthis.registerColumnOption(\"headerFilterFunc\");\r\n\t\tthis.registerColumnOption(\"headerFilterFuncParams\");\r\n\t\tthis.registerColumnOption(\"headerFilterLiveFilter\");\r\n\r\n\t\tthis.registerTableFunction(\"searchRows\", this.searchRows.bind(this));\r\n\t\tthis.registerTableFunction(\"searchData\", this.searchData.bind(this));\r\n\r\n\t\tthis.registerTableFunction(\"setFilter\", this.userSetFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"refreshFilter\", this.userRefreshFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"addFilter\", this.userAddFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"getFilters\", this.getFilters.bind(this));\r\n\t\tthis.registerTableFunction(\"setHeaderFilterFocus\", this.userSetHeaderFilterFocus.bind(this));\r\n\t\tthis.registerTableFunction(\"getHeaderFilterValue\", this.userGetHeaderFilterValue.bind(this));\r\n\t\tthis.registerTableFunction(\"setHeaderFilterValue\", this.userSetHeaderFilterValue.bind(this));\r\n\t\tthis.registerTableFunction(\"getHeaderFilters\", this.getHeaderFilters.bind(this));\r\n\t\tthis.registerTableFunction(\"removeFilter\", this.userRemoveFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"clearFilter\", this.userClearFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"clearHeaderFilter\", this.userClearHeaderFilter.bind(this));\r\n\r\n\t\tthis.registerComponentFunction(\"column\", \"headerFilterFocus\", this.setHeaderFilterFocus.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"reloadHeaderFilter\", this.reloadHeaderFilter.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"getHeaderFilterValue\", this.getHeaderFilterValue.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"setHeaderFilterValue\", this.setHeaderFilterValue.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumnHeaderFilter.bind(this));\r\n\t\tthis.subscribe(\"column-width-fit-before\", this.hideHeaderFilterElements.bind(this));\r\n\t\tthis.subscribe(\"column-width-fit-after\", this.showHeaderFilterElements.bind(this));\r\n\t\tthis.subscribe(\"table-built\", this.tableBuilt.bind(this));\r\n\r\n\t\tif(this.table.options.filterMode === \"remote\"){\r\n\t\t\tthis.subscribe(\"data-params\", this.remoteFilterParams.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerDataHandler(this.filter.bind(this), 10);\r\n\t}\r\n\r\n\ttableBuilt(){\r\n\t\tif(this.table.options.initialFilter){\r\n\t\t\tthis.setFilter(this.table.options.initialFilter);\r\n\t\t}\r\n\r\n\t\tif(this.table.options.initialHeaderFilter){\r\n\t\t\tthis.table.options.initialHeaderFilter.forEach((item) => {\r\n\r\n\t\t\t\tvar column = this.table.columnManager.findColumn(item.field);\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tthis.setHeaderFilterValue(column, item.value);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", item.field);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.tableInitialized = true;\r\n\t}\r\n\r\n\tremoteFilterParams(data, config, silent, params){\r\n\t\tparams.filter = this.getFilters(true, true);\r\n\t\treturn params;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\t//set standard filters\r\n\tuserSetFilter(field, type, value, params){\r\n\t\tthis.setFilter(field, type, value, params);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//set standard filters\r\n\tuserRefreshFilter(){\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//add filter to array\r\n\tuserAddFilter(field, type, value, params){\r\n\t\tthis.addFilter(field, type, value, params);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\tuserSetHeaderFilterFocus(field){\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\tthis.setHeaderFilterFocus(column);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Focus Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tuserGetHeaderFilterValue(field) {\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\treturn this.getHeaderFilterValue(column);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", field);\r\n\t\t}\r\n\t}\r\n\r\n\tuserSetHeaderFilterValue(field, value){\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\tthis.setHeaderFilterValue(column, value);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//remove filter from array\r\n\tuserRemoveFilter(field, type, value){\r\n\t\tthis.removeFilter(field, type, value);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//clear filters\r\n\tuserClearFilter(all){\r\n\t\tthis.clearFilter(all);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//clear header filters\r\n\tuserClearHeaderFilter(){\r\n\t\tthis.clearHeaderFilter();\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\r\n\t//search for specific row components\r\n\tsearchRows(field, type, value){\r\n\t\treturn this.search(\"rows\", field, type, value);\r\n\t}\r\n\r\n\t//search for specific data\r\n\tsearchData(field, type, value){\r\n\t\treturn this.search(\"data\", field, type, value);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tinitializeColumnHeaderFilter(column){\r\n\t\tvar def = column.definition;\r\n\r\n\t\tif(def.headerFilter){\r\n\r\n\t\t\tif(typeof def.headerFilterPlaceholder !== \"undefined\" && def.field){\r\n\t\t\t\tthis.module(\"localize\").setHeaderFilterColumnPlaceholder(def.field, def.headerFilterPlaceholder);\r\n\t\t\t}\r\n\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\r\n\t//initialize column header filter\r\n\tinitializeColumn(column, value){\r\n\t\tvar self = this,\r\n\t\tfield = column.getField(),\r\n\t\tparams;\r\n\r\n\t\t//handle successfull value change\r\n\t\tfunction success(value){\r\n\t\t\tvar filterType = (column.modules.filter.tagType == \"input\" && column.modules.filter.attrType == \"text\") || column.modules.filter.tagType == \"textarea\" ? \"partial\" : \"match\",\r\n\t\t\ttype = \"\",\r\n\t\t\tfilterChangeCheck = \"\",\r\n\t\t\tfilterFunc;\r\n\r\n\t\t\tif(typeof column.modules.filter.prevSuccess === \"undefined\" || column.modules.filter.prevSuccess !== value){\r\n\r\n\t\t\t\tcolumn.modules.filter.prevSuccess = value;\r\n\r\n\t\t\t\tif(!column.modules.filter.emptyFunc(value)){\r\n\t\t\t\t\tcolumn.modules.filter.value = value;\r\n\r\n\t\t\t\t\tswitch(typeof column.definition.headerFilterFunc){\r\n\t\t\t\t\t\tcase \"string\":\r\n\t\t\t\t\t\tif(Filter.filters[column.definition.headerFilterFunc]){\r\n\t\t\t\t\t\t\ttype = column.definition.headerFilterFunc;\r\n\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\tvar params = column.definition.headerFilterFuncParams || {};\r\n\t\t\t\t\t\t\t\tvar fieldVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\t\tparams = typeof params === \"function\" ? params(value, fieldVal, data) : params;\r\n\r\n\t\t\t\t\t\t\t\treturn Filter.filters[column.definition.headerFilterFunc](value, fieldVal, data, params);\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tconsole.warn(\"Header Filter Error - Matching filter function not found: \", column.definition.headerFilterFunc);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"function\":\r\n\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\tvar params = column.definition.headerFilterFuncParams || {};\r\n\t\t\t\t\t\t\tvar fieldVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\tparams = typeof params === \"function\" ? params(value, fieldVal, data) : params;\r\n\r\n\t\t\t\t\t\t\treturn column.definition.headerFilterFunc(value, fieldVal, data, params);\r\n\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\ttype = filterFunc;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(!filterFunc){\r\n\t\t\t\t\t\tswitch(filterType){\r\n\t\t\t\t\t\t\tcase \"partial\":\r\n\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\tvar colVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\t\tif(typeof colVal !== 'undefined' && colVal !== null){\r\n\t\t\t\t\t\t\t\t\treturn String(colVal).toLowerCase().indexOf(String(value).toLowerCase()) > -1;\r\n\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\ttype = \"like\";\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\treturn column.getFieldValue(data) == value;\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\ttype = \"=\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tself.headerFilters[field] = {value:value, func:filterFunc, type:type, params:params || {}};\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdelete self.headerFilters[field];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcolumn.modules.filter.value = value;\r\n\r\n\t\t\t\tfilterChangeCheck = JSON.stringify(self.headerFilters);\r\n\r\n\t\t\t\tif(self.prevHeaderFilterChangeCheck !== filterChangeCheck){\r\n\t\t\t\t\tself.prevHeaderFilterChangeCheck = filterChangeCheck;\r\n\r\n\t\t\t\t\tself.trackChanges();\r\n\t\t\t\t\tself.refreshFilter();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tcolumn.modules.filter = {\r\n\t\t\tsuccess:success,\r\n\t\t\tattrType:false,\r\n\t\t\ttagType:false,\r\n\t\t\temptyFunc:false,\r\n\t\t};\r\n\r\n\t\tthis.generateHeaderFilterElement(column);\r\n\t}\r\n\r\n\tgenerateHeaderFilterElement(column, initialValue, reinitialize){\r\n\t\tvar self = this,\r\n\t\tsuccess = column.modules.filter.success,\r\n\t\tfield = column.getField(),\r\n\t\tfilterElement, editor, editorElement, cellWrapper, typingTimer, searchTrigger, params;\r\n\r\n\t\tcolumn.modules.filter.value = initialValue;\r\n\r\n\t\t//handle aborted edit\r\n\t\tfunction cancel(){}\r\n\r\n\t\tif(column.modules.filter.headerElement && column.modules.filter.headerElement.parentNode){\r\n\t\t\tcolumn.contentElement.removeChild(column.modules.filter.headerElement.parentNode);\r\n\t\t}\r\n\r\n\t\tif(field){\r\n\r\n\t\t\t//set empty value function\r\n\t\t\tcolumn.modules.filter.emptyFunc = column.definition.headerFilterEmptyCheck || function(value){\r\n\t\t\t\treturn !value && value !== \"0\" && value !== 0;\r\n\t\t\t};\r\n\r\n\t\t\tfilterElement = document.createElement(\"div\");\r\n\t\t\tfilterElement.classList.add(\"tabulator-header-filter\");\r\n\r\n\t\t\t//set column editor\r\n\t\t\tswitch(typeof column.definition.headerFilter){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tif(self.table.modules.edit.editors[column.definition.headerFilter]){\r\n\t\t\t\t\teditor = self.table.modules.edit.editors[column.definition.headerFilter];\r\n\r\n\t\t\t\t\tif((column.definition.headerFilter === \"tick\" || column.definition.headerFilter === \"tickCross\") && !column.definition.headerFilterEmptyCheck){\r\n\t\t\t\t\t\tcolumn.modules.filter.emptyFunc = function(value){\r\n\t\t\t\t\t\t\treturn value !== true && value !== false;\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Filter Error - Cannot build header filter, No such editor found: \", column.definition.editor);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\teditor = column.definition.headerFilter;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\tif(column.modules.edit && column.modules.edit.editor){\r\n\t\t\t\t\teditor = column.modules.edit.editor;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(column.definition.formatter && self.table.modules.edit.editors[column.definition.formatter]){\r\n\t\t\t\t\t\teditor = self.table.modules.edit.editors[column.definition.formatter];\r\n\r\n\t\t\t\t\t\tif((column.definition.formatter === \"tick\" || column.definition.formatter === \"tickCross\") && !column.definition.headerFilterEmptyCheck){\r\n\t\t\t\t\t\t\tcolumn.modules.filter.emptyFunc = function(value){\r\n\t\t\t\t\t\t\t\treturn value !== true && value !== false;\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\teditor = self.table.modules.edit.editors[\"input\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(editor){\r\n\r\n\t\t\t\tcellWrapper = {\r\n\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\treturn typeof initialValue !== \"undefined\" ? initialValue : \"\";\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetField:function(){\r\n\t\t\t\t\t\treturn column.definition.field;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\treturn filterElement;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tnormalizeHeight:function(){\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\r\n\t\t\t\tparams = column.definition.headerFilterParams || {};\r\n\r\n\t\t\t\tparams = typeof params === \"function\" ? params.call(self.table, cellWrapper) : params;\r\n\r\n\t\t\t\teditorElement = editor.call(this.table.modules.edit, cellWrapper, function(){}, success, cancel, params);\r\n\r\n\t\t\t\tif(!editorElement){\r\n\t\t\t\t\tconsole.warn(\"Filter Error - Cannot add filter to \" + field + \" column, editor returned a value of false\");\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!(editorElement instanceof Node)){\r\n\t\t\t\t\tconsole.warn(\"Filter Error - Cannot add filter to \" + field + \" column, editor should return an instance of Node, the editor returned:\", editorElement);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//set Placeholder Text\r\n\t\t\t\tif(field){\r\n\t\t\t\t\tself.langBind(\"headerFilters|columns|\" + column.definition.field, function(value){\r\n\t\t\t\t\t\teditorElement.setAttribute(\"placeholder\", typeof value !== \"undefined\" && value ? value : self.langText(\"headerFilters|default\"));\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself.langBind(\"headerFilters|default\", function(value){\r\n\t\t\t\t\t\teditorElement.setAttribute(\"placeholder\", value);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//focus on element on click\r\n\t\t\t\teditorElement.addEventListener(\"click\", function(e){\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\teditorElement.focus();\r\n\t\t\t\t});\r\n\r\n\t\t\t\teditorElement.addEventListener(\"focus\", (e) => {\r\n\t\t\t\t\tvar left = this.table.columnManager.element.scrollLeft;\r\n\r\n\t\t\t\t\tvar headerPos = this.table.rowManager.element.scrollLeft + parseInt(this.table.columnManager.element.style.marginLeft);\r\n\r\n\t\t\t\t\tif(left !== headerPos){\r\n\t\t\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\t\t\tthis.table.columnManager.scrollHorizontal(left);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\t//live update filters as user types\r\n\t\t\t\ttypingTimer = false;\r\n\r\n\t\t\t\tsearchTrigger = function(e){\r\n\t\t\t\t\tif(typingTimer){\r\n\t\t\t\t\t\tclearTimeout(typingTimer);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\ttypingTimer = setTimeout(function(){\r\n\t\t\t\t\t\tsuccess(editorElement.value);\r\n\t\t\t\t\t},self.table.options.headerFilterLiveFilterDelay);\r\n\t\t\t\t};\r\n\r\n\t\t\t\tcolumn.modules.filter.headerElement = editorElement;\r\n\t\t\t\tcolumn.modules.filter.attrType = editorElement.hasAttribute(\"type\") ? editorElement.getAttribute(\"type\").toLowerCase() : \"\" ;\r\n\t\t\t\tcolumn.modules.filter.tagType = editorElement.tagName.toLowerCase();\r\n\r\n\t\t\t\tif(column.definition.headerFilterLiveFilter !== false){\r\n\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\t!(\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === 'autocomplete' ||\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === 'tickCross' ||\r\n\t\t\t\t\t\t\t((column.definition.editor === 'autocomplete' ||\r\n\t\t\t\t\t\t\t\tcolumn.definition.editor === 'tickCross') &&\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === true)\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t) {\r\n\t\t\t\t\t\teditorElement.addEventListener(\"keyup\", searchTrigger);\r\n\t\t\t\t\teditorElement.addEventListener(\"search\", searchTrigger);\r\n\r\n\r\n\t\t\t\t\t//update number filtered columns on change\r\n\t\t\t\t\tif(column.modules.filter.attrType == \"number\"){\r\n\t\t\t\t\t\teditorElement.addEventListener(\"change\", function(e){\r\n\t\t\t\t\t\t\tsuccess(editorElement.value);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//change text inputs to search inputs to allow for clearing of field\r\n\t\t\t\t\tif(column.modules.filter.attrType == \"text\" && this.table.browser !== \"ie\"){\r\n\t\t\t\t\t\teditorElement.setAttribute(\"type\", \"search\");\r\n\t\t\t\t\t\t// editorElement.off(\"change blur\"); //prevent blur from triggering filter and preventing selection click\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t\t//prevent input and select elements from propegating click to column sorters etc\r\n\t\t\t\t\tif(column.modules.filter.tagType == \"input\" || column.modules.filter.tagType == \"select\" || column.modules.filter.tagType == \"textarea\"){\r\n\t\t\t\t\t\teditorElement.addEventListener(\"mousedown\",function(e){\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfilterElement.appendChild(editorElement);\r\n\r\n\t\t\t\tcolumn.contentElement.appendChild(filterElement);\r\n\r\n\t\t\t\tif(!reinitialize){\r\n\t\t\t\t\tself.headerFilterColumns.push(column);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Filter Error - Cannot add header filter, column has no field set:\", column.definition.title);\r\n\t\t}\r\n\t}\r\n\r\n\t//hide all header filter elements (used to ensure correct column widths in \"fitData\" layout mode)\r\n\thideHeaderFilterElements(){\r\n\t\tthis.headerFilterColumns.forEach(function(column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tcolumn.modules.filter.headerElement.style.display = 'none';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//show all header filter elements (used to ensure correct column widths in \"fitData\" layout mode)\r\n\tshowHeaderFilterElements(){\r\n\t\tthis.headerFilterColumns.forEach(function(column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tcolumn.modules.filter.headerElement.style.display = '';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//programatically set focus of header filter\r\n\tsetHeaderFilterFocus(column){\r\n\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\tcolumn.modules.filter.headerElement.focus();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Focus Error - No header filter set on column:\", column.getField());\r\n\t\t}\r\n\t}\r\n\r\n\t//programmatically get value of header filter\r\n\tgetHeaderFilterValue(column){\r\n\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\treturn column.modules.filter.value;\r\n\t\t} else {\r\n\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t}\r\n\t}\r\n\r\n\t//programatically set value of header filter\r\n\tsetHeaderFilterValue(column, value){\r\n\t\tif (column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tthis.generateHeaderFilterElement(column, value, true);\r\n\t\t\t\tcolumn.modules.filter.success(value);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treloadHeaderFilter(column){\r\n\t\tif (column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tthis.generateHeaderFilterElement(column, column.modules.filter.value, true);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trefreshFilter(){\r\n\t\tif(this.tableInitialized){\r\n\t\t\tif(this.table.options.filterMode === \"remote\"){\r\n\t\t\t\tthis.reloadData(null, false, false);\r\n\t\t\t}else{\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//TODO - Persist left position of row manager\r\n\t\t// left = this.scrollLeft;\r\n\t\t// this.scrollHorizontal(left);\r\n\t}\r\n\r\n\t//check if the filters has changed since last use\r\n\ttrackChanges(){\r\n\t\tthis.changed = true;\r\n\t\tthis.dispatch(\"filter-changed\");\r\n\t}\r\n\r\n\t//check if the filters has changed since last use\r\n\thasChanged(){\r\n\t\tvar changed = this.changed;\r\n\t\tthis.changed = false;\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t//set standard filters\r\n\tsetFilter(field, type, value, params){\r\n\t\tthis.filterList = [];\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value, params:params}];\r\n\t\t}\r\n\r\n\t\tthis.addFilter(field);\r\n\t}\r\n\r\n\t//add filter to array\r\n\taddFilter(field, type, value, params){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value, params:params}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\tthis.filterList.push(filter);\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.trackChanges();\r\n\t\t}\r\n\t}\r\n\r\n\tfindFilter(filter){\r\n\t\tvar column;\r\n\r\n\t\tif(Array.isArray(filter)){\r\n\t\t\treturn this.findSubFilters(filter);\r\n\t\t}\r\n\r\n\t\tvar filterFunc = false;\r\n\r\n\t\tif(typeof filter.field == \"function\"){\r\n\t\t\tfilterFunc = function(data){\r\n\t\t\t\treturn filter.field(data, filter.type || {})// pass params to custom filter function\r\n\t\t\t};\r\n\t\t}else{\r\n\r\n\t\t\tif(Filter.filters[filter.type]){\r\n\r\n\t\t\t\tcolumn = this.table.columnManager.getColumnByField(filter.field);\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\treturn Filter.filters[filter.type](filter.value, column.getFieldValue(data), data, filter.params || {});\r\n\t\t\t\t\t};\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\treturn Filter.filters[filter.type](filter.value, data[filter.field], data, filter.params || {});\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Filter Error - No such filter type found, ignoring: \", filter.type);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfilter.func = filterFunc;\r\n\r\n\t\treturn filter.func ? filter : false;\r\n\t}\r\n\r\n\tfindSubFilters(filters){\r\n\t\tvar output = [];\r\n\r\n\t\tfilters.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\toutput.push(filter);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output.length ? output : false;\r\n\t}\r\n\r\n\t//get all filters\r\n\tgetFilters(all, ajax){\r\n\t\tvar output = [];\r\n\r\n\t\tif(all){\r\n\t\t\toutput = this.getHeaderFilters();\r\n\t\t}\r\n\r\n\t\tif(ajax){\r\n\t\t\toutput.forEach(function(item){\r\n\t\t\t\tif(typeof item.type == \"function\"){\r\n\t\t\t\t\titem.type = \"function\";\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\toutput = output.concat(this.filtersToArray(this.filterList, ajax));\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//filter to Object\r\n\tfiltersToArray(filterList, ajax){\r\n\t\tvar output = [];\r\n\r\n\t\tfilterList.forEach((filter) => {\r\n\t\t\tvar item;\r\n\r\n\t\t\tif(Array.isArray(filter)){\r\n\t\t\t\toutput.push(this.filtersToArray(filter, ajax));\r\n\t\t\t}else{\r\n\t\t\t\titem = {field:filter.field, type:filter.type, value:filter.value}\r\n\r\n\t\t\t\tif(ajax){\r\n\t\t\t\t\tif(typeof item.type == \"function\"){\r\n\t\t\t\t\t\titem.type = \"function\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\toutput.push(item);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//get all filters\r\n\tgetHeaderFilters(){\r\n\t\tvar output = [];\r\n\r\n\t\tfor(var key in this.headerFilters){\r\n\t\t\toutput.push({field:key, type:this.headerFilters[key].type, value:this.headerFilters[key].value});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//remove filter from array\r\n\tremoveFilter(field, type, value){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tvar index = -1;\r\n\r\n\t\t\tif(typeof filter.field == \"object\"){\r\n\t\t\t\tindex = this.filterList.findIndex((element) => {\r\n\t\t\t\t\treturn filter === element;\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tindex = this.filterList.findIndex((element) => {\r\n\t\t\t\t\treturn filter.field === element.field && filter.type === element.type && filter.value === element.value;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.filterList.splice(index, 1);\r\n\t\t\t\tchanged = true;\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Filter Error - No matching filter type found, ignoring: \", filter.type);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//clear filters\r\n\tclearFilter(all){\r\n\t\tthis.filterList = [];\r\n\r\n\t\tif(all){\r\n\t\t\tthis.clearHeaderFilter();\r\n\t\t}\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//clear header filters\r\n\tclearHeaderFilter(){\r\n\t\tthis.headerFilters = {};\r\n\t\tthis.prevHeaderFilterChangeCheck = \"{}\";\r\n\r\n\t\tthis.headerFilterColumns.forEach((column) => {\r\n\t\t\tif(typeof column.modules.filter.value !== \"undefined\"){\r\n\t\t\t\tdelete column.modules.filter.value;\r\n\t\t\t}\r\n\t\t\tcolumn.modules.filter.prevSuccess = undefined;\r\n\t\t\tthis.reloadHeaderFilter(column);\r\n\t\t});\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//search data and return matching rows\r\n\tsearch (searchType, field, type, value){\r\n\t\tvar activeRows = [],\r\n\t\tfilterList = [];\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\tfilterList.push(filter);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\tvar match = true;\r\n\r\n\t\t\tfilterList.forEach((filter) => {\r\n\t\t\t\tif(!this.filterRecurse(filter, row.getData())){\r\n\t\t\t\t\tmatch = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tactiveRows.push(searchType === \"data\" ? row.getData(\"data\") : row.getComponent());\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t\treturn activeRows;\r\n\t}\r\n\r\n\t//filter row array\r\n\tfilter(rowList, filters){\r\n\t\tvar activeRows = [],\r\n\t\tactiveRowComponents = [];\r\n\r\n\t\tif(this.subscribedExternal(\"dataFiltering\")){\r\n\t\t\tthis.dispatchExternal(\"dataFiltering\", this.getFilters(true));\r\n\t\t}\r\n\r\n\t\tif(this.table.options.filterMode !== \"remote\" && (this.filterList.length || Object.keys(this.headerFilters).length)){\r\n\r\n\t\t\trowList.forEach((row) => {\r\n\t\t\t\tif(this.filterRow(row)){\r\n\t\t\t\t\tactiveRows.push(row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t}else{\r\n\t\t\tactiveRows = rowList.slice(0);\r\n\t\t}\r\n\r\n\t\tif(this.subscribedExternal(\"dataFiltered\")){\r\n\r\n\t\t\tactiveRows.forEach((row) => {\r\n\t\t\t\tactiveRowComponents.push(row.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatchExternal(\"dataFiltered\", this.getFilters(true), activeRowComponents);\r\n\t\t}\r\n\r\n\t\treturn activeRows;\r\n\t}\r\n\r\n\t//filter individual row\r\n\tfilterRow(row, filters){\r\n\t\tvar match = true,\r\n\t\tdata = row.getData();\r\n\r\n\t\tthis.filterList.forEach((filter) => {\r\n\t\t\tif(!this.filterRecurse(filter, data)){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\tfor(var field in this.headerFilters){\r\n\t\t\tif(!this.headerFilters[field].func(data)){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tfilterRecurse(filter, data){\r\n\t\tvar match = false;\r\n\r\n\t\tif(Array.isArray(filter)){\r\n\t\t\tfilter.forEach((subFilter) => {\r\n\t\t\t\tif(this.filterRecurse(subFilter, data)){\r\n\t\t\t\t\tmatch = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tmatch = filter.func(data);\r\n\t\t}\r\n\r\n\t\treturn match;\r\n\t}\r\n}\r\n\r\nFilter.moduleName = \"filter\";\r\n\r\n//load defaults\r\nFilter.filters = defaultFilters;\r\n\r\nexport default Filter;","import plaintext from './formatters/plaintext.js';\r\nimport html from './formatters/html.js';\r\nimport textarea from './formatters/textarea.js';\r\nimport money from './formatters/money.js';\r\nimport link from './formatters/link.js';\r\nimport image from './formatters/image.js';\r\nimport tickCross from './formatters/tickCross.js';\r\nimport datetime from './formatters/datetime.js';\r\nimport datetimediff from './formatters/datetimediff.js';\r\nimport lookup from './formatters/lookup.js';\r\nimport star from './formatters/star.js';\r\nimport traffic from './formatters/traffic.js';\r\nimport progress from './formatters/progress.js';\r\nimport color from './formatters/color.js';\r\nimport buttonTick from './formatters/buttonTick.js';\r\nimport buttonCross from './formatters/buttonCross.js';\r\nimport rownum from './formatters/rownum.js';\r\nimport handle from './formatters/handle.js';\r\nimport responsiveCollapse from './formatters/responsiveCollapse.js';\r\nimport rowSelection from './formatters/rowSelection.js';\r\n\r\nexport default {\r\n\tplaintext:plaintext,\r\n\thtml:html,\r\n\ttextarea:textarea,\r\n\tmoney:money,\r\n\tlink:link,\r\n\timage:image,\r\n\ttickCross:tickCross,\r\n\tdatetime:datetime,\r\n\tdatetimediff:datetimediff,\r\n\tlookup:lookup,\r\n\tstar:star,\r\n\ttraffic:traffic,\r\n\tprogress:progress,\r\n\tcolor:color,\r\n\tbuttonTick:buttonTick,\r\n\tbuttonCross:buttonCross,\r\n\trownum:rownum,\r\n\thandle:handle,\r\n\tresponsiveCollapse:responsiveCollapse,\r\n\trowSelection:rowSelection,\r\n};","export default function(cell, formatterParams, onRendered){\r\n\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n};","export default function(cell, formatterParams, onRendered){\r\n\treturn cell.getValue();\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().style.whiteSpace = \"pre-wrap\";\r\n\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar floatVal = parseFloat(cell.getValue()),\r\n\tsign = \"\",\r\n\tnumber, integer, decimal, rgx;\r\n\r\n\tvar decimalSym = formatterParams.decimal || \".\";\r\n\tvar thousandSym = formatterParams.thousand || \",\";\r\n\tvar negativeSign = formatterParams.negativeSign || \"-\";\r\n\tvar symbol = formatterParams.symbol || \"\";\r\n\tvar after = !!formatterParams.symbolAfter;\r\n\tvar precision = typeof formatterParams.precision !== \"undefined\" ? formatterParams.precision : 2;\r\n\r\n\tif(isNaN(floatVal)){\r\n\t\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n\t}\r\n\r\n\tif(floatVal < 0){\r\n\t\tfloatVal = Math.abs(floatVal);\r\n\t\tsign = negativeSign;\r\n\t}\r\n\r\n\tnumber = precision !== false ? floatVal.toFixed(precision) : floatVal;\r\n\tnumber = String(number).split(\".\");\r\n\r\n\tinteger = number[0];\r\n\tdecimal = number.length > 1 ? decimalSym + number[1] : \"\";\r\n\r\n\tif (formatterParams.thousand !== false) {\r\n\t\trgx = /(\\d+)(\\d{3})/;\r\n\r\n\t\twhile (rgx.test(integer)){\r\n\t\t\tinteger = integer.replace(rgx, \"$1\" + thousandSym + \"$2\");\r\n\t\t}\r\n\t}\r\n\r\n\treturn after ? sign + integer + decimal + symbol : sign + symbol + integer + decimal;\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\turlPrefix = formatterParams.urlPrefix || \"\",\r\n\tdownload = formatterParams.download,\r\n\tlabel = value,\r\n\tel = document.createElement(\"a\"),\r\n\tdata;\r\n\r\n\tfunction labelTraverse(path, data){\r\n\t\tvar item = path.shift(),\r\n\t\tvalue = data[item];\r\n\t\t\r\n\t\tif(path.length && typeof value === \"object\"){\r\n\t\t\treturn labelTraverse(path, value);\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t};\r\n\r\n\tif(formatterParams.labelField){\r\n\t\tdata = cell.getData();\r\n\t\tlabel = labelTraverse(formatterParams.labelField.split(this.table.options.nestedFieldSeparator), data);\r\n\t}\r\n\r\n\tif(formatterParams.label){\r\n\t\tswitch(typeof formatterParams.label){\r\n\t\t\tcase \"string\":\r\n\t\t\tlabel = formatterParams.label;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tlabel = formatterParams.label(cell);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif(label){\r\n\t\tif(formatterParams.urlField){\r\n\t\t\tdata = cell.getData();\r\n\t\t\tvalue = data[formatterParams.urlField];\r\n\t\t}\r\n\r\n\t\tif(formatterParams.url){\r\n\t\t\tswitch(typeof formatterParams.url){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tvalue = formatterParams.url;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tvalue = formatterParams.url(cell);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tel.setAttribute(\"href\", urlPrefix + value);\r\n\r\n\t\tif(formatterParams.target){\r\n\t\t\tel.setAttribute(\"target\", formatterParams.target);\r\n\t\t}\r\n\r\n\t\tif(formatterParams.download){\r\n\r\n\t\t\tif(typeof download == \"function\"){\r\n\t\t\t\tdownload = download(cell);\r\n\t\t\t}else{\r\n\t\t\t\tdownload = download === true ? \"\" : download;\r\n\t\t\t}\r\n\r\n\t\t\tel.setAttribute(\"download\", download);\r\n\t\t}\r\n\r\n\t\tel.innerHTML = this.emptyToSpace(this.sanitizeHTML(label));\r\n\r\n\t\treturn el;\r\n\t}else{\r\n\t\treturn \" \";\r\n\t}\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar el = document.createElement(\"img\"),\r\n\tsrc = cell.getValue();\r\n\r\n\tif(formatterParams.urlPrefix){\r\n\t\tsrc = formatterParams.urlPrefix + cell.getValue();\r\n\t}\r\n\r\n\tif(formatterParams.urlSuffix){\r\n\t\tsrc = src + formatterParams.urlSuffix;\r\n\t}\r\n\r\n\tel.setAttribute(\"src\", src);\r\n\r\n\tswitch(typeof formatterParams.height){\r\n\t\tcase \"number\":\r\n\t\tel.style.height = formatterParams.height + \"px\";\r\n\t\tbreak;\r\n\r\n\t\tcase \"string\":\r\n\t\tel.style.height = formatterParams.height;\r\n\t\tbreak;\r\n\t}\r\n\r\n\tswitch(typeof formatterParams.width){\r\n\t\tcase \"number\":\r\n\t\tel.style.width = formatterParams.width + \"px\";\r\n\t\tbreak;\r\n\r\n\t\tcase \"string\":\r\n\t\tel.style.width = formatterParams.width;\r\n\t\tbreak;\r\n\t}\r\n\r\n\tel.addEventListener(\"load\", function(){\r\n\t\tcell.getRow().normalizeHeight();\r\n\t});\r\n\r\n\treturn el;\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\telement = cell.getElement(),\r\n\tempty = formatterParams.allowEmpty,\r\n\ttruthy = formatterParams.allowTruthy,\r\n\ttrueValueSet = Object.keys(formatterParams).includes(\"trueValue\"),\r\n\ttick = typeof formatterParams.tickElement !== \"undefined\" ? formatterParams.tickElement : '',\r\n\tcross = typeof formatterParams.crossElement !== \"undefined\" ? formatterParams.crossElement : '';\r\n\r\n\tif((trueValueSet && value === formatterParams.trueValue) || (!trueValueSet && ((truthy && value) || (value === true || value === \"true\" || value === \"True\" || value === 1 || value === \"1\")))){\r\n\t\telement.setAttribute(\"aria-checked\", true);\r\n\t\treturn tick || \"\";\r\n\t}else{\r\n\t\tif(empty && (value === \"null\" || value === \"\" || value === null || typeof value === \"undefined\")){\r\n\t\t\telement.setAttribute(\"aria-checked\", \"mixed\");\r\n\t\t\treturn \"\";\r\n\t\t}else{\r\n\t\t\telement.setAttribute(\"aria-checked\", false);\r\n\t\t\treturn cross || \"\";\r\n\t\t}\r\n\t}\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar inputFormat = formatterParams.inputFormat || \"yyyy-MM-dd HH:mm:ss\";\r\n\tvar\toutputFormat = formatterParams.outputFormat || \"dd/MM/yyyy HH:mm:ss\";\r\n\tvar\tinvalid = typeof formatterParams.invalidPlaceholder !== \"undefined\" ? formatterParams.invalidPlaceholder : \"\";\r\n\tvar value = cell.getValue();\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tvar newDatetime;\r\n\r\n\t\tif(DT.isDateTime(value)){\r\n\t\t\t newDatetime = value;\r\n\t\t }else if(inputFormat === \"iso\"){\r\n\t\t\t newDatetime = DT.fromISO(String(value));\r\n\t\t }else{\r\n\t\t\t newDatetime = DT.fromFormat(String(value), inputFormat);\r\n\t\t }\r\n\r\n\t\tif(newDatetime.isValid){\r\n\t\t\tif(formatterParams.timezone){\r\n\t\t\t\tnewDatetime = newDatetime.setZone(formatterParams.timezone);\r\n\t\t\t}\r\n\r\n\t\t\treturn newDatetime.toFormat(outputFormat);\r\n\t\t}else{\r\n\t\t\tif(invalid === true || !value){\r\n\t\t\t\treturn value;\r\n\t\t\t}else if(typeof invalid === \"function\"){\r\n\t\t\t\treturn invalid(value);\r\n\t\t\t}else{\r\n\t\t\t\treturn invalid;\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tconsole.error(\"Format Error - 'datetime' formatter is dependant on luxon.js\");\r\n\t}\r\n};","export default function (cell, formatterParams, onRendered) {\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar inputFormat = formatterParams.inputFormat || \"yyyy-MM-dd HH:mm:ss\";\r\n\tvar invalid = typeof formatterParams.invalidPlaceholder !== \"undefined\" ? formatterParams.invalidPlaceholder : \"\";\r\n\tvar suffix = typeof formatterParams.suffix !== \"undefined\" ? formatterParams.suffix : false;\r\n\tvar unit = typeof formatterParams.unit !== \"undefined\" ? formatterParams.unit : \"days\";\r\n\tvar humanize = typeof formatterParams.humanize !== \"undefined\" ? formatterParams.humanize : false;\r\n\tvar date = typeof formatterParams.date !== \"undefined\" ? formatterParams.date : DT.now();\r\n\tvar value = cell.getValue();\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tvar newDatetime;\r\n\r\n\t\tif(DT.isDateTime(value)){\r\n\t\t\t newDatetime = value;\r\n\t\t }else if(inputFormat === \"iso\"){\r\n\t\t\t newDatetime = DT.fromISO(String(value));\r\n\t\t }else{\r\n\t\t\t newDatetime = DT.fromFormat(String(value), inputFormat);\r\n\t\t }\r\n\r\n\t\tif (newDatetime.isValid){\r\n\t\t\tif(humanize){\r\n\t\t\t\treturn newDatetime.diff(date, unit).toHuman() + (suffix ? \" \" + suffix : \"\");\r\n\t\t\t}else{\r\n\t\t\t\treturn parseInt(newDatetime.diff(date, unit)[unit]) + (suffix ? \" \" + suffix : \"\");\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\tif (invalid === true) {\r\n\t\t\t\treturn value;\r\n\t\t\t} else if (typeof invalid === \"function\") {\r\n\t\t\t\treturn invalid(value);\r\n\t\t\t} else {\r\n\t\t\t\treturn invalid;\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tconsole.error(\"Format Error - 'datetimediff' formatter is dependant on luxon.js\");\r\n\t}\r\n};","export default function (cell, formatterParams, onRendered) {\r\n\tvar value = cell.getValue();\r\n\r\n\tif (typeof formatterParams[value] === \"undefined\") {\r\n\t\tconsole.warn('Missing display value for ' + value);\r\n\t\treturn value;\r\n\t}\r\n\r\n\treturn formatterParams[value];\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\telement = cell.getElement(),\r\n\tmaxStars = formatterParams && formatterParams.stars ? formatterParams.stars : 5,\r\n\tstars = document.createElement(\"span\"),\r\n\tstar = document.createElementNS('http://www.w3.org/2000/svg', \"svg\"),\r\n\tstarActive = '',\r\n\tstarInactive = '';\r\n\r\n\t//style stars holder\r\n\tstars.style.verticalAlign = \"middle\";\r\n\r\n\t//style star\r\n\tstar.setAttribute(\"width\", \"14\");\r\n\tstar.setAttribute(\"height\", \"14\");\r\n\tstar.setAttribute(\"viewBox\", \"0 0 512 512\");\r\n\tstar.setAttribute(\"xml:space\", \"preserve\");\r\n\tstar.style.padding = \"0 1px\";\r\n\r\n\tvalue = value && !isNaN(value) ? parseInt(value) : 0;\r\n\r\n\tvalue = Math.max(0, Math.min(value, maxStars));\r\n\r\n\tfor(var i=1;i<= maxStars;i++){\r\n\t\tvar nextStar = star.cloneNode(true);\r\n\t\tnextStar.innerHTML = i <= value ? starActive : starInactive;\r\n\r\n\t\tstars.appendChild(nextStar);\r\n\t}\r\n\r\n\telement.style.whiteSpace = \"nowrap\";\r\n\telement.style.overflow = \"hidden\";\r\n\telement.style.textOverflow = \"ellipsis\";\r\n\r\n\telement.setAttribute(\"aria-label\", value);\r\n\r\n\treturn stars;\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar value = this.sanitizeHTML(cell.getValue()) || 0,\r\n\tel = document.createElement(\"span\"),\r\n\tmax = formatterParams && formatterParams.max ? formatterParams.max : 100,\r\n\tmin = formatterParams && formatterParams.min ? formatterParams.min : 0,\r\n\tcolors = formatterParams && typeof formatterParams.color !== \"undefined\" ? formatterParams.color : [\"red\", \"orange\", \"green\"],\r\n\tcolor = \"#666666\",\r\n\tpercent, percentValue;\r\n\r\n\tif(isNaN(value) || typeof cell.getValue() === \"undefined\"){\r\n\t\treturn;\r\n\t}\r\n\r\n\tel.classList.add(\"tabulator-traffic-light\");\r\n\r\n\t//make sure value is in range\r\n\tpercentValue = parseFloat(value) <= max ? parseFloat(value) : max;\r\n\tpercentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min;\r\n\r\n\t//workout percentage\r\n\tpercent = (max - min) / 100;\r\n\tpercentValue = Math.round((percentValue - min) / percent);\r\n\r\n\t//set color\r\n\tswitch(typeof colors){\r\n\t\tcase \"string\":\r\n\t\tcolor = colors;\r\n\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\tcolor = colors(value);\r\n\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\tif(Array.isArray(colors)){\r\n\t\t\tvar unit = 100 / colors.length;\r\n\t\t\tvar index = Math.floor(percentValue / unit);\r\n\r\n\t\t\tindex = Math.min(index, colors.length - 1);\r\n\t\t\tindex = Math.max(index, 0);\r\n\t\t\tcolor = colors[index];\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tel.style.backgroundColor = color;\r\n\r\n\treturn el;\r\n};","import CellComponent from '../../../../core/cell/CellComponent.js';\r\n\r\nexport default function(cell, formatterParams, onRendered){ //progress bar\r\n\tvar value = this.sanitizeHTML(cell.getValue()) || 0,\r\n\telement = cell.getElement(),\r\n\tmax = formatterParams && formatterParams.max ? formatterParams.max : 100,\r\n\tmin = formatterParams && formatterParams.min ? formatterParams.min : 0,\r\n\tlegendAlign = formatterParams && formatterParams.legendAlign ? formatterParams.legendAlign : \"center\",\r\n\tpercent, percentValue, color, legend, legendColor, top, left, right, bottom;\r\n\r\n\t//make sure value is in range\r\n\tpercentValue = parseFloat(value) <= max ? parseFloat(value) : max;\r\n\tpercentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min;\r\n\r\n\t//workout percentage\r\n\tpercent = (max - min) / 100;\r\n\tpercentValue = Math.round((percentValue - min) / percent);\r\n\r\n\t//set bar color\r\n\tswitch(typeof formatterParams.color){\r\n\t\tcase \"string\":\r\n\t\tcolor = formatterParams.color;\r\n\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\tcolor = formatterParams.color(value);\r\n\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\tif(Array.isArray(formatterParams.color)){\r\n\t\t\tvar unit = 100 / formatterParams.color.length;\r\n\t\t\tvar index = Math.floor(percentValue / unit);\r\n\r\n\t\t\tindex = Math.min(index, formatterParams.color.length - 1);\r\n\t\t\tindex = Math.max(index, 0);\r\n\t\t\tcolor = formatterParams.color[index];\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tdefault:\r\n\t\tcolor = \"#2DC214\";\r\n\t}\r\n\r\n\t//generate legend\r\n\tswitch(typeof formatterParams.legend){\r\n\t\tcase \"string\":\r\n\t\tlegend = formatterParams.legend;\r\n\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\tlegend = formatterParams.legend(value);\r\n\t\tbreak;\r\n\t\tcase \"boolean\":\r\n\t\tlegend = value;\r\n\t\tbreak;\r\n\t\tdefault:\r\n\t\tlegend = false;\r\n\t}\r\n\r\n\t//set legend color\r\n\tswitch(typeof formatterParams.legendColor){\r\n\t\tcase \"string\":\r\n\t\tlegendColor = formatterParams.legendColor;\r\n\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\tlegendColor = formatterParams.legendColor(value);\r\n\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\tif(Array.isArray(formatterParams.legendColor)){\r\n\t\t\tvar unit = 100 / formatterParams.legendColor.length;\r\n\t\t\tvar index = Math.floor(percentValue / unit);\r\n\r\n\t\t\tindex = Math.min(index, formatterParams.legendColor.length - 1);\r\n\t\t\tindex = Math.max(index, 0);\r\n\t\t\tlegendColor = formatterParams.legendColor[index];\r\n\t\t}\r\n\t\tbreak;\r\n\t\tdefault:\r\n\t\tlegendColor = \"#000\";\r\n\t}\r\n\r\n\telement.style.minWidth = \"30px\";\r\n\telement.style.position = \"relative\";\r\n\r\n\telement.setAttribute(\"aria-label\", percentValue);\r\n\r\n\tvar barEl = document.createElement(\"div\");\r\n\tbarEl.style.display = \"inline-block\";\r\n\tbarEl.style.position = \"absolute\";\r\n\tbarEl.style.width = percentValue + \"%\";\r\n\tbarEl.style.backgroundColor = color;\r\n\tbarEl.style.height = \"100%\";\r\n\r\n\tbarEl.setAttribute('data-max', max);\r\n\tbarEl.setAttribute('data-min', min);\r\n\r\n\tvar barContainer = document.createElement(\"div\");\r\n\tbarContainer.style.position = \"relative\";\r\n\tbarContainer.style.width = \"100%\";\r\n\tbarContainer.style.height = \"100%\";\r\n\r\n\tif(legend){\r\n\t\tvar legendEl = document.createElement(\"div\");\r\n\t\tlegendEl.style.position = \"absolute\";\r\n\t\tlegendEl.style.top = 0;\r\n\t\tlegendEl.style.left = 0;\r\n\t\tlegendEl.style.textAlign = legendAlign;\r\n\t\tlegendEl.style.width = \"100%\";\r\n\t\tlegendEl.style.color = legendColor;\r\n\t\tlegendEl.innerHTML = legend;\r\n\t}\r\n\r\n\tonRendered(function(){\r\n\r\n\t\t//handle custom element needed if formatter is to be included in printed/downloaded output\r\n\t\tif(!(cell instanceof CellComponent)){\r\n\t\t\tvar holderEl = document.createElement(\"div\");\r\n\t\t\tholderEl.style.position = \"absolute\";\r\n\t\t\tholderEl.style.top = \"4px\";\r\n\t\t\tholderEl.style.bottom = \"4px\";\r\n\t\t\tholderEl.style.left = \"4px\";\r\n\t\t\tholderEl.style.right = \"4px\";\r\n\r\n\t\t\telement.appendChild(holderEl);\r\n\r\n\t\t\telement = holderEl;\r\n\t\t}\r\n\r\n\t\telement.appendChild(barContainer);\r\n\t\tbarContainer.appendChild(barEl);\r\n\r\n\t\tif(legend){\r\n\t\t\tbarContainer.appendChild(legendEl);\r\n\t\t}\r\n\t});\r\n\r\n\treturn \"\";\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().style.backgroundColor = this.sanitizeHTML(cell.getValue());\r\n\treturn \"\";\r\n};","export default function(cell, formatterParams, onRendered){\r\n\treturn '';\r\n};","export default function(cell, formatterParams, onRendered){\r\n\treturn '';\r\n};","export default function(cell, formatterParams, onRendered){\r\n\treturn this.table.rowManager.activeRows.indexOf(cell.getRow()._getSelf()) + 1 || \"\";\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().classList.add(\"tabulator-row-handle\");\r\n\treturn \"
\";\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar open = false,\r\n\tel = document.createElement(\"div\"),\r\n\tconfig = cell.getRow()._row.modules.responsiveLayout;\r\n\r\n\tel.classList.add(\"tabulator-responsive-collapse-toggle\");\r\n\tel.innerHTML = \"+-\";\r\n\r\n\tcell.getElement().classList.add(\"tabulator-row-handle\");\r\n\r\n\tfunction toggleList(isOpen){\r\n\t\tvar collapseEl = config.element;\r\n\r\n\t\tconfig.open = isOpen;\r\n\r\n\t\tif(collapseEl){\r\n\r\n\t\t\tif(config.open){\r\n\t\t\t\tel.classList.add(\"open\");\r\n\t\t\t\tcollapseEl.style.display = '';\r\n\t\t\t}else{\r\n\t\t\t\tel.classList.remove(\"open\");\r\n\t\t\t\tcollapseEl.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tel.addEventListener(\"click\", function(e){\r\n\t\te.stopImmediatePropagation();\r\n\t\ttoggleList(!config.open);\r\n\t});\r\n\r\n\ttoggleList(config.open);\r\n\r\n\treturn el;\r\n};","import RowComponent from '../../../../core/row/RowComponent.js';\r\n\r\nexport default function(cell, formatterParams, onRendered){\r\n\tvar checkbox = document.createElement(\"input\");\r\n\tvar blocked = false;\r\n\r\n\tcheckbox.type = 'checkbox';\r\n\r\n\tcheckbox.setAttribute(\"aria-label\", \"Select Row\");\r\n\t\r\n\tif(this.table.modExists(\"selectRow\", true)){\r\n\r\n\t\tcheckbox.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tif(typeof cell.getRow == 'function'){\r\n\t\t\tvar row = cell.getRow();\r\n\r\n\t\t\tif(row instanceof RowComponent){\r\n\r\n\t\t\t\tcheckbox.addEventListener(\"change\", (e) => {\r\n\t\t\t\t\tif(this.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\t\tif(!blocked){\r\n\t\t\t\t\t\t\trow.toggleSelect();\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tblocked = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trow.toggleSelect();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(this.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\tcheckbox.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\tblocked = true;\r\n\t\t\t\t\t\tthis.table.modules.selectRow.handleComplexRowClick(row._row, e);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcheckbox.checked = row.isSelected && row.isSelected();\r\n\t\t\t\tthis.table.modules.selectRow.registerRowSelectCheckbox(row, checkbox);\r\n\t\t\t}else{\r\n\t\t\t\tcheckbox = \"\";\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\tcheckbox.addEventListener(\"change\", (e) => {\r\n\t\t\t\tif(this.table.modules.selectRow.selectedRows.length){\r\n\t\t\t\t\tthis.table.deselectRow();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis.table.selectRow(formatterParams.rowRange);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.table.modules.selectRow.registerHeaderSelectCheckbox(checkbox);\r\n\t\t}\r\n\t}\r\n\r\n\treturn checkbox;\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultFormatters from './defaults/formatters.js';\r\n\r\nclass Format extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.registerColumnOption(\"formatter\");\r\n\t\tthis.registerColumnOption(\"formatterParams\");\r\n\r\n\t\tthis.registerColumnOption(\"formatterPrint\");\r\n\t\tthis.registerColumnOption(\"formatterPrintParams\");\r\n\t\tthis.registerColumnOption(\"formatterClipboard\");\r\n\t\tthis.registerColumnOption(\"formatterClipboardParams\");\r\n\t\tthis.registerColumnOption(\"formatterHtmlOutput\");\r\n\t\tthis.registerColumnOption(\"formatterHtmlOutputParams\");\r\n\t\tthis.registerColumnOption(\"titleFormatter\");\r\n\t\tthis.registerColumnOption(\"titleFormatterParams\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-format\", this.formatValue.bind(this));\r\n\t\tthis.subscribe(\"cell-rendered\", this.cellRendered.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"column-format\", this.formatHeader.bind(this));\r\n\t}\r\n\r\n\t//initialize column formatter\r\n\tinitializeColumn(column){\r\n\t\tcolumn.modules.format = this.lookupFormatter(column, \"\");\r\n\r\n\t\tif(typeof column.definition.formatterPrint !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.print = this.lookupFormatter(column, \"Print\");\r\n\t\t}\r\n\r\n\t\tif(typeof column.definition.formatterClipboard !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.clipboard = this.lookupFormatter(column, \"Clipboard\");\r\n\t\t}\r\n\r\n\t\tif(typeof column.definition.formatterHtmlOutput !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.htmlOutput = this.lookupFormatter(column, \"HtmlOutput\");\r\n\t\t}\r\n\t}\r\n\r\n\tlookupFormatter(column, type){\r\n\t\tvar config = {params:column.definition[\"formatter\" + type + \"Params\"] || {}},\r\n\t\tformatter = column.definition[\"formatter\" + type];\r\n\r\n\t\t//set column formatter\r\n\t\tswitch(typeof formatter){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(Format.formatters[formatter]){\r\n\t\t\t\tconfig.formatter = Format.formatters[formatter];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Formatter Error - No such formatter found: \", formatter);\r\n\t\t\t\tconfig.formatter = Format.formatters.plaintext;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tconfig.formatter = formatter;\r\n\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\tconfig.formatter = Format.formatters.plaintext;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn config;\r\n\t}\r\n\r\n\tcellRendered(cell){\r\n\t\tif(cell.modules.format && cell.modules.format.renderedCallback && !cell.modules.format.rendered){\r\n\t\t\tcell.modules.format.renderedCallback();\r\n\t\t\tcell.modules.format.rendered = true;\r\n\t\t}\r\n\t}\r\n\r\n\t//return a formatted value for a column header\r\n\tformatHeader(column, title, el){\r\n\t\tvar formatter, params, onRendered, mockCell;\r\n\r\n\t\tif(column.definition.titleFormatter){\r\n\t\t\tformatter = this.getFormatter(column.definition.titleFormatter);\r\n\r\n\t\t\tonRendered = (callback) => {\r\n\t\t\t\tcolumn.titleFormatterRendered = callback;\r\n\t\t\t};\r\n\r\n\t\t\tmockCell = {\r\n\t\t\t\tgetValue:function(){\r\n\t\t\t\t\treturn title;\r\n\t\t\t\t},\r\n\t\t\t\tgetElement:function(){\r\n\t\t\t\t\treturn el;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\tparams = column.definition.titleFormatterParams || {};\r\n\r\n\t\t\tparams = typeof params === \"function\" ? params() : params;\r\n\r\n\t\t\treturn formatter.call(this, mockCell, params, onRendered);\r\n\t\t}else{\r\n\t\t\treturn title;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t//return a formatted value for a cell\r\n\tformatValue(cell){\r\n\t\tvar component = cell.getComponent(),\r\n\t\tparams = typeof cell.column.modules.format.params === \"function\" ? cell.column.modules.format.params(component) : cell.column.modules.format.params;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\tif(!cell.modules.format){\r\n\t\t\t\tcell.modules.format = {};\r\n\t\t\t}\r\n\r\n\t\t\tcell.modules.format.renderedCallback = callback;\r\n\t\t\tcell.modules.format.rendered = false;\r\n\t\t}\r\n\r\n\t\treturn cell.column.modules.format.formatter.call(this, component, params, onRendered);\r\n\t}\r\n\r\n\tformatExportValue(cell, type){\r\n\t\tvar formatter = cell.column.modules.format[type],\r\n\t\tparams;\r\n\r\n\t\tif(formatter){\r\n\t\t\tparams = typeof formatter.params === \"function\" ? formatter.params(component) : formatter.params;\r\n\r\n\t\t\tfunction onRendered(callback){\r\n\t\t\t\tif(!cell.modules.format){\r\n\t\t\t\t\tcell.modules.format = {};\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcell.modules.format.renderedCallback = callback;\r\n\t\t\t\tcell.modules.format.rendered = false;\r\n\t\t\t}\r\n\r\n\t\t\treturn formatter.formatter.call(this, cell.getComponent(), params, onRendered);\r\n\r\n\t\t}else{\r\n\t\t\treturn this.formatValue(cell);\r\n\t\t}\r\n\t}\r\n\r\n\tsanitizeHTML(value){\r\n\t\tif(value){\r\n\t\t\tvar entityMap = {\r\n\t\t\t\t'&': '&',\r\n\t\t\t\t'<': '<',\r\n\t\t\t\t'>': '>',\r\n\t\t\t\t'\"': '"',\r\n\t\t\t\t\"'\": ''',\r\n\t\t\t\t'/': '/',\r\n\t\t\t\t'`': '`',\r\n\t\t\t\t'=': '='\r\n\t\t\t};\r\n\r\n\t\t\treturn String(value).replace(/[&<>\"'`=\\/]/g, function (s) {\r\n\t\t\t\treturn entityMap[s];\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn value;\r\n\t\t}\r\n\t}\r\n\r\n\temptyToSpace(value){\r\n\t\treturn value === null || typeof value === \"undefined\" || value === \"\" ? \" \" : value;\r\n\t}\r\n\r\n\t//get formatter for cell\r\n\tgetFormatter(formatter){\r\n\t\tvar formatter;\r\n\r\n\t\tswitch(typeof formatter){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(Format.formatters[formatter]){\r\n\t\t\t\tformatter = Format.formatters[formatter]\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Formatter Error - No such formatter found: \", formatter);\r\n\t\t\t\tformatter = Format.formatters.plaintext;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tformatter = formatter;\r\n\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\tformatter = Format.formatters.plaintext;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn formatter;\r\n\t}\r\n}\r\n\r\nFormat.moduleName = \"format\";\r\n\r\n//load defaults\r\nFormat.formatters = defaultFormatters;\r\n\r\nexport default Format;","import Module from '../../core/Module.js';\r\n\r\nclass FrozenColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.leftColumns = [];\r\n\t\tthis.rightColumns = [];\r\n\t\tthis.leftMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.rightPadding = 0;\r\n\t\tthis.initializationMode = \"left\";\r\n\t\tthis.active = false;\r\n\t\tthis.blocked = true;\r\n\t\t\r\n\t\tthis.registerColumnOption(\"frozen\");\r\n\t}\r\n\t\r\n\t//reset initial state\r\n\treset(){\r\n\t\tthis.initializationMode = \"left\";\r\n\t\tthis.leftColumns = [];\r\n\t\tthis.rightColumns = [];\r\n\t\tthis.leftMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.active = false;\r\n\t\t\r\n\t\tthis.table.columnManager.headersElement.style.marginLeft = 0;\r\n\t\tthis.table.columnManager.element.style.paddingRight = 0;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-layout\", this.layoutCell.bind(this));\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"column-width\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"row-layout-after\", this.layoutRow.bind(this));\r\n\t\tthis.subscribe(\"table-layout\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"columns-loading\", this.reset.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"column-add\", this.reinitializeColumns.bind(this));\r\n\t\tthis.subscribe(\"column-delete\", this.reinitializeColumns.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"table-redraw\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"layout-refreshing\", this.blockLayout.bind(this));\r\n\t\tthis.subscribe(\"layout-refreshed\", this.unblockLayout.bind(this));\r\n\t}\r\n\t\r\n\tblockLayout(){\r\n\t\tthis.blocked = true;\r\n\t}\r\n\t\r\n\tunblockLayout(){\r\n\t\tthis.blocked = false;\r\n\t}\r\n\t\r\n\tlayoutCell(cell){\r\n\t\tthis.layoutElement(cell.element, cell.column)\r\n\t}\r\n\t\r\n\treinitializeColumns(){\r\n\t\tthis.reset();\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//initialize specific column\r\n\tinitializeColumn(column){\r\n\t\tvar config = {margin:0, edge:false};\r\n\t\t\r\n\t\tif(!column.isGroup){\r\n\t\t\t\r\n\t\t\tif(this.frozenCheck(column)){\r\n\t\t\t\t\r\n\t\t\t\tconfig.position = this.initializationMode;\r\n\t\t\t\t\r\n\t\t\t\tif(this.initializationMode == \"left\"){\r\n\t\t\t\t\tthis.leftColumns.push(column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.rightColumns.unshift(column);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.active = true;\r\n\t\t\t\t\r\n\t\t\t\tcolumn.modules.frozen = config;\r\n\t\t\t}else{\r\n\t\t\t\tthis.initializationMode = \"right\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tfrozenCheck(column){\r\n\t\tif(column.parent.isGroup && column.definition.frozen){\r\n\t\t\tconsole.warn(\"Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups\");\r\n\t\t}\r\n\t\t\r\n\t\tif(column.parent.isGroup){\r\n\t\t\treturn this.frozenCheck(column.parent);\r\n\t\t}else{\r\n\t\t\treturn column.definition.frozen;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//quick layout to smooth horizontal scrolling\r\n\tscrollHorizontal(){\r\n\t\tvar rows;\r\n\t\t\r\n\t\tif(this.active){\t\t\r\n\t\t\tthis.calcMargins(true);\r\n\t\t\t\r\n\t\t\tthis.layoutColumnPosition();\r\n\t\t\t\r\n\t\t\tthis.layoutCalcRows();\r\n\t\t\t\r\n\t\t\tthis.reinitializeRows();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//calculate margins for rows\r\n\tcalcMargins(scroll){\r\n\t\t\r\n\t\tif(!scroll){\r\n\t\t\tthis.leftMargin = this._calcSpace(this.leftColumns, this.leftColumns.length) + \"px\";\t\t\t\r\n\t\t\tthis.rightMargin = this._calcSpace(this.rightColumns, this.rightColumns.length) + \"px\";\t\r\n\t\t\tthis.table.rowManager.tableElement.style.marginRight = this.rightMargin;\r\n\t\t}\r\n\t\t\r\n\t\t//calculate right frozen columns\r\n\t\tthis.rightPadding = this.table.rowManager.element.clientWidth + this.table.columnManager.scrollLeft;\r\n\t}\r\n\t\r\n\t//layout calculation rows\r\n\tlayoutCalcRows(){\r\n\t\tif(this.table.modExists(\"columnCalcs\")){\r\n\t\t\tif(this.table.modules.columnCalcs.topInitialized && this.table.modules.columnCalcs.topRow){\r\n\t\t\t\tthis.layoutRow(this.table.modules.columnCalcs.topRow);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.modules.columnCalcs.botInitialized && this.table.modules.columnCalcs.botRow){\r\n\t\t\t\tthis.layoutRow(this.table.modules.columnCalcs.botRow);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.modExists(\"groupRows\")){\r\n\t\t\t\tthis.layoutGroupCalcs(this.table.modules.groupRows.getGroups())\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tlayoutGroupCalcs(groups){\r\n\t\tgroups.forEach((group) => {\r\n\t\t\tif(group.calcs.top){\r\n\t\t\t\tthis.layoutRow(group.calcs.top);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(group.calcs.bottom){\r\n\t\t\t\tthis.layoutRow(group.calcs.bottom);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(group.groupList && group.groupList.length){\r\n\t\t\t\tthis.layoutGroupCalcs(group.groupList && group.groupList);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//calculate column positions and layout headers\r\n\tlayoutColumnPosition(allCells){\r\n\t\tvar leftParents = [];\r\n\t\t\r\n\t\tvar leftMargin = 0;\r\n\t\tvar rightMargin = 0;\r\n\t\t\r\n\t\tthis.table.columnManager.headersElement.style.marginLeft = this.leftMargin;\r\n\t\tthis.table.columnManager.element.style.paddingRight = this.rightMargin;\r\n\t\t\r\n\t\tthis.leftColumns.forEach((column, i) => {\t\r\n\t\t\tcolumn.modules.frozen.marginValue = leftMargin + this.table.columnManager.scrollLeft;\r\n\t\t\tcolumn.modules.frozen.margin = column.modules.frozen.marginValue + \"px\";\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\tleftMargin += column.getWidth();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(i == this.leftColumns.length - 1){\r\n\t\t\t\tcolumn.modules.frozen.edge = true;\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.modules.frozen.edge = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(column.parent.isGroup){\r\n\t\t\t\tvar parentEl = this.getColGroupParentElement(column);\r\n\t\t\t\tif(!leftParents.includes(parentEl)){\r\n\t\t\t\t\tthis.layoutElement(parentEl, column);\r\n\t\t\t\t\tleftParents.push(parentEl);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(column.modules.frozen.edge){\r\n\t\t\t\t\tparentEl.classList.add(\"tabulator-frozen-\" + column.modules.frozen.position);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.layoutElement(column.getElement(), column);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(allCells){\r\n\t\t\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.rightColumns.forEach((column, i) => {\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\trightMargin += column.getWidth();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.frozen.marginValue = this.rightPadding - rightMargin;\r\n\t\t\tcolumn.modules.frozen.margin = column.modules.frozen.marginValue + \"px\";\r\n\t\t\t\r\n\t\t\tif(i == this.rightColumns.length - 1){\r\n\t\t\t\tcolumn.modules.frozen.edge = true;\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.modules.frozen.edge = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif(column.parent.isGroup){\r\n\t\t\t\tthis.layoutElement(this.getColGroupParentElement(column), column);\r\n\t\t\t}else{\r\n\t\t\t\tthis.layoutElement(column.getElement(), column);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(allCells){\r\n\t\t\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetColGroupParentElement(column){\r\n\t\treturn column.parent.isGroup ? this.getColGroupParentElement(column.parent) : column.getElement();\r\n\t}\r\n\t\r\n\t//layout columns appropriately\r\n\tlayout(){\t\r\n\t\tif(this.active && !this.blocked){\r\n\t\t\t//calculate row padding\r\n\t\t\tthis.calcMargins();\r\n\t\t\t\r\n\t\t\t//calculate left columns\r\n\t\t\tthis.layoutColumnPosition();\r\n\r\n\t\t\tthis.reinitializeRows();\r\n\t\t\t\r\n\t\t\tthis.layoutCalcRows();\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeRows(){\r\n\t\tvar visibleRows = this.table.rowManager.getVisibleRows();\r\n\t\tvar otherRows = this.table.rowManager.getRows().filter(row => !visibleRows.includes(row));\r\n\r\n\t\totherRows.forEach((row) =>{\r\n\t\t\trow.deinitialize();\r\n\t\t});\r\n\t\t\r\n\t\tvisibleRows.forEach((row) =>{\r\n\t\t\tif(row.type === \"row\"){\r\n\t\t\t\tthis.layoutRow(row);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tlayoutRow(row){\r\n\t\t// console.trace(\"row\")\r\n\t\tvar rowEl = row.getElement();\r\n\t\t\r\n\t\trowEl.style.paddingLeft = this.leftMargin;\r\n\t\t\r\n\t\tif(this.table.options.layout === \"fitDataFill\" && this.rightColumns.length){\r\n\t\t\tthis.table.rowManager.getTableElement().style.minWidth = \"calc(100% - \" + this.rightMargin + \")\";\r\n\t\t}\r\n\t\t\r\n\t\tthis.leftColumns.forEach((column) => {\r\n\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\r\n\t\t\tif(cell){\r\n\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.rightColumns.forEach((column) => {\r\n\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\r\n\t\t\tif(cell){\r\n\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tlayoutElement(element, column){\r\n\t\t\r\n\t\tif(column.modules.frozen){\r\n\t\t\telement.style.position = \"absolute\";\r\n\t\t\telement.style.left = column.modules.frozen.margin;\r\n\t\t\t\r\n\t\t\telement.classList.add(\"tabulator-frozen\");\r\n\t\t\t\r\n\t\t\tif(column.modules.frozen.edge){\r\n\t\t\t\telement.classList.add(\"tabulator-frozen-\" + column.modules.frozen.position);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_calcSpace(columns, index){\r\n\t\tvar width = 0;\r\n\t\t\r\n\t\tfor (let i = 0; i < index; i++){\r\n\t\t\tif(columns[i].visible){\r\n\t\t\t\twidth += columns[i].getWidth();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn width;\r\n\t}\r\n}\r\n\r\nFrozenColumns.moduleName = \"frozenColumns\";\r\n\r\nexport default FrozenColumns;","import Module from '../../core/Module.js';\r\n\r\nclass FrozenRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.topElement = document.createElement(\"div\");\r\n\t\tthis.rows = [];\r\n\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"freeze\", this.freezeRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"unfreeze\", this.unfreezeRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isFrozen\", this.isRowFrozen.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.rows = [];\r\n\r\n\t\tthis.topElement.classList.add(\"tabulator-frozen-rows-holder\");\r\n\r\n\t\t// this.table.columnManager.element.append(this.topElement);\r\n\t\tthis.table.columnManager.getElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling);\r\n\r\n\t\tthis.subscribe(\"row-deleting\", this.detachRow.bind(this));\r\n\t\tthis.subscribe(\"rows-visible\", this.visibleRows.bind(this));\r\n\r\n\t\tthis.registerDisplayHandler(this.getRows.bind(this), 10);\r\n\t}\r\n\r\n\tisRowFrozen(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\t\treturn index > -1;\r\n\t}\r\n\r\n\tisFrozen(){\r\n\t\treturn !!this.rows.length;\r\n\t}\r\n\r\n\tvisibleRows(viewable, rows){\r\n\t\tthis.rows.forEach((row) => {\r\n\t\t\trows.push(row);\r\n\t\t});\r\n\r\n\t\treturn rows;\r\n\t}\r\n\r\n\t//filter frozen rows out of display data\r\n\tgetRows(rows){\r\n\t\tvar self = this,\r\n\t\tfrozen = [],\r\n\t\toutput = rows.slice(0);\r\n\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\tvar index = output.indexOf(row);\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\toutput.splice(index, 1);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tfreezeRow(row){\r\n\t\tif(!row.modules.frozen){\r\n\t\t\trow.modules.frozen = true;\r\n\t\t\tthis.topElement.appendChild(row.getElement());\r\n\t\t\trow.initialize();\r\n\t\t\trow.normalizeHeight();\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\tthis.rows.push(row);\r\n\r\n\t\t\tthis.refreshData(false, \"display\")\r\n\r\n\t\t\tthis.styleRows();\r\n\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Freeze Error - Row is already frozen\");\r\n\t\t}\r\n\t}\r\n\r\n\tunfreezeRow(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\r\n\t\tif(row.modules.frozen){\r\n\r\n\t\t\trow.modules.frozen = false;\r\n\r\n\t\t\tthis.detachRow(row);\r\n\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\tthis.refreshData(false, \"display\")\r\n\r\n\t\t\tif(this.rows.length){\r\n\t\t\t\tthis.styleRows();\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Freeze Error - Row is already unfrozen\");\r\n\t\t}\r\n\t}\r\n\r\n\tdetachRow(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tvar rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\r\n\t\t\tthis.rows.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\tstyleRows(row){\r\n\t\tthis.rows.forEach((row, i) => {\r\n\t\t\tthis.table.rowManager.styleRow(row, i);\r\n\t\t});\r\n\t}\r\n}\r\n\r\nFrozenRows.moduleName = \"frozenRows\";\r\n\r\nexport default FrozenRows;","//public group object\r\nclass GroupComponent {\r\n\tconstructor (group){\r\n\t\tthis._group = group;\r\n\t\tthis.type = \"GroupComponent\";\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._group.groupManager.table.componentFunctionBinder.handle(\"row\", target._group, name)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\tgetKey(){\r\n\t\treturn this._group.key;\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._group.field;\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._group.element;\r\n\t}\r\n\r\n\tgetRows(){\r\n\t\treturn this._group.getRows(true);\r\n\t}\r\n\r\n\tgetSubGroups(){\r\n\t\treturn this._group.getSubGroups(true);\r\n\t}\r\n\r\n\tgetParentGroup(){\r\n\t\treturn this._group.parent ? this._group.parent.getComponent() : false;\r\n\t}\r\n\r\n\tisVisible(){\r\n\t\treturn this._group.visible;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tthis._group.show();\r\n\t}\r\n\r\n\thide(){\r\n\t\tthis._group.hide();\r\n\t}\r\n\r\n\ttoggle(){\r\n\t\tthis._group.toggleVisibility();\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._group;\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._group.groupManager.table;\r\n\t}\r\n}\r\n\r\nexport default GroupComponent;","import Helpers from '../../core/tools/Helpers.js';\r\nimport GroupComponent from './GroupComponent.js';\r\n\r\n//Group functions\r\nclass Group{\r\n\t\r\n\tconstructor(groupManager, parent, level, key, field, generator, oldGroup){\r\n\t\tthis.groupManager = groupManager;\r\n\t\tthis.parent = parent;\r\n\t\tthis.key = key;\r\n\t\tthis.level = level;\r\n\t\tthis.field = field;\r\n\t\tthis.hasSubGroups = level < (groupManager.groupIDLookups.length - 1);\r\n\t\tthis.addRow = this.hasSubGroups ? this._addRowToGroup : this._addRow;\r\n\t\tthis.type = \"group\"; //type of element\r\n\t\tthis.old = oldGroup;\r\n\t\tthis.rows = [];\r\n\t\tthis.groups = [];\r\n\t\tthis.groupList = [];\r\n\t\tthis.generator = generator;\r\n\t\tthis.element = false;\r\n\t\tthis.elementContents = false;\r\n\t\tthis.height = 0;\r\n\t\tthis.outerHeight = 0;\r\n\t\tthis.initialized = false;\r\n\t\tthis.calcs = {};\r\n\t\tthis.initialized = false;\r\n\t\tthis.modules = {};\r\n\t\tthis.arrowElement = false;\r\n\t\t\r\n\t\tthis.visible = oldGroup ? oldGroup.visible : (typeof groupManager.startOpen[level] !== \"undefined\" ? groupManager.startOpen[level] : groupManager.startOpen[0]);\r\n\t\t\r\n\t\tthis.component = null;\r\n\t\t\r\n\t\tthis.createElements();\r\n\t\tthis.addBindings();\r\n\t\t\r\n\t\tthis.createValueGroups();\r\n\t}\r\n\t\r\n\twipe(){\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\tgroup.wipe();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\tif(row.modules){\r\n\t\t\t\t\tdelete row.modules.group;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tthis.element = false;\r\n\t\tthis.arrowElement = false;\r\n\t\tthis.elementContents = false;\r\n\t}\r\n\t\r\n\tcreateElements(){\r\n\t\tvar arrow = document.createElement(\"div\");\r\n\t\tarrow.classList.add(\"tabulator-arrow\");\r\n\t\t\r\n\t\tthis.element = document.createElement(\"div\");\r\n\t\tthis.element.classList.add(\"tabulator-row\");\r\n\t\tthis.element.classList.add(\"tabulator-group\");\r\n\t\tthis.element.classList.add(\"tabulator-group-level-\" + this.level);\r\n\t\tthis.element.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\tthis.arrowElement = document.createElement(\"div\");\r\n\t\tthis.arrowElement.classList.add(\"tabulator-group-toggle\");\r\n\t\tthis.arrowElement.appendChild(arrow);\r\n\t\t\r\n\t\t//setup movable rows\r\n\t\tif(this.groupManager.table.options.movableRows !== false && this.groupManager.table.modExists(\"moveRow\")){\r\n\t\t\tthis.groupManager.table.modules.moveRow.initializeGroupHeader(this);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcreateValueGroups(){\r\n\t\tvar level = this.level + 1;\r\n\t\tif(this.groupManager.allowedValues && this.groupManager.allowedValues[level]){\r\n\t\t\tthis.groupManager.allowedValues[level].forEach((value) => {\r\n\t\t\t\tthis._createGroup(value, level);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\taddBindings(){\r\n\t\tvar toggleElement;\r\n\t\t\r\n\t\tif(this.groupManager.table.options.groupToggleElement){\r\n\t\t\ttoggleElement = this.groupManager.table.options.groupToggleElement == \"arrow\" ? this.arrowElement : this.element;\r\n\t\t\t\r\n\t\t\ttoggleElement.addEventListener(\"click\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\tthis.toggleVisibility();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\t_createGroup(groupID, level){\r\n\t\tvar groupKey = level + \"_\" + groupID;\r\n\t\tvar group = new Group(this.groupManager, this, level, groupID, this.groupManager.groupIDLookups[level].field, this.groupManager.headerGenerator[level] || this.groupManager.headerGenerator[0], this.old ? this.old.groups[groupKey] : false);\r\n\t\t\r\n\t\tthis.groups[groupKey] = group;\r\n\t\tthis.groupList.push(group);\r\n\t}\r\n\t\r\n\t_addRowToGroup(row){\r\n\t\t\r\n\t\tvar level = this.level + 1;\r\n\t\t\r\n\t\tif(this.hasSubGroups){\r\n\t\t\tvar groupID = this.groupManager.groupIDLookups[level].func(row.getData()),\r\n\t\t\tgroupKey = level + \"_\" + groupID;\r\n\t\t\t\r\n\t\t\tif(this.groupManager.allowedValues && this.groupManager.allowedValues[level]){\r\n\t\t\t\tif(this.groups[groupKey]){\r\n\t\t\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(!this.groups[groupKey]){\r\n\t\t\t\t\tthis._createGroup(groupID, level);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_addRow(row){\r\n\t\tthis.rows.push(row);\r\n\t\trow.modules.group = this;\r\n\t}\r\n\t\r\n\tinsertRow(row, to, after){\r\n\t\tvar data = this.conformRowData({});\r\n\t\t\r\n\t\trow.updateData(data);\r\n\t\t\r\n\t\tvar toIndex = this.rows.indexOf(to);\r\n\t\t\r\n\t\tif(toIndex > -1){\r\n\t\t\tif(after){\r\n\t\t\t\tthis.rows.splice(toIndex+1, 0, row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.splice(toIndex, 0, row);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(after){\r\n\t\t\t\tthis.rows.push(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.unshift(row);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\trow.modules.group = this;\r\n\t\t\r\n\t\tthis.generateGroupHeaderContents();\r\n\t\t\r\n\t\tif(this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\tthis.groupManager.table.modules.columnCalcs.recalcGroup(this);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.updateGroupRows(true);\r\n\t}\r\n\t\r\n\tscrollHeader(left){\r\n\t\tif(this.arrowElement){\r\n\t\t\tthis.arrowElement.style.marginLeft = left;\r\n\t\t\t\r\n\t\t\tthis.groupList.forEach(function(child){\r\n\t\t\t\tchild.scrollHeader(left);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRowIndex(row){}\r\n\t\r\n\t//update row data to match grouping contraints\r\n\tconformRowData(data){\r\n\t\tif(this.field){\r\n\t\t\tdata[this.field] = this.key;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Data Conforming Error - Cannot conform row data to match new group as groupBy is a function\");\r\n\t\t}\r\n\t\t\r\n\t\tif(this.parent){\r\n\t\t\tdata = this.parent.conformRowData(data);\r\n\t\t}\r\n\t\t\r\n\t\treturn data;\r\n\t}\r\n\t\r\n\tremoveRow(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\t\tvar el = row.getElement();\r\n\t\t\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.rows.splice(index, 1);\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.groupManager.table.options.groupValues && !this.rows.length){\r\n\t\t\tif(this.parent){\r\n\t\t\t\tthis.parent.removeGroup(this);\r\n\t\t\t}else{\r\n\t\t\t\tthis.groupManager.removeGroup(this);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tif(el.parentNode){\r\n\t\t\t\tel.parentNode.removeChild(el);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.generateGroupHeaderContents();\r\n\t\t\t\r\n\t\t\tif(this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\t\tthis.groupManager.table.modules.columnCalcs.recalcGroup(this);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveGroup(group){\r\n\t\tvar groupKey = group.level + \"_\" + group.key,\r\n\t\tindex;\r\n\t\t\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tdelete this.groups[groupKey];\r\n\t\t\t\r\n\t\t\tindex = this.groupList.indexOf(group);\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.groupList.splice(index, 1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(!this.groupList.length){\r\n\t\t\t\tif(this.parent){\r\n\t\t\t\t\tthis.parent.removeGroup(this);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.groupManager.removeGroup(this);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetHeadersAndRows(noCalc){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\toutput.push(this);\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(this.visible){\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\t\toutput = output.concat(group.getHeadersAndRows(noCalc));\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tif(!noCalc && this.groupManager.table.options.columnCalcs != \"table\" && this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.modules.columnCalcs.hasTopCalcs()){\r\n\t\t\t\t\tif(this.calcs.top){\r\n\t\t\t\t\t\tthis.calcs.top.detachElement();\r\n\t\t\t\t\t\tthis.calcs.top.deleteCells();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows);\r\n\t\t\t\t\toutput.push(this.calcs.top);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\toutput = output.concat(this.rows);\r\n\t\t\t\t\r\n\t\t\t\tif(!noCalc && this.groupManager.table.options.columnCalcs != \"table\" && this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()){\r\n\t\t\t\t\tif(this.calcs.bottom){\r\n\t\t\t\t\t\tthis.calcs.bottom.detachElement();\r\n\t\t\t\t\t\tthis.calcs.bottom.deleteCells();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows);\r\n\t\t\t\t\toutput.push(this.calcs.bottom);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!this.groupList.length && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\t\t\r\n\t\t\t\tif(this.groupManager.table.modExists(\"columnCalcs\")){\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!noCalc && this.groupManager.table.modules.columnCalcs.hasTopCalcs()){\r\n\t\t\t\t\t\tif(this.calcs.top){\r\n\t\t\t\t\t\t\tthis.calcs.top.detachElement();\r\n\t\t\t\t\t\t\tthis.calcs.top.deleteCells();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.groupManager.table.options.groupClosedShowCalcs){\r\n\t\t\t\t\t\t\tthis.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows);\r\n\t\t\t\t\t\t\toutput.push(this.calcs.top);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!noCalc && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()){\r\n\t\t\t\t\t\tif(this.calcs.bottom){\r\n\t\t\t\t\t\t\tthis.calcs.bottom.detachElement();\r\n\t\t\t\t\t\t\tthis.calcs.bottom.deleteCells();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.groupManager.table.options.groupClosedShowCalcs){\r\n\t\t\t\t\t\t\tthis.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows);\r\n\t\t\t\t\t\t\toutput.push(this.calcs.bottom);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetData(visible, transform){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(!visible || (visible && this.visible)){\r\n\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\toutput.push(row.getData(transform || \"data\"));\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetRowCount(){\r\n\t\tvar count = 0;\r\n\t\t\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\tcount += group.getRowCount();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tcount = this.rows.length;\r\n\t\t}\r\n\t\treturn count;\r\n\t}\r\n\t\r\n\ttoggleVisibility(){\r\n\t\tif(this.visible){\r\n\t\t\tthis.hide();\r\n\t\t}else{\r\n\t\t\tthis.show();\r\n\t\t}\r\n\t}\r\n\t\r\n\thide(){\r\n\t\tthis.visible = false;\r\n\t\t\r\n\t\tif(this.groupManager.table.rowManager.getRenderMode() == \"classic\" && !this.groupManager.table.options.pagination){\r\n\t\t\t\r\n\t\t\tthis.element.classList.remove(\"tabulator-group-visible\");\r\n\t\t\t\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar rows = group.getHeadersAndRows();\r\n\t\t\t\t\t\r\n\t\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\t\trow.detachElement();\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());\r\n\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth();\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.table.externalEvents.dispatch(\"groupVisibilityChanged\", this.getComponent(), false);\r\n\t}\r\n\t\r\n\tshow(){\r\n\t\tthis.visible = true;\r\n\t\t\r\n\t\tif(this.groupManager.table.rowManager.getRenderMode() == \"classic\" && !this.groupManager.table.options.pagination){\r\n\t\t\t\r\n\t\t\tthis.element.classList.add(\"tabulator-group-visible\");\r\n\t\t\t\r\n\t\t\tvar prev = this.generateElement();\r\n\t\t\t\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\t\tvar rows = group.getHeadersAndRows();\r\n\t\t\t\t\t\r\n\t\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\t\tprev.parentNode.insertBefore(rowEl, prev.nextSibling);\r\n\t\t\t\t\t\trow.initialize();\r\n\t\t\t\t\t\tprev = rowEl;\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\tprev.parentNode.insertBefore(rowEl, prev.nextSibling);\r\n\t\t\t\t\trow.initialize();\r\n\t\t\t\t\tprev = rowEl;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());\r\n\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth();\r\n\t\t}else{\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.table.externalEvents.dispatch(\"groupVisibilityChanged\", this.getComponent(), true);\r\n\t}\r\n\t\r\n\t_visSet(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tif(typeof this.visible == \"function\"){\r\n\t\t\t\r\n\t\t\tthis.rows.forEach(function(row){\r\n\t\t\t\tdata.push(row.getData());\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.visible = this.visible(this.key, this.getRowCount(), data, this.getComponent());\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRowGroup(row){\r\n\t\tvar match = false;\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\tvar result = group.getRowGroup(row);\r\n\t\t\t\t\r\n\t\t\t\tif(result){\r\n\t\t\t\t\tmatch = result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tif(this.rows.find(function(item){\r\n\t\t\t\treturn item === row;\r\n\t\t\t})){\r\n\t\t\t\tmatch = this;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn match;\r\n\t}\r\n\t\r\n\tgetSubGroups(component){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.groupList.forEach(function(child){\r\n\t\t\toutput.push(component ? child.getComponent() : child);\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetRows(compoment){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\toutput.push(compoment ? row.getComponent() : row);\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgenerateGroupHeaderContents(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\tdata.push(row.getData());\r\n\t\t});\r\n\t\t\r\n\t\tthis.elementContents = this.generator(this.key, this.getRowCount(), data, this.getComponent());\r\n\t\t\r\n\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\r\n\t\tif(typeof this.elementContents === \"string\"){\r\n\t\t\tthis.element.innerHTML = this.elementContents;\r\n\t\t}else{\r\n\t\t\tthis.element.appendChild(this.elementContents);\r\n\t\t}\r\n\t\t\r\n\t\tthis.element.insertBefore(this.arrowElement, this.element.firstChild);\r\n\t}\r\n\t\r\n\tgetPath(path = []) {\r\n\t\tpath.unshift(this.key);\r\n\t\tif(this.parent) {\r\n\t\t\tthis.parent.getPath(path);\r\n\t\t}\r\n\t\treturn path;\r\n\t}\r\n\t\r\n\t////////////// Standard Row Functions //////////////\r\n\t\r\n\tgetElement(){\r\n\t\treturn this.elementContents ? this.element : this.generateElement();\r\n\t}\r\n\t\r\n\tgenerateElement(){\r\n\t\tthis.addBindings = false;\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(this.visible){\r\n\t\t\tthis.element.classList.add(\"tabulator-group-visible\");\r\n\t\t}else{\r\n\t\t\tthis.element.classList.remove(\"tabulator-group-visible\");\r\n\t\t}\r\n\t\t\r\n\t\tfor(var i = 0; i < this.element.childNodes.length; ++i){\r\n\t\t\tthis.element.childNodes[i].parentNode.removeChild(this.element.childNodes[i]);\r\n\t\t}\r\n\t\t\r\n\t\tthis.generateGroupHeaderContents();\r\n\t\t\r\n\t\t// this.addBindings();\r\n\t\t\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\tdetachElement(){\r\n\t\tif (this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//normalize the height of elements in the row\r\n\tnormalizeHeight(){\r\n\t\tthis.setHeight(this.element.clientHeight);\r\n\t}\r\n\t\r\n\tinitialize(force){\r\n\t\tif(!this.initialized || force){\r\n\t\t\tthis.normalizeHeight();\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitialize(){\r\n\t\tthis.initialized = false;\r\n\t\tthis.height = 0;\r\n\t\t\r\n\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\tthis.initialize(true);\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetHeight(height){\r\n\t\tif(this.height != height){\r\n\t\t\tthis.height = height;\r\n\t\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return rows outer height\r\n\tgetHeight(){\r\n\t\treturn this.outerHeight;\r\n\t}\r\n\t\r\n\tgetGroup(){\r\n\t\treturn this;\r\n\t}\r\n\t\r\n\treinitializeHeight(){}\r\n\t\r\n\tcalcHeight(){}\r\n\t\r\n\tsetCellHeight(){}\r\n\t\r\n\tclearCellHeight(){}\r\n\t\r\n\tdeinitializeHeight(){}\r\n\t\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new GroupComponent(this);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n\r\nexport default Group;","import Module from '../../core/Module.js';\r\n\r\nimport GroupComponent from './GroupComponent.js';\r\nimport Group from './Group.js';\r\n\r\nclass GroupRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.groupIDLookups = false; //enable table grouping and set field to group by\r\n\t\tthis.startOpen = [function(){return false;}]; //starting state of group\r\n\t\tthis.headerGenerator = [function(){return \"\";}];\r\n\t\tthis.groupList = []; //ordered list of groups\r\n\t\tthis.allowedValues = false;\r\n\t\tthis.groups = {}; //hold row groups\r\n\t\tthis.displayIndex = 0; //index in display pipeline\r\n\r\n\t\tthis.displayHandler = this.getRows.bind(this);\r\n\r\n\t\t//register table options\r\n\t\tthis.registerTableOption(\"groupBy\", false); //enable table grouping and set field to group by\r\n\t\tthis.registerTableOption(\"groupStartOpen\", true); //starting state of group\r\n\t\tthis.registerTableOption(\"groupValues\", false);\r\n\t\tthis.registerTableOption(\"groupUpdateOnCellEdit\", false);\r\n\t\tthis.registerTableOption(\"groupHeader\", false); //header generation function\r\n\t\tthis.registerTableOption(\"groupHeaderPrint\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderClipboard\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderHtmlOutput\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderDownload\", null);\r\n\t\tthis.registerTableOption(\"groupToggleElement\", \"arrow\");\r\n\t\tthis.registerTableOption(\"groupClosedShowCalcs\", false);\r\n\r\n\t\t//register table functions\r\n\t\tthis.registerTableFunction(\"setGroupBy\", this.setGroupBy.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupValues\", this.setGroupValues.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupStartOpen\", this.setGroupStartOpen.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupHeader\", this.setGroupHeader.bind(this));\r\n\t\tthis.registerTableFunction(\"getGroups\", this.userGetGroups.bind(this));\r\n\t\tthis.registerTableFunction(\"getGroupedData\", this.userGetGroupedData.bind(this));\r\n\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"getGroup\", this.rowGetGroup.bind(this));\r\n\t}\r\n\r\n\t//initialize group configuration\r\n\tinitialize(){\r\n\t\tif(this.table.options.groupBy){\r\n\r\n\t\t\tif(this.table.options.groupUpdateOnCellEdit){\r\n\t\t\t\tthis.subscribe(\"cell-value-updated\", this.cellUpdated.bind(this));\r\n\t\t\t\tthis.subscribe(\"row-data-changed\", this.reassignRowToGroup.bind(this), 0);\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"table-built\", this.configureGroupSetup.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"row-deleting\", this.rowDeleting.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHeaders.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.wipe.bind(this));\r\n\t\t\tthis.subscribe(\"rows-added\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"row-moving\", this.rowMoving.bind(this));\r\n\t\t\tthis.subscribe(\"row-adding-index\", this.rowAddingIndex.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"rows-sample\", this.rowSample.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"render-virtual-fill\", this.virtualRenderFill.bind(this));\r\n\r\n\t\t\tthis.registerDisplayHandler(this.displayHandler, 20);\r\n\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\r\n\tconfigureGroupSetup(){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tvar groupBy = this.table.options.groupBy,\r\n\t\t\tstartOpen = this.table.options.groupStartOpen,\r\n\t\t\tgroupHeader = this.table.options.groupHeader;\r\n\r\n\t\t\tthis.allowedValues = this.table.options.groupValues;\r\n\r\n\t\t\tif(Array.isArray(groupBy) && Array.isArray(groupHeader) && groupBy.length > groupHeader.length){\r\n\t\t\t\tconsole.warn(\"Error creating group headers, groupHeader array is shorter than groupBy array\");\r\n\t\t\t}\r\n\r\n\t\t\tthis.headerGenerator = [function(){return \"\";}];\r\n\t\t\tthis.startOpen = [function(){return false;}]; //starting state of group\r\n\r\n\t\t\tthis.langBind(\"groups|item\", (langValue, lang) => {\r\n\t\t\t\tthis.headerGenerator[0] = (value, count, data) => { //header layout function\r\n\t\t\t\t\treturn (typeof value === \"undefined\" ? \"\" : value) + \"(\" + count + \" \" + ((count === 1) ? langValue : lang.groups.items) + \")\";\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tthis.groupIDLookups = [];\r\n\r\n\t\t\tif(Array.isArray(groupBy) || groupBy){\r\n\t\t\t\tif(this.table.modExists(\"columnCalcs\") && this.table.options.columnCalcs != \"table\" && this.table.options.columnCalcs != \"both\"){\r\n\t\t\t\t\tthis.table.modules.columnCalcs.removeCalcs();\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.modExists(\"columnCalcs\") && this.table.options.columnCalcs != \"group\"){\r\n\r\n\t\t\t\t\tvar cols = this.table.columnManager.getRealColumns();\r\n\r\n\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\tif(col.definition.topCalc){\r\n\t\t\t\t\t\t\tthis.table.modules.columnCalcs.initializeTopRow();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(col.definition.bottomCalc){\r\n\t\t\t\t\t\t\tthis.table.modules.columnCalcs.initializeBottomRow();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(!Array.isArray(groupBy)){\r\n\t\t\t\tgroupBy = [groupBy];\r\n\t\t\t}\r\n\r\n\t\t\tgroupBy.forEach((group, i) => {\r\n\t\t\t\tvar lookupFunc, column;\r\n\r\n\t\t\t\tif(typeof group == \"function\"){\r\n\t\t\t\t\tlookupFunc = group;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolumn = this.table.columnManager.getColumnByField(group);\r\n\r\n\t\t\t\t\tif(column){\r\n\t\t\t\t\t\tlookupFunc = function(data){\r\n\t\t\t\t\t\t\treturn column.getFieldValue(data);\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tlookupFunc = function(data){\r\n\t\t\t\t\t\t\treturn data[group];\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.groupIDLookups.push({\r\n\t\t\t\t\tfield: typeof group === \"function\" ? false : group,\r\n\t\t\t\t\tfunc:lookupFunc,\r\n\t\t\t\t\tvalues:this.allowedValues ? this.allowedValues[i] : false,\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t\tif(startOpen){\r\n\t\t\t\tif(!Array.isArray(startOpen)){\r\n\t\t\t\t\tstartOpen = [startOpen];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstartOpen.forEach((level) => {\r\n\t\t\t\t\tlevel = typeof level == \"function\" ? level : function(){return true;};\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.startOpen = startOpen;\r\n\t\t\t}\r\n\r\n\t\t\tif(groupHeader){\r\n\t\t\t\tthis.headerGenerator = Array.isArray(groupHeader) ? groupHeader : [groupHeader];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trowSample(rows, prevValue){\r\n\t\tvar group = this.getGroups(false)[0];\r\n\r\n\t\tprevValue.push(group.getRows(false)[0]);\r\n\r\n\t\treturn prevValue;\r\n\t}\r\n\r\n\tvirtualRenderFill(){\r\n\t\tvar el = this.table.rowManager.tableElement;\r\n\t\tvar rows = this.table.rowManager.getVisibleRows();\r\n\r\n\t\trows = rows.filter((row) => {\r\n\t\t\treturn row.type !== \"group\";\r\n\t\t});\r\n\r\n\t\tel.style.minWidth = !rows.length ? this.table.columnManager.getWidth() + \"px\" : \"\";\r\n\r\n\t\t// if(this.table.options.groupBy){\r\n\t\t// \tif(this.layoutMode() != \"fitDataFill\" && rowsCount == this.table.modules.groupRows.countGroups()){\r\n\t\t// \t\tel.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t// \t}\r\n\t\t// }\r\n\t}\r\n\r\n\trowAddingIndex(row, index, top){\r\n\t\tthis.assignRowToGroup(row);\r\n\r\n\t\tvar groupRows = row.modules.group.rows;\r\n\r\n\t\tif(groupRows.length > 1){\r\n\t\t\tif(!index || (index && groupRows.indexOf(index) == -1)){\r\n\t\t\t\tif(top){\r\n\t\t\t\t\tif(groupRows[0] !== row){\r\n\t\t\t\t\t\tindex = groupRows[0];\r\n\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(groupRows[groupRows.length -1] !== row){\r\n\t\t\t\t\t\tindex = groupRows[groupRows.length -1];\r\n\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn index;\r\n\t}\r\n\r\n\ttrackChanges(){\r\n\t\tthis.dispatch(\"group-changed\");\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tsetGroupBy(groups){\r\n\t\tthis.table.options.groupBy = groups;\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.initialize();\r\n\t\t}else{\r\n\t\t\tthis.configureGroupSetup();\r\n\t\t}\r\n\r\n\t\tthis.refreshData();\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\tsetGroupValues(groupValues){\r\n\t\tthis.table.options.groupValues = groupValues;\r\n\t\tthis.configureGroupSetup();\r\n\t\tthis.refreshData();\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\tsetGroupStartOpen(values){\r\n\t\tthis.table.options.groupStartOpen = values;\r\n\t\tthis.configureGroupSetup();\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\r\n\t\t\tthis.trackChanges();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Grouping Update - cant refresh view, no groups have been set\");\r\n\t\t}\r\n\t}\r\n\r\n\tsetGroupHeader(values){\r\n\t\tthis.table.options.groupHeader = values;\r\n\t\tthis.configureGroupSetup();\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\r\n\t\t\tthis.trackChanges();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Grouping Update - cant refresh view, no groups have been set\");\r\n\t\t}\r\n\t}\r\n\r\n\tuserGetGroups(values){\r\n\t\treturn this.getGroups(true);\r\n\t}\r\n\r\n\t// get grouped table data in the same format as getData()\r\n\tuserGetGroupedData(){\r\n\t\treturn this.table.options.groupBy ?\r\n\t\tthis.getGroupedData() : this.getData()\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////////\r\n\t///////// Component Functions /////////\r\n\t///////////////////////////////////////\r\n\r\n\trowGetGroup(row){\r\n\t\treturn row.modules.group ? row.modules.group.getComponent() : false;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\trowMoving(from, to, after){\r\n\t\tif(!after && to instanceof Group){\r\n\t\t\tto = this.table.rowManager.prevDisplayRow(from) || to;\r\n\t\t}\r\n\r\n\t\tvar toGroup = to instanceof Group ? to : to.modules.group;\r\n\t\tvar fromGroup = from instanceof Group ? from : from.modules.group;\r\n\r\n\t\tif(toGroup === fromGroup){\r\n\t\t\tthis.table.rowManager.moveRowInArray(toGroup.rows, from, to, after);\r\n\t\t}else{\r\n\t\t\tif(fromGroup){\r\n\t\t\t\tfromGroup.removeRow(from);\r\n\t\t\t}\r\n\r\n\t\t\ttoGroup.insertRow(from, to, after);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trowDeleting(row){\r\n\t\t//remove from group\r\n\t\tif(row.modules.group){\r\n\t\t\trow.modules.group.removeRow(row);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trowsUpdated(row){\r\n\t\tthis.updateGroupRows(true);\r\n\t}\r\n\r\n\tcellUpdated(cell){\r\n\t\tthis.reassignRowToGroup(cell.row);\r\n\t}\r\n\r\n\r\n\tsetDisplayIndex(index){\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\r\n\tgetDisplayIndex(){\r\n\t\treturn this.displayIndex;\r\n\t}\r\n\r\n\t//return appropriate rows with group headers\r\n\tgetRows(rows){\r\n\t\tif(this.table.options.groupBy && this.groupIDLookups.length){\r\n\r\n\t\t\tthis.dispatchExternal(\"dataGrouping\");\r\n\r\n\t\t\tthis.generateGroups(rows);\r\n\r\n\t\t\tif(this.subscribedExternal(\"dataGrouped\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataGrouped\", this.getGroups(true));\r\n\t\t\t}\r\n\r\n\t\t\treturn this.updateGroupRows();\r\n\r\n\t\t}else{\r\n\t\t\treturn rows.slice(0);\r\n\t\t}\r\n\t}\r\n\r\n\tgetGroups(component){\r\n\t\tvar groupComponents = [];\r\n\r\n\t\tthis.groupList.forEach(function(group){\r\n\t\t\tgroupComponents.push(component ? group.getComponent() : group);\r\n\t\t});\r\n\r\n\t\treturn groupComponents;\r\n\t}\r\n\r\n\tgetChildGroups(group){\r\n\t\tvar groupComponents = [];\r\n\r\n\t\tif(!group){\r\n\t\t\tgroup = this;\r\n\t\t}\r\n\r\n\t\tgroup.groupList.forEach((child) => {\r\n\t\t\tif(child.groupList.length){\r\n\t\t\t\tgroupComponents = groupComponents.concat(this.getChildGroups(child));\r\n\t\t\t}else{\r\n\t\t\t\tgroupComponents.push(child);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn groupComponents;\r\n\t}\r\n\r\n\twipe(){\r\n\t\tthis.groupList.forEach(function(group){\r\n\t\t\tgroup.wipe();\r\n\t\t});\r\n\t}\r\n\r\n\tpullGroupListData(groupList) {\r\n\t\tvar groupListData = [];\r\n\r\n\t\tgroupList.forEach((group) => {\r\n\t\t\tvar groupHeader = {};\r\n\t\t\tgroupHeader.level = 0;\r\n\t\t\tgroupHeader.rowCount = 0;\r\n\t\t\tgroupHeader.headerContent = \"\";\r\n\t\t\tvar childData = [];\r\n\r\n\t\t\tif (group.hasSubGroups) {\r\n\t\t\t\tchildData = this.pullGroupListData(group.groupList);\r\n\r\n\t\t\t\tgroupHeader.level = group.level;\r\n\t\t\t\tgroupHeader.rowCount = childData.length - group.groupList.length; // data length minus number of sub-headers\r\n\t\t\t\tgroupHeader.headerContent = group.generator(group.key, groupHeader.rowCount, group.rows, group);\r\n\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\t\t\t\tgroupListData = groupListData.concat(childData);\r\n\t\t\t}\r\n\r\n\t\t\telse {\r\n\t\t\t\tgroupHeader.level = group.level;\r\n\t\t\t\tgroupHeader.headerContent = group.generator(group.key, group.rows.length, group.rows, group);\r\n\t\t\t\tgroupHeader.rowCount = group.getRows().length;\r\n\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\r\n\t\t\t\tgroup.getRows().forEach((row) => {\r\n\t\t\t\t\tgroupListData.push(row.getData(\"data\"));\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn groupListData\r\n\t}\r\n\r\n\tgetGroupedData(){\r\n\r\n\t\treturn this.pullGroupListData(this.groupList);\r\n\t}\r\n\r\n\tgetRowGroup(row){\r\n\t\tvar match = false;\r\n\r\n\t\tif(this.options(\"dataTree\")){\r\n\t\t\trow = this.table.modules.dataTree.getTreeParentRoot(row);\r\n\t\t}\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\tvar result = group.getRowGroup(row);\r\n\r\n\t\t\tif(result){\r\n\t\t\t\tmatch = result;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tcountGroups(){\r\n\t\treturn this.groupList.length;\r\n\t}\r\n\r\n\tgenerateGroups(rows){\r\n\t\tvar oldGroups = this.groups;\r\n\r\n\t\tthis.groups = {};\r\n\t\tthis.groupList = [];\r\n\r\n\t\tif(this.allowedValues && this.allowedValues[0]){\r\n\t\t\tthis.allowedValues[0].forEach((value) => {\r\n\t\t\t\tthis.createGroup(value, 0, oldGroups);\r\n\t\t\t});\r\n\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.assignRowToExistingGroup(row, oldGroups);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.assignRowToGroup(row, oldGroups);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tcreateGroup(groupID, level, oldGroups){\r\n\t\tvar groupKey = level + \"_\" + groupID,\r\n\t\tgroup;\r\n\r\n\t\toldGroups = oldGroups || [];\r\n\r\n\t\tgroup = new Group(this, false, level, groupID, this.groupIDLookups[0].field, this.headerGenerator[0], oldGroups[groupKey]);\r\n\r\n\t\tthis.groups[groupKey] = group;\r\n\t\tthis.groupList.push(group);\r\n\t}\r\n\r\n\tassignRowToExistingGroup(row, oldGroups){\r\n\t\tvar groupID = this.groupIDLookups[0].func(row.getData()),\r\n\t\tgroupKey = \"0_\" + groupID;\r\n\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t}\r\n\t}\r\n\r\n\tassignRowToGroup(row, oldGroups){\r\n\t\tvar groupID = this.groupIDLookups[0].func(row.getData()),\r\n\t\tnewGroupNeeded = !this.groups[\"0_\" + groupID];\r\n\r\n\t\tif(newGroupNeeded){\r\n\t\t\tthis.createGroup(groupID, 0, oldGroups);\r\n\t\t}\r\n\r\n\t\tthis.groups[\"0_\" + groupID].addRow(row);\r\n\r\n\t\treturn !newGroupNeeded;\r\n\t}\r\n\r\n\treassignRowToGroup(row){\r\n\t\tif(row.type === \"row\"){\r\n\t\t\tvar oldRowGroup = row.modules.group,\r\n\t\t\toldGroupPath = oldRowGroup.getPath(),\r\n\t\t\tnewGroupPath = this.getExpectedPath(row),\r\n\t\t\tsamePath = true;\r\n\r\n\t\t\t// figure out if new group path is the same as old group path\r\n\t\t\tvar samePath = (oldGroupPath.length == newGroupPath.length) && oldGroupPath.every((element, index) => {\r\n\t\t\t\treturn element === newGroupPath[index];\r\n\t\t\t});\r\n\r\n\t\t\t// refresh if they new path and old path aren't the same (aka the row's groupings have changed)\r\n\t\t\tif(!samePath) {\r\n\t\t\t\toldRowGroup.removeRow(row);\r\n\t\t\t\tthis.assignRowToGroup(row, this.groups);\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgetExpectedPath(row) {\r\n\t\tvar groupPath = [], rowData = row.getData();\r\n\r\n\t\tthis.groupIDLookups.forEach((groupId) => {\r\n\t\t\tgroupPath.push(groupId.func(rowData));\r\n\t\t});\r\n\r\n\t\treturn groupPath;\r\n\t}\r\n\r\n\tupdateGroupRows(force){\r\n\t\tvar output = [],\r\n\t\toldRowCount;\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\toutput = output.concat(group.getHeadersAndRows());\r\n\t\t});\r\n\r\n\t\tif(force){\r\n\t\t\tthis.refreshData(true, this.displayHandler);\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tscrollHeaders(left){\r\n\t\tif(this.table.options.renderHorizontal === \"virtual\"){\r\n\t\t\tleft -= this.table.columnManager.renderer.vDomPadLeft;\r\n\t\t}\r\n\r\n\t\tleft = left + \"px\";\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\tgroup.scrollHeader(left);\r\n\t\t});\r\n\t}\r\n\r\n\tremoveGroup(group){\r\n\t\tvar groupKey = group.level + \"_\" + group.key,\r\n\t\tindex;\r\n\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tdelete this.groups[groupKey];\r\n\r\n\t\t\tindex = this.groupList.indexOf(group);\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.groupList.splice(index, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nGroupRows.moduleName = \"groupRows\";\r\n\r\nexport default GroupRows;","import Module from '../../core/Module.js';\r\nimport Row from '../../core/row/Row.js';\r\nimport Cell from '../../core/cell/Cell.js';\r\n\r\nimport defaultUndoers from './defaults/undoers.js';\r\nimport defaultRedoers from './defaults/redoers.js';\r\n\r\nclass History extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.history = [];\r\n\t\tthis.index = -1;\r\n\r\n\t\tthis.registerTableOption(\"history\", false); //enable edit history\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.history){\r\n\t\t\tthis.subscribe(\"cell-value-updated\", this.cellUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"cell-delete\", this.clearComponentHistory.bind(this));\r\n\t\t\tthis.subscribe(\"row-delete\", this.rowDeleted.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.clear.bind(this));\r\n\t\t\tthis.subscribe(\"row-added\", this.rowAdded.bind(this));\r\n\t\t\tthis.subscribe(\"row-move\", this.rowMoved.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"undo\", this.undo.bind(this));\r\n\t\tthis.registerTableFunction(\"redo\", this.redo.bind(this));\r\n\t\tthis.registerTableFunction(\"getHistoryUndoSize\", this.getHistoryUndoSize.bind(this));\r\n\t\tthis.registerTableFunction(\"getHistoryRedoSize\", this.getHistoryRedoSize.bind(this));\r\n\t\tthis.registerTableFunction(\"clearHistory\", this.clear.bind(this));\r\n\t}\r\n\r\n\trowMoved(from, to, after){\r\n\t\tthis.action(\"rowMove\", from, {posFrom:this.table.rowManager.getRowPosition(from), posTo:this.table.rowManager.getRowPosition(to), to:to, after:after});\r\n\t}\r\n\r\n\trowAdded(row, data, pos, index){\r\n\t\tthis.action(\"rowAdd\", row, {data:data, pos:pos, index:index});\r\n\t}\r\n\r\n\trowDeleted(row){\r\n\t\tvar index, rows;\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\r\n\t\t\trows = row.getComponent().getGroup().rows\r\n\t\t\tindex = rows.indexOf(row);\r\n\r\n\t\t\tif(index){\r\n\t\t\t\tindex = rows[index-1];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tindex = row.table.rowManager.getRowIndex(row);\r\n\r\n\t\t\tif(index){\r\n\t\t\t\tindex = row.table.rowManager.rows[index-1];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.action(\"rowDelete\", row, {data:row.getData(), pos:!index, index:index});\r\n\t}\r\n\r\n\tcellUpdated(cell){\r\n\t\tthis.action(\"cellEdit\", cell, {oldValue:cell.oldValue, newValue:cell.value});\r\n\t}\r\n\r\n\tclear(){\r\n\t\tthis.history = [];\r\n\t\tthis.index = -1;\r\n\t}\r\n\r\n\taction(type, component, data){\r\n\t\tthis.history = this.history.slice(0, this.index + 1);\r\n\r\n\t\tthis.history.push({\r\n\t\t\ttype:type,\r\n\t\t\tcomponent:component,\r\n\t\t\tdata:data,\r\n\t\t});\r\n\r\n\t\tthis.index ++;\r\n\t}\r\n\r\n\tgetHistoryUndoSize(){\r\n\t\treturn this.index + 1;\r\n\t}\r\n\r\n\tgetHistoryRedoSize(){\r\n\t\treturn this.history.length - (this.index + 1);\r\n\t}\r\n\r\n\tclearComponentHistory(component){\r\n\t\tvar index = this.history.findIndex(function(item){\r\n\t\t\treturn item.component === component;\r\n\t\t});\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.history.splice(index, 1);\r\n\t\t\tif(index <= this.index){\r\n\t\t\t\tthis.index--;\r\n\t\t\t}\r\n\r\n\t\t\tthis.clearComponentHistory(component);\r\n\t\t}\r\n\t}\r\n\r\n\tundo(){\r\n\t\tif(this.index > -1){\r\n\t\t\tlet action = this.history[this.index];\r\n\r\n\t\t\tHistory.undoers[action.type].call(this, action);\r\n\r\n\t\t\tthis.index--;\r\n\r\n\t\t\tthis.dispatchExternal(\"historyUndo\", action.type, action.component.getComponent(), action.data);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"History Undo Error - No more history to undo\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tredo(){\r\n\t\tif(this.history.length-1 > this.index){\r\n\r\n\t\t\tthis.index++;\r\n\r\n\t\t\tlet action = this.history[this.index];\r\n\r\n\t\t\tHistory.redoers[action.type].call(this, action);\r\n\r\n\t\t\tthis.dispatchExternal(\"historyRedo\", action.type, action.component.getComponent(), action.data);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"History Redo Error - No more history to redo\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//rebind rows to new element after deletion\r\n\t_rebindRow(oldRow, newRow){\r\n\t\tthis.history.forEach(function(action){\r\n\t\t\tif(action.component instanceof Row){\r\n\t\t\t\tif(action.component === oldRow){\r\n\t\t\t\t\taction.component = newRow;\r\n\t\t\t\t}\r\n\t\t\t}else if(action.component instanceof Cell){\r\n\t\t\t\tif(action.component.row === oldRow){\r\n\t\t\t\t\tvar field = action.component.column.getField();\r\n\r\n\t\t\t\t\tif(field){\r\n\t\t\t\t\t\taction.component = newRow.getCell(field);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n\r\nHistory.moduleName = \"history\";\r\n\r\n//load defaults\r\nHistory.undoers = defaultUndoers;\r\nHistory.redoers = defaultRedoers;\r\n\r\nexport default History;","export default {\r\n\tcellEdit: function(action){\r\n\t\taction.component.setValueProcessData(action.data.oldValue);\r\n\t\taction.component.cellRendered();\r\n\t},\r\n\r\n\trowAdd: function(action){\r\n\t\taction.component.deleteActual();\r\n\t},\r\n\r\n\trowDelete: function(action){\r\n\t\tvar newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index);\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tthis.table.modules.groupRows.updateGroupRows(true);\r\n\t\t}\r\n\r\n\t\tthis._rebindRow(action.component, newRow);\r\n\t},\r\n\r\n\trowMove: function(action){\r\n\t\tthis.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posFrom], !action.data.after);\r\n\t\tthis.table.rowManager.redraw();\r\n\t},\r\n};","export default {\r\n\tcellEdit: function(action){\r\n\t\taction.component.setValueProcessData(action.data.newValue);\r\n\t\taction.component.cellRendered();\r\n\t},\r\n\r\n\trowAdd: function(action){\r\n\t\tvar newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index);\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tthis.table.modules.groupRows.updateGroupRows(true);\r\n\t\t}\r\n\r\n\t\tthis._rebindRow(action.component, newRow);\r\n\t},\r\n\r\n\trowDelete:function(action){\r\n\t\taction.component.deleteActual();\r\n\t},\r\n\r\n\trowMove: function(action){\r\n\t\tthis.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posTo], action.data.after);\r\n\t\tthis.table.rowManager.redraw();\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\nimport Column from '../../core/column/Column.js';\r\n\r\nclass HtmlTableImport extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.fieldIndex = [];\r\n\t\tthis.hasIndex = false;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.tableElementCheck();\r\n\t}\r\n\r\n\ttableElementCheck(){\r\n\t\tif(this.table.originalElement && this.table.originalElement.tagName === \"TABLE\"){\r\n\t\t\tif(this.table.originalElement.childNodes.length){\r\n\t\t\t\tthis.parseTable();\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Unable to parse data from empty table tag, Tabulator should be initialized on a div tag unless importing data from a table element.\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tparseTable(){\r\n\t\tvar element = this.table.originalElement,\r\n\t\toptions = this.table.options,\r\n\t\tcolumns = options.columns,\r\n\t\theaders = element.getElementsByTagName(\"th\"),\r\n\t\trows = element.getElementsByTagName(\"tbody\")[0],\r\n\t\tdata = [],\r\n\t\tnewTable;\r\n\r\n\t\tthis.hasIndex = false;\r\n\r\n\t\tthis.dispatchExternal(\"htmlImporting\");\r\n\r\n\t\trows = rows ? rows.getElementsByTagName(\"tr\") : [];\r\n\r\n\t\t//check for Tabulator inline options\r\n\t\tthis._extractOptions(element, options);\r\n\r\n\t\tif(headers.length){\r\n\t\t\tthis._extractHeaders(headers, rows);\r\n\t\t}else{\r\n\t\t\tthis._generateBlankHeaders(headers, rows);\r\n\t\t}\r\n\r\n\t\t//iterate through table rows and build data set\r\n\t\tfor(var index = 0; index < rows.length; index++){\r\n\t\t\tvar row = rows[index],\r\n\t\t\tcells = row.getElementsByTagName(\"td\"),\r\n\t\t\titem = {};\r\n\r\n\t\t\t//create index if the dont exist in table\r\n\t\t\tif(!this.hasIndex){\r\n\t\t\t\titem[options.index] = index;\r\n\t\t\t}\r\n\r\n\t\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\t\tvar cell = cells[i];\r\n\t\t\t\tif(typeof this.fieldIndex[i] !== \"undefined\"){\r\n\t\t\t\t\titem[this.fieldIndex[i]] = cell.innerHTML;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//add row data to item\r\n\t\t\tdata.push(item);\r\n\t\t}\r\n\r\n\t\toptions.data = data;\r\n\r\n\t\tthis.dispatchExternal(\"htmlImported\");\r\n\t}\r\n\r\n\t//extract tabulator attribute options\r\n\t_extractOptions(element, options, defaultOptions){\r\n\t\tvar attributes = element.attributes;\r\n\t\tvar optionsArr = defaultOptions ? Object.keys(defaultOptions) : Object.keys(options);\r\n\t\tvar optionsList = {};\r\n\r\n\t\toptionsArr.forEach((item) => {\r\n\t\t\toptionsList[item.toLowerCase()] = item;\r\n\t\t});\r\n\r\n\t\tfor(var index in attributes){\r\n\t\t\tvar attrib = attributes[index];\r\n\t\t\tvar name;\r\n\r\n\t\t\tif(attrib && typeof attrib == \"object\" && attrib.name && attrib.name.indexOf(\"tabulator-\") === 0){\r\n\t\t\t\tname = attrib.name.replace(\"tabulator-\", \"\");\r\n\r\n\t\t\t\tif(typeof optionsList[name] !== \"undefined\"){\r\n\t\t\t\t\toptions[optionsList[name]] = this._attribValue(attrib.value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//get value of attribute\r\n\t_attribValue(value){\r\n\t\tif(value === \"true\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif(value === \"false\"){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\t//find column if it has already been defined\r\n\t_findCol(title){\r\n\t\tvar match = this.table.options.columns.find((column) => {\r\n\t\t\treturn column.title === title;\r\n\t\t});\r\n\r\n\t\treturn match || false;\r\n\t}\r\n\r\n\t//extract column from headers\r\n\t_extractHeaders(headers, rows){\r\n\t\tfor(var index = 0; index < headers.length; index++){\r\n\t\t\tvar header = headers[index],\r\n\t\t\texists = false,\r\n\t\t\tcol = this._findCol(header.textContent),\r\n\t\t\twidth, attributes;\r\n\r\n\t\t\tif(col){\r\n\t\t\t\texists = true;\r\n\t\t\t}else{\r\n\t\t\t\tcol = {title:header.textContent.trim()};\r\n\t\t\t}\r\n\r\n\t\t\tif(!col.field) {\r\n\t\t\t\tcol.field = header.textContent.trim().toLowerCase().replace(\" \", \"_\");\r\n\t\t\t}\r\n\r\n\t\t\twidth = header.getAttribute(\"width\");\r\n\r\n\t\t\tif(width && !col.width)\t{\r\n\t\t\t\tcol.width = width;\r\n\t\t\t}\r\n\r\n\t\t\t//check for Tabulator inline options\r\n\t\t\tthis._extractOptions(header, col, this.table.columnManager.optionsList.registeredDefaults);\r\n\r\n\t\t\tthis.fieldIndex[index] = col.field;\r\n\r\n\t\t\tif(col.field == this.table.options.index){\r\n\t\t\t\tthis.hasIndex = true;\r\n\t\t\t}\r\n\r\n\t\t\tif(!exists){\r\n\t\t\t\tthis.table.options.columns.push(col);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\r\n\t//generate blank headers\r\n\t_generateBlankHeaders(headers, rows){\r\n\t\tfor(var index = 0; index < headers.length; index++){\r\n\t\t\tvar header = headers[index],\r\n\t\t\tcol = {title:\"\", field:\"col\" + index};\r\n\r\n\t\t\tthis.fieldIndex[index] = col.field;\r\n\r\n\t\t\tvar width = header.getAttribute(\"width\");\r\n\r\n\t\t\tif(width){\r\n\t\t\t\tcol.width = width;\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.options.columns.push(col);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nHtmlTableImport.moduleName = \"htmlTableImport\";\r\n\r\nexport default HtmlTableImport;","import csv from './importers/csv.js';\r\nimport json from './importers/json.js';\r\n\r\nexport default {\r\n\tcsv:csv,\r\n\tjson:json,\r\n};","function csvImporter(input){\r\n var data = [],\r\n row = 0, \r\n col = 0,\r\n inQuote = false;\r\n \r\n //Iterate over each character\r\n for (let index = 0; index < input.length; index++) {\r\n let char = input[index], \r\n nextChar = input[index+1]; \r\n \r\n //Initialize empty row\r\n if(!data[row]){\r\n data[row] = [];\r\n }\r\n\r\n //Initialize empty column\r\n if(!data[row][col]){\r\n data[row][col] = \"\";\r\n }\r\n \r\n //Handle quotation mark inside string\r\n if (char == '\"' && inQuote && nextChar == '\"') { \r\n data[row][col] += char; \r\n index++;\r\n continue; \r\n }\r\n \r\n //Begin / End Quote\r\n if (char == '\"') { \r\n inQuote = !inQuote;\r\n continue;\r\n }\r\n \r\n //Next column (if not in quote)\r\n if (char == ',' && !inQuote) { \r\n col++;\r\n continue; \r\n }\r\n \r\n //New row if new line and not in quote (CRLF) \r\n if (char == '\\r' && nextChar == '\\n' && !inQuote) { \r\n col = 0; \r\n row++; \r\n index++; \r\n continue; \r\n }\r\n \r\n //New row if new line and not in quote (CR or LF) \r\n if ((char == '\\r' || char == '\\n') && !inQuote) { \r\n col = 0;\r\n row++;\r\n continue; \r\n }\r\n\r\n //Normal Character, append to column\r\n data[row][col] += char;\r\n }\r\n\r\n return data;\r\n}\r\n\r\nexport default csvImporter;","export default function(input){\r\n try {\r\n return JSON.parse(input);\r\n } catch(e) {\r\n console.warn(\"JSON Import Error - File contents is invalid JSON\", e);\r\n return Promise.reject();\r\n }\r\n}","import Module from '../../core/Module.js';\r\n\r\nimport defaultImporters from './defaults/importers.js';\r\n\r\nclass Import extends Module{\r\n \r\n constructor(table){\r\n super(table);\r\n \r\n this.registerTableOption(\"importFormat\");\r\n this.registerTableOption(\"importReader\", \"text\");\r\n }\r\n \r\n initialize(){\r\n this.registerTableFunction(\"import\", this.importFromFile.bind(this));\r\n\r\n if(this.table.options.importFormat){\r\n this.subscribe(\"data-loading\", this.loadDataCheck.bind(this), 10);\r\n this.subscribe(\"data-load\", this.loadData.bind(this), 10);\r\n }\r\n }\r\n\r\n loadDataCheck(data){\r\n return typeof data === \"string\";\r\n }\r\n\r\n loadData(data, params, config, silent, previousData){\r\n return this.importData(this.lookupImporter(), data)\r\n .then(this.structureData.bind(this))\r\n .catch((err) => {\r\n console.error(\"Import Error:\", err || \"Unable to import data\")\r\n return Promise.reject(err);\r\n })\r\n }\r\n\r\n lookupImporter(importFormat){\r\n var importer;\r\n \r\n if(!importFormat){\r\n importFormat = this.table.options.importFormat;\r\n }\r\n \r\n if(typeof importFormat === \"string\"){\r\n importer = Import.importers[importFormat];\r\n }else{\r\n importer = importFormat;\r\n }\r\n\r\n if(!importer){\r\n console.error(\"Import Error - Importer not found:\", importFormat);\r\n }\r\n \r\n return importer;\r\n }\r\n \r\n importFromFile(importFormat, extension){\r\n var importer = this.lookupImporter(importFormat);\r\n \r\n if(importer){\r\n return this.pickFile(extension)\r\n .then(this.importData.bind(this, importer))\r\n .then(this.structureData.bind(this))\r\n .then(this.setData.bind(this))\r\n .catch((err) => {\r\n console.error(\"Import Error:\", err || \"Unable to import file\")\r\n return Promise.reject(err);\r\n })\r\n }\r\n }\r\n \r\n pickFile(extensions){\r\n return new Promise((resolve, reject) => {\r\n var input = document.createElement(\"input\");\r\n input.type = \"file\";\r\n input.accept = extensions;\r\n \r\n input.addEventListener(\"change\", (e) => {\r\n var file = input.files[0],\r\n reader = new FileReader(),\r\n data;\r\n \r\n switch(this.table.options.importReader){\r\n case \"buffer\":\r\n reader.readAsArrayBuffer(file);\r\n break;\r\n\r\n case \"binary\":\r\n reader.readAsBinaryString(file);\r\n break;\r\n\r\n case \"url\":\r\n reader.readAsDataURL(file);\r\n break;\r\n\r\n case \"text\":\r\n default:\r\n reader.readAsText(file);\r\n }\r\n \r\n reader.onload = (e) => {\r\n resolve(reader.result)\r\n };\r\n \r\n reader.onerror = (e) => {\r\n console.warn(\"File Load Error - Unable to read file\");\r\n reject();\r\n };\r\n });\r\n \r\n input.click();\r\n });\r\n }\r\n \r\n importData(importer, fileContents){\r\n var data = importer.call(this.table, fileContents);\r\n \r\n if(data instanceof Promise){\r\n return data;\r\n }else{\r\n return data ? Promise.resolve(data) : Promise.reject();\r\n }\r\n }\r\n\r\n structureData(parsedData){\r\n var data = [];\r\n \r\n if(Array.isArray(parsedData) && parsedData.length && Array.isArray(parsedData[0])){\r\n if(this.table.options.autoColumns){\r\n data = this.structureArrayToObject(parsedData);\r\n }else{\r\n data = this.structureArrayToColumns(parsedData);\r\n }\r\n\r\n return data;\r\n }else{\r\n return parsedData;\r\n }\r\n }\r\n\r\n structureArrayToObject(parsedData){\r\n var columns = parsedData.shift();\r\n\r\n var data = parsedData.map((values) => {\r\n var row = {};\r\n\r\n columns.forEach((key, i) => {\r\n row[key] = values[i];\r\n })\r\n\r\n return row;\r\n })\r\n\r\n return data;\r\n }\r\n\r\n structureArrayToColumns(parsedData){\r\n var data = [],\r\n columns = this.table.getColumns();\r\n\r\n //remove first row if it is the column names\r\n if(columns[0] && parsedData[0][0]){\r\n if(columns[0].getDefinition().title === parsedData[0][0]){\r\n parsedData.shift();\r\n }\r\n }\r\n \r\n //convert row arrays to objects\r\n parsedData.forEach((rowData) => {\r\n var row = {};\r\n\r\n rowData.forEach((value, index) => {\r\n var column = columns[index];\r\n\r\n if(column){\r\n row[column.getField()] = value;\r\n }\r\n })\r\n\r\n data.push(row);\r\n });\r\n\r\n return data;\r\n }\r\n \r\n setData(data){\r\n return this.table.setData(data);\r\n }\r\n}\r\n\r\nImport.moduleName = \"import\";\r\n\r\n//load defaults\r\nImport.importers = defaultImporters;\r\n\r\nexport default Import;","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport Cell from '../../core/cell/Cell';\r\nimport Column from '../../core/column/Column';\r\n\r\nclass Interaction extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.eventMap = {\r\n\t\t\t//row events\r\n\t\t\trowClick:\"row-click\",\r\n\t\t\trowDblClick:\"row-dblclick\",\r\n\t\t\trowContext:\"row-contextmenu\",\r\n\t\t\trowMouseEnter:\"row-mouseenter\",\r\n\t\t\trowMouseLeave:\"row-mouseleave\",\r\n\t\t\trowMouseOver:\"row-mouseover\",\r\n\t\t\trowMouseOut:\"row-mouseout\",\r\n\t\t\trowMouseMove:\"row-mousemove\",\r\n\t\t\trowTap:\"row\",\r\n\t\t\trowDblTap:\"row\",\r\n\t\t\trowTapHold:\"row\",\r\n\r\n\t\t\t//cell events\r\n\t\t\tcellClick:\"cell-click\",\r\n\t\t\tcellDblClick:\"cell-dblclick\",\r\n\t\t\tcellContext:\"cell-contextmenu\",\r\n\t\t\tcellMouseEnter:\"cell-mouseenter\",\r\n\t\t\tcellMouseLeave:\"cell-mouseleave\",\r\n\t\t\tcellMouseOver:\"cell-mouseover\",\r\n\t\t\tcellMouseOut:\"cell-mouseout\",\r\n\t\t\tcellMouseMove:\"cell-mousemove\",\r\n\t\t\tcellTap:\"cell\",\r\n\t\t\tcellDblTap:\"cell\",\r\n\t\t\tcellTapHold:\"cell\",\r\n\r\n\t\t\t//column header events\r\n\t\t\theaderClick:\"column-click\",\r\n\t\t\theaderDblClick:\"column-dblclick\",\r\n\t\t\theaderContext:\"column-contextmenu\",\r\n\t\t\theaderMouseEnter:\"column-mouseenter\",\r\n\t\t\theaderMouseLeave:\"column-mouseleave\",\r\n\t\t\theaderMouseOver:\"column-mouseover\",\r\n\t\t\theaderMouseOut:\"column-mouseout\",\r\n\t\t\theaderMouseMove:\"column-mousemove\",\r\n\t\t\theaderTap:\"column\",\r\n\t\t\theaderDblTap:\"column\",\r\n\t\t\theaderTapHold:\"column\",\r\n\r\n\t\t\t//group header\r\n\t\t\tgroupClick:\"group-click\",\r\n\t\t\tgroupDblClick:\"group-dblclick\",\r\n\t\t\tgroupContext:\"group-contextmenu\",\r\n\t\t\tgroupMouseEnter:\"group-mouseenter\",\r\n\t\t\tgroupMouseLeave:\"group-mouseleave\",\r\n\t\t\tgroupMouseOver:\"group-mouseover\",\r\n\t\t\tgroupMouseOut:\"group-mouseout\",\r\n\t\t\tgroupMouseMove:\"group-mousemove\",\r\n\t\t\tgroupTap:\"group\",\r\n\t\t\tgroupDblTap:\"group\",\r\n\t\t\tgroupTapHold:\"group\",\r\n\t\t}\r\n\r\n\t\tthis.subscribers = {};\r\n\r\n\t\tthis.touchSubscribers = {};\r\n\r\n\t\tthis.columnSubscribers = {};\r\n\r\n\t\tthis.touchWatchers = {\r\n\t\t\trow:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tcell:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tcolumn:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tgroup:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.registerColumnOption(\"headerClick\");\r\n\t\tthis.registerColumnOption(\"headerDblClick\");\r\n\t\tthis.registerColumnOption(\"headerContext\");\r\n\t\tthis.registerColumnOption(\"headerMouseEnter\");\r\n\t\tthis.registerColumnOption(\"headerMouseLeave\");\r\n\t\tthis.registerColumnOption(\"headerMouseOver\");\r\n\t\tthis.registerColumnOption(\"headerMouseOut\");\r\n\t\tthis.registerColumnOption(\"headerMouseMove\");\r\n\t\tthis.registerColumnOption(\"headerTap\");\r\n\t\tthis.registerColumnOption(\"headerDblTap\");\r\n\t\tthis.registerColumnOption(\"headerTapHold\");\r\n\r\n\t\tthis.registerColumnOption(\"cellClick\");\r\n\t\tthis.registerColumnOption(\"cellDblClick\");\r\n\t\tthis.registerColumnOption(\"cellContext\");\r\n\t\tthis.registerColumnOption(\"cellMouseEnter\");\r\n\t\tthis.registerColumnOption(\"cellMouseLeave\");\r\n\t\tthis.registerColumnOption(\"cellMouseOver\");\r\n\t\tthis.registerColumnOption(\"cellMouseOut\");\r\n\t\tthis.registerColumnOption(\"cellMouseMove\");\r\n\t\tthis.registerColumnOption(\"cellTap\");\r\n\t\tthis.registerColumnOption(\"cellDblTap\");\r\n\t\tthis.registerColumnOption(\"cellTapHold\");\r\n\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.initializeExternalEvents();\r\n\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this))\r\n\t\tthis.subscribe(\"cell-dblclick\", this.cellContentsSelectionFixer.bind(this))\r\n\t}\r\n\r\n\tcellContentsSelectionFixer(e, cell){\r\n\t\tif(this.table.modExists(\"edit\")){\r\n\t\t\tif (this.table.modules.edit.currentCell === this){\r\n\t\t\t\treturn; //prevent instant selection of editor content\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\ttry{\r\n\t\t\tif (document.selection) { // IE\r\n\t\t\t\tvar range = document.body.createTextRange();\r\n\t\t\t\trange.moveToElementText(this.element);\r\n\t\t\t\trange.select();\r\n\t\t\t} else if (window.getSelection) {\r\n\t\t\t\tvar range = document.createRange();\r\n\t\t\t\trange.selectNode(this.element);\r\n\t\t\t\twindow.getSelection().removeAllRanges();\r\n\t\t\t\twindow.getSelection().addRange(range);\r\n\t\t\t}\r\n\t\t}catch(e){}\r\n\t}\r\n\r\n\tinitializeExternalEvents(){\r\n\t\tfor(let key in this.eventMap){\r\n\t\t\tthis.subscriptionChangeExternal(key, this.subscriptionChanged.bind(this, key))\r\n\t\t}\r\n\t}\r\n\r\n\tsubscriptionChanged(key, added){\r\n\t\tvar index;\r\n\r\n\t\tif(added){\r\n\t\t\tif(!this.subscribers[key]){\r\n\t\t\t\tif(this.eventMap[key].includes(\"-\")){\r\n\t\t\t\t\tthis.subscribers[key] = this.handle.bind(this, key);\r\n\t\t\t\t\tthis.subscribe(this.eventMap[key], this.subscribers[key]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.subscribeTouchEvents(key);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.eventMap[key].includes(\"-\")){\r\n\t\t\t\tif(this.subscribers[key] && !this.columnSubscribers[key] && !this.subscribedExternal(key)){\r\n\t\t\t\t\tthis.unsubscribe(this.eventMap[key], this.subscribers[key]);\r\n\t\t\t\t\tdelete this.subscribers[key];\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.unsubscribeTouchEvents(key);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tsubscribeTouchEvents(key){\r\n\t\tvar type = this.eventMap[key];\r\n\r\n\t\tif(!this.touchSubscribers[type + \"-touchstart\"]){\r\n\t\t\tthis.touchSubscribers[type + \"-touchstart\"] = this.handleTouch.bind(this, type, \"start\");\r\n\t\t\tthis.touchSubscribers[type + \"-touchend\"] = this.handleTouch.bind(this, type, \"end\");\r\n\r\n\t\t\tthis.subscribe(type + \"-touchstart\", this.touchSubscribers[type + \"-touchstart\"]);\r\n\t\t\tthis.subscribe(type + \"-touchend\", this.touchSubscribers[type + \"-touchend\"]);\r\n\t\t}\r\n\r\n\t\tthis.subscribers[key] = true;\r\n\t}\r\n\r\n\tunsubscribeTouchEvents(key){\r\n\t\tvar notouch = true,\r\n\t\ttype = this.eventMap[key];\r\n\r\n\t\tif(this.subscribers[key] && !this.subscribedExternal(key)){\r\n\t\t\tdelete this.subscribers[key];\r\n\r\n\t\t\tfor(let i in this.eventMap){\r\n\t\t\t\tif(this.eventMap[i] === type){\r\n\t\t\t\t\tif(this.subscribers[i]){\r\n\t\t\t\t\t\tnotouch = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(notouch){\r\n\t\t\t\tthis.unsubscribe(type + \"-touchstart\", this.touchSubscribers[type + \"-touchstart\"]);\r\n\t\t\t\tthis.unsubscribe(type + \"-touchend\", this.touchSubscribers[type + \"-touchend\"]);\r\n\r\n\t\t\t\tdelete this.touchSubscribers[type + \"-touchstart\"];\r\n\t\t\t\tdelete this.touchSubscribers[type + \"-touchend\"];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.definition;\r\n\r\n\t\tfor(let key in this.eventMap){\r\n\t\t\tif(def[key]){\r\n\t\t\t\tthis.subscriptionChanged(key, true);\r\n\r\n\t\t\t\tif(!this.columnSubscribers[key]){\r\n\t\t\t\t\tthis.columnSubscribers[key] = [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.columnSubscribers[key].push(column);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\thandle(action, e, component){\r\n\t\tthis.dispatchEvent(action, e, component);\r\n\t}\r\n\r\n\thandleTouch(type, action, e, component){\r\n\t\tvar watchers = this.touchWatchers[type];\r\n\r\n\t\tif(type === \"column\"){\r\n\t\t\ttype = \"header\";\r\n\t\t}\r\n\r\n\t\tswitch(action){\r\n\t\t\tcase \"start\":\r\n\t\t\twatchers.tap = true;\r\n\r\n\t\t\tclearTimeout(watchers.tapHold);\r\n\r\n\t\t\twatchers.tapHold = setTimeout(() => {\r\n\t\t\t\tclearTimeout(watchers.tapHold);\r\n\t\t\t\twatchers.tapHold = null;\r\n\r\n\t\t\t\twatchers.tap = null;\r\n\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\twatchers.tapDbl = null;\r\n\r\n\t\t\t\tthis.dispatchEvent(type + \"TapHold\", e, component);\r\n\t\t\t}, 1000);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"end\":\r\n\t\t\tif(watchers.tap){\r\n\r\n\t\t\t\twatchers.tap = null;\r\n\t\t\t\tthis.dispatchEvent(type + \"Tap\", e, component);\r\n\t\t\t}\r\n\r\n\t\t\tif(watchers.tapDbl){\r\n\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\twatchers.tapDbl = null;\r\n\r\n\t\t\t\tthis.dispatchEvent(type + \"DblTap\", e, component);\r\n\t\t\t}else{\r\n\t\t\t\twatchers.tapDbl = setTimeout(() => {\r\n\t\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\t\twatchers.tapDbl = null;\r\n\t\t\t\t}, 300);\r\n\t\t\t}\r\n\r\n\t\t\tclearTimeout(watchers.tapHold);\r\n\t\t\twatchers.tapHold = null;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tdispatchEvent(action, e, component){\r\n\t\tvar componentObj = component.getComponent(),\r\n\t\tcallback;\r\n\r\n\t\tif(this.columnSubscribers[action]){\r\n\r\n\t\t\tif(component instanceof Cell){\r\n\t\t\t\tcallback = component.column.definition[action];\r\n\t\t\t}else if(component instanceof Column){\r\n\t\t\t\tcallback = component.definition[action];\r\n\t\t\t}\r\n\r\n\t\t\tif(callback){\r\n\t\t\t\tcallback(e, componentObj);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(action, e, componentObj);\r\n\t}\r\n}\r\n\r\nInteraction.moduleName = \"interaction\";\r\n\r\nexport default Interaction;","import Module from '../../core/Module.js';\r\n\r\nimport defaultBindings from './defaults/bindings.js';\r\nimport defaultActions from './defaults/actions.js';\r\n\r\nclass Keybindings extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.watchKeys = null;\r\n\t\tthis.pressedKeys = null;\r\n\t\tthis.keyupBinding = false;\r\n\t\tthis.keydownBinding = false;\r\n\r\n\t\tthis.registerTableOption(\"keybindings\", {}); //array for keybindings\r\n\t\tthis.registerTableOption(\"tabEndNewRow\", false); //create new row when tab to end of table\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tvar bindings = this.table.options.keybindings,\r\n\t\tmergedBindings = {};\r\n\r\n\t\tthis.watchKeys = {};\r\n\t\tthis.pressedKeys = [];\r\n\r\n\t\tif(bindings !== false){\r\n\t\t\tObject.assign(mergedBindings, Keybindings.bindings)\r\n\t\t\tObject.assign(mergedBindings, bindings)\r\n\r\n\t\t\tthis.mapBindings(mergedBindings);\r\n\t\t\tthis.bindEvents();\r\n\t\t}\r\n\r\n\t\tthis.subscribe(\"table-destroy\", this.clearBindings.bind(this));\r\n\t}\r\n\r\n\tmapBindings(bindings){\r\n\t\tfor(let key in bindings){\r\n\t\t\tif(Keybindings.actions[key]){\r\n\t\t\t\tif(bindings[key]){\r\n\t\t\t\t\tif(typeof bindings[key] !== \"object\"){\r\n\t\t\t\t\t\tbindings[key] = [bindings[key]];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbindings[key].forEach((binding) => {\r\n\t\t\t\t\t\tvar bindingList = Array.isArray(binding) ? binding : [binding];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tbindingList.forEach((item) => {\r\n\t\t\t\t\t\t\tthis.mapBinding(key, item);\r\n\t\t\t\t\t\t});\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Key Binding Error - no such action:\", key);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmapBinding(action, symbolsList){\r\n\t\tvar binding = {\r\n\t\t\taction: Keybindings.actions[action],\r\n\t\t\tkeys: [],\r\n\t\t\tctrl: false,\r\n\t\t\tshift: false,\r\n\t\t\tmeta: false,\r\n\t\t};\r\n\r\n\t\tvar symbols = symbolsList.toString().toLowerCase().split(\" \").join(\"\").split(\"+\");\r\n\r\n\t\tsymbols.forEach((symbol) => {\r\n\t\t\tswitch(symbol){\r\n\t\t\t\tcase \"ctrl\":\r\n\t\t\t\tbinding.ctrl = true;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"shift\":\r\n\t\t\t\tbinding.shift = true;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"meta\":\r\n\t\t\t\tbinding.meta = true;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\tsymbol = isNaN(symbol) ? symbol.toUpperCase().charCodeAt(0) : parseInt(symbol);\r\n\t\t\t\tbinding.keys.push(symbol);\r\n\r\n\t\t\t\tif(!this.watchKeys[symbol]){\r\n\t\t\t\t\tthis.watchKeys[symbol] = [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.watchKeys[symbol].push(binding);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tbindEvents(){\r\n\t\tvar self = this;\r\n\r\n\t\tthis.keyupBinding = function(e){\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tvar bindings = self.watchKeys[code];\r\n\r\n\t\t\tif(bindings){\r\n\r\n\t\t\t\tself.pressedKeys.push(code);\r\n\r\n\t\t\t\tbindings.forEach(function(binding){\r\n\t\t\t\t\tself.checkBinding(e, binding);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.keydownBinding = function(e){\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tvar bindings = self.watchKeys[code];\r\n\r\n\t\t\tif(bindings){\r\n\r\n\t\t\t\tvar index = self.pressedKeys.indexOf(code);\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tself.pressedKeys.splice(index, 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.table.element.addEventListener(\"keydown\", this.keyupBinding);\r\n\r\n\t\tthis.table.element.addEventListener(\"keyup\", this.keydownBinding);\r\n\t}\r\n\r\n\tclearBindings(){\r\n\t\tif(this.keyupBinding){\r\n\t\t\tthis.table.element.removeEventListener(\"keydown\", this.keyupBinding);\r\n\t\t}\r\n\r\n\t\tif(this.keydownBinding){\r\n\t\t\tthis.table.element.removeEventListener(\"keyup\", this.keydownBinding);\r\n\t\t}\r\n\t}\r\n\r\n\tcheckBinding(e, binding){\r\n\t\tvar match = true;\r\n\r\n\t\tif(e.ctrlKey == binding.ctrl && e.shiftKey == binding.shift && e.metaKey == binding.meta){\r\n\t\t\tbinding.keys.forEach((key) => {\r\n\t\t\t\tvar index = this.pressedKeys.indexOf(key);\r\n\r\n\t\t\t\tif(index == -1){\r\n\t\t\t\t\tmatch = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tbinding.action.call(this, e);\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\nKeybindings.moduleName = \"keybindings\";\r\n\r\n//load defaults\r\nKeybindings.bindings = defaultBindings;\r\nKeybindings.actions = defaultActions;\r\n\r\nexport default Keybindings;","export default {\r\n\tnavPrev:\"shift + 9\",\r\n\tnavNext:9,\r\n\tnavUp:38,\r\n\tnavDown:40,\r\n\tscrollPageUp:33,\r\n\tscrollPageDown:34,\r\n\tscrollToStart:36,\r\n\tscrollToEnd:35,\r\n\tundo:[\"ctrl + 90\", \"meta + 90\"],\r\n\tredo:[\"ctrl + 89\", \"meta + 89\"],\r\n\tcopyToClipboard:[\"ctrl + 67\", \"meta + 89\"],\r\n};","export default {\r\n\tkeyBlock:function(e){\r\n\t\te.stopPropagation();\r\n\t\te.preventDefault();\r\n\t},\r\n\tscrollPageUp:function(e){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tnewPos = rowManager.scrollTop - rowManager.element.clientHeight,\r\n\t\tscrollMax = rowManager.element.scrollHeight;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\tif(newPos >= 0){\r\n\t\t\t\trowManager.element.scrollTop = newPos;\r\n\t\t\t}else{\r\n\t\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[0]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tscrollPageDown:function(e){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tnewPos = rowManager.scrollTop + rowManager.element.clientHeight,\r\n\t\tscrollMax = rowManager.element.scrollHeight;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\tif(newPos <= scrollMax){\r\n\t\t\t\trowManager.element.scrollTop = newPos;\r\n\t\t\t}else{\r\n\t\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\r\n\t},\r\n\tscrollToStart:function(e){\r\n\t\tvar rowManager = this.table.rowManager;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[0]);\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tscrollToEnd:function(e){\r\n\t\tvar rowManager = this.table.rowManager;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]);\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tnavPrev:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-prev\", e);\r\n\t},\r\n\r\n\tnavNext:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-next\", e);\r\n\t},\r\n\r\n\tnavLeft:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-left\", e);\r\n\t},\r\n\r\n\tnavRight:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-right\", e);\r\n\t},\r\n\r\n\tnavUp:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-up\", e);\r\n\t},\r\n\r\n\tnavDown:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-down\", e);\r\n\t},\r\n\r\n\tundo:function(e){\r\n\t\tvar cell = false;\r\n\t\tif(this.table.options.history && this.table.modExists(\"history\") && this.table.modExists(\"edit\")){\r\n\r\n\t\t\tcell = this.table.modules.edit.currentCell;\r\n\r\n\t\t\tif(!cell){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tthis.table.modules.history.undo();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tredo:function(e){\r\n\t\tvar cell = false;\r\n\t\tif(this.table.options.history && this.table.modExists(\"history\") && this.table.modExists(\"edit\")){\r\n\r\n\t\t\tcell = this.table.modules.edit.currentCell;\r\n\r\n\t\t\tif(!cell){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tthis.table.modules.history.redo();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tcopyToClipboard:function(e){\r\n\t\tif(!this.table.modules.edit.currentCell){\r\n\t\t\tif(this.table.modExists(\"clipboard\", true)){\r\n\t\t\t\tthis.table.modules.clipboard.copy(false, true);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nclass Menu extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.menuContainer = null;\r\n\t\tthis.nestedMenuBlock = false;\r\n\t\t\r\n\t\tthis.currentComponent = null;\r\n\t\tthis.rootPopup = null;\r\n\t\t\r\n\t\tthis.columnSubscribers = {};\r\n\t\t\r\n\t\tthis.registerTableOption(\"menuContainer\", undefined); //deprecated\r\n\r\n\t\tthis.registerTableOption(\"rowContextMenu\", false);\r\n\t\tthis.registerTableOption(\"rowClickMenu\", false);\r\n\t\tthis.registerTableOption(\"groupContextMenu\", false);\r\n\t\tthis.registerTableOption(\"groupClickMenu\", false);\r\n\t\t\r\n\t\tthis.registerColumnOption(\"headerContextMenu\");\r\n\t\tthis.registerColumnOption(\"headerClickMenu\");\r\n\t\tthis.registerColumnOption(\"headerMenu\");\r\n\t\tthis.registerColumnOption(\"headerMenuIcon\");\r\n\t\tthis.registerColumnOption(\"contextMenu\");\r\n\t\tthis.registerColumnOption(\"clickMenu\");\r\n\t\t\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.deprecationCheck();\r\n\t\tthis.initializeRowWatchers();\r\n\t\tthis.initializeGroupWatchers();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\r\n\tdeprecationCheck(){\r\n\t\tif(typeof this.table.options.menuContainer !== \"undefined\"){\r\n\t\t\tconsole.warn(\"Use of the menuContainer option is now deprecated. Please use the popupContainer option instead\");\r\n\r\n\t\t\tthis.table.options.popupContainer = this.table.options.menuContainer;\r\n\t\t}\r\n\t}\t\r\n\t\r\n\tinitializeRowWatchers(){\r\n\t\tif(this.table.options.rowContextMenu){\r\n\t\t\tthis.subscribe(\"row-contextmenu\", this.loadMenuEvent.bind(this, this.table.options.rowContextMenu));\r\n\t\t\tthis.table.on(\"rowTapHold\", this.loadMenuEvent.bind(this, this.table.options.rowContextMenu));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.rowClickMenu){\r\n\t\t\tthis.subscribe(\"row-click\", this.loadMenuEvent.bind(this, this.table.options.rowClickMenu));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeGroupWatchers(){\r\n\t\tif(this.table.options.groupContextMenu){\r\n\t\t\tthis.subscribe(\"group-contextmenu\", this.loadMenuEvent.bind(this, this.table.options.groupContextMenu));\r\n\t\t\tthis.table.on(\"groupTapHold\", this.loadMenuEvent.bind(this, this.table.options.groupContextMenu));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.groupClickMenu){\r\n\t\t\tthis.subscribe(\"group-click\", this.loadMenuEvent.bind(this, this.table.options.groupClickMenu));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar options = [\"headerContextMenu\", \"headerClickMenu\"],\r\n\t\tdef = column.definition;\r\n\t\t\r\n\t\t//handle column events\r\n\t\tif(def.headerContextMenu && !this.columnSubscribers.headerContextMenu){\r\n\t\t\tthis.columnSubscribers.headerContextMenu = this.loadMenuTableColumnEvent.bind(this, \"headerContextMenu\");\r\n\t\t\tthis.subscribe(\"column-contextmenu\", this.columnSubscribers.headerContextMenu);\r\n\t\t\tthis.table.on(\"headerTapHold\", this.loadMenuTableColumnEvent.bind(this, \"headerContextMenu\"))\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerClickMenu && !this.columnSubscribers.headerClickMenu){\r\n\t\t\tthis.columnSubscribers.headerClickMenu = this.loadMenuTableColumnEvent.bind(this, \"headerClickMenu\");\r\n\t\t\tthis.subscribe(\"column-click\", this.columnSubscribers.headerClickMenu);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerMenu){\r\n\t\t\tthis.initializeColumnHeaderMenu(column);\r\n\t\t}\r\n\t\t\r\n\t\t//handle cell events\r\n\t\tif(def.contextMenu && !this.columnSubscribers.contextMenu){\r\n\t\t\tthis.columnSubscribers.contextMenu = this.loadMenuTableCellEvent.bind(this, \"contextMenu\");\r\n\t\t\tthis.subscribe(\"cell-contextmenu\", this.columnSubscribers.contextMenu);\r\n\t\t\tthis.table.on(\"cellTapHold\", this.loadMenuTableCellEvent.bind(this, \"contextMenu\"))\r\n\t\t}\r\n\t\t\r\n\t\tif(def.clickMenu && !this.columnSubscribers.clickMenu){\r\n\t\t\tthis.columnSubscribers.clickMenu = this.loadMenuTableCellEvent.bind(this, \"clickMenu\");\r\n\t\t\tthis.subscribe(\"cell-click\", this.columnSubscribers.clickMenu);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumnHeaderMenu(column){\r\n\t\tvar icon = column.definition.headerMenuIcon,\r\n\t\theaderMenuEl;\r\n\t\t\r\n\t\theaderMenuEl = document.createElement(\"span\");\r\n\t\theaderMenuEl.classList.add(\"tabulator-header-popup-button\");\r\n\r\n\t\tif(icon){\r\n\t\t\tif(typeof icon === \"function\"){\r\n\t\t\t\ticon = icon(column.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tif(icon instanceof HTMLElement){\r\n\t\t\t\theaderMenuEl.appendChild(icon);\r\n\t\t\t}else{\r\n\t\t\t\theaderMenuEl.innerHTML = icon;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\theaderMenuEl.innerHTML = \"⋮\";\r\n\t\t}\r\n\t\t\r\n\t\theaderMenuEl.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tthis.loadMenuEvent(column.definition.headerMenu, e, column);\r\n\t\t});\r\n\t\t\r\n\t\tcolumn.titleElement.insertBefore(headerMenuEl, column.titleElement.firstChild);\r\n\t}\r\n\t\r\n\tloadMenuTableCellEvent(option, e, cell){\r\n\t\tif(cell._cell){\r\n\t\t\tcell = cell._cell;\r\n\t\t}\r\n\t\t\r\n\t\tif(cell.column.definition[option]){\r\n\t\t\tthis.loadMenuEvent(cell.column.definition[option], e, cell);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadMenuTableColumnEvent(option, e, column){\r\n\t\tif(column._column){\r\n\t\t\tcolumn = column._column;\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition[option]){\r\n\t\t\tthis.loadMenuEvent(column.definition[option], e, column);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadMenuEvent(menu, e, component){\r\n\t\tif(component._group){\r\n\t\t\tcomponent = component._group;\r\n\t\t}else if(component._row){\r\n\t\t\tcomponent = component._row;\r\n\t\t}\r\n\t\t\r\n\t\tmenu = typeof menu == \"function\" ? menu.call(this.table, e, component.getComponent()) : menu;\r\n\t\t\r\n\t\tthis.loadMenu(e, component, menu);\r\n\t}\r\n\t\r\n\tloadMenu(e, component, menu, parentEl, parentPopup){\r\n\t\tvar touch = !(e instanceof MouseEvent),\t\t\r\n\t\tmenuEl = document.createElement(\"div\"),\r\n\t\tpopup;\r\n\t\t\r\n\t\tmenuEl.classList.add(\"tabulator-menu\");\r\n\t\t\r\n\t\tif(!touch){\r\n\t\t\te.preventDefault();\r\n\t\t}\r\n\t\t\r\n\t\t//abort if no menu set\r\n\t\tif(!menu || !menu.length){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif(!parentEl){\r\n\t\t\tif(this.nestedMenuBlock){\r\n\t\t\t\t//abort if child menu already open\r\n\t\t\t\tif(this.rootPopup){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.nestedMenuBlock = setTimeout(() => {\r\n\t\t\t\t\tthis.nestedMenuBlock = false;\r\n\t\t\t\t}, 100)\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.rootPopup){\r\n\t\t\t\tthis.rootPopup.hide();\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.rootPopup = popup = this.popup(menuEl);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tpopup = parentPopup.child(menuEl);\r\n\t\t}\r\n\t\t\r\n\t\tmenu.forEach((item) => {\r\n\t\t\tvar itemEl = document.createElement(\"div\"),\r\n\t\t\tlabel = item.label,\r\n\t\t\tdisabled = item.disabled;\r\n\t\t\t\r\n\t\t\tif(item.separator){\r\n\t\t\t\titemEl.classList.add(\"tabulator-menu-separator\");\r\n\t\t\t}else{\r\n\t\t\t\titemEl.classList.add(\"tabulator-menu-item\");\r\n\t\t\t\t\r\n\t\t\t\tif(typeof label == \"function\"){\r\n\t\t\t\t\tlabel = label.call(this.table, component.getComponent());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(label instanceof Node){\r\n\t\t\t\t\titemEl.appendChild(label);\r\n\t\t\t\t}else{\r\n\t\t\t\t\titemEl.innerHTML = label;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(typeof disabled == \"function\"){\r\n\t\t\t\t\tdisabled = disabled.call(this.table, component.getComponent());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(disabled){\r\n\t\t\t\t\titemEl.classList.add(\"tabulator-menu-item-disabled\");\r\n\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(item.menu && item.menu.length){\r\n\t\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\tthis.loadMenu(e, component, item.menu, itemEl, popup);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(item.action){\r\n\t\t\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\t\t\titem.action(e, component.getComponent());\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(item.menu && item.menu.length){\r\n\t\t\t\t\titemEl.classList.add(\"tabulator-menu-item-submenu\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmenuEl.appendChild(itemEl);\r\n\t\t});\r\n\t\t\r\n\t\tmenuEl.addEventListener(\"click\", (e) => {\r\n\t\t\tthis.rootPopup.hide();\r\n\t\t});\r\n\t\t\r\n\t\tpopup.show(parentEl || e);\r\n\t\t\r\n\t\tif(popup === this.rootPopup){\r\n\t\t\tthis.rootPopup.hideOnBlur(() => {\r\n\t\t\t\tthis.rootPopup = null;\r\n\t\t\t\t\r\n\t\t\t\tif(this.currentComponent){\r\n\t\t\t\t\tthis.dispatchExternal(\"menuClosed\", this.currentComponent.getComponent());\r\n\t\t\t\t\tthis.currentComponent = null;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.currentComponent = component;\r\n\r\n\t\t\tthis.dispatchExternal(\"menuOpened\", component.getComponent())\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMenu.moduleName = \"menu\";\r\n\r\nexport default Menu;\r\n","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nclass MoveColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.placeholderElement = this.createPlaceholderElement();\r\n\t\tthis.hoverElement = false; //floating column header element\r\n\t\tthis.checkTimeout = false; //click check timeout holder\r\n\t\tthis.checkPeriod = 250; //period to wait on mousedown to consider this a move and not a click\r\n\t\tthis.moving = false; //currently moving column\r\n\t\tthis.toCol = false; //destination column\r\n\t\tthis.toColAfter = false; //position of moving column relative to the desitnation column\r\n\t\tthis.startX = 0; //starting position within header element\r\n\t\tthis.autoScrollMargin = 40; //auto scroll on edge when within margin\r\n\t\tthis.autoScrollStep = 5; //auto scroll distance in pixels\r\n\t\tthis.autoScrollTimeout = false; //auto scroll timeout\r\n\t\tthis.touchMove = false;\r\n\t\t\r\n\t\tthis.moveHover = this.moveHover.bind(this);\r\n\t\tthis.endMove = this.endMove.bind(this);\r\n\t\t\r\n\t\tthis.registerTableOption(\"movableColumns\", false); //enable movable columns\r\n\t}\r\n\t\r\n\tcreatePlaceholderElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-col\");\r\n\t\tel.classList.add(\"tabulator-col-placeholder\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.movableColumns){\r\n\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar self = this,\r\n\t\tconfig = {},\r\n\t\tcolEl;\r\n\t\t\r\n\t\tif(!column.modules.frozen && !column.isGroup){\r\n\t\t\tcolEl = column.getElement();\r\n\t\t\t\r\n\t\t\tconfig.mousemove = function(e){\r\n\t\t\t\tif(column.parent === self.moving.parent){\r\n\t\t\t\t\tif((((self.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(colEl).left) + self.table.columnManager.element.scrollLeft) > (column.getWidth() / 2)){\r\n\t\t\t\t\t\tif(self.toCol !== column || !self.toColAfter){\r\n\t\t\t\t\t\t\tcolEl.parentNode.insertBefore(self.placeholderElement, colEl.nextSibling);\r\n\t\t\t\t\t\t\tself.moveColumn(column, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(self.toCol !== column || self.toColAfter){\r\n\t\t\t\t\t\t\tcolEl.parentNode.insertBefore(self.placeholderElement, colEl);\r\n\t\t\t\t\t\t\tself.moveColumn(column, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}.bind(self);\r\n\t\t\t\r\n\t\t\tcolEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tself.touchMove = false;\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, column);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tcolEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tself.bindTouchEvents(column);\r\n\t\t}\r\n\t\t\r\n\t\tcolumn.modules.moveColumn = config;\r\n\t}\r\n\t\r\n\tbindTouchEvents(column){\r\n\t\tvar colEl = column.getElement(),\r\n\t\tstartXMove = false, //shifting center position of the cell\r\n\t\tdir = false,\r\n\t\tcurrentCol, nextCol, prevCol, nextColWidth, prevColWidth, nextColWidthLast, prevColWidthLast;\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchstart\", (e) => {\r\n\t\t\tthis.checkTimeout = setTimeout(() => {\r\n\t\t\t\tthis.touchMove = true;\r\n\t\t\t\tcurrentCol = column;\r\n\t\t\t\tnextCol = column.nextColumn();\r\n\t\t\t\tnextColWidth = nextCol ? nextCol.getWidth()/2 : 0;\r\n\t\t\t\tprevCol = column.prevColumn();\r\n\t\t\t\tprevColWidth = prevCol ? prevCol.getWidth()/2 : 0;\r\n\t\t\t\tnextColWidthLast = 0;\r\n\t\t\t\tprevColWidthLast = 0;\r\n\t\t\t\tstartXMove = false;\r\n\t\t\t\t\r\n\t\t\t\tthis.startMove(e, column);\r\n\t\t\t}, this.checkPeriod);\r\n\t\t}, {passive: true});\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchmove\", (e) => {\r\n\t\t\tvar halfCol, diff, moveToCol;\r\n\t\t\t\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.moveHover(e);\r\n\t\t\t\t\r\n\t\t\t\tif(!startXMove){\r\n\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tdiff = e.touches[0].pageX - startXMove;\r\n\t\t\t\t\r\n\t\t\t\tif(diff > 0){\r\n\t\t\t\t\tif(nextCol && diff - nextColWidthLast > nextColWidth){\r\n\t\t\t\t\t\tmoveToCol = nextCol;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(moveToCol !== column){\r\n\t\t\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t\t\t\tmoveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement().nextSibling);\r\n\t\t\t\t\t\t\tthis.moveColumn(moveToCol, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(prevCol && -diff - prevColWidthLast > prevColWidth){\r\n\t\t\t\t\t\tmoveToCol = prevCol;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(moveToCol !== column){\r\n\t\t\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t\t\t\tmoveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement());\r\n\t\t\t\t\t\t\tthis.moveColumn(moveToCol, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(moveToCol){\r\n\t\t\t\t\tcurrentCol = moveToCol;\r\n\t\t\t\t\tnextCol = moveToCol.nextColumn();\r\n\t\t\t\t\tnextColWidthLast = nextColWidth;\r\n\t\t\t\t\tnextColWidth = nextCol ? nextCol.getWidth() / 2 : 0;\r\n\t\t\t\t\tprevCol = moveToCol.prevColumn();\r\n\t\t\t\t\tprevColWidthLast = prevColWidth;\r\n\t\t\t\t\tprevColWidth = prevCol ? prevCol.getWidth() / 2 : 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}, {passive: true});\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchend\", (e) => {\r\n\t\t\tif(this.checkTimeout){\r\n\t\t\t\tclearTimeout(this.checkTimeout);\r\n\t\t\t}\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.endMove(e);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tstartMove(e, column){\r\n\t\tvar element = column.getElement(),\r\n\t\theaderElement = this.table.columnManager.getElement(),\r\n\t\theadersElement = this.table.columnManager.getHeadersElement();\r\n\t\t\r\n\t\tthis.moving = column;\r\n\t\tthis.startX = (this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(element).left;\r\n\t\t\r\n\t\tthis.table.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\t//create placeholder\r\n\t\tthis.placeholderElement.style.width = column.getWidth() + \"px\";\r\n\t\tthis.placeholderElement.style.height = column.getHeight() + \"px\";\r\n\t\t\r\n\t\telement.parentNode.insertBefore(this.placeholderElement, element);\r\n\t\telement.parentNode.removeChild(element);\r\n\t\t\r\n\t\t//create hover element\r\n\t\tthis.hoverElement = element.cloneNode(true);\r\n\t\tthis.hoverElement.classList.add(\"tabulator-moving\");\r\n\t\t\r\n\t\tthis.table.columnManager.getElement().appendChild(this.hoverElement);\r\n\t\t\r\n\t\tthis.hoverElement.style.left = \"0\";\r\n\t\tthis.hoverElement.style.bottom = (headerElement.clientHeight - headersElement.offsetHeight) + \"px\";\r\n\t\t\r\n\t\tif(!this.touchMove){\r\n\t\t\tthis._bindMouseMove();\r\n\t\t\t\r\n\t\t\tdocument.body.addEventListener(\"mousemove\", this.moveHover);\r\n\t\t\tdocument.body.addEventListener(\"mouseup\", this.endMove);\r\n\t\t}\r\n\t\t\r\n\t\tthis.moveHover(e);\r\n\t}\r\n\t\r\n\t_bindMouseMove(){\r\n\t\tthis.table.columnManager.columnsByIndex.forEach(function(column){\r\n\t\t\tif(column.modules.moveColumn.mousemove){\r\n\t\t\t\tcolumn.getElement().addEventListener(\"mousemove\", column.modules.moveColumn.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t_unbindMouseMove(){\r\n\t\tthis.table.columnManager.columnsByIndex.forEach(function(column){\r\n\t\t\tif(column.modules.moveColumn.mousemove){\r\n\t\t\t\tcolumn.getElement().removeEventListener(\"mousemove\", column.modules.moveColumn.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tmoveColumn(column, after){\r\n\t\tvar movingCells = this.moving.getCells();\r\n\t\t\r\n\t\tthis.toCol = column;\r\n\t\tthis.toColAfter = after;\r\n\t\t\r\n\t\tif(after){\r\n\t\t\tcolumn.getCells().forEach(function(cell, i){\r\n\t\t\t\tvar cellEl = cell.getElement(true);\r\n\t\t\t\t\r\n\t\t\t\tif(cellEl.parentNode && movingCells[i]){\r\n\t\t\t\t\tcellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl.nextSibling);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tcolumn.getCells().forEach(function(cell, i){\r\n\t\t\t\tvar cellEl = cell.getElement(true);\r\n\t\t\t\t\r\n\t\t\t\tif(cellEl.parentNode && movingCells[i]){\r\n\t\t\t\t\tcellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tendMove(e){\r\n\t\tif(e.which === 1 || this.touchMove){\r\n\t\t\tthis._unbindMouseMove();\r\n\t\t\t\r\n\t\t\tthis.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling);\r\n\t\t\tthis.placeholderElement.parentNode.removeChild(this.placeholderElement);\r\n\t\t\tthis.hoverElement.parentNode.removeChild(this.hoverElement);\r\n\t\t\t\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-block-select\");\r\n\t\t\t\r\n\t\t\tif(this.toCol){\r\n\t\t\t\tthis.table.columnManager.moveColumnActual(this.moving, this.toCol, this.toColAfter);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.moving = false;\r\n\t\t\tthis.toCol = false;\r\n\t\t\tthis.toColAfter = false;\r\n\t\t\t\r\n\t\t\tif(!this.touchMove){\r\n\t\t\t\tdocument.body.removeEventListener(\"mousemove\", this.moveHover);\r\n\t\t\t\tdocument.body.removeEventListener(\"mouseup\", this.endMove);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveHover(e){\r\n\t\tvar columnHolder = this.table.columnManager.getElement(),\r\n\t\tscrollLeft = columnHolder.scrollLeft,\r\n\t\txPos = ((this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(columnHolder).left) + scrollLeft,\r\n\t\tscrollPos;\r\n\t\t\r\n\t\tthis.hoverElement.style.left = (xPos - this.startX) + \"px\";\r\n\t\t\r\n\t\tif(xPos - scrollLeft < this.autoScrollMargin){\r\n\t\t\tif(!this.autoScrollTimeout){\r\n\t\t\t\tthis.autoScrollTimeout = setTimeout(() => {\r\n\t\t\t\t\tscrollPos = Math.max(0,scrollLeft-5);\r\n\t\t\t\t\tthis.table.rowManager.getElement().scrollLeft = scrollPos;\r\n\t\t\t\t\tthis.autoScrollTimeout = false;\r\n\t\t\t\t}, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(scrollLeft + columnHolder.clientWidth - xPos < this.autoScrollMargin){\r\n\t\t\tif(!this.autoScrollTimeout){\r\n\t\t\t\tthis.autoScrollTimeout = setTimeout(() => {\r\n\t\t\t\t\tscrollPos = Math.min(columnHolder.clientWidth, scrollLeft+5);\r\n\t\t\t\t\tthis.table.rowManager.getElement().scrollLeft = scrollPos;\r\n\t\t\t\t\tthis.autoScrollTimeout = false;\r\n\t\t\t\t}, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMoveColumns.moduleName = \"moveColumn\";\r\n\r\nexport default MoveColumns;\r\n","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nclass MoveRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.placeholderElement = this.createPlaceholderElement();\r\n\t\tthis.hoverElement = false; //floating row header element\r\n\t\tthis.checkTimeout = false; //click check timeout holder\r\n\t\tthis.checkPeriod = 150; //period to wait on mousedown to consider this a move and not a click\r\n\t\tthis.moving = false; //currently moving row\r\n\t\tthis.toRow = false; //destination row\r\n\t\tthis.toRowAfter = false; //position of moving row relative to the desitnation row\r\n\t\tthis.hasHandle = false; //row has handle instead of fully movable row\r\n\t\tthis.startY = 0; //starting Y position within header element\r\n\t\tthis.startX = 0; //starting X position within header element\r\n\r\n\t\tthis.moveHover = this.moveHover.bind(this);\r\n\t\tthis.endMove = this.endMove.bind(this);\r\n\t\tthis.tableRowDropEvent = false;\r\n\r\n\t\tthis.touchMove = false;\r\n\r\n\t\tthis.connection = false;\r\n\t\tthis.connectionSelectorsTables = false;\r\n\t\tthis.connectionSelectorsElements = false;\r\n\t\tthis.connectionElements = [];\r\n\t\tthis.connections = [];\r\n\r\n\t\tthis.connectedTable = false;\r\n\t\tthis.connectedRow = false;\r\n\r\n\t\tthis.registerTableOption(\"movableRows\", false); //enable movable rows\r\n\t\tthis.registerTableOption(\"movableRowsConnectedTables\", false); //tables for movable rows to be connected to\r\n\t\tthis.registerTableOption(\"movableRowsConnectedElements\", false); //other elements for movable rows to be connected to\r\n\t\tthis.registerTableOption(\"movableRowsSender\", false);\r\n\t\tthis.registerTableOption(\"movableRowsReceiver\", \"insert\");\r\n\r\n\t\tthis.registerColumnOption(\"rowHandle\");\r\n\t}\r\n\r\n\tcreatePlaceholderElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-row\");\r\n\t\tel.classList.add(\"tabulator-row-placeholder\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.movableRows){\r\n\t\t\tthis.connectionSelectorsTables = this.table.options.movableRowsConnectedTables;\r\n\t\t\tthis.connectionSelectorsElements = this.table.options.movableRowsConnectedElements;\r\n\r\n\t\t\tthis.connection = this.connectionSelectorsTables || this.connectionSelectorsElements;\r\n\r\n\t\t\tthis.subscribe(\"cell-init\", this.initializeCell.bind(this));\r\n\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeGroupHeader(group){\r\n\t\tvar self = this,\r\n\t\tconfig = {},\r\n\t\trowEl;\r\n\r\n\t\t//inter table drag drop\r\n\t\tconfig.mouseup = function(e){\r\n\t\t\tself.tableRowDrop(e, row);\r\n\t\t}.bind(self);\r\n\r\n\t\t//same table drag drop\r\n\t\tconfig.mousemove = function(e){\r\n\t\t\tif(((e.pageY - Helpers.elOffset(group.element).top) + self.table.rowManager.element.scrollTop) > (group.getHeight() / 2)){\r\n\t\t\t\tif(self.toRow !== group || !self.toRowAfter){\r\n\t\t\t\t\tvar rowEl = group.getElement();\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);\r\n\t\t\t\t\tself.moveRow(group, true);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(self.toRow !== group || self.toRowAfter){\r\n\t\t\t\t\tvar rowEl = group.getElement();\r\n\t\t\t\t\tif(rowEl.previousSibling){\r\n\t\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl);\r\n\t\t\t\t\t\tself.moveRow(group, false);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.bind(self);\r\n\r\n\t\tgroup.modules.moveRow = config;\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\tconfig = {},\r\n\t\trowEl;\r\n\r\n\t\t//inter table drag drop\r\n\t\tconfig.mouseup = function(e){\r\n\t\t\tself.tableRowDrop(e, row);\r\n\t\t}.bind(self);\r\n\r\n\t\t//same table drag drop\r\n\t\tconfig.mousemove = function(e){\r\n\t\t\tvar rowEl = row.getElement();\r\n\r\n\t\t\tif(((e.pageY - Helpers.elOffset(rowEl).top) + self.table.rowManager.element.scrollTop) > (row.getHeight() / 2)){\r\n\t\t\t\tif(self.toRow !== row || !self.toRowAfter){\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);\r\n\t\t\t\t\tself.moveRow(row, true);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(self.toRow !== row || self.toRowAfter){\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl);\r\n\t\t\t\t\tself.moveRow(row, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.bind(self);\r\n\r\n\r\n\t\tif(!this.hasHandle){\r\n\r\n\t\t\trowEl = row.getElement();\r\n\r\n\t\t\trowEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, row);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trowEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.bindTouchEvents(row, row.getElement());\r\n\t\t}\r\n\r\n\t\trow.modules.moveRow = config;\r\n\t}\r\n\r\n\tinitializeColumn(column){\r\n\t\tif(column.definition.rowHandle && this.table.options.movableRows !== false){\r\n\t\t\tthis.hasHandle = true;\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeCell(cell){\r\n\t\tif(cell.column.definition.rowHandle && this.table.options.movableRows !== false){\r\n\t\t\tvar self = this,\r\n\t\t\tcellEl = cell.getElement(true);\r\n\r\n\t\t\tcellEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, cell.row);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tcellEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.bindTouchEvents(cell.row, cellEl);\r\n\t\t}\r\n\t}\r\n\r\n\tbindTouchEvents(row, element){\r\n\t\tvar startYMove = false, //shifting center position of the cell\r\n\t\tdir = false,\r\n\t\tcurrentRow, nextRow, prevRow, nextRowHeight, prevRowHeight, nextRowHeightLast, prevRowHeightLast;\r\n\r\n\t\telement.addEventListener(\"touchstart\", (e) => {\r\n\t\t\tthis.checkTimeout = setTimeout(() => {\r\n\t\t\t\tthis.touchMove = true;\r\n\t\t\t\tcurrentRow = row;\r\n\t\t\t\tnextRow = row.nextRow();\r\n\t\t\t\tnextRowHeight = nextRow ? nextRow.getHeight()/2 : 0;\r\n\t\t\t\tprevRow = row.prevRow();\r\n\t\t\t\tprevRowHeight = prevRow ? prevRow.getHeight()/2 : 0;\r\n\t\t\t\tnextRowHeightLast = 0;\r\n\t\t\t\tprevRowHeightLast = 0;\r\n\t\t\t\tstartYMove = false;\r\n\r\n\t\t\t\tthis.startMove(e, row);\r\n\t\t\t}, this.checkPeriod);\r\n\t\t}, {passive: true});\r\n\t\tthis.moving, this.toRow, this.toRowAfter\r\n\t\telement.addEventListener(\"touchmove\", (e) => {\r\n\r\n\t\t\tvar halfCol, diff, moveToRow;\r\n\r\n\t\t\tif(this.moving){\r\n\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\tthis.moveHover(e);\r\n\r\n\t\t\t\tif(!startYMove){\r\n\t\t\t\t\tstartYMove = e.touches[0].pageY;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdiff = e.touches[0].pageY - startYMove;\r\n\r\n\t\t\t\tif(diff > 0){\r\n\t\t\t\t\tif(nextRow && diff - nextRowHeightLast > nextRowHeight){\r\n\t\t\t\t\t\tmoveToRow = nextRow;\r\n\r\n\t\t\t\t\t\tif(moveToRow !== row){\r\n\t\t\t\t\t\t\tstartYMove = e.touches[0].pageY\r\n\t\t\t\t\t\t\tmoveToRow.getElement().parentNode.insertBefore(this.placeholderElement, moveToRow.getElement().nextSibling);\r\n\t\t\t\t\t\t\tthis.moveRow(moveToRow, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(prevRow && -diff - prevRowHeightLast > prevRowHeight){\r\n\t\t\t\t\t\tmoveToRow = prevRow;\r\n\r\n\t\t\t\t\t\tif(moveToRow !== row){\r\n\t\t\t\t\t\t\tstartYMove = e.touches[0].pageY;\r\n\t\t\t\t\t\t\tmoveToRow.getElement().parentNode.insertBefore(this.placeholderElement, moveToRow.getElement());\r\n\t\t\t\t\t\t\tthis.moveRow(moveToRow, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(moveToRow){\r\n\t\t\t\t\tcurrentRow = moveToRow;\r\n\t\t\t\t\tnextRow = moveToRow.nextRow();\r\n\t\t\t\t\tnextRowHeightLast = nextRowHeight;\r\n\t\t\t\t\tnextRowHeight = nextRow ? nextRow.getHeight() / 2 : 0;\r\n\t\t\t\t\tprevRow = moveToRow.prevRow();\r\n\t\t\t\t\tprevRowHeightLast = prevRowHeight;\r\n\t\t\t\t\tprevRowHeight = prevRow ? prevRow.getHeight() / 2 : 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\telement.addEventListener(\"touchend\", (e) => {\r\n\t\t\tif(this.checkTimeout){\r\n\t\t\t\tclearTimeout(this.checkTimeout);\r\n\t\t\t}\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.endMove(e);\r\n\t\t\t\tthis.touchMove = false;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t_bindMouseMove(){\r\n\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\tif((row.type === \"row\" || row.type === \"group\") && row.modules.moveRow && row.modules.moveRow.mousemove){\r\n\t\t\t\trow.getElement().addEventListener(\"mousemove\", row.modules.moveRow.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t_unbindMouseMove(){\r\n\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\tif((row.type === \"row\" || row.type === \"group\") && row.modules.moveRow && row.modules.moveRow.mousemove){\r\n\t\t\t\trow.getElement().removeEventListener(\"mousemove\", row.modules.moveRow.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tstartMove(e, row){\r\n\t\tvar element = row.getElement();\r\n\r\n\t\tthis.setStartPosition(e, row);\r\n\r\n\t\tthis.moving = row;\r\n\r\n\t\tthis.table.element.classList.add(\"tabulator-block-select\");\r\n\r\n\t\t//create placeholder\r\n\t\tthis.placeholderElement.style.width = row.getWidth() + \"px\";\r\n\t\tthis.placeholderElement.style.height = row.getHeight() + \"px\";\r\n\r\n\t\tif(!this.connection){\r\n\t\t\telement.parentNode.insertBefore(this.placeholderElement, element);\r\n\t\t\telement.parentNode.removeChild(element);\r\n\t\t}else{\r\n\t\t\tthis.table.element.classList.add(\"tabulator-movingrow-sending\");\r\n\t\t\tthis.connectToTables(row);\r\n\t\t}\r\n\r\n\t\t//create hover element\r\n\t\tthis.hoverElement = element.cloneNode(true);\r\n\t\tthis.hoverElement.classList.add(\"tabulator-moving\");\r\n\r\n\t\tif(this.connection){\r\n\t\t\tdocument.body.appendChild(this.hoverElement);\r\n\t\t\tthis.hoverElement.style.left = \"0\";\r\n\t\t\tthis.hoverElement.style.top = \"0\";\r\n\t\t\tthis.hoverElement.style.width = this.table.element.clientWidth + \"px\";\r\n\t\t\tthis.hoverElement.style.whiteSpace = \"nowrap\";\r\n\t\t\tthis.hoverElement.style.overflow = \"hidden\";\r\n\t\t\tthis.hoverElement.style.pointerEvents = \"none\";\r\n\t\t}else{\r\n\t\t\tthis.table.rowManager.getTableElement().appendChild(this.hoverElement);\r\n\r\n\t\t\tthis.hoverElement.style.left = \"0\";\r\n\t\t\tthis.hoverElement.style.top = \"0\";\r\n\r\n\t\t\tthis._bindMouseMove();\r\n\t\t}\r\n\r\n\t\tdocument.body.addEventListener(\"mousemove\", this.moveHover);\r\n\t\tdocument.body.addEventListener(\"mouseup\", this.endMove);\r\n\r\n\t\tthis.dispatchExternal(\"rowMoving\", row.getComponent());\r\n\r\n\t\tthis.moveHover(e);\r\n\t}\r\n\r\n\tsetStartPosition(e, row){\r\n\t\tvar pageX = this.touchMove ? e.touches[0].pageX : e.pageX,\r\n\t\tpageY = this.touchMove ? e.touches[0].pageY : e.pageY,\r\n\t\telement, position;\r\n\r\n\t\telement = row.getElement();\r\n\t\tif(this.connection){\r\n\t\t\tposition = element.getBoundingClientRect();\r\n\r\n\t\t\tthis.startX = position.left - pageX + window.pageXOffset;\r\n\t\t\tthis.startY = position.top - pageY + window.pageYOffset;\r\n\t\t}else{\r\n\t\t\tthis.startY = (pageY - element.getBoundingClientRect().top);\r\n\t\t}\r\n\t}\r\n\r\n\tendMove(e){\r\n\t\tif(!e || e.which === 1 || this.touchMove){\r\n\t\t\tthis._unbindMouseMove();\r\n\r\n\t\t\tif(!this.connection){\r\n\t\t\t\tthis.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling);\r\n\t\t\t\tthis.placeholderElement.parentNode.removeChild(this.placeholderElement);\r\n\t\t\t}\r\n\r\n\t\t\tthis.hoverElement.parentNode.removeChild(this.hoverElement);\r\n\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-block-select\");\r\n\r\n\t\t\tif(this.toRow){\r\n\t\t\t\tthis.table.rowManager.moveRow(this.moving, this.toRow, this.toRowAfter);\r\n\t\t\t}else{\r\n\t\t\t\tthis.dispatchExternal(\"rowMoveCancelled\", this.moving.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tthis.moving = false;\r\n\t\t\tthis.toRow = false;\r\n\t\t\tthis.toRowAfter = false;\r\n\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", this.moveHover);\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", this.endMove);\r\n\r\n\t\t\tif(this.connection){\r\n\t\t\t\tthis.table.element.classList.remove(\"tabulator-movingrow-sending\");\r\n\t\t\t\tthis.disconnectFromTables();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmoveRow(row, after){\r\n\t\tthis.toRow = row;\r\n\t\tthis.toRowAfter = after;\r\n\t}\r\n\r\n\tmoveHover(e){\r\n\t\tif(this.connection){\r\n\t\t\tthis.moveHoverConnections.call(this, e);\r\n\t\t}else{\r\n\t\t\tthis.moveHoverTable.call(this, e);\r\n\t\t}\r\n\t}\r\n\r\n\tmoveHoverTable(e){\r\n\t\tvar rowHolder = this.table.rowManager.getElement(),\r\n\t\tscrollTop = rowHolder.scrollTop,\r\n\t\tyPos = ((this.touchMove ? e.touches[0].pageY : e.pageY) - rowHolder.getBoundingClientRect().top) + scrollTop,\r\n\t\tscrollPos;\r\n\r\n\t\tthis.hoverElement.style.top = (yPos - this.startY) + \"px\";\r\n\t}\r\n\r\n\tmoveHoverConnections(e){\r\n\t\tthis.hoverElement.style.left = (this.startX + (this.touchMove ? e.touches[0].pageX : e.pageX)) + \"px\";\r\n\t\tthis.hoverElement.style.top = (this.startY + (this.touchMove ? e.touches[0].pageY : e.pageY)) + \"px\";\r\n\t}\r\n\r\n\telementRowDrop(e, element, row){\r\n\t\tthis.dispatchExternal(\"movableRowsElementDrop\", e, element, row ? row.getComponent() : false);\r\n\t}\r\n\r\n\t//establish connection with other tables\r\n\tconnectToTables(row){\r\n\t\tvar connectionTables;\r\n\r\n\t\tif(this.connectionSelectorsTables){\r\n\t\t\tconnectionTables = this.commsConnections(this.connectionSelectorsTables);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSendingStart\", connectionTables);\r\n\r\n\t\t\tthis.commsSend(this.connectionSelectorsTables, \"moveRow\", \"connect\", {\r\n\t\t\t\trow:row,\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.connectionSelectorsElements){\r\n\r\n\t\t\tthis.connectionElements = [];\r\n\r\n\t\t\tif(!Array.isArray(this.connectionSelectorsElements)){\r\n\t\t\t\tthis.connectionSelectorsElements = [this.connectionSelectorsElements];\r\n\t\t\t}\r\n\r\n\t\t\tthis.connectionSelectorsElements.forEach((query) => {\r\n\t\t\t\tif(typeof query === \"string\"){\r\n\t\t\t\t\tthis.connectionElements = this.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(query)));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.connectionElements.push(query);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.connectionElements.forEach((element) => {\r\n\t\t\t\tvar dropEvent = (e) => {\r\n\t\t\t\t\tthis.elementRowDrop(e, element, this.moving);\r\n\t\t\t\t};\r\n\r\n\t\t\t\telement.addEventListener(\"mouseup\", dropEvent);\r\n\t\t\t\telement.tabulatorElementDropEvent = dropEvent;\r\n\r\n\t\t\t\telement.classList.add(\"tabulator-movingrow-receiving\");\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t//disconnect from other tables\r\n\tdisconnectFromTables(){\r\n\t\tvar connectionTables;\r\n\r\n\t\tif(this.connectionSelectorsTables){\r\n\t\t\tconnectionTables = this.commsConnections(this.connectionSelectorsTables);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSendingStop\", connectionTables);\r\n\r\n\t\t\tthis.commsSend(this.connectionSelectorsTables, \"moveRow\", \"disconnect\");\r\n\t\t}\r\n\r\n\t\tthis.connectionElements.forEach((element) => {\r\n\t\t\telement.classList.remove(\"tabulator-movingrow-receiving\");\r\n\t\t\telement.removeEventListener(\"mouseup\", element.tabulatorElementDropEvent);\r\n\t\t\tdelete element.tabulatorElementDropEvent;\r\n\t\t});\r\n\t}\r\n\r\n\t//accept incomming connection\r\n\tconnect(table, row){\r\n\t\tif(!this.connectedTable){\r\n\t\t\tthis.connectedTable = table;\r\n\t\t\tthis.connectedRow = row;\r\n\r\n\t\t\tthis.table.element.classList.add(\"tabulator-movingrow-receiving\");\r\n\r\n\t\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\t\tif(row.type === \"row\" && row.modules.moveRow && row.modules.moveRow.mouseup){\r\n\t\t\t\t\trow.getElement().addEventListener(\"mouseup\", row.modules.moveRow.mouseup);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.tableRowDropEvent = this.tableRowDrop.bind(this);\r\n\r\n\t\t\tthis.table.element.addEventListener(\"mouseup\", this.tableRowDropEvent);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivingStart\", row, table);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Row Error - Table cannot accept connection, already connected to table:\", this.connectedTable);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//close incomming connection\r\n\tdisconnect(table){\r\n\t\tif(table === this.connectedTable){\r\n\t\t\tthis.connectedTable = false;\r\n\t\t\tthis.connectedRow = false;\r\n\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-movingrow-receiving\");\r\n\r\n\t\t\tthis.table.rowManager.getDisplayRows().forEach((row) =>{\r\n\t\t\t\tif(row.type === \"row\" && row.modules.moveRow && row.modules.moveRow.mouseup){\r\n\t\t\t\t\trow.getElement().removeEventListener(\"mouseup\", row.modules.moveRow.mouseup);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.table.element.removeEventListener(\"mouseup\", this.tableRowDropEvent);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivingStop\", table);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Row Error - trying to disconnect from non connected table\")\r\n\t\t}\r\n\t}\r\n\r\n\tdropComplete(table, row, success){\r\n\t\tvar sender = false;\r\n\r\n\t\tif(success){\r\n\r\n\t\t\tswitch(typeof this.table.options.movableRowsSender){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tsender = this.senders[this.table.options.movableRowsSender];\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tsender = this.table.options.movableRowsSender;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(sender){\r\n\t\t\t\tsender.call(this, this.moving.getComponent(), row ? row.getComponent() : undefined, table)\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.options.movableRowsSender){\r\n\t\t\t\t\tconsole.warn(\"Mover Row Error - no matching sender found:\", this.table.options.movableRowsSender);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSent\", this.moving.getComponent(), row ? row.getComponent() : undefined, table);\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"movableRowsSentFailed\", this.moving.getComponent(), row ? row.getComponent() : undefined, table);\r\n\t\t}\r\n\r\n\t\tthis.endMove();\r\n\t}\r\n\r\n\ttableRowDrop(e, row){\r\n\t\tvar receiver = false,\r\n\t\tsuccess = false;\r\n\r\n\t\te.stopImmediatePropagation();\r\n\r\n\t\tswitch(typeof this.table.options.movableRowsReceiver){\r\n\t\t\tcase \"string\":\r\n\t\t\treceiver = this.receivers[this.table.options.movableRowsReceiver];\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\treceiver = this.table.options.movableRowsReceiver;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(receiver){\r\n\t\t\tsuccess = receiver.call(this, this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable)\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Mover Row Error - no matching receiver found:\", this.table.options.movableRowsReceiver)\r\n\t\t}\r\n\r\n\t\tif(success){\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceived\", this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivedFailed\", this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);\r\n\t\t}\r\n\r\n\t\tthis.commsSend(this.connectedTable, \"moveRow\", \"dropcomplete\", {\r\n\t\t\trow:row,\r\n\t\t\tsuccess:success,\r\n\t\t});\r\n\t}\r\n\r\n\tcommsReceived(table, action, data){\r\n\t\tswitch(action){\r\n\t\t\tcase \"connect\":\r\n\t\t\treturn this.connect(table, data.row);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"disconnect\":\r\n\t\t\treturn this.disconnect(table);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"dropcomplete\":\r\n\t\t\treturn this.dropComplete(table, data.row, data.success);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMoveRows.prototype.receivers = {\r\n\tinsert:function(fromRow, toRow, fromTable){\r\n\t\tthis.table.addRow(fromRow.getData(), undefined, toRow);\r\n\t\treturn true;\r\n\t},\r\n\r\n\tadd:function(fromRow, toRow, fromTable){\r\n\t\tthis.table.addRow(fromRow.getData());\r\n\t\treturn true;\r\n\t},\r\n\r\n\tupdate:function(fromRow, toRow, fromTable){\r\n\t\tif(toRow){\r\n\t\t\ttoRow.update(fromRow.getData());\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n\r\n\treplace:function(fromRow, toRow, fromTable){\r\n\t\tif(toRow){\r\n\t\t\tthis.table.addRow(fromRow.getData(), undefined, toRow);\r\n\t\t\ttoRow.delete();\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n};\r\n\r\nMoveRows.prototype.senders = {\r\n\tdelete:function(fromRow, toRow, toTable){\r\n\t\tfromRow.delete();\r\n\t}\r\n};\r\n\r\nMoveRows.moduleName = \"moveRow\";\r\n\r\nexport default MoveRows;","import Module from '../../core/Module.js';\r\n\r\nimport defaultMutators from './defaults/mutators.js';\r\n\r\nclass Mutator extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.allowedTypes = [\"\", \"data\", \"edit\", \"clipboard\"]; //list of muatation types\r\n\t\tthis.enabled = true;\r\n\r\n\t\tthis.registerColumnOption(\"mutator\");\r\n\t\tthis.registerColumnOption(\"mutatorParams\");\r\n\t\tthis.registerColumnOption(\"mutatorData\");\r\n\t\tthis.registerColumnOption(\"mutatorDataParams\");\r\n\t\tthis.registerColumnOption(\"mutatorEdit\");\r\n\t\tthis.registerColumnOption(\"mutatorEditParams\");\r\n\t\tthis.registerColumnOption(\"mutatorClipboard\");\r\n\t\tthis.registerColumnOption(\"mutatorClipboardParams\");\r\n\t\tthis.registerColumnOption(\"mutateLink\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-value-changing\", this.transformCell.bind(this));\r\n\t\tthis.subscribe(\"cell-value-changed\", this.mutateLink.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"row-data-init-before\", this.rowDataChanged.bind(this));\r\n\t\tthis.subscribe(\"row-data-changing\", this.rowDataChanged.bind(this));\r\n\t}\r\n\r\n\trowDataChanged(row, tempData, updatedData){\r\n\t\treturn this.transformRow(tempData, \"data\", updatedData);\r\n\t}\r\n\r\n\t//initialize column mutator\r\n\tinitializeColumn(column){\r\n\t\tvar match = false,\r\n\t\tconfig = {};\r\n\r\n\t\tthis.allowedTypes.forEach((type) => {\r\n\t\t\tvar key = \"mutator\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\t\tmutator;\r\n\r\n\t\t\tif(column.definition[key]){\r\n\t\t\t\tmutator = this.lookupMutator(column.definition[key]);\r\n\r\n\t\t\t\tif(mutator){\r\n\t\t\t\t\tmatch = true;\r\n\r\n\t\t\t\t\tconfig[key] = {\r\n\t\t\t\t\t\tmutator:mutator,\r\n\t\t\t\t\t\tparams: column.definition[key + \"Params\"] || {},\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(match){\r\n\t\t\tcolumn.modules.mutate = config;\r\n\t\t}\r\n\t}\r\n\r\n\tlookupMutator(value){\r\n\t\tvar mutator = false;\r\n\r\n\t\t//set column mutator\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(Mutator.mutators[value]){\r\n\t\t\t\tmutator = Mutator.mutators[value];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Mutator Error - No such mutator found, ignoring: \", value);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tmutator = value;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn mutator;\r\n\t}\r\n\r\n\t//apply mutator to row\r\n\ttransformRow(data, type, updatedData){\r\n\t\tvar key = \"mutator\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\tvalue;\r\n\r\n\t\tif(this.enabled){\r\n\r\n\t\t\tthis.table.columnManager.traverse((column) => {\r\n\t\t\t\tvar mutator, params, component;\r\n\r\n\t\t\t\tif(column.modules.mutate){\r\n\t\t\t\t\tmutator = column.modules.mutate[key] || column.modules.mutate.mutator || false;\r\n\r\n\t\t\t\t\tif(mutator){\r\n\t\t\t\t\t\tvalue = column.getFieldValue(typeof updatedData !== \"undefined\" ? updatedData : data);\r\n\r\n\t\t\t\t\t\tif(type == \"data\" || typeof value !== \"undefined\"){\r\n\t\t\t\t\t\t\tcomponent = column.getComponent();\r\n\t\t\t\t\t\t\tparams = typeof mutator.params === \"function\" ? mutator.params(value, data, type, component) : mutator.params;\r\n\t\t\t\t\t\t\tcolumn.setFieldValue(data, mutator.mutator(value, data, type, params, component));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//apply mutator to new cell value\r\n\ttransformCell(cell, value){\r\n\t\tif(cell.column.modules.mutate){\r\n\t\t\tvar mutator = cell.column.modules.mutate.mutatorEdit || cell.column.modules.mutate.mutator || false,\r\n\t\t\ttempData = {};\r\n\r\n\t\t\tif(mutator){\r\n\t\t\t\ttempData = Object.assign(tempData, cell.row.getData());\r\n\t\t\t\tcell.column.setFieldValue(tempData, value);\r\n\t\t\t\treturn mutator.mutator(value, tempData, \"edit\", mutator.params, cell.getComponent());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\tmutateLink(cell){\r\n\t\tvar links = cell.column.definition.mutateLink;\r\n\r\n\t\tif(links){\r\n\t\t\tif(!Array.isArray(links)){\r\n\t\t\t\tlinks = [links];\r\n\t\t\t}\r\n\r\n\t\t\tlinks.forEach((link) => {\r\n\t\t\t\tvar linkCell = cell.row.getCell(link);\r\n\r\n\t\t\t\tif(linkCell){\r\n\t\t\t\t\tlinkCell.setValue(linkCell.getValue(), true, true);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tenable(){\r\n\t\tthis.enabled = true;\r\n\t}\r\n\r\n\tdisable(){\r\n\t\tthis.enabled = false;\r\n\t}\r\n}\r\n\r\nMutator.moduleName = \"mutator\";\r\n\r\n//load defaults\r\nMutator.mutators = defaultMutators;\r\n\r\nexport default Mutator;","export default {};","import rows from './pageCounters/rows.js';\r\nimport pages from './pageCounters/pages.js';\r\n\r\n\r\nexport default {\r\n\trows:rows,\r\n\tpages:pages,\r\n};","export default function(pageSize, currentRow, currentPage, totalRows, totalPages){\r\n\tvar el = document.createElement(\"span\"),\r\n\tshowingEl = document.createElement(\"span\"),\r\n\tvalueEl = document.createElement(\"span\"),\r\n\tofEl = document.createElement(\"span\"),\r\n\ttotalEl = document.createElement(\"span\"),\r\n\trowsEl = document.createElement(\"span\");\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|showing\", (value) => {\r\n\t\tshowingEl.innerHTML = value;\r\n\t});\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|of\", (value) => {\r\n\t\tofEl.innerHTML = value;\r\n\t});\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|rows\", (value) => {\r\n\t\trowsEl.innerHTML = value;\r\n\t});\r\n\r\n\tif(totalRows){\r\n\t\tvalueEl.innerHTML = \" \" + currentRow + \"-\" + Math.min((currentRow + pageSize - 1), totalRows) + \" \";\r\n\t\t\r\n\t\ttotalEl.innerHTML = \" \" + totalRows + \" \";\r\n\t\t\r\n\t\tel.appendChild(showingEl);\r\n\t\tel.appendChild(valueEl);\r\n\t\tel.appendChild(ofEl);\r\n\t\tel.appendChild(totalEl);\r\n\t\tel.appendChild(rowsEl);\r\n\t}else{\r\n\t\tvalueEl.innerHTML = \" 0 \";\r\n\r\n\t\tel.appendChild(showingEl);\r\n\t\tel.appendChild(valueEl);\r\n\t\tel.appendChild(rowsEl);\r\n\t}\r\n\t\r\n\treturn el;\r\n};","export default function(pageSize, currentRow, currentPage, totalRows, totalPages){\r\n\r\n var el = document.createElement(\"span\"),\r\n\tshowingEl = document.createElement(\"span\"),\r\n\tvalueEl = document.createElement(\"span\"),\r\n\tofEl = document.createElement(\"span\"),\r\n\ttotalEl = document.createElement(\"span\"),\r\n\trowsEl = document.createElement(\"span\");\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|showing\", (value) => {\r\n\t\tshowingEl.innerHTML = value;\r\n\t});\r\n\t\r\n\tvalueEl.innerHTML = \" \" + currentPage + \" \";\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|of\", (value) => {\r\n\t\tofEl.innerHTML = value;\r\n\t});\r\n\t\r\n\ttotalEl.innerHTML = \" \" + totalPages + \" \";\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|pages\", (value) => {\r\n\t\trowsEl.innerHTML = value;\r\n\t});\r\n\t\r\n\tel.appendChild(showingEl);\r\n\tel.appendChild(valueEl);\r\n\tel.appendChild(ofEl);\r\n\tel.appendChild(totalEl);\r\n\tel.appendChild(rowsEl);\r\n\t\r\n\treturn el;\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultPageCounters from './defaults/pageCounters.js';\r\n\r\nclass Page extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.mode = \"local\";\r\n\t\tthis.progressiveLoad = false;\r\n\t\t\r\n\t\tthis.element = null;\r\n\t\tthis.pageCounterElement = null;\r\n\t\tthis.pageCounter = null;\r\n\t\t\r\n\t\tthis.size = 0;\r\n\t\tthis.page = 1;\r\n\t\tthis.count = 5;\r\n\t\tthis.max = 1;\r\n\r\n\t\tthis.remoteRowCountEstimate = null;\r\n\t\t\r\n\t\tthis.displayIndex = 0; //index in display pipeline\r\n\t\t\r\n\t\tthis.initialLoad = true;\r\n\t\tthis.dataChanging = false; //flag to check if data is being changed by this module\r\n\t\t\r\n\t\tthis.pageSizes = [];\r\n\t\t\r\n\t\tthis.registerTableOption(\"pagination\", false); //set pagination type\r\n\t\tthis.registerTableOption(\"paginationMode\", \"local\"); //local or remote pagination\r\n\t\tthis.registerTableOption(\"paginationSize\", false); //set number of rows to a page\r\n\t\tthis.registerTableOption(\"paginationInitialPage\", 1); //initial page to show on load\r\n\t\tthis.registerTableOption(\"paginationCounter\", false); // set pagination counter\r\n\t\tthis.registerTableOption(\"paginationCounterElement\", false); // set pagination counter\r\n\t\tthis.registerTableOption(\"paginationButtonCount\", 5); // set count of page button\r\n\t\tthis.registerTableOption(\"paginationSizeSelector\", false); //add pagination size selector element\r\n\t\tthis.registerTableOption(\"paginationElement\", false); //element to hold pagination numbers\r\n\t\t// this.registerTableOption(\"paginationDataSent\", {}); //pagination data sent to the server\r\n\t\t// this.registerTableOption(\"paginationDataReceived\", {}); //pagination data received from the server\r\n\t\tthis.registerTableOption(\"paginationAddRow\", \"page\"); //add rows on table or page\r\n\t\t\r\n\t\tthis.registerTableOption(\"progressiveLoad\", false); //progressive loading\r\n\t\tthis.registerTableOption(\"progressiveLoadDelay\", 0); //delay between requests\r\n\t\tthis.registerTableOption(\"progressiveLoadScrollMargin\", 0); //margin before scroll begins\r\n\t\t\r\n\t\tthis.registerTableFunction(\"setMaxPage\", this.setMaxPage.bind(this));\r\n\t\tthis.registerTableFunction(\"setPage\", this.setPage.bind(this));\r\n\t\tthis.registerTableFunction(\"setPageToRow\", this.userSetPageToRow.bind(this));\r\n\t\tthis.registerTableFunction(\"setPageSize\", this.userSetPageSize.bind(this));\r\n\t\tthis.registerTableFunction(\"getPageSize\", this.getPageSize.bind(this));\r\n\t\tthis.registerTableFunction(\"previousPage\", this.previousPage.bind(this));\r\n\t\tthis.registerTableFunction(\"nextPage\", this.nextPage.bind(this));\r\n\t\tthis.registerTableFunction(\"getPage\", this.getPage.bind(this));\r\n\t\tthis.registerTableFunction(\"getPageMax\", this.getPageMax.bind(this));\r\n\t\t\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"pageTo\", this.setPageToRow.bind(this));\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"row-added\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"data-processed\", this.initialLoadComplete.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.calculatePageSizes.bind(this));\r\n\t\t\tthis.subscribe(\"footer-redraw\", this.footerRedraw.bind(this));\r\n\r\n\t\t\tif(this.table.options.paginationAddRow == \"page\"){\r\n\t\t\t\tthis.subscribe(\"row-adding-position\", this.rowAddingPosition.bind(this));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.options.paginationMode === \"remote\"){\r\n\t\t\t\tthis.subscribe(\"data-params\", this.remotePageParams.bind(this));\r\n\t\t\t\tthis.subscribe(\"data-loaded\", this._parseRemoteData.bind(this));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.options.progressiveLoad){\r\n\t\t\t\tconsole.error(\"Progressive Load Error - Pagination and progressive load cannot be used at the same time\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.registerDisplayHandler(this.restOnRenderBefore.bind(this), 40);\r\n\t\t\tthis.registerDisplayHandler(this.getRows.bind(this), 50);\r\n\t\t\t\r\n\t\t\tthis.createElements();\r\n\t\t\tthis.initializePageCounter();\r\n\t\t\tthis.initializePaginator();\r\n\t\t}else if(this.table.options.progressiveLoad){\r\n\t\t\tthis.subscribe(\"data-params\", this.remotePageParams.bind(this));\r\n\t\t\tthis.subscribe(\"data-loaded\", this._parseRemoteData.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.calculatePageSizes.bind(this));\r\n\t\t\tthis.subscribe(\"data-processed\", this.initialLoadComplete.bind(this));\r\n\t\t\t\r\n\t\t\tthis.initializeProgressive(this.table.options.progressiveLoad)\r\n\t\t\t\r\n\t\t\tif(this.table.options.progressiveLoad === \"scroll\"){\r\n\t\t\t\tthis.subscribe(\"scroll-vertical\", this.scrollVertical.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trowAddingPosition(row, top){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tdispRows = rowManager.getDisplayRows(),\r\n\t\tindex;\r\n\t\t\r\n\t\tif(top){\r\n\t\t\tif(dispRows.length){\r\n\t\t\t\tindex = dispRows[0];\r\n\t\t\t}else{\r\n\t\t\t\tif(rowManager.activeRows.length){\r\n\t\t\t\t\tindex = rowManager.activeRows[rowManager.activeRows.length-1];\r\n\t\t\t\t\ttop = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(dispRows.length){\r\n\t\t\t\tindex = dispRows[dispRows.length - 1];\r\n\t\t\t\ttop = dispRows.length < this.size ? false : true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn {index, top}\r\n\t}\r\n\t\r\n\tcalculatePageSizes(){\r\n\t\tvar testElRow, testElCell;\r\n\t\t\r\n\t\tif(this.table.options.paginationSize){\r\n\t\t\tthis.size = this.table.options.paginationSize;\r\n\t\t}else{\r\n\t\t\ttestElRow = document.createElement(\"div\");\r\n\t\t\ttestElRow.classList.add(\"tabulator-row\");\r\n\t\t\ttestElRow.style.visibility = \"hidden\";\r\n\t\t\t\r\n\t\t\ttestElCell = document.createElement(\"div\");\r\n\t\t\ttestElCell.classList.add(\"tabulator-cell\");\r\n\t\t\ttestElCell.innerHTML = \"Page Row Test\";\r\n\t\t\t\r\n\t\t\ttestElRow.appendChild(testElCell);\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.getTableElement().appendChild(testElRow);\r\n\t\t\t\r\n\t\t\tthis.size = Math.floor(this.table.rowManager.getElement().clientHeight / testElRow.offsetHeight);\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.getTableElement().removeChild(testElRow);\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(\"pageSizeChanged\", this.size);\r\n\t\t\r\n\t\tthis.generatePageSizeSelectList();\r\n\t}\r\n\t\r\n\tinitialLoadComplete(){\r\n\t\tthis.initialLoad = false;\r\n\t}\r\n\t\r\n\tremotePageParams(data, config, silent, params){\r\n\t\tif(!this.initialLoad){\r\n\t\t\tif((this.progressiveLoad && !silent) || (!this.progressiveLoad && !this.dataChanging)){\r\n\t\t\t\tthis.reset(true);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//configure request params\r\n\t\tparams.page = this.page;\r\n\t\t\r\n\t\t//set page size if defined\r\n\t\tif(this.size){\r\n\t\t\tparams.size = this.size;\r\n\t\t}\r\n\t\t\r\n\t\treturn params;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\tuserSetPageToRow(row){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\trow = this.rowManager.findRow(row);\r\n\t\t\t\r\n\t\t\tif(row){\r\n\t\t\t\treturn this.setPageToRow(row)\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn Promise.reject();\r\n\t}\r\n\t\r\n\tuserSetPageSize(size){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\tthis.setPageSize(size);\r\n\t\t\treturn this.setPage(1);\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tscrollVertical(top, dir){\r\n\t\tvar element, diff, margin;\r\n\t\tif(!dir && !this.table.dataLoader.loading){\r\n\t\t\telement = this.table.rowManager.getElement();\r\n\t\t\tdiff = element.scrollHeight - element.clientHeight - top;\r\n\t\t\tmargin = this.table.options.progressiveLoadScrollMargin || (element.clientHeight * 2);\r\n\t\t\t\r\n\t\t\tif(diff < margin){\r\n\t\t\t\tthis.nextPage()\r\n\t\t\t\t.catch(() => {}); //consume the exception thrown when on the last page\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trestOnRenderBefore(rows, renderInPosition){\r\n\t\tif(!renderInPosition){\r\n\t\t\tif(this.mode === \"local\"){\r\n\t\t\t\tthis.reset();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\trowsUpdated(){\r\n\t\tthis.refreshData(true, \"all\");\r\n\t}\r\n\t\r\n\tcreateElements(){\r\n\t\tvar button;\r\n\t\t\r\n\t\tthis.element = document.createElement(\"span\");\r\n\t\tthis.element.classList.add(\"tabulator-paginator\");\r\n\t\t\r\n\t\tthis.pagesElement = document.createElement(\"span\");\r\n\t\tthis.pagesElement.classList.add(\"tabulator-pages\");\r\n\t\t\r\n\t\tbutton = document.createElement(\"button\");\r\n\t\tbutton.classList.add(\"tabulator-page\");\r\n\t\tbutton.setAttribute(\"type\", \"button\");\r\n\t\tbutton.setAttribute(\"role\", \"button\");\r\n\t\tbutton.setAttribute(\"aria-label\", \"\");\r\n\t\tbutton.setAttribute(\"title\", \"\");\r\n\t\t\r\n\t\tthis.firstBut = button.cloneNode(true);\r\n\t\tthis.firstBut.setAttribute(\"data-page\", \"first\");\r\n\t\t\r\n\t\tthis.prevBut = button.cloneNode(true);\r\n\t\tthis.prevBut.setAttribute(\"data-page\", \"prev\");\r\n\t\t\r\n\t\tthis.nextBut = button.cloneNode(true);\r\n\t\tthis.nextBut.setAttribute(\"data-page\", \"next\");\r\n\t\t\r\n\t\tthis.lastBut = button.cloneNode(true);\r\n\t\tthis.lastBut.setAttribute(\"data-page\", \"last\");\r\n\t\t\r\n\t\tif(this.table.options.paginationSizeSelector){\r\n\t\t\tthis.pageSizeSelect = document.createElement(\"select\");\r\n\t\t\tthis.pageSizeSelect.classList.add(\"tabulator-page-size\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tgeneratePageSizeSelectList(){\r\n\t\tvar pageSizes = [];\r\n\t\t\r\n\t\tif(this.pageSizeSelect){\r\n\t\t\t\r\n\t\t\tif(Array.isArray(this.table.options.paginationSizeSelector)){\r\n\t\t\t\tpageSizes = this.table.options.paginationSizeSelector;\r\n\t\t\t\tthis.pageSizes = pageSizes;\r\n\t\t\t\t\r\n\t\t\t\tif(this.pageSizes.indexOf(this.size) == -1){\r\n\t\t\t\t\tpageSizes.unshift(this.size);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t\r\n\t\t\t\tif(this.pageSizes.indexOf(this.size) == -1){\r\n\t\t\t\t\tpageSizes = [];\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (let i = 1; i < 5; i++){\r\n\t\t\t\t\t\tpageSizes.push(this.size * i);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.pageSizes = pageSizes;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tpageSizes = this.pageSizes;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\twhile(this.pageSizeSelect.firstChild) this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);\r\n\t\t\t\r\n\t\t\tpageSizes.forEach((item) => {\r\n\t\t\t\tvar itemEl = document.createElement(\"option\");\r\n\t\t\t\titemEl.value = item;\r\n\t\t\t\t\r\n\t\t\t\tif(item === true){\r\n\t\t\t\t\tthis.langBind(\"pagination|all\", function(value){\r\n\t\t\t\t\t\titemEl.innerHTML = value;\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\titemEl.innerHTML = item;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tthis.pageSizeSelect.appendChild(itemEl);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.pageSizeSelect.value = this.size;\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializePageCounter(){\r\n\t\tvar counter = this.table.options.paginationCounter,\r\n\t\tpageCounter = null;\r\n\t\t\r\n\t\tif(counter){\r\n\t\t\tif(typeof counter === \"function\"){\r\n\t\t\t\tpageCounter = counter;\r\n\t\t\t}else{\r\n\t\t\t\tpageCounter = Page.pageCounters[counter];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(pageCounter){\r\n\t\t\t\tthis.pageCounter = pageCounter;\r\n\t\t\t\t\r\n\t\t\t\tthis.pageCounterElement = document.createElement(\"span\");\r\n\t\t\t\tthis.pageCounterElement.classList.add(\"tabulator-page-counter\");\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Pagination Error - No such page counter found: \", counter);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//setup pagination\r\n\tinitializePaginator(hidden){\r\n\t\tvar pageSelectLabel, paginationCounterHolder;\r\n\t\t\r\n\t\tif(!hidden){\r\n\t\t\t//build pagination element\r\n\t\t\t\r\n\t\t\t//bind localizations\r\n\t\t\tthis.langBind(\"pagination|first\", (value) => {\r\n\t\t\t\tthis.firstBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|first_title\", (value) => {\r\n\t\t\t\tthis.firstBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.firstBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|prev\", (value) => {\r\n\t\t\t\tthis.prevBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|prev_title\", (value) => {\r\n\t\t\t\tthis.prevBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.prevBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|next\", (value) => {\r\n\t\t\t\tthis.nextBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|next_title\", (value) => {\r\n\t\t\t\tthis.nextBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.nextBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|last\", (value) => {\r\n\t\t\t\tthis.lastBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|last_title\", (value) => {\r\n\t\t\t\tthis.lastBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.lastBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t//click bindings\r\n\t\t\tthis.firstBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.setPage(1)\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.prevBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.previousPage()\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.nextBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.nextPage()\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.lastBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.setPage(this.max)\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(this.table.options.paginationElement){\r\n\t\t\t\tthis.element = this.table.options.paginationElement;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.pageSizeSelect){\r\n\t\t\t\tpageSelectLabel = document.createElement(\"label\");\r\n\t\t\t\t\r\n\t\t\t\tthis.langBind(\"pagination|page_size\", (value) => {\r\n\t\t\t\t\tthis.pageSizeSelect.setAttribute(\"aria-label\", value);\r\n\t\t\t\t\tthis.pageSizeSelect.setAttribute(\"title\", value);\r\n\t\t\t\t\tpageSelectLabel.innerHTML = value;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.element.appendChild(pageSelectLabel);\r\n\t\t\t\tthis.element.appendChild(this.pageSizeSelect);\r\n\t\t\t\t\r\n\t\t\t\tthis.pageSizeSelect.addEventListener(\"change\", (e) => {\r\n\t\t\t\t\tthis.setPageSize(this.pageSizeSelect.value == \"true\" ? true : this.pageSizeSelect.value);\r\n\t\t\t\t\tthis.setPage(1)\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//append to DOM\r\n\t\t\tthis.element.appendChild(this.firstBut);\r\n\t\t\tthis.element.appendChild(this.prevBut);\r\n\t\t\tthis.element.appendChild(this.pagesElement);\r\n\t\t\tthis.element.appendChild(this.nextBut);\r\n\t\t\tthis.element.appendChild(this.lastBut);\r\n\t\t\t\r\n\t\t\tif(!this.table.options.paginationElement && !hidden){\r\n\t\t\t\tif(this.table.options.paginationCounter){\r\n\r\n\t\t\t\t\tpaginationCounterHolder \r\n\r\n\t\t\t\t\tif(this.table.options.paginationCounterElement){\r\n\t\t\t\t\t\tif(this.table.options.paginationCounterElement instanceof HTMLElement){\r\n\t\t\t\t\t\t\tthis.table.options.paginationCounterElement.appendChild(this.pageCounterElement);\r\n\t\t\t\t\t\t}else if(typeof this.table.options.paginationCounterElement === \"string\"){\r\n\t\t\t\t\t\t\tpaginationCounterHolder = document.querySelector(this.table.options.paginationCounterElement);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(paginationCounterHolder){\r\n\t\t\t\t\t\t\t\tpaginationCounterHolder.appendChild(this.pageCounterElement);\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Pagination Error - Unable to find element matching paginationCounterElement selector:\", this.table.options.paginationCounterElement);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.footerAppend(this.pageCounterElement);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.footerAppend(this.element);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.page = this.table.options.paginationInitialPage;\r\n\t\t\tthis.count = this.table.options.paginationButtonCount;\r\n\t\t}\r\n\t\t\r\n\t\t//set default values\r\n\t\tthis.mode = this.table.options.paginationMode;\r\n\t}\r\n\t\r\n\tinitializeProgressive(mode){\r\n\t\tthis.initializePaginator(true);\r\n\t\tthis.mode = \"progressive_\" + mode;\r\n\t\tthis.progressiveLoad = true;\r\n\t}\r\n\t\r\n\ttrackChanges(){\r\n\t\tthis.dispatch(\"page-changed\");\r\n\t}\r\n\t\r\n\tsetDisplayIndex(index){\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\t\r\n\tgetDisplayIndex(){\r\n\t\treturn this.displayIndex;\r\n\t}\r\n\t\r\n\t//calculate maximum page from number of rows\r\n\tsetMaxRows(rowCount){\r\n\t\tif(!rowCount){\r\n\t\t\tthis.max = 1;\r\n\t\t}else{\r\n\t\t\tthis.max = this.size === true ? 1 : Math.ceil(rowCount/this.size);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.page > this.max){\r\n\t\t\tthis.page = this.max;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//reset to first page without triggering action\r\n\treset(force){\r\n\t\tif(!this.initialLoad){\r\n\t\t\tif(this.mode == \"local\" || force){\r\n\t\t\t\tthis.page = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set the maximum page\r\n\tsetMaxPage(max){\r\n\t\t\r\n\t\tmax = parseInt(max);\r\n\t\t\r\n\t\tthis.max = max || 1;\r\n\t\t\r\n\t\tif(this.page > this.max){\r\n\t\t\tthis.page = this.max;\r\n\t\t\tthis.trigger();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set current page number\r\n\tsetPage(page){\r\n\t\tswitch(page){\r\n\t\t\tcase \"first\":\r\n\t\t\treturn this.setPage(1);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"prev\":\r\n\t\t\treturn this.previousPage();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"next\":\r\n\t\t\treturn this.nextPage();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"last\":\r\n\t\t\treturn this.setPage(this.max);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\tpage = parseInt(page);\r\n\t\t\r\n\t\tif((page > 0 && page <= this.max) || this.mode !== \"local\"){\r\n\t\t\tthis.page = page;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Requested page is out of range of 1 - \" + this.max + \":\", page);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetPageToRow(row){\r\n\t\tvar rows = this.table.rowManager.getDisplayRows(this.displayIndex - 1);\r\n\t\tvar index = rows.indexOf(row);\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tvar page = this.size === true ? 1 : Math.ceil((index + 1) / this.size);\r\n\t\t\t\r\n\t\t\treturn this.setPage(page)\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Requested row is not visible\");\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetPageSize(size){\r\n\t\tif(size !== true){\r\n\t\t\tsize = parseInt(size);\r\n\t\t}\r\n\r\n\t\tif(size > 0){\r\n\t\t\tthis.size = size;\r\n\t\t\tthis.dispatchExternal(\"pageSizeChanged\", size);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.pageSizeSelect){\r\n\t\t\t// this.pageSizeSelect.value = size;\r\n\t\t\tthis.generatePageSizeSelectList();\r\n\t\t}\r\n\t\t\r\n\t\tthis.trackChanges();\r\n\t}\r\n\t\r\n\t_setPageCounter(totalRows, size, currentRow){\r\n\t\tvar content;\r\n\t\t\r\n\t\tif(this.pageCounter){\r\n\r\n\t\t\tif(this.mode === \"remote\"){\r\n\t\t\t\tsize = this.size;\r\n\t\t\t\tcurrentRow = ((this.page - 1) * this.size) + 1;\r\n\t\t\t\ttotalRows = this.remoteRowCountEstimate;\r\n\t\t\t}\r\n\r\n\t\t\tcontent = this.pageCounter.call(this, size, currentRow, this.page, totalRows, this.max);\r\n\t\t\t\r\n\t\t\tswitch(typeof content){\r\n\t\t\t\tcase \"object\":\r\n\t\t\t\tif(content instanceof Node){\r\n\t\t\t\t\t\r\n\t\t\t\t\t//clear previous cell contents\r\n\t\t\t\t\twhile(this.pageCounterElement.firstChild) this.pageCounterElement.removeChild(this.pageCounterElement.firstChild);\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.pageCounterElement.appendChild(content);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.pageCounterElement.innerHTML = \"\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(content != null){\r\n\t\t\t\t\t\tconsole.warn(\"Page Counter Error - Page Counter has returned a type of object, the only valid page counter object return is an instance of Node, the page counter returned:\", content);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"undefined\":\r\n\t\t\t\tcase \"null\":\r\n\t\t\t\tthis.pageCounterElement.innerHTML = \"\";\r\n\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\tthis.pageCounterElement.innerHTML = content;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//setup the pagination buttons\r\n\t_setPageButtons(){\r\n\t\tlet leftSize = Math.floor((this.count-1) / 2);\r\n\t\tlet rightSize = Math.ceil((this.count-1) / 2);\r\n\t\tlet min = this.max - this.page + leftSize + 1 < this.count ? this.max-this.count+1: Math.max(this.page-leftSize,1);\r\n\t\tlet max = this.page <= rightSize? Math.min(this.count, this.max) :Math.min(this.page+rightSize, this.max);\r\n\t\t\r\n\t\twhile(this.pagesElement.firstChild) this.pagesElement.removeChild(this.pagesElement.firstChild);\r\n\t\t\r\n\t\tif(this.page == 1){\r\n\t\t\tthis.firstBut.disabled = true;\r\n\t\t\tthis.prevBut.disabled = true;\r\n\t\t}else{\r\n\t\t\tthis.firstBut.disabled = false;\r\n\t\t\tthis.prevBut.disabled = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.page == this.max){\r\n\t\t\tthis.lastBut.disabled = true;\r\n\t\t\tthis.nextBut.disabled = true;\r\n\t\t}else{\r\n\t\t\tthis.lastBut.disabled = false;\r\n\t\t\tthis.nextBut.disabled = false;\r\n\t\t}\r\n\t\t\r\n\t\tfor(let i = min; i <= max; i++){\r\n\t\t\tif(i>0 && i <= this.max){\r\n\t\t\t\tthis.pagesElement.appendChild(this._generatePageButton(i));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.footerRedraw();\r\n\t}\r\n\t\r\n\t_generatePageButton(page){\r\n\t\tvar button = document.createElement(\"button\");\r\n\t\t\r\n\t\tbutton.classList.add(\"tabulator-page\");\r\n\t\tif(page == this.page){\r\n\t\t\tbutton.classList.add(\"active\");\r\n\t\t}\r\n\t\t\r\n\t\tbutton.setAttribute(\"type\", \"button\");\r\n\t\tbutton.setAttribute(\"role\", \"button\");\r\n\t\t\r\n\t\tthis.langBind(\"pagination|page_title\", (value) => {\r\n\t\t\tbutton.setAttribute(\"aria-label\", value + \" \" + page);\r\n\t\t\tbutton.setAttribute(\"title\", value + \" \" + page);\r\n\t\t});\r\n\t\t\r\n\t\tbutton.setAttribute(\"data-page\", page);\r\n\t\tbutton.textContent = page;\r\n\t\t\r\n\t\tbutton.addEventListener(\"click\", (e) => {\r\n\t\t\tthis.setPage(page)\r\n\t\t});\r\n\t\t\r\n\t\treturn button;\r\n\t}\r\n\t\r\n\t//previous page\r\n\tpreviousPage(){\r\n\t\tif(this.page > 1){\r\n\t\t\tthis.page--;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger()\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Previous page would be less than page 1:\", 0);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//next page\r\n\tnextPage(){\r\n\t\tif(this.page < this.max){\r\n\t\t\tthis.page++;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger();\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tif(!this.progressiveLoad){\r\n\t\t\t\tconsole.warn(\"Pagination Error - Next page would be greater than maximum page of \" + this.max + \":\", this.max + 1);\r\n\t\t\t}\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return current page number\r\n\tgetPage(){\r\n\t\treturn this.page;\r\n\t}\r\n\t\r\n\t//return max page number\r\n\tgetPageMax(){\r\n\t\treturn this.max;\r\n\t}\r\n\t\r\n\tgetPageSize(size){\r\n\t\treturn this.size;\r\n\t}\r\n\t\r\n\tgetMode(){\r\n\t\treturn this.mode;\r\n\t}\r\n\t\r\n\t//return appropriate rows for current page\r\n\tgetRows(data){\r\n\t\tvar actualRowPageSize = 0,\r\n\t\toutput, start, end, actualStartRow;\r\n\r\n\t\tvar actualRows = data.filter((row) => {\r\n\t\t\treturn row.type === \"row\";\r\n\t\t});\r\n\t\t\r\n\t\tif(this.mode == \"local\"){\r\n\t\t\toutput = [];\r\n\t\t\t\r\n\t\t\tthis.setMaxRows(data.length);\r\n\t\t\t\r\n\t\t\tif(this.size === true){\r\n\t\t\t\tstart = 0;\r\n\t\t\t\tend = data.length;\r\n\t\t\t}else{\r\n\t\t\t\tstart = this.size * (this.page - 1);\r\n\t\t\t\tend = start + parseInt(this.size);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._setPageButtons();\r\n\t\t\t\r\n\t\t\tfor(let i = start; i < end; i++){\r\n\t\t\t\tlet row = data[i];\r\n\r\n\t\t\t\tif(row){\r\n\t\t\t\t\toutput.push(row);\r\n\r\n\t\t\t\t\tif(row.type === \"row\"){\r\n\t\t\t\t\t\tif(!actualStartRow){\r\n\t\t\t\t\t\t\tactualStartRow = row;\r\n\t\t\t\t\t\t}\t\r\n\r\n\t\t\t\t\t\tactualRowPageSize++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._setPageCounter(actualRows.length, actualRowPageSize, actualStartRow ? (actualRows.indexOf(actualStartRow) + 1) : 0);\r\n\t\t\t\r\n\t\t\treturn output;\r\n\t\t}else{\r\n\t\t\tthis._setPageButtons();\r\n\t\t\tthis._setPageCounter(actualRows.length);\r\n\t\t\t\r\n\t\t\treturn data.slice(0);\r\n\t\t}\r\n\t}\r\n\t\r\n\ttrigger(){\r\n\t\tvar left;\r\n\t\t\r\n\t\tswitch(this.mode){\r\n\t\t\tcase \"local\":\r\n\t\t\tleft = this.table.rowManager.scrollLeft;\r\n\t\t\t\r\n\t\t\tthis.refreshData();\r\n\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"pageLoaded\", this.getPage());\r\n\t\t\t\r\n\t\t\treturn Promise.resolve();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"remote\":\r\n\t\t\tthis.dataChanging = true;\r\n\t\t\treturn this.reloadData(null)\r\n\t\t\t.finally(() => {\r\n\t\t\t\tthis.dataChanging = false;\r\n\t\t\t})\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"progressive_load\":\r\n\t\t\tcase \"progressive_scroll\":\r\n\t\t\treturn this.reloadData(null, true);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\tconsole.warn(\"Pagination Error - no such pagination mode:\", this.mode);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_parseRemoteData(data){\r\n\t\tvar left, data, margin;\r\n\t\t\r\n\t\tif(typeof data.last_page === \"undefined\"){\r\n\t\t\tconsole.warn(\"Remote Pagination Error - Server response missing '\" + (this.options(\"dataReceiveParams\").last_page || \"last_page\") + \"' property\");\r\n\t\t}\r\n\t\t\r\n\t\tif(data.data){\r\n\t\t\tthis.max = parseInt(data.last_page) || 1;\r\n\r\n\t\t\tthis.remoteRowCountEstimate = typeof data.last_row !== \"undefined\" ? data.last_row : (data.last_page * this.size - (this.page == data.last_page ? (this.size - data.data.length) : 0));\r\n\t\t\t\r\n\t\t\tif(this.progressiveLoad){\r\n\t\t\t\tswitch(this.mode){\r\n\t\t\t\t\tcase \"progressive_load\":\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.page == 1){\r\n\t\t\t\t\t\tthis.table.rowManager.setData(data.data, false, this.page == 1)\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.table.rowManager.addRows(data.data);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.page < this.max){\r\n\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\tthis.nextPage();\r\n\t\t\t\t\t\t}, this.table.options.progressiveLoadDelay);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"progressive_scroll\":\r\n\t\t\t\t\tdata = this.page === 1 ? data.data : this.table.rowManager.getData().concat(data.data);\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.table.rowManager.setData(data, this.page !== 1, this.page == 1);\r\n\t\t\t\t\t\r\n\t\t\t\t\tmargin = this.table.options.progressiveLoadScrollMargin || (this.table.rowManager.element.clientHeight * 2);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.table.rowManager.element.scrollHeight <= (this.table.rowManager.element.clientHeight + margin)){\r\n\t\t\t\t\t\tif(this.page < this.max){\r\n\t\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\t\tthis.nextPage();\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\t// left = this.table.rowManager.scrollLeft;\r\n\t\t\t\tthis.dispatchExternal(\"pageLoaded\", this.getPage());\r\n\t\t\t\t// this.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\t// this.table.columnManager.scrollHorizontal(left);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Remote Pagination Error - Server response missing '\" + (this.options(\"dataReceiveParams\").data || \"data\") + \"' property\");\r\n\t\t}\r\n\t\t\r\n\t\treturn data.data;\r\n\t}\r\n\t\r\n\t//handle the footer element being redrawn\r\n\tfooterRedraw(){\r\n\t\tvar footer = this.table.footerManager.containerElement;\r\n\r\n\t\tif((Math.ceil(footer.clientWidth) - footer.scrollWidth) < 0){\r\n\t\t\tthis.pagesElement.style.display = 'none';\r\n\t\t}else{\r\n\t\t\tthis.pagesElement.style.display = '';\r\n\t\t\t\r\n\t\t\tif((Math.ceil(footer.clientWidth) - footer.scrollWidth) < 0){\r\n\t\t\t\tthis.pagesElement.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nPage.moduleName = \"page\";\r\n\r\n//load defaults\r\nPage.pageCounters = defaultPageCounters;\r\n\r\nexport default Page;","// read peristence information from storage\r\nexport default {\r\n\tlocal:function(id, type){\r\n\t\tvar data = localStorage.getItem(id + \"-\" + type);\r\n\r\n\t\treturn data ? JSON.parse(data) : false;\r\n\t},\r\n\tcookie:function(id, type){\r\n\t\tvar cookie = document.cookie,\r\n\t\tkey = id + \"-\" + type,\r\n\t\tcookiePos = cookie.indexOf(key + \"=\"),\r\n\t\tend, data;\r\n\r\n\t\t//if cookie exists, decode and load column data into tabulator\r\n\t\tif(cookiePos > -1){\r\n\t\t\tcookie = cookie.slice(cookiePos);\r\n\r\n\t\t\tend = cookie.indexOf(\";\");\r\n\r\n\t\t\tif(end > -1){\r\n\t\t\t\tcookie = cookie.slice(0, end);\r\n\t\t\t}\r\n\r\n\t\t\tdata = cookie.replace(key + \"=\", \"\");\r\n\t\t}\r\n\r\n\t\treturn data ? JSON.parse(data) : false;\r\n\t}\r\n};\r\n","//write persistence information to storage\r\nexport default {\r\n\tlocal:function(id, type, data){\r\n\t\tlocalStorage.setItem(id + \"-\" + type, JSON.stringify(data));\r\n\t},\r\n\tcookie:function(id, type, data){\r\n\t\tvar expireDate = new Date();\r\n\r\n\t\texpireDate.setDate(expireDate.getDate() + 10000);\r\n\r\n\t\tdocument.cookie = id + \"-\" + type + \"=\" + JSON.stringify(data) + \"; expires=\" + expireDate.toUTCString();\r\n\t}\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultReaders from './defaults/readers.js';\r\nimport defaultWriters from './defaults/writers.js';\r\n\r\nclass Persistence extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.mode = \"\";\r\n\t\tthis.id = \"\";\r\n\t\t// this.persistProps = [\"field\", \"width\", \"visible\"];\r\n\t\tthis.defWatcherBlock = false;\r\n\t\tthis.config = {};\r\n\t\tthis.readFunc = false;\r\n\t\tthis.writeFunc = false;\r\n\r\n\t\tthis.registerTableOption(\"persistence\", false);\r\n\t\tthis.registerTableOption(\"persistenceID\", \"\"); //key for persistent storage\r\n\t\tthis.registerTableOption(\"persistenceMode\", true); //mode for storing persistence information\r\n\t\tthis.registerTableOption(\"persistenceReaderFunc\", false); //function for handling persistence data reading\r\n\t\tthis.registerTableOption(\"persistenceWriterFunc\", false); //function for handling persistence data writing\r\n\t}\r\n\r\n\t// Test for whether localStorage is available for use.\r\n\tlocalStorageTest() {\r\n\t\tvar testKey = \"_tabulator_test\";\r\n\r\n\t\ttry {\r\n\t\t\twindow.localStorage.setItem( testKey, testKey);\r\n\t\t\twindow.localStorage.removeItem( testKey );\r\n\t\t\treturn true;\r\n\t\t} catch(e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//setup parameters\r\n\tinitialize(){\r\n\t\tif(this.table.options.persistence){\r\n\t\t\t//determine persistent layout storage type\r\n\t\t\tvar mode = this.table.options.persistenceMode,\r\n\t\t\tid = this.table.options.persistenceID,\r\n\t\t\tretreivedData;\r\n\r\n\t\t\tthis.mode = mode !== true ? mode : (this.localStorageTest() ? \"local\" : \"cookie\");\r\n\r\n\t\t\tif(this.table.options.persistenceReaderFunc){\r\n\t\t\t\tif(typeof this.table.options.persistenceReaderFunc === \"function\"){\r\n\t\t\t\t\tthis.readFunc = this.table.options.persistenceReaderFunc;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(Persistence.readers[this.table.options.persistenceReaderFunc]){\r\n\t\t\t\t\t\tthis.readFunc = Persistence.readers[this.table.options.persistenceReaderFunc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Persistence Read Error - invalid reader set\", this.table.options.persistenceReaderFunc);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(Persistence.readers[this.mode]){\r\n\t\t\t\t\tthis.readFunc = Persistence.readers[this.mode];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Persistence Read Error - invalid reader set\", this.mode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.options.persistenceWriterFunc){\r\n\t\t\t\tif(typeof this.table.options.persistenceWriterFunc === \"function\"){\r\n\t\t\t\t\tthis.writeFunc = this.table.options.persistenceWriterFunc;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(Persistence.writers[this.table.options.persistenceWriterFunc]){\r\n\t\t\t\t\t\tthis.writeFunc = Persistence.writers[this.table.options.persistenceWriterFunc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Persistence Write Error - invalid reader set\", this.table.options.persistenceWriterFunc);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(Persistence.writers[this.mode]){\r\n\t\t\t\t\tthis.writeFunc = Persistence.writers[this.mode];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Persistence Write Error - invalid writer set\", this.mode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//set storage tag\r\n\t\t\tthis.id = \"tabulator-\" + (id || (this.table.element.getAttribute(\"id\") || \"\"));\r\n\r\n\t\t\tthis.config = {\r\n\t\t\t\tsort:this.table.options.persistence === true || this.table.options.persistence.sort,\r\n\t\t\t\tfilter:this.table.options.persistence === true || this.table.options.persistence.filter,\r\n\t\t\t\tgroup:this.table.options.persistence === true || this.table.options.persistence.group,\r\n\t\t\t\tpage:this.table.options.persistence === true || this.table.options.persistence.page,\r\n\t\t\t\tcolumns:this.table.options.persistence === true ? [\"title\", \"width\", \"visible\"] : this.table.options.persistence.columns,\r\n\t\t\t};\r\n\r\n\t\t\t//load pagination data if needed\r\n\t\t\tif(this.config.page){\r\n\t\t\t\tretreivedData = this.retreiveData(\"page\");\r\n\r\n\t\t\t\tif(retreivedData){\r\n\t\t\t\t\tif(typeof retreivedData.paginationSize !== \"undefined\" && (this.config.page === true || this.config.page.size)){\r\n\t\t\t\t\t\tthis.table.options.paginationSize = retreivedData.paginationSize;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(typeof retreivedData.paginationInitialPage !== \"undefined\" && (this.config.page === true || this.config.page.page)){\r\n\t\t\t\t\t\tthis.table.options.paginationInitialPage = retreivedData.paginationInitialPage;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//load group data if needed\r\n\t\t\tif(this.config.group){\r\n\t\t\t\tretreivedData = this.retreiveData(\"group\");\r\n\r\n\t\t\t\tif(retreivedData){\r\n\t\t\t\t\tif(typeof retreivedData.groupBy !== \"undefined\" && (this.config.group === true || this.config.group.groupBy)){\r\n\t\t\t\t\t\tthis.table.options.groupBy = retreivedData.groupBy;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(typeof retreivedData.groupStartOpen !== \"undefined\" && (this.config.group === true || this.config.group.groupStartOpen)){\r\n\t\t\t\t\t\tthis.table.options.groupStartOpen = retreivedData.groupStartOpen;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(typeof retreivedData.groupHeader !== \"undefined\" && (this.config.group === true || this.config.group.groupHeader)){\r\n\t\t\t\t\t\tthis.table.options.groupHeader = retreivedData.groupHeader;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.columns){\r\n\t\t\t\tthis.table.options.columns = this.load(\"columns\", this.table.options.columns);\r\n\t\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t\t\tthis.subscribe(\"column-show\", this.save.bind(this, \"columns\"));\r\n\t\t\t\tthis.subscribe(\"column-hide\", this.save.bind(this, \"columns\"));\r\n\t\t\t\tthis.subscribe(\"column-moved\", this.save.bind(this, \"columns\"));\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"table-built\", this.tableBuilt.bind(this), 0);\r\n\r\n\t\t\tthis.subscribe(\"table-redraw\", this.tableRedraw.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"filter-changed\", this.eventSave.bind(this, \"filter\"));\r\n\t\t\tthis.subscribe(\"sort-changed\", this.eventSave.bind(this, \"sort\"));\r\n\t\t\tthis.subscribe(\"group-changed\", this.eventSave.bind(this, \"group\"));\r\n\t\t\tthis.subscribe(\"page-changed\", this.eventSave.bind(this, \"page\"));\r\n\t\t\tthis.subscribe(\"column-resized\", this.eventSave.bind(this, \"columns\"));\r\n\t\t\tthis.subscribe(\"layout-refreshed\", this.eventSave.bind(this, \"columns\"));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"getColumnLayout\", this.getColumnLayout.bind(this));\r\n\t\tthis.registerTableFunction(\"setColumnLayout\", this.setColumnLayout.bind(this));\r\n\t}\r\n\r\n\teventSave(type){\r\n\t\tif(this.config[type]){\r\n\t\t\tthis.save(type);\r\n\t\t}\r\n\t}\r\n\r\n\ttableBuilt(){\r\n\t\tvar options = this.table.options,\r\n\t\tsorters, filters;\r\n\r\n\t\tif(this.config.sort){\r\n\t\t\tsorters = this.load(\"sort\");\r\n\r\n\t\t\tif(!sorters === false){\r\n\t\t\t\tthis.table.options.initialSort = sorters;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this.config.filter){\r\n\t\t\tfilters = this.load(\"filter\");\r\n\r\n\t\t\tif(!filters === false){\r\n\t\t\t\tthis.table.options.initialFilter = filters;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tif(force && this.config.columns){\r\n\t\t\tthis.save(\"columns\");\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tgetColumnLayout(){\r\n\t\treturn this.parseColumns(this.table.columnManager.getColumns());\r\n\t}\r\n\r\n\tsetColumnLayout(layout){\r\n\t\tthis.table.columnManager.setColumns(this.mergeDefinition(this.table.options.columns, layout))\r\n\t\treturn true;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tinitializeColumn(column){\r\n\t\tvar def, keys;\r\n\r\n\t\tif(this.config.columns){\r\n\t\t\tthis.defWatcherBlock = true;\r\n\r\n\t\t\tdef = column.getDefinition();\r\n\r\n\t\t\tkeys = this.config.columns === true ? Object.keys(def) : this.config.columns;\r\n\r\n\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\tvar props = Object.getOwnPropertyDescriptor(def, key);\r\n\t\t\t\tvar value = def[key];\r\n\t\t\t\tif(props){\r\n\t\t\t\t\tObject.defineProperty(def, key, {\r\n\t\t\t\t\t\tset: function(newValue){\r\n\t\t\t\t\t\t\tvalue = newValue;\r\n\r\n\t\t\t\t\t\t\tif(!this.defWatcherBlock){\r\n\t\t\t\t\t\t\t\tthis.save(\"columns\");\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif(props.set){\r\n\t\t\t\t\t\t\t\tprops.set(newValue);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tget:function(){\r\n\t\t\t\t\t\t\tif(props.get){\r\n\t\t\t\t\t\t\t\tprops.get();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.defWatcherBlock = false;\r\n\t\t}\r\n\t}\r\n\r\n\t//load saved definitions\r\n\tload(type, current){\r\n\t\tvar data = this.retreiveData(type);\r\n\r\n\t\tif(current){\r\n\t\t\tdata = data ? this.mergeDefinition(current, data) : current;\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//retreive data from memory\r\n\tretreiveData(type){\r\n\t\treturn this.readFunc ? this.readFunc(this.id, type) : false;\r\n\t}\r\n\r\n\t//merge old and new column definitions\r\n\tmergeDefinition(oldCols, newCols){\r\n\t\tvar output = [];\r\n\r\n\t\tnewCols = newCols || [];\r\n\r\n\t\tnewCols.forEach((column, to) => {\r\n\t\t\tvar from = this._findColumn(oldCols, column),\r\n\t\t\tkeys;\r\n\r\n\t\t\tif(from){\r\n\t\t\t\tif(this.config.columns === true || this.config.columns == undefined){\r\n\t\t\t\t\tkeys = Object.keys(from);\r\n\t\t\t\t\tkeys.push(\"width\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tkeys = this.config.columns;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\t\tif(key !== \"columns\" && typeof column[key] !== \"undefined\"){\r\n\t\t\t\t\t\tfrom[key] = column[key];\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(from.columns){\r\n\t\t\t\t\tfrom.columns = this.mergeDefinition(from.columns, column.columns);\r\n\t\t\t\t}\r\n\r\n\t\t\t\toutput.push(from);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\toldCols.forEach((column, i) => {\r\n\t\t\tvar from = this._findColumn(newCols, column);\r\n\r\n\t\t\tif (!from) {\r\n\t\t\t\tif(output.length>i){\r\n\t\t\t\t\toutput.splice(i, 0, column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\toutput.push(column);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//find matching columns\r\n\t_findColumn(columns, subject){\r\n\t\tvar type = subject.columns ? \"group\" : (subject.field ? \"field\" : \"object\");\r\n\r\n\t\treturn columns.find(function(col){\r\n\t\t\tswitch(type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\treturn col.title === subject.title && col.columns.length === subject.columns.length;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"field\":\r\n\t\t\t\treturn col.field === subject.field;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"object\":\r\n\t\t\t\treturn col === subject;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//save data\r\n\tsave(type){\r\n\t\tvar data = {};\r\n\r\n\t\tswitch(type){\r\n\t\t\tcase \"columns\":\r\n\t\t\tdata = this.parseColumns(this.table.columnManager.getColumns())\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"filter\":\r\n\t\t\tdata = this.table.modules.filter.getFilters();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"sort\":\r\n\t\t\tdata = this.validateSorters(this.table.modules.sort.getSort());\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\tdata = this.getGroupConfig();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"page\":\r\n\t\t\tdata = this.getPageConfig();\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(this.writeFunc){\r\n\t\t\tthis.writeFunc(this.id, type, data);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t//ensure sorters contain no function data\r\n\tvalidateSorters(data){\r\n\t\tdata.forEach(function(item){\r\n\t\t\titem.column = item.field;\r\n\t\t\tdelete item.field;\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tgetGroupConfig(){\r\n\t\tvar data = {};\r\n\r\n\t\tif(this.config.group){\r\n\t\t\tif(this.config.group === true || this.config.group.groupBy){\r\n\t\t\t\tdata.groupBy = this.table.options.groupBy;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.group === true || this.config.group.groupStartOpen){\r\n\t\t\t\tdata.groupStartOpen = this.table.options.groupStartOpen;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.group === true || this.config.group.groupHeader){\r\n\t\t\t\tdata.groupHeader = this.table.options.groupHeader;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tgetPageConfig(){\r\n\t\tvar data = {};\r\n\r\n\t\tif(this.config.page){\r\n\t\t\tif(this.config.page === true || this.config.page.size){\r\n\t\t\t\tdata.paginationSize = this.table.modules.page.getPageSize();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.page === true || this.config.page.page){\r\n\t\t\t\tdata.paginationInitialPage = this.table.modules.page.getPage();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\r\n\t//parse columns for data to store\r\n\tparseColumns(columns){\r\n\t\tvar definitions = [],\r\n\t\texcludedKeys = [\"headerContextMenu\", \"headerMenu\", \"contextMenu\", \"clickMenu\"];\r\n\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\tvar defStore = {},\r\n\t\t\tcolDef = column.getDefinition(),\r\n\t\t\tkeys;\r\n\r\n\t\t\tif(column.isGroup){\r\n\t\t\t\tdefStore.title = colDef.title;\r\n\t\t\t\tdefStore.columns = this.parseColumns(column.getColumns());\r\n\t\t\t}else{\r\n\t\t\t\tdefStore.field = column.getField();\r\n\r\n\t\t\t\tif(this.config.columns === true || this.config.columns == undefined){\r\n\t\t\t\t\tkeys = Object.keys(colDef);\r\n\t\t\t\t\tkeys.push(\"width\");\r\n\t\t\t\t\tkeys.push(\"visible\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tkeys = this.config.columns;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\t\tswitch(key){\r\n\t\t\t\t\t\tcase \"width\":\r\n\t\t\t\t\t\tdefStore.width = column.getWidth();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"visible\":\r\n\t\t\t\t\t\tdefStore.visible = column.visible;\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tif(typeof colDef[key] !== \"function\" && excludedKeys.indexOf(key) === -1){\r\n\t\t\t\t\t\t\tdefStore[key] = colDef[key];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tdefinitions.push(defStore);\r\n\t\t});\r\n\r\n\t\treturn definitions;\r\n\t}\r\n}\r\n\r\nPersistence.moduleName = \"persistence\";\r\n\r\nPersistence.moduleInitOrder = -10;\r\n\r\n//load defaults\r\nPersistence.readers = defaultReaders;\r\nPersistence.writers = defaultWriters;\r\n\r\nexport default Persistence;","import Module from '../../core/Module.js';\r\n\r\nclass Popup extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.columnSubscribers = {};\r\n\t\t\r\n\t\tthis.registerTableOption(\"rowContextPopup\", false);\r\n\t\tthis.registerTableOption(\"rowClickPopup\", false);\r\n\t\tthis.registerTableOption(\"groupContextPopup\", false);\r\n\t\tthis.registerTableOption(\"groupClickPopup\", false);\r\n\t\t\r\n\t\tthis.registerColumnOption(\"headerContextPopup\");\r\n\t\tthis.registerColumnOption(\"headerClickPopup\");\r\n\t\tthis.registerColumnOption(\"headerPopup\");\r\n\t\tthis.registerColumnOption(\"headerPopupIcon\");\r\n\t\tthis.registerColumnOption(\"contextPopup\");\r\n\t\tthis.registerColumnOption(\"clickPopup\");\r\n\t\t\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.initializeRowWatchers();\r\n\t\tthis.initializeGroupWatchers();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\t\r\n\tinitializeRowWatchers(){\r\n\t\tif(this.table.options.rowContextPopup){\r\n\t\t\tthis.subscribe(\"row-contextmenu\", this.loadPopupEvent.bind(this, this.table.options.rowContextPopup));\r\n\t\t\tthis.table.on(\"rowTapHold\", this.loadPopupEvent.bind(this, this.table.options.rowContextPopup));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.rowClickPopup){\r\n\t\t\tthis.subscribe(\"row-click\", this.loadPopupEvent.bind(this, this.table.options.rowClickPopup));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeGroupWatchers(){\r\n\t\tif(this.table.options.groupContextPopup){\r\n\t\t\tthis.subscribe(\"group-contextmenu\", this.loadPopupEvent.bind(this, this.table.options.groupContextPopup));\r\n\t\t\tthis.table.on(\"groupTapHold\", this.loadPopupEvent.bind(this, this.table.options.groupContextPopup));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.groupClickPopup){\r\n\t\t\tthis.subscribe(\"group-click\", this.loadPopupEvent.bind(this, this.table.options.groupClickPopup));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar options = [\"headerContextPopup\", \"headerClickPopup\"],\r\n\t\tdef = column.definition;\r\n\t\t\r\n\t\t//handle column events\r\n\t\tif(def.headerContextPopup && !this.columnSubscribers.headerContextPopup){\r\n\t\t\tthis.columnSubscribers.headerContextPopup = this.loadPopupTableColumnEvent.bind(this, \"headerContextPopup\");\r\n\t\t\tthis.subscribe(\"column-contextmenu\", this.columnSubscribers.headerContextPopup);\r\n\t\t\tthis.table.on(\"headerTapHold\", this.loadPopupTableColumnEvent.bind(this, \"headerContextPopup\"))\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerClickPopup && !this.columnSubscribers.headerClickPopup){\r\n\t\t\tthis.columnSubscribers.headerClickPopup = this.loadPopupTableColumnEvent.bind(this, \"headerClickPopup\");\r\n\t\t\tthis.subscribe(\"column-click\", this.columnSubscribers.headerClickPopup);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerPopup){\r\n\t\t\tthis.initializeColumnHeaderPopup(column);\r\n\t\t}\r\n\t\t\r\n\t\t//handle cell events\r\n\t\tif(def.contextPopup && !this.columnSubscribers.contextPopup){\r\n\t\t\tthis.columnSubscribers.contextPopup = this.loadPopupTableCellEvent.bind(this, \"contextPopup\");\r\n\t\t\tthis.subscribe(\"cell-contextmenu\", this.columnSubscribers.contextPopup);\r\n\t\t\tthis.table.on(\"cellTapHold\", this.loadPopupTableCellEvent.bind(this, \"contextPopup\"))\r\n\t\t}\r\n\t\t\r\n\t\tif(def.clickPopup && !this.columnSubscribers.clickPopup){\r\n\t\t\tthis.columnSubscribers.clickPopup = this.loadPopupTableCellEvent.bind(this, \"clickPopup\");\r\n\t\t\tthis.subscribe(\"cell-click\", this.columnSubscribers.clickPopup);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumnHeaderPopup(column){\r\n\t\tvar icon = column.definition.headerPopupIcon,\r\n\t\theaderPopupEl;\r\n\t\t\r\n\t\theaderPopupEl = document.createElement(\"span\");\r\n\t\theaderPopupEl.classList.add(\"tabulator-header-popup-button\");\r\n\r\n\t\tif(icon){\r\n\t\t\tif(typeof icon === \"function\"){\r\n\t\t\t\ticon = icon(column.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tif(icon instanceof HTMLElement){\r\n\t\t\t\theaderPopupEl.appendChild(icon);\r\n\t\t\t}else{\r\n\t\t\t\theaderPopupEl.innerHTML = icon;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\theaderPopupEl.innerHTML = \"⋮\";\r\n\t\t}\r\n\t\t\r\n\t\theaderPopupEl.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tthis.loadPopupEvent(column.definition.headerPopup, e, column);\r\n\t\t});\r\n\t\t\r\n\t\tcolumn.titleElement.insertBefore(headerPopupEl, column.titleElement.firstChild);\r\n\t}\r\n\t\r\n\tloadPopupTableCellEvent(option, e, cell){\r\n\t\tif(cell._cell){\r\n\t\t\tcell = cell._cell;\r\n\t\t}\r\n\t\t\r\n\t\tif(cell.column.definition[option]){\r\n\t\t\tthis.loadPopupEvent(cell.column.definition[option], e, cell);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadPopupTableColumnEvent(option, e, column){\r\n\t\tif(column._column){\r\n\t\t\tcolumn = column._column;\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition[option]){\r\n\t\t\tthis.loadPopupEvent(column.definition[option], e, column);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadPopupEvent(contents, e, component){\r\n\t\tvar renderedCallback;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\trenderedCallback = callback;\r\n\t\t}\r\n\t\t\r\n\t\tif(component._group){\r\n\t\t\tcomponent = component._group;\r\n\t\t}else if(component._row){\r\n\t\t\tcomponent = component._row;\r\n\t\t}\r\n\t\t\r\n\t\tcontents = typeof contents == \"function\" ? contents.call(this.table, e, component.getComponent(), onRendered) : contents;\r\n\t\t\r\n\t\tthis.loadPopup(e, component, contents, renderedCallback);\r\n\t}\r\n\t\r\n\tloadPopup(e, component, contents, renderedCallback){\r\n\t\tvar touch = !(e instanceof MouseEvent),\r\n\t\tcontentsEl, popup;\r\n\t\t\r\n\t\tif(contents instanceof HTMLElement){\r\n\t\t\tcontentsEl = contents;\r\n\t\t}else{\r\n\t\t\tcontentsEl = document.createElement(\"div\");\r\n\t\t\tcontentsEl.innerHTML = contents;\r\n\t\t}\r\n\t\t\r\n\t\tcontentsEl.classList.add(\"tabulator-popup\");\r\n\r\n\t\tcontentsEl.addEventListener(\"click\", (e) =>{\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tif(!touch){\r\n\t\t\te.preventDefault();\r\n\t\t}\r\n\t\t\r\n\t\tpopup = this.popup(contentsEl);\r\n\r\n\t\tif(typeof renderedCallback === \"function\"){\r\n\t\t\tpopup.renderCallback(renderedCallback);\r\n\t\t}\r\n\t\t\r\n\t\tpopup.show(e).hideOnBlur(() => {\r\n\t\t\tthis.dispatchExternal(\"popupClosed\", component.getComponent());\r\n\t\t});\r\n\r\n\r\n\r\n\t\tthis.dispatchExternal(\"popupOpened\", component.getComponent())\r\n\t}\r\n}\r\n\r\nPopup.moduleName = \"popup\";\r\n\r\nexport default Popup;\r\n","import Module from '../../core/Module.js';\r\n\r\nclass Print extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.element = false;\r\n\t\tthis.manualBlock = false;\r\n\r\n\t\tthis.registerTableOption(\"printAsHtml\", false); //enable print as html\r\n\t\tthis.registerTableOption(\"printFormatter\", false); //printing page formatter\r\n\t\tthis.registerTableOption(\"printHeader\", false); //page header contents\r\n\t\tthis.registerTableOption(\"printFooter\", false); //page footer contents\r\n\t\tthis.registerTableOption(\"printStyled\", true); //enable print as html styling\r\n\t\tthis.registerTableOption(\"printRowRange\", \"visible\"); //restrict print to visible rows only\r\n\t\tthis.registerTableOption(\"printConfig\", {}); //print config options\r\n\r\n\t\tthis.registerColumnOption(\"print\");\r\n\t\tthis.registerColumnOption(\"titlePrint\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.printAsHtml){\r\n\t\t\twindow.addEventListener(\"beforeprint\", this.replaceTable.bind(this));\r\n\t\t\twindow.addEventListener(\"afterprint\", this.cleanup.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"print\", this.printFullscreen.bind(this));\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\treplaceTable(){\r\n\t\tif(!this.manualBlock){\r\n\t\t\tthis.element = document.createElement(\"div\");\r\n\t\t\tthis.element.classList.add(\"tabulator-print-table\");\r\n\r\n\t\t\tthis.element.appendChild(this.table.modules.export.genereateTable(this.table.options.printConfig, this.table.options.printStyled, this.table.options.printRowRange, \"print\"));\r\n\r\n\t\t\tthis.table.element.style.display = \"none\";\r\n\r\n\t\t\tthis.table.element.parentNode.insertBefore(this.element, this.table.element);\r\n\t\t}\r\n\t}\r\n\r\n\tcleanup(){\r\n\t\tdocument.body.classList.remove(\"tabulator-print-fullscreen-hide\");\r\n\r\n\t\tif(this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\tthis.table.element.style.display = \"\";\r\n\t\t}\r\n\t}\r\n\r\n\tprintFullscreen(visible, style, config){\r\n\t\tvar scrollX = window.scrollX,\r\n\t\tscrollY = window.scrollY,\r\n\t\theaderEl = document.createElement(\"div\"),\r\n\t\tfooterEl = document.createElement(\"div\"),\r\n\t\ttableEl = this.table.modules.export.genereateTable(typeof config != \"undefined\" ? config : this.table.options.printConfig, typeof style != \"undefined\" ? style : this.table.options.printStyled, visible || this.table.options.printRowRange, \"print\"),\r\n\t\theaderContent, footerContent;\r\n\r\n\t\tthis.manualBlock = true;\r\n\r\n\t\tthis.element = document.createElement(\"div\");\r\n\t\tthis.element.classList.add(\"tabulator-print-fullscreen\");\r\n\r\n\t\tif(this.table.options.printHeader){\r\n\t\t\theaderEl.classList.add(\"tabulator-print-header\");\r\n\r\n\t\t\theaderContent = typeof this.table.options.printHeader == \"function\" ? this.table.options.printHeader.call(this.table) : this.table.options.printHeader;\r\n\r\n\t\t\tif(typeof headerContent == \"string\"){\r\n\t\t\t\theaderEl.innerHTML = headerContent;\r\n\t\t\t}else{\r\n\t\t\t\theaderEl.appendChild(headerContent);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element.appendChild(headerEl);\r\n\t\t}\r\n\r\n\t\tthis.element.appendChild(tableEl);\r\n\r\n\t\tif(this.table.options.printFooter){\r\n\t\t\tfooterEl.classList.add(\"tabulator-print-footer\");\r\n\r\n\t\t\tfooterContent = typeof this.table.options.printFooter == \"function\" ? this.table.options.printFooter.call(this.table) : this.table.options.printFooter;\r\n\r\n\r\n\t\t\tif(typeof footerContent == \"string\"){\r\n\t\t\t\tfooterEl.innerHTML = footerContent;\r\n\t\t\t}else{\r\n\t\t\t\tfooterEl.appendChild(footerContent);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element.appendChild(footerEl);\r\n\t\t}\r\n\r\n\t\tdocument.body.classList.add(\"tabulator-print-fullscreen-hide\");\r\n\t\tdocument.body.appendChild(this.element);\r\n\r\n\t\tif(this.table.options.printFormatter){\r\n\t\t\tthis.table.options.printFormatter(this.element, tableEl);\r\n\t\t}\r\n\r\n\t\twindow.print();\r\n\r\n\t\tthis.cleanup();\r\n\r\n\t\twindow.scrollTo(scrollX, scrollY);\r\n\r\n\t\tthis.manualBlock = false;\r\n\t}\r\n}\r\n\r\nPrint.moduleName = \"print\";\r\n\r\nexport default Print;","import Module from '../../core/Module.js';\r\n\r\nclass ReactiveData extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.data = false;\r\n\t\tthis.blocked = false; //block reactivity while performing update\r\n\t\tthis.origFuncs = {}; // hold original data array functions to allow replacement after data is done with\r\n\t\tthis.currentVersion = 0;\r\n\r\n\t\tthis.registerTableOption(\"reactiveData\", false); //enable data reactivity\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.reactiveData){\r\n\t\t\tthis.subscribe(\"cell-value-save-before\", this.block.bind(this));\r\n\t\t\tthis.subscribe(\"cell-value-save-after\", this.unblock.bind(this));\r\n\t\t\tthis.subscribe(\"row-data-save-before\", this.block.bind(this));\r\n\t\t\tthis.subscribe(\"row-data-save-after\", this.unblock.bind(this));\r\n\t\t\tthis.subscribe(\"row-data-init-after\", this.watchRow.bind(this));\r\n\t\t\tthis.subscribe(\"data-processing\", this.watchData.bind(this));\r\n\t\t\tthis.subscribe(\"table-destroy\", this.unwatchData.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\twatchData(data){\r\n\t\tvar self = this,\r\n\t\tpushFunc, version;\r\n\r\n\t\tthis.currentVersion ++;\r\n\r\n\t\tversion = this.currentVersion;\r\n\r\n\t\tthis.unwatchData();\r\n\r\n\t\tthis.data = data;\r\n\r\n\t\t//override array push function\r\n\t\tthis.origFuncs.push = data.push;\r\n\r\n\t\tObject.defineProperty(this.data, \"push\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments);\r\n\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\targs.forEach((arg) => {\r\n\t\t\t\t\t\tself.table.rowManager.addRowActual(arg, false);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.origFuncs.push.apply(data, arguments);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t//override array unshift function\r\n\t\tthis.origFuncs.unshift = data.unshift;\r\n\r\n\t\tObject.defineProperty(this.data, \"unshift\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments);\r\n\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\targs.forEach((arg) => {\r\n\t\t\t\t\t\tself.table.rowManager.addRowActual(arg, true);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.origFuncs.unshift.apply(data, arguments);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\t//override array shift function\r\n\t\tthis.origFuncs.shift = data.shift;\r\n\r\n\t\tObject.defineProperty(this.data, \"shift\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar row;\r\n\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tif(self.data.length){\r\n\t\t\t\t\t\trow = self.table.rowManager.getRowFromDataObject(self.data[0]);\r\n\r\n\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\trow.deleteActual();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.origFuncs.shift.call(data);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t//override array pop function\r\n\t\tthis.origFuncs.pop = data.pop;\r\n\r\n\t\tObject.defineProperty(this.data, \"pop\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar row;\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tif(self.data.length){\r\n\t\t\t\t\t\trow = self.table.rowManager.getRowFromDataObject(self.data[self.data.length - 1]);\r\n\r\n\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\trow.deleteActual();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn self.origFuncs.pop.call(data);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\t//override array splice function\r\n\t\tthis.origFuncs.splice = data.splice;\r\n\r\n\t\tObject.defineProperty(this.data, \"splice\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments),\r\n\t\t\t\tstart = args[0] < 0 ? data.length + args[0] : args[0],\r\n\t\t\t\tend = args[1],\r\n\t\t\t\tnewRows = args[2] ? args.slice(2) : false,\r\n\t\t\t\tstartRow;\r\n\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\r\n\t\t\t\t\t//add new rows\r\n\t\t\t\t\tif(newRows){\r\n\t\t\t\t\t\tstartRow = data[start] ? self.table.rowManager.getRowFromDataObject(data[start]) : false;\r\n\r\n\t\t\t\t\t\tif(startRow){\r\n\t\t\t\t\t\t\tnewRows.forEach((rowData) => {\r\n\t\t\t\t\t\t\t\tself.table.rowManager.addRowActual(rowData, true, startRow, true);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnewRows = newRows.slice().reverse();\r\n\r\n\t\t\t\t\t\t\tnewRows.forEach((rowData) => {\r\n\t\t\t\t\t\t\t\tself.table.rowManager.addRowActual(rowData, true, false, true);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//delete removed rows\r\n\t\t\t\t\tif(end !== 0){\r\n\t\t\t\t\t\tvar oldRows = data.slice(start, typeof args[1] === \"undefined\" ? args[1] : start + end);\r\n\r\n\t\t\t\t\t\toldRows.forEach((rowData, i) => {\r\n\t\t\t\t\t\t\tvar row = self.table.rowManager.getRowFromDataObject(rowData);\r\n\r\n\t\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\t\trow.deleteActual(i !== oldRows.length - 1);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(newRows || end !== 0){\r\n\t\t\t\t\t\tself.table.rowManager.reRenderInPosition();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.origFuncs.splice.apply(data, arguments);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tunwatchData(){\r\n\t\tif(this.data !== false){\r\n\t\t\tfor(var key in this.origFuncs){\r\n\t\t\t\tObject.defineProperty(this.data, key, {\r\n\t\t\t\t\tenumerable: true,\r\n\t\t\t\t\tconfigurable:true,\r\n\t\t\t\t\twritable:true,\r\n\t\t\t\t\tvalue: this.origFuncs.key,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\twatchRow(row){\r\n\t\tvar data = row.getData();\r\n\r\n\t\tthis.blocked = true;\r\n\r\n\t\tfor(var key in data){\r\n\t\t\tthis.watchKey(row, data, key);\r\n\t\t}\r\n\r\n\t\tif(this.table.options.dataTree){\r\n\t\t\tthis.watchTreeChildren(row);\r\n\t\t}\r\n\r\n\t\tthis.blocked = false;\r\n\t}\r\n\r\n\twatchTreeChildren (row){\r\n\t\tvar childField = row.getData()[this.table.options.dataTreeChildField],\r\n\t\torigFuncs = {};\r\n\r\n\t\tfunction rebuildTree(){\r\n\t\t\tthis.table.modules.dataTree.initializeRow(row);\r\n\t\t\tthis.table.modules.dataTree.layoutRow(row);\r\n\t\t\tthis.table.rowManager.refreshActiveData(\"tree\", false, true);\r\n\t\t}\r\n\r\n\t\tif(childField){\r\n\r\n\t\t\torigFuncs.push = childField.push;\r\n\r\n\t\t\tObject.defineProperty(childField, \"push\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tvar result = origFuncs.push.apply(childField, arguments);\r\n\r\n\t\t\t\t\trebuildTree();\r\n\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\torigFuncs.unshift = childField.unshift;\r\n\r\n\t\t\tObject.defineProperty(childField, \"unshift\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tvar result = origFuncs.unshift.apply(childField, arguments);\r\n\r\n\t\t\t\t\trebuildTree();\r\n\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\torigFuncs.shift = childField.shift;\r\n\r\n\t\t\tObject.defineProperty(childField, \"shift\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tvar result = origFuncs.shift.call(childField);\r\n\r\n\t\t\t\t\trebuildTree();\r\n\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\torigFuncs.pop = childField.pop;\r\n\r\n\t\t\tObject.defineProperty(childField, \"pop\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tvar result = origFuncs.pop.call(childField);\r\n\r\n\t\t\t\t\trebuildTree();\r\n\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\torigFuncs.splice = childField.splice;\r\n\r\n\t\t\tObject.defineProperty(childField, \"splice\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tvar result = origFuncs.splice.apply(childField, arguments);\r\n\r\n\t\t\t\t\trebuildTree();\r\n\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\twatchKey(row, data, key){\r\n\t\tvar props = Object.getOwnPropertyDescriptor(data, key),\r\n\t\tvalue = data[key],\r\n\t\tversion = this.currentVersion;\r\n\r\n\t\tObject.defineProperty(data, key, {\r\n\t\t\tset: (newValue) => {\r\n\t\t\t\tvalue = newValue;\r\n\t\t\t\tif(!this.blocked && version === this.currentVersion){\r\n\t\t\t\t\tvar update = {};\r\n\t\t\t\t\tupdate[key] = newValue;\r\n\t\t\t\t\trow.updateData(update);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(props.set){\r\n\t\t\t\t\tprops.set(newValue);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tget:() => {\r\n\r\n\t\t\t\tif(props.get){\r\n\t\t\t\t\tprops.get();\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn value;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tunwatchRow(row){\r\n\t\tvar data = row.getData();\r\n\r\n\t\tfor(var key in data){\r\n\t\t\tObject.defineProperty(data, key, {\r\n\t\t\t\tvalue:data[key],\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tblock(){\r\n\t\tthis.blocked = true;\r\n\t}\r\n\r\n\tunblock(){\r\n\t\tthis.blocked = false;\r\n\t}\r\n}\r\n\r\nReactiveData.moduleName = \"reactiveData\";\r\n\r\nexport default ReactiveData;\r\n\r\n\r\n\r\n","import Module from '../../core/Module.js';\r\n\r\nclass ResizeColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.startColumn = false;\r\n\t\tthis.startX = false;\r\n\t\tthis.startWidth = false;\r\n\t\tthis.latestX = false;\r\n\t\tthis.handle = null;\r\n\t\tthis.initialNextColumn = null;\r\n\t\tthis.nextColumn = null;\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.registerColumnOption(\"resizable\", true);\r\n\t\tthis.registerTableOption(\"resizableColumnFit\", false);\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-rendered\", this.layoutColumnHeader.bind(this));\r\n\t}\r\n\t\r\n\tinitializeEventWatchers(){\r\n\t\tif(!this.initialized){\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-rendered\", this.layoutCellHandles.bind(this));\r\n\t\t\tthis.subscribe(\"cell-delete\", this.deInitializeComponent.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-height\", this.resizeHandle.bind(this));\r\n\t\t\tthis.subscribe(\"column-moved\", this.columnLayoutUpdated.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-hide\", this.deInitializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"column-show\", this.columnLayoutUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"column-width\", this.columnWidthUpdated.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-delete\", this.deInitializeComponent.bind(this));\r\n\t\t\tthis.subscribe(\"column-height\", this.resizeHandle.bind(this));\r\n\t\t\t\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\tlayoutCellHandles(cell){\r\n\t\tif(cell.row.type === \"row\"){\r\n\t\t\tthis.deInitializeComponent(cell);\r\n\t\t\tthis.initializeColumn(\"cell\", cell, cell.column, cell.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tlayoutColumnHeader(column){\r\n\t\tif(column.definition.resizable){\r\n\t\t\tthis.initializeEventWatchers();\r\n\t\t\tthis.deInitializeComponent(column);\r\n\t\t\tthis.initializeColumn(\"header\", column, column, column.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolumnLayoutUpdated(column){\r\n\t\tvar prev = column.prevColumn();\r\n\t\t\r\n\t\tthis.reinitializeColumn(column);\r\n\t\t\r\n\t\tif(prev){\r\n\t\t\tthis.reinitializeColumn(prev);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolumnWidthUpdated(column){\r\n\t\tif(column.modules.frozen){\r\n\t\t\tif(this.table.modules.frozenColumns.leftColumns.includes(column)){\r\n\t\t\t\tthis.table.modules.frozenColumns.leftColumns.forEach((col) => {\r\n\t\t\t\t\tthis.reinitializeColumn(col);\r\n\t\t\t\t});\r\n\t\t\t}else if(this.table.modules.frozenColumns.rightColumns.includes(column)){\r\n\t\t\t\tthis.table.modules.frozenColumns.rightColumns.forEach((col) => {\r\n\t\t\t\t\tthis.reinitializeColumn(col);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeColumn(column){\r\n\t\tvar frozenOffset = column.modules.frozen ? (column.modules.frozen.marginValue + column.getWidth() + \"px\") : false;\r\n\t\t;\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tif(cell.modules.resize && cell.modules.resize.handleEl){\r\n\t\t\t\tif(frozenOffset){\r\n\t\t\t\t\tcell.modules.resize.handleEl.style.left = frozenOffset;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcell.element.after(cell.modules.resize.handleEl);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(column.modules.resize && column.modules.resize.handleEl){\r\n\t\t\tif(frozenOffset){\r\n\t\t\t\tcolumn.modules.resize.handleEl.style.left = frozenOffset;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.element.after(column.modules.resize.handleEl);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(type, component, column, element){\r\n\t\tvar self = this,\r\n\t\tvariableHeight = false,\r\n\t\tmode = column.definition.resizable,\r\n\t\tconfig = {},\r\n\t\tnearestColumn = column.getLastColumn();\r\n\t\t\r\n\t\t//set column resize mode\r\n\t\tif(type === \"header\"){\r\n\t\t\tvariableHeight = column.definition.formatter == \"textarea\" || column.definition.variableHeight;\r\n\t\t\tconfig = {variableHeight:variableHeight};\r\n\t\t}\r\n\t\t\r\n\t\tif((mode === true || mode == type) && this._checkResizability(nearestColumn)){\r\n\t\t\t\r\n\t\t\tvar handle = document.createElement('span');\r\n\t\t\thandle.className = \"tabulator-col-resize-handle\";\r\n\t\t\t\r\n\t\t\thandle.addEventListener(\"click\", function(e){\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tvar handleDown = function(e){\r\n\t\t\t\tself.startColumn = column;\r\n\t\t\t\tself.initialNextColumn = self.nextColumn = nearestColumn.nextColumn();\r\n\t\t\t\tself._mouseDown(e, nearestColumn, handle);\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\thandle.addEventListener(\"mousedown\", handleDown);\r\n\t\t\thandle.addEventListener(\"touchstart\", handleDown, {passive: true});\r\n\t\t\t\r\n\t\t\t//resize column on double click\r\n\t\t\thandle.addEventListener(\"dblclick\", (e) => {\r\n\t\t\t\tvar oldWidth = nearestColumn.getWidth();\r\n\t\t\t\t\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tnearestColumn.reinitializeWidth(true);\r\n\t\t\t\t\r\n\t\t\t\tif(oldWidth !== nearestColumn.getWidth()){\r\n\t\t\t\t\tself.dispatch(\"column-resized\", nearestColumn);\r\n\t\t\t\t\tself.table.externalEvents.dispatch(\"columnResized\", nearestColumn.getComponent());\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(column.modules.frozen){\r\n\t\t\t\thandle.style.position = \"absolute\";\r\n\t\t\t\thandle.style.left = column.modules.frozen.marginValue + column.getWidth() + \"px\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconfig.handleEl = handle;\r\n\t\t\t\r\n\t\t\tif(element.parentNode){\r\n\t\t\t\telement.after(handle);\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcomponent.modules.resize = config;\r\n\t}\r\n\t\r\n\tdeInitializeColumn(column){\r\n\t\tthis.deInitializeComponent(column);\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tthis.deInitializeComponent(cell);\r\n\t\t});\r\n\t}\r\n\t\r\n\tdeInitializeComponent(component){\r\n\t\tvar handleEl;\r\n\t\t\r\n\t\tif(component.modules.resize){\r\n\t\t\thandleEl = component.modules.resize.handleEl;\r\n\t\t\t\r\n\t\t\tif(handleEl && handleEl.parentElement){\r\n\t\t\t\thandleEl.parentElement.removeChild(handleEl);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tresizeHandle(component, height){\r\n\t\tif(component.modules.resize && component.modules.resize.handleEl){\r\n\t\t\tcomponent.modules.resize.handleEl.style.height = height;\r\n\t\t}\r\n\t}\r\n\t\r\n\t_checkResizability(column){\r\n\t\treturn column.definition.resizable;\r\n\t}\r\n\t\r\n\t_mouseDown(e, column, handle){\r\n\t\tvar self = this;\r\n\t\t\r\n\t\tself.table.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\tfunction mouseMove(e){\r\n\t\t\tvar x = typeof e.screenX === \"undefined\" ? e.touches[0].screenX : e.screenX,\r\n\t\t\tstartDiff = x - self.startX,\r\n\t\t\tmoveDiff = x - self.latestX,\r\n\t\t\tblockedBefore, blockedAfter;\r\n\t\t\t\r\n\t\t\tself.latestX = x;\r\n\t\t\t\r\n\t\t\tif(self.table.rtl){\r\n\t\t\t\tstartDiff = -startDiff;\r\n\t\t\t\tmoveDiff = -moveDiff;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tblockedBefore = column.width == column.minWidth || column.width == column.maxWidth;\r\n\t\t\t\r\n\t\t\tcolumn.setWidth(self.startWidth + startDiff);\r\n\t\t\t\r\n\t\t\tblockedAfter = column.width == column.minWidth || column.width == column.maxWidth;\r\n\t\t\t\r\n\t\t\tif(moveDiff < 0){\r\n\t\t\t\tself.nextColumn = self.initialNextColumn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(self.table.options.resizableColumnFit && self.nextColumn && !(blockedBefore && blockedAfter)){\r\n\t\t\t\tlet colWidth = self.nextColumn.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tif(moveDiff > 0){\r\n\t\t\t\t\tif(colWidth <= self.nextColumn.minWidth){\r\n\t\t\t\t\t\tself.nextColumn = self.nextColumn.nextColumn();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(self.nextColumn){\r\n\t\t\t\t\tself.nextColumn.setWidth(self.nextColumn.getWidth() - moveDiff);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tself.table.columnManager.renderer.rerenderColumns(true);\r\n\t\t\t\r\n\t\t\tif(!self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight){\r\n\t\t\t\tcolumn.checkCellHeights();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfunction mouseUp(e){\r\n\t\t\t\r\n\t\t\t//block editor from taking action while resizing is taking place\r\n\t\t\tif(self.startColumn.modules.edit){\r\n\t\t\t\tself.startColumn.modules.edit.blocked = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight){\r\n\t\t\t\tcolumn.checkCellHeights();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", mouseUp);\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", mouseMove);\r\n\t\t\t\r\n\t\t\thandle.removeEventListener(\"touchmove\", mouseMove);\r\n\t\t\thandle.removeEventListener(\"touchend\", mouseUp);\r\n\t\t\t\r\n\t\t\tself.table.element.classList.remove(\"tabulator-block-select\");\r\n\t\t\t\r\n\t\t\tif(self.startWidth !== column.getWidth()){\r\n\t\t\t\tself.dispatch(\"column-resized\", column);\r\n\t\t\t\tself.table.externalEvents.dispatch(\"columnResized\", column.getComponent());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\te.stopPropagation(); //prevent resize from interfereing with movable columns\r\n\t\t\r\n\t\t//block editor from taking action while resizing is taking place\r\n\t\tif(self.startColumn.modules.edit){\r\n\t\t\tself.startColumn.modules.edit.blocked = true;\r\n\t\t}\r\n\t\t\r\n\t\tself.startX = typeof e.screenX === \"undefined\" ? e.touches[0].screenX : e.screenX;\r\n\t\tself.latestX = self.startX;\r\n\t\tself.startWidth = column.getWidth();\r\n\t\t\r\n\t\tdocument.body.addEventListener(\"mousemove\", mouseMove);\r\n\t\tdocument.body.addEventListener(\"mouseup\", mouseUp);\r\n\t\thandle.addEventListener(\"touchmove\", mouseMove, {passive: true});\r\n\t\thandle.addEventListener(\"touchend\", mouseUp);\r\n\t}\r\n}\r\n\r\nResizeColumns.moduleName = \"resizeColumns\";\r\n\r\nexport default ResizeColumns;","import Module from '../../core/Module.js';\r\n\r\nclass ResizeRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.startColumn = false;\r\n\t\tthis.startY = false;\r\n\t\tthis.startHeight = false;\r\n\t\tthis.handle = null;\r\n\t\tthis.prevHandle = null;\r\n\r\n\t\tthis.registerTableOption(\"resizableRows\", false); //resizable rows\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.resizableRows){\r\n\t\t\tthis.subscribe(\"row-layout-after\", this.initializeRow.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\trowEl = row.getElement();\r\n\r\n\t\tvar handle = document.createElement('div');\r\n\t\thandle.className = \"tabulator-row-resize-handle\";\r\n\r\n\t\tvar prevHandle = document.createElement('div');\r\n\t\tprevHandle.className = \"tabulator-row-resize-handle prev\";\r\n\r\n\t\thandle.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tvar handleDown = function(e){\r\n\t\t\tself.startRow = row;\r\n\t\t\tself._mouseDown(e, row, handle);\r\n\t\t};\r\n\r\n\t\thandle.addEventListener(\"mousedown\", handleDown);\r\n\t\thandle.addEventListener(\"touchstart\", handleDown, {passive: true});\r\n\r\n\t\tprevHandle.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tvar prevHandleDown = function(e){\r\n\t\t\tvar prevRow = self.table.rowManager.prevDisplayRow(row);\r\n\r\n\t\t\tif(prevRow){\r\n\t\t\t\tself.startRow = prevRow;\r\n\t\t\t\tself._mouseDown(e, prevRow, prevHandle);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tprevHandle.addEventListener(\"mousedown\",prevHandleDown);\r\n\t\tprevHandle.addEventListener(\"touchstart\",prevHandleDown, {passive: true});\r\n\r\n\t\trowEl.appendChild(handle);\r\n\t\trowEl.appendChild(prevHandle);\r\n\t}\r\n\r\n\t_mouseDown(e, row, handle){\r\n\t\tvar self = this;\r\n\r\n\t\tself.table.element.classList.add(\"tabulator-block-select\");\r\n\r\n\t\tfunction mouseMove(e){\r\n\t\t\trow.setHeight(self.startHeight + ((typeof e.screenY === \"undefined\" ? e.touches[0].screenY : e.screenY) - self.startY));\r\n\t\t}\r\n\r\n\t\tfunction mouseUp(e){\r\n\r\n\t\t\t// //block editor from taking action while resizing is taking place\r\n\t\t\t// if(self.startColumn.modules.edit){\r\n\t\t\t// \tself.startColumn.modules.edit.blocked = false;\r\n\t\t\t// }\r\n\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", mouseMove);\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", mouseMove);\r\n\r\n\t\t\thandle.removeEventListener(\"touchmove\", mouseMove);\r\n\t\t\thandle.removeEventListener(\"touchend\", mouseUp);\r\n\r\n\t\t\tself.table.element.classList.remove(\"tabulator-block-select\");\r\n\r\n\t\t\tself.dispatchExternal(\"rowResized\", row.getComponent());\r\n\t\t}\r\n\r\n\t\te.stopPropagation(); //prevent resize from interfereing with movable columns\r\n\r\n\t\t//block editor from taking action while resizing is taking place\r\n\t\t// if(self.startColumn.modules.edit){\r\n\t\t// \tself.startColumn.modules.edit.blocked = true;\r\n\t\t// }\r\n\r\n\t\tself.startY = typeof e.screenY === \"undefined\" ? e.touches[0].screenY : e.screenY;\r\n\t\tself.startHeight = row.getHeight();\r\n\r\n\t\tdocument.body.addEventListener(\"mousemove\", mouseMove);\r\n\t\tdocument.body.addEventListener(\"mouseup\", mouseUp);\r\n\r\n\t\thandle.addEventListener(\"touchmove\", mouseMove, {passive: true});\r\n\t\thandle.addEventListener(\"touchend\", mouseUp);\r\n\t}\r\n}\r\n\r\nResizeRows.moduleName = \"resizeRows\";\r\n\r\nexport default ResizeRows;","import Module from '../../core/Module.js';\r\n\r\nclass ResizeTable extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.binding = false;\r\n\t\tthis.observer = false;\r\n\t\tthis.containerObserver = false;\r\n\r\n\t\tthis.tableHeight = 0;\r\n\t\tthis.tableWidth = 0;\r\n\t\tthis.containerHeight = 0;\r\n\t\tthis.containerWidth = 0;\r\n\r\n\t\tthis.autoResize = false;\r\n\r\n\t\tthis.registerTableOption(\"autoResize\", true); //auto resize table\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.autoResize){\r\n\t\t\tvar table = this.table,\r\n\t\t\ttableStyle;\r\n\r\n\t\t\tthis.tableHeight = table.element.clientHeight;\r\n\t\t\tthis.tableWidth = table.element.clientWidth;\r\n\r\n\t\t\tif(table.element.parentNode){\r\n\t\t\t\tthis.containerHeight = table.element.parentNode.clientHeight;\r\n\t\t\t\tthis.containerWidth = table.element.parentNode.clientWidth;\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof ResizeObserver !== \"undefined\" && table.rowManager.getRenderMode() === \"virtual\"){\r\n\r\n\t\t\t\tthis.autoResize = true;\r\n\r\n\t\t\t\tthis.observer = new ResizeObserver((entry) => {\r\n\t\t\t\t\tif(!table.browserMobile || (table.browserMobile &&!table.modules.edit.currentCell)){\r\n\r\n\t\t\t\t\t\tvar nodeHeight = Math.floor(entry[0].contentRect.height);\r\n\t\t\t\t\t\tvar nodeWidth = Math.floor(entry[0].contentRect.width);\r\n\r\n\t\t\t\t\t\tif(this.tableHeight != nodeHeight || this.tableWidth != nodeWidth){\r\n\t\t\t\t\t\t\tthis.tableHeight = nodeHeight;\r\n\t\t\t\t\t\t\tthis.tableWidth = nodeWidth;\r\n\r\n\t\t\t\t\t\t\tif(table.element.parentNode){\r\n\t\t\t\t\t\t\t\tthis.containerHeight = table.element.parentNode.clientHeight;\r\n\t\t\t\t\t\t\t\tthis.containerWidth = table.element.parentNode.clientWidth;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tthis.table.columnManager.renderer.rerenderColumns(true);\r\n\r\n\t\t\t\t\t\t\ttable.redraw();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.observer.observe(table.element);\r\n\r\n\t\t\t\ttableStyle = window.getComputedStyle(table.element);\r\n\r\n\t\t\t\tif(this.table.element.parentNode && !this.table.rowManager.fixedHeight && (tableStyle.getPropertyValue(\"max-height\") || tableStyle.getPropertyValue(\"min-height\"))){\r\n\r\n\t\t\t\t\tthis.containerObserver = new ResizeObserver((entry) => {\r\n\t\t\t\t\t\tif(!table.browserMobile || (table.browserMobile &&!table.modules.edit.currentCell)){\r\n\r\n\t\t\t\t\t\t\tvar nodeHeight = Math.floor(entry[0].contentRect.height);\r\n\t\t\t\t\t\t\tvar nodeWidth = Math.floor(entry[0].contentRect.width);\r\n\r\n\t\t\t\t\t\t\tif(this.containerHeight != nodeHeight || this.containerWidth != nodeWidth){\r\n\t\t\t\t\t\t\t\tthis.containerHeight = nodeHeight;\r\n\t\t\t\t\t\t\t\tthis.containerWidth = nodeWidth;\r\n\t\t\t\t\t\t\t\tthis.tableHeight = table.element.clientHeight;\r\n\t\t\t\t\t\t\t\tthis.tableWidth = table.element.clientWidth;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\ttable.columnManager.renderer.rerenderColumns(true);\r\n\r\n\t\t\t\t\t\t\ttable.redraw();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tthis.containerObserver.observe(this.table.element.parentNode);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.subscribe(\"table-resize\", this.tableResized.bind(this));\r\n\r\n\t\t\t}else{\r\n\t\t\t\tthis.binding = function(){\r\n\t\t\t\t\tif(!table.browserMobile || (table.browserMobile && !table.modules.edit.currentCell)){\r\n\r\n\t\t\t\t\t\ttable.columnManager.renderer.rerenderColumns(true);\r\n\r\n\t\t\t\t\t\ttable.redraw();\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\r\n\t\t\t\twindow.addEventListener(\"resize\", this.binding);\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"table-destroy\", this.clearBindings.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\ttableResized(){\r\n\t\tthis.table.rowManager.redraw();\r\n\t}\r\n\r\n\tclearBindings(){\r\n\t\tif(this.binding){\r\n\t\t\twindow.removeEventListener(\"resize\", this.binding);\r\n\t\t}\r\n\r\n\t\tif(this.observer){\r\n\t\t\tthis.observer.unobserve(this.table.element);\r\n\t\t}\r\n\r\n\t\tif(this.containerObserver){\r\n\t\t\tthis.containerObserver.unobserve(this.table.element.parentNode);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nResizeTable.moduleName = \"resizeTable\";\r\n\r\nexport default ResizeTable;","import Module from '../../core/Module.js';\r\n\r\nclass ResponsiveLayout extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.columns = [];\r\n\t\tthis.hiddenColumns = [];\r\n\t\tthis.mode = \"\";\r\n\t\tthis.index = 0;\r\n\t\tthis.collapseFormatter = [];\r\n\t\tthis.collapseStartOpen = true;\r\n\t\tthis.collapseHandleColumn = false;\r\n\r\n\t\tthis.registerTableOption(\"responsiveLayout\", false); //responsive layout flags\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseStartOpen\", true); //start showing collapsed data\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseUseFormatters\", true); //responsive layout collapse formatter\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseFormatter\", false); //responsive layout collapse formatter\r\n\r\n\t\tthis.registerColumnOption(\"responsive\");\r\n\t}\r\n\r\n\t//generate responsive columns list\r\n\tinitialize(){\r\n\t\tvar self = this,\r\n\t\tcolumns = [];\r\n\r\n\t\tif(this.table.options.responsiveLayout){\r\n\t\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"column-show\", this.updateColumnVisibility.bind(this));\r\n\t\t\tthis.subscribe(\"column-hide\", this.updateColumnVisibility.bind(this));\r\n\t\t\tthis.subscribe(\"columns-loaded\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-moved\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-add\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-delete\", this.initializeResponsivity.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"table-redrawing\", this.tableRedraw.bind(this));\r\n\r\n\t\t\tif(this.table.options.responsiveLayout === \"collapse\"){\r\n\t\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\t\tthis.subscribe(\"row-layout\", this.layoutRow.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tif([\"fitColumns\", \"fitDataStretch\"].indexOf(this.layoutMode()) === -1){\r\n\t\t\tif(!force){\r\n\t\t\t\tthis.update();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeResponsivity(){\r\n\t\tvar columns = [];\r\n\r\n\t\tthis.mode = this.table.options.responsiveLayout;\r\n\t\tthis.collapseFormatter = this.table.options.responsiveLayoutCollapseFormatter || this.formatCollapsedData;\r\n\t\tthis.collapseStartOpen = this.table.options.responsiveLayoutCollapseStartOpen;\r\n\t\tthis.hiddenColumns = [];\r\n\r\n\t\t//determine level of responsivity for each column\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column, i) => {\r\n\t\t\tif(column.modules.responsive){\r\n\t\t\t\tif(column.modules.responsive.order && column.modules.responsive.visible){\r\n\t\t\t\t\tcolumn.modules.responsive.index = i;\r\n\t\t\t\t\tcolumns.push(column);\r\n\r\n\t\t\t\t\tif(!column.visible && this.mode === \"collapse\"){\r\n\t\t\t\t\t\tthis.hiddenColumns.push(column);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t//sort list by responsivity\r\n\t\tcolumns = columns.reverse();\r\n\t\tcolumns = columns.sort((a, b) => {\r\n\t\t\tvar diff = b.modules.responsive.order - a.modules.responsive.order;\r\n\t\t\treturn diff || (b.modules.responsive.index - a.modules.responsive.index);\r\n\t\t});\r\n\r\n\t\tthis.columns = columns;\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tthis.generateCollapsedContent();\r\n\t\t}\r\n\r\n\t\t//assign collapse column\r\n\t\tfor (let col of this.table.columnManager.columnsByIndex){\r\n\t\t\tif(col.definition.formatter == \"responsiveCollapse\"){\r\n\t\t\t\tthis.collapseHandleColumn = col;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this.collapseHandleColumn){\r\n\t\t\tif(this.hiddenColumns.length){\r\n\t\t\t\tthis.collapseHandleColumn.show();\r\n\t\t\t}else{\r\n\t\t\t\tthis.collapseHandleColumn.hide();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//define layout information\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.getDefinition();\r\n\r\n\t\tcolumn.modules.responsive = {order: typeof def.responsive === \"undefined\" ? 1 : def.responsive, visible:def.visible === false ? false : true};\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar el;\r\n\r\n\t\tif(row.type !== \"calc\"){\r\n\t\t\tel = document.createElement(\"div\");\r\n\t\t\tel.classList.add(\"tabulator-responsive-collapse\");\r\n\r\n\t\t\trow.modules.responsiveLayout = {\r\n\t\t\t\telement:el,\r\n\t\t\t\topen:this.collapseStartOpen,\r\n\t\t\t};\r\n\r\n\t\t\tif(!this.collapseStartOpen){\r\n\t\t\t\tel.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tlayoutRow(row){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tif(row.modules.responsiveLayout){\r\n\t\t\trowEl.appendChild(row.modules.responsiveLayout.element);\r\n\t\t\tthis.generateCollapsedRowContent(row);\r\n\t\t}\r\n\t}\r\n\r\n\t//update column visibility\r\n\tupdateColumnVisibility(column, responsiveToggle){\r\n\t\tif(!responsiveToggle && column.modules.responsive){\r\n\t\t\tcolumn.modules.responsive.visible = column.visible;\r\n\t\t\tthis.initializeResponsivity();\r\n\t\t}\r\n\t}\r\n\r\n\thideColumn(column){\r\n\t\tvar colCount = this.hiddenColumns.length;\r\n\r\n\t\tcolumn.hide(false, true);\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tthis.hiddenColumns.unshift(column);\r\n\t\t\tthis.generateCollapsedContent();\r\n\r\n\t\t\tif(this.collapseHandleColumn && !colCount){\r\n\t\t\t\tthis.collapseHandleColumn.show();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tshowColumn(column){\r\n\t\tvar index;\r\n\r\n\t\tcolumn.show(false, true);\r\n\t\t//set column width to prevent calculation loops on uninitialized columns\r\n\t\tcolumn.setWidth(column.getWidth());\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tindex = this.hiddenColumns.indexOf(column);\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.hiddenColumns.splice(index, 1);\r\n\t\t\t}\r\n\r\n\t\t\tthis.generateCollapsedContent();\r\n\r\n\t\t\tif(this.collapseHandleColumn && !this.hiddenColumns.length){\r\n\t\t\t\tthis.collapseHandleColumn.hide();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//redraw columns to fit space\r\n\tupdate(){\r\n\t\tvar self = this,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\r\n\t\t\tlet width = self.table.modules.layout.getMode() == \"fitColumns\" ? self.table.columnManager.getFlexBaseWidth() : self.table.columnManager.getWidth();\r\n\r\n\t\t\tlet diff = (self.table.options.headerVisible ? self.table.columnManager.element.clientWidth : self.table.element.clientWidth) - width;\r\n\r\n\t\t\tif(diff < 0){\r\n\t\t\t\t//table is too wide\r\n\t\t\t\tlet column = self.columns[self.index];\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tself.hideColumn(column);\r\n\t\t\t\t\tself.index ++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\r\n\t\t\t\t//table has spare space\r\n\t\t\t\tlet column = self.columns[self.index -1];\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tif(diff > 0){\r\n\t\t\t\t\t\tif(diff >= column.getWidth()){\r\n\t\t\t\t\t\t\tself.showColumn(column);\r\n\t\t\t\t\t\t\tself.index --;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tworking = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tworking = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(!self.table.rowManager.activeRowsCount){\r\n\t\t\t\tself.table.rowManager.renderEmptyScroll();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateCollapsedContent(){\r\n\t\tvar self = this,\r\n\t\trows = this.table.rowManager.getDisplayRows();\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\tself.generateCollapsedRowContent(row);\r\n\t\t});\r\n\t}\r\n\r\n\tgenerateCollapsedRowContent(row){\r\n\t\tvar el, contents;\r\n\r\n\t\tif(row.modules.responsiveLayout){\r\n\t\t\tel = row.modules.responsiveLayout.element;\r\n\r\n\t\t\twhile(el.firstChild) el.removeChild(el.firstChild);\r\n\r\n\t\t\tcontents = this.collapseFormatter(this.generateCollapsedRowData(row));\r\n\t\t\tif(contents){\r\n\t\t\t\tel.appendChild(contents);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateCollapsedRowData(row){\r\n\t\tvar self = this,\r\n\t\tdata = row.getData(),\r\n\t\toutput = [],\r\n\t\tmockCellComponent;\r\n\r\n\t\tthis.hiddenColumns.forEach(function(column){\r\n\t\t\tvar value = column.getFieldValue(data);\r\n\r\n\t\t\tif(column.definition.title && column.field){\r\n\t\t\t\tif(column.modules.format && self.table.options.responsiveLayoutCollapseUseFormatters){\r\n\r\n\t\t\t\t\tmockCellComponent = {\r\n\t\t\t\t\t\tvalue:false,\r\n\t\t\t\t\t\tdata:{},\r\n\t\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetData:function(){\r\n\t\t\t\t\t\t\treturn data;\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\t\treturn document.createElement(\"div\");\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\t\treturn row.getComponent();\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tfunction onRendered(callback){\r\n\t\t\t\t\t\tcallback();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\toutput.push({\r\n\t\t\t\t\t\tfield: column.field,\r\n\t\t\t\t\t\ttitle: column.definition.title,\r\n\t\t\t\t\t\tvalue: column.modules.format.formatter.call(self.table.modules.format, mockCellComponent, column.modules.format.params, onRendered)\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\toutput.push({\r\n\t\t\t\t\t\tfield: column.field,\r\n\t\t\t\t\t\ttitle: column.definition.title,\r\n\t\t\t\t\t\tvalue: value\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tformatCollapsedData(data){\r\n\t\tvar list = document.createElement(\"table\");\r\n\r\n\t\tdata.forEach(function(item){\r\n\t\t\tvar row = document.createElement(\"tr\");\r\n\t\t\tvar titleData = document.createElement(\"td\");\r\n\t\t\tvar valueData = document.createElement(\"td\");\r\n\t\t\tvar node_content;\r\n\r\n\t\t\tvar titleHighlight = document.createElement(\"strong\");\r\n\t\t\ttitleData.appendChild(titleHighlight);\r\n\t\t\tthis.langBind(\"columns|\" + item.field, function(text){\r\n\t\t\t\ttitleHighlight.innerHTML = text || item.title;\r\n\t\t\t});\r\n\r\n\t\t\tif(item.value instanceof Node){\r\n\t\t\t\tnode_content = document.createElement(\"div\");\r\n\t\t\t\tnode_content.appendChild(item.value);\r\n\t\t\t\tvalueData.appendChild(node_content);\r\n\t\t\t}else{\r\n\t\t\t\tvalueData.innerHTML = item.value;\r\n\t\t\t}\r\n\r\n\t\t\trow.appendChild(titleData);\r\n\t\t\trow.appendChild(valueData);\r\n\t\t\tlist.appendChild(row);\r\n\t\t}, this);\r\n\r\n\t\treturn Object.keys(data).length ? list : \"\";\r\n\t}\r\n}\r\n\r\nResponsiveLayout.moduleName = \"responsiveLayout\";\r\n\r\nexport default ResponsiveLayout;","import Module from '../../core/Module.js';\r\n\r\nclass SelectRow extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.selecting = false; //flag selecting in progress\r\n\t\tthis.lastClickedRow = false; //last clicked row\r\n\t\tthis.selectPrev = []; //hold previously selected element for drag drop selection\r\n\t\tthis.selectedRows = []; //hold selected rows\r\n\t\tthis.headerCheckboxElement = null; // hold header select element\r\n\t\t\r\n\t\tthis.registerTableOption(\"selectable\", \"highlight\"); //highlight rows on hover\r\n\t\tthis.registerTableOption(\"selectableRangeMode\", \"drag\"); //highlight rows on hover\r\n\t\tthis.registerTableOption(\"selectableRollingSelection\", true); //roll selection once maximum number of selectable rows is reached\r\n\t\tthis.registerTableOption(\"selectablePersistence\", true); // maintain selection when table view is updated\r\n\t\tthis.registerTableOption(\"selectableCheck\", function(data, row){return true;}); //check wheather row is selectable\r\n\t\t\r\n\t\tthis.registerTableFunction(\"selectRow\", this.selectRows.bind(this));\r\n\t\tthis.registerTableFunction(\"deselectRow\", this.deselectRows.bind(this));\r\n\t\tthis.registerTableFunction(\"toggleSelectRow\", this.toggleRow.bind(this));\r\n\t\tthis.registerTableFunction(\"getSelectedRows\", this.getSelectedRows.bind(this));\r\n\t\tthis.registerTableFunction(\"getSelectedData\", this.getSelectedData.bind(this));\r\n\t\t\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"select\", this.selectRows.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"deselect\", this.deselectRows.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"toggleSelect\", this.toggleRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isSelected\", this.isRowSelected.bind(this));\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.selectable !== false){\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleting\", this.rowDeleted.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.clearSelectionData.bind(this));\r\n\t\t\tthis.subscribe(\"rows-retrieve\", this.rowRetrieve.bind(this));\r\n\t\t\t\r\n\t\t\tif(this.table.options.selectable && !this.table.options.selectablePersistence){\r\n\t\t\t\tthis.subscribe(\"data-refreshing\", this.deselectRows.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trowRetrieve(type, prevValue){\r\n\t\treturn type === \"selected\" ? this.selectedRows : prevValue;\r\n\t}\r\n\t\r\n\trowDeleted(row){\r\n\t\tthis._deselectRow(row, true);\r\n\t}\r\n\t\r\n\tclearSelectionData(silent){\r\n\t\tthis.selecting = false;\r\n\t\tthis.lastClickedRow = false;\r\n\t\tthis.selectPrev = [];\r\n\t\tthis.selectedRows = [];\r\n\t\t\r\n\t\tif(silent !== true){\r\n\t\t\tthis._rowSelectionChanged();\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\telement = row.getElement();\r\n\t\t\r\n\t\t// trigger end of row selection\r\n\t\tvar endSelect = function(){\r\n\t\t\t\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tself.selecting = false;\r\n\t\t\t}, 50);\r\n\t\t\t\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", endSelect);\r\n\t\t};\r\n\t\t\r\n\t\trow.modules.select = {selected:false};\r\n\t\t\r\n\t\t//set row selection class\r\n\t\tif(self.table.options.selectableCheck.call(this.table, row.getComponent())){\r\n\t\t\telement.classList.add(\"tabulator-selectable\");\r\n\t\t\telement.classList.remove(\"tabulator-unselectable\");\r\n\t\t\t\r\n\t\t\tif(self.table.options.selectable && self.table.options.selectable != \"highlight\"){\r\n\t\t\t\tif(self.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\telement.addEventListener(\"click\", this.handleComplexRowClick.bind(this, row));\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.addEventListener(\"click\", function(e){\r\n\t\t\t\t\t\tif(!self.table.modExists(\"edit\") || !self.table.modules.edit.getCurrentCell()){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!self.selecting){\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\t\t\tif(e.shiftKey){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.selecting = true;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.selectPrev = [];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tdocument.body.addEventListener(\"mouseup\", endSelect);\r\n\t\t\t\t\t\t\tdocument.body.addEventListener(\"keyup\", endSelect);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mouseenter\", function(e){\r\n\t\t\t\t\t\tif(self.selecting){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(self.selectPrev[1] == row){\r\n\t\t\t\t\t\t\t\tself.toggleRow(self.selectPrev[0]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mouseout\", function(e){\r\n\t\t\t\t\t\tif(self.selecting){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\tself.selectPrev.unshift(row);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\telement.classList.add(\"tabulator-unselectable\");\r\n\t\t\telement.classList.remove(\"tabulator-selectable\");\r\n\t\t}\r\n\t}\r\n\t\r\n\thandleComplexRowClick(row, e){\r\n\t\tif(e.shiftKey){\r\n\t\t\tthis.table._clearSelection();\r\n\t\t\tthis.lastClickedRow = this.lastClickedRow || row;\r\n\t\t\t\r\n\t\t\tvar lastClickedRowIdx = this.table.rowManager.getDisplayRowIndex(this.lastClickedRow);\r\n\t\t\tvar rowIdx = this.table.rowManager.getDisplayRowIndex(row);\r\n\t\t\t\r\n\t\t\tvar fromRowIdx = lastClickedRowIdx <= rowIdx ? lastClickedRowIdx : rowIdx;\r\n\t\t\tvar toRowIdx = lastClickedRowIdx >= rowIdx ? lastClickedRowIdx : rowIdx;\r\n\t\t\t\r\n\t\t\tvar rows = this.table.rowManager.getDisplayRows().slice(0);\r\n\t\t\tvar toggledRows = rows.splice(fromRowIdx, toRowIdx - fromRowIdx + 1);\r\n\t\t\t\r\n\t\t\tif(e.ctrlKey || e.metaKey){\r\n\t\t\t\ttoggledRows.forEach((toggledRow)=>{\r\n\t\t\t\t\tif(toggledRow !== this.lastClickedRow){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.table.options.selectable !== true && !this.isRowSelected(row)){\r\n\t\t\t\t\t\t\tif(this.selectedRows.length < this.table.options.selectable){\r\n\t\t\t\t\t\t\t\tthis.toggleRow(toggledRow);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.toggleRow(toggledRow);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tthis.lastClickedRow = row;\r\n\t\t\t}else{\r\n\t\t\t\tthis.deselectRows(undefined, true);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.selectable !== true){\r\n\t\t\t\t\tif(toggledRows.length > this.table.options.selectable){\r\n\t\t\t\t\t\ttoggledRows = toggledRows.slice(0, this.table.options.selectable)\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.selectRows(toggledRows);\r\n\t\t\t}\r\n\t\t\tthis.table._clearSelection();\r\n\t\t}\r\n\t\telse if(e.ctrlKey || e.metaKey){\r\n\t\t\tthis.toggleRow(row);\r\n\t\t\tthis.lastClickedRow = row;\r\n\t\t}else{\r\n\t\t\tthis.deselectRows(undefined, true);\r\n\t\t\tthis.selectRows(row);\r\n\t\t\tthis.lastClickedRow = row;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//toggle row selection\r\n\ttoggleRow(row){\r\n\t\tif(this.table.options.selectableCheck.call(this.table, row.getComponent())){\r\n\t\t\tif(row.modules.select && row.modules.select.selected){\r\n\t\t\t\tthis._deselectRow(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis._selectRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//select a number of rows\r\n\tselectRows(rows){\r\n\t\tvar rowMatch;\r\n\t\t\r\n\t\tswitch(typeof rows){\r\n\t\t\tcase \"undefined\":\r\n\t\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis._rowSelectionChanged();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"string\":\r\n\t\t\t\r\n\t\t\trowMatch = this.table.rowManager.findRow(rows);\r\n\t\t\t\r\n\t\t\tif(rowMatch){\r\n\t\t\t\tthis._selectRow(rowMatch, true, true);\r\n\t\t\t}else{\r\n\t\t\t\tthis.table.rowManager.getRows(rows).forEach((row) => {\r\n\t\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._rowSelectionChanged();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\tif(Array.isArray(rows)){\r\n\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis._rowSelectionChanged();\r\n\t\t\t}else{\r\n\t\t\t\tthis._selectRow(rows, false, true);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//select an individual row\r\n\t_selectRow(rowInfo, silent, force){\r\n\t\tvar index;\r\n\t\t\r\n\t\t//handle max row count\r\n\t\tif(!isNaN(this.table.options.selectable) && this.table.options.selectable !== true && !force){\r\n\t\t\tif(this.selectedRows.length >= this.table.options.selectable){\r\n\t\t\t\tif(this.table.options.selectableRollingSelection){\r\n\t\t\t\t\tthis._deselectRow(this.selectedRows[0]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tvar row = this.table.rowManager.findRow(rowInfo);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\tif(this.selectedRows.indexOf(row) == -1){\r\n\t\t\t\trow.getElement().classList.add(\"tabulator-selected\");\r\n\t\t\t\tif(!row.modules.select){\r\n\t\t\t\t\trow.modules.select = {};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\trow.modules.select.selected = true;\r\n\t\t\t\tif(row.modules.select.checkboxEl){\r\n\t\t\t\t\trow.modules.select.checkboxEl.checked = true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.selectedRows.push(row);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.dataTreeSelectPropagate){\r\n\t\t\t\t\tthis.childRowSelection(row, true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatchExternal(\"rowSelected\", row.getComponent());\r\n\t\t\t\t\r\n\t\t\t\tthis._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Selection Error - No such row found, ignoring selection:\" + rowInfo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tisRowSelected(row){\r\n\t\treturn this.selectedRows.indexOf(row) !== -1;\r\n\t}\r\n\t\r\n\t//deselect a number of rows\r\n\tdeselectRows(rows, silent){\r\n\t\tvar self = this,\r\n\t\trowCount;\r\n\t\t\r\n\t\tif(typeof rows == \"undefined\"){\r\n\t\t\t\r\n\t\t\trowCount = self.selectedRows.length;\r\n\t\t\t\r\n\t\t\tfor(let i = 0; i < rowCount; i++){\r\n\t\t\t\tself._deselectRow(self.selectedRows[0], true);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(rowCount){\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tif(Array.isArray(rows)){\r\n\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\tself._deselectRow(row, true);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}else{\r\n\t\t\t\tself._deselectRow(rows, silent);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//deselect an individual row\r\n\t_deselectRow(rowInfo, silent){\r\n\t\tvar self = this,\r\n\t\trow = self.table.rowManager.findRow(rowInfo),\r\n\t\tindex;\r\n\t\t\r\n\t\tif(row){\r\n\t\t\tindex = self.selectedRows.findIndex(function(selectedRow){\r\n\t\t\t\treturn selectedRow == row;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\t\r\n\t\t\t\trow.getElement().classList.remove(\"tabulator-selected\");\r\n\t\t\t\tif(!row.modules.select){\r\n\t\t\t\t\trow.modules.select = {};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\trow.modules.select.selected = false;\r\n\t\t\t\tif(row.modules.select.checkboxEl){\r\n\t\t\t\t\trow.modules.select.checkboxEl.checked = false;\r\n\t\t\t\t}\r\n\t\t\t\tself.selectedRows.splice(index, 1);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.dataTreeSelectPropagate){\r\n\t\t\t\t\tthis.childRowSelection(row, false);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatchExternal(\"rowDeselected\", row.getComponent());\r\n\t\t\t\t\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Deselection Error - No such row found, ignoring selection:\" + rowInfo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetSelectedData(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tthis.selectedRows.forEach(function(row){\r\n\t\t\tdata.push(row.getData());\r\n\t\t});\r\n\t\t\r\n\t\treturn data;\r\n\t}\r\n\t\r\n\tgetSelectedRows(){\r\n\t\t\r\n\t\tvar rows = [];\r\n\t\t\r\n\t\tthis.selectedRows.forEach(function(row){\r\n\t\t\trows.push(row.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t_rowSelectionChanged(silent){\r\n\t\tif(this.headerCheckboxElement){\r\n\t\t\tif(this.selectedRows.length === 0){\r\n\t\t\t\tthis.headerCheckboxElement.checked = false;\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = false;\r\n\t\t\t} else if(this.table.rowManager.rows.length === this.selectedRows.length){\r\n\t\t\t\tthis.headerCheckboxElement.checked = true;\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = false;\r\n\t\t\t} else {\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = true;\r\n\t\t\t\tthis.headerCheckboxElement.checked = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(!silent){\r\n\t\t\tthis.dispatchExternal(\"rowSelectionChanged\", this.getSelectedData(), this.getSelectedRows());\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterRowSelectCheckbox (row, element) {\r\n\t\tif(!row._row.modules.select){\r\n\t\t\trow._row.modules.select = {};\r\n\t\t}\r\n\t\t\r\n\t\trow._row.modules.select.checkboxEl = element;\r\n\t}\r\n\t\r\n\tregisterHeaderSelectCheckbox (element) {\r\n\t\tthis.headerCheckboxElement = element;\r\n\t}\r\n\t\r\n\tchildRowSelection(row, select){\r\n\t\tvar children = this.table.modules.dataTree.getChildren(row, true);\r\n\t\t\r\n\t\tif(select){\r\n\t\t\tfor(let child of children){\r\n\t\t\t\tthis._selectRow(child, true);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tfor(let child of children){\r\n\t\t\t\tthis._deselectRow(child, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nSelectRow.moduleName = \"selectRow\";\r\n\r\nexport default SelectRow;","//sort datetime\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar format = params.format || \"dd/MM/yyyy HH:mm:ss\",\r\n\talignEmptyValues = params.alignEmptyValues,\r\n\temptyAlign = 0;\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tif(DT.isDateTime(a)){\r\n\t\t\t a = a;\r\n\t\t}else if(format === \"iso\"){\r\n\t\t\t a = DT.fromISO(String(a));\r\n\t\t}else{\r\n\t\t\t a = DT.fromFormat(String(a), format);\r\n\t\t}\r\n\r\n\t\tif(DT.isDateTime(b)){\r\n\t\t\t b = b;\r\n\t\t}else if(format === \"iso\"){\r\n\t\t\t b = DT.fromISO(String(b));\r\n\t\t}else{\r\n\t\t\t b = DT.fromFormat(String(b), format);\r\n\t\t}\r\n\r\n\t\tif(!a.isValid){\r\n\t\t\temptyAlign = !b.isValid ? 0 : -1;\r\n\t\t}else if(!b.isValid){\r\n\t\t\temptyAlign = 1;\r\n\t\t}else{\r\n\t\t\t//compare valid values\r\n\t\t\treturn a - b;\r\n\t\t}\r\n\r\n\t\t//fix empty values in position\r\n\t\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\t\temptyAlign *= -1;\r\n\t\t}\r\n\r\n\t\treturn emptyAlign;\r\n\r\n\t}else{\r\n\t\tconsole.error(\"Sort Error - 'datetime' sorter is dependant on luxon.js\");\r\n\t}\r\n};","import number from './sorters/number.js';\r\nimport string from './sorters/string.js';\r\nimport date from './sorters/date.js';\r\nimport time from './sorters/time.js';\r\nimport datetime from './sorters/datetime.js';\r\nimport boolean from './sorters/boolean.js';\r\nimport array from './sorters/array.js';\r\nimport exists from './sorters/exists.js';\r\nimport alphanum from './sorters/alphanum.js';\r\n\r\nexport default {\r\n\tnumber:number,\r\n\tstring:string,\r\n\tdate:date,\r\n\ttime:time,\r\n\tdatetime:datetime,\r\n\tboolean:boolean,\r\n\tarray:array,\r\n\texists:exists,\r\n\talphanum:alphanum\r\n};","//sort numbers\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar decimal = params.decimalSeparator;\r\n\tvar thousand = params.thousandSeparator;\r\n\tvar emptyAlign = 0;\r\n\r\n\ta = String(a);\r\n\tb = String(b);\r\n\r\n\tif(thousand){\r\n\t\ta = a.split(thousand).join(\"\");\r\n\t\tb = b.split(thousand).join(\"\");\r\n\t}\r\n\r\n\tif(decimal){\r\n\t\ta = a.split(decimal).join(\".\");\r\n\t\tb = b.split(decimal).join(\".\");\r\n\t}\r\n\r\n\ta = parseFloat(a);\r\n\tb = parseFloat(b);\r\n\r\n\t//handle non numeric values\r\n\tif(isNaN(a)){\r\n\t\temptyAlign = isNaN(b) ? 0 : -1;\r\n\t}else if(isNaN(b)){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\t\t//compare valid values\r\n\t\treturn a - b;\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n};","//sort strings\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar emptyAlign = 0;\r\n\tvar locale;\r\n\r\n\t//handle empty values\r\n\tif(!a){\r\n\t\temptyAlign = !b ? 0 : -1;\r\n\t}else if(!b){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\t\t//compare valid values\r\n\t\tswitch(typeof params.locale){\r\n\t\t\tcase \"boolean\":\r\n\t\t\tif(params.locale){\r\n\t\t\t\tlocale = this.langLocale();\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\tcase \"string\":\r\n\t\t\tlocale = params.locale;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn String(a).toLowerCase().localeCompare(String(b).toLowerCase(), locale);\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n};","import datetime from './datetime.js';\r\n\r\n//sort date\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tif(!params.format){\r\n\t\tparams.format = \"dd/MM/yyyy\";\r\n\t}\r\n\r\n\treturn datetime.call(this, a, b, aRow, bRow, column, dir, params);\r\n};","import datetime from './datetime.js';\r\n\r\n//sort times\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tif(!params.format){\r\n\t\tparams.format = \"HH:mm\";\r\n\t}\r\n\r\n\treturn datetime.call(this, a, b, aRow, bRow, column, dir, params);\r\n};","//sort booleans\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar el1 = a === true || a === \"true\" || a === \"True\" || a === 1 ? 1 : 0;\r\n\tvar el2 = b === true || b === \"true\" || b === \"True\" || b === 1 ? 1 : 0;\r\n\r\n\treturn el1 - el2;\r\n};","//sort if element contains any data\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar el1 = 0;\r\n\tvar el2 = 0;\r\n\tvar type = params.type || \"length\";\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar emptyAlign = 0;\r\n\r\n\tfunction calc(value){\r\n\r\n\t\tswitch(type){\r\n\t\t\tcase \"length\":\r\n\t\t\treturn value.length;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"sum\":\r\n\t\t\treturn value.reduce(function(c, d){\r\n\t\t\t\treturn c + d;\r\n\t\t\t});\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"max\":\r\n\t\t\treturn Math.max.apply(null, value) ;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"min\":\r\n\t\t\treturn Math.min.apply(null, value) ;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"avg\":\r\n\t\t\treturn value.reduce(function(c, d){\r\n\t\t\t\treturn c + d;\r\n\t\t\t}) / value.length;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\t//handle non array values\r\n\tif(!Array.isArray(a)){\r\n\t\talignEmptyValues = !Array.isArray(b) ? 0 : -1;\r\n\t}else if(!Array.isArray(b)){\r\n\t\talignEmptyValues = 1;\r\n\t}else{\r\n\r\n\t\t//compare valid values\r\n\t\tel1 = a ? calc(a) : 0;\r\n\t\tel2 = b ? calc(b) : 0;\r\n\r\n\t\treturn el1 - el2;\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n};","//sort if element contains any data\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar el1 = typeof a == \"undefined\" ? 0 : 1;\r\n\tvar el2 = typeof b == \"undefined\" ? 0 : 1;\r\n\r\n\treturn el1 - el2;\r\n};","//sort alpha numeric strings\r\nexport default function(as, bs, aRow, bRow, column, dir, params){\r\n\tvar a, b, a1, b1, i= 0, L, rx = /(\\d+)|(\\D+)/g, rd = /\\d/;\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar emptyAlign = 0;\r\n\r\n\t//handle empty values\r\n\tif(!as && as!== 0){\r\n\t\temptyAlign = !bs && bs!== 0 ? 0 : -1;\r\n\t}else if(!bs && bs!== 0){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\r\n\t\tif(isFinite(as) && isFinite(bs)) return as - bs;\r\n\t\ta = String(as).toLowerCase();\r\n\t\tb = String(bs).toLowerCase();\r\n\t\tif(a === b) return 0;\r\n\t\tif(!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1;\r\n\t\ta = a.match(rx);\r\n\t\tb = b.match(rx);\r\n\t\tL = a.length > b.length ? b.length : a.length;\r\n\t\twhile(i < L){\r\n\t\t\ta1= a[i];\r\n\t\t\tb1= b[i++];\r\n\t\t\tif(a1 !== b1){\r\n\t\t\t\tif(isFinite(a1) && isFinite(b1)){\r\n\t\t\t\t\tif(a1.charAt(0) === \"0\") a1 = \".\" + a1;\r\n\t\t\t\t\tif(b1.charAt(0) === \"0\") b1 = \".\" + b1;\r\n\t\t\t\t\treturn a1 - b1;\r\n\t\t\t\t}\r\n\t\t\t\telse return a1 > b1 ? 1 : -1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn a.length > b.length;\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultSorters from './defaults/sorters.js';\r\n\r\nclass Sort extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t \tthis.sortList = []; //holder current sort\r\n\t \tthis.changed = false; //has the sort changed since last render\r\n\r\n\t \tthis.registerTableOption(\"sortMode\", \"local\"); //local or remote sorting\r\n\r\n\t \tthis.registerTableOption(\"initialSort\", false); //initial sorting criteria\r\n\t \tthis.registerTableOption(\"columnHeaderSortMulti\", true); //multiple or single column sorting\r\n\t \tthis.registerTableOption(\"sortOrderReverse\", false); //reverse internal sort ordering\r\n\t \tthis.registerTableOption(\"headerSortElement\", \"
\"); //header sort element\r\n\r\n\t \tthis.registerColumnOption(\"sorter\");\r\n\t \tthis.registerColumnOption(\"sorterParams\");\r\n\r\n\t \tthis.registerColumnOption(\"headerSort\", true);\r\n\t \tthis.registerColumnOption(\"headerSortStartingDir\");\r\n\t \tthis.registerColumnOption(\"headerSortTristate\");\r\n\r\n\t }\r\n\r\n\t initialize(){\r\n\t \tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t \tthis.subscribe(\"table-built\", this.tableBuilt.bind(this));\r\n\t \tthis.registerDataHandler(this.sort.bind(this), 20);\r\n\r\n\t \tthis.registerTableFunction(\"setSort\", this.userSetSort.bind(this));\r\n\t \tthis.registerTableFunction(\"getSorters\", this.getSort.bind(this));\r\n\t \tthis.registerTableFunction(\"clearSort\", this.clearSort.bind(this));\r\n\r\n\t \tif(this.table.options.sortMode === \"remote\"){\r\n\t \t\tthis.subscribe(\"data-params\", this.remoteSortParams.bind(this));\r\n\t \t}\r\n\t }\r\n\r\n\t tableBuilt(){\r\n\t \tif(this.table.options.initialSort){\r\n\t \t\tthis.setSort(this.table.options.initialSort);\r\n\t \t}\r\n\t }\r\n\r\n\t remoteSortParams(data, config, silent, params){\r\n\t \tvar sorters = this.getSort();\r\n\r\n\t \tsorters.forEach((item) => {\r\n\t \t\tdelete item.column;\r\n\t \t});\r\n\r\n\t \tparams.sort = sorters;\r\n\r\n\t \treturn params;\r\n\t }\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tuserSetSort(sortList, dir){\r\n\t\tthis.setSort(sortList, dir);\r\n\t\t// this.table.rowManager.sorterRefresh();\r\n\t\tthis.refreshSort();\r\n\t}\r\n\r\n\tclearSort(){\r\n\t\tthis.clear();\r\n\t\t// this.table.rowManager.sorterRefresh();\r\n\t\tthis.refreshSort();\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\t//initialize column header for sorting\r\n\tinitializeColumn(column){\r\n\t\tvar sorter = false,\r\n\t\tcolEl,\r\n\t\tarrowEl;\r\n\r\n\t\tswitch(typeof column.definition.sorter){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(Sort.sorters[column.definition.sorter]){\r\n\t\t\t\tsorter = Sort.sorters[column.definition.sorter];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Sort Error - No such sorter found: \", column.definition.sorter);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tsorter = column.definition.sorter;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcolumn.modules.sort = {\r\n\t\t\tsorter:sorter, dir:\"none\",\r\n\t\t\tparams:column.definition.sorterParams || {},\r\n\t\t\tstartingDir:column.definition.headerSortStartingDir || \"asc\",\r\n\t\t\ttristate: column.definition.headerSortTristate,\r\n\t\t};\r\n\r\n\t\tif(column.definition.headerSort !== false){\r\n\r\n\t\t\tcolEl = column.getElement();\r\n\r\n\t\t\tcolEl.classList.add(\"tabulator-sortable\");\r\n\r\n\r\n\t\t\tarrowEl = document.createElement(\"div\");\r\n\t\t\tarrowEl.classList.add(\"tabulator-col-sorter\");\r\n\r\n\t\t\tif(typeof this.table.options.headerSortElement == \"object\"){\r\n\t\t\t\tarrowEl.appendChild(this.table.options.headerSortElement);\r\n\t\t\t}else{\r\n\t\t\t\tarrowEl.innerHTML = this.table.options.headerSortElement;\r\n\t\t\t}\r\n\r\n\t\t\t//create sorter arrow\r\n\t\t\tcolumn.titleHolderElement.appendChild(arrowEl);\r\n\r\n\t\t\tcolumn.modules.sort.element = arrowEl;\r\n\r\n\t\t\t//sort on click\r\n\t\t\tcolEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\tvar dir = \"\",\r\n\t\t\t\tsorters=[],\r\n\t\t\t\tmatch = false;\r\n\r\n\t\t\t\tif(column.modules.sort){\r\n\t\t\t\t\tif(column.modules.sort.tristate){\r\n\t\t\t\t\t\tif(column.modules.sort.dir == \"none\"){\r\n\t\t\t\t\t\t\tdir = column.modules.sort.startingDir;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(column.modules.sort.dir == column.modules.sort.startingDir){\r\n\t\t\t\t\t\t\t\tdir = column.modules.sort.dir == \"asc\" ? \"desc\" : \"asc\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tdir = \"none\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tswitch(column.modules.sort.dir){\r\n\t\t\t\t\t\t\tcase \"asc\":\r\n\t\t\t\t\t\t\tdir = \"desc\";\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase \"desc\":\r\n\t\t\t\t\t\t\tdir = \"asc\";\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tdir = column.modules.sort.startingDir;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\tif (this.table.options.columnHeaderSortMulti && (e.shiftKey || e.ctrlKey)) {\r\n\t\t\t\t\t\tsorters = this.getSort();\r\n\r\n\t\t\t\t\t\tmatch = sorters.findIndex((sorter) => {\r\n\t\t\t\t\t\t\treturn sorter.field === column.getField();\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\tif(match > -1){\r\n\t\t\t\t\t\t\tsorters[match].dir = dir;\r\n\r\n\t\t\t\t\t\t\tif(match != sorters.length -1){\r\n\t\t\t\t\t\t\t\tmatch = sorters.splice(match, 1)[0];\r\n\t\t\t\t\t\t\t\tif(dir != \"none\"){\r\n\t\t\t\t\t\t\t\t\tsorters.push(match);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(dir != \"none\"){\r\n\t\t\t\t\t\t\t\tsorters.push({column:column, dir:dir});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t//add to existing sort\r\n\t\t\t\t\t\tthis.setSort(sorters);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(dir == \"none\"){\r\n\t\t\t\t\t\t\tthis.clear();\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t//sort by column only\r\n\t\t\t\t\t\t\tthis.setSort(column, dir);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// this.table.rowManager.sorterRefresh(!this.sortList.length);\r\n\t\t\t\t\tthis.refreshSort();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\trefreshSort(){\r\n\t\tif(this.table.options.sortMode === \"remote\"){\r\n\t\t\tthis.reloadData(null, false, false);\r\n\t\t}else{\r\n\t\t\tthis.refreshData(true);\r\n\t\t}\r\n\r\n\t\t//TODO - Persist left position of row manager\r\n\t\t// left = this.scrollLeft;\r\n\t\t// this.scrollHorizontal(left);\r\n\t}\r\n\r\n\t//check if the sorters have changed since last use\r\n\thasChanged(){\r\n\t\tvar changed = this.changed;\r\n\t\tthis.changed = false;\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t//return current sorters\r\n\tgetSort(){\r\n\t\tvar self = this,\r\n\t\tsorters = [];\r\n\r\n\t\tself.sortList.forEach(function(item){\r\n\t\t\tif(item.column){\r\n\t\t\t\tsorters.push({column:item.column.getComponent(), field:item.column.getField(), dir:item.dir});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn sorters;\r\n\t}\r\n\r\n\t//change sort list and trigger sort\r\n\tsetSort(sortList, dir){\r\n\t\tvar self = this,\r\n\t\tnewSortList = [];\r\n\r\n\t\tif(!Array.isArray(sortList)){\r\n\t\t\tsortList = [{column: sortList, dir:dir}];\r\n\t\t}\r\n\r\n\t\tsortList.forEach(function(item){\r\n\t\t\tvar column;\r\n\r\n\t\t\tcolumn = self.table.columnManager.findColumn(item.column);\r\n\r\n\t\t\tif(column){\r\n\t\t\t\titem.column = column;\r\n\t\t\t\tnewSortList.push(item);\r\n\t\t\t\tself.changed = true;\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Sort Warning - Sort field does not exist and is being ignored: \", item.column);\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t\tself.sortList = newSortList;\r\n\r\n\t\tthis.dispatch(\"sort-changed\");\r\n\t}\r\n\r\n\t//clear sorters\r\n\tclear(){\r\n\t\tthis.setSort([]);\r\n\t}\r\n\r\n\t//find appropriate sorter for column\r\n\tfindSorter(column){\r\n\t\tvar row = this.table.rowManager.activeRows[0],\r\n\t\tsorter = \"string\",\r\n\t\tfield, value;\r\n\r\n\t\tif(row){\r\n\t\t\trow = row.getData();\r\n\t\t\tfield = column.getField();\r\n\r\n\t\t\tif(field){\r\n\r\n\t\t\t\tvalue = column.getFieldValue(row);\r\n\r\n\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\tsorter = \"boolean\";\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\tif(!isNaN(value) && value !== \"\"){\r\n\t\t\t\t\t\tsorter = \"number\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)){\r\n\t\t\t\t\t\t\tsorter = \"alphanum\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Sort.sorters[sorter];\r\n\t}\r\n\r\n\t//work through sort list sorting data\r\n\tsort(data){\r\n\t\tvar self = this,\r\n\t\tsortList = this.table.options.sortOrderReverse ? self.sortList.slice().reverse() : self.sortList,\r\n\t\tsortListActual = [],\r\n\t\trowComponents = [],\r\n\t\tlastSort;\r\n\r\n\t\tif(this.subscribedExternal(\"dataSorting\")){\r\n\t\t\tthis.dispatchExternal(\"dataSorting\", self.getSort());\r\n\t\t}\r\n\r\n\t\tself.clearColumnHeaders();\r\n\r\n\t\tif(this.table.options.sortMode !== \"remote\"){\r\n\r\n\t\t\t//build list of valid sorters and trigger column specific callbacks before sort begins\r\n\t\t\tsortList.forEach(function(item, i){\r\n\t\t\t\tvar sortObj = item.column.modules.sort;\r\n\r\n\t\t\t\tif(item.column && sortObj){\r\n\r\n\t\t\t\t\t//if no sorter has been defined, take a guess\r\n\t\t\t\t\tif(!sortObj.sorter){\r\n\t\t\t\t\t\tsortObj.sorter = self.findSorter(item.column);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\titem.params = typeof sortObj.params === \"function\" ? sortObj.params(item.column.getComponent(), item.dir) : sortObj.params;\r\n\r\n\t\t\t\t\tsortListActual.push(item);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tself.setColumnHeader(item.column, item.dir);\r\n\t\t\t});\r\n\r\n\t\t\t//sort data\r\n\t\t\tif (sortListActual.length) {\r\n\t\t\t\tself._sortItems(data, sortListActual);\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tsortList.forEach(function(item, i){\r\n\t\t\t\tself.setColumnHeader(item.column, item.dir);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.subscribedExternal(\"dataSorted\")){\r\n\t\t\tdata.forEach((row) => {\r\n\t\t\t\trowComponents.push(row.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatchExternal(\"dataSorted\", self.getSort(), rowComponents);\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//clear sort arrows on columns\r\n\tclearColumnHeaders(){\r\n\t\tthis.table.columnManager.getRealColumns().forEach(function(column){\r\n\t\t\tif(column.modules.sort){\r\n\t\t\t\tcolumn.modules.sort.dir = \"none\";\r\n\t\t\t\tcolumn.getElement().setAttribute(\"aria-sort\", \"none\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//set the column header sort direction\r\n\tsetColumnHeader(column, dir){\r\n\t\tcolumn.modules.sort.dir = dir;\r\n\t\tcolumn.getElement().setAttribute(\"aria-sort\", dir);\r\n\t}\r\n\r\n\t//sort each item in sort list\r\n\t_sortItems(data, sortList){\r\n\t\tvar sorterCount = sortList.length - 1;\r\n\r\n\t\tdata.sort((a, b) => {\r\n\t\t\tvar result;\r\n\r\n\t\t\tfor(var i = sorterCount; i>= 0; i--){\r\n\t\t\t\tlet sortItem = sortList[i];\r\n\r\n\t\t\t\tresult = this._sortRow(a, b, sortItem.column, sortItem.dir, sortItem.params);\r\n\r\n\t\t\t\tif(result !== 0){\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn result;\r\n\t\t});\r\n\t}\r\n\r\n\t//process individual rows for a sort function on active data\r\n\t_sortRow(a, b, column, dir, params){\r\n\t\tvar el1Comp, el2Comp, colComp;\r\n\r\n\t\t//switch elements depending on search direction\r\n\t\tvar el1 = dir == \"asc\" ? a : b;\r\n\t\tvar el2 = dir == \"asc\" ? b : a;\r\n\r\n\t\ta = column.getFieldValue(el1.getData());\r\n\t\tb = column.getFieldValue(el2.getData());\r\n\r\n\t\ta = typeof a !== \"undefined\" ? a : \"\";\r\n\t\tb = typeof b !== \"undefined\" ? b : \"\";\r\n\r\n\t\tel1Comp = el1.getComponent();\r\n\t\tel2Comp = el2.getComponent();\r\n\r\n\t\treturn column.modules.sort.sorter.call(this, a, b, el1Comp, el2Comp, column.getComponent(), dir, params);\r\n\t}\r\n}\r\n\r\nSort.moduleName = \"sort\";\r\n\r\n//load defaults\r\nSort.sorters = defaultSorters;\r\n\r\nexport default Sort;","import Module from '../../core/Module.js';\r\nimport Cell from '../../core/cell/Cell.js';\r\n\r\nclass Tooltip extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.tooltipSubscriber = null,\r\n\t\tthis.headerSubscriber = null,\r\n\t\t\r\n\t\tthis.timeout = null;\r\n\t\tthis.popupInstance = null;\r\n\t\t\r\n\t\tthis.registerTableOption(\"tooltipGenerationMode\", undefined); //deprecated\r\n\t\tthis.registerTableOption(\"tooltipDelay\", 300); \r\n\t\t\r\n\t\tthis.registerColumnOption(\"tooltip\");\r\n\t\tthis.registerColumnOption(\"headerTooltip\");\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.deprecationCheck();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\t\r\n\tdeprecationCheck(){\r\n\t\tif(typeof this.table.options.tooltipGenerationMode !== \"undefined\"){\r\n\t\t\tconsole.warn(\"Use of the tooltipGenerationMode option is now deprecated. This option is no longer needed as tooltips are always generated on hover now\");\r\n\t\t}\r\n\t}\t\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tif(column.definition.headerTooltip && !this.headerSubscriber){\r\n\t\t\tthis.headerSubscriber = true;\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-mousemove\", this.mousemoveCheck.bind(this, \"headerTooltip\"));\r\n\t\t\tthis.subscribe(\"column-mouseout\", this.mouseoutCheck.bind(this, \"headerTooltip\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition.tooltip && !this.tooltipSubscriber){\r\n\t\t\tthis.tooltipSubscriber = true;\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-mousemove\", this.mousemoveCheck.bind(this, \"tooltip\"));\r\n\t\t\tthis.subscribe(\"cell-mouseout\", this.mouseoutCheck.bind(this, \"tooltip\"));\r\n\t\t}\r\n\t}\r\n\t\r\n\tmousemoveCheck(action, e, component){\r\n\t\tvar tooltip = action === \"tooltip\" ? component.column.definition.tooltip : component.definition.headerTooltip;\r\n\t\t\r\n\t\tif(tooltip){\r\n\t\t\tthis.clearPopup();\r\n\t\t\tthis.timeout = setTimeout(this.loadTooltip.bind(this, e, component, tooltip), this.table.options.tooltipDelay);\r\n\t\t}\r\n\t}\r\n\r\n\tmouseoutCheck(action, e, component){\r\n\t\tif(!this.popupInstance){\r\n\t\t\tthis.clearPopup();\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearPopup(action, e, component){\r\n\t\tclearTimeout(this.timeout);\r\n\t\tthis.timeout = null;\r\n\t\t\r\n\t\tif(this.popupInstance){\r\n\t\t\tthis.popupInstance.hide();\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadTooltip(e, component, tooltip){\r\n\t\tvar contentsEl, renderedCallback, coords;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\trenderedCallback = callback;\r\n\t\t}\r\n\t\t\r\n\t\tif(typeof tooltip === \"function\"){\r\n\t\t\ttooltip = tooltip(e, component.getComponent(), onRendered);\r\n\t\t}\r\n\t\t\r\n\t\tif(tooltip instanceof HTMLElement){\r\n\t\t\tcontentsEl = tooltip;\r\n\t\t}else{\r\n\t\t\tcontentsEl = document.createElement(\"div\");\r\n\t\t\t\r\n\t\t\tif(tooltip === true){\r\n\t\t\t\tif(component instanceof Cell){\r\n\t\t\t\t\ttooltip = component.value;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(component.definition.field){\r\n\t\t\t\t\t\tthis.langBind(\"columns|\" + component.definition.field, (value) => {\r\n\t\t\t\t\t\t\tcontentsEl.innerHTML = tooltip = value || component.definition.title;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\ttooltip = component.definition.title;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcontentsEl.innerHTML = tooltip;\r\n\t\t}\r\n\t\t\r\n\t\tif(tooltip || tooltip === 0 || tooltip === \"0\" || tooltip === false){\r\n\t\t\tcontentsEl.classList.add(\"tabulator-tooltip\");\r\n\r\n\t\t\tcontentsEl.addEventListener(\"mousemove\", e => e.preventDefault())\r\n\t\t\t\r\n\t\t\tthis.popupInstance = this.popup(contentsEl);\r\n\t\t\t\r\n\t\t\tif(typeof renderedCallback === \"function\"){\r\n\t\t\t\tthis.popupInstance.renderCallback(renderedCallback);\r\n\t\t\t}\r\n\r\n\t\t\tcoords = this.popupInstance.containerEventCoords(e);\r\n\t\t\t\r\n\t\t\tthis.popupInstance.show(coords.x + 15, coords.y + 15).hideOnBlur(() => {\r\n\t\t\t\tthis.dispatchExternal(\"TooltipClosed\", component.getComponent());\r\n\t\t\t\tthis.popupInstance = null;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"TooltipOpened\", component.getComponent());\r\n\t\t}\r\n\t}\r\n}\r\n\r\nTooltip.moduleName = \"tooltip\";\r\n\r\nexport default Tooltip;\r\n","export default {\r\n\t//is integer\r\n\tinteger: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvalue = Number(value);\r\n\t\treturn typeof value === 'number' && isFinite(value) && Math.floor(value) === value;\r\n\t},\r\n\r\n\t//is float\r\n\tfloat: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvalue = Number(value);\r\n\t\treturn typeof value === 'number' && isFinite(value) && value % 1 !== 0;\r\n\t},\r\n\r\n\t//must be a number\r\n\tnumeric: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn !isNaN(value);\r\n\t},\r\n\r\n\t//must be a string\r\n\tstring: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn isNaN(value);\r\n\t},\r\n\r\n\t//maximum value\r\n\tmax: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn parseFloat(value) <= parameters;\r\n\t},\r\n\r\n\t//minimum value\r\n\tmin: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn parseFloat(value) >= parameters;\r\n\t},\r\n\r\n\t//starts with value\r\n\tstarts: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).toLowerCase().startsWith(String(parameters).toLowerCase());\r\n\t},\r\n\r\n\t//ends with value\r\n\tends: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).toLowerCase().endsWith(String(parameters).toLowerCase());\r\n\t},\r\n\r\n\r\n\t//minimum string length\r\n\tminLength: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).length >= parameters;\r\n\t},\r\n\r\n\t//maximum string length\r\n\tmaxLength: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).length <= parameters;\r\n\t},\r\n\r\n\t//in provided value list\r\n\tin: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif(typeof parameters == \"string\"){\r\n\t\t\tparameters = parameters.split(\"|\");\r\n\t\t}\r\n\r\n\t\treturn value === \"\" || parameters.indexOf(value) > -1;\r\n\t},\r\n\r\n\t//must match provided regex\r\n\tregex: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar reg = new RegExp(parameters);\r\n\r\n\t\treturn reg.test(value);\r\n\t},\r\n\r\n\t//value must be unique in this column\r\n\tunique: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar unique = true;\r\n\r\n\t\tvar cellData = cell.getData();\r\n\t\tvar column = cell.getColumn()._getSelf();\r\n\r\n\t\tthis.table.rowManager.rows.forEach(function(row){\r\n\t\t\tvar data = row.getData();\r\n\r\n\t\t\tif(data !== cellData){\r\n\t\t\t\tif(value == column.getFieldValue(data)){\r\n\t\t\t\t\tunique = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn unique;\r\n\t},\r\n\r\n\t//must have a value\r\n\trequired:function(cell, value, parameters){\r\n\t\treturn value !== \"\" && value !== null && typeof value !== \"undefined\";\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultValidators from './defaults/validators.js';\r\n\r\nclass Validate extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.invalidCells = [];\r\n\t\t\r\n\t\tthis.registerTableOption(\"validationMode\", \"blocking\");\r\n\t\t\r\n\t\tthis.registerColumnOption(\"validator\");\r\n\t\t\r\n\t\tthis.registerTableFunction(\"getInvalidCells\", this.getInvalidCells.bind(this));\r\n\t\tthis.registerTableFunction(\"clearCellValidation\", this.userClearCellValidation.bind(this));\r\n\t\tthis.registerTableFunction(\"validate\", this.userValidate.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"cell\", \"isValid\", this.cellIsValid.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"clearValidation\", this.clearValidation.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"validate\", this.cellValidate.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"column\", \"validate\", this.columnValidate.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"validate\", this.rowValidate.bind(this));\r\n\t}\r\n\t\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-delete\", this.clearValidation.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumnCheck.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"edit-success\", this.editValidate.bind(this));\r\n\t\tthis.subscribe(\"edit-editor-clear\", this.editorClear.bind(this));\r\n\t\tthis.subscribe(\"edit-edited-clear\", this.editedClear.bind(this));\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Event Handling //////////\r\n\t///////////////////////////////////\r\n\t\r\n\teditValidate(cell, value, previousValue){\r\n\t\tvar valid = this.table.options.validationMode !== \"manual\" ? this.validate(cell.column.modules.validate, cell, value) : true;\r\n\t\t\r\n\t\t// allow time for editor to make render changes then style cell\r\n\t\tif(valid !== true){\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tcell.getElement().classList.add(\"tabulator-validation-fail\");\r\n\t\t\t\tthis.dispatchExternal(\"validationFailed\", cell.getComponent(), value, valid);\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\treturn valid;\r\n\t}\r\n\t\r\n\teditorClear(cell, cancelled){\r\n\t\tif(cancelled){\r\n\t\t\tif(cell.column.modules.validate){\r\n\t\t\t\tthis.cellValidate(cell);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t}\r\n\t\r\n\teditedClear(cell){\r\n\t\tif(cell.modules.validate){\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t////////// Cell Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\tcellIsValid(cell){\r\n\t\treturn cell.modules.validate ? (cell.modules.validate.invalid || true) : true;\r\n\t}\r\n\t\r\n\tcellValidate(cell){\r\n\t\treturn this.validate(cell.column.modules.validate, cell, cell.getValue());\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Column Functions ////////\r\n\t///////////////////////////////////\r\n\t\r\n\tcolumnValidate(column){\r\n\t\tvar invalid = [];\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tif(this.cellValidate(cell) !== true){\r\n\t\t\t\tinvalid.push(cell.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn invalid.length ? invalid : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t////////// Row Functions //////////\r\n\t///////////////////////////////////\r\n\t\r\n\trowValidate(row){\r\n\t\tvar invalid = [];\r\n\t\t\r\n\t\trow.cells.forEach((cell) => {\r\n\t\t\tif(this.cellValidate(cell) !== true){\r\n\t\t\t\tinvalid.push(cell.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn invalid.length ? invalid : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\t\r\n\tuserClearCellValidation(cells){\r\n\t\tif(!cells){\r\n\t\t\tcells = this.getInvalidCells();\r\n\t\t}\r\n\t\t\r\n\t\tif(!Array.isArray(cells)){\r\n\t\t\tcells = [cells];\r\n\t\t}\r\n\t\t\r\n\t\tcells.forEach((cell) => {\r\n\t\t\tthis.clearValidation(cell._getSelf());\r\n\t\t});\r\n\t}\r\n\t\r\n\tuserValidate(cells){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\t//clear row data\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\trow = row.getComponent();\r\n\t\t\t\r\n\t\t\tvar valid = row.validate();\r\n\t\t\t\r\n\t\t\tif(valid !== true){\r\n\t\t\t\toutput = output.concat(valid);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn output.length ? output : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tinitializeColumnCheck(column){\r\n\t\tif(typeof column.definition.validator !== \"undefined\"){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//validate\r\n\tinitializeColumn(column){\r\n\t\tvar self = this,\r\n\t\tconfig = [],\r\n\t\tvalidator;\r\n\t\t\r\n\t\tif(column.definition.validator){\r\n\t\t\t\r\n\t\t\tif(Array.isArray(column.definition.validator)){\r\n\t\t\t\tcolumn.definition.validator.forEach((item) => {\r\n\t\t\t\t\tvalidator = self._extractValidator(item);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(validator){\r\n\t\t\t\t\t\tconfig.push(validator);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tvalidator = this._extractValidator(column.definition.validator);\r\n\t\t\t\t\r\n\t\t\t\tif(validator){\r\n\t\t\t\t\tconfig.push(validator);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.validate = config.length ? config : false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t_extractValidator(value){\r\n\t\tvar type, params, pos;\r\n\t\t\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\tpos = value.indexOf(':');\r\n\t\t\t\r\n\t\t\tif(pos > -1){\r\n\t\t\t\ttype = value.substring(0,pos);\r\n\t\t\t\tparams = value.substring(pos+1);\r\n\t\t\t}else{\r\n\t\t\t\ttype = value;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn this._buildValidator(type, params);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"function\":\r\n\t\t\treturn this._buildValidator(value);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"object\":\r\n\t\t\treturn this._buildValidator(value.type, value.parameters);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t\r\n\t_buildValidator(type, params){\r\n\t\t\r\n\t\tvar func = typeof type == \"function\" ? type : Validate.validators[type];\r\n\t\t\r\n\t\tif(!func){\r\n\t\t\tconsole.warn(\"Validator Setup Error - No matching validator found:\", type);\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn {\r\n\t\t\t\ttype:typeof type == \"function\" ? \"function\" : type,\r\n\t\t\t\tfunc:func,\r\n\t\t\t\tparams:params,\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n\t\r\n\tvalidate(validators, cell, value){\r\n\t\tvar self = this,\r\n\t\tfailedValidators = [],\r\n\t\tinvalidIndex = this.invalidCells.indexOf(cell);\r\n\t\t\r\n\t\tif(validators){\r\n\t\t\tvalidators.forEach((item) => {\r\n\t\t\t\tif(!item.func.call(self, cell.getComponent(), value, item.params)){\r\n\t\t\t\t\tfailedValidators.push({\r\n\t\t\t\t\t\ttype:item.type,\r\n\t\t\t\t\t\tparameters:item.params\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tif(!cell.modules.validate){\r\n\t\t\tcell.modules.validate = {};\r\n\t\t}\r\n\t\t\r\n\t\tif(!failedValidators.length){\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t\t\t\r\n\t\t\tif(invalidIndex > -1){\r\n\t\t\t\tthis.invalidCells.splice(invalidIndex, 1);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcell.modules.validate.invalid = failedValidators;\r\n\t\t\t\r\n\t\t\tif(this.table.options.validationMode !== \"manual\"){\r\n\t\t\t\tcell.getElement().classList.add(\"tabulator-validation-fail\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(invalidIndex == -1){\r\n\t\t\t\tthis.invalidCells.push(cell);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn failedValidators.length ? failedValidators : true;\r\n\t}\r\n\t\r\n\tgetInvalidCells(){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.invalidCells.forEach((cell) => {\r\n\t\t\toutput.push(cell.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tclearValidation(cell){\r\n\t\tvar invalidIndex;\r\n\t\t\r\n\t\tif(cell.modules.validate && cell.modules.validate.invalid){\r\n\t\t\t\r\n\t\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t\t\r\n\t\t\tinvalidIndex = this.invalidCells.indexOf(cell);\r\n\t\t\t\r\n\t\t\tif(invalidIndex > -1){\r\n\t\t\t\tthis.invalidCells.splice(invalidIndex, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nValidate.moduleName = \"validate\";\r\n\r\n//load defaults\r\nValidate.validators = defaultValidators;\r\n\r\nexport default Validate;\r\n","//tabulator with all modules installed\r\nimport {default as Tabulator} from './Tabulator.js';\r\nimport * as modules from '../core/modules/optional.js';\r\nimport ModuleBinder from './tools/ModuleBinder.js';\r\n\r\nclass TabulatorFull extends Tabulator {};\r\n\r\n//bind modules and static functionality\r\nnew ModuleBinder(TabulatorFull, modules);\r\n\r\nexport default TabulatorFull;"],"names":["CoreFeature","table","data","silent","columnsChanged","this","dataLoader","load","undefined","modules","localize","getText","arguments","bind","getLocale","comms","getConnections","send","layout","getMode","eventBus","subscribe","unsubscribe","key","subscribed","subscriptionChange","dispatch","chain","confirm","externalEvents","options","value","module","ColumnComponent","column","_column","type","Proxy","get","target","name","receiver","componentFunctionBinder","handle","getElement","getDefinition","getField","getTitleDownload","cells","forEach","cell","push","getComponent","visible","isGroup","columns","show","hide","output","length","parent","Column","columnManager","scrollToColumn","to","after","toColumn","findColumn","moveColumn","console","warn","nextCol","nextColumn","prevCol","prevColumn","updates","updateDefinition","getWidth","width","result","reinitializeWidth","setWidth","renderer","rerenderColumns","CellComponent","_cell","getValue","getOldValue","initialValue","row","getData","mutate","setValue","setValueActual","checkHeight","Cell","element","oldValue","height","minWidth","component","loaded","build","generateElement","_configureCell","getFieldValue","document","createElement","className","setAttribute","field","style","textAlign","hozAlign","vertAlign","display","alignItems","top","bottom","middle","justifyContent","left","right","center","definition","cssClass","split","classList","add","val","_this2","innerHTML","Node","firstChild","removeChild","appendChild","containerOnly","layoutElement","force","setValueProcessData","cellRendered","cellEdited","call","dispatchExternal","subscribedExternal","rowManager","changed","setFieldValue","_generateContents","widthStyled","offsetWidth","minWidthStyled","maxWidth","maxWidthStyled","reinitializeHeight","heightStyled","offsetHeight","redrawBlock","parentNode","deleteCell","calcs","getCellIndex","def","_this","contentElement","titleHolderElement","titleElement","groupElement","createGroupElement","fieldStructure","titleDownload","titleFormatterRendered","mapDefinitions","setField","maxInitialWidth","widthFixed","i","newCol","attachColumn","checkColumnVisibility","registerColumnField","_initialize","bindModuleColumns","el","defaults","columnDefaults","optionsList","generate","defaultOptionList","Object","keys","indexOf","title","nestedFieldSeparator","_getNestedData","_getFlatData","_setNestedData","_setFlatData","registerColumnPosition","reRegisterPosition","headerVertical","_bindEvents","_buildColumnHeaderContent","_buildGroupHeader","_buildColumnHeader","dblTap","tapHold","tap","headerClick","addEventListener","e","_this3","headerDblClick","headerContext","headerTap","passive","headerDblTap","clearTimeout","setTimeout","headerTapHold","_this4","setMinWidth","parseInt","setMaxWidth","headerHozAlign","_buildColumnHeaderTitle","editableTitle","stopPropagation","focus","_this5","langBind","text","_formatColumnHeaderTitle","contents","_this6","dataObj","structure","columnRendered","alignment","parentHeight","getGroupElement","clientHeight","getHeadersElement","minHeight","paddingTop","verticalAlign","clearVerticalAlign","formatter","rowNumColumn","getFirstColumn","getLastColumn","getTopColumn","updateBranches","colDefs","responsiveToggle","verticalAlignHeaders","matchChildWidths","childWidth","child","index","splice","setWidthActual","isNaN","Math","floor","clientWidth","max","min","rows","heightInitialized","offsetParent","clearCellHeight","calcHeight","setCellHeight","ceil","getBoundingClientRect","Promise","resolve","reject","_this7","cellCount","deregisterColumn","findColumnIndex","_nextVisibleColumn","getColumnByIndex","_prevVisibleColumn","fitToData","clearWidth","setTo","error","assign","addColumn","then","_this8","defaultOptions","Helpers","box","window","pageYOffset","documentElement","clientTop","pageXOffset","clientLeft","obj","clone","list","objectProto","__proto__","arrayProto","Array","isArray","subject","match","copy","_typeof","findIndex","item","unshift","deepClone","OptionsList","msgType","registeredDefaults","option","userOptions","debugInvalidOptions","hasOwnProperty","Renderer","elementVertical","elementHorizontal","tableElement","verticalFillMode","callback","update","blockRedraw","dir","includingBuffer","getDisplayRows","rowEl","remove","clearRows","clearColumns","renderRows","renderColumns","rerenderRows","position","ifVisible","rowIndex","offset","scrollToRowIfVisible","elVisible","elOffset","scrollToRowPosition","scrollToRowNearestTop","scrollToRow","scrollHeight","scrollTop","offsetTop","BaiscHorizontal","VirtualDomHorizontal","leftCol","rightCol","scrollLeft","vDomScrollPosLeft","vDomScrollPosRight","vDomPadLeft","vDomPadRight","fitDataColAvg","windowBuffer","visibleRows","initialized","isFitData","compatibilityCheck","layoutCheck","vertScrollListen","ok","find","col","frozen","startsWith","clearVisRowCache","dataChange","scroll","buffer","columnsByIndex","old","cols","colPos","clear","calcWindowBuffer","config","leftPos","rightPos","fitDataCheck","vdomHoz","paddingLeft","paddingRight","reinitChanged","reinitializeRows","initializeRow","reinitializeRow","change","colEnd","generateCells","layoutRefresh","getVisibleRows","diff","abs","addColRight","removeColLeft","addColLeft","removeColRight","start","end","changes","getCell","fitDataColActualWidthCheck","prepend","ex","message","_this9","newWidth","widthDiff","colPositionAdjust","ColumnManager","blockHozScrollEvent","headersElement","columnsByField","defaultColumnOptions","initializeRenderer","createHeadersElement","createHeaderElement","insertBefore","scrollHorizontal","renderClass","renderers","RendererVirtualDomHorizontal","RendererBasicHorizontal","renderHorizontal","initialize","headerVisible","hozAdjust","scrollWidth","marginLeft","scrollColumns","sorter","definitions","autoColumnsDefinitions","setColumns","_addColumn","_reIndexColumns","redraw","before","nextToColumn","colEl","topColumn","parentIndex","nextEl","nextSibling","getHeight","columnHeaderVertAlign","adjustTableSize","_getSelf","HTMLElement","root","matches","active","structured","from","moveColumnActual","reinitialize","_moveColumnInArray","getComponents","updateRows","toIndex","fromIndex","concat","adjust","scrollToColumnPosition","scrollToColumnIfVisible","offsetLeft","generateCell","totalWidth","fixedWidth","colWidth","layoutMode","resetScroll","footerManager","RowComponent","_row","transform","getCells","getRowPosition","moveToRow","updateData","normalizeHeight","nextRow","prevRow","Row","manualHeight","outerHeight","created","setData","create","deleteCells","renderRowCells","rowFormatter","rerenderRowCells","children","maxHeight","rowHeight","resizableRows","setHeight","clearHeight","updatedData","newRowData","tempData","attrname","JSON","parse","getColumnsByFieldRoot","findCell","nextDisplayRow","prevDisplayRow","toRow","findRow","moveRowActual","refreshActiveData","deleteActual","getRowIndex","detatchModules","deleteRow","group","BaiscVertical","visibility","onlyGroupHeaders","styleRow","rowTop","VirtualDomVertical","vDomRowHeight","vDomTop","vDomBottom","vDomScrollPosTop","vDomScrollPosBottom","vDomTopPad","vDomBottomPad","vDomMaxRenderChain","vDomWindowBuffer","vDomWindowMinTotalRows","vDomWindowMinMarginRows","vDomTopNewRows","vDomBottomNewRows","paddingBottom","_virtualRenderFill","topRow","topOffset","deinitializeHeight","topDiff","bottomDiff","margin","_addTopRow","vDomScrollHeight","_removeBottomRow","_addBottomRow","_removeTopRow","renderVerticalBuffer","topEdge","bottomEdge","topFound","bottomRow","slice","forceMove","holder","topPad","rowsHeight","heightOccupied","topPadHeight","rowsCount","containerHeight","fillableSpace","addedRows","paddingAdjust","_quickNormalizeRowHeight","removableRows","RowManager","createHolderElement","createTableElement","heightFixer","placeholder","placeholderContents","firstRender","renderMode","fixedHeight","activeRowsPipeline","activeRows","activeRowsCount","displayRows","displayRowsCount","redrawBlockRestoreConfig","redrawBlockRenderInPosition","dataPipeline","displayPipeline","initializePlaceholder","leftDir","topDir","_positionPlaceholder","scrollRows","renderInPosition","pagination","_setDataActual","reRenderInPosition","autoColumns","generateColumnsFromRowData","_wipeElements","wipe","allIndex","activeIndex","setActiveRows","displayRowIterator","displayIndex","regenerateRowNumbers","_showPlaceholder","pos","addRowActual","findAddRowPos","reverse","addRow","_clearPlaceholder","addRowPos","chainResult","moveRowInArray","findRowIndex","rowOnly","getDisplayRowIndex","getRows","handler","priority","sort","a","b","skipStage","stage","cascadeOrder","refreshPipelines","renderTable","layoutColumnsOnNewData","resetDisplayRows","setDisplayRows","viewable","RendererVirtualDomVertical","RendererBasicVertical","renderVertical","_clearTable","renderEmptyScroll","initialHeight","otherHeight","external","resize","tableWidth","browser","event","createEvent","initEvent","dispatchEvent","Event","FooterManager","containerElement","createContainerElement","initializeElement","footerElement","querySelector","activate","deactivate","InteractionManager","abortClasses","previousTargets","listeners","componentMap","pseudoTrackers","subscriber","pseudoTracking","buildListenerMap","bindSubscriptionWatchers","listenerMap","listener","components","pseudoMouseEnter","pseudoMouseLeave","leaveList","linkedKeys","filter","links","includes","values","comp","subscriptionChanged","clearWatchers","added","bindPseudoEvents","updateEventListeners","track","removeEventListener","path","composedPath","targets","findTargets","bindComponents","triggerEvents","targetMatches","previousTarget","closest","ComponentFunctionBinder","bindings","funcName","DataLoader","requestOrder","loading","params","replace","requestNo","alertLoader","mapParams","dataSendParams","response","objectInvert","dataReceiveParams","rowData","clearAlert","alertError","dataLoaderErrorTimeout","map","alertManager","alert","dataLoaderLoading","langText","dataLoaderError","ExternalEventBus","debug","events","subscriptionNotifiers","_debugDispatch","_dispatch","_notifiySubscriptionChange","notifiers","args","shift","callResult","apply","log","InternalEventBus","_debugChain","_chain","_debugConfirm","_confirm","fallback","confirmed","TableRegistry","tables","query","results","querySelectorAll","matchElement","Tabulator","lookupTable","Popup","container","_lookupContainer","reversedX","childPopup","blurable","blurCallback","renderedCallback","blurEvent","escEvent","_escapeCheck","popupContainer","_checkContainerIsParent","body","touch","MouseEvent","x","touches","pageX","y","pageY","parentOffset","containerOffset","origin","parentEl","coords","elementPositionCoords","containerEventCoords","_fitToScreen","keyCode","Module","_handler","register","func","initGuard","registerDataPipelineHandler","registerDisplayPipelineHandler","append","menuEl","menuContainer","content","responsiveLayout","modExists","fitData","reinitializeColumnWidths","fitDataFill","fitDataGeneral","fitDataTable","fitDataStretch","colsWidth","gap","lastCol","responsive","fitColumns","flexColWidth","overflowWidth","flexWidth","flexGrowUnits","flexColumns","fixedShrinkColumns","flexShrinkUnits","gapFill","calcWidth","scaleColumns","freeSpace","shrinkCols","oversizeCols","oversizeSpace","remainingSpace","nextColWidth","remainingFlexGrowUnits","changeUnits","undersizeCols","calcGrow","widthGrow","calcShrink","widthShrink","Layout","mode","registerTableOption","registerColumnOption","modes","moduleName","defaultModes","Localize","locale","lang","langList","langs","headerFilterPlaceholder","setHeaderFilterPlaceholder","installLang","setLocale","registerTableFunction","getLang","headerFilters","_setLangProp","desiredLocale","navigator","language","toLowerCase","prefix","traverseLang","trans","prop","_executeBindings","pathArray","_getLangElement","level","rootPath","binding","Comms","receive","selectors","connections","con","action","connection","tableComms","commsReceived","ModuleBinder","tabulator","bindStaticFuctionality","bindModules","coreModules","moduleBindings","extendModule","property","source","registerModule","mod","registerModuleBinding","findTable","prototype","orderedStartMods","orderedEndMods","unOrderedMods","moduleCore","modulesCore","moduleInitOrder","modulesRegular","core","mods","Alert","_createAlertElement","msgElement","_createMsgElement","_typeClass","interactionMonitor","browserSlow","browserMobile","rtl","originalElement","initializeCoreSystems","_create","_clearObjectPointers","_mapDeprecatedFunctionality","debugEventsExternal","debugEventsInternal","InteractionMonitor","getSelection","empty","removeAllRanges","selection","_rtlCheck","_buildElement","_initializeTable","_loadInitialData","getComputedStyle","textDirection","direction","reactiveData","newElement","tagName","attributes","replaceChild","_detectBrowser","deregister","ua","userAgent","vendor","opera","test","msg","stack","line","debugInitialization","Error","trim","restoreRedraw","blockActiveLoad","clearData","getDataCount","responses","addRows","newRows","getRowFromPosition","foundRows","fromRow","getDefinitionTree","fromColumn","plugin","required","rowFormatterPrint","rowFormatterClipboard","rowFormatterHtmlOutput","Accessor","allowedTypes","initializeColumn","transformRow","accessor","charAt","toUpperCase","lookupAccessor","accessors","rowComponent","traverse","colCompnent","generateParamsList","serializeParams","encoded","encodeURIComponent","join","url","method","headers","stringify","form","FormData","Ajax","urlGenerator","loaderPromise","contentTypeFormatters","ajaxRequestFunc","defaultLoaderPromise","ajaxURLGenerator","defaultURLGenerator","ajaxURL","setUrl","setDefaultConfig","ajaxConfig","getUrl","requestDataCheck","requestParams","requestData","ajaxParams","previousData","generateConfig","sendRequest","defaultConfig","ajaxRequesting","ajaxResponse","contentType","ajaxContentType","Accept","location","credentials","fetch","json","status","statusText","defaultContentTypeFormatters","Clipboard","pasteParser","pasteAction","customSelection","rowRange","blocked","clipboard","clipboardCopyRowRange","plain","html","preventDefault","clipboardCopyFormatter","generateExportList","clipboardCopyConfig","clipboardCopyStyled","genereateHTMLTable","generatePlainContent","clipboardData","originalEvent","reset","paste","setPasteParser","clipboardPasteParser","setPasteAction","clipboardPasteAction","getKey","range","internal","sel","textRange","createRange","selectNodeContents","toString","addRange","createTextRange","moveToElementText","select","execCommand","pasteActions","parser","pasteParsers","checkPaseOrigin","getPasteData","mutateData","mutator","valid","edit","currentCell","updateOrAddData","insert","addData","headerFindSuccess","columnMap","CalcComponent","calcParams","precision","reduce","sum","Number","toFixed","parseFloat","String","ColumnCalcs","topCalcs","botCalcs","genColumn","topElement","botElement","botRow","topInitialized","botInitialized","cellValueChanged","initializeColumnCheck","rowsUpdated","recalcActiveRows","recalcActiveRowsRefresh","tableRedraw","getResults","userRecalc","recalc","groupBy","recalcRowGroup","dataTreeStartExpanded","dataTree","recalcAll","topCalc","bottomCalc","columnCalcs","topCalcParams","botCalcParams","bottomCalcParams","calculations","initializeTopRow","botCalc","initializeBottomRow","footerRemove","footerPrepend","rowsToData","generateRow","frozenColumns","recalcGroup","groupRows","getRowGroup","getChildGroups","generateRowData","dataTreeChildColumnCalcs","open","getFilteredTreeChildren","disable","enable","format","getFormatter","paramKey","getGroups","getGroupResults","groupObj","subGroups","getSubGroups","subGroupResults","subgroup","groups","defaultCalculations","DataTree","indent","collapseEl","expandEl","branchEl","elementField","startOpen","registerComponentFunction","collapseRow","expandRow","toggleRow","getTreeParent","getRowChildren","addTreeChildRow","isRowExpanded","dummyEl","dataTreeChildField","dataTreeChildIndent","dataTreeBranchElement","dataTreeCollapseElement","tabIndex","dataTreeExpandElement","layoutRow","rowDelete","rowDataChanged","columnMoving","initializeElementField","tableRedrawing","registerDisplayHandler","reinitializeRowChildren","firstCol","getFirstVisibleColumn","dataTreeElementColumn","getTreeChildren","redrawNeeded","refreshData","childArray","controlEl","generateControlElement","cloneNode","marginRight","getPropertyValue","oldControl","getChildren","allChildren","generateChildren","dataTreeFilter","dataTreeSort","sub","childData","childRow","getTreeParentRoot","childIndex","findChildIndex","recurse","csv","setFileContents","delimiter","fileContents","depth","bom","jsonLines","pdf","header","autoTableParams","rowGroupStyles","fontStyle","fontSize","cellPadding","fillColor","rowCalcStyles","jsPDFParams","jsPDF","parseRow","styles","colSpan","rowSpan","orientation","unit","doc","jspdf","autoTable","didDrawPage","head","documentProcessing","xlsx","sheetName","workbook","XLSX","utils","book_new","tableFeatures","generateSheet","merges","worksheet","s","c","r","j","Date","sheet_add_aoa","encode_range","SheetNames","Sheets","sheetOnly","sheets","sheet","commsSend","intercept","buf","ArrayBuffer","view","Uint8Array","charCodeAt","s2ab","write","bookType","bookSST","Download","blob","download","downloadToTab","filename","interceptCallback","downloadFunc","downloaders","mime","triggerDownload","downloadConfig","downloadRowRange","groupHeader","groupHeaderDownload","_group","getRowCount","newTab","Blob","downloadReady","URL","createObjectURL","msSaveOrOpenBlob","click","maskInput","mask","maskLetter","maskLetterChar","maskNumber","maskNumberChar","maskWildcard","maskWildcardChar","fillSymbols","symbol","char","maskAutoFill","defaultDownloaders","Edit","editor","onRendered","success","cancel","editorParams","_initializeParams","displayItems","currentItems","focusedItem","input","_createInputElement","listEl","_createListElement","initialValues","isFilter","filterTimeout","filtered","typing","popup","listIteration","actions","_deprecationCheck","_initializeValue","_onRendered","listItemFormatter","sortValuesList","searchFunc","searchingPlaceholder","defaultValue","multiselect","headerFilterInitialListGen","cellEl","clickStop","preventScroll","_preventBlur","_inputKeyDown","attribs","elementAttributes","clearable","padding","boxSizing","autocomplete","cursor","caretColor","getAttribute","_bindInputEvents","valueCheck","valueKeys","verticalNavigation","placeholderLoading","placeholderEmpty","filterDelay","emptyValue","freetext","filterFunc","filterRemote","allowEmpty","listOnEmpty","valuesLookup","valuesURL","_inputFocus","_inputClick","_inputBlur","_inputSearch","_inputKeyUp","rebuildOptionsList","_filterList","_clearChoices","_keyUp","_keyDown","_keySide","_keyEnter","_keyEsc","_keyHomeEnd","_keySelectLetter","_keyAutoCompLetter","stopImmediatePropagation","_focusItem","_chooseItem","_cancel","_scrollToValue","_filter","character","fromCharCode","filterTerm","label","scrollIntoView","behavior","block","inline","_generateOptions","_sortOptions","_buildList","_showList","isInteger","_filterOptions","itteration","_ajaxRequest","_uniqueColumnValues","valuesLookupField","_addPlaceholder","responseValues","_parseList","_clearList","term","urlBuilder","getColumnByField","getColumn","inputValues","entries","_parseListItem","_parseListGroup","itemParams","selected","original","_defaultSortFunction","_sortGroup","as","bs","a1","b1","L","rx","rd","emptyAlign","isFinite","_defaultFilterFunc","_filterItem","_buildItem","itemFormatter","_groupClick","_itemClick","_styleItem","_this10","startVis","isVisible","_setListWidth","hideOnBlur","_resolveValue","_this11","blur","cellValue","search","onChange","selectContents","textarea","vertNav","whiteSpace","getRow","heightNow","selectionStart","number","step","blurFunc","List","star","self","maxStars","getElementsByTagName","size","stars","starsHolder","createElementNS","starChange","buildStar","starHolder","nextStar","changeValue","overflow","textOverflow","progress","mouseDrag","mouseDragWidth","percent","bar","updateValue","calcVal","round","backgroundColor","screenX","tickCross","tristate","indetermValue","indeterminateValue","indetermState","trueValueSet","falseValueSet","marginTop","checkedValue","checked","trueValue","falseValue","indeterminate","mouseClick","recursionBlock","invalidEdit","editedCells","editors","getEditedCells","clearCellEdited","navigatePrev","navigateNext","navigateLeft","navigateRight","navigateUp","navigateDown","cellisEdited","clearEdited","editCell","cellCancelEdit","bindEditor","columnDeleteCheck","rowDeleteCheck","cancelEdit","keybindingNavigateNext","newRow","edited","nextCell","findNextEditableCell","getIndex","findPrevEditableCell","allowEdit","check","prevCell","editable","clearEditor","variableHeight","cellEditCancelled","contains","button","forceEdit","focusCellNoEvent","getRenderMode","leftEdge","rightEdge","leftMargin","rightMargin","cellEditor","rendered","focusScrollAdjust","cellClick","cellEditing","validationMode","editIndex","defaultEditors","ExportRow","ExportColumn","Export","cloneTableStyle","colVisProp","getHtml","columnHeaders","headersToExportRows","generateColumnGroupHeaders","bodyToExportRows","rowLookup","genereateTableElement","selectRow","selectedRows","columnGroups","colData","processColumnGroup","maxDepth","groupData","subGroup","subGroupData","columnVisCheck","headerDepth","exportRows","parseColumnGroup","rowGroups","exportCols","headerEl","bodyEl","lookupTableStyles","setup","treeElementField","mapElementStyles","genereateHeaderElement","genereateGroupElement","genereateCalcElement","genereateRowElement","evenRow","oddRow","calcRow","firstRow","firstGroup","getElementsByClassName","styleCells","firstCell","lastCell","classNames","generator","cellWrapper","formatCells","formatExportValue","align","htmlOutputConfig","props","lookup","fromStyle","filterVal","rowVal","filterParams","RegExp","keywords","separator","keyword","matchAll","endsWith","Filter","filterList","headerFilterColumns","prevHeaderFilterChangeCheck","tableInitialized","searchRows","searchData","userSetFilter","userRefreshFilter","userAddFilter","getFilters","userSetHeaderFilterFocus","userGetHeaderFilterValue","userSetHeaderFilterValue","getHeaderFilters","userRemoveFilter","userClearFilter","userClearHeaderFilter","setHeaderFilterFocus","reloadHeaderFilter","getHeaderFilterValue","setHeaderFilterValue","initializeColumnHeaderFilter","hideHeaderFilterElements","showHeaderFilterElements","tableBuilt","filterMode","remoteFilterParams","registerDataHandler","initialFilter","setFilter","initialHeaderFilter","refreshFilter","addFilter","removeFilter","all","clearFilter","clearHeaderFilter","headerFilter","setHeaderFilterColumnPlaceholder","filterType","tagType","attrType","filterChangeCheck","prevSuccess","emptyFunc","headerFilterFunc","filters","headerFilterFuncParams","fieldVal","colVal","trackChanges","generateHeaderFilterElement","filterElement","editorElement","typingTimer","searchTrigger","headerElement","headerFilterEmptyCheck","headerFilterParams","headerFilterLiveFilterDelay","hasAttribute","headerFilterLiveFilter","reloadData","findFilter","findSubFilters","ajax","filtersToArray","searchType","filterRecurse","rowList","activeRowComponents","filterRow","subFilter","_this12","defaultFilters","plaintext","formatterParams","emptyToSpace","sanitizeHTML","money","integer","decimal","rgx","floatVal","sign","decimalSym","thousandSym","thousand","negativeSign","symbolAfter","link","urlPrefix","labelField","labelTraverse","urlField","image","src","urlSuffix","truthy","allowTruthy","tick","tickElement","cross","crossElement","datetime","newDatetime","DT","DateTime","luxon","inputFormat","outputFormat","invalid","invalidPlaceholder","isDateTime","fromISO","fromFormat","isValid","timezone","setZone","toFormat","datetimediff","suffix","humanize","date","now","toHuman","traffic","percentValue","colors","color","legend","legendColor","legendAlign","barEl","barContainer","legendEl","holderEl","buttonTick","buttonCross","rownum","responsiveCollapse","toggleList","isOpen","rowSelection","checkbox","selectableRangeMode","toggleSelect","handleComplexRowClick","isSelected","registerRowSelectCheckbox","deselectRow","registerHeaderSelectCheckbox","Format","formatValue","formatHeader","lookupFormatter","formatterPrint","print","formatterClipboard","formatterHtmlOutput","htmlOutput","formatters","mockCell","titleFormatter","titleFormatterParams","entityMap","defaultFormatters","FrozenColumns","leftColumns","rightColumns","rightPadding","initializationMode","layoutCell","reinitializeColumns","blockLayout","unblockLayout","edge","frozenCheck","calcMargins","layoutColumnPosition","layoutCalcRows","_calcSpace","layoutGroupCalcs","groupList","allCells","leftParents","marginValue","getColGroupParentElement","deinitialize","getTableElement","FrozenRows","freezeRow","unfreezeRow","isRowFrozen","detachRow","styleRows","GroupComponent","groupManager","toggleVisibility","Group","oldGroup","hasSubGroups","groupIDLookups","_addRowToGroup","_addRow","elementContents","arrowElement","createElements","addBindings","createValueGroups","arrow","movableRows","moveRow","initializeGroupHeader","allowedValues","_createGroup","groupToggleElement","groupID","groupKey","headerGenerator","conformRowData","generateGroupHeaderContents","updateGroupRows","scrollHeader","groupValues","removeGroup","noCalc","_visSet","getHeadersAndRows","hasTopCalcs","detachElement","generateTopRow","hasBottomCalcs","generateBottomRow","groupClosedShowCalcs","count","getDisplayIndex","checkClassicModeGroupHeaderWidth","prev","compoment","getPath","childNodes","GroupRows","displayHandler","setGroupBy","setGroupValues","setGroupStartOpen","setGroupHeader","userGetGroups","userGetGroupedData","rowGetGroup","groupUpdateOnCellEdit","cellUpdated","reassignRowToGroup","configureGroupSetup","rowDeleting","scrollHeaders","rowMoving","rowAddingIndex","rowSample","virtualRenderFill","groupStartOpen","langValue","items","removeCalcs","getRealColumns","lookupFunc","prevValue","assignRowToGroup","getGroupedData","toGroup","fromGroup","removeRow","insertRow","generateGroups","groupComponents","groupListData","pullGroupListData","rowCount","headerContent","oldGroups","createGroup","assignRowToExistingGroup","newGroupNeeded","oldRowGroup","oldGroupPath","newGroupPath","getExpectedPath","every","groupPath","groupId","History","history","clearComponentHistory","rowDeleted","rowAdded","rowMoved","undo","redo","getHistoryUndoSize","getHistoryRedoSize","posFrom","posTo","getGroup","newValue","undoers","redoers","oldRow","cellEdit","rowAdd","_rebindRow","rowMove","HtmlTableImport","fieldIndex","hasIndex","tableElementCheck","parseTable","_extractOptions","_extractHeaders","_generateBlankHeaders","optionsArr","attrib","_attribValue","exists","_findCol","textContent","inQuote","nextChar","Import","importFromFile","importFormat","loadDataCheck","loadData","importData","lookupImporter","structureData","err","importer","importers","extension","pickFile","extensions","accept","file","files","reader","FileReader","importReader","readAsArrayBuffer","readAsBinaryString","readAsDataURL","readAsText","onload","onerror","parsedData","structureArrayToObject","structureArrayToColumns","getColumns","defaultImporters","Interaction","eventMap","rowClick","rowDblClick","rowContext","rowMouseEnter","rowMouseLeave","rowMouseOver","rowMouseOut","rowMouseMove","rowTap","rowDblTap","rowTapHold","cellDblClick","cellContext","cellMouseEnter","cellMouseLeave","cellMouseOver","cellMouseOut","cellMouseMove","cellTap","cellDblTap","cellTapHold","headerMouseEnter","headerMouseLeave","headerMouseOver","headerMouseOut","headerMouseMove","groupClick","groupDblClick","groupContext","groupMouseEnter","groupMouseLeave","groupMouseOver","groupMouseOut","groupMouseMove","groupTap","groupDblTap","groupTapHold","subscribers","touchSubscribers","columnSubscribers","touchWatchers","tapDbl","initializeExternalEvents","cellContentsSelectionFixer","selectNode","subscriptionChangeExternal","subscribeTouchEvents","unsubscribeTouchEvents","handleTouch","notouch","watchers","componentObj","Keybindings","watchKeys","pressedKeys","keyupBinding","keydownBinding","keybindings","mergedBindings","mapBindings","bindEvents","clearBindings","mapBinding","symbolsList","ctrl","meta","code","checkBinding","ctrlKey","shiftKey","metaKey","navPrev","navNext","navUp","navDown","scrollPageUp","scrollPageDown","scrollToStart","scrollToEnd","copyToClipboard","keyBlock","newPos","scrollMax","navLeft","navRight","Menu","nestedMenuBlock","currentComponent","rootPopup","deprecationCheck","initializeRowWatchers","initializeGroupWatchers","rowContextMenu","loadMenuEvent","on","rowClickMenu","groupContextMenu","groupClickMenu","headerContextMenu","loadMenuTableColumnEvent","headerClickMenu","headerMenu","initializeColumnHeaderMenu","contextMenu","loadMenuTableCellEvent","clickMenu","headerMenuEl","icon","headerMenuIcon","menu","loadMenu","parentPopup","itemEl","disabled","MoveColumns","placeholderElement","createPlaceholderElement","hoverElement","checkTimeout","checkPeriod","moving","toCol","toColAfter","startX","autoScrollMargin","autoScrollStep","autoScrollTimeout","touchMove","moveHover","endMove","movableColumns","mousemove","which","startMove","bindTouchEvents","prevColWidth","nextColWidthLast","prevColWidthLast","startXMove","moveToCol","_bindMouseMove","movingCells","_unbindMouseMove","scrollPos","columnHolder","xPos","MoveRows","toRowAfter","hasHandle","startY","tableRowDropEvent","connectionSelectorsTables","connectionSelectorsElements","connectionElements","connectedTable","connectedRow","movableRowsConnectedTables","movableRowsConnectedElements","initializeCell","mouseup","tableRowDrop","previousSibling","rowHandle","nextRowHeight","prevRowHeight","nextRowHeightLast","prevRowHeightLast","startYMove","setStartPosition","connectToTables","pointerEvents","disconnectFromTables","moveHoverConnections","moveHoverTable","rowHolder","yPos","connectionTables","commsConnections","dropEvent","elementRowDrop","tabulatorElementDropEvent","sender","movableRowsSender","senders","movableRowsReceiver","receivers","connect","disconnect","dropComplete","fromTable","toTable","Mutator","enabled","transformCell","mutateLink","lookupMutator","mutators","mutatorEdit","linkCell","pageSize","currentRow","currentPage","totalRows","totalPages","showingEl","valueEl","ofEl","totalEl","rowsEl","pages","Page","progressiveLoad","pageCounterElement","pageCounter","page","remoteRowCountEstimate","initialLoad","dataChanging","pageSizes","setMaxPage","setPage","userSetPageToRow","userSetPageSize","getPageSize","previousPage","nextPage","getPage","getPageMax","setPageToRow","initialLoadComplete","calculatePageSizes","footerRedraw","paginationAddRow","rowAddingPosition","paginationMode","remotePageParams","_parseRemoteData","restOnRenderBefore","initializePageCounter","initializePaginator","initializeProgressive","scrollVertical","dispRows","testElRow","testElCell","paginationSize","generatePageSizeSelectList","setPageSize","progressiveLoadScrollMargin","pagesElement","firstBut","prevBut","nextBut","lastBut","paginationSizeSelector","pageSizeSelect","counter","paginationCounter","pageCounters","hidden","pageSelectLabel","paginationCounterHolder","paginationElement","paginationCounterElement","footerAppend","paginationInitialPage","paginationButtonCount","trigger","leftSize","rightSize","_generatePageButton","actualStartRow","actualRowPageSize","actualRows","setMaxRows","_setPageButtons","_setPageCounter","last_page","last_row","progressiveLoadDelay","footer","defaultPageCounters","local","id","localStorage","getItem","cookie","cookiePos","setItem","expireDate","setDate","getDate","toUTCString","Persistence","defWatcherBlock","readFunc","writeFunc","testKey","removeItem","persistence","retreivedData","persistenceMode","persistenceID","localStorageTest","persistenceReaderFunc","readers","persistenceWriterFunc","writers","retreiveData","save","eventSave","getColumnLayout","setColumnLayout","sorters","initialSort","parseColumns","mergeDefinition","getOwnPropertyDescriptor","defineProperty","set","current","oldCols","newCols","_findColumn","validateSorters","getSort","getGroupConfig","getPageConfig","excludedKeys","defStore","colDef","defaultReaders","defaultWriters","rowContextPopup","loadPopupEvent","rowClickPopup","groupContextPopup","groupClickPopup","headerContextPopup","loadPopupTableColumnEvent","headerClickPopup","headerPopup","initializeColumnHeaderPopup","contextPopup","loadPopupTableCellEvent","clickPopup","headerPopupEl","headerPopupIcon","loadPopup","contentsEl","renderCallback","Print","manualBlock","printAsHtml","replaceTable","cleanup","printFullscreen","genereateTable","printConfig","printStyled","printRowRange","footerContent","scrollX","scrollY","footerEl","tableEl","printHeader","printFooter","printFormatter","scrollTo","ReactiveData","origFuncs","currentVersion","unblock","watchRow","watchData","unwatchData","version","enumerable","configurable","arg","getRowFromDataObject","pop","startRow","oldRows","writable","watchKey","watchTreeChildren","childField","rebuildTree","ResizeColumns","startColumn","startWidth","latestX","initialNextColumn","layoutColumnHeader","layoutCellHandles","deInitializeComponent","resizeHandle","columnLayoutUpdated","deInitializeColumn","columnWidthUpdated","resizable","initializeEventWatchers","reinitializeColumn","frozenOffset","handleEl","nearestColumn","_checkResizability","handleDown","_mouseDown","oldWidth","parentElement","mouseMove","blockedBefore","blockedAfter","startDiff","moveDiff","resizableColumnFit","checkCellHeights","mouseUp","ResizeRows","startHeight","prevHandle","prevHandleDown","screenY","ResizeTable","observer","containerObserver","tableHeight","containerWidth","autoResize","tableStyle","ResizeObserver","entry","nodeHeight","contentRect","nodeWidth","observe","tableResized","unobserve","ResponsiveLayout","hiddenColumns","collapseFormatter","collapseStartOpen","collapseHandleColumn","updateColumnVisibility","initializeResponsivity","responsiveLayoutCollapseFormatter","formatCollapsedData","responsiveLayoutCollapseStartOpen","order","generateCollapsedContent","generateCollapsedRowContent","colCount","working","getFlexBaseWidth","hideColumn","showColumn","generateCollapsedRowData","mockCellComponent","responsiveLayoutCollapseUseFormatters","node_content","titleData","valueData","titleHighlight","SelectRow","selecting","lastClickedRow","selectPrev","headerCheckboxElement","selectRows","deselectRows","getSelectedRows","getSelectedData","isRowSelected","selectable","clearSelectionData","rowRetrieve","selectablePersistence","_deselectRow","_rowSelectionChanged","endSelect","selectableCheck","getCurrentCell","_clearSelection","lastClickedRowIdx","rowIdx","fromRowIdx","toRowIdx","toggledRows","toggledRow","_selectRow","rowMatch","rowInfo","selectableRollingSelection","checkboxEl","dataTreeSelectPropagate","childRowSelection","selectedRow","aRow","bRow","alignEmptyValues","decimalSeparator","thousandSeparator","string","langLocale","localeCompare","time","array","calc","d","alphanum","Sort","sortList","userSetSort","clearSort","sortMode","remoteSortParams","setSort","refreshSort","arrowEl","sorterParams","startingDir","headerSortStartingDir","headerSortTristate","headerSort","headerSortElement","columnHeaderSortMulti","newSortList","sortOrderReverse","sortListActual","rowComponents","clearColumnHeaders","sortObj","findSorter","setColumnHeader","_sortItems","sorterCount","sortItem","_sortRow","el1Comp","el2Comp","el1","el2","defaultSorters","Tooltip","tooltipSubscriber","headerSubscriber","timeout","popupInstance","tooltipGenerationMode","headerTooltip","mousemoveCheck","mouseoutCheck","tooltip","clearPopup","loadTooltip","tooltipDelay","parameters","numeric","starts","ends","minLength","maxLength","regex","unique","cellData","Validate","invalidCells","getInvalidCells","userClearCellValidation","userValidate","cellIsValid","clearValidation","cellValidate","columnValidate","rowValidate","editValidate","editorClear","editedClear","previousValue","validate","cancelled","validator","_extractValidator","substring","_buildValidator","validators","failedValidators","invalidIndex","defaultValidators","TabulatorFull"],"mappings":";4sHAAqBA,wBAERC,kBACNA,MAAQA,+CAOHC,EAAMC,EAAQC,UACjBC,KAAKJ,MAAMK,WAAWC,KAAKL,OAAMM,OAAWA,OAAWA,EAAWL,EAAQC,0DAQrEH,MAAMQ,QAAQC,UAASC,gBAAWC,kEAIlCX,MAAMQ,QAAQC,UAASG,aAAQD,oEAI/BX,MAAMQ,QAAQC,UAASI,kBAAaF,0EASpCX,MAAMQ,QAAQM,OAAMC,uBAAkBJ,mEAItCX,MAAMQ,QAAQM,OAAME,aAAQL,uDAQjCP,KAAKJ,MAAMQ,QAAQS,OAAOC,yDAI1Bd,KAAKJ,MAAMQ,QAAQS,OAAOA,iEASrBjB,MAAMmB,UAASC,kBAAaT,qEAI5BX,MAAMmB,UAASE,oBAAeV,8CAGhCW,UACHlB,KAAKJ,MAAMmB,SAASI,WAAWD,oEAI1BtB,MAAMmB,UAASK,2BAAsBb,kEAIrCX,MAAMmB,UAASM,iBAAYd,+DAI3BX,MAAMmB,UAASO,cAASf,iEAIxBX,MAAMmB,UAASQ,gBAAWhB,0EAI1BX,MAAM4B,gBAAeH,iBAAYd,sDAG3BW,UACXlB,KAAKJ,MAAM4B,eAAeL,WAAWD,4EAIhCtB,MAAM4B,gBAAeJ,2BAAsBb,2CAOhDW,UACAlB,KAAKJ,MAAM6B,QAAQP,qCAGjBA,EAAKQ,eACM,IAAVA,SACJ9B,MAAM6B,QAAQP,GAAOQ,GAGpB1B,KAAKJ,MAAM6B,QAAQP,kCAQpBA,UACClB,KAAKJ,MAAM+B,OAAOT,YCvHNU,wBACPC,yBACPC,QAAUD,OACVE,KAAO,kBAEL,IAAIC,MAAMhC,KAAM,CACtBiC,IAAK,SAASC,EAAQC,EAAMC,eACC,IAAjBF,EAAOC,GACVD,EAAOC,GAEPD,EAAOJ,QAAQlC,MAAMy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AU,GAEhCw0B,EAAe//E,KAAK0+E,aAAahzE,QAAQ7I,KAEtB,QACb67E,aAAa3uE,OAAOgwE,EAAc,WApSpB3uD,GA0SvBqtD,GAASjqD,WAAa,WAGtBiqD,GAASoB,WAAaG,grBC5ShBC,iGAAsB7wD,UAG5B,IAAI0H,EAAampD,GAAe7/E"} \ No newline at end of file +{"version":3,"file":"tabulator.min.js","sources":["../../src/js/core/CoreFeature.js","../../src/js/core/column/ColumnComponent.js","../../src/js/core/column/defaults/options.js","../../src/js/core/cell/CellComponent.js","../../src/js/core/cell/Cell.js","../../src/js/core/column/Column.js","../../src/js/core/tools/Helpers.js","../../src/js/core/tools/OptionsList.js","../../src/js/core/rendering/Renderer.js","../../src/js/core/rendering/renderers/BasicHorizontal.js","../../src/js/core/rendering/renderers/VirtualDomHorizontal.js","../../src/js/core/ColumnManager.js","../../src/js/core/row/RowComponent.js","../../src/js/core/row/Row.js","../../src/js/core/rendering/renderers/BasicVertical.js","../../src/js/core/rendering/renderers/VirtualDomVertical.js","../../src/js/core/RowManager.js","../../src/js/core/FooterManager.js","../../src/js/core/tools/InteractionMonitor.js","../../src/js/core/tools/ComponentFunctionBinder.js","../../src/js/core/tools/DataLoader.js","../../src/js/core/tools/ExternalEventBus.js","../../src/js/core/tools/InternalEventBus.js","../../src/js/core/tools/TableRegistry.js","../../src/js/core/tools/Popup.js","../../src/js/core/Module.js","../../src/js/modules/Layout/defaults/modes/fitDataGeneral.js","../../src/js/modules/Layout/defaults/modes.js","../../src/js/modules/Layout/defaults/modes/fitData.js","../../src/js/modules/Layout/defaults/modes/fitDataStretch.js","../../src/js/modules/Layout/defaults/modes/fitColumns.js","../../src/js/modules/Layout/Layout.js","../../src/js/modules/Localize/Localize.js","../../src/js/modules/Localize/defaults/langs.js","../../src/js/modules/Comms/Comms.js","../../src/js/core/tools/ModuleBinder.js","../../src/js/core/tools/Alert.js","../../src/js/core/Tabulator.js","../../src/js/core/defaults/options.js","../../src/js/modules/Accessor/Accessor.js","../../src/js/modules/Accessor/defaults/accessors.js","../../src/js/modules/Ajax/defaults/urlGenerator.js","../../src/js/modules/Ajax/defaults/contentTypeFormatters.js","../../src/js/modules/Ajax/Ajax.js","../../src/js/modules/Ajax/defaults/config.js","../../src/js/modules/Ajax/defaults/loaderPromise.js","../../src/js/modules/Clipboard/Clipboard.js","../../src/js/modules/Clipboard/defaults/pasteActions.js","../../src/js/modules/Clipboard/defaults/pasteParsers.js","../../src/js/modules/ColumnCalcs/CalcComponent.js","../../src/js/modules/ColumnCalcs/defaults/calculations.js","../../src/js/modules/ColumnCalcs/ColumnCalcs.js","../../src/js/modules/DataTree/DataTree.js","../../src/js/modules/Download/defaults/downloaders.js","../../src/js/modules/Download/defaults/downloaders/csv.js","../../src/js/modules/Download/defaults/downloaders/json.js","../../src/js/modules/Download/defaults/downloaders/jsonLines.js","../../src/js/modules/Download/defaults/downloaders/pdf.js","../../src/js/modules/Download/defaults/downloaders/xlsx.js","../../src/js/modules/Download/defaults/downloaders/html.js","../../src/js/modules/Download/Download.js","../../src/js/modules/Edit/inputMask.js","../../src/js/modules/Edit/List.js","../../src/js/modules/Edit/defaults/editors.js","../../src/js/modules/Edit/defaults/editors/input.js","../../src/js/modules/Edit/defaults/editors/textarea.js","../../src/js/modules/Edit/defaults/editors/number.js","../../src/js/modules/Edit/defaults/editors/range.js","../../src/js/modules/Edit/defaults/editors/select.js","../../src/js/modules/Edit/defaults/editors/list.js","../../src/js/modules/Edit/defaults/editors/autocomplete.js","../../src/js/modules/Edit/defaults/editors/star.js","../../src/js/modules/Edit/defaults/editors/progress.js","../../src/js/modules/Edit/defaults/editors/tickCross.js","../../src/js/modules/Edit/Edit.js","../../src/js/modules/Export/ExportRow.js","../../src/js/modules/Export/ExportColumn.js","../../src/js/modules/Export/Export.js","../../src/js/modules/Filter/defaults/filters.js","../../src/js/modules/Filter/Filter.js","../../src/js/modules/Format/defaults/formatters.js","../../src/js/modules/Format/defaults/formatters/plaintext.js","../../src/js/modules/Format/defaults/formatters/html.js","../../src/js/modules/Format/defaults/formatters/textarea.js","../../src/js/modules/Format/defaults/formatters/money.js","../../src/js/modules/Format/defaults/formatters/link.js","../../src/js/modules/Format/defaults/formatters/image.js","../../src/js/modules/Format/defaults/formatters/tickCross.js","../../src/js/modules/Format/defaults/formatters/datetime.js","../../src/js/modules/Format/defaults/formatters/datetimediff.js","../../src/js/modules/Format/defaults/formatters/lookup.js","../../src/js/modules/Format/defaults/formatters/star.js","../../src/js/modules/Format/defaults/formatters/traffic.js","../../src/js/modules/Format/defaults/formatters/progress.js","../../src/js/modules/Format/defaults/formatters/color.js","../../src/js/modules/Format/defaults/formatters/buttonTick.js","../../src/js/modules/Format/defaults/formatters/buttonCross.js","../../src/js/modules/Format/defaults/formatters/rownum.js","../../src/js/modules/Format/defaults/formatters/handle.js","../../src/js/modules/Format/defaults/formatters/responsiveCollapse.js","../../src/js/modules/Format/defaults/formatters/rowSelection.js","../../src/js/modules/Format/Format.js","../../src/js/modules/FrozenColumns/FrozenColumns.js","../../src/js/modules/FrozenRows/FrozenRows.js","../../src/js/modules/GroupRows/GroupComponent.js","../../src/js/modules/GroupRows/Group.js","../../src/js/modules/GroupRows/GroupRows.js","../../src/js/modules/History/History.js","../../src/js/modules/History/defaults/undoers.js","../../src/js/modules/History/defaults/redoers.js","../../src/js/modules/HtmlTableImport/HtmlTableImport.js","../../src/js/modules/Import/defaults/importers.js","../../src/js/modules/Import/defaults/importers/csv.js","../../src/js/modules/Import/defaults/importers/json.js","../../src/js/modules/Import/Import.js","../../src/js/modules/Interaction/Interaction.js","../../src/js/modules/Keybindings/Keybindings.js","../../src/js/modules/Keybindings/defaults/bindings.js","../../src/js/modules/Keybindings/defaults/actions.js","../../src/js/modules/Menu/Menu.js","../../src/js/modules/MoveColumns/MoveColumns.js","../../src/js/modules/MoveRows/MoveRows.js","../../src/js/modules/Mutator/Mutator.js","../../src/js/modules/Mutator/defaults/mutators.js","../../src/js/modules/Page/defaults/pageCounters.js","../../src/js/modules/Page/defaults/pageCounters/rows.js","../../src/js/modules/Page/defaults/pageCounters/pages.js","../../src/js/modules/Page/Page.js","../../src/js/modules/Persistence/defaults/readers.js","../../src/js/modules/Persistence/defaults/writers.js","../../src/js/modules/Persistence/Persistence.js","../../src/js/modules/Popup/Popup.js","../../src/js/modules/Print/Print.js","../../src/js/modules/ReactiveData/ReactiveData.js","../../src/js/modules/ResizeColumns/ResizeColumns.js","../../src/js/modules/ResizeRows/ResizeRows.js","../../src/js/modules/ResizeTable/ResizeTable.js","../../src/js/modules/ResponsiveLayout/ResponsiveLayout.js","../../src/js/modules/SelectRow/SelectRow.js","../../src/js/modules/Sort/defaults/sorters/datetime.js","../../src/js/modules/Sort/defaults/sorters.js","../../src/js/modules/Sort/defaults/sorters/number.js","../../src/js/modules/Sort/defaults/sorters/string.js","../../src/js/modules/Sort/defaults/sorters/date.js","../../src/js/modules/Sort/defaults/sorters/time.js","../../src/js/modules/Sort/defaults/sorters/boolean.js","../../src/js/modules/Sort/defaults/sorters/array.js","../../src/js/modules/Sort/defaults/sorters/exists.js","../../src/js/modules/Sort/defaults/sorters/alphanum.js","../../src/js/modules/Sort/Sort.js","../../src/js/modules/Tooltip/Tooltip.js","../../src/js/modules/Validate/defaults/validators.js","../../src/js/modules/Validate/Validate.js","../../src/js/core/TabulatorFull.js"],"sourcesContent":["export default class CoreFeature{\r\n\r\n\tconstructor(table){\r\n\t\tthis.table = table;\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t/////////////// DataLoad /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\treloadData(data, silent, columnsChanged){\r\n\t\treturn this.table.dataLoader.load(data, undefined, undefined, undefined, silent, columnsChanged);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t///////////// Localization ///////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tlangText(){\r\n\t\treturn this.table.modules.localize.getText(...arguments);\r\n\t}\r\n\r\n\tlangBind(){\r\n\t\treturn this.table.modules.localize.bind(...arguments);\r\n\t}\r\n\r\n\tlangLocale(){\r\n\t\treturn this.table.modules.localize.getLocale(...arguments);\r\n\t}\r\n\r\n\r\n\t//////////////////////////////////////////\r\n\t////////// Inter Table Comms /////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tcommsConnections(){\r\n\t\treturn this.table.modules.comms.getConnections(...arguments);\r\n\t}\r\n\r\n\tcommsSend(){\r\n\t\treturn this.table.modules.comms.send(...arguments);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t//////////////// Layout /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tlayoutMode(){\r\n\t\treturn this.table.modules.layout.getMode();\r\n\t}\r\n\r\n\tlayoutRefresh(){\r\n\t\treturn this.table.modules.layout.layout();\r\n\t}\r\n\r\n\r\n\t//////////////////////////////////////////\r\n\t/////////////// Event Bus ////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tsubscribe(){\r\n\t\treturn this.table.eventBus.subscribe(...arguments);\r\n\t}\r\n\r\n\tunsubscribe(){\r\n\t\treturn this.table.eventBus.unsubscribe(...arguments);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.table.eventBus.subscribed(key);\r\n\t}\r\n\r\n\tsubscriptionChange(){\r\n\t\treturn this.table.eventBus.subscriptionChange(...arguments);\r\n\t}\r\n\r\n\tdispatch(){\r\n\t\treturn this.table.eventBus.dispatch(...arguments);\r\n\t}\r\n\r\n\tchain(){\r\n\t\treturn this.table.eventBus.chain(...arguments);\r\n\t}\r\n\r\n\tconfirm(){\r\n\t\treturn this.table.eventBus.confirm(...arguments);\r\n\t}\r\n\r\n\tdispatchExternal(){\r\n\t\treturn this.table.externalEvents.dispatch(...arguments);\r\n\t}\r\n\r\n\tsubscribedExternal(key){\r\n\t\treturn this.table.externalEvents.subscribed(key);\r\n\t}\r\n\r\n\tsubscriptionChangeExternal(){\r\n\t\treturn this.table.externalEvents.subscriptionChange(...arguments);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t//////////////// Options /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\toptions(key){\r\n\t\treturn this.table.options[key];\r\n\t}\r\n\r\n\tsetOption(key, value){\r\n\t\tif(typeof value !== \"undefined\"){\r\n\t\t\tthis.table.options[key] = value;\r\n\t\t}\r\n\r\n\t\treturn this.table.options[key];\r\n\t}\r\n\r\n\r\n\t//////////////////////////////////////////\r\n\t//////////////// Modules /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tmodule(key){\r\n\t\treturn this.table.module(key);\r\n\t}\r\n}","import Column from './Column.js';\r\n\r\n//public column object\r\nexport default class ColumnComponent {\r\n\tconstructor (column){\r\n\t\tthis._column = column;\r\n\t\tthis.type = \"ColumnComponent\";\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._column.table.componentFunctionBinder.handle(\"column\", target._column, name)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._column.getElement();\r\n\t}\r\n\r\n\tgetDefinition(){\r\n\t\treturn this._column.getDefinition();\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._column.getField();\r\n\t}\r\n\r\n\tgetTitleDownload() {\r\n\t\treturn this._column.getTitleDownload();\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._column.cells.forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tisVisible(){\r\n\t\treturn this._column.visible;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tif(this._column.isGroup){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\tcolumn.show();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis._column.show();\r\n\t\t}\r\n\t}\r\n\r\n\thide(){\r\n\t\tif(this._column.isGroup){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\tcolumn.hide();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis._column.hide();\r\n\t\t}\r\n\t}\r\n\r\n\ttoggle(){\r\n\t\tif(this._column.visible){\r\n\t\t\tthis.hide();\r\n\t\t}else{\r\n\t\t\tthis.show();\r\n\t\t}\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn this._column.delete();\r\n\t}\r\n\r\n\tgetSubColumns(){\r\n\t\tvar output = [];\r\n\r\n\t\tif(this._column.columns.length){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\toutput.push(column.getComponent());\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetParentColumn(){\r\n\t\treturn this._column.parent instanceof Column ? this._column.parent.getComponent() : false;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._column;\r\n\t}\r\n\r\n\tscrollTo(){\r\n\t\treturn this._column.table.columnManager.scrollToColumn(this._column);\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._column.table;\r\n\t}\r\n\r\n\tmove(to, after){\r\n\t\tvar toColumn = this._column.table.columnManager.findColumn(to);\r\n\r\n\t\tif(toColumn){\r\n\t\t\tthis._column.table.columnManager.moveColumn(this._column, toColumn, after)\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching column found:\", toColumn);\r\n\t\t}\r\n\t}\r\n\r\n\tgetNextColumn(){\r\n\t\tvar nextCol = this._column.nextColumn();\r\n\r\n\t\treturn nextCol ? nextCol.getComponent() : false;\r\n\t}\r\n\r\n\tgetPrevColumn(){\r\n\t\tvar prevCol = this._column.prevColumn();\r\n\r\n\t\treturn prevCol ? prevCol.getComponent() : false;\r\n\t}\r\n\r\n\tupdateDefinition(updates){\r\n\t\treturn this._column.updateDefinition(updates);\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\treturn this._column.getWidth();\r\n\t}\r\n\r\n\tsetWidth(width){\r\n\t\tvar result;\r\n\r\n\t\tif(width === true){\r\n\t\t\tresult = this._column.reinitializeWidth(true);\r\n\t\t}else{\r\n\t\t\tresult = this._column.setWidth(width);\r\n\t\t}\r\n\r\n\t\tthis._column.table.columnManager.renderer.rerenderColumns(true);\r\n\r\n\t\treturn result;\r\n\t}\r\n}","export default {\r\n\t\"title\": undefined,\r\n\t\"field\": undefined,\r\n\t\"columns\": undefined,\r\n\t\"visible\": undefined,\r\n\t\"hozAlign\": undefined,\r\n\t\"vertAlign\": undefined,\r\n\t\"width\": undefined,\r\n\t\"minWidth\": 40,\r\n\t\"maxWidth\": undefined,\r\n\t\"maxInitialWidth\": undefined,\r\n\t\"cssClass\": undefined,\r\n\t\"variableHeight\": undefined,\r\n\t\"headerVertical\": undefined,\r\n\t\"headerHozAlign\": undefined,\r\n\t\"editableTitle\": undefined,\r\n}","//public cell object\r\nexport default class CellComponent {\r\n\r\n\tconstructor (cell){\r\n\t\tthis._cell = cell;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._cell.table.componentFunctionBinder.handle(\"cell\", target._cell, name)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\tgetValue(){\r\n\t\treturn this._cell.getValue();\r\n\t}\r\n\r\n\tgetOldValue(){\r\n\t\treturn this._cell.getOldValue();\r\n\t}\r\n\r\n\tgetInitialValue(){\r\n\t\treturn this._cell.initialValue;\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._cell.getElement();\r\n\t}\r\n\r\n\tgetRow(){\r\n\t\treturn this._cell.row.getComponent();\r\n\t}\r\n\r\n\tgetData(){\r\n\t\treturn this._cell.row.getData();\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._cell.column.getField();\r\n\t}\r\n\r\n\tgetColumn(){\r\n\t\treturn this._cell.column.getComponent();\r\n\t}\r\n\r\n\tsetValue(value, mutate){\r\n\t\tif(typeof mutate == \"undefined\"){\r\n\t\t\tmutate = true;\r\n\t\t}\r\n\r\n\t\tthis._cell.setValue(value, mutate);\r\n\t}\r\n\r\n\trestoreOldValue(){\r\n\t\tthis._cell.setValueActual(this._cell.getOldValue());\r\n\t}\r\n\r\n\trestoreInitialValue(){\r\n\t\tthis._cell.setValueActual(this._cell.initialValue);\r\n\t}\r\n\r\n\tcheckHeight(){\r\n\t\tthis._cell.checkHeight();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._cell.table;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._cell;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport CellComponent from './CellComponent.js';\r\n\r\nexport default class Cell extends CoreFeature{\r\n\tconstructor(column, row){\r\n\t\tsuper(column.table);\r\n\r\n\t\tthis.table = column.table;\r\n\t\tthis.column = column;\r\n\t\tthis.row = row;\r\n\t\tthis.element = null;\r\n\t\tthis.value = null;\r\n\t\tthis.initialValue;\r\n\t\tthis.oldValue = null;\r\n\t\tthis.modules = {};\r\n\r\n\t\tthis.height = null;\r\n\t\tthis.width = null;\r\n\t\tthis.minWidth = null;\r\n\r\n\t\tthis.component = null;\r\n\r\n\t\tthis.loaded = false; //track if the cell has been added to the DOM yet\r\n\r\n\t\tthis.build();\r\n\t}\r\n\r\n\t//////////////// Setup Functions /////////////////\r\n\t//generate element\r\n\tbuild(){\r\n\t\tthis.generateElement();\r\n\r\n\t\tthis.setWidth();\r\n\r\n\t\tthis._configureCell();\r\n\r\n\t\tthis.setValueActual(this.column.getFieldValue(this.row.data));\r\n\r\n\t\tthis.initialValue = this.value;\r\n\t}\r\n\r\n\tgenerateElement(){\r\n\t\tthis.element = document.createElement('div');\r\n\t\tthis.element.className = \"tabulator-cell\";\r\n\t\tthis.element.setAttribute(\"role\", \"gridcell\");\r\n\t\tthis.element = this.element;\r\n\t}\r\n\r\n\t_configureCell(){\r\n\t\tvar element = this.element,\r\n\t\tfield = this.column.getField(),\r\n\t\tvertAligns = {\r\n\t\t\ttop:\"flex-start\",\r\n\t\t\tbottom:\"flex-end\",\r\n\t\t\tmiddle:\"center\",\r\n\t\t},\r\n\t\thozAligns = {\r\n\t\t\tleft:\"flex-start\",\r\n\t\t\tright:\"flex-end\",\r\n\t\t\tcenter:\"center\",\r\n\t\t};\r\n\r\n\t\t//set text alignment\r\n\t\telement.style.textAlign = this.column.hozAlign;\r\n\r\n\t\tif(this.column.vertAlign){\r\n\t\t\telement.style.display = \"inline-flex\";\r\n\r\n\t\t\telement.style.alignItems = vertAligns[this.column.vertAlign] || \"\";\r\n\r\n\t\t\tif(this.column.hozAlign){\r\n\t\t\t\telement.style.justifyContent = hozAligns[this.column.hozAlign] || \"\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(field){\r\n\t\t\telement.setAttribute(\"tabulator-field\", field);\r\n\t\t}\r\n\r\n\t\t//add class to cell if needed\r\n\t\tif(this.column.definition.cssClass){\r\n\t\t\tvar classNames = this.column.definition.cssClass.split(\" \")\r\n\t\t\tclassNames.forEach((className) => {\r\n\t\t\t\telement.classList.add(className)\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"cell-init\", this);\r\n\r\n\t\t//hide cell if not visible\r\n\t\tif(!this.column.visible){\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\t//generate cell contents\r\n\t_generateContents(){\r\n\t\tvar val;\r\n\r\n\t\tval = this.chain(\"cell-format\", this, null, () => {\r\n\t\t\treturn this.element.innerHTML = this.value;\r\n\t\t});\r\n\r\n\t\tswitch(typeof val){\r\n\t\t\tcase \"object\":\r\n\t\t\tif(val instanceof Node){\r\n\r\n\t\t\t\t//clear previous cell contents\r\n\t\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\r\n\t\t\t\tthis.element.appendChild(val);\r\n\t\t\t}else{\r\n\t\t\t\tthis.element.innerHTML = \"\";\r\n\r\n\t\t\t\tif(val != null){\r\n\t\t\t\t\tconsole.warn(\"Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:\", val);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\tcase \"undefined\":\r\n\t\t\tthis.element.innerHTML = \"\";\r\n\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\tthis.element.innerHTML = val;\r\n\t\t}\r\n\t}\r\n\r\n\tcellRendered(){\r\n\t\tthis.dispatch(\"cell-rendered\", this);\r\n\t}\r\n\r\n\t//////////////////// Getters ////////////////////\r\n\tgetElement(containerOnly){\r\n\t\tif(!this.loaded){\r\n\t\t\tthis.loaded = true;\r\n\t\t\tif(!containerOnly){\r\n\t\t\t\tthis.layoutElement();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\tgetValue(){\r\n\t\treturn this.value;\r\n\t}\r\n\r\n\tgetOldValue(){\r\n\t\treturn this.oldValue;\r\n\t}\r\n\r\n\t//////////////////// Actions ////////////////////\r\n\tsetValue(value, mutate, force){\r\n\t\tvar changed = this.setValueProcessData(value, mutate, force);\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.dispatch(\"cell-value-updated\", this);\r\n\r\n\t\t\tthis.cellRendered();\r\n\r\n\t\t\tif(this.column.definition.cellEdited){\r\n\t\t\t\tthis.column.definition.cellEdited.call(this.table, this.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"cellEdited\", this.getComponent());\r\n\r\n\t\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tsetValueProcessData(value, mutate, force){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(this.value !== value || force){\r\n\r\n\t\t\tchanged = true;\r\n\r\n\t\t\tif(mutate){\r\n\t\t\t\tvalue = this.chain(\"cell-value-changing\", [this, value], null, value);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.setValueActual(value);\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.dispatch(\"cell-value-changed\", this);\r\n\t\t}\r\n\r\n\t\treturn changed;\r\n\t}\r\n\r\n\tsetValueActual(value){\r\n\t\tthis.oldValue = this.value;\r\n\r\n\t\tthis.value = value;\r\n\r\n\t\tthis.dispatch(\"cell-value-save-before\", this);\r\n\r\n\t\tthis.column.setFieldValue(this.row.data, value);\r\n\r\n\t\tthis.dispatch(\"cell-value-save-after\", this);\r\n\r\n\t\tif(this.loaded){\r\n\t\t\tthis.layoutElement();\r\n\t\t}\r\n\t}\r\n\r\n\tlayoutElement(){\r\n\t\tthis._generateContents();\r\n\r\n\t\tthis.dispatch(\"cell-layout\", this);\r\n\t}\r\n\r\n\tsetWidth(){\r\n\t\tthis.width = this.column.width;\r\n\t\tthis.element.style.width = this.column.widthStyled;\r\n\t}\r\n\r\n\tclearWidth(){\r\n\t\tthis.width = \"\";\r\n\t\tthis.element.style.width = \"\";\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\treturn this.width || this.element.offsetWidth;\r\n\t}\r\n\r\n\tsetMinWidth(){\r\n\t\tthis.minWidth = this.column.minWidth;\r\n\t\tthis.element.style.minWidth = this.column.minWidthStyled;\r\n\t}\r\n\r\n\tsetMaxWidth(){\r\n\t\tthis.maxWidth = this.column.maxWidth;\r\n\t\tthis.element.style.maxWidth = this.column.maxWidthStyled;\r\n\t}\r\n\r\n\tcheckHeight(){\r\n\t\t// var height = this.element.css(\"height\");\r\n\t\tthis.row.reinitializeHeight();\r\n\t}\r\n\r\n\tclearHeight(){\r\n\t\tthis.element.style.height = \"\";\r\n\t\tthis.height = null;\r\n\r\n\t\tthis.dispatch(\"cell-height\", this, \"\");\r\n\t}\r\n\r\n\tsetHeight(){\r\n\t\tthis.height = this.row.height;\r\n\t\tthis.element.style.height = this.row.heightStyled;\r\n\r\n\t\tthis.dispatch(\"cell-height\", this, this.row.heightStyled);\r\n\t}\r\n\r\n\tgetHeight(){\r\n\t\treturn this.height || this.element.offsetHeight;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tthis.element.style.display = this.column.vertAlign ? \"inline-flex\" : \"\";\r\n\t}\r\n\r\n\thide(){\r\n\t\tthis.element.style.display = \"none\";\r\n\t}\r\n\r\n\tdelete(){\r\n\t\tthis.dispatch(\"cell-delete\", this);\r\n\r\n\t\tif(!this.table.rowManager.redrawBlock && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\r\n\t\tthis.element = false;\r\n\t\tthis.column.deleteCell(this);\r\n\t\tthis.row.deleteCell(this);\r\n\t\tthis.calcs = {};\r\n\t}\r\n\r\n\tgetIndex(){\r\n\t\treturn this.row.getCellIndex(this);\r\n\t}\r\n\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new CellComponent(this);\r\n\t\t}\r\n\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n","import CoreFeature from '../CoreFeature.js';\r\nimport ColumnComponent from './ColumnComponent.js';\r\nimport defaultOptions from './defaults/options.js';\r\n\r\nimport Cell from '../cell/Cell.js';\r\n\r\nclass Column extends CoreFeature{\r\n\r\n\tconstructor(def, parent){\r\n\t\tsuper(parent.table);\r\n\r\n\t\tthis.definition = def; //column definition\r\n\t\tthis.parent = parent; //hold parent object\r\n\t\tthis.type = \"column\"; //type of element\r\n\t\tthis.columns = []; //child columns\r\n\t\tthis.cells = []; //cells bound to this column\r\n\t\tthis.element = this.createElement(); //column header element\r\n\t\tthis.contentElement = false;\r\n\t\tthis.titleHolderElement = false;\r\n\t\tthis.titleElement = false;\r\n\t\tthis.groupElement = this.createGroupElement(); //column group holder element\r\n\t\tthis.isGroup = false;\r\n\t\tthis.hozAlign = \"\"; //horizontal text alignment\r\n\t\tthis.vertAlign = \"\"; //vert text alignment\r\n\r\n\t\t//multi dimensional filed handling\r\n\t\tthis.field =\"\";\r\n\t\tthis.fieldStructure = \"\";\r\n\t\tthis.getFieldValue = \"\";\r\n\t\tthis.setFieldValue = \"\";\r\n\r\n\t\tthis.titleDownload = null;\r\n\t\tthis.titleFormatterRendered = false;\r\n\r\n\t\tthis.mapDefinitions();\r\n\r\n\t\tthis.setField(this.definition.field);\r\n\r\n\t\tthis.modules = {}; //hold module variables;\r\n\r\n\t\tthis.width = null; //column width\r\n\t\tthis.widthStyled = \"\"; //column width prestyled to improve render efficiency\r\n\t\tthis.maxWidth = null; //column maximum width\r\n\t\tthis.maxWidthStyled = \"\"; //column maximum prestyled to improve render efficiency\r\n\t\tthis.maxInitialWidth = null;\r\n\t\tthis.minWidth = null; //column minimum width\r\n\t\tthis.minWidthStyled = \"\"; //column minimum prestyled to improve render efficiency\r\n\t\tthis.widthFixed = false; //user has specified a width for this column\r\n\r\n\t\tthis.visible = true; //default visible state\r\n\r\n\t\tthis.component = null;\r\n\r\n\t\t//initialize column\r\n\t\tif(this.definition.columns){\r\n\r\n\t\t\tthis.isGroup = true;\r\n\r\n\t\t\tthis.definition.columns.forEach((def, i) => {\r\n\t\t\t\tvar newCol = new Column(def, this);\r\n\t\t\t\tthis.attachColumn(newCol);\r\n\t\t\t});\r\n\r\n\t\t\tthis.checkColumnVisibility();\r\n\t\t}else{\r\n\t\t\tparent.registerColumnField(this);\r\n\t\t}\r\n\r\n\t\tthis._initialize();\r\n\r\n\t\tthis.bindModuleColumns();\r\n\t}\r\n\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-col\");\r\n\t\tel.setAttribute(\"role\", \"columnheader\");\r\n\t\tel.setAttribute(\"aria-sort\", \"none\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tcreateGroupElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-col-group-cols\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tmapDefinitions(){\r\n\t\tvar defaults = this.table.options.columnDefaults;\r\n\r\n\t\t//map columnDefaults onto column definitions\r\n\t\tif(defaults){\r\n\t\t\tfor(let key in defaults){\r\n\t\t\t\tif(typeof this.definition[key] === \"undefined\"){\r\n\t\t\t\t\tthis.definition[key] = defaults[key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.definition = this.table.columnManager.optionsList.generate(Column.defaultOptionList, this.definition)\r\n\t}\r\n\r\n\tcheckDefinition(){\r\n\t\tObject.keys(this.definition).forEach((key) => {\r\n\t\t\tif(Column.defaultOptionList.indexOf(key) === -1){\r\n\t\t\t\tconsole.warn(\"Invalid column definition option in '\" + (this.field || this.definition.title) + \"' column:\", key)\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tsetField(field){\r\n\t\tthis.field = field;\r\n\t\tthis.fieldStructure = field ? (this.table.options.nestedFieldSeparator ? field.split(this.table.options.nestedFieldSeparator) : [field]) : [];\r\n\t\tthis.getFieldValue = this.fieldStructure.length > 1 ? this._getNestedData : this._getFlatData;\r\n\t\tthis.setFieldValue = this.fieldStructure.length > 1 ? this._setNestedData : this._setFlatData;\r\n\t}\r\n\r\n\t//register column position with column manager\r\n\tregisterColumnPosition(column){\r\n\t\tthis.parent.registerColumnPosition(column);\r\n\t}\r\n\r\n\t//register column position with column manager\r\n\tregisterColumnField(column){\r\n\t\tthis.parent.registerColumnField(column);\r\n\t}\r\n\r\n\t//trigger position registration\r\n\treRegisterPosition(){\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tcolumn.reRegisterPosition();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.registerColumnPosition(this);\r\n\t\t}\r\n\t}\r\n\r\n\t_mapDepricatedFunctionality(){\r\n\t\t//all previously deprecated functionality removed in the 5.0 release\r\n\t}\r\n\r\n\t//build header element\r\n\t_initialize(){\r\n\t\tvar def = this.definition;\r\n\r\n\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\r\n\t\tif(def.headerVertical){\r\n\t\t\tthis.element.classList.add(\"tabulator-col-vertical\");\r\n\r\n\t\t\tif(def.headerVertical === \"flip\"){\r\n\t\t\t\tthis.element.classList.add(\"tabulator-col-vertical-flip\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.contentElement = this._buildColumnHeaderContent();\r\n\r\n\t\tthis.element.appendChild(this.contentElement);\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis._buildGroupHeader();\r\n\t\t}else{\r\n\t\t\tthis._buildColumnHeader();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-init\", this);\r\n\t}\r\n\r\n\t//build header element for header\r\n\t_buildColumnHeader(){\r\n\t\tvar def = this.definition,\r\n\t\ttable = this.table;\r\n\r\n\t\tthis.dispatch(\"column-layout\", this);\r\n\r\n\t\t//set column visibility\r\n\t\tif(typeof def.visible != \"undefined\"){\r\n\t\t\tif(def.visible){\r\n\t\t\t\tthis.show(true);\r\n\t\t\t}else{\r\n\t\t\t\tthis.hide(true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//asign additional css classes to column header\r\n\t\tif(def.cssClass){\r\n\t\t\tvar classeNames = def.cssClass.split(\" \");\r\n\t\t\tclasseNames.forEach((className) => {\r\n\t\t\t\tthis.element.classList.add(className);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(def.field){\r\n\t\t\tthis.element.setAttribute(\"tabulator-field\", def.field);\r\n\t\t}\r\n\r\n\t\t//set min width if present\r\n\t\tthis.setMinWidth(parseInt(def.minWidth));\r\n\r\n\t\tif (def.maxInitialWidth) {\r\n\t\t\tthis.maxInitialWidth = parseInt(def.maxInitialWidth);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.maxWidth){\r\n\t\t\tthis.setMaxWidth(parseInt(def.maxWidth));\r\n\t\t}\r\n\r\n\t\tthis.reinitializeWidth();\r\n\r\n\t\t//set orizontal text alignment\r\n\t\tthis.hozAlign = this.definition.hozAlign;\r\n\t\tthis.vertAlign = this.definition.vertAlign;\r\n\r\n\t\tthis.titleElement.style.textAlign = this.definition.headerHozAlign;\r\n\t}\r\n\r\n\t_buildColumnHeaderContent(){\r\n\t\tvar def = this.definition,\r\n\t\ttable = this.table;\r\n\r\n\t\tvar contentElement = document.createElement(\"div\");\r\n\t\tcontentElement.classList.add(\"tabulator-col-content\");\r\n\r\n\t\tthis.titleHolderElement = document.createElement(\"div\");\r\n\t\tthis.titleHolderElement.classList.add(\"tabulator-col-title-holder\");\r\n\r\n\t\tcontentElement.appendChild(this.titleHolderElement);\r\n\r\n\t\tthis.titleElement = this._buildColumnHeaderTitle();\r\n\r\n\t\tthis.titleHolderElement.appendChild(this.titleElement);\r\n\r\n\t\treturn contentElement;\r\n\t}\r\n\r\n\t//build title element of column\r\n\t_buildColumnHeaderTitle(){\r\n\t\tvar def = this.definition,\r\n\t\ttitle;\r\n\r\n\t\tvar titleHolderElement = document.createElement(\"div\");\r\n\t\ttitleHolderElement.classList.add(\"tabulator-col-title\");\r\n\r\n\t\tif(def.editableTitle){\r\n\t\t\tvar titleElement = document.createElement(\"input\");\r\n\t\t\ttitleElement.classList.add(\"tabulator-title-editor\");\r\n\r\n\t\t\ttitleElement.addEventListener(\"click\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\ttitleElement.focus();\r\n\t\t\t});\r\n\r\n\t\t\ttitleElement.addEventListener(\"change\", () => {\r\n\t\t\t\tdef.title = titleElement.value;\r\n\t\t\t\tthis.dispatchExternal(\"columnTitleChanged\", this.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\ttitleHolderElement.appendChild(titleElement);\r\n\r\n\t\t\tif(def.field){\r\n\t\t\t\tthis.langBind(\"columns|\" + def.field, (text) => {\r\n\t\t\t\t\ttitleElement.value = text || (def.title || \" \");\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\ttitleElement.value = def.title || \" \";\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tif(def.field){\r\n\t\t\t\tthis.langBind(\"columns|\" + def.field, (text) => {\r\n\t\t\t\t\tthis._formatColumnHeaderTitle(titleHolderElement, text || (def.title || \" \"));\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tthis._formatColumnHeaderTitle(titleHolderElement, def.title || \" \");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn titleHolderElement;\r\n\t}\r\n\r\n\t_formatColumnHeaderTitle(el, title){\r\n\t\tvar contents = this.chain(\"column-format\", [this, title, el], null, () => {\r\n\t\t\treturn title;\r\n\t\t});\r\n\r\n\t\tswitch(typeof contents){\r\n\t\t\tcase \"object\":\r\n\t\t\tif(contents instanceof Node){\r\n\t\t\t\tel.appendChild(contents);\r\n\t\t\t}else{\r\n\t\t\t\tel.innerHTML = \"\";\r\n\t\t\t\tconsole.warn(\"Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:\", contents);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\tcase \"undefined\":\r\n\t\t\tel.innerHTML = \"\";\r\n\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\tel.innerHTML = contents;\r\n\t\t}\r\n\t}\r\n\r\n\t//build header element for column group\r\n\t_buildGroupHeader(){\r\n\t\tthis.element.classList.add(\"tabulator-col-group\");\r\n\t\tthis.element.setAttribute(\"role\", \"columngroup\");\r\n\t\tthis.element.setAttribute(\"aria-title\", this.definition.title);\r\n\r\n\t\t//asign additional css classes to column header\r\n\t\tif(this.definition.cssClass){\r\n\t\t\tvar classeNames = this.definition.cssClass.split(\" \");\r\n\t\t\tclasseNames.forEach((className) => {\r\n\t\t\t\tthis.element.classList.add(className);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.titleElement.style.textAlign = this.definition.headerHozAlign;\r\n\r\n\t\tthis.element.appendChild(this.groupElement);\r\n\t}\r\n\r\n\t//flat field lookup\r\n\t_getFlatData(data){\r\n\t\treturn data[this.field];\r\n\t}\r\n\r\n\t//nested field lookup\r\n\t_getNestedData(data){\r\n\t\tvar dataObj = data,\r\n\t\tstructure = this.fieldStructure,\r\n\t\tlength = structure.length,\r\n\t\toutput;\r\n\r\n\t\tfor(let i = 0; i < length; i++){\r\n\r\n\t\t\tdataObj = dataObj[structure[i]];\r\n\r\n\t\t\toutput = dataObj;\r\n\r\n\t\t\tif(!dataObj){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//flat field set\r\n\t_setFlatData(data, value){\r\n\t\tif(this.field){\r\n\t\t\tdata[this.field] = value;\r\n\t\t}\r\n\t}\r\n\r\n\t//nested field set\r\n\t_setNestedData(data, value){\r\n\t\tvar dataObj = data,\r\n\t\tstructure = this.fieldStructure,\r\n\t\tlength = structure.length;\r\n\r\n\t\tfor(let i = 0; i < length; i++){\r\n\r\n\t\t\tif(i == length -1){\r\n\t\t\t\tdataObj[structure[i]] = value;\r\n\t\t\t}else{\r\n\t\t\t\tif(!dataObj[structure[i]]){\r\n\t\t\t\t\tif(typeof value !== \"undefined\"){\r\n\t\t\t\t\t\tdataObj[structure[i]] = {};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdataObj = dataObj[structure[i]];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//attach column to this group\r\n\tattachColumn(column){\r\n\t\tif(this.groupElement){\r\n\t\t\tthis.columns.push(column);\r\n\t\t\tthis.groupElement.appendChild(column.getElement());\r\n\r\n\t\t\tcolumn.columnRendered();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Warning - Column being attached to another column instead of column group\");\r\n\t\t}\r\n\t}\r\n\r\n\t//vertically align header in column\r\n\tverticalAlign(alignment, height){\r\n\r\n\t\t//calculate height of column header and group holder element\r\n\t\tvar parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : (height || this.parent.getHeadersElement().clientHeight);\r\n\t\t// var parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : this.parent.getHeadersElement().clientHeight;\r\n\r\n\t\tthis.element.style.height = parentHeight + \"px\";\r\n\r\n\t\tthis.dispatch(\"column-height\", this, this.element.style.height);\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.groupElement.style.minHeight = (parentHeight - this.contentElement.offsetHeight) + \"px\";\r\n\t\t}\r\n\r\n\t\t//vertically align cell contents\r\n\t\tif(!this.isGroup && alignment !== \"top\"){\r\n\t\t\tif(alignment === \"bottom\"){\r\n\t\t\t\tthis.element.style.paddingTop = (this.element.clientHeight - this.contentElement.offsetHeight) + \"px\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.element.style.paddingTop = ((this.element.clientHeight - this.contentElement.offsetHeight) / 2) + \"px\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.verticalAlign(alignment);\r\n\t\t});\r\n\t}\r\n\r\n\t//clear vertical alignmenet\r\n\tclearVerticalAlign(){\r\n\t\tthis.element.style.paddingTop = \"\";\r\n\t\tthis.element.style.height = \"\";\r\n\t\tthis.element.style.minHeight = \"\";\r\n\t\tthis.groupElement.style.minHeight = \"\";\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.clearVerticalAlign();\r\n\t\t});\r\n\r\n\t\tthis.dispatch(\"column-height\", this, \"\");\r\n\t}\r\n\r\n\tbindModuleColumns (){\r\n\t\t//check if rownum formatter is being used on a column\r\n\t\tif(this.definition.formatter == \"rownum\"){\r\n\t\t\tthis.table.rowManager.rowNumColumn = this;\r\n\t\t}\r\n\t}\r\n\r\n\t//// Retreive Column Information ////\r\n\t//return column header element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\t//return colunm group element\r\n\tgetGroupElement(){\r\n\t\treturn this.groupElement;\r\n\t}\r\n\r\n\t//return field name\r\n\tgetField(){\r\n\t\treturn this.field;\r\n\t}\r\n\r\n\tgetTitleDownload() {\r\n\t\treturn this.titleDownload;\r\n\t}\r\n\r\n\t//return the first column in a group\r\n\tgetFirstColumn(){\r\n\t\tif(!this.isGroup){\r\n\t\t\treturn this;\r\n\t\t}else{\r\n\t\t\tif(this.columns.length){\r\n\t\t\t\treturn this.columns[0].getFirstColumn();\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//return the last column in a group\r\n\tgetLastColumn(){\r\n\t\tif(!this.isGroup){\r\n\t\t\treturn this;\r\n\t\t}else{\r\n\t\t\tif(this.columns.length){\r\n\t\t\t\treturn this.columns[this.columns.length -1].getLastColumn();\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//return all columns in a group\r\n\tgetColumns(){\r\n\t\treturn this.columns;\r\n\t}\r\n\r\n\t//return all columns in a group\r\n\tgetCells(){\r\n\t\treturn this.cells;\r\n\t}\r\n\r\n\t//retreive the top column in a group of columns\r\n\tgetTopColumn(){\r\n\t\tif(this.parent.isGroup){\r\n\t\t\treturn this.parent.getTopColumn();\r\n\t\t}else{\r\n\t\t\treturn this;\r\n\t\t}\r\n\t}\r\n\r\n\t//return column definition object\r\n\tgetDefinition(updateBranches){\r\n\t\tvar colDefs = [];\r\n\r\n\t\tif(this.isGroup && updateBranches){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tcolDefs.push(column.getDefinition(true));\r\n\t\t\t});\r\n\r\n\t\t\tthis.definition.columns = colDefs;\r\n\t\t}\r\n\r\n\t\treturn this.definition;\r\n\t}\r\n\r\n\t//////////////////// Actions ////////////////////\r\n\tcheckColumnVisibility(){\r\n\t\tvar visible = false;\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvisible = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(visible){\r\n\t\t\tthis.show();\r\n\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), false);\r\n\t\t}else{\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\t//show column\r\n\tshow(silent, responsiveToggle){\r\n\t\tif(!this.visible){\r\n\t\t\tthis.visible = true;\r\n\r\n\t\t\tthis.element.style.display = \"\";\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.checkColumnVisibility();\r\n\t\t\t}\r\n\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.show();\r\n\t\t\t});\r\n\r\n\t\t\tif(!this.isGroup && this.width === null){\r\n\t\t\t\tthis.reinitializeWidth();\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.columnManager.verticalAlignHeaders();\r\n\r\n\t\t\tthis.dispatch(\"column-show\", this, responsiveToggle);\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), true);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\r\n\t\t\tif(!this.silent){\r\n\t\t\t\tthis.table.columnManager.renderer.rerenderColumns();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//hide column\r\n\thide(silent, responsiveToggle){\r\n\t\tif(this.visible){\r\n\t\t\tthis.visible = false;\r\n\r\n\t\t\tthis.element.style.display = \"none\";\r\n\r\n\t\t\tthis.table.columnManager.verticalAlignHeaders();\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.checkColumnVisibility();\r\n\t\t\t}\r\n\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.hide();\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatch(\"column-hide\", this, responsiveToggle);\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), false);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\r\n\t\t\tif(!this.silent){\r\n\t\t\t\tthis.table.columnManager.renderer.rerenderColumns();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmatchChildWidths(){\r\n\t\tvar childWidth = 0;\r\n\r\n\t\tif(this.contentElement && this.columns.length){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tif(column.visible){\r\n\t\t\t\t\tchildWidth += column.getWidth();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.contentElement.style.maxWidth = (childWidth - 1) + \"px\";\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tremoveChild(child){\r\n\t\tvar index = this.columns.indexOf(child);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.columns.splice(index, 1);\r\n\t\t}\r\n\r\n\t\tif(!this.columns.length){\r\n\t\t\tthis.delete();\r\n\t\t}\r\n\t}\r\n\r\n\tsetWidth(width){\r\n\t\tthis.widthFixed = true;\r\n\t\tthis.setWidthActual(width);\r\n\t}\r\n\r\n\tsetWidthActual(width){\r\n\t\tif(isNaN(width)){\r\n\t\t\twidth = Math.floor((this.table.element.clientWidth/100) * parseInt(width));\r\n\t\t}\r\n\r\n\t\twidth = Math.max(this.minWidth, width);\r\n\r\n\t\tif(this.maxWidth){\r\n\t\t\twidth = Math.min(this.maxWidth, width);\r\n\t\t}\r\n\r\n\t\tthis.width = width;\r\n\t\tthis.widthStyled = width ? width + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.width = this.widthStyled;\r\n\r\n\t\tif(!this.isGroup){\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.setWidth();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.parent.isGroup){\r\n\t\t\tthis.parent.matchChildWidths();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-width\", this);\r\n\t}\r\n\r\n\tcheckCellHeights(){\r\n\t\tvar rows = [];\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tif(cell.row.heightInitialized){\r\n\t\t\t\tif(cell.row.getElement().offsetParent !== null){\r\n\t\t\t\t\trows.push(cell.row);\r\n\t\t\t\t\tcell.row.clearCellHeight();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcell.row.heightInitialized = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\trow.calcHeight();\r\n\t\t});\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\trow.setCellHeight();\r\n\t\t});\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\tvar width = 0;\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tif(column.visible){\r\n\t\t\t\t\twidth += column.getWidth();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\twidth = this.width;\r\n\t\t}\r\n\r\n\t\treturn width;\r\n\t}\r\n\r\n\tgetHeight(){\r\n\t\treturn Math.ceil(this.element.getBoundingClientRect().height);\r\n\t}\r\n\r\n\tsetMinWidth(minWidth){\r\n\t\tthis.minWidth = minWidth;\r\n\t\tthis.minWidthStyled = minWidth ? minWidth + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.minWidth = this.minWidthStyled;\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setMinWidth();\r\n\t\t});\r\n\t}\r\n\r\n\tsetMaxWidth(maxWidth){\r\n\t\tthis.maxWidth = maxWidth;\r\n\t\tthis.maxWidthStyled = maxWidth ? maxWidth + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.maxWidth = this.maxWidthStyled;\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setMaxWidth();\r\n\t\t});\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar index;\r\n\r\n\t\t\tif(this.isGroup){\r\n\t\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\t\tcolumn.delete();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatch(\"column-delete\", this);\r\n\r\n\t\t\tvar cellCount = this.cells.length;\r\n\r\n\t\t\tfor(let i = 0; i < cellCount; i++){\r\n\t\t\t\tthis.cells[0].delete();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.element.parentNode){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element = false;\r\n\t\t\tthis.contentElement = false;\r\n\t\t\tthis.titleElement = false;\r\n\t\t\tthis.groupElement = false;\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.removeChild(this);\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.columnManager.deregisterColumn(this);\r\n\r\n\t\t\tthis.table.columnManager.renderer.rerenderColumns(true);\r\n\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\r\n\tcolumnRendered(){\r\n\t\tif(this.titleFormatterRendered){\r\n\t\t\tthis.titleFormatterRendered();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-rendered\", this);\r\n\t}\r\n\r\n\t//////////////// Cell Management /////////////////\r\n\t//generate cell for this column\r\n\tgenerateCell(row){\r\n\t\tvar cell = new Cell(this, row);\r\n\r\n\t\tthis.cells.push(cell);\r\n\r\n\t\treturn cell;\r\n\t}\r\n\r\n\tnextColumn(){\r\n\t\tvar index = this.table.columnManager.findColumnIndex(this);\r\n\t\treturn index > -1 ? this._nextVisibleColumn(index + 1) : false;\r\n\t}\r\n\r\n\t_nextVisibleColumn(index){\r\n\t\tvar column = this.table.columnManager.getColumnByIndex(index);\r\n\t\treturn !column || column.visible ? column : this._nextVisibleColumn(index + 1);\r\n\t}\r\n\r\n\tprevColumn(){\r\n\t\tvar index = this.table.columnManager.findColumnIndex(this);\r\n\t\treturn index > -1 ? this._prevVisibleColumn(index - 1) : false;\r\n\t}\r\n\r\n\t_prevVisibleColumn(index){\r\n\t\tvar column = this.table.columnManager.getColumnByIndex(index);\r\n\t\treturn !column || column.visible ? column : this._prevVisibleColumn(index - 1);\r\n\t}\r\n\r\n\treinitializeWidth(force){\r\n\t\tthis.widthFixed = false;\r\n\r\n\t\t//set width if present\r\n\t\tif(typeof this.definition.width !== \"undefined\" && !force){\r\n\t\t\t// maxInitialWidth ignored here as width specified\r\n\t\t\tthis.setWidth(this.definition.width);\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-width-fit-before\", this);\r\n\r\n\t\tthis.fitToData(force);\r\n\r\n\t\tthis.dispatch(\"column-width-fit-after\", this);\r\n\t}\r\n\r\n\t//set column width to maximum cell width for non group columns\r\n\tfitToData(force){\r\n\t\tif(this.isGroup){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(!this.widthFixed){\r\n\t\t\tthis.element.style.width = \"\";\r\n\r\n\t\t\tthis.cells.forEach((cell) => {\r\n\t\t\t\tcell.clearWidth();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tvar maxWidth = this.element.offsetWidth;\r\n\r\n\t\tif(!this.width || !this.widthFixed){\r\n\t\t\tthis.cells.forEach((cell) => {\r\n\t\t\t\tvar width = cell.getWidth();\r\n\r\n\t\t\t\tif(width > maxWidth){\r\n\t\t\t\t\tmaxWidth = width;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(maxWidth){\r\n\t\t\t\tvar setTo = maxWidth + 1;\r\n\t\t\t\tif (this.maxInitialWidth && !force) {\r\n\t\t\t\t\tsetTo = Math.min(setTo, this.maxInitialWidth);\r\n\t\t\t\t}\r\n\t\t\t\tthis.setWidthActual(setTo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdateDefinition(updates){\r\n\t\tvar definition;\r\n\r\n\t\tif(!this.isGroup){\r\n\t\t\tif(!this.parent.isGroup){\r\n\t\t\t\tdefinition = Object.assign({}, this.getDefinition());\r\n\t\t\t\tdefinition = Object.assign(definition, updates);\r\n\r\n\t\t\t\treturn this.table.columnManager.addColumn(definition, false, this)\r\n\t\t\t\t.then((column) => {\r\n\r\n\t\t\t\t\tif(definition.field == this.field){\r\n\t\t\t\t\t\tthis.field = false; //cleair field name to prevent deletion of duplicate column from arrays\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn this.delete()\r\n\t\t\t\t\t.then(() => {\r\n\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Column Update Error - The updateDefinition function is only available on ungrouped columns\");\r\n\t\t\t\treturn Promise.reject(\"Column Update Error - The updateDefinition function is only available on columns, not column groups\");\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Column Update Error - The updateDefinition function is only available on ungrouped columns\");\r\n\t\t\treturn Promise.reject(\"Column Update Error - The updateDefinition function is only available on columns, not column groups\");\r\n\t\t}\r\n\t}\r\n\r\n\tdeleteCell(cell){\r\n\t\tvar index = this.cells.indexOf(cell);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.cells.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new ColumnComponent(this);\r\n\t\t}\r\n\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n\r\nColumn.defaultOptionList = defaultOptions;\r\n\r\nexport default Column;\r\n","export default class Helpers{\r\n\r\n\tstatic elVisible(el){\r\n\t\treturn !(el.offsetWidth <= 0 && el.offsetHeight <= 0);\r\n\t}\r\n\r\n\tstatic elOffset(el){\r\n\t\tvar box = el.getBoundingClientRect();\r\n\r\n\t\treturn {\r\n\t\t\ttop: box.top + window.pageYOffset - document.documentElement.clientTop,\r\n\t\t\tleft: box.left + window.pageXOffset - document.documentElement.clientLeft\r\n\t\t};\r\n\t}\r\n\r\n\tstatic deepClone(obj, clone, list = []){\r\n\t\tvar objectProto = {}.__proto__,\r\n\t\tarrayProto = [].__proto__;\r\n\r\n\t\tif (!clone){\r\n\t\t\tclone = Object.assign(Array.isArray(obj) ? [] : {}, obj);\r\n\t\t}\r\n\r\n\t\tfor(var i in obj) {\r\n\t\t\tlet subject = obj[i],\r\n\t\t\tmatch, copy;\r\n\r\n\t\t\tif(subject != null && typeof subject === \"object\" && (subject.__proto__ === objectProto || subject.__proto__ === arrayProto)){\r\n\t\t\t\tmatch = list.findIndex((item) => {\r\n\t\t\t\t\treturn item.subject === subject;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(match > -1){\r\n\t\t\t\t\tclone[i] = list[match].copy;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcopy = Object.assign(Array.isArray(subject) ? [] : {}, subject);\r\n\r\n\t\t\t\t\tlist.unshift({subject, copy});\r\n\r\n\t\t\t\t\tclone[i] = this.deepClone(subject, copy, list);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn clone;\r\n\t}\r\n}","export default class OptionsList {\r\n\tconstructor(table, msgType, defaults = {}){\r\n\t\tthis.table = table;\r\n\t\tthis.msgType = msgType;\r\n\t\tthis.registeredDefaults = Object.assign({}, defaults)\r\n\t}\r\n\r\n\tregister(option, value){\r\n\t\tthis.registeredDefaults[option] = value;\r\n\t}\r\n\r\n\tgenerate(defaultOptions, userOptions = {}){\r\n\t\tvar output = Object.assign({}, this.registeredDefaults);\r\n\r\n\t\tObject.assign(output, defaultOptions);\r\n\r\n\t\tif(userOptions.debugInvalidOptions !== false || this.table.options.debugInvalidOptions){\r\n\t\t\tfor (var key in userOptions){\r\n\t\t\t\tif(!output.hasOwnProperty(key)){\r\n\t\t\t\t\tconsole.warn(\"Invalid \" + this.msgType + \" option:\", key)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (var key in output){\r\n\t\t\tif(key in userOptions){\r\n\t\t\t\toutput[key] = userOptions[key];\r\n\t\t\t}else{\r\n\t\t\t\tif(Array.isArray(output[key])){\r\n\t\t\t\t\toutput[key] = Object.assign([], output[key]);\r\n\t\t\t\t}else if(typeof output[key] === \"object\" && output[key] !== null){\r\n\t\t\t\t\toutput[key] = Object.assign({}, output[key]);\r\n\t\t\t\t}else if (typeof output[key] === \"undefined\"){\r\n\t\t\t\t\tdelete output[key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from '../tools/Helpers.js';\r\n\r\nexport default class Renderer extends CoreFeature{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.elementVertical = table.rowManager.element;\r\n\t\tthis.elementHorizontal = table.columnManager.element;\r\n\t\tthis.tableElement = table.rowManager.tableElement;\r\n\r\n\t\tthis.verticalFillMode = \"fit\"; // used by row manager to determin how to size the render area (\"fit\" - fits container to the contents, \"fill\" - fills the contianer without resizing it)\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t/////// Internal Bindings /////////\r\n\t///////////////////////////////////\r\n\r\n\tinitialize(){\r\n\t\t//initialize core functionality\r\n\t}\r\n\r\n\tclearRows(){\r\n\t\t//clear down existing rows layout\r\n\t}\r\n\r\n\tclearColumns(){\r\n\t\t//clear down existing columns layout\r\n\t}\r\n\r\n\r\n\treinitializeColumnWidths(columns){\r\n\t\t//resize columns to fit data\r\n\t}\r\n\r\n\r\n\trenderRows(){\r\n\t\t//render rows from a clean slate\r\n\t}\r\n\r\n\trenderColumns(){\r\n\t\t//render columns from a clean slate\r\n\t}\r\n\r\n\trerenderRows(callback){\r\n\t\t// rerender rows and keep position\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\t}\r\n\r\n\trerenderColumns(update, blockRedraw){\r\n\t\t//rerender columns\r\n\t}\r\n\r\n\trenderRowCells(row){\r\n\t\t//render the cells in a row\r\n\t}\r\n\r\n\trerenderRowCells(row, force){\r\n\t\t//rerender the cells in a row\r\n\t}\r\n\r\n\tscrollColumns(left, dir){\r\n\t\t//handle horizontal scrolling\r\n\t}\r\n\r\n\tscrollRows(top, dir){\r\n\t\t//handle vertical scolling\r\n\t}\r\n\r\n\tresize(){\r\n\t\t//container has rezied, carry out any needed recalculations (DO NOT RERENDER IN THIS FUNCTION)\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\t//scroll to a specific row\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\t//determine weather the row is nearest the top or bottom of the table, retur true for top or false for bottom\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\t//return the visible rows\r\n\t\treturn [];\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t//////// Helper Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\trows(){\r\n\t\treturn this.table.rowManager.getDisplayRows();\r\n\t}\r\n\r\n\tstyleRow(row, index){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tif(index % 2){\r\n\t\t\trowEl.classList.add(\"tabulator-row-even\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-odd\");\r\n\t\t}else{\r\n\t\t\trowEl.classList.add(\"tabulator-row-odd\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-even\");\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t/////// External Triggers /////////\r\n\t/////// (DO NOT OVERRIDE) /////////\r\n\t///////////////////////////////////\r\n\r\n\tclear(){\r\n\t\t//clear down existing layout\r\n\t\tthis.clearRows();\r\n\t\tthis.clearColumns();\r\n\t}\r\n\r\n\trender(){\r\n\t\t//render from a clean slate\r\n\t\tthis.renderRows();\r\n\t\tthis.renderColumns();\r\n\t}\r\n\r\n\trerender(callback){\r\n\t\t// rerender and keep position\r\n\t\tthis.rerenderRows();\r\n\t\tthis.rerenderColumns();\r\n\t}\r\n\r\n\tscrollToRowPosition(row, position, ifVisible){\r\n\t\tvar rowIndex = this.rows().indexOf(row),\r\n\t\trowEl = row.getElement(),\r\n\t\toffset = 0;\r\n\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tif(rowIndex > -1){\r\n\r\n\t\t\t\tif(typeof ifVisible === \"undefined\"){\r\n\t\t\t\t\tifVisible = this.table.options.scrollToRowIfVisible;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//check row visibility\r\n\t\t\t\tif(!ifVisible){\r\n\t\t\t\t\tif(Helpers.elVisible(rowEl)){\r\n\t\t\t\t\t\toffset = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(offset > 0 && offset < this.elementVertical.clientHeight - rowEl.offsetHeight){\r\n\t\t\t\t\t\t\tresolve();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(typeof position === \"undefined\"){\r\n\t\t\t\t\tposition = this.table.options.scrollToRowPosition;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(position === \"nearest\"){\r\n\t\t\t\t\tposition = this.scrollToRowNearestTop(row) ? \"top\" : \"bottom\"\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//scroll to row\r\n\t\t\t\tthis.scrollToRow(row);\r\n\r\n\t\t\t\t//align to correct position\r\n\t\t\t\tswitch(position){\r\n\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\tcase \"center\":\r\n\r\n\t\t\t\t\tif(this.elementVertical.scrollHeight - this.elementVertical.scrollTop == this.elementVertical.clientHeight){\r\n\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop + (rowEl.offsetTop - this.elementVertical.scrollTop) - ((this.elementVertical.scrollHeight - rowEl.offsetTop) / 2);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - (this.elementVertical.clientHeight / 2);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"bottom\":\r\n\r\n\t\t\t\t\tif(this.elementVertical.scrollHeight - this.elementVertical.scrollTop == this.elementVertical.clientHeight){\r\n\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - (this.elementVertical.scrollHeight - rowEl.offsetTop) + rowEl.offsetHeight;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - this.elementVertical.clientHeight + rowEl.offsetHeight;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"top\":\r\n\t\t\t\t\tthis.elementVertical.scrollTop = rowEl.offsetTop;\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tresolve();\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - Row not visible\");\r\n\t\t\t\treject(\"Scroll Error - Row not visible\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class BaiscHorizontal extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t}\r\n\r\n\trenderRowCells(row){\r\n\t\trow.cells.forEach((cell) => {\r\n\t\t\trow.element.appendChild(cell.getElement());\r\n\t\t\tcell.cellRendered();\r\n\t\t});\r\n\t}\r\n\r\n\treinitializeColumnWidths(columns){\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t});\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class VirtualDomHorizontal extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.leftCol = 0;\r\n\t\tthis.rightCol = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = 0;\r\n\t\tthis.vDomScrollPosRight = 0;\r\n\t\t\r\n\t\tthis.vDomPadLeft = 0;\r\n\t\tthis.vDomPadRight = 0;\r\n\t\t\r\n\t\tthis.fitDataColAvg = 0;\r\n\t\t\r\n\t\tthis.windowBuffer = 200; //pixel margin to make column visible before it is shown on screen\r\n\t\t\r\n\t\tthis.visibleRows = null;\r\n\r\n\t\tthis.initialized = false;\r\n\t\tthis.isFitData = false;\r\n\t\t\r\n\t\tthis.columns = [];\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.compatibilityCheck();\r\n\t\tthis.layoutCheck();\r\n\t\tthis.vertScrollListen();\r\n\t}\r\n\t\r\n\tcompatibilityCheck(){\r\n\t\tvar columns = this.options(\"columns\"),\r\n\t\tfrozen = false,\r\n\t\tok = true;\r\n\t\t\r\n\t\tif(this.options(\"layout\") == \"fitDataTable\"){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with fitDataTable layout mode\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.options(\"responsiveLayout\")){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with responsive columns\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.options(\"rtl\")){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not currently compatible with RTL text direction\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(columns){\r\n\t\t\tfrozen = columns.find((col) => {\r\n\t\t\t\treturn col.frozen;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(frozen){\r\n\t\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with frozen columns\");\r\n\t\t\t\tok = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// if(!ok){\r\n\t\t// \toptions.virtualDomHoz = false;\r\n\t\t// }\r\n\t\t\r\n\t\treturn ok;\r\n\t}\r\n\t\r\n\tlayoutCheck(){\r\n\t\tthis.isFitData = this.options(\"layout\").startsWith('fitData');\r\n\t}\r\n\r\n\tvertScrollListen(){\r\n\t\tthis.subscribe(\"scroll-vertical\", this.clearVisRowCache.bind(this));\r\n\t\tthis.subscribe(\"data-refreshed\", this.clearVisRowCache.bind(this));\r\n\t}\r\n\r\n\tclearVisRowCache(){\r\n\t\tthis.visibleRows = null;\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t///////// Public Functions ///////////\r\n\t//////////////////////////////////////\r\n\t\r\n\trenderColumns(row, force){\r\n\t\tthis.dataChange();\r\n\t}\r\n\r\n\t\r\n\tscrollColumns(left, dir){\r\n\t\tif(this.scrollLeft != left){\r\n\t\t\tthis.scrollLeft = left;\r\n\t\t\t\r\n\t\t\tthis.scroll(left - (this.vDomScrollPosLeft + this.windowBuffer));\r\n\t\t}\r\n\t}\r\n\t\r\n\tcalcWindowBuffer(){\r\n\t\tvar buffer = this.elementVertical.clientWidth;\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvar width = column.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tif(width > buffer){\r\n\t\t\t\t\tbuffer = width;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.windowBuffer = buffer * 2;\r\n\t}\r\n\t\r\n\trerenderColumns(update, blockRedraw){\t\t\r\n\t\tvar old = {\r\n\t\t\tcols:this.columns,\r\n\t\t\tleftCol:this.leftCol,\r\n\t\t\trightCol:this.rightCol,\r\n\t\t},\r\n\t\tcolPos = 0;\r\n\t\t\r\n\t\t\r\n\t\tif(update && !this.initialized){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tthis.clear();\r\n\t\t\r\n\t\tthis.calcWindowBuffer();\r\n\t\t\r\n\t\tthis.scrollLeft = this.elementVertical.scrollLeft;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = this.scrollLeft - this.windowBuffer;\r\n\t\tthis.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.windowBuffer;\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tvar config = {};\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvar width = column.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tconfig.leftPos = colPos;\r\n\t\t\t\tconfig.rightPos = colPos + width;\r\n\t\t\t\t\r\n\t\t\t\tconfig.width = width;\r\n\t\t\t\t\r\n\t\t\t\tif (this.isFitData) {\r\n\t\t\t\t\tconfig.fitDataCheck = column.modules.vdomHoz ? column.modules.vdomHoz.fitDataCheck : true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif((colPos + width > this.vDomScrollPosLeft) && (colPos < this.vDomScrollPosRight)){\r\n\t\t\t\t\t//column is visible\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.leftCol == -1){\r\n\t\t\t\t\t\tthis.leftCol = this.columns.length;\r\n\t\t\t\t\t\tthis.vDomPadLeft = colPos;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.rightCol = this.columns.length;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t// column is hidden\r\n\t\t\t\t\tif(this.leftCol !== -1){\r\n\t\t\t\t\t\tthis.vDomPadRight += width;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.columns.push(column);\r\n\t\t\t\t\r\n\t\t\t\tcolumn.modules.vdomHoz = config;\r\n\t\t\t\t\r\n\t\t\t\tcolPos += width;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t\r\n\t\tthis.initialized = true;\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tif(!update || this.reinitChanged(old)){\r\n\t\t\t\tthis.reinitializeRows();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.elementVertical.scrollLeft = this.scrollLeft;\r\n\t}\r\n\t\r\n\trenderRowCells(row){\r\n\t\tif(this.initialized){\r\n\t\t\tthis.initializeRow(row);\r\n\t\t}else{\r\n\t\t\trow.cells.forEach((cell) => {\r\n\t\t\t\trow.element.appendChild(cell.getElement());\r\n\t\t\t\tcell.cellRendered();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\trerenderRowCells(row, force){\r\n\t\tthis.reinitializeRow(row, force);\r\n\t}\r\n\t\r\n\treinitializeColumnWidths(columns){\r\n\t\tfor(let i = this.leftCol; i <= this.rightCol; i++){\r\n\t\t\tthis.columns[i].reinitializeWidth();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t//////// Internal Rendering //////////\r\n\t//////////////////////////////////////\r\n\t\r\n\tdeinitialize(){\r\n\t\tthis.initialized = false;\r\n\t}\r\n\t\r\n\tclear(){\r\n\t\tthis.columns = [];\r\n\t\t\r\n\t\tthis.leftCol = -1;\r\n\t\tthis.rightCol = 0;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = 0;\r\n\t\tthis.vDomScrollPosRight = 0;\r\n\t\tthis.vDomPadLeft = 0;\r\n\t\tthis.vDomPadRight = 0;\r\n\t}\r\n\t\r\n\tdataChange(){\r\n\t\tvar change = false,\r\n\t\tcollsWidth = 0,\r\n\t\tcolEnd = 0,\r\n\t\tgroup, row, rowEl;\r\n\t\t\r\n\t\tif(this.isFitData){\r\n\t\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\t\tif(!column.definition.width && column.visible){\r\n\t\t\t\t\tchange = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(change){\r\n\t\t\t\tif(change && this.table.rowManager.getDisplayRows().length){\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.windowBuffer;\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar row = this.chain(\"rows-sample\", [1], [], () => {\r\n\t\t\t\t\t\treturn this.table.rowManager.getDisplayRows();\r\n\t\t\t\t\t})[0];\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trowEl = row.getElement();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trow.generateCells();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.tableElement.appendChild(rowEl);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor(var colEnd = 0; colEnd < row.cells.length; colEnd++){\r\n\t\t\t\t\t\t\tlet cell = row.cells[colEnd];\r\n\t\t\t\t\t\t\trowEl.appendChild(cell.getElement());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcell.column.reinitializeWidth();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcollsWidth += cell.column.getWidth();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// if(collsWidth > this.vDomScrollPosRight){\r\n\t\t\t\t\t\t\t// \tbreak;\r\n\t\t\t\t\t\t\t// }\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// this.fitDataColAvg = Math.floor(collsWidth / (colEnd + 1));\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// for(colEnd; colEnd < this.table.columnManager.columnsByIndex.length; colEnd++){\r\n\t\t\t\t\t\t// \tthis.table.columnManager.columnsByIndex[colEnd].setWidth(this.fitDataColAvg);\r\n\t\t\t\t\t\t// }\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.rerenderColumns(false, true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.options(\"layout\") === \"fitColumns\"){\r\n\t\t\t\tthis.layoutRefresh();\r\n\t\t\t\tthis.rerenderColumns(false, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitChanged(old){\r\n\t\tvar match = true;\r\n\t\t\r\n\t\tif(old.cols.length !== this.columns.length || old.leftCol !== this.leftCol || old.rightCol !== this.rightCol){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\told.cols.forEach((col, i) => {\r\n\t\t\tif(col !== this.columns[i]){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn !match;\r\n\t}\r\n\t\r\n\treinitializeRows(){\r\n\t\tvar rows = this.getVisibleRows();\r\n\t\trows.forEach((row) => {\r\n\t\t\tthis.reinitializeRow(row, true);\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetVisibleRows(){\r\n\t\tif (!this.visibleRows){\r\n\t\t\tthis.visibleRows = this.table.rowManager.getVisibleRows();\r\n\t\t}\r\n\r\n\t\treturn this.visibleRows;\t\r\n\t}\r\n\t\r\n\tscroll(diff){\r\n\t\tthis.vDomScrollPosLeft += diff;\r\n\t\tthis.vDomScrollPosRight += diff;\r\n\r\n\t\tif(Math.abs(diff) > (this.windowBuffer / 2)){\r\n\t\t\tthis.rerenderColumns();\r\n\t\t}else{\r\n\t\t\tif(diff > 0){\r\n\t\t\t\t//scroll right\r\n\t\t\t\tthis.addColRight();\r\n\t\t\t\tthis.removeColLeft();\r\n\t\t\t}else{\r\n\t\t\t\t//scroll left\r\n\t\t\t\tthis.addColLeft();\r\n\t\t\t\tthis.removeColRight();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolPositionAdjust (start, end, diff){\r\n\t\tfor(let i = start; i < end; i++){\r\n\t\t\tlet column = this.columns[i];\r\n\t\t\t\r\n\t\t\tcolumn.modules.vdomHoz.leftPos += diff;\r\n\t\t\tcolumn.modules.vdomHoz.rightPos += diff;\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColRight(){\r\n\t\tvar changes = false;\r\n\t\t\r\n\t\twhile(true){\r\n\t\t\t\r\n\t\t\tlet column = this.columns[this.rightCol + 1];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.leftPos <= this.vDomScrollPosRight){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\trow.getElement().appendChild(cell.getElement());\r\n\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.fitDataColActualWidthCheck(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.rightCol++; // Don't move this below the >= check below\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.rightCol >= (this.columns.length - 1)){\r\n\t\t\t\t\t\tthis.vDomPadRight = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomPadRight -= column.getWidth();\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColLeft(){\r\n\t\tvar changes = false;\r\n\t\t\r\n\t\twhile(true){\r\n\t\t\tlet column = this.columns[this.leftCol - 1];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.rightPos >= this.vDomScrollPosLeft){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\trow.getElement().prepend(cell.getElement());\r\n\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.leftCol--; // don't move this below the <= check below\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.leftCol <= 0){ // replicating logic in addColRight\r\n\t\t\t\t\t\tthis.vDomPadLeft = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomPadLeft -= column.getWidth();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tlet diff = this.fitDataColActualWidthCheck(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(diff){\r\n\t\t\t\t\t\tthis.scrollLeft = this.elementVertical.scrollLeft = this.elementVertical.scrollLeft + diff;\r\n\t\t\t\t\t\tthis.vDomPadRight -= diff;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveColRight(){\r\n\t\tvar changes = false;\r\n\t\t\r\n\t\twhile(true){\r\n\t\t\tlet column = this.columns[this.rightCol];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.leftPos > this.vDomScrollPosRight){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\trow.getElement().removeChild(cell.getElement());\r\n\t\t\t\t\t\t\t} catch (ex) {\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Could not removeColRight\", ex.message)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.vDomPadRight += column.getWidth();\r\n\t\t\t\t\tthis.rightCol --;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveColLeft(){\r\n\t\tvar changes = false;\r\n\t\t\r\n\t\twhile(true){\r\n\t\t\tlet column = this.columns[this.leftCol];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.rightPos < this.vDomScrollPosLeft){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\t\t\t\t\t\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\trow.getElement().removeChild(cell.getElement());\r\n\t\t\t\t\t\t\t} catch (ex) {\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Could not removeColLeft\", ex.message)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.vDomPadLeft += column.getWidth();\r\n\t\t\t\t\tthis.leftCol ++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\tfitDataColActualWidthCheck(column){\r\n\t\tvar newWidth, widthDiff;\r\n\t\t\r\n\t\tif(column.modules.vdomHoz.fitDataCheck){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t\t\r\n\t\t\tnewWidth = column.getWidth();\r\n\t\t\twidthDiff = newWidth - column.modules.vdomHoz.width;\r\n\t\t\t\r\n\t\t\tif(widthDiff){\r\n\t\t\t\tcolumn.modules.vdomHoz.rightPos += widthDiff;\r\n\t\t\t\tcolumn.modules.vdomHoz.width = newWidth;\r\n\t\t\t\tthis.colPositionAdjust(this.columns.indexOf(column) + 1, this.columns.length, widthDiff);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.vdomHoz.fitDataCheck = false;\r\n\t\t}\r\n\t\t\r\n\t\treturn widthDiff;\r\n\t}\r\n\t\r\n\tinitializeRow(row){\r\n\t\tif(row.type !== \"group\"){\r\n\t\t\trow.modules.vdomHoz = {\r\n\t\t\t\tleftCol:this.leftCol,\r\n\t\t\t\trightCol:this.rightCol,\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tfor(let i = this.leftCol; i <= this.rightCol; i++){\r\n\t\t\t\tlet column = this.columns[i];\r\n\t\t\t\t\r\n\t\t\t\tif(column && column.visible){\r\n\t\t\t\t\tlet cell = row.getCell(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\trow.getElement().appendChild(cell.getElement());\r\n\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeRow(row, force){\r\n\t\tif(row.type !== \"group\"){\r\n\t\t\tif(force || !row.modules.vdomHoz || row.modules.vdomHoz.leftCol !== this.leftCol || row.modules.vdomHoz.rightCol !== this.rightCol){\r\n\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\twhile(rowEl.firstChild) rowEl.removeChild(rowEl.firstChild);\r\n\t\t\t\t\r\n\t\t\t\tthis.initializeRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Column from './column/Column.js';\r\nimport ColumnComponent from './column/ColumnComponent.js';\r\nimport Helpers from './tools/Helpers.js';\r\nimport OptionsList from './tools/OptionsList.js';\r\n\r\nimport RendererBasicHorizontal from './rendering/renderers/BasicHorizontal.js';\r\nimport RendererVirtualDomHorizontal from './rendering/renderers/VirtualDomHorizontal.js';\r\n\r\nimport defaultColumnOptions from './column/defaults/options.js';\r\n\r\nexport default class ColumnManager extends CoreFeature {\r\n\r\n\tconstructor (table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.blockHozScrollEvent = false;\r\n\t\tthis.headersElement = null;\r\n\t\tthis.element = null ; //containing element\r\n\t\tthis.columns = []; // column definition object\r\n\t\tthis.columnsByIndex = []; //columns by index\r\n\t\tthis.columnsByField = {}; //columns by field\r\n\t\tthis.scrollLeft = 0;\r\n\t\tthis.optionsList = new OptionsList(this.table, \"column definition\", defaultColumnOptions);\r\n\r\n\t\tthis.renderer = null;\r\n\t}\r\n\r\n\t////////////// Setup Functions /////////////////\r\n\r\n\tinitialize(){\r\n\t\tthis.initializeRenderer();\r\n\r\n\t\tthis.headersElement = this.createHeadersElement();\r\n\t\tthis.element = this.createHeaderElement();\r\n\r\n\t\tthis.element.insertBefore(this.headersElement, this.element.firstChild);\r\n\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t}\r\n\r\n\tinitializeRenderer(){\r\n\t\tvar renderClass;\r\n\r\n\t\tvar renderers = {\r\n\t\t\t\"virtual\": RendererVirtualDomHorizontal,\r\n\t\t\t\"basic\": RendererBasicHorizontal,\r\n\t\t};\r\n\r\n\t\tif(typeof this.table.options.renderHorizontal === \"string\"){\r\n\t\t\trenderClass = renderers[this.table.options.renderHorizontal];\r\n\t\t}else{\r\n\t\t\trenderClass = this.table.options.renderHorizontal;\r\n\t\t}\r\n\r\n\t\tif(renderClass){\r\n\t\t\tthis.renderer = new renderClass(this.table, this.element, this.tableElement);\r\n\t\t\tthis.renderer.initialize();\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Unable to find matching renderer:\", table.options.renderHorizontal);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tcreateHeadersElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-headers\");\r\n\t\tel.setAttribute(\"role\", \"row\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tcreateHeaderElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-header\");\r\n\t\tel.setAttribute(\"role\", \"rowgroup\");\r\n\r\n\t\tif(!this.table.options.headerVisible){\r\n\t\t\tel.classList.add(\"tabulator-header-hidden\");\r\n\t\t}\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\t//return containing element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\t//return header containing element\r\n\tgetHeadersElement(){\r\n\t\treturn this.headersElement;\r\n\t}\r\n\r\n\t//scroll horizontally to match table body\r\n\tscrollHorizontal(left){\r\n\t\tvar hozAdjust = 0,\r\n\t\tscrollWidth = this.element.scrollWidth - this.table.element.clientWidth;\r\n\r\n\t\t// this.tempScrollBlock();\r\n\t\tthis.element.scrollLeft = left;\r\n\r\n\t\t//adjust for vertical scrollbar moving table when present\r\n\t\tif(left > scrollWidth){\r\n\t\t\thozAdjust = left - scrollWidth;\r\n\t\t\tthis.element.style.marginLeft = (-(hozAdjust)) + \"px\";\r\n\t\t}else{\r\n\t\t\tthis.element.style.marginLeft = 0;\r\n\t\t}\r\n\r\n\t\tthis.scrollLeft = left;\r\n\r\n\t\tthis.renderer.scrollColumns(left);\r\n\t}\r\n\r\n\t///////////// Column Setup Functions /////////////\r\n\tgenerateColumnsFromRowData(data){\r\n\t\tvar cols = [],\r\n\t\tdefinitions = this.table.options.autoColumnsDefinitions,\r\n\t\trow, sorter;\r\n\r\n\t\tif(data && data.length){\r\n\r\n\t\t\trow = data[0];\r\n\r\n\t\t\tfor(var key in row){\r\n\t\t\t\tlet col = {\r\n\t\t\t\t\tfield:key,\r\n\t\t\t\t\ttitle:key,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tlet value = row[key];\r\n\r\n\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\tsorter = \"boolean\";\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\tif(Array.isArray(value)){\r\n\t\t\t\t\t\tsorter = \"array\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\tif(!isNaN(value) && value !== \"\"){\r\n\t\t\t\t\t\tsorter = \"number\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)){\r\n\t\t\t\t\t\t\tsorter = \"alphanum\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcol.sorter = sorter;\r\n\r\n\t\t\t\tcols.push(col);\r\n\t\t\t}\r\n\r\n\t\t\tif(definitions){\r\n\r\n\t\t\t\tswitch(typeof definitions){\r\n\t\t\t\t\tcase \"function\":\r\n\t\t\t\t\tthis.table.options.columns = definitions.call(this.table, cols);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\tif(Array.isArray(definitions)){\r\n\t\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\t\tvar match = definitions.find((def) => {\r\n\t\t\t\t\t\t\t\treturn def.field === col.field;\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\tif(match){\r\n\t\t\t\t\t\t\t\tObject.assign(col, match);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\t\tif(definitions[col.field]){\r\n\t\t\t\t\t\t\t\tObject.assign(col, definitions[col.field]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.table.options.columns = cols;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.table.options.columns = cols;\r\n\t\t\t}\r\n\r\n\t\t\tthis.setColumns(this.table.options.columns);\r\n\t\t}\r\n\t}\r\n\r\n\tsetColumns(cols, row){\r\n\t\twhile(this.headersElement.firstChild) this.headersElement.removeChild(this.headersElement.firstChild);\r\n\r\n\t\tthis.columns = [];\r\n\t\tthis.columnsByIndex = [];\r\n\t\tthis.columnsByField = {};\r\n\r\n\t\tthis.dispatch(\"columns-loading\");\r\n\r\n\t\tcols.forEach((def, i) => {\r\n\t\t\tthis._addColumn(def);\r\n\t\t});\r\n\r\n\t\tthis._reIndexColumns();\r\n\r\n\t\tthis.dispatch(\"columns-loaded\");\r\n\r\n\t\tthis.renderer.rerenderColumns(false, true);\r\n\r\n\t\tthis.redraw(true);\r\n\t}\r\n\r\n\t_addColumn(definition, before, nextToColumn){\r\n\t\tvar column = new Column(definition, this),\r\n\t\tcolEl = column.getElement(),\r\n\t\tindex = nextToColumn ? this.findColumnIndex(nextToColumn) : nextToColumn;\r\n\r\n\t\tif(nextToColumn && index > -1){\r\n\t\t\tvar topColumn = nextToColumn.getTopColumn()\r\n\t\t\tvar parentIndex = this.columns.indexOf(topColumn);\r\n\t\t\tvar nextEl = topColumn.getElement();\r\n\r\n\t\t\tif(before){\r\n\t\t\t\tthis.columns.splice(parentIndex, 0, column);\r\n\t\t\t\tnextEl.parentNode.insertBefore(colEl, nextEl);\r\n\t\t\t}else{\r\n\t\t\t\tthis.columns.splice(parentIndex + 1, 0, column);\r\n\t\t\t\tnextEl.parentNode.insertBefore(colEl, nextEl.nextSibling);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(before){\r\n\t\t\t\tthis.columns.unshift(column);\r\n\t\t\t\tthis.headersElement.insertBefore(column.getElement(), this.headersElement.firstChild);\r\n\t\t\t}else{\r\n\t\t\t\tthis.columns.push(column);\r\n\t\t\t\tthis.headersElement.appendChild(column.getElement());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcolumn.columnRendered();\r\n\r\n\t\treturn column;\r\n\t}\r\n\r\n\tregisterColumnField(col){\r\n\t\tif(col.definition.field){\r\n\t\t\tthis.columnsByField[col.definition.field] = col;\r\n\t\t}\r\n\t}\r\n\r\n\tregisterColumnPosition(col){\r\n\t\tthis.columnsByIndex.push(col);\r\n\t}\r\n\r\n\t_reIndexColumns(){\r\n\t\tthis.columnsByIndex = [];\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.reRegisterPosition();\r\n\t\t});\r\n\t}\r\n\r\n\t//ensure column headers take up the correct amount of space in column groups\r\n\tverticalAlignHeaders(){\r\n\t\tvar minHeight = 0;\r\n\r\n\t\tthis.columns.forEach((column) => {\r\n\t\t\tvar height;\r\n\r\n\t\t\tcolumn.clearVerticalAlign();\r\n\r\n\t\t\theight = column.getHeight();\r\n\r\n\t\t\tif(height > minHeight){\r\n\t\t\t\tminHeight = height;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.columns.forEach((column) => {\r\n\t\t\tcolumn.verticalAlign(this.table.options.columnHeaderVertAlign, minHeight);\r\n\t\t});\r\n\r\n\t\tthis.table.rowManager.adjustTableSize();\r\n\t}\r\n\r\n\t//////////////// Column Details /////////////////\r\n\tfindColumn(subject){\r\n\t\tif(typeof subject == \"object\"){\r\n\r\n\t\t\tif(subject instanceof Column){\r\n\t\t\t\t//subject is column element\r\n\t\t\t\treturn subject;\r\n\t\t\t}else if(subject instanceof ColumnComponent){\r\n\t\t\t\t//subject is public column component\r\n\t\t\t\treturn subject._getSelf() || false;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\t\t\t\t//subject is a HTML element of the column header\r\n\t\t\t\tlet match = this.columns.find((column) => {\r\n\t\t\t\t\treturn column.element === subject;\r\n\t\t\t\t});\r\n\r\n\t\t\t\treturn match || false;\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the field name of the column\r\n\t\t\treturn this.columnsByField[subject] || false;\r\n\t\t}\r\n\r\n\t\t//catch all for any other type of input\r\n\t\treturn false;\r\n\t}\r\n\r\n\tgetColumnByField(field){\r\n\t\treturn this.columnsByField[field];\r\n\t}\r\n\r\n\tgetColumnsByFieldRoot(root){\r\n\t\tvar matches = [];\r\n\r\n\t\tObject.keys(this.columnsByField).forEach((field) => {\r\n\t\t\tvar fieldRoot = field.split(\".\")[0];\r\n\t\t\tif(fieldRoot === root){\r\n\t\t\t\tmatches.push(this.columnsByField[field]);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn matches;\r\n\t}\r\n\r\n\tgetColumnByIndex(index){\r\n\t\treturn this.columnsByIndex[index];\r\n\t}\r\n\r\n\tgetFirstVisibleColumn(index){\r\n\t\tvar index = this.columnsByIndex.findIndex((col) => {\r\n\t\t\treturn col.visible;\r\n\t\t});\r\n\r\n\t\treturn index > -1 ? this.columnsByIndex[index] : false;\r\n\t}\r\n\r\n\tgetColumns(){\r\n\t\treturn this.columns;\r\n\t}\r\n\r\n\tfindColumnIndex(column){\r\n\t\treturn this.columnsByIndex.findIndex((col) => {\r\n\t\t\treturn column === col;\r\n\t\t});\r\n\t}\r\n\r\n\t//return all columns that are not groups\r\n\tgetRealColumns(){\r\n\t\treturn this.columnsByIndex;\r\n\t}\r\n\r\n\t//travers across columns and call action\r\n\ttraverse(callback){\r\n\t\tthis.columnsByIndex.forEach((column,i) =>{\r\n\t\t\tcallback(column, i);\r\n\t\t});\r\n\t}\r\n\r\n\t//get defintions of actual columns\r\n\tgetDefinitions(active){\r\n\t\tvar output = [];\r\n\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tif(!active || (active && column.visible)){\r\n\t\t\t\toutput.push(column.getDefinition());\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//get full nested definition tree\r\n\tgetDefinitionTree(){\r\n\t\tvar output = [];\r\n\r\n\t\tthis.columns.forEach((column) => {\r\n\t\t\toutput.push(column.getDefinition(true));\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetComponents(structured){\r\n\t\tvar output = [],\r\n\t\tcolumns = structured ? this.columns : this.columnsByIndex;\r\n\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\toutput.push(column.getComponent());\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\tvar width = 0;\r\n\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tif(column.visible){\r\n\t\t\t\twidth += column.getWidth();\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn width;\r\n\t}\r\n\r\n\tmoveColumn(from, to, after){\r\n\t\tthis.moveColumnActual(from, to, after);\r\n\r\n\t\tto.element.parentNode.insertBefore(from.element, to.element);\r\n\r\n\t\tif(after){\r\n\t\t\tto.element.parentNode.insertBefore(to.element, from.element);\r\n\t\t}\r\n\r\n\t\tthis.verticalAlignHeaders();\r\n\r\n\t\tthis.table.rowManager.reinitialize();\r\n\t}\r\n\r\n\tmoveColumnActual(from, to, after){\r\n\t\tif(from.parent.isGroup){\r\n\t\t\tthis._moveColumnInArray(from.parent.columns, from, to, after);\r\n\t\t}else{\r\n\t\t\tthis._moveColumnInArray(this.columns, from, to, after);\r\n\t\t}\r\n\r\n\t\tthis._moveColumnInArray(this.columnsByIndex, from, to, after, true);\r\n\r\n\t\tthis.renderer.rerenderColumns(true);\r\n\r\n\t\tthis.dispatch(\"column-moved\", from, to, after);\r\n\r\n\t\tif(this.subscribedExternal(\"columnMoved\")){\r\n\t\t\tthis.dispatchExternal(\"columnMoved\", from.getComponent(), this.table.columnManager.getComponents());\r\n\t\t}\r\n\t}\r\n\r\n\t_moveColumnInArray(columns, from, to, after, updateRows){\r\n\t\tvar\tfromIndex = columns.indexOf(from),\r\n\t\ttoIndex, rows = [];\r\n\r\n\t\tif (fromIndex > -1) {\r\n\r\n\t\t\tcolumns.splice(fromIndex, 1);\r\n\r\n\t\t\ttoIndex = columns.indexOf(to);\r\n\r\n\t\t\tif (toIndex > -1) {\r\n\r\n\t\t\t\tif(after){\r\n\t\t\t\t\ttoIndex = toIndex+1;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\ttoIndex = fromIndex;\r\n\t\t\t}\r\n\r\n\t\t\tcolumns.splice(toIndex, 0, from);\r\n\r\n\t\t\tif(updateRows){\r\n\r\n\t\t\t\trows = this.chain(\"column-moving-rows\", [from, to, after], null, []) || [];\r\n\r\n\t\t\t\trows = rows.concat(this.table.rowManager.rows);\r\n\r\n\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\tif(row.cells.length){\r\n\t\t\t\t\t\tvar cell = row.cells.splice(fromIndex, 1)[0];\r\n\t\t\t\t\t\trow.cells.splice(toIndex, 0, cell);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tscrollToColumn(column, position, ifVisible){\r\n\t\tvar left = 0,\r\n\t\toffset = 0,\r\n\t\tadjust = 0,\r\n\t\tcolEl = column.getElement();\r\n\r\n\t\treturn new Promise((resolve, reject) => {\r\n\r\n\t\t\tif(typeof position === \"undefined\"){\r\n\t\t\t\tposition = this.table.options.scrollToColumnPosition;\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof ifVisible === \"undefined\"){\r\n\t\t\t\tifVisible = this.table.options.scrollToColumnIfVisible;\r\n\t\t\t}\r\n\r\n\t\t\tif(column.visible){\r\n\r\n\t\t\t\t//align to correct position\r\n\t\t\t\tswitch(position){\r\n\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\tcase \"center\":\r\n\t\t\t\t\tadjust = -this.element.clientWidth / 2;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"right\":\r\n\t\t\t\t\tadjust = colEl.clientWidth - this.headersElement.clientWidth;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//check column visibility\r\n\t\t\t\tif(!ifVisible){\r\n\r\n\t\t\t\t\toffset = colEl.offsetLeft;\r\n\r\n\t\t\t\t\tif(offset > 0 && offset + colEl.offsetWidth < this.element.clientWidth){\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//calculate scroll position\r\n\t\t\t\tleft = colEl.offsetLeft + adjust;\r\n\r\n\t\t\t\tleft = Math.max(Math.min(left, this.table.rowManager.element.scrollWidth - this.table.rowManager.element.clientWidth),0);\r\n\r\n\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\tthis.scrollHorizontal(left);\r\n\r\n\t\t\t\tresolve();\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - Column not visible\");\r\n\t\t\t\treject(\"Scroll Error - Column not visible\");\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t}\r\n\r\n\t//////////////// Cell Management /////////////////\r\n\tgenerateCells(row){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tcells.push(column.generateCell(row));\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\t//////////////// Column Management /////////////////\r\n\tgetFlexBaseWidth(){\r\n\t\tvar totalWidth = this.table.element.clientWidth, //table element width\r\n\t\tfixedWidth = 0;\r\n\r\n\t\t//adjust for vertical scrollbar if present\r\n\t\tif(this.table.rowManager.element.scrollHeight > this.table.rowManager.element.clientHeight){\r\n\t\t\ttotalWidth -= this.table.rowManager.element.offsetWidth - this.table.rowManager.element.clientWidth;\r\n\t\t}\r\n\r\n\t\tthis.columnsByIndex.forEach(function(column){\r\n\t\t\tvar width, minWidth, colWidth;\r\n\r\n\t\t\tif(column.visible){\r\n\r\n\t\t\t\twidth = column.definition.width || 0;\r\n\r\n\t\t\t\tminWidth = parseInt(column.minWidth);\r\n\r\n\t\t\t\tif(typeof(width) == \"string\"){\r\n\t\t\t\t\tif(width.indexOf(\"%\") > -1){\r\n\t\t\t\t\t\tcolWidth = (totalWidth / 100) * parseInt(width) ;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tcolWidth = parseInt(width);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolWidth = width;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfixedWidth += colWidth > minWidth ? colWidth : minWidth;\r\n\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn fixedWidth;\r\n\t}\r\n\r\n\taddColumn(definition, before, nextToColumn){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar column = this._addColumn(definition, before, nextToColumn);\r\n\r\n\t\t\tthis._reIndexColumns();\r\n\r\n\t\t\tthis.dispatch(\"column-add\", definition, before, nextToColumn);\r\n\r\n\t\t\tif(this.layoutMode() != \"fitColumns\"){\r\n\t\t\t\tcolumn.reinitializeWidth();\r\n\t\t\t}\r\n\r\n\t\t\tthis.redraw(true);\r\n\r\n\t\t\tthis.table.rowManager.reinitialize();\r\n\r\n\t\t\tthis.renderer.rerenderColumns();\r\n\r\n\t\t\tresolve(column);\r\n\t\t});\r\n\t}\r\n\r\n\t//remove column from system\r\n\tderegisterColumn(column){\r\n\t\tvar field = column.getField(),\r\n\t\tindex;\r\n\r\n\t\t//remove from field list\r\n\t\tif(field){\r\n\t\t\tdelete this.columnsByField[field];\r\n\t\t}\r\n\r\n\t\t//remove from index list\r\n\t\tindex = this.columnsByIndex.indexOf(column);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.columnsByIndex.splice(index, 1);\r\n\t\t}\r\n\r\n\t\t//remove from column list\r\n\t\tindex = this.columns.indexOf(column);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.columns.splice(index, 1);\r\n\t\t}\r\n\r\n\t\tthis.verticalAlignHeaders();\r\n\r\n\t\tthis.redraw();\r\n\t}\r\n\r\n\t//redraw columns\r\n\tredraw(force){\r\n\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\tthis.verticalAlignHeaders();\r\n\t\t}\r\n\r\n\t\tif(force){\r\n\t\t\tthis.table.rowManager.resetScroll();\r\n\t\t\tthis.table.rowManager.reinitialize();\r\n\t\t}\r\n\r\n\t\tif(!this.confirm(\"table-redrawing\", force)){\r\n\t\t\tthis.layoutRefresh();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"table-redraw\", force);\r\n\r\n\t\tthis.table.footerManager.redraw();\r\n\t}\r\n}","//public row object\r\nexport default class RowComponent {\r\n\r\n\tconstructor (row){\r\n\t\tthis._row = row;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._row.table.componentFunctionBinder.handle(\"row\", target._row, name)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\tgetData(transform){\r\n\t\treturn this._row.getData(transform);\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._row.getElement();\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._row.getCells().forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tgetCell(column){\r\n\t\tvar cell = this._row.getCell(column);\r\n\t\treturn cell ? cell.getComponent() : false;\r\n\t}\r\n\r\n\tgetIndex(){\r\n\t\treturn this._row.getData(\"data\")[this._row.table.options.index];\r\n\t}\r\n\r\n\tgetPosition(active){\r\n\t\treturn this._row.table.rowManager.getRowPosition(this._row, active);\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn this._row.delete();\r\n\t}\r\n\r\n\tscrollTo(){\r\n\t\treturn this._row.table.rowManager.scrollToRow(this._row);\r\n\t}\r\n\r\n\tmove(to, after){\r\n\t\tthis._row.moveToRow(to, after);\r\n\t}\r\n\r\n\tupdate(data){\r\n\t\treturn this._row.updateData(data);\r\n\t}\r\n\r\n\tnormalizeHeight(){\r\n\t\tthis._row.normalizeHeight(true);\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._row;\r\n\t}\r\n\r\n\treformat(){\r\n\t\treturn this._row.reinitialize();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._row.table;\r\n\t}\r\n\r\n\tgetNextRow(){\r\n\t\tvar row = this._row.nextRow();\r\n\t\treturn row ? row.getComponent() : row;\r\n\t}\r\n\r\n\tgetPrevRow(){\r\n\t\tvar row = this._row.prevRow();\r\n\t\treturn row ? row.getComponent() : row;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport RowComponent from './RowComponent.js';\r\nimport Helpers from '../tools/Helpers.js';\r\n\r\nexport default class Row extends CoreFeature{\r\n\tconstructor (data, parent, type = \"row\"){\r\n\t\tsuper(parent.table);\r\n\t\t\r\n\t\tthis.parent = parent;\r\n\t\tthis.data = {};\r\n\t\tthis.type = type; //type of element\r\n\t\tthis.element = false;\r\n\t\tthis.modules = {}; //hold module variables;\r\n\t\tthis.cells = [];\r\n\t\tthis.height = 0; //hold element height\r\n\t\tthis.heightStyled = \"\"; //hold element height prestyled to improve render efficiency\r\n\t\tthis.manualHeight = false; //user has manually set row height\r\n\t\tthis.outerHeight = 0; //hold elements outer height\r\n\t\tthis.initialized = false; //element has been rendered\r\n\t\tthis.heightInitialized = false; //element has resized cells to fit\r\n\t\t\r\n\t\tthis.component = null;\r\n\t\t\r\n\t\tthis.created = false;\r\n\t\t\r\n\t\tthis.setData(data);\r\n\t}\r\n\t\r\n\tcreate(){\r\n\t\tif(!this.created){\r\n\t\t\tthis.created = true;\r\n\t\t\tthis.generateElement();\r\n\t\t}\r\n\t}\r\n\t\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-row\");\r\n\t\tel.setAttribute(\"role\", \"row\");\r\n\t\t\r\n\t\tthis.element = el;\r\n\t}\r\n\t\r\n\tgetElement(){\r\n\t\tthis.create();\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\tdetachElement(){\r\n\t\tif (this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgenerateElement(){\r\n\t\tthis.createElement();\r\n\t\tthis.dispatch(\"row-init\", this);\r\n\t}\r\n\t\r\n\tgenerateCells(){\r\n\t\tthis.cells = this.table.columnManager.generateCells(this);\r\n\t}\r\n\t\r\n\t//functions to setup on first render\r\n\tinitialize(force){\r\n\t\tthis.create();\r\n\t\t\r\n\t\tif(!this.initialized || force){\r\n\t\t\t\r\n\t\t\tthis.deleteCells();\r\n\t\t\t\r\n\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout-before\", this);\r\n\t\t\t\r\n\t\t\tthis.generateCells();\r\n\t\t\t\r\n\t\t\tthis.initialized = true;\r\n\t\t\t\r\n\t\t\tthis.table.columnManager.renderer.renderRowCells(this);\r\n\t\t\t\r\n\t\t\tif(force){\r\n\t\t\t\tthis.normalizeHeight();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout\", this);\r\n\t\t\t\r\n\t\t\tif(this.table.options.rowFormatter){\r\n\t\t\t\tthis.table.options.rowFormatter(this.getComponent());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout-after\", this);\r\n\t\t}else{\r\n\t\t\tthis.table.columnManager.renderer.rerenderRowCells(this);\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeHeight(){\r\n\t\tthis.heightInitialized = false;\r\n\t\t\r\n\t\tif(this.element && this.element.offsetParent !== null){\r\n\t\t\tthis.normalizeHeight(true);\r\n\t\t}\r\n\t}\r\n\r\n\tdeinitialize(){\r\n\t\tthis.initialized = false;\r\n\t}\r\n\t\r\n\tdeinitializeHeight(){\r\n\t\tthis.heightInitialized = false;\r\n\t}\r\n\t\r\n\treinitialize(children){\r\n\t\tthis.initialized = false;\r\n\t\tthis.heightInitialized = false;\r\n\t\t\r\n\t\tif(!this.manualHeight){\r\n\t\t\tthis.height = 0;\r\n\t\t\tthis.heightStyled = \"\";\r\n\t\t}\r\n\t\t\r\n\t\tif(this.element && this.element.offsetParent !== null){\r\n\t\t\tthis.initialize(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatch(\"row-relayout\", this);\r\n\t}\r\n\t\r\n\t//get heights when doing bulk row style calcs in virtual DOM\r\n\tcalcHeight(force){\r\n\t\tvar maxHeight = 0,\r\n\t\tminHeight;\r\n\t\t\r\n\t\tif(this.table.options.rowHeight){\r\n\t\t\tthis.height = this.table.options.rowHeight;\r\n\t\t}else{\r\n\t\t\tminHeight = this.table.options.resizableRows ? this.element.clientHeight : 0;\r\n\t\t\t\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tvar height = cell.getHeight();\r\n\t\t\t\tif(height > maxHeight){\r\n\t\t\t\t\tmaxHeight = height;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(force){\r\n\t\t\t\tthis.height = Math.max(maxHeight, minHeight);\r\n\t\t\t}else{\r\n\t\t\t\tthis.height = this.manualHeight ? this.height : Math.max(maxHeight, minHeight);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.heightStyled = this.height ? this.height + \"px\" : \"\";\r\n\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t}\r\n\t\r\n\t//set of cells\r\n\tsetCellHeight(){\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setHeight();\r\n\t\t});\r\n\t\t\r\n\t\tthis.heightInitialized = true;\r\n\t}\r\n\t\r\n\tclearCellHeight(){\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.clearHeight();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//normalize the height of elements in the row\r\n\tnormalizeHeight(force){\r\n\t\tif(force && !this.table.options.rowHeight){\r\n\t\t\tthis.clearCellHeight();\r\n\t\t}\r\n\t\t\r\n\t\tthis.calcHeight(force);\r\n\t\t\r\n\t\tthis.setCellHeight();\r\n\t}\r\n\t\r\n\t//set height of rows\r\n\tsetHeight(height, force){\r\n\t\tif(this.height != height || force){\r\n\t\t\t\r\n\t\t\tthis.manualHeight = true;\r\n\t\t\t\r\n\t\t\tthis.height = height;\r\n\t\t\tthis.heightStyled = height ? height + \"px\" : \"\";\r\n\t\t\t\r\n\t\t\tthis.setCellHeight();\r\n\t\t\t\r\n\t\t\t// this.outerHeight = this.element.outerHeight();\r\n\t\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return rows outer height\r\n\tgetHeight(){\r\n\t\treturn this.outerHeight;\r\n\t}\r\n\t\r\n\t//return rows outer Width\r\n\tgetWidth(){\r\n\t\treturn this.element.offsetWidth;\r\n\t}\r\n\t\r\n\t//////////////// Cell Management /////////////////\r\n\tdeleteCell(cell){\r\n\t\tvar index = this.cells.indexOf(cell);\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.cells.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////// Data Management /////////////////\r\n\tsetData(data){\r\n\t\tthis.data = this.chain(\"row-data-init-before\", [this, data], undefined, data);\r\n\t\t\r\n\t\tthis.dispatch(\"row-data-init-after\", this);\r\n\t}\r\n\t\r\n\t//update the rows data\r\n\tupdateData(updatedData){\r\n\t\tvar visible = this.element && Helpers.elVisible(this.element),\r\n\t\ttempData = {},\r\n\t\tnewRowData;\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\r\n\t\t\tif(typeof updatedData === \"string\"){\r\n\t\t\t\tupdatedData = JSON.parse(updatedData);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-save-before\", this);\r\n\t\t\t\r\n\t\t\tif(this.subscribed(\"row-data-changing\")){\r\n\t\t\t\ttempData = Object.assign(tempData, this.data);\r\n\t\t\t\ttempData = Object.assign(tempData, updatedData);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tnewRowData = this.chain(\"row-data-changing\", [this, tempData, updatedData], null, updatedData);\r\n\t\t\t\r\n\t\t\t//set data\r\n\t\t\tfor (var attrname in newRowData) {\r\n\t\t\t\tthis.data[attrname] = newRowData[attrname];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-save-after\", this);\r\n\t\t\t\r\n\t\t\t//update affected cells only\r\n\t\t\tfor (var attrname in updatedData) {\r\n\t\t\t\t\r\n\t\t\t\tlet columns = this.table.columnManager.getColumnsByFieldRoot(attrname);\r\n\t\t\t\t\r\n\t\t\t\tcolumns.forEach((column) => {\r\n\t\t\t\t\tlet cell = this.getCell(column.getField());\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(cell){\r\n\t\t\t\t\t\tlet value = column.getFieldValue(newRowData);\r\n\t\t\t\t\t\tif(cell.getValue() != value){\r\n\t\t\t\t\t\t\tcell.setValueProcessData(value);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(visible){\r\n\t\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Partial reinitialization if visible\r\n\t\t\tif(visible){\r\n\t\t\t\tthis.normalizeHeight(true);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.rowFormatter){\r\n\t\t\t\t\tthis.table.options.rowFormatter(this.getComponent());\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.initialized = false;\r\n\t\t\t\tthis.height = 0;\r\n\t\t\t\tthis.heightStyled = \"\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-changed\", this, visible, updatedData);\r\n\t\t\t\r\n\t\t\t//this.reinitialize();\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"rowUpdated\", this.getComponent());\r\n\t\t\t\r\n\t\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetData(transform){\r\n\t\tif(transform){\r\n\t\t\treturn this.chain(\"row-data-retrieve\", [this, transform], null, this.data);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.data;\r\n\t}\r\n\t\r\n\tgetCell(column){\r\n\t\tvar match = false;\r\n\t\t\r\n\t\tcolumn = this.table.columnManager.findColumn(column);\r\n\t\t\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.generateCells();\r\n\t\t}\r\n\t\t\r\n\t\tmatch = this.cells.find(function(cell){\r\n\t\t\treturn cell.column === column;\r\n\t\t});\r\n\t\t\r\n\t\treturn match;\r\n\t}\r\n\t\r\n\tgetCellIndex(findCell){\r\n\t\treturn this.cells.findIndex(function(cell){\r\n\t\t\treturn cell === findCell;\r\n\t\t});\r\n\t}\r\n\t\r\n\tfindCell(subject){\r\n\t\treturn this.cells.find((cell) => {\r\n\t\t\treturn cell.element === subject;\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetCells(){\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.generateCells();\r\n\t\t}\r\n\t\t\r\n\t\treturn this.cells;\r\n\t}\r\n\t\r\n\tnextRow(){\r\n\t\tvar row = this.table.rowManager.nextDisplayRow(this, true);\r\n\t\treturn row || false;\r\n\t}\r\n\t\r\n\tprevRow(){\r\n\t\tvar row = this.table.rowManager.prevDisplayRow(this, true);\r\n\t\treturn row || false;\r\n\t}\r\n\t\r\n\tmoveToRow(to, before){\r\n\t\tvar toRow = this.table.rowManager.findRow(to);\r\n\t\t\r\n\t\tif(toRow){\r\n\t\t\tthis.table.rowManager.moveRowActual(this, toRow, !before);\r\n\t\t\tthis.table.rowManager.refreshActiveData(\"display\", false, true);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching row found:\", to);\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////// Actions /////////////////////\r\n\tdelete(){\r\n\t\tthis.dispatch(\"row-delete\", this);\r\n\t\t\r\n\t\tthis.deleteActual();\r\n\t\t\r\n\t\treturn Promise.resolve();\r\n\t}\r\n\t\r\n\tdeleteActual(blockRedraw){\r\n\t\tvar index = this.table.rowManager.getRowIndex(this);\r\n\t\t\r\n\t\tthis.detatchModules();\r\n\t\t\r\n\t\tthis.table.rowManager.deleteRow(this, blockRedraw);\r\n\t\t\r\n\t\tthis.deleteCells();\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.heightInitialized = false;\r\n\t\tthis.element = false;\r\n\t\t\r\n\t\tthis.dispatch(\"row-deleted\", this);\r\n\t}\r\n\t\r\n\tdetatchModules(){\r\n\t\tthis.dispatch(\"row-deleting\", this);\r\n\t}\r\n\t\r\n\tdeleteCells(){\r\n\t\tvar cellCount = this.cells.length;\r\n\t\t\r\n\t\tfor(let i = 0; i < cellCount; i++){\r\n\t\t\tthis.cells[0].delete();\r\n\t\t}\r\n\t}\r\n\t\r\n\twipe(){\r\n\t\tthis.detatchModules();\r\n\t\tthis.deleteCells();\r\n\t\t\r\n\t\tif(this.element){\r\n\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\t\r\n\t\t\tif(this.element.parentNode){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.element = false;\r\n\t\tthis.modules = {};\r\n\t}\r\n\t\r\n\tgetGroup(){\r\n\t\treturn this.modules.group || false;\r\n\t}\r\n\t\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new RowComponent(this);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.component;\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class BaiscVertical extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.verticalFillMode = \"fill\";\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t}\r\n\r\n\tclearRows(){\r\n\t\tvar element = this.tableElement;\r\n\r\n\t\t// element.children.detach();\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\telement.scrollTop = 0;\r\n\t\telement.scrollLeft = 0;\r\n\r\n\t\telement.style.minWidth = \"\";\r\n\t\telement.style.minHeight = \"\";\r\n\t\telement.style.display = \"\";\r\n\t\telement.style.visibility = \"\";\r\n\t}\r\n\r\n\trenderRows(){\r\n\t\tvar element = this.tableElement,\r\n\t\tonlyGroupHeaders = true;\r\n\r\n\t\tthis.rows().forEach((row, index) => {\r\n\t\t\tthis.styleRow(row, index);\r\n\t\t\telement.appendChild(row.getElement());\r\n\t\t\trow.initialize(true);\r\n\r\n\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\tonlyGroupHeaders = false;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(onlyGroupHeaders){\r\n\t\t\telement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t}else{\r\n\t\t\telement.style.minWidth = \"\";\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trerenderRows(callback){\r\n\t\tthis.clearRows();\r\n\t\tthis.renderRows();\r\n\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\tvar rowTop = Helpers.elOffset(row.getElement()).top;\r\n\r\n\t\treturn !(Math.abs(this.elementVertical.scrollTop - rowTop) > Math.abs(this.elementVertical.scrollTop + this.elementVertical.clientHeight - rowTop));\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tthis.elementVertical.scrollTop = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top + this.elementVertical.scrollTop;\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\treturn this.rows();\r\n\t}\r\n\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class VirtualDomVertical extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.verticalFillMode = \"fill\";\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.vDomRowHeight = 20; //approximation of row heights for padding\r\n\r\n\t\tthis.vDomTop = 0; //hold position for first rendered row in the virtual DOM\r\n\t\tthis.vDomBottom = 0; //hold possition for last rendered row in the virtual DOM\r\n\r\n\t\tthis.vDomScrollPosTop = 0; //last scroll position of the vDom top;\r\n\t\tthis.vDomScrollPosBottom = 0; //last scroll position of the vDom bottom;\r\n\r\n\t\tthis.vDomTopPad = 0; //hold value of padding for top of virtual DOM\r\n\t\tthis.vDomBottomPad = 0; //hold value of padding for bottom of virtual DOM\r\n\r\n\t\tthis.vDomMaxRenderChain = 90; //the maximum number of dom elements that can be rendered in 1 go\r\n\r\n\t\tthis.vDomWindowBuffer = 0; //window row buffer before removing elements, to smooth scrolling\r\n\r\n\t\tthis.vDomWindowMinTotalRows = 20; //minimum number of rows to be generated in virtual dom (prevent buffering issues on tables with tall rows)\r\n\t\tthis.vDomWindowMinMarginRows = 5; //minimum number of rows to be generated in virtual dom margin\r\n\r\n\t\tthis.vDomTopNewRows = []; //rows to normalize after appending to optimize render speed\r\n\t\tthis.vDomBottomNewRows = []; //rows to normalize after appending to optimize render speed\r\n\t}\r\n\r\n\t//////////////////////////////////////\r\n\t///////// Public Functions ///////////\r\n\t//////////////////////////////////////\r\n\r\n\tclearRows(){\r\n\t\tvar element = this.tableElement;\r\n\r\n\t\t// element.children.detach();\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\telement.style.paddingTop = \"\";\r\n\t\telement.style.paddingBottom = \"\";\r\n\t\t// element.style.minWidth = \"\";\r\n\t\telement.style.minHeight = \"\";\r\n\t\telement.style.display = \"\";\r\n\t\telement.style.visibility = \"\";\r\n\r\n\t\tthis.elementVertical.scrollTop = 0;\r\n\t\tthis.elementVertical.scrollLeft = 0;\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.vDomTop = 0;\r\n\t\tthis.vDomBottom = 0;\r\n\t\tthis.vDomTopPad = 0;\r\n\t\tthis.vDomBottomPad = 0;\r\n\t\tthis.vDomScrollPosTop = 0;\r\n\t\tthis.vDomScrollPosBottom = 0;\r\n\t}\r\n\r\n\trenderRows(){\r\n\t\tthis._virtualRenderFill();\r\n\t}\r\n\r\n\trerenderRows(callback){\r\n\t\tvar scrollTop = this.elementVertical.scrollTop;\r\n\t\tvar topRow = false;\r\n\t\tvar topOffset = false;\r\n\r\n\t\tvar left = this.table.rowManager.scrollLeft;\r\n\r\n\t\tvar rows = this.rows();\r\n\r\n\t\tfor(var i = this.vDomTop; i <= this.vDomBottom; i++){\r\n\r\n\t\t\tif(rows[i]){\r\n\t\t\t\tvar diff = scrollTop - rows[i].getElement().offsetTop;\r\n\r\n\t\t\t\tif(topOffset === false || Math.abs(diff) < topOffset){\r\n\t\t\t\t\ttopOffset = diff;\r\n\t\t\t\t\ttopRow = i;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\trows.forEach((row) => {\r\n\t\t\trow.deinitializeHeight();\r\n\t\t});\r\n\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\r\n\t\tthis._virtualRenderFill((topRow === false ? this.rows.length - 1 : topRow), true, topOffset || 0);\r\n\r\n\t\tthis.scrollColumns(left);\r\n\t}\r\n\r\n\tscrollColumns(left){\r\n\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t}\r\n\r\n\tscrollRows(top, dir){\r\n\t\tvar topDiff = top - this.vDomScrollPosTop;\r\n\t\tvar bottomDiff = top - this.vDomScrollPosBottom;\r\n\t\tvar margin = this.vDomWindowBuffer * 2;\r\n\t\tvar rows = this.rows();\r\n\r\n\t\tthis.scrollTop = top;\r\n\r\n\t\tif(-topDiff > margin || bottomDiff > margin){\r\n\t\t\t//if big scroll redraw table;\r\n\t\t\tvar left = this.table.rowManager.scrollLeft;\r\n\t\t\tthis._virtualRenderFill(Math.floor((this.elementVertical.scrollTop / this.elementVertical.scrollHeight) * rows.length));\r\n\t\t\tthis.scrollColumns(left);\r\n\t\t}else{\r\n\r\n\t\t\tif(dir){\r\n\t\t\t\t//scrolling up\r\n\t\t\t\tif(topDiff < 0){\r\n\t\t\t\t\tthis._addTopRow(rows, -topDiff);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(bottomDiff < 0){\r\n\t\t\t\t\t//hide bottom row if needed\r\n\t\t\t\t\tif(this.vDomScrollHeight - this.scrollTop > this.vDomWindowBuffer){\r\n\t\t\t\t\t\tthis._removeBottomRow(rows, -bottomDiff);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomScrollPosBottom = this.scrollTop;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\r\n\t\t\t\tif(bottomDiff >= 0){\r\n\t\t\t\t\tthis._addBottomRow(rows, bottomDiff);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//scrolling down\r\n\t\t\t\tif(topDiff >= 0){\r\n\t\t\t\t\t//hide top row if needed\r\n\t\t\t\t\tif(this.scrollTop > this.vDomWindowBuffer){\r\n\t\t\t\t\t\tthis._removeTopRow(rows, topDiff);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomScrollPosTop = this.scrollTop;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tresize(){\r\n\t\tthis.vDomWindowBuffer = this.table.options.renderVerticalBuffer || this.elementVertical.clientHeight;\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\tvar rowIndex = this.rows().indexOf(row);\r\n\r\n\t\treturn !(Math.abs(this.vDomTop - rowIndex) > Math.abs(this.vDomBottom - rowIndex));\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\tvar index = this.rows().indexOf(row);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis._virtualRenderFill(index, true);\r\n\t\t}\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\tvar topEdge = this.elementVertical.scrollTop,\r\n\t\tbottomEdge = this.elementVertical.clientHeight + topEdge,\r\n\t\ttopFound = false,\r\n\t\ttopRow = 0,\r\n\t\tbottomRow = 0,\r\n\t\trows = this.rows();\r\n\r\n\t\tif(includingBuffer){\r\n\t\t\ttopRow = this.vDomTop;\r\n\t\t\tbottomRow = this.vDomBottom;\r\n\t\t}else{\r\n\t\t\tfor(var i = this.vDomTop; i <= this.vDomBottom; i++){\r\n\t\t\t\tif(rows[i]){\r\n\t\t\t\t\tif(!topFound){\r\n\t\t\t\t\t\tif((topEdge - rows[i].getElement().offsetTop) >= 0){\r\n\t\t\t\t\t\t\ttopRow = i;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\ttopFound = true;\r\n\r\n\t\t\t\t\t\t\tif(bottomEdge - rows[i].getElement().offsetTop >= 0){\r\n\t\t\t\t\t\t\t\tbottomRow = i;\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(bottomEdge - rows[i].getElement().offsetTop >= 0){\r\n\t\t\t\t\t\t\tbottomRow = i;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn rows.slice(topRow, bottomRow + 1);\r\n\t}\r\n\r\n\t//////////////////////////////////////\r\n\t//////// Internal Rendering //////////\r\n\t//////////////////////////////////////\r\n\r\n\t//full virtual render\r\n\t_virtualRenderFill(position, forceMove, offset){\r\n\t\tvar\telement = this.tableElement,\r\n\t\tholder = this.elementVertical,\r\n\t\ttopPad = 0,\r\n\t\trowsHeight = 0,\r\n\t\theightOccupied = 0,\r\n\t\ttopPadHeight = 0,\r\n\t\ti = 0,\r\n\t\trows = this.rows(),\r\n\t\trowsCount = rows.length,\r\n\t\tcontainerHeight = this.elementVertical.clientHeight;\r\n\r\n\t\tposition = position || 0;\r\n\r\n\t\toffset = offset || 0;\r\n\r\n\t\tif(!position){\r\n\t\t\tthis.clear();\r\n\t\t}else{\r\n\t\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\t\t//check if position is too close to bottom of table\r\n\t\t\theightOccupied = (rowsCount - position + 1) * this.vDomRowHeight;\r\n\r\n\t\t\tif(heightOccupied < containerHeight){\r\n\t\t\t\tposition -= Math.ceil((containerHeight - heightOccupied) / this.vDomRowHeight);\r\n\t\t\t\tif(position < 0){\r\n\t\t\t\t\tposition = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//calculate initial pad\r\n\t\t\ttopPad = Math.min(Math.max(Math.floor(this.vDomWindowBuffer / this.vDomRowHeight), this.vDomWindowMinMarginRows), position);\r\n\t\t\tposition -= topPad;\r\n\t\t}\r\n\r\n\t\tif(rowsCount && Helpers.elVisible(this.elementVertical)){\r\n\t\t\tthis.vDomTop = position;\r\n\r\n\t\t\tthis.vDomBottom = position -1;\r\n\r\n\t\t\twhile ((rowsHeight <= containerHeight + this.vDomWindowBuffer || i < this.vDomWindowMinTotalRows) && this.vDomBottom < rowsCount -1){\r\n\t\t\t\tvar index = this.vDomBottom + 1,\r\n\t\t\t\trow = rows[index],\r\n\t\t\t\trowHeight = 0;\r\n\r\n\t\t\t\tthis.styleRow(row, index);\r\n\r\n\t\t\t\telement.appendChild(row.getElement());\r\n\r\n\t\t\t\trow.initialize();\r\n\r\n\t\t\t\tif(!row.heightInitialized){\r\n\t\t\t\t\trow.normalizeHeight(true);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowHeight = row.getHeight();\r\n\r\n\t\t\t\tif(i < topPad){\r\n\t\t\t\t\ttopPadHeight += rowHeight;\r\n\t\t\t\t}else{\r\n\t\t\t\t\trowsHeight += rowHeight;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.vDomBottom ++;\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\r\n\t\t\tif(!position){\r\n\t\t\t\tthis.vDomTopPad = 0;\r\n\t\t\t\t//adjust rowheight to match average of rendered elements\r\n\t\t\t\tthis.vDomRowHeight = Math.floor((rowsHeight + topPadHeight) / i);\r\n\t\t\t\tthis.vDomBottomPad = this.vDomRowHeight * (rowsCount - this.vDomBottom -1);\r\n\r\n\t\t\t\tthis.vDomScrollHeight = topPadHeight + rowsHeight + this.vDomBottomPad - containerHeight;\r\n\t\t\t}else{\r\n\t\t\t\tthis.vDomTopPad = !forceMove ? this.scrollTop - topPadHeight : (this.vDomRowHeight * this.vDomTop) + offset;\r\n\t\t\t\tthis.vDomBottomPad = this.vDomBottom == rowsCount-1 ? 0 : Math.max(this.vDomScrollHeight - this.vDomTopPad - rowsHeight - topPadHeight, 0);\r\n\t\t\t}\r\n\r\n\t\t\telement.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\telement.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\r\n\t\t\tif(forceMove){\r\n\t\t\t\tthis.scrollTop = this.vDomTopPad + (topPadHeight) + offset - (this.elementVertical.scrollWidth > this.elementVertical.clientWidth ? this.elementVertical.offsetHeight - containerHeight : 0);\r\n\t\t\t}\r\n\r\n\t\t\tthis.scrollTop = Math.min(this.scrollTop, this.elementVertical.scrollHeight - containerHeight);\r\n\r\n\t\t\t//adjust for horizontal scrollbar if present (and not at top of table)\r\n\t\t\tif(this.elementVertical.scrollWidth > this.elementVertical.offsetWidth && forceMove){\r\n\t\t\t\tthis.scrollTop += this.elementVertical.offsetHeight - containerHeight;\r\n\t\t\t}\r\n\r\n\t\t\tthis.vDomScrollPosTop = this.scrollTop;\r\n\t\t\tthis.vDomScrollPosBottom = this.scrollTop;\r\n\r\n\t\t\tholder.scrollTop = this.scrollTop;\r\n\r\n\t\t\tthis.dispatch(\"render-virtual-fill\");\r\n\t\t}\r\n\t}\r\n\r\n\t_addTopRow(rows, fillableSpace){\r\n\t\tvar table = this.tableElement,\r\n\t\taddedRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\tindex = this.vDomTop -1,\r\n\t\ti = 0;\r\n\r\n\t\twhile(true){\r\n\t\t\tif(this.vDomTop){\r\n\t\t\t\tlet row = rows[index],\r\n\t\t\t\trowHeight, initialized;\r\n\r\n\t\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\t\t\t\t\tinitialized = row.initialized;\r\n\r\n\t\t\t\t\tif(fillableSpace >= rowHeight){\r\n\r\n\t\t\t\t\t\tthis.styleRow(row, index);\r\n\t\t\t\t\t\ttable.insertBefore(row.getElement(), table.firstChild);\r\n\r\n\t\t\t\t\t\tif(!row.initialized || !row.heightInitialized){\r\n\t\t\t\t\t\t\taddedRows.push(row);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\trow.initialize();\r\n\r\n\t\t\t\t\t\tif(!initialized){\r\n\t\t\t\t\t\t\trowHeight = row.getElement().offsetHeight;\r\n\r\n\t\t\t\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\t\tthis.vDomTop--;\r\n\t\t\t\t\t\tindex--;\r\n\t\t\t\t\t\ti++;\r\n\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of addedRows){\r\n\t\t\trow.clearCellHeight();\r\n\t\t}\r\n\r\n\t\tthis._quickNormalizeRowHeight(addedRows);\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomTopPad -= paddingAdjust;\r\n\r\n\t\t\tif(this.vDomTopPad < 0){\r\n\t\t\t\tthis.vDomTopPad = index * this.vDomRowHeight;\r\n\t\t\t}\r\n\r\n\t\t\tif(index < 1){\r\n\t\t\t\tthis.vDomTopPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\ttable.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\tthis.vDomScrollPosTop -= paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_removeTopRow(rows, fillableSpace){\r\n\t\tvar removableRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\ti = 0;\r\n\r\n\t\twhile(true){\r\n\t\t\tlet row = rows[this.vDomTop],\r\n\t\t\trowHeight, diff;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\t\t\t\t\tthis.vDomTop++;\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tremovableRows.push(row);\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of removableRows){\r\n\t\t\tlet rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomTopPad += paddingAdjust;\r\n\t\t\tthis.tableElement.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\tthis.vDomScrollPosTop += this.vDomTop ? paddingAdjust : paddingAdjust + this.vDomWindowBuffer;\r\n\t\t}\r\n\t}\r\n\r\n\t_addBottomRow(rows, fillableSpace){\r\n\t\tvar table = this.tableElement,\r\n\t\taddedRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\tindex = this.vDomBottom + 1,\r\n\t\ti = 0;\r\n\r\n\t\twhile(true){\r\n\t\t\tlet row = rows[index],\r\n\t\t\trowHeight, initialized;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\t\t\t\tinitialized = row.initialized;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\r\n\t\t\t\t\tthis.styleRow(row, index);\r\n\t\t\t\t\ttable.appendChild(row.getElement());\r\n\r\n\t\t\t\t\tif(!row.initialized || !row.heightInitialized){\r\n\t\t\t\t\t\taddedRows.push(row);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\trow.initialize();\r\n\r\n\t\t\t\t\tif(!initialized){\r\n\t\t\t\t\t\trowHeight = row.getElement().offsetHeight;\r\n\r\n\t\t\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tthis.vDomBottom++;\r\n\t\t\t\t\tindex++;\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of addedRows){\r\n\t\t\trow.clearCellHeight();\r\n\t\t}\r\n\r\n\t\tthis._quickNormalizeRowHeight(addedRows);\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomBottomPad -= paddingAdjust;\r\n\r\n\t\t\tif(this.vDomBottomPad < 0 || index == rows.length -1){\r\n\t\t\t\tthis.vDomBottomPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\ttable.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\t\t\tthis.vDomScrollPosBottom += paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_removeBottomRow(rows, fillableSpace){\r\n\t\tvar removableRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\ti = 0;\r\n\r\n\t\twhile(true){\r\n\t\t\tlet row = rows[this.vDomBottom],\r\n\t\t\trowHeight, diff;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\t\t\t\t\tthis.vDomBottom --;\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tremovableRows.push(row);\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of removableRows){\r\n\t\t\tlet rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomBottomPad += paddingAdjust;\r\n\r\n\t\t\tif(this.vDomBottomPad < 0){\r\n\t\t\t\tthis.vDomBottomPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\tthis.tableElement.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\t\t\tthis.vDomScrollPosBottom -= paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_quickNormalizeRowHeight(rows){\r\n\t\tfor(let row of rows){\r\n\t\t\trow.calcHeight();\r\n\t\t}\r\n\r\n\t\tfor(let row of rows){\r\n\t\t\trow.setCellHeight();\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Row from './row/Row.js';\r\nimport RowComponent from './row/RowComponent.js';\r\nimport Helpers from './tools/Helpers.js';\r\n\r\nimport RendererBasicVertical from './rendering/renderers/BasicVertical.js';\r\nimport RendererVirtualDomVertical from './rendering/renderers/VirtualDomVertical.js';\r\n\r\nexport default class RowManager extends CoreFeature{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.element = this.createHolderElement(); //containing element\r\n\t\tthis.tableElement = this.createTableElement(); //table element\r\n\t\tthis.heightFixer = this.createTableElement(); //table element\r\n\t\tthis.placeholder = null; //placeholder element\r\n\t\tthis.placeholderContents = null; //placeholder element\r\n\t\t\r\n\t\tthis.firstRender = false; //handle first render\r\n\t\tthis.renderMode = \"virtual\"; //current rendering mode\r\n\t\tthis.fixedHeight = false; //current rendering mode\r\n\t\t\r\n\t\tthis.rows = []; //hold row data objects\r\n\t\tthis.activeRowsPipeline = []; //hold calculation of active rows\r\n\t\tthis.activeRows = []; //rows currently available to on display in the table\r\n\t\tthis.activeRowsCount = 0; //count of active rows\r\n\t\t\r\n\t\tthis.displayRows = []; //rows currently on display in the table\r\n\t\tthis.displayRowsCount = 0; //count of display rows\r\n\t\t\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.rowNumColumn = false; //hold column component for row number column\r\n\t\t\r\n\t\tthis.redrawBlock = false; //prevent redraws to allow multiple data manipulations before continuing\r\n\t\tthis.redrawBlockRestoreConfig = false; //store latest redraw function calls for when redraw is needed\r\n\t\tthis.redrawBlockRenderInPosition = false; //store latest redraw function calls for when redraw is needed\r\n\t\t\r\n\t\tthis.dataPipeline = []; //hold data pipeline tasks\r\n\t\tthis.displayPipeline = []; //hold data display pipeline tasks\r\n\t\t\r\n\t\tthis.renderer = null;\r\n\t}\r\n\t\r\n\t//////////////// Setup Functions /////////////////\r\n\t\r\n\tcreateHolderElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-tableholder\");\r\n\t\tel.setAttribute(\"tabindex\", 0);\r\n\t\t// el.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tcreateTableElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-table\");\r\n\t\tel.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tinitializePlaceholder(){\r\n\t\t//configure placeholder element\r\n\t\tif(typeof this.table.options.placeholder == \"string\"){\r\n\t\t\tlet el = document.createElement(\"div\");\r\n\t\t\tel.classList.add(\"tabulator-placeholder\");\r\n\t\t\t\r\n\t\t\tlet contents = document.createElement(\"div\");\r\n\t\t\tcontents.classList.add(\"tabulator-placeholder-contents\");\r\n\t\t\tcontents.innerHTML = this.table.options.placeholder;\r\n\t\t\t\r\n\t\t\tel.appendChild(contents);\r\n\t\t\t\r\n\t\t\tthis.placeholderContents = contents;\r\n\t\t\tthis.placeholder = el;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return containing element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\t//return table element\r\n\tgetTableElement(){\r\n\t\treturn this.tableElement;\r\n\t}\r\n\t\r\n\t//return position of row in table\r\n\tgetRowPosition(row, active){\r\n\t\tif(active){\r\n\t\t\treturn this.activeRows.indexOf(row);\r\n\t\t}else{\r\n\t\t\treturn this.rows.indexOf(row);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.initializePlaceholder()\r\n\t\tthis.initializeRenderer();\r\n\t\t\r\n\t\t//initialize manager\r\n\t\tthis.element.appendChild(this.tableElement);\r\n\t\t\r\n\t\tthis.firstRender = true;\r\n\t\t\r\n\t\t//scroll header along with table body\r\n\t\tthis.element.addEventListener(\"scroll\", () => {\r\n\t\t\tvar left = this.element.scrollLeft,\r\n\t\t\tleftDir = this.scrollLeft > left,\r\n\t\t\ttop = this.element.scrollTop,\r\n\t\t\ttopDir = this.scrollTop > top;\r\n\t\t\t\r\n\t\t\t//handle horizontal scrolling\r\n\t\t\tif(this.scrollLeft != left){\r\n\t\t\t\tthis.scrollLeft = left;\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"scroll-horizontal\", left, leftDir);\r\n\t\t\t\tthis.dispatchExternal(\"scrollHorizontal\", left, leftDir);\r\n\r\n\t\t\t\tthis._positionPlaceholder();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//handle vertical scrolling\r\n\t\t\tif(this.scrollTop != top){\r\n\t\t\t\tthis.scrollTop = top;\r\n\t\t\t\t\r\n\t\t\t\tthis.renderer.scrollRows(top, topDir);\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"scroll-vertical\", top, topDir);\r\n\t\t\t\tthis.dispatchExternal(\"scrollVertical\", top, topDir);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t////////////////// Row Manipulation //////////////////\r\n\tfindRow(subject){\r\n\t\tif(typeof subject == \"object\"){\r\n\t\t\tif(subject instanceof Row){\r\n\t\t\t\t//subject is row element\r\n\t\t\t\treturn subject;\r\n\t\t\t}else if(subject instanceof RowComponent){\r\n\t\t\t\t//subject is public row component\r\n\t\t\t\treturn subject._getSelf() || false;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\t\t\t\t//subject is a HTML element of the row\r\n\t\t\t\tlet match = this.rows.find((row) => {\r\n\t\t\t\t\treturn row.getElement() === subject;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\treturn match || false;\r\n\t\t\t}\r\n\t\t}else if(typeof subject == \"undefined\" || subject === null){\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the index of the row\r\n\t\t\tlet match = this.rows.find((row) => {\r\n\t\t\t\treturn row.data[this.table.options.index] == subject;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\treturn match || false;\r\n\t\t}\r\n\t\t\r\n\t\t//catch all for any other type of input\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tgetRowFromDataObject(data){\r\n\t\tvar match = this.rows.find((row) => {\r\n\t\t\treturn row.data === data;\r\n\t\t});\r\n\t\t\r\n\t\treturn match || false;\r\n\t}\r\n\t\r\n\tgetRowFromPosition(position, active){\r\n\t\tif(active){\r\n\t\t\treturn this.activeRows[position];\r\n\t\t}else{\r\n\t\t\treturn this.rows[position];\r\n\t\t}\r\n\t}\r\n\t\r\n\tscrollToRow(row, position, ifVisible){\r\n\t\treturn this.renderer.scrollToRowPosition(row, position, ifVisible);\r\n\t}\r\n\t\r\n\t////////////////// Data Handling //////////////////\r\n\tsetData(data, renderInPosition, columnsChanged){\r\n\t\treturn new Promise((resolve, reject)=>{\r\n\t\t\tif(renderInPosition && this.getDisplayRows().length){\r\n\t\t\t\tif(this.table.options.pagination){\r\n\t\t\t\t\tthis._setDataActual(data, true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.reRenderInPosition(() => {\r\n\t\t\t\t\t\tthis._setDataActual(data);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.options.autoColumns && columnsChanged && this.table.initialized){\r\n\t\t\t\t\tthis.table.columnManager.generateColumnsFromRowData(data);\r\n\t\t\t\t}\r\n\t\t\t\tthis.resetScroll();\r\n\t\t\t\t\r\n\t\t\t\tthis._setDataActual(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\t\r\n\t_setDataActual(data, renderInPosition){\r\n\t\tthis.dispatchExternal(\"dataProcessing\", data);\r\n\t\t\r\n\t\tthis._wipeElements();\r\n\t\t\r\n\t\tif(Array.isArray(data)){\r\n\t\t\tthis.dispatch(\"data-processing\", data);\r\n\t\t\t\r\n\t\t\tdata.forEach((def, i) => {\r\n\t\t\t\tif(def && typeof def === \"object\"){\r\n\t\t\t\t\tvar row = new Row(def, this);\r\n\t\t\t\t\tthis.rows.push(row);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Data Loading Warning - Invalid row data detected and ignored, expecting object but received:\", def);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.refreshActiveData(false, false, renderInPosition);\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"data-processed\", data);\r\n\t\t\tthis.dispatchExternal(\"dataProcessed\", data);\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Data Loading Error - Unable to process data due to invalid data type \\nExpecting: array \\nReceived: \", typeof data, \"\\nData: \", data);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_wipeElements(){\r\n\t\tthis.dispatch(\"rows-wipe\");\r\n\t\t\r\n\t\tthis.rows.forEach((row) => {\r\n\t\t\trow.wipe();\r\n\t\t});\r\n\t\t\r\n\t\tthis.rows = [];\r\n\t\tthis.activeRows = [];\r\n\t\tthis.activeRowsPipeline = [];\r\n\t\tthis.activeRowsCount = 0;\r\n\t\tthis.displayRows = [];\r\n\t\tthis.displayRowsCount = 0;\r\n\t\t\r\n\t\tthis.adjustTableSize();\r\n\t}\r\n\t\r\n\tdeleteRow(row, blockRedraw){\r\n\t\tvar allIndex = this.rows.indexOf(row),\r\n\t\tactiveIndex = this.activeRows.indexOf(row);\r\n\t\t\r\n\t\tif(activeIndex > -1){\r\n\t\t\tthis.activeRows.splice(activeIndex, 1);\r\n\t\t}\r\n\t\t\r\n\t\tif(allIndex > -1){\r\n\t\t\tthis.rows.splice(allIndex, 1);\r\n\t\t}\r\n\t\t\r\n\t\tthis.setActiveRows(this.activeRows);\r\n\t\t\r\n\t\tthis.displayRowIterator((rows) => {\r\n\t\t\tvar displayIndex = rows.indexOf(row);\r\n\t\t\t\r\n\t\t\tif(displayIndex > -1){\r\n\t\t\t\trows.splice(displayIndex, 1);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t}\r\n\t\t\r\n\t\tthis.regenerateRowNumbers();\r\n\t\t\r\n\t\tthis.dispatchExternal(\"rowDeleted\", row.getComponent());\r\n\t\t\r\n\t\tif(!this.displayRowsCount){\r\n\t\t\tthis._showPlaceholder();\r\n\t\t}\r\n\t\t\r\n\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\tthis.dispatchExternal(\"dataChanged\", this.getData());\r\n\t\t}\r\n\t}\r\n\t\r\n\taddRow(data, pos, index, blockRedraw){\r\n\t\tvar row = this.addRowActual(data, pos, index, blockRedraw);\r\n\t\treturn row;\r\n\t}\r\n\t\r\n\t//add multiple rows\r\n\taddRows(data, pos, index){\r\n\t\tvar length = 0,\r\n\t\trows = [];\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tpos = this.findAddRowPos(pos);\r\n\t\t\t\r\n\t\t\tif(!Array.isArray(data)){\r\n\t\t\t\tdata = [data];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tlength = data.length - 1;\r\n\t\t\t\r\n\t\t\tif((typeof index == \"undefined\" && pos) || (typeof index !== \"undefined\" && !pos)){\r\n\t\t\t\tdata.reverse();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdata.forEach((item, i) => {\r\n\t\t\t\tvar row = this.addRow(item, pos, index, true);\r\n\t\t\t\trows.push(row);\r\n\t\t\t\tthis.dispatch(\"row-added\", row, data, pos, index);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.refreshActiveData(false, false, true);\r\n\t\t\t\r\n\t\t\tthis.regenerateRowNumbers();\r\n\t\t\t\r\n\t\t\tif(rows.length){\r\n\t\t\t\tthis._clearPlaceholder();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve(rows);\r\n\t\t});\r\n\t}\r\n\t\r\n\tfindAddRowPos(pos){\r\n\t\tif(typeof pos === \"undefined\"){\r\n\t\t\tpos = this.table.options.addRowPos;\r\n\t\t}\r\n\t\t\r\n\t\tif(pos === \"pos\"){\r\n\t\t\tpos = true;\r\n\t\t}\r\n\t\t\r\n\t\tif(pos === \"bottom\"){\r\n\t\t\tpos = false;\r\n\t\t}\r\n\t\t\r\n\t\treturn pos;\r\n\t}\r\n\t\r\n\taddRowActual(data, pos, index, blockRedraw){\r\n\t\tvar row = data instanceof Row ? data : new Row(data || {}, this),\r\n\t\ttop = this.findAddRowPos(pos),\r\n\t\tallIndex = -1,\r\n\t\tactiveIndex, chainResult;\r\n\t\t\r\n\t\tif(!index){\r\n\t\t\tchainResult = this.chain(\"row-adding-position\", [row, top], null, {index, top});\r\n\t\t\t\r\n\t\t\tindex = chainResult.index;\r\n\t\t\ttop = chainResult.top;\r\n\t\t}\r\n\t\t\r\n\t\tif(typeof index !== \"undefined\"){\r\n\t\t\tindex = this.findRow(index);\r\n\t\t}\r\n\t\t\r\n\t\tindex = this.chain(\"row-adding-index\", [row, index, top], null, index);\r\n\t\t\r\n\t\tif(index){\r\n\t\t\tallIndex = this.rows.indexOf(index);\r\n\t\t}\r\n\t\t\r\n\t\tif(index && allIndex > -1){\r\n\t\t\tactiveIndex = this.activeRows.indexOf(index);\r\n\t\t\t\r\n\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\tvar displayIndex = rows.indexOf(index);\r\n\t\t\t\t\r\n\t\t\t\tif(displayIndex > -1){\r\n\t\t\t\t\trows.splice((top ? displayIndex : displayIndex + 1), 0, row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(activeIndex > -1){\r\n\t\t\t\tthis.activeRows.splice((top ? activeIndex : activeIndex + 1), 0, row);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.rows.splice((top ? allIndex : allIndex + 1), 0, row);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tif(top){\r\n\t\t\t\t\r\n\t\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\t\trows.unshift(row);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.activeRows.unshift(row);\r\n\t\t\t\tthis.rows.unshift(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\t\trows.push(row);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.activeRows.push(row);\r\n\t\t\t\tthis.rows.push(row);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.setActiveRows(this.activeRows);\r\n\t\t\r\n\t\tthis.dispatchExternal(\"rowAdded\", row.getComponent());\r\n\t\t\r\n\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t}\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t}\r\n\t\t\r\n\t\treturn row;\r\n\t}\r\n\t\r\n\tmoveRow(from, to, after){\r\n\t\tthis.dispatch(\"row-move\", from, to, after);\r\n\t\t\r\n\t\tthis.moveRowActual(from, to, after);\r\n\t\t\r\n\t\tthis.regenerateRowNumbers();\r\n\t\t\r\n\t\tthis.dispatch(\"row-moved\", from, to, after);\r\n\t\tthis.dispatchExternal(\"rowMoved\", from.getComponent());\r\n\t}\r\n\t\r\n\tmoveRowActual(from, to, after){\r\n\t\tthis.moveRowInArray(this.rows, from, to, after);\r\n\t\tthis.moveRowInArray(this.activeRows, from, to, after);\r\n\t\t\r\n\t\tthis.displayRowIterator((rows) => {\r\n\t\t\tthis.moveRowInArray(rows, from, to, after);\r\n\t\t});\r\n\t\t\r\n\t\tthis.dispatch(\"row-moving\", from, to, after);\r\n\t}\r\n\t\r\n\tmoveRowInArray(rows, from, to, after){\r\n\t\tvar\tfromIndex, toIndex, start, end;\r\n\t\t\r\n\t\tif(from !== to){\r\n\t\t\t\r\n\t\t\tfromIndex = rows.indexOf(from);\r\n\t\t\t\r\n\t\t\tif (fromIndex > -1) {\r\n\t\t\t\t\r\n\t\t\t\trows.splice(fromIndex, 1);\r\n\t\t\t\t\r\n\t\t\t\ttoIndex = rows.indexOf(to);\r\n\t\t\t\t\r\n\t\t\t\tif (toIndex > -1) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(after){\r\n\t\t\t\t\t\trows.splice(toIndex+1, 0, from);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trows.splice(toIndex, 0, from);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\trows.splice(fromIndex, 0, from);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//restyle rows\r\n\t\t\tif(rows === this.getDisplayRows()){\r\n\t\t\t\t\r\n\t\t\t\tstart = fromIndex < toIndex ? fromIndex : toIndex;\r\n\t\t\t\tend = toIndex > fromIndex ? toIndex : fromIndex +1;\r\n\t\t\t\t\r\n\t\t\t\tfor(let i = start; i <= end; i++){\r\n\t\t\t\t\tif(rows[i]){\r\n\t\t\t\t\t\tthis.styleRow(rows[i], i);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearData(){\r\n\t\tthis.setData([]);\r\n\t}\r\n\t\r\n\tgetRowIndex(row){\r\n\t\treturn this.findRowIndex(row, this.rows);\r\n\t}\r\n\t\r\n\tgetDisplayRowIndex(row){\r\n\t\tvar index = this.getDisplayRows().indexOf(row);\r\n\t\treturn index > -1 ? index : false;\r\n\t}\r\n\t\r\n\tnextDisplayRow(row, rowOnly){\r\n\t\tvar index = this.getDisplayRowIndex(row),\r\n\t\tnextRow = false;\r\n\t\t\r\n\t\t\r\n\t\tif(index !== false && index < this.displayRowsCount -1){\r\n\t\t\tnextRow = this.getDisplayRows()[index+1];\r\n\t\t}\r\n\t\t\r\n\t\tif(nextRow && (!(nextRow instanceof Row) || nextRow.type != \"row\")){\r\n\t\t\treturn this.nextDisplayRow(nextRow, rowOnly);\r\n\t\t}\r\n\t\t\r\n\t\treturn nextRow;\r\n\t}\r\n\t\r\n\tprevDisplayRow(row, rowOnly){\r\n\t\tvar index = this.getDisplayRowIndex(row),\r\n\t\tprevRow = false;\r\n\t\t\r\n\t\tif(index){\r\n\t\t\tprevRow = this.getDisplayRows()[index-1];\r\n\t\t}\r\n\t\t\r\n\t\tif(rowOnly && prevRow && (!(prevRow instanceof Row) || prevRow.type != \"row\")){\r\n\t\t\treturn this.prevDisplayRow(prevRow, rowOnly);\r\n\t\t}\r\n\t\t\r\n\t\treturn prevRow;\r\n\t}\r\n\t\r\n\tfindRowIndex(row, list){\r\n\t\tvar rowIndex;\r\n\t\t\r\n\t\trow = this.findRow(row);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\trowIndex = list.indexOf(row);\r\n\t\t\t\r\n\t\t\tif(rowIndex > -1){\r\n\t\t\t\treturn rowIndex;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tgetData(active, transform){\r\n\t\tvar output = [],\r\n\t\trows = this.getRows(active);\r\n\t\t\r\n\t\trows.forEach(function(row){\r\n\t\t\tif(row.type == \"row\"){\r\n\t\t\t\toutput.push(row.getData(transform || \"data\"));\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetComponents(active){\r\n\t\tvar\toutput = [],\r\n\t\trows = this.getRows(active);\r\n\t\t\r\n\t\trows.forEach(function(row){\r\n\t\t\toutput.push(row.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetDataCount(active){\r\n\t\tvar rows = this.getRows(active);\r\n\t\t\r\n\t\treturn rows.length;\r\n\t}\r\n\t\r\n\tscrollHorizontal(left){\r\n\t\tthis.scrollLeft = left;\r\n\t\tthis.element.scrollLeft = left;\r\n\t\t\r\n\t\tthis.dispatch(\"scroll-horizontal\", left);\r\n\t}\r\n\t\r\n\tregisterDataPipelineHandler(handler, priority){\r\n\t\tif(typeof priority !== \"undefined\"){\r\n\t\t\tthis.dataPipeline.push({handler, priority})\r\n\t\t\tthis.dataPipeline.sort((a, b) => {\r\n\t\t\t\treturn a.priority - b.priority;\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Data pipeline handlers must have a priority in order to be registered\")\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterDisplayPipelineHandler(handler, priority){\r\n\t\tif(typeof priority !== \"undefined\"){\r\n\t\t\tthis.displayPipeline.push({handler, priority})\r\n\t\t\tthis.displayPipeline.sort((a, b) => {\r\n\t\t\t\treturn a.priority - b.priority;\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Display pipeline handlers must have a priority in order to be registered\")\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set active data set\r\n\trefreshActiveData(handler, skipStage, renderInPosition){\r\n\t\tvar table = this.table,\r\n\t\tstage = \"\",\r\n\t\tindex = 0,\r\n\t\tcascadeOrder = [\"all\", \"dataPipeline\", \"display\", \"displayPipeline\", \"end\"],\r\n\t\tdisplayIndex;\r\n\t\t\r\n\t\t\r\n\t\tif(typeof handler === \"function\"){\r\n\t\t\tindex = this.dataPipeline.findIndex((item) => {\r\n\t\t\t\treturn item.handler === handler;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tstage = \"dataPipeline\";\r\n\t\t\t\t\r\n\t\t\t\tif(skipStage){\r\n\t\t\t\t\tif(index == this.dataPipeline.length - 1){\r\n\t\t\t\t\t\tstage = \"display\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tindex = this.displayPipeline.findIndex((item) => {\r\n\t\t\t\t\treturn item.handler === handler;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tstage = \"displayPipeline\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(skipStage){\r\n\t\t\t\t\t\tif(index == this.displayPipeline.length - 1){\r\n\t\t\t\t\t\t\tstage = \"end\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.error(\"Unable to refresh data, invalid handler provided\", handler)\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tstage = handler || \"all\";\r\n\t\t\tindex = 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.redrawBlock){\r\n\t\t\tif(!this.redrawBlockRestoreConfig || (this.redrawBlockRestoreConfig && ((this.redrawBlockRestoreConfig.stage === stage && index < this.redrawBlockRestoreConfig.index) || (cascadeOrder.indexOf(stage) < cascadeOrder.indexOf(this.redrawBlockRestoreConfig.stage))))){\r\n\t\t\t\tthis.redrawBlockRestoreConfig = {\r\n\t\t\t\t\thandler: handler,\r\n\t\t\t\t\tskipStage: skipStage,\r\n\t\t\t\t\trenderInPosition: renderInPosition,\r\n\t\t\t\t\tstage:stage,\r\n\t\t\t\t\tindex:index,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn;\r\n\t\t}else{\r\n\t\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\t\tif(renderInPosition){\r\n\t\t\t\t\tthis.reRenderInPosition(this.refreshPipelines.bind(this, handler, stage, index, renderInPosition));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!handler){\r\n\t\t\t\t\t\tthis.table.columnManager.renderer.renderColumns();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.renderTable();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(table.options.layoutColumnsOnNewData){\r\n\t\t\t\t\t\tthis.table.columnManager.redraw(true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"data-refreshed\");\r\n\t\t}\r\n\t}\r\n\t\r\n\trefreshPipelines(handler, stage, index, renderInPosition){\r\n\t\tthis.dispatch(\"data-refreshing\");\r\n\t\t\r\n\t\tif(!handler){\r\n\t\t\tthis.activeRowsPipeline[0] = this.rows.slice(0);\r\n\t\t}\r\n\t\t\r\n\t\t//cascade through data refresh stages\r\n\t\tswitch(stage){\r\n\t\t\tcase \"all\":\r\n\t\t\t//handle case where alldata needs refreshing\r\n\t\t\t\r\n\t\t\tcase \"dataPipeline\":\r\n\t\t\t\r\n\t\t\tfor(let i = index; i < this.dataPipeline.length; i++){\r\n\t\t\t\tlet result = this.dataPipeline[i].handler(this.activeRowsPipeline[i].slice(0));\r\n\t\t\t\t\r\n\t\t\t\tthis.activeRowsPipeline[i + 1] = result || this.activeRowsPipeline[i].slice(0);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.setActiveRows(this.activeRowsPipeline[this.dataPipeline.length]);\r\n\t\t\t\r\n\t\t\tthis.regenerateRowNumbers();\r\n\t\t\t\r\n\t\t\tcase \"display\":\r\n\t\t\tindex = 0;\r\n\t\t\tthis.resetDisplayRows();\r\n\t\t\t\r\n\t\t\tcase \"displayPipeline\":\r\n\t\t\tfor(let i = index; i < this.displayPipeline.length; i++){\r\n\t\t\t\tlet result = this.displayPipeline[i].handler((i ? this.getDisplayRows(i - 1) : this.activeRows).slice(0), renderInPosition);\r\n\t\t\t\t\r\n\t\t\t\tthis.setDisplayRows(result || this.getDisplayRows(i - 1).slice(0), i);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase \"end\":\r\n\t\t\t//case to handle scenario when trying to skip past end stage\r\n\t\t}\r\n\t}\r\n\t\r\n\t//regenerate row numbers for row number formatter if in use\r\n\tregenerateRowNumbers(){\r\n\t\tif(this.rowNumColumn){\r\n\t\t\tthis.activeRows.forEach((row) => {\r\n\t\t\t\tvar cell = row.getCell(this.rowNumColumn);\r\n\t\t\t\t\r\n\t\t\t\tif(cell){\r\n\t\t\t\t\tcell._generateContents();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetActiveRows(activeRows){\r\n\t\tthis.activeRows = activeRows;\r\n\t\tthis.activeRowsCount = this.activeRows.length;\r\n\t}\r\n\t\r\n\t//reset display rows array\r\n\tresetDisplayRows(){\r\n\t\tthis.displayRows = [];\r\n\t\t\r\n\t\tthis.displayRows.push(this.activeRows.slice(0));\r\n\t\t\r\n\t\tthis.displayRowsCount = this.displayRows[0].length;\r\n\t}\r\n\t\r\n\tgetNextDisplayIndex(){\r\n\t\treturn this.displayRows.length;\r\n\t}\r\n\t\r\n\t//set display row pipeline data\r\n\tsetDisplayRows(displayRows, index){\r\n\t\t\r\n\t\tvar output = true;\r\n\t\t\r\n\t\tif(index && typeof this.displayRows[index] != \"undefined\"){\r\n\t\t\tthis.displayRows[index] = displayRows;\r\n\t\t\toutput = true;\r\n\t\t}else{\r\n\t\t\tthis.displayRows.push(displayRows)\r\n\t\t\toutput = index = this.displayRows.length -1;\r\n\t\t}\r\n\t\t\r\n\t\tif(index == this.displayRows.length -1){\r\n\t\t\tthis.displayRowsCount = this.displayRows[this.displayRows.length -1].length;\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetDisplayRows(index){\r\n\t\tif(typeof index == \"undefined\"){\r\n\t\t\treturn this.displayRows.length ? this.displayRows[this.displayRows.length -1] : [];\r\n\t\t}else{\r\n\t\t\treturn this.displayRows[index] || [];\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetVisibleRows(chain, viewable){\r\n\t\tvar rows = Object.assign([], this.renderer.visibleRows(!viewable));\r\n\t\t\r\n\t\tif(chain){\r\n\t\t\trows = this.chain(\"rows-visible\", [viewable], rows, rows);\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t//repeat action accross display rows\r\n\tdisplayRowIterator(callback){\r\n\t\tthis.activeRowsPipeline.forEach(callback);\r\n\t\tthis.displayRows.forEach(callback);\r\n\t\t\r\n\t\tthis.displayRowsCount = this.displayRows[this.displayRows.length -1].length;\r\n\t}\r\n\t\r\n\t//return only actual rows (not group headers etc)\r\n\tgetRows(type){\r\n\t\tvar rows;\r\n\t\t\r\n\t\tswitch(type){\r\n\t\t\tcase \"active\":\r\n\t\t\trows = this.activeRows;\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"display\":\r\n\t\t\trows = this.table.rowManager.getDisplayRows();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"visible\":\r\n\t\t\trows = this.getVisibleRows(false, true);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\trows = this.chain(\"rows-retrieve\", type, null, this.rows) || this.rows;\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t///////////////// Table Rendering /////////////////\r\n\t//trigger rerender of table in current position\r\n\treRenderInPosition(callback){\r\n\t\tif(this.redrawBlock){\r\n\t\t\tif(callback){\r\n\t\t\t\tcallback();\r\n\t\t\t}else{\r\n\t\t\t\tthis.redrawBlockRenderInPosition = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"renderStarted\");\r\n\t\t\tthis.renderer.rerenderRows(callback);\r\n\t\t\tthis.dispatchExternal(\"renderComplete\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeRenderer(){\r\n\t\tvar renderClass;\r\n\t\t\r\n\t\tvar renderers = {\r\n\t\t\t\"virtual\": RendererVirtualDomVertical,\r\n\t\t\t\"basic\": RendererBasicVertical,\r\n\t\t};\r\n\t\t\r\n\t\tif(typeof this.table.options.renderVertical === \"string\"){\r\n\t\t\trenderClass = renderers[this.table.options.renderVertical];\r\n\t\t}else{\r\n\t\t\trenderClass = this.table.options.renderVertical;\r\n\t\t}\r\n\t\t\r\n\t\tif(renderClass){\r\n\t\t\tthis.renderer = new renderClass(this.table, this.element, this.tableElement);\r\n\t\t\tthis.renderer.initialize();\r\n\t\t\t\r\n\t\t\tif((this.table.element.clientHeight || this.table.options.height)){\r\n\t\t\t\tthis.fixedHeight = true;\r\n\t\t\t}else{\r\n\t\t\t\tthis.fixedHeight = false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Unable to find matching renderer:\", table.options.renderVertical);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRenderMode(){\r\n\t\treturn this.renderMode;\r\n\t}\r\n\t\r\n\trenderTable(){\r\n\t\tthis.dispatchExternal(\"renderStarted\");\r\n\t\t\r\n\t\tthis.element.scrollTop = 0;\r\n\t\t\r\n\t\tthis._clearTable();\r\n\t\t\r\n\t\tif(this.displayRowsCount){\r\n\t\t\tthis.renderer.renderRows();\r\n\t\t\t\r\n\t\t\tif(this.firstRender){\r\n\t\t\t\tthis.firstRender = false;\r\n\t\t\t\tthis.layoutRefresh();\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.renderEmptyScroll();\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.fixedHeight){\r\n\t\t\tthis.adjustTableSize();\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatch(\"table-layout\");\r\n\t\t\r\n\t\tif(!this.displayRowsCount){\r\n\t\t\tthis._showPlaceholder();\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatchExternal(\"renderComplete\");\r\n\t}\r\n\t\r\n\t//show scrollbars on empty table div\r\n\trenderEmptyScroll(){\r\n\t\tif(this.placeholder){\r\n\t\t\tthis.tableElement.style.display = \"none\";\r\n\t\t}else{\r\n\t\t\tthis.tableElement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t\t// this.tableElement.style.minHeight = \"1px\";\r\n\t\t\t// this.tableElement.style.visibility = \"hidden\";\r\n\t\t}\r\n\t}\r\n\t\r\n\t_clearTable(){\r\n\t\tvar element = this.tableElement;\r\n\t\t\r\n\t\tthis._clearPlaceholder();\r\n\t\t\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.renderer.clearRows();\r\n\t}\r\n\t\r\n\t_showPlaceholder(){\r\n\t\tif(this.placeholder){\r\n\t\t\tthis.placeholder.setAttribute(\"tabulator-render-mode\", this.renderMode);\r\n\t\t\t\r\n\t\t\tthis.getElement().appendChild(this.placeholder);\r\n\t\t\tthis._positionPlaceholder();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_clearPlaceholder(){\r\n\t\tif(this.placeholder && this.placeholder.parentNode){\r\n\t\t\tthis.placeholder.parentNode.removeChild(this.placeholder);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_positionPlaceholder(){\r\n\t\tif(this.placeholder && this.placeholder.parentNode){\r\n\t\t\tthis.placeholder.style.width = this.table.columnManager.getWidth() + \"px\";\r\n\t\t\tthis.placeholderContents.style.width = this.table.rowManager.element.clientWidth + \"px\";\r\n\t\t\tthis.placeholderContents.style.marginLeft = this.scrollLeft + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tstyleRow(row, index){\r\n\t\tvar rowEl = row.getElement();\r\n\t\t\r\n\t\tif(index % 2){\r\n\t\t\trowEl.classList.add(\"tabulator-row-even\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-odd\");\r\n\t\t}else{\r\n\t\t\trowEl.classList.add(\"tabulator-row-odd\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-even\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t//normalize height of active rows\r\n\tnormalizeHeight(){\r\n\t\tthis.activeRows.forEach(function(row){\r\n\t\t\trow.normalizeHeight();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//adjust the height of the table holder to fit in the Tabulator element\r\n\tadjustTableSize(){\r\n\t\tvar initialHeight = this.element.clientHeight,\r\n\t\tmodExists;\r\n\t\t\r\n\t\tif(this.renderer.verticalFillMode === \"fill\"){\r\n\t\t\tlet otherHeight = Math.floor(this.table.columnManager.getElement().getBoundingClientRect().height + (this.table.footerManager && this.table.footerManager.active && !this.table.footerManager.external ? this.table.footerManager.getElement().getBoundingClientRect().height : 0));\r\n\t\t\t\r\n\t\t\tif(this.fixedHeight){\r\n\t\t\t\tthis.element.style.minHeight = \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t\tthis.element.style.height = \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t\tthis.element.style.maxHeight = \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.element.style.height = \"\";\r\n\t\t\t\tthis.element.style.height = (this.table.element.clientHeight - otherHeight) + \"px\";\r\n\t\t\t\tthis.element.scrollTop = this.scrollTop;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.renderer.resize();\r\n\t\t\t\r\n\t\t\t//check if the table has changed size when dealing with variable height tables\r\n\t\t\tif(!this.fixedHeight && initialHeight != this.element.clientHeight){\r\n\t\t\t\tif(this.subscribed(\"table-resize\")){\r\n\t\t\t\t\tthis.dispatch(\"table-resize\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.redraw();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis._positionPlaceholder();\r\n\t}\r\n\t\r\n\t//renitialize all rows\r\n\treinitialize(){\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\trow.reinitialize(true);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//prevent table from being redrawn\r\n\tblockRedraw (){\r\n\t\tthis.redrawBlock = true;\r\n\t\tthis.redrawBlockRestoreConfig = false;\r\n\t}\r\n\t\r\n\t//restore table redrawing\r\n\trestoreRedraw (){\r\n\t\tthis.redrawBlock = false;\r\n\t\t\r\n\t\tif(this.redrawBlockRestoreConfig){\r\n\t\t\tthis.refreshActiveData(this.redrawBlockRestoreConfig.handler, this.redrawBlockRestoreConfig.skipStage, this.redrawBlockRestoreConfig.renderInPosition)\r\n\t\t\t\r\n\t\t\tthis.redrawBlockRestoreConfig = false;\r\n\t\t}else{\r\n\t\t\tif(this.redrawBlockRenderInPosition){\r\n\t\t\t\tthis.reRenderInPosition();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.redrawBlockRenderInPosition = false;\r\n\t}\r\n\t\r\n\t//redraw table\r\n\tredraw (force){\r\n\t\tvar pos = 0,\r\n\t\tleft = this.scrollLeft;\r\n\t\t\r\n\t\tthis.adjustTableSize();\r\n\t\t\r\n\t\tthis.table.tableWidth = this.table.element.clientWidth;\r\n\t\t\r\n\t\tif(!force){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t\tthis.scrollHorizontal(left);\r\n\t\t}else{\r\n\t\t\tthis.renderTable();\r\n\t\t}\r\n\t}\r\n\t\r\n\tresetScroll(){\r\n\t\tthis.element.scrollLeft = 0;\r\n\t\tthis.element.scrollTop = 0;\r\n\t\t\r\n\t\tif(this.table.browser === \"ie\"){\r\n\t\t\tvar event = document.createEvent(\"Event\");\r\n\t\t\tevent.initEvent(\"scroll\", false, true);\r\n\t\t\tthis.element.dispatchEvent(event);\r\n\t\t}else{\r\n\t\t\tthis.element.dispatchEvent(new Event('scroll'));\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\n\r\nexport default class FooterManager extends CoreFeature{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.active = false;\r\n\t\tthis.element = this.createElement(); //containing element\r\n\t\tthis.containerElement = this.createContainerElement(); //containing element\r\n\t\tthis.external = false;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.initializeElement();\r\n\t}\r\n\r\n\tcreateElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-footer\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\t\r\n\tcreateContainerElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-footer-contents\");\r\n\r\n\t\tthis.element.appendChild(el);\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitializeElement(){\r\n\t\tif(this.table.options.footerElement){\r\n\r\n\t\t\tswitch(typeof this.table.options.footerElement){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tif(this.table.options.footerElement[0] === \"<\"){\r\n\t\t\t\t\tthis.containerElement.innerHTML = this.table.options.footerElement;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.external = true;\r\n\t\t\t\t\tthis.containerElement = document.querySelector(this.table.options.footerElement);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\tthis.element = this.table.options.footerElement;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\tappend(element){\r\n\t\tthis.activate();\r\n\r\n\t\tthis.containerElement.appendChild(element);\r\n\t\tthis.table.rowManager.adjustTableSize();\r\n\t}\r\n\r\n\tprepend(element){\r\n\t\tthis.activate();\r\n\r\n\t\tthis.element.insertBefore(element, this.element.firstChild);\r\n\t\tthis.table.rowManager.adjustTableSize();\r\n\t}\r\n\r\n\tremove(element){\r\n\t\telement.parentNode.removeChild(element);\r\n\t\tthis.deactivate();\r\n\t}\r\n\r\n\tdeactivate(force){\r\n\t\tif(!this.element.firstChild || force){\r\n\t\t\tif(!this.external){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\t\t\tthis.active = false;\r\n\t\t}\r\n\t}\r\n\r\n\tactivate(){\r\n\t\tif(!this.active){\r\n\t\t\tthis.active = true;\r\n\t\t\tif(!this.external){\r\n\t\t\t\tthis.table.element.appendChild(this.getElement());\r\n\t\t\t\tthis.table.element.style.display = '';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tredraw(){\r\n\t\tthis.dispatch(\"footer-redraw\")\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from './Helpers.js';\r\nimport Row from '../row/Row.js';\r\n\r\nexport default class InteractionManager extends CoreFeature {\r\n\t\r\n\tconstructor (table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.el = null;\r\n\t\t\r\n\t\tthis.abortClasses = [\"tabulator-headers\", \"tabulator-table\"];\r\n\t\t\r\n\t\tthis.previousTargets = {};\r\n\t\t\r\n\t\tthis.listeners = [\r\n\t\t\t\"click\",\r\n\t\t\t\"dblclick\",\r\n\t\t\t\"contextmenu\",\r\n\t\t\t\"mouseenter\",\r\n\t\t\t\"mouseleave\",\r\n\t\t\t\"mouseover\",\r\n\t\t\t\"mouseout\",\r\n\t\t\t\"mousemove\",\r\n\t\t\t\"touchstart\",\r\n\t\t\t\"touchend\",\r\n\t\t];\r\n\t\t\r\n\t\tthis.componentMap = {\r\n\t\t\t\"tabulator-cell\":\"cell\",\r\n\t\t\t\"tabulator-row\":\"row\",\r\n\t\t\t\"tabulator-group\":\"group\",\r\n\t\t\t\"tabulator-col\":\"column\",\r\n\t\t};\r\n\t\t\r\n\t\tthis.pseudoTrackers = {\r\n\t\t\t\"row\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"cell\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"group\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"column\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t}\r\n\t\t\r\n\t\tthis.pseudoTracking = false;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.el = this.table.element;\r\n\t\t\r\n\t\tthis.buildListenerMap();\r\n\t\tthis.bindSubscriptionWatchers();\r\n\t}\r\n\t\r\n\tbuildListenerMap(){\r\n\t\tvar listenerMap = {};\r\n\t\t\r\n\t\tthis.listeners.forEach((listener) => {\r\n\t\t\tlistenerMap[listener] = {\r\n\t\t\t\thandler:null,\r\n\t\t\t\tcomponents:[],\r\n\t\t\t}\r\n\t\t})\r\n\t\t\r\n\t\tthis.listeners = listenerMap;\r\n\t}\r\n\t\r\n\tbindPseudoEvents(){\r\n\t\tObject.keys(this.pseudoTrackers).forEach((key) => {\r\n\t\t\tthis.pseudoTrackers[key].subscriber = this.pseudoMouseEnter.bind(this, key);\r\n\t\t\tthis.subscribe(key + \"-mouseover\", this.pseudoTrackers[key].subscriber);\r\n\t\t});\r\n\t\t\r\n\t\tthis.pseudoTracking = true;\r\n\t}\r\n\t\r\n\tpseudoMouseEnter(key, e, target){\r\n\t\tif(this.pseudoTrackers[key].target !== target){\r\n\t\t\t\r\n\t\t\tif(this.pseudoTrackers[key].target){\r\n\t\t\t\tthis.dispatch(key + \"-mouseleave\", e, this.pseudoTrackers[key].target);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.pseudoMouseLeave(key, e);\r\n\t\t\t\r\n\t\t\tthis.pseudoTrackers[key].target = target;\r\n\t\t\t\r\n\t\t\tthis.dispatch(key + \"-mouseenter\", e, target);\r\n\t\t}\r\n\t}\r\n\t\r\n\tpseudoMouseLeave(key, e){\r\n\t\tvar leaveList = Object.keys(this.pseudoTrackers),\r\n\t\tlinkedKeys = {\r\n\t\t\t\"row\":[\"cell\"],\r\n\t\t\t\"cell\":[\"row\"],\r\n\t\t};\r\n\t\t\r\n\t\tleaveList = leaveList.filter((item) => {\r\n\t\t\tvar links = linkedKeys[key];\r\n\t\t\treturn item !== key && (!links || (links && !links.includes(item)));\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\tleaveList.forEach((key) => {\r\n\t\t\tvar target = this.pseudoTrackers[key].target;\r\n\t\t\t\r\n\t\t\tif(this.pseudoTrackers[key].target){\r\n\t\t\t\tthis.dispatch(key + \"-mouseleave\", e, target);\r\n\t\t\t\t\r\n\t\t\t\tthis.pseudoTrackers[key].target = null;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t\r\n\tbindSubscriptionWatchers(){\r\n\t\tvar listeners = Object.keys(this.listeners),\r\n\t\tcomponents = Object.values(this.componentMap);\r\n\t\t\r\n\t\tfor(let comp of components){\r\n\t\t\tfor(let listener of listeners){\r\n\t\t\t\tlet key = comp + \"-\" + listener;\r\n\t\t\t\t\r\n\t\t\t\tthis.subscriptionChange(key, this.subscriptionChanged.bind(this, comp, listener));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.subscribe(\"table-destroy\", this.clearWatchers.bind(this))\r\n\t}\r\n\t\r\n\tsubscriptionChanged(component, key, added){\r\n\t\tvar listener = this.listeners[key].components,\r\n\t\tindex = listener.indexOf(component),\r\n\t\tchanged = false;\r\n\t\t\r\n\t\tif(added){\r\n\t\t\tif(index === -1){\r\n\t\t\t\tlistener.push(component);\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!this.subscribed(component + \"-\" + key)){\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tlistener.splice(index, 1);\r\n\t\t\t\t\tchanged = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif((key === \"mouseenter\" || key === \"mouseleave\") && !this.pseudoTracking){\r\n\t\t\tthis.bindPseudoEvents();\r\n\t\t}\r\n\t\t\r\n\t\tif(changed){\r\n\t\t\tthis.updateEventListeners();\r\n\t\t}\r\n\t}\r\n\t\r\n\tupdateEventListeners(){\r\n\t\tfor(let key in this.listeners){\r\n\t\t\tlet listener = this.listeners[key];\r\n\t\t\t\r\n\t\t\tif(listener.components.length){\r\n\t\t\t\tif(!listener.handler){\r\n\t\t\t\t\tlistener.handler = this.track.bind(this, key);\r\n\t\t\t\t\tthis.el.addEventListener(key, listener.handler)\r\n\t\t\t\t\t// this.el.addEventListener(key, listener.handler, {passive: true})\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(listener.handler){\r\n\t\t\t\t\tthis.el.removeEventListener(key, listener.handler)\r\n\t\t\t\t\tlistener.handler = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\ttrack(type, e){\r\n\t\tvar path = (e.composedPath && e.composedPath()) || e.path;\r\n\t\t\r\n\t\tvar targets = this.findTargets(path);\r\n\t\ttargets = this.bindComponents(type, targets);\r\n\t\t\r\n\t\tthis.triggerEvents(type, e, targets);\r\n\t\t\r\n\t\tif(this.pseudoTracking && (type == \"mouseover\" || type == \"mouseleave\") && !Object.keys(targets).length){\r\n\t\t\tthis.pseudoMouseLeave(\"none\", e);\r\n\t\t}\r\n\t}\r\n\t\r\n\tfindTargets(path){\r\n\t\tvar targets = {};\r\n\t\t\r\n\t\tlet componentMap = Object.keys(this.componentMap);\r\n\t\t\r\n\t\tfor (let el of path) {\r\n\t\t\tlet classList = el.classList ? [...el.classList] : [];\r\n\t\t\t\r\n\t\t\tlet abort = classList.filter((item) => {\r\n\t\t\t\treturn this.abortClasses.includes(item);\r\n\t\t\t})\r\n\t\t\t\r\n\t\t\tif(abort.length){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tlet elTargets = classList.filter((item) => {\r\n\t\t\t\treturn componentMap.includes(item);\r\n\t\t\t})\r\n\t\t\t\r\n\t\t\tfor (let target of elTargets) {\r\n\t\t\t\ttargets[this.componentMap[target]] = el;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(targets.group && targets.group === targets.row){\r\n\t\t\tdelete targets.row;\r\n\t\t}\r\n\t\t\r\n\t\treturn targets;\r\n\t}\r\n\t\r\n\tbindComponents(type, targets){\r\n\t\t//ensure row component is looked up before cell\r\n\t\tvar keys = Object.keys(targets).reverse(),\r\n\t\tlistener = this.listeners[type],\r\n\t\ttargetMatches = {};\r\n\t\t\r\n\t\tfor(let key of keys){\r\n\t\t\tlet component;\r\n\t\t\tlet target = targets[key];\r\n\t\t\tlet previousTarget = this.previousTargets[key];\r\n\t\t\t\r\n\t\t\tif(previousTarget && previousTarget.target === target){\r\n\t\t\t\tcomponent = previousTarget.component;\r\n\t\t\t}else{\r\n\t\t\t\tswitch(key){\r\n\t\t\t\t\tcase \"row\":\r\n\t\t\t\t\tcase \"group\":\r\n\t\t\t\t\tif(listener.components.includes(\"row\") || listener.components.includes(\"cell\") || listener.components.includes(\"group\")){\r\n\t\t\t\t\t\tlet rows = this.table.rowManager.getVisibleRows(true);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcomponent = rows.find((row) => {\r\n\t\t\t\t\t\t\treturn row.getElement() === target;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(targets[\"row\"] && targets[\"row\"].parentNode && targets[\"row\"].parentNode.closest(\".tabulator-row\")){\r\n\t\t\t\t\t\t\ttargets[key] = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"column\":\r\n\t\t\t\t\tif(listener.components.includes(\"column\")){\r\n\t\t\t\t\t\tcomponent = this.table.columnManager.findColumn(target);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"cell\":\r\n\t\t\t\t\tif(listener.components.includes(\"cell\")){\r\n\t\t\t\t\t\tif(targets[\"row\"] instanceof Row){\r\n\t\t\t\t\t\t\tcomponent = targets[\"row\"].findCell(target);\r\n\t\t\t\t\t\t}else{\t\r\n\t\t\t\t\t\t\tif(targets[\"row\"]){\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?\")\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(component){\r\n\t\t\t\ttargets[key] = component;\r\n\t\t\t\ttargetMatches[key] = {\r\n\t\t\t\t\ttarget:target,\r\n\t\t\t\t\tcomponent:component,\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.previousTargets = targetMatches;\r\n\t\t\r\n\t\treturn targets;\r\n\t}\r\n\t\r\n\ttriggerEvents(type, e, targets){\r\n\t\tvar listener = this.listeners[type];\r\n\t\t\r\n\t\tfor(let key in targets){\r\n\t\t\tif(targets[key] && listener.components.includes(key)){\r\n\t\t\t\tthis.dispatch(key + \"-\" + type, e, targets[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearWatchers(){\r\n\t\tfor(let key in this.listeners){\r\n\t\t\tlet listener = this.listeners[key];\r\n\t\t\t\r\n\t\t\tif(listener.handler){\r\n\t\t\t\tthis.el.removeEventListener(key, listener.handler)\r\n\t\t\t\tlistener.handler = null;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}","export default class ComponentFunctionBinder{\r\n\r\n\tconstructor(table){\r\n\t\tthis.table = table;\r\n\r\n\t\tthis.bindings = {};\r\n\t}\r\n\r\n\tbind(type, funcName, handler){\r\n\t\tif(!this.bindings[type]){\r\n\t\t\tthis.bindings[type] = {};\r\n\t\t}\r\n\r\n\t\tif(this.bindings[type][funcName]){\r\n\t\t\tconsole.warn(\"Unable to bind component handler, a matching function name is already bound\", type, funcName, handler)\r\n\t\t}else{\r\n\t\t\tthis.bindings[type][funcName] = handler;\r\n\t\t}\r\n\t}\r\n\r\n\thandle(type, component, name){\r\n\t\tif(this.bindings[type] && this.bindings[type][name] && typeof this.bindings[type][name].bind === 'function'){\r\n\t\t\treturn this.bindings[type][name].bind(null, component);\r\n\t\t}else{\r\n\t\t\tif(name !== \"then\" && typeof name === \"string\" && !name.startsWith(\"_\")){\r\n\t\t\t\t\tconsole.error(\"The \" + type + \" component does not have a \" + name + \" function, have you checked that you have the correct Tabulator module installed?\")\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n","import CoreFeature from '../CoreFeature.js';\r\n\r\nexport default class DataLoader extends CoreFeature{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.requestOrder = 0; //prevent requests coming out of sequence if overridden by another load request\r\n\t\tthis.loading = false;\r\n\t}\r\n\r\n\tinitialize(){}\r\n\r\n\tload(data, params, config, replace, silent, columnsChanged){\r\n\t\tvar requestNo = ++this.requestOrder;\r\n\r\n\t\tthis.dispatchExternal(\"dataLoading\", data);\r\n\r\n\t\t//parse json data to array\r\n\t\tif (data && (data.indexOf(\"{\") == 0 || data.indexOf(\"[\") == 0)){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\r\n\t\tif(this.confirm(\"data-loading\", [data, params, config, silent])){\r\n\t\t\tthis.loading = true;\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.alertLoader();\r\n\t\t\t}\r\n\r\n\t\t\t//get params for request\r\n\t\t\tparams = this.chain(\"data-params\", [data, config, silent], params || {}, params || {});\r\n\r\n\t\t\tparams = this.mapParams(params, this.table.options.dataSendParams);\r\n\r\n\t\t\tvar result = this.chain(\"data-load\", [data, params, config, silent], false, Promise.resolve([]));\r\n\t\t\t\r\n\t\t\treturn result.then((response) => {\r\n\t\t\t\tif(!Array.isArray(response) && typeof response == \"object\"){\r\n\t\t\t\t\tresponse = this.mapParams(response, this.objectInvert(this.table.options.dataReceiveParams));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar rowData = this.chain(\"data-loaded\", response, null, response);\r\n\r\n\t\t\t\tif(requestNo == this.requestOrder){\r\n\t\t\t\t\tthis.clearAlert();\r\n\r\n\t\t\t\t\tif(rowData !== false){\r\n\t\t\t\t\t\tthis.dispatchExternal(\"dataLoaded\", rowData);\r\n\t\t\t\t\t\tthis.table.rowManager.setData(rowData, replace, typeof columnsChanged === \"undefined\" ? !replace : columnsChanged);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made\");\r\n\t\t\t\t}\r\n\t\t\t}).catch((error) => {\r\n\t\t\t\tconsole.error(\"Data Load Error: \", error);\r\n\t\t\t\tthis.dispatchExternal(\"dataLoadError\", error);\r\n\r\n\t\t\t\tif(!silent){\r\n\t\t\t\t\tthis.alertError();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tthis.clearAlert();\r\n\t\t\t\t}, this.table.options.dataLoaderErrorTimeout);\r\n\t\t\t})\r\n\t\t\t.finally(() => {\r\n\t\t\t\tthis.loading = false;\r\n\t\t\t})\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"dataLoaded\", data);\r\n\r\n\t\t\tif(!data){\r\n\t\t\t\tdata = [];\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.rowManager.setData(data, replace, typeof columnsChanged === \"undefined\" ? !replace : columnsChanged);\r\n\t\t\treturn Promise.resolve();\r\n\t\t}\r\n\t}\r\n\r\n\tmapParams(params, map){\r\n\t\tvar output = {};\r\n\r\n\t\tfor(let key in params){\r\n\t\t\toutput[map.hasOwnProperty(key) ? map[key] : key] = params[key];\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tobjectInvert(obj){\r\n\t\tvar output = {};\r\n\r\n\t\tfor(let key in obj){\r\n\t\t\toutput[obj[key]] = key;\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tblockActiveLoad(){\r\n\t\tthis.requestOrder++;\r\n\t}\r\n\r\n\talertLoader(){\r\n\t\tvar shouldLoad = typeof this.table.options.dataLoader === \"function\" ? this.table.options.dataLoader() : this.table.options.dataLoader;\r\n\r\n\t\tif(shouldLoad){\r\n\t\t\tthis.table.alertManager.alert(this.table.options.dataLoaderLoading || this.langText(\"data|loading\"));\r\n\t\t}\r\n\t}\r\n\r\n\talertError(){\r\n\t\tthis.table.alertManager.alert(this.table.options.dataLoaderError || this.langText(\"data|error\"), \"error\");\r\n\t}\r\n\r\n\tclearAlert(){\r\n\t\tthis.table.alertManager.clear();\r\n\t}\r\n}","export default class ExternalEventBus {\r\n\r\n\tconstructor(table, optionsList, debug){\r\n\t\tthis.table = table;\r\n\t\tthis.events = {};\r\n\t\tthis.optionsList = optionsList || {};\r\n\t\tthis.subscriptionNotifiers = {};\r\n\r\n\t\tthis.dispatch = debug ? this._debugDispatch.bind(this) : this._dispatch.bind(this);\r\n\t\tthis.debug = debug;\r\n\t}\r\n\r\n\tsubscriptionChange(key, callback){\r\n\t\tif(!this.subscriptionNotifiers[key]){\r\n\t\t\tthis.subscriptionNotifiers[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.subscriptionNotifiers[key].push(callback);\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis._notifiySubscriptionChange(key, true);\r\n\t\t}\r\n\t}\r\n\r\n\tsubscribe(key, callback){\r\n\t\tif(!this.events[key]){\r\n\t\t\tthis.events[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.events[key].push(callback);\r\n\r\n\t\tthis._notifiySubscriptionChange(key, true);\r\n\t}\r\n\r\n\tunsubscribe(key, callback){\r\n\t\tvar index;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tif(callback){\r\n\t\t\t\tindex = this.events[key].findIndex((item) => {\r\n\t\t\t\t\treturn item === callback;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tthis.events[key].splice(index, 1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Cannot remove event, no matching event found:\", key, callback);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tdelete this.events[key];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cannot remove event, no events set on:\", key);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._notifiySubscriptionChange(key, false);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.events[key] && this.events[key].length;\r\n\t}\r\n\r\n\t_notifiySubscriptionChange(key, subscribed){\r\n\t\tvar notifiers = this.subscriptionNotifiers[key];\r\n\r\n\t\tif(notifiers){\r\n\t\t\tnotifiers.forEach((callback)=>{\r\n\t\t\t\tcallback(subscribed);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_dispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args.shift(),\r\n\t\tresult;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tthis.events[key].forEach((callback, i) => {\r\n\t\t\t\tlet callResult = callback.apply(this.table, args);\r\n\r\n\t\t\t\tif(!i){\r\n\t\t\t\t\tresult = callResult;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\t_debugDispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"ExternalEvent:\" + args[0];\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._dispatch(...arguments)\r\n\t}\r\n}","export default class InternalEventBus {\r\n\r\n\tconstructor(debug){\r\n\t\tthis.events = {};\r\n\t\tthis.subscriptionNotifiers = {};\r\n\r\n\t\tthis.dispatch = debug ? this._debugDispatch.bind(this) : this._dispatch.bind(this);\r\n\t\tthis.chain = debug ? this._debugChain.bind(this) : this._chain.bind(this);\r\n\t\tthis.confirm = debug ? this._debugConfirm.bind(this) : this._confirm.bind(this);\r\n\t\tthis.debug = debug;\r\n\t}\r\n\r\n\tsubscriptionChange(key, callback){\r\n\t\tif(!this.subscriptionNotifiers[key]){\r\n\t\t\tthis.subscriptionNotifiers[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.subscriptionNotifiers[key].push(callback);\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis._notifiySubscriptionChange(key, true);\r\n\t\t}\r\n\t}\r\n\r\n\tsubscribe(key, callback, priority = 10000){\r\n\t\tif(!this.events[key]){\r\n\t\t\tthis.events[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.events[key].push({callback, priority});\r\n\r\n\t\tthis.events[key].sort((a, b) => {\r\n\t\t\treturn a.priority - b.priority;\r\n\t\t});\r\n\r\n\t\tthis._notifiySubscriptionChange(key, true);\r\n\t}\r\n\r\n\tunsubscribe(key, callback){\r\n\t\tvar index;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tif(callback){\r\n\t\t\t\tindex = this.events[key].findIndex((item) => {\r\n\t\t\t\t\treturn item.callback === callback;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tthis.events[key].splice(index, 1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Cannot remove event, no matching event found:\", key, callback);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cannot remove event, no events set on:\", key);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._notifiySubscriptionChange(key, false);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.events[key] && this.events[key].length;\r\n\t}\r\n\r\n\t_chain(key, args, initialValue, fallback){\r\n\t\tvar value = initialValue;\r\n\r\n\t\tif(!Array.isArray(args)){\r\n\t\t\targs = [args];\r\n\t\t}\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis.events[key].forEach((subscriber, i) => {\r\n\t\t\t\tvalue = subscriber.callback.apply(this, args.concat([value]));\r\n\t\t\t});\r\n\r\n\t\t\treturn value;\r\n\t\t}else{\r\n\t\t\treturn typeof fallback === \"function\" ? fallback() : fallback;\r\n\t\t}\r\n\t}\r\n\r\n\t_confirm(key, args){\r\n\t\tvar confirmed = false;\r\n\r\n\t\tif(!Array.isArray(args)){\r\n\t\t\targs = [args];\r\n\t\t}\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis.events[key].forEach((subscriber, i) => {\r\n\t\t\t\tif(subscriber.callback.apply(this, args)){\r\n\t\t\t\t\tconfirmed = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn confirmed;\r\n\t}\r\n\r\n\t_notifiySubscriptionChange(key, subscribed){\r\n\t\tvar notifiers = this.subscriptionNotifiers[key];\r\n\r\n\t\tif(notifiers){\r\n\t\t\tnotifiers.forEach((callback)=>{\r\n\t\t\t\tcallback(subscribed);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_dispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args.shift();\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tthis.events[key].forEach((subscriber) => {\r\n\t\t\t\tlet callResult = subscriber.callback.apply(this, args);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_debugDispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._dispatch(...arguments);\r\n\t}\r\n\r\n\t_debugChain(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._chain(...arguments);\r\n\t}\r\n\r\n\t_debugConfirm(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._confirm(...arguments);\r\n\t}\r\n}","import Tabulator from '../Tabulator.js';\r\n\r\nclass TableRegistry {\r\n\r\n\tstatic register(table){\r\n\t\tTableRegistry.tables.push(table);\r\n\t}\r\n\r\n\tstatic deregister(table){\r\n\t\tvar index = TableRegistry.tables.indexOf(table);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tTableRegistry.tables.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\tstatic lookupTable(query, silent){\r\n\t\tvar results = [],\r\n\t\tmatches, match;\r\n\r\n\t\tif(typeof query === \"string\"){\r\n\t\t\tmatches = document.querySelectorAll(query);\r\n\r\n\t\t\tif(matches.length){\r\n\t\t\t\tfor(var i = 0; i < matches.length; i++){\r\n\t\t\t\t\tmatch = TableRegistry.matchElement(matches[i]);\r\n\r\n\t\t\t\t\tif(match){\r\n\t\t\t\t\t\tresults.push(match);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}else if((typeof HTMLElement !== \"undefined\" && query instanceof HTMLElement) || query instanceof Tabulator){\r\n\t\t\tmatch = TableRegistry.matchElement(query);\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tresults.push(match);\r\n\t\t\t}\r\n\t\t}else if(Array.isArray(query)){\r\n\t\t\tquery.forEach(function(item){\r\n\t\t\t\tresults = results.concat(TableRegistry.lookupTable(item));\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Table Connection Error - Invalid Selector\", query);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\tstatic matchElement(element){\r\n\t\treturn TableRegistry.tables.find(function(table){\r\n\t\t\treturn element instanceof Tabulator ? table === element : table.element === element;\r\n\t\t});\r\n\t}\r\n}\r\n\r\nTableRegistry.tables = [];\r\n\r\nexport default TableRegistry;","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from './Helpers.js';\r\n\r\nexport default class Popup extends CoreFeature{\r\n constructor(table, element, parent){\r\n super(table);\r\n \r\n this.element = element;\r\n this.container = this._lookupContainer();\r\n \r\n this.parent = parent;\r\n \r\n this.reversedX = false;\r\n this.childPopup = null;\r\n this.blurable = false;\r\n this.blurCallback = null;\r\n this.renderedCallback = null;\r\n \r\n this.visible = false;\r\n \r\n this.element.classList.add(\"tabulator-popup-container\");\r\n \r\n this.blurEvent = this.hide.bind(this, false);\r\n this.escEvent = this._escapeCheck.bind(this);\r\n\r\n this.destroyBinding = this.hide.bind(this, true);\r\n }\r\n \r\n _lookupContainer(){\r\n var container = this.table.options.popupContainer;\r\n \r\n if(typeof container === \"string\"){\r\n container = document.querySelector(container);\r\n \r\n if(!container){\r\n console.warn(\"Menu Error - no container element found matching selector:\", this.table.options.popupContainer , \"(defaulting to document body)\");\r\n }\r\n }else if (container === true){\r\n container = this.table.element;\r\n }\r\n \r\n if(container && !this._checkContainerIsParent(container)){\r\n container = false;\r\n console.warn(\"Menu Error - container element does not contain this table:\", this.table.options.popupContainer , \"(defaulting to document body)\");\r\n }\r\n \r\n if(!container){\r\n container = document.body;\r\n }\r\n \r\n return container;\r\n }\r\n \r\n _checkContainerIsParent(container, element = this.table.element){\r\n if(container === element){\r\n return true;\r\n }else{\r\n return element.parentNode ? this._checkContainerIsParent(container, element.parentNode) : false;\r\n }\r\n }\r\n \r\n renderCallback(callback){\r\n this.renderedCallback = callback;\r\n }\r\n \r\n containerEventCoords(e){\r\n var touch = !(e instanceof MouseEvent);\r\n \r\n var x = touch ? e.touches[0].pageX : e.pageX;\r\n var y = touch ? e.touches[0].pageY : e.pageY;\r\n \r\n if(this.container !== document.body){\r\n let parentOffset = Helpers.elOffset(this.container);\r\n \r\n x -= parentOffset.left;\r\n y -= parentOffset.top;\r\n }\r\n \r\n return {x, y};\r\n }\r\n \r\n elementPositionCoords(element, position = \"right\"){\r\n var offset = Helpers.elOffset(element),\r\n containerOffset, x, y;\r\n \r\n if(this.container !== document.body){\r\n containerOffset = Helpers.elOffset(this.container);\r\n \r\n offset.left -= containerOffset.left;\r\n offset.top -= containerOffset.top;\r\n }\r\n \r\n switch(position){\r\n case \"right\":\r\n x = offset.left + element.offsetWidth;\r\n y = offset.top - 1;\r\n break;\r\n \r\n case \"bottom\":\r\n x = offset.left;\r\n y = offset.top + element.offsetHeight;\r\n break;\r\n }\r\n \r\n return {x, y, offset};\r\n }\r\n \r\n show(origin, position){\r\n var x, y, parentEl, parentOffset, containerOffset, coords;\r\n \r\n if(origin instanceof HTMLElement){\r\n parentEl = origin;\r\n coords = this.elementPositionCoords(origin, position);\r\n \r\n parentOffset = coords.offset;\r\n x = coords.x;\r\n y = coords.y;\r\n \r\n }else if(typeof origin === \"number\"){\r\n parentOffset = {top:0, left:0};\r\n x = origin;\r\n y = position;\r\n }else{\r\n coords = this.containerEventCoords(origin);\r\n \r\n x = coords.x;\r\n y = coords.y;\r\n \r\n this.reversedX = false;\r\n }\r\n \r\n this.element.style.top = y + \"px\";\r\n this.element.style.left = x + \"px\";\r\n \r\n this.container.appendChild(this.element);\r\n \r\n if(typeof this.renderedCallback === \"function\"){\r\n this.renderedCallback();\r\n }\r\n \r\n this._fitToScreen(x, y, parentEl, parentOffset, position);\r\n \r\n this.visible = true;\r\n\r\n this.subscribe(\"table-destroy\", this.destroyBinding);\r\n \r\n return this;\r\n }\r\n \r\n _fitToScreen(x, y, parentEl, parentOffset, position){\r\n var scrollTop = this.container === document.body ? document.documentElement.scrollTop : this.container.scrollTop;\r\n\r\n //move menu to start on right edge if it is too close to the edge of the screen\r\n if((x + this.element.offsetWidth) >= this.container.offsetWidth || this.reversedX){\r\n this.element.style.left = \"\";\r\n \r\n if(parentEl){\r\n this.element.style.right = (this.container.offsetWidth - parentOffset.left) + \"px\";\r\n }else{\r\n this.element.style.right = (this.container.offsetWidth - x) + \"px\";\r\n }\r\n \r\n this.reversedX = true;\r\n }\r\n\r\n //move menu to start on bottom edge if it is too close to the edge of the screen\r\n if((y + this.element.offsetHeight) > Math.max(this.container.offsetHeight, scrollTop ? this.container.scrollHeight : 0)) {\r\n if(parentEl){\r\n switch(position){\r\n case \"bottom\":\r\n this.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight - parentEl.offsetHeight - 1) + \"px\";\r\n break;\r\n\r\n default:\r\n this.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight + parentEl.offsetHeight + 1) + \"px\";\r\n }\r\n \r\n }else{\r\n this.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight) + \"px\";\r\n }\r\n }\r\n }\r\n \r\n isVisible(){\r\n return this.visible;\r\n }\r\n \r\n hideOnBlur(callback){\r\n this.blurable = true;\r\n \r\n if(this.visible){\r\n setTimeout(() => {\r\n this.table.rowManager.element.addEventListener(\"scroll\", this.blurEvent);\r\n this.subscribe(\"cell-editing\", this.blurEvent);\r\n document.body.addEventListener(\"click\", this.blurEvent);\r\n document.body.addEventListener(\"contextmenu\", this.blurEvent);\r\n window.addEventListener(\"resize\", this.blurEvent);\r\n document.body.addEventListener(\"keydown\", this.escEvent);\r\n }, 100);\r\n \r\n this.blurCallback = callback;\r\n }\r\n \r\n return this;\r\n }\r\n \r\n _escapeCheck(e){\r\n if(e.keyCode == 27){\r\n this.hide();\r\n }\r\n }\r\n \r\n hide(silent = false){\r\n if(this.visible){\r\n if(this.blurable){\r\n document.body.removeEventListener(\"keydown\", this.escEvent);\r\n document.body.removeEventListener(\"click\", this.blurEvent);\r\n document.body.removeEventListener(\"contextmenu\", this.blurEvent);\r\n window.removeEventListener(\"resize\", this.blurEvent);\r\n this.table.rowManager.element.removeEventListener(\"scroll\", this.blurEvent);\r\n this.unsubscribe(\"cell-editing\", this.blurEvent);\r\n }\r\n \r\n if(this.childPopup){\r\n this.childPopup.hide();\r\n }\r\n \r\n if(this.parent){\r\n this.parent.childPopup = null;\r\n }\r\n \r\n if(this.element.parentNode){\r\n this.element.parentNode.removeChild(this.element);\r\n }\r\n\r\n this.visible = false;\r\n\r\n if(this.blurCallback && !silent){\r\n this.blurCallback();\r\n }\r\n\r\n this.unsubscribe(\"table-destroy\", this.destroyBinding);\r\n }\r\n \r\n return this;\r\n }\r\n \r\n child(element){\r\n if(this.childPopup){\r\n this.childPopup.hide();\r\n }\r\n \r\n this.childPopup = new Popup(this.table, element, this);\r\n \r\n return this.childPopup;\r\n }\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Popup from './tools/Popup.js';\r\n\r\nclass Module extends CoreFeature{\r\n\r\n\tconstructor(table, name){\r\n\t\tsuper(table);\r\n\r\n\t\tthis._handler = null;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\t// setup module when table is initialized, to be overriden in module\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t////// Options Registration ///////\r\n\t///////////////////////////////////\r\n\r\n\tregisterTableOption(key, value){\r\n\t\tthis.table.optionsList.register(key, value);\r\n\t}\r\n\r\n\tregisterColumnOption(key, value){\r\n\t\tthis.table.columnManager.optionsList.register(key, value);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t/// Public Function Registration ///\r\n\t///////////////////////////////////\r\n\r\n\tregisterTableFunction(name, func){\r\n\t\tif(typeof this.table[name] === \"undefined\"){\r\n\t\t\tthis.table[name] = (...args) => {\r\n\t\t\t\tthis.table.initGuard(name);\r\n\r\n\t\t\t\treturn func(...args);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Unable to bind table function, name already in use\", name)\r\n\t\t}\r\n\t}\r\n\r\n\tregisterComponentFunction(component, func, handler){\r\n\t\treturn this.table.componentFunctionBinder.bind(component, func, handler);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t////////// Data Pipeline //////////\r\n\t///////////////////////////////////\r\n\r\n\tregisterDataHandler(handler, priority){\r\n\t\tthis.table.rowManager.registerDataPipelineHandler(handler, priority)\r\n\t\tthis._handler = handler;\r\n\t}\r\n\r\n\tregisterDisplayHandler(handler, priority){\r\n\t\tthis.table.rowManager.registerDisplayPipelineHandler(handler, priority)\r\n\t\tthis._handler = handler;\r\n\t}\r\n\r\n\trefreshData(renderInPosition, handler){\r\n\t\tif(!handler){\r\n\t\t\thandler = this._handler;\r\n\t\t}\r\n\r\n\t\tif(handler){\r\n\t\t\tthis.table.rowManager.refreshActiveData(handler, false, renderInPosition);\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t//////// Footer Management ////////\r\n\t///////////////////////////////////\r\n\r\n\tfooterAppend(element){\r\n\t\treturn this.table.footerManager.append(element)\r\n\t}\r\n\r\n\tfooterPrepend(element){\r\n\t\treturn this.table.footerManager.prepend(element)\r\n\t}\r\n\r\n\tfooterRemove(element){\r\n\t\treturn this.table.footerManager.remove(element)\r\n\t} \r\n\r\n\t///////////////////////////////////\r\n\t//////// Popups Management ////////\r\n\t///////////////////////////////////\r\n\t\r\n\tpopup(menuEl, menuContainer){\r\n\t\treturn new Popup(this.table, menuEl, menuContainer);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t//////// Alert Management ////////\r\n\t///////////////////////////////////\r\n\r\n\talert(content, type){\r\n\t\treturn this.table.alertManager.alert(content, type);\r\n\t}\r\n\r\n\tclearAlert(){\r\n\t\treturn this.table.alertManager.clear();\r\n\t}\r\n\t\r\n}\r\n\r\nexport default Module;","//resize columns to fit data they contain and stretch row to fill table, also used for fitDataTable\r\nexport default function(columns){\r\n\tcolumns.forEach(function(column){\r\n\t\tcolumn.reinitializeWidth();\r\n\t});\r\n\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n};","import fitData from './modes/fitData.js';\r\nimport fitDataGeneral from './modes/fitDataGeneral.js';\r\nimport fitDataStretch from './modes/fitDataStretch.js';\r\nimport fitColumns from './modes/fitColumns.js';\r\n\r\nexport default {\r\n\tfitData:fitData,\r\n\tfitDataFill:fitDataGeneral,\r\n\tfitDataTable:fitDataGeneral,\r\n\tfitDataStretch:fitDataStretch,\r\n\tfitColumns:fitColumns ,\r\n};","//resize columns to fit data they contain\r\nexport default function(columns){\r\n\tthis.table.columnManager.renderer.reinitializeColumnWidths(columns);\r\n\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n};","//resize columns to fit data the contain and stretch last column to fill table\r\nexport default function(columns){\r\n\tvar colsWidth = 0,\r\n\ttableWidth = this.table.rowManager.element.clientWidth,\r\n\tgap = 0,\r\n\tlastCol = false;\r\n\r\n\tcolumns.forEach((column, i) => {\r\n\t\tif(!column.widthFixed){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t}\r\n\r\n\t\tif(this.table.options.responsiveLayout ? column.modules.responsive.visible : column.visible){\r\n\t\t\tlastCol = column;\r\n\t\t}\r\n\r\n\t\tif(column.visible){\r\n\t\t\tcolsWidth += column.getWidth();\r\n\t\t}\r\n\t});\r\n\r\n\tif(lastCol){\r\n\t\tgap = tableWidth - colsWidth + lastCol.getWidth();\r\n\r\n\t\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\t\tlastCol.setWidth(0);\r\n\t\t\tthis.table.modules.responsiveLayout.update();\r\n\t\t}\r\n\r\n\t\tif(gap > 0){\r\n\t\t\tlastCol.setWidth(gap);\r\n\t\t}else{\r\n\t\t\tlastCol.reinitializeWidth();\r\n\t\t}\r\n\t}else{\r\n\t\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\t\tthis.table.modules.responsiveLayout.update();\r\n\t\t}\r\n\t}\r\n};","//resize columns to fit\r\nexport default function(columns){\r\n\tvar totalWidth = this.table.element.clientWidth; //table element width\r\n\tvar fixedWidth = 0; //total width of columns with a defined width\r\n\tvar flexWidth = 0; //total width available to flexible columns\r\n\tvar flexGrowUnits = 0; //total number of widthGrow blocks accross all columns\r\n\tvar flexColWidth = 0; //desired width of flexible columns\r\n\tvar flexColumns = []; //array of flexible width columns\r\n\tvar fixedShrinkColumns = []; //array of fixed width columns that can shrink\r\n\tvar flexShrinkUnits = 0; //total number of widthShrink blocks accross all columns\r\n\tvar overflowWidth = 0; //horizontal overflow width\r\n\tvar gapFill=0; //number of pixels to be added to final column to close and half pixel gaps\r\n\r\n\tfunction calcWidth(width){\r\n\t\tvar colWidth;\r\n\r\n\t\tif(typeof(width) == \"string\"){\r\n\t\t\tif(width.indexOf(\"%\") > -1){\r\n\t\t\t\tcolWidth = (totalWidth / 100) * parseInt(width);\r\n\t\t\t}else{\r\n\t\t\t\tcolWidth = parseInt(width);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcolWidth = width;\r\n\t\t}\r\n\r\n\t\treturn colWidth;\r\n\t}\r\n\r\n\t//ensure columns resize to take up the correct amount of space\r\n\tfunction scaleColumns(columns, freeSpace, colWidth, shrinkCols){\r\n\r\n\t\tvar oversizeCols = [],\r\n\t\toversizeSpace = 0,\r\n\t\tremainingSpace = 0,\r\n\t\tnextColWidth = 0,\r\n\t\tremainingFlexGrowUnits = flexGrowUnits,\r\n\t\tgap = 0,\r\n\t\tchangeUnits = 0,\r\n\t\tundersizeCols = [];\r\n\r\n\t\tfunction calcGrow(col){\r\n\t\t\treturn (colWidth * (col.column.definition.widthGrow || 1));\r\n\t\t}\r\n\r\n\t\tfunction calcShrink(col){\r\n\t\t\treturn (calcWidth(col.width) - (colWidth * (col.column.definition.widthShrink || 0)))\r\n\t\t}\r\n\r\n\t\tcolumns.forEach(function(col, i){\r\n\t\t\tvar width = shrinkCols ? calcShrink(col) : calcGrow(col);\r\n\t\t\tif(col.column.minWidth >= width){\r\n\t\t\t\toversizeCols.push(col);\r\n\t\t\t}else{\r\n\t\t\t\tif(col.column.maxWidth && col.column.maxWidth < width){\r\n\t\t\t\t\tcol.width = col.column.maxWidth;\r\n\t\t\t\t\tfreeSpace -= col.column.maxWidth;\r\n\r\n\t\t\t\t\tremainingFlexGrowUnits -= shrinkCols ? (col.column.definition.widthShrink || 1) : (col.column.definition.widthGrow || 1);\r\n\r\n\t\t\t\t\tif(remainingFlexGrowUnits){\r\n\t\t\t\t\t\tcolWidth = Math.floor(freeSpace/remainingFlexGrowUnits);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tundersizeCols.push(col);\r\n\t\t\t\t\tchangeUnits += shrinkCols ? (col.column.definition.widthShrink || 1) : (col.column.definition.widthGrow || 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(oversizeCols.length){\r\n\t\t\toversizeCols.forEach(function(col){\r\n\t\t\t\toversizeSpace += shrinkCols ? col.width - col.column.minWidth : col.column.minWidth;\r\n\t\t\t\tcol.width = col.column.minWidth;\r\n\t\t\t});\r\n\r\n\t\t\tremainingSpace = freeSpace - oversizeSpace;\r\n\r\n\t\t\tnextColWidth = changeUnits ? Math.floor(remainingSpace/changeUnits) : remainingSpace;\r\n\r\n\t\t\tgap = remainingSpace - (nextColWidth * changeUnits);\r\n\r\n\t\t\tgap += scaleColumns(undersizeCols, remainingSpace, nextColWidth, shrinkCols);\r\n\t\t}else{\r\n\t\t\tgap = changeUnits ? freeSpace - (Math.floor(freeSpace/changeUnits) * changeUnits) : freeSpace;\r\n\r\n\t\t\tundersizeCols.forEach(function(column){\r\n\t\t\t\tcolumn.width = shrinkCols ? calcShrink(column) : calcGrow(column);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn gap;\r\n\t}\r\n\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n\r\n\t//adjust for vertical scrollbar if present\r\n\tif(this.table.rowManager.element.scrollHeight > this.table.rowManager.element.clientHeight){\r\n\t\ttotalWidth -= this.table.rowManager.element.offsetWidth - this.table.rowManager.element.clientWidth;\r\n\t}\r\n\r\n\tcolumns.forEach(function(column){\r\n\t\tvar width, minWidth, colWidth;\r\n\r\n\t\tif(column.visible){\r\n\r\n\t\t\twidth = column.definition.width;\r\n\t\t\tminWidth = parseInt(column.minWidth);\r\n\r\n\t\t\tif(width){\r\n\r\n\t\t\t\tcolWidth = calcWidth(width);\r\n\r\n\t\t\t\tfixedWidth += colWidth > minWidth ? colWidth : minWidth;\r\n\r\n\t\t\t\tif(column.definition.widthShrink){\r\n\t\t\t\t\tfixedShrinkColumns.push({\r\n\t\t\t\t\t\tcolumn:column,\r\n\t\t\t\t\t\twidth:colWidth > minWidth ? colWidth : minWidth\r\n\t\t\t\t\t});\r\n\t\t\t\t\tflexShrinkUnits += column.definition.widthShrink;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tflexColumns.push({\r\n\t\t\t\t\tcolumn:column,\r\n\t\t\t\t\twidth:0,\r\n\t\t\t\t});\r\n\t\t\t\tflexGrowUnits += column.definition.widthGrow || 1;\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\t//calculate available space\r\n\tflexWidth = totalWidth - fixedWidth;\r\n\r\n\t//calculate correct column size\r\n\tflexColWidth = Math.floor(flexWidth / flexGrowUnits)\r\n\r\n\t//generate column widths\r\n\tvar gapFill = scaleColumns(flexColumns, flexWidth, flexColWidth, false);\r\n\r\n\t//increase width of last column to account for rounding errors\r\n\tif(flexColumns.length && gapFill > 0){\r\n\t\tflexColumns[flexColumns.length-1].width += + gapFill;\r\n\t}\r\n\r\n\t//caculate space for columns to be shrunk into\r\n\tflexColumns.forEach(function(col){\r\n\t\tflexWidth -= col.width;\r\n\t});\r\n\r\n\toverflowWidth = Math.abs(gapFill) + flexWidth;\r\n\r\n\t//shrink oversize columns if there is no available space\r\n\tif(overflowWidth > 0 && flexShrinkUnits){\r\n\t\tgapFill = scaleColumns(fixedShrinkColumns, overflowWidth, Math.floor(overflowWidth / flexShrinkUnits), true);\r\n\t}\r\n\r\n\t//decrease width of last column to account for rounding errors\r\n\tif(fixedShrinkColumns.length){\r\n\t\tfixedShrinkColumns[fixedShrinkColumns.length-1].width -= gapFill;\r\n\t}\r\n\r\n\tflexColumns.forEach(function(col){\r\n\t\tcol.column.setWidth(col.width);\r\n\t});\r\n\r\n\tfixedShrinkColumns.forEach(function(col){\r\n\t\tcol.column.setWidth(col.width);\r\n\t});\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultModes from './defaults/modes.js';\r\n\r\nclass Layout extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table, \"layout\");\r\n\r\n\t\tthis.mode = null;\r\n\r\n\t\tthis.registerTableOption(\"layout\", \"fitData\"); //layout type\r\n\t\tthis.registerTableOption(\"layoutColumnsOnNewData\", false); //update column widths on setData\r\n\r\n\t\tthis.registerColumnOption(\"widthGrow\");\r\n\t\tthis.registerColumnOption(\"widthShrink\");\r\n\t}\r\n\r\n\t//initialize layout system\r\n\tinitialize(){\r\n\t\tvar layout = this.table.options.layout;\r\n\r\n\t\tif(Layout.modes[layout]){\r\n\t\t\tthis.mode = layout;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Layout Error - invalid mode set, defaulting to 'fitData' : \" + layout);\r\n\t\t\tthis.mode = 'fitData';\r\n\t\t}\r\n\r\n\t\tthis.table.element.setAttribute(\"tabulator-layout\", this.mode);\r\n\t}\r\n\r\n\tgetMode(){\r\n\t\treturn this.mode;\r\n\t}\r\n\r\n\t//trigger table layout\r\n\tlayout(){\r\n\t\tthis.dispatch(\"layout-refreshing\")\r\n\t\tLayout.modes[this.mode].call(this, this.table.columnManager.columnsByIndex);\r\n\r\n\t\tthis.dispatch(\"layout-refreshed\")\r\n\t}\r\n}\r\n\r\nLayout.moduleName = \"layout\";\r\n\r\n//load defaults\r\nLayout.modes = defaultModes;\r\n\r\nexport default Layout;","import Module from '../../core/Module.js';\r\n\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defaultLangs from './defaults/langs.js';\r\n\r\nclass Localize extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.locale = \"default\"; //current locale\r\n\t\tthis.lang = false; //current language\r\n\t\tthis.bindings = {}; //update events to call when locale is changed\r\n\t\tthis.langList = {};\r\n\r\n\t\tthis.registerTableOption(\"locale\", false); //current system language\r\n\t\tthis.registerTableOption(\"langs\", {});\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.langList = Helpers.deepClone(Localize.langs);\r\n\r\n\t\tif(this.table.options.columnDefaults.headerFilterPlaceholder !== false){\r\n\t\t\tthis.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder);\r\n\t\t}\r\n\r\n\t\tfor(let locale in this.table.options.langs){\r\n\t\t\tthis.installLang(locale, this.table.options.langs[locale]);\r\n\t\t}\r\n\r\n\t\tthis.setLocale(this.table.options.locale);\r\n\r\n\t\tthis.registerTableFunction(\"setLocale\", this.setLocale.bind(this));\r\n\t\tthis.registerTableFunction(\"getLocale\", this.getLocale.bind(this));\r\n\t\tthis.registerTableFunction(\"getLang\", this.getLang.bind(this));\r\n\t}\r\n\r\n\t//set header placehoder\r\n\tsetHeaderFilterPlaceholder(placeholder){\r\n\t\tthis.langList.default.headerFilters.default = placeholder;\r\n\t}\r\n\r\n\t//set header filter placeholder by column\r\n\tsetHeaderFilterColumnPlaceholder(column, placeholder){\r\n\t\tthis.langList.default.headerFilters.columns[column] = placeholder;\r\n\r\n\t\tif(this.lang && !this.lang.headerFilters.columns[column]){\r\n\t\t\tthis.lang.headerFilters.columns[column] = placeholder;\r\n\t\t}\r\n\t}\r\n\r\n\t//setup a lang description object\r\n\tinstallLang(locale, lang){\r\n\t\tif(this.langList[locale]){\r\n\t\t\tthis._setLangProp(this.langList[locale], lang);\r\n\t\t}else{\r\n\t\t\tthis.langList[locale] = lang;\r\n\t\t}\r\n\t}\r\n\r\n\t_setLangProp(lang, values){\r\n\t\tfor(let key in values){\r\n\t\t\tif(lang[key] && typeof lang[key] == \"object\"){\r\n\t\t\t\tthis._setLangProp(lang[key], values[key])\r\n\t\t\t}else{\r\n\t\t\t\tlang[key] = values[key];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//set current locale\r\n\tsetLocale(desiredLocale){\r\n\t\tdesiredLocale = desiredLocale || \"default\";\r\n\r\n\t\t//fill in any matching languge values\r\n\t\tfunction traverseLang(trans, path){\r\n\t\t\tfor(var prop in trans){\r\n\t\t\t\tif(typeof trans[prop] == \"object\"){\r\n\t\t\t\t\tif(!path[prop]){\r\n\t\t\t\t\t\tpath[prop] = {};\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttraverseLang(trans[prop], path[prop]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tpath[prop] = trans[prop];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//determing correct locale to load\r\n\t\tif(desiredLocale === true && navigator.language){\r\n\t\t\t//get local from system\r\n\t\t\tdesiredLocale = navigator.language.toLowerCase();\r\n\t\t}\r\n\r\n\t\tif(desiredLocale){\r\n\t\t\t//if locale is not set, check for matching top level locale else use default\r\n\t\t\tif(!this.langList[desiredLocale]){\r\n\t\t\t\tlet prefix = desiredLocale.split(\"-\")[0];\r\n\r\n\t\t\t\tif(this.langList[prefix]){\r\n\t\t\t\t\tconsole.warn(\"Localization Error - Exact matching locale not found, using closest match: \", desiredLocale, prefix);\r\n\t\t\t\t\tdesiredLocale = prefix;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Localization Error - Matching locale not found, using default: \", desiredLocale);\r\n\t\t\t\t\tdesiredLocale = \"default\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.locale = desiredLocale;\r\n\r\n\t\t//load default lang template\r\n\t\tthis.lang = Helpers.deepClone(this.langList.default || {});\r\n\r\n\t\tif(desiredLocale != \"default\"){\r\n\t\t\ttraverseLang(this.langList[desiredLocale], this.lang);\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(\"localized\", this.locale, this.lang);\r\n\r\n\t\tthis._executeBindings();\r\n\t}\r\n\r\n\t//get current locale\r\n\tgetLocale(locale){\r\n\t\treturn this.locale;\r\n\t}\r\n\r\n\t//get lang object for given local or current if none provided\r\n\tgetLang(locale){\r\n\t\treturn locale ? this.langList[locale] : this.lang;\r\n\t}\r\n\r\n\t//get text for current locale\r\n\tgetText(path, value){\r\n\t\tvar path = value ? path + \"|\" + value : path,\r\n\t\tpathArray = path.split(\"|\"),\r\n\t\ttext = this._getLangElement(pathArray, this.locale);\r\n\r\n\t\t// if(text === false){\r\n\t\t// \tconsole.warn(\"Localization Error - Matching localized text not found for given path: \", path);\r\n\t\t// }\r\n\r\n\t\treturn text || \"\";\r\n\t}\r\n\r\n\t//traverse langs object and find localized copy\r\n\t_getLangElement(path, locale){\r\n\t\tvar root = this.lang;\r\n\r\n\t\tpath.forEach(function(level){\r\n\t\t\tvar rootPath;\r\n\r\n\t\t\tif(root){\r\n\t\t\t\trootPath = root[level];\r\n\r\n\t\t\t\tif(typeof rootPath != \"undefined\"){\r\n\t\t\t\t\troot = rootPath;\r\n\t\t\t\t}else{\r\n\t\t\t\t\troot = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn root;\r\n\t}\r\n\r\n\t//set update binding\r\n\tbind(path, callback){\r\n\t\tif(!this.bindings[path]){\r\n\t\t\tthis.bindings[path] = [];\r\n\t\t}\r\n\r\n\t\tthis.bindings[path].push(callback);\r\n\r\n\t\tcallback(this.getText(path), this.lang);\r\n\t}\r\n\r\n\t//itterate through bindings and trigger updates\r\n\t_executeBindings(){\r\n\t\tfor(let path in this.bindings){\r\n\t\t\tthis.bindings[path].forEach((binding) => {\r\n\t\t\t\tbinding(this.getText(path), this.lang);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n}\r\n\r\nLocalize.moduleName = \"localize\";\r\n\r\n//load defaults\r\nLocalize.langs = defaultLangs;\r\n\r\nexport default Localize;","export default {\r\n\t\"default\":{ //hold default locale text\r\n\t\t\"groups\":{\r\n\t\t\t\"item\":\"item\",\r\n\t\t\t\"items\":\"items\",\r\n\t\t},\r\n\t\t\"columns\":{\r\n\t\t},\r\n\t\t\"data\":{\r\n\t\t\t\"loading\":\"Loading\",\r\n\t\t\t\"error\":\"Error\",\r\n\t\t},\r\n\t\t\"pagination\":{\r\n\t\t\t\"page_size\":\"Page Size\",\r\n\t\t\t\"page_title\":\"Show Page\",\r\n\t\t\t\"first\":\"First\",\r\n\t\t\t\"first_title\":\"First Page\",\r\n\t\t\t\"last\":\"Last\",\r\n\t\t\t\"last_title\":\"Last Page\",\r\n\t\t\t\"prev\":\"Prev\",\r\n\t\t\t\"prev_title\":\"Prev Page\",\r\n\t\t\t\"next\":\"Next\",\r\n\t\t\t\"next_title\":\"Next Page\",\r\n\t\t\t\"all\":\"All\",\r\n\t\t\t\"counter\":{\r\n\t\t\t\t\"showing\": \"Showing\",\r\n\t\t\t\t\"of\": \"of\",\r\n\t\t\t\t\"rows\": \"rows\",\r\n\t\t\t\t\"pages\": \"pages\",\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"headerFilters\":{\r\n\t\t\t\"default\":\"filter column...\",\r\n\t\t\t\"columns\":{}\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\nimport TableRegistry from '../../core/tools/TableRegistry.js';\r\n\r\nclass Comms extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"tableComms\", this.receive.bind(this));\r\n\t}\r\n\r\n\tgetConnections(selectors){\r\n\t\tvar connections = [],\r\n\t\tconnection;\r\n\r\n\t\tconnection = TableRegistry.lookupTable(selectors);\r\n\r\n\t\tconnection.forEach((con) =>{\r\n\t\t\tif(this.table !== con){\r\n\t\t\t\tconnections.push(con);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn connections;\r\n\t}\r\n\r\n\tsend(selectors, module, action, data){\r\n\t\tvar connections = this.getConnections(selectors);\r\n\r\n\t\tconnections.forEach((connection) => {\r\n\t\t\tconnection.tableComms(this.table.element, module, action, data);\r\n\t\t});\r\n\r\n\t\tif(!connections.length && selectors){\r\n\t\t\tconsole.warn(\"Table Connection Error - No tables matching selector found\", selectors);\r\n\t\t}\r\n\t}\r\n\r\n\treceive(table, module, action, data){\r\n\t\tif(this.table.modExists(module)){\r\n\t\t\treturn this.table.modules[module].commsReceived(table, action, data);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Inter-table Comms Error - no such module:\", module);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nComms.moduleName = \"comms\";\r\n\r\nexport default Comms;","import * as coreModules from '../modules/core.js';\r\nimport TableRegistry from './TableRegistry.js';\r\n\r\nexport default class ModuleBinder {\r\n\t\r\n\tconstructor(tabulator, modules){\r\n\t\tthis.bindStaticFuctionality(tabulator);\r\n\t\tthis.bindModules(tabulator, coreModules, true);\r\n\t\t\r\n\t\tif(modules){\r\n\t\t\tthis.bindModules(tabulator, modules);\r\n\t\t}\r\n\t}\r\n\t\r\n\tbindStaticFuctionality(tabulator){\r\n\t\ttabulator.moduleBindings = {};\r\n\t\t\r\n\t\ttabulator.extendModule = function(name, property, values){\r\n\t\t\tif(tabulator.moduleBindings[name]){\r\n\t\t\t\tvar source = tabulator.moduleBindings[name][property];\r\n\t\t\t\t\r\n\t\t\t\tif(source){\r\n\t\t\t\t\tif(typeof values == \"object\"){\r\n\t\t\t\t\t\tfor(let key in values){\r\n\t\t\t\t\t\t\tsource[key] = values[key];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Module Error - Invalid value type, it must be an object\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Module Error - property does not exist:\", property);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Module Error - module does not exist:\", name);\r\n\t\t\t}\r\n\t\t};\r\n\t\t\r\n\t\ttabulator.registerModule = function(modules){\r\n\t\t\tif(!Array.isArray(modules)){\r\n\t\t\t\tmodules = [modules];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmodules.forEach((mod) => {\r\n\t\t\t\ttabulator.registerModuleBinding(mod)\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\ttabulator.registerModuleBinding = function(mod){\r\n\t\t\ttabulator.moduleBindings[mod.moduleName] = mod;\r\n\t\t};\r\n\t\t\r\n\t\ttabulator.findTable = function(query){\r\n\t\t\tvar results = TableRegistry.lookupTable(query, true);\r\n\t\t\treturn Array.isArray(results) && !results.length ? false : results;\r\n\t\t}\r\n\t\t\r\n\t\t//ensure that module are bound to instantiated function\r\n\t\ttabulator.prototype.bindModules = function(){\r\n\t\t\tvar orderedStartMods = [],\r\n\t\t\torderedEndMods = [],\r\n\t\t\tunOrderedMods = [];\r\n\t\t\t\r\n\t\t\tthis.modules = {};\r\n\t\t\t\r\n\t\t\tfor(var name in tabulator.moduleBindings){\r\n\t\t\t\tlet mod = tabulator.moduleBindings[name];\r\n\t\t\t\tlet module = new mod(this);\r\n\t\t\t\t\r\n\t\t\t\tthis.modules[name] = module;\r\n\t\t\t\t\r\n\t\t\t\tif(mod.prototype.moduleCore){\r\n\t\t\t\t\tthis.modulesCore.push(module);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(mod.moduleInitOrder){\r\n\t\t\t\t\t\tif(mod.moduleInitOrder < 0){\r\n\t\t\t\t\t\t\torderedStartMods.push(module);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\torderedEndMods.push(module);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tunOrderedMods.push(module);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\torderedStartMods.sort((a, b) => a.moduleInitOrder > b.moduleInitOrder ? 1 : -1);\r\n\t\t\torderedEndMods.sort((a, b) => a.moduleInitOrder > b.moduleInitOrder ? 1 : -1);\r\n\t\t\t\r\n\t\t\tthis.modulesRegular = orderedStartMods.concat(unOrderedMods.concat(orderedEndMods));\r\n\t\t}\r\n\t}\r\n\t\r\n\tbindModules(tabulator, modules, core){\r\n\t\tvar mods = Object.values(modules);\r\n\t\t\r\n\t\tif(core){\r\n\t\t\tmods.forEach((mod) => {\r\n\t\t\t\tmod.prototype.moduleCore = true;\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\ttabulator.registerModule(mods);\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from './Helpers.js';\r\n\r\nexport default class Alert extends CoreFeature{\r\n constructor(table){\r\n super(table);\r\n \r\n this.element = this._createAlertElement();\r\n this.msgElement = this._createMsgElement();\r\n this.type = null;\r\n \r\n this.element.appendChild(this.msgElement);\r\n }\r\n \r\n _createAlertElement(){\r\n var el = document.createElement(\"div\");\r\n el.classList.add(\"tabulator-alert\");\r\n return el;\r\n }\r\n \r\n _createMsgElement(){\r\n var el = document.createElement(\"div\");\r\n el.classList.add(\"tabulator-alert-msg\");\r\n el.setAttribute(\"role\", \"alert\");\r\n return el;\r\n }\r\n \r\n _typeClass(){\r\n return \"tabulator-alert-state-\" + this.type;\r\n }\r\n \r\n alert(content, type = \"msg\"){\r\n if(content){\r\n this.clear();\r\n \r\n this.type = type;\r\n \r\n while(this.msgElement.firstChild) this.msgElement.removeChild(this.msgElement.firstChild);\r\n \r\n this.msgElement.classList.add(this._typeClass());\r\n \r\n if(typeof content === \"function\"){\r\n content = content();\r\n }\r\n \r\n if(content instanceof HTMLElement){\r\n this.msgElement.appendChild(content);\r\n }else{\r\n this.msgElement.innerHTML = content;\r\n }\r\n \r\n this.table.element.appendChild(this.element);\r\n }\r\n }\r\n \r\n clear(){\r\n if(this.element.parentNode){\r\n this.element.parentNode.removeChild(this.element);\r\n }\r\n \r\n this.msgElement.classList.remove(this._typeClass());\r\n }\r\n}","'use strict';\r\n\r\nimport defaultOptions from './defaults/options.js';\r\n\r\nimport ColumnManager from './ColumnManager.js';\r\nimport RowManager from './RowManager.js';\r\nimport FooterManager from './FooterManager.js';\r\n\r\nimport InteractionMonitor from './tools/InteractionMonitor.js';\r\nimport ComponentFunctionBinder from './tools/ComponentFunctionBinder.js';\r\nimport DataLoader from './tools/DataLoader.js';\r\n\r\nimport ExternalEventBus from './tools/ExternalEventBus.js';\r\nimport InternalEventBus from './tools/InternalEventBus.js';\r\n\r\nimport TableRegistry from './tools/TableRegistry.js';\r\nimport ModuleBinder from './tools/ModuleBinder.js';\r\n\r\nimport OptionsList from './tools/OptionsList.js';\r\n\r\nimport Alert from './tools/Alert.js';\r\n\r\nclass Tabulator {\r\n\t\r\n\tconstructor(element, options){\r\n\t\t\r\n\t\tthis.options = {};\r\n\t\t\r\n\t\tthis.columnManager = null; // hold Column Manager\r\n\t\tthis.rowManager = null; //hold Row Manager\r\n\t\tthis.footerManager = null; //holder Footer Manager\r\n\t\tthis.alertManager = null; //hold Alert Manager\r\n\t\tthis.vdomHoz = null; //holder horizontal virtual dom\r\n\t\tthis.externalEvents = null; //handle external event messaging\r\n\t\tthis.eventBus = null; //handle internal event messaging\r\n\t\tthis.interactionMonitor = false; //track user interaction\r\n\t\tthis.browser = \"\"; //hold current browser type\r\n\t\tthis.browserSlow = false; //handle reduced functionality for slower browsers\r\n\t\tthis.browserMobile = false; //check if running on mobile, prevent resize cancelling edit on keyboard appearance\r\n\t\tthis.rtl = false; //check if the table is in RTL mode\r\n\t\tthis.originalElement = null; //hold original table element if it has been replaced\r\n\t\t\r\n\t\tthis.componentFunctionBinder = new ComponentFunctionBinder(this); //bind component functions\r\n\t\tthis.dataLoader = false; //bind component functions\r\n\t\t\r\n\t\tthis.modules = {}; //hold all modules bound to this table\r\n\t\tthis.modulesCore = []; //hold core modules bound to this table (for initialization purposes)\r\n\t\tthis.modulesRegular = []; //hold regular modules bound to this table (for initialization purposes)\r\n\t\t\r\n\t\tthis.optionsList = new OptionsList(this, \"table constructor\");\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\t\r\n\t\tif(this.initializeElement(element)){\r\n\t\t\t\r\n\t\t\tthis.initializeCoreSystems(options);\r\n\t\t\t\r\n\t\t\t//delay table creation to allow event bindings immediately after the constructor\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tthis._create();\r\n\t\t\t})\r\n\t\t}\r\n\t\t\r\n\t\tTableRegistry.register(this); //register table for inter-device communication\r\n\t}\r\n\t\r\n\tinitializeElement(element){\r\n\t\tif(typeof HTMLElement !== \"undefined\" && element instanceof HTMLElement){\r\n\t\t\tthis.element = element;\r\n\t\t\treturn true;\r\n\t\t}else if(typeof element === \"string\"){\r\n\t\t\tthis.element = document.querySelector(element);\r\n\t\t\t\r\n\t\t\tif(this.element){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Tabulator Creation Error - no element found matching selector: \", element);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Tabulator Creation Error - Invalid element provided:\", element);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeCoreSystems(options){\r\n\t\tthis.columnManager = new ColumnManager(this);\r\n\t\tthis.rowManager = new RowManager(this);\r\n\t\tthis.footerManager = new FooterManager(this);\r\n\t\tthis.dataLoader = new DataLoader(this);\r\n\t\tthis.alertManager = new Alert(this);\r\n\t\t\r\n\t\tthis.bindModules();\r\n\t\t\r\n\t\tthis.options = this.optionsList.generate(Tabulator.defaultOptions, options)\r\n\t\t\r\n\t\tthis._clearObjectPointers();\r\n\t\t\r\n\t\tthis._mapDeprecatedFunctionality();\r\n\t\t\r\n\t\tthis.externalEvents = new ExternalEventBus(this, this.options, this.options.debugEventsExternal);\r\n\t\tthis.eventBus = new InternalEventBus(this.options.debugEventsInternal);\r\n\t\t\r\n\t\tthis.interactionMonitor = new InteractionMonitor(this);\r\n\t\t\r\n\t\tthis.dataLoader.initialize();\r\n\t\t// this.columnManager.initialize();\r\n\t\t// this.rowManager.initialize();\r\n\t\tthis.footerManager.initialize();\r\n\t}\r\n\t\r\n\t//convert deprecated functionality to new functions\r\n\t_mapDeprecatedFunctionality(){\r\n\t\t//all previously deprecated functionality removed in the 5.0 release\r\n\t}\r\n\t\r\n\t_clearSelection(){\r\n\t\t\r\n\t\tthis.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\tif (window.getSelection) {\r\n\t\t\tif (window.getSelection().empty) { // Chrome\r\n\t\t\t\twindow.getSelection().empty();\r\n\t\t\t} else if (window.getSelection().removeAllRanges) { // Firefox\r\n\t\t\t\twindow.getSelection().removeAllRanges();\r\n\t\t\t}\r\n\t\t} else if (document.selection) { // IE?\r\n\t\t\tdocument.selection.empty();\r\n\t\t}\r\n\t\t\r\n\t\tthis.element.classList.remove(\"tabulator-block-select\");\r\n\t}\r\n\t\r\n\t//create table\r\n\t_create(){\r\n\t\tthis.externalEvents.dispatch(\"tableBuilding\");\r\n\t\tthis.eventBus.dispatch(\"table-building\");\r\n\t\t\r\n\t\tthis._rtlCheck();\r\n\t\t\r\n\t\tthis._buildElement();\r\n\t\t\r\n\t\tthis._initializeTable();\r\n\t\t\r\n\t\tthis._loadInitialData();\r\n\t\t\r\n\t\tthis.initialized = true;\r\n\t\t\r\n\t\tthis.externalEvents.dispatch(\"tableBuilt\");\r\n\t}\r\n\t\r\n\t_rtlCheck(){\r\n\t\tvar style = window.getComputedStyle(this.element);\r\n\t\t\r\n\t\tswitch(this.options.textDirection){\r\n\t\t\tcase\"auto\":\r\n\t\t\tif(style.direction !== \"rtl\"){\r\n\t\t\t\tbreak;\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tcase \"rtl\":\r\n\t\t\tthis.element.classList.add(\"tabulator-rtl\");\r\n\t\t\tthis.rtl = true;\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"ltr\":\r\n\t\t\tthis.element.classList.add(\"tabulator-ltr\");\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\tthis.rtl = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//clear pointers to objects in default config object\r\n\t_clearObjectPointers(){\r\n\t\tthis.options.columns = this.options.columns.slice(0);\r\n\t\t\r\n\t\tif(Array.isArray(this.options.data) && !this.options.reactiveData){\r\n\t\t\tthis.options.data = this.options.data.slice(0);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//build tabulator element\r\n\t_buildElement(){\r\n\t\tvar element = this.element,\r\n\t\toptions = this.options,\r\n\t\tnewElement;\r\n\t\t\r\n\t\tif(element.tagName === \"TABLE\"){\r\n\t\t\tthis.originalElement = this.element;\r\n\t\t\tnewElement = document.createElement(\"div\");\r\n\t\t\t\r\n\t\t\t//transfer attributes to new element\r\n\t\t\tvar attributes = element.attributes;\r\n\t\t\t\r\n\t\t\t// loop through attributes and apply them on div\r\n\t\t\tfor(var i in attributes){\r\n\t\t\t\tif(typeof attributes[i] == \"object\"){\r\n\t\t\t\t\tnewElement.setAttribute(attributes[i].name, attributes[i].value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// replace table with div element\r\n\t\t\telement.parentNode.replaceChild(newElement, element);\r\n\t\t\t\r\n\t\t\tthis.element = element = newElement;\r\n\t\t}\r\n\t\t\r\n\t\telement.classList.add(\"tabulator\");\r\n\t\telement.setAttribute(\"role\", \"grid\");\r\n\t\t\r\n\t\t//empty element\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\t\r\n\t\t//set table height\r\n\t\tif(options.height){\r\n\t\t\toptions.height = isNaN(options.height) ? options.height : options.height + \"px\";\r\n\t\t\telement.style.height = options.height;\r\n\t\t}\r\n\t\t\r\n\t\t//set table min height\r\n\t\tif(options.minHeight !== false){\r\n\t\t\toptions.minHeight = isNaN(options.minHeight) ? options.minHeight : options.minHeight + \"px\";\r\n\t\t\telement.style.minHeight = options.minHeight;\r\n\t\t}\r\n\t\t\r\n\t\t//set table maxHeight\r\n\t\tif(options.maxHeight !== false){\r\n\t\t\toptions.maxHeight = isNaN(options.maxHeight) ? options.maxHeight : options.maxHeight + \"px\";\r\n\t\t\telement.style.maxHeight = options.maxHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//initialize core systems and modules\r\n\t_initializeTable(){\r\n\t\tvar element = this.element,\r\n\t\toptions = this.options;\r\n\t\t\r\n\t\tthis.interactionMonitor.initialize();\r\n\t\t\r\n\t\tthis.columnManager.initialize();\r\n\t\tthis.rowManager.initialize();\r\n\t\t\r\n\t\tthis._detectBrowser();\r\n\t\t\r\n\t\t//initialize core modules\r\n\t\tthis.modulesCore.forEach((mod) => {\r\n\t\t\tmod.initialize();\r\n\t\t})\r\n\t\t\r\n\t\t//build table elements\r\n\t\telement.appendChild(this.columnManager.getElement());\r\n\t\telement.appendChild(this.rowManager.getElement());\r\n\t\t\r\n\t\tif(options.footerElement){\r\n\t\t\tthis.footerManager.activate();\r\n\t\t}\r\n\t\t\r\n\t\tif(options.autoColumns && options.data){\r\n\t\t\t\r\n\t\t\tthis.columnManager.generateColumnsFromRowData(this.options.data);\r\n\t\t}\r\n\t\t\r\n\t\t//initialize regular modules\r\n\t\tthis.modulesRegular.forEach((mod) => {\r\n\t\t\tmod.initialize();\r\n\t\t});\r\n\t\t\r\n\t\tthis.columnManager.setColumns(options.columns);\r\n\t\t\r\n\t\tthis.eventBus.dispatch(\"table-built\");\r\n\t}\r\n\t\r\n\t_loadInitialData(){\r\n\t\tthis.dataLoader.load(this.options.data);\r\n\t}\r\n\t\r\n\t//deconstructor\r\n\tdestroy(){\r\n\t\tvar element = this.element;\r\n\t\t\r\n\t\tTableRegistry.deregister(this); //deregister table from inter-device communication\r\n\t\t\r\n\t\tthis.eventBus.dispatch(\"table-destroy\");\r\n\t\t\r\n\t\t//clear row data\r\n\t\tthis.rowManager.rows.forEach(function(row){\r\n\t\t\trow.wipe();\r\n\t\t});\r\n\t\t\r\n\t\tthis.rowManager.rows = [];\r\n\t\tthis.rowManager.activeRows = [];\r\n\t\tthis.rowManager.displayRows = [];\r\n\t\t\r\n\t\t//clear DOM\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\telement.classList.remove(\"tabulator\");\r\n\t}\r\n\t\r\n\t_detectBrowser(){\r\n\t\tvar ua = navigator.userAgent||navigator.vendor||window.opera;\r\n\t\t\r\n\t\tif(ua.indexOf(\"Trident\") > -1){\r\n\t\t\tthis.browser = \"ie\";\r\n\t\t\tthis.browserSlow = true;\r\n\t\t}else if(ua.indexOf(\"Edge\") > -1){\r\n\t\t\tthis.browser = \"edge\";\r\n\t\t\tthis.browserSlow = true;\r\n\t\t}else if(ua.indexOf(\"Firefox\") > -1){\r\n\t\t\tthis.browser = \"firefox\";\r\n\t\t\tthis.browserSlow = false;\r\n\t\t}else{\r\n\t\t\tthis.browser = \"other\";\r\n\t\t\tthis.browserSlow = false;\r\n\t\t}\r\n\t\t\r\n\t\tthis.browserMobile = /(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ua)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(ua.slice(0,4));\r\n\t}\r\n\t\r\n\tinitGuard(func, msg){\r\n\t\tvar stack, line;\r\n\t\t\r\n\t\tif(this.options.debugInitialization && !this.initialized){\r\n\t\t\tif(!func){\r\n\t\t\t\tstack = new Error().stack.split(\"\\n\");\r\n\t\t\t\t\r\n\t\t\t\tline = stack[0] == \"Error\" ? stack[2] : stack[1];\r\n\t\t\t\t\r\n\t\t\t\tif(line[0] == \" \"){\r\n\t\t\t\t\tfunc = line.trim().split(\" \")[1].split(\".\")[1];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfunc = line.trim().split(\"@\")[0];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconsole.warn(\"Table Not Initialized - Calling the \" + func + \" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function.\" + (msg ? \" \" + msg : \"\"));\r\n\t\t}\r\n\t\t\r\n\t\treturn this.initialized;\r\n\t}\r\n\t\r\n\t////////////////// Data Handling //////////////////\r\n\t//block table redrawing\r\n\tblockRedraw(){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.rowManager.blockRedraw();\r\n\t}\r\n\t\r\n\t//restore table redrawing\r\n\trestoreRedraw(){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.rowManager.restoreRedraw();\r\n\t}\r\n\t\r\n\t//load data\r\n\tsetData(data, params, config){\r\n\t\tthis.initGuard(false, \"To set initial data please use the 'data' property in the table constructor.\");\r\n\t\t\r\n\t\treturn this.dataLoader.load(data, params, config, false);\r\n\t}\r\n\t\r\n\t//clear data\r\n\tclearData(){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tthis.dataLoader.blockActiveLoad();\r\n\t\tthis.rowManager.clearData();\r\n\t}\r\n\t\r\n\t//get table data array\r\n\tgetData(active){\r\n\t\treturn this.rowManager.getData(active);\r\n\t}\r\n\t\r\n\t//get table data array count\r\n\tgetDataCount(active){\r\n\t\treturn this.rowManager.getDataCount(active);\r\n\t}\r\n\t\r\n\t//replace data, keeping table in position with same sort\r\n\treplaceData(data, params, config){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.dataLoader.load(data, params, config, true, true);\r\n\t}\r\n\t\r\n\t//update table data\r\n\tupdateData(data){\r\n\t\tvar responses = 0;\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data){\r\n\t\t\t\tdata.forEach((item) => {\r\n\t\t\t\t\tvar row = this.rowManager.findRow(item[this.options.index]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(row){\r\n\t\t\t\t\t\tresponses++;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trow.updateData(item)\r\n\t\t\t\t\t\t.then(()=>{\r\n\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\tresolve();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\taddData(data, pos, index){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data){\r\n\t\t\t\tthis.rowManager.addRows(data, pos, index)\r\n\t\t\t\t.then((rows) => {\r\n\t\t\t\t\tvar output = [];\r\n\t\t\t\t\t\r\n\t\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\t\toutput.push(row.getComponent());\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tresolve(output);\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//update table data\r\n\tupdateOrAddData(data){\r\n\t\tvar rows = [],\r\n\t\tresponses = 0;\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data){\r\n\t\t\t\tdata.forEach((item) => {\r\n\t\t\t\t\tvar row = this.rowManager.findRow(item[this.options.index]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tresponses++;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(row){\r\n\t\t\t\t\t\trow.updateData(item)\r\n\t\t\t\t\t\t.then(()=>{\r\n\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\trows.push(row.getComponent());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\tresolve(rows);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.rowManager.addRows(item)\r\n\t\t\t\t\t\t.then((newRows)=>{\r\n\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\trows.push(newRows[0].getComponent());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\tresolve(rows);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//get row object\r\n\tgetRow(index){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching row found:\", index);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//get row object\r\n\tgetRowFromPosition(position, active){\r\n\t\tvar row = this.rowManager.getRowFromPosition(position, active);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching row found:\", position);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//delete row from table\r\n\tdeleteRow(index){\r\n\t\tvar foundRows = [];\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(!Array.isArray(index)){\r\n\t\t\tindex = [index];\r\n\t\t}\r\n\t\t\r\n\t\t//find matching rows\r\n\t\tfor(let item of index){\r\n\t\t\tlet row = this.rowManager.findRow(item, true);\r\n\t\t\t\r\n\t\t\tif(row){\r\n\t\t\t\tfoundRows.push(row);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Delete Error - No matching row found:\", item);\r\n\t\t\t\treturn Promise.reject(\"Delete Error - No matching row found\")\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//sort rows into correct order to ensure smooth delete from table\r\n\t\tfoundRows.sort((a, b) => {\r\n\t\t\treturn this.rowManager.rows.indexOf(a) > this.rowManager.rows.indexOf(b) ? 1 : -1;\r\n\t\t});\r\n\t\t\r\n\t\t//delete rows\r\n\t\tfoundRows.forEach((row) =>{\r\n\t\t\trow.delete()\r\n\t\t});\r\n\t\t\r\n\t\tthis.rowManager.reRenderInPosition();\r\n\t\t\r\n\t\treturn Promise.resolve();\r\n\t}\r\n\t\r\n\t//add row to table\r\n\taddRow(data, pos, index){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.rowManager.addRows(data, pos, index)\r\n\t\t.then((rows)=>{\r\n\t\t\treturn rows[0].getComponent();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//update a row if it exitsts otherwise create it\r\n\tupdateOrAddRow(index, data){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.updateData(data)\r\n\t\t\t.then(()=>{\r\n\t\t\t\treturn row.getComponent();\r\n\t\t\t})\r\n\t\t}else{\r\n\t\t\treturn this.rowManager.addRows(data)\r\n\t\t\t.then((rows)=>{\r\n\t\t\t\treturn rows[0].getComponent();\r\n\t\t\t})\r\n\t\t}\r\n\t}\r\n\t\r\n\t//update row data\r\n\tupdateRow(index, data){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.updateData(data)\r\n\t\t\t.then(()=>{\r\n\t\t\t\treturn Promise.resolve(row.getComponent());\r\n\t\t\t})\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Update Error - No matching row found:\", index);\r\n\t\t\treturn Promise.reject(\"Update Error - No matching row found\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t//scroll to row in DOM\r\n\tscrollToRow(index, position, ifVisible){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn this.rowManager.scrollToRow(row, position, ifVisible)\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Scroll Error - No matching row found:\", index);\r\n\t\t\treturn Promise.reject(\"Scroll Error - No matching row found\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveRow(from, to, after){\r\n\t\tvar fromRow = this.rowManager.findRow(from);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(fromRow){\r\n\t\t\tfromRow.moveToRow(to, after);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching row found:\", from);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRows(active){\r\n\t\treturn this.rowManager.getComponents(active);\t\r\n\t}\r\n\t\r\n\t//get position of row in table\r\n\tgetRowPosition(index, active){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn this.rowManager.getRowPosition(row, active);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Position Error - No matching row found:\", index);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t/////////////// Column Functions ///////////////\r\n\tsetColumns(definition){\r\n\t\tthis.initGuard(false, \"To set initial columns please use the 'columns' property in the table constructor\");\r\n\t\t\r\n\t\tthis.columnManager.setColumns(definition);\r\n\t}\r\n\t\r\n\tgetColumns(structured){\r\n\t\treturn this.columnManager.getComponents(structured);\r\n\t}\r\n\t\r\n\tgetColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetColumnDefinitions(){\r\n\t\treturn this.columnManager.getDefinitionTree();\r\n\t}\r\n\t\r\n\tshowColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tcolumn.show();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Show Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\thideColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field); \r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tcolumn.hide();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Hide Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\ttoggleColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tif(column.visible){\r\n\t\t\t\tcolumn.hide();\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.show();\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Visibility Toggle Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColumn(definition, before, field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.columnManager.addColumn(definition, before, column)\r\n\t\t.then((column) => {\r\n\t\t\treturn column.getComponent();\r\n\t\t});\r\n\t}\r\n\t\r\n\tdeleteColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.delete();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Delete Error - No matching column found:\", field);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tupdateColumnDefinition(field, definition){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.updateDefinition(definition)\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Update Error - No matching column found:\", field);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveColumn(from, to, after){\r\n\t\tvar fromColumn = this.columnManager.findColumn(from),\r\n\t\ttoColumn = this.columnManager.findColumn(to);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(fromColumn){\r\n\t\t\tif(toColumn){\r\n\t\t\t\tthis.columnManager.moveColumn(fromColumn, toColumn, after)\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Move Error - No matching column found:\", toColumn);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching column found:\", from);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//scroll to column in DOM\r\n\tscrollToColumn(field, position, ifVisible){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\treturn this.columnManager.scrollToColumn(column, position, ifVisible)\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - No matching column found:\", field);\r\n\t\t\t\treturn Promise.reject(\"Scroll Error - No matching column found\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//////////// General Public Functions ////////////\r\n\t//redraw list without updating data\r\n\tredraw(force){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.columnManager.redraw(force);\r\n\t\tthis.rowManager.redraw(force);\r\n\t}\r\n\t\r\n\tsetHeight(height){\r\n\t\tthis.options.height = isNaN(height) ? height : height + \"px\";\r\n\t\tthis.element.style.height = this.options.height;\r\n\t\tthis.rowManager.initializeRenderer();\r\n\t\tthis.rowManager.redraw();\r\n\t}\r\n\t\r\n\t//////////////////// Event Bus ///////////////////\r\n\t\r\n\ton(key, callback){\r\n\t\tthis.externalEvents.subscribe(key, callback);\r\n\t}\r\n\t\r\n\toff(key, callback){\r\n\t\tthis.externalEvents.unsubscribe(key, callback);\r\n\t}\r\n\t\r\n\tdispatchEvent(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args.shift();\r\n\t\t\r\n\t\tthis.externalEvents.dispatch(...arguments)\r\n\t}\r\n\r\n\t//////////////////// Alerts ///////////////////\r\n\r\n\talert(contents, type){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.alertManager.alert(contents, type);\r\n\t}\r\n\r\n\tclearAlert(){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.alertManager.clear();\r\n\t}\r\n\t\r\n\t////////////// Extension Management //////////////\r\n\tmodExists(plugin, required){\r\n\t\tif(this.modules[plugin]){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tif(required){\r\n\t\t\t\tconsole.error(\"Tabulator Module Not Installed: \" + plugin);\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tmodule(key){\r\n\t\tvar mod = this.modules[key];\r\n\t\t\r\n\t\tif(!mod){\r\n\t\t\tconsole.error(\"Tabulator module not installed: \" + key);\r\n\t\t}\r\n\t\t\r\n\t\treturn mod;\r\n\t}\r\n}\r\n\r\n//default setup options\r\nTabulator.defaultOptions = defaultOptions;\r\n\r\n//bind modules and static functionality\r\nnew ModuleBinder(Tabulator);\r\n\r\nexport default Tabulator;\r\n","export default {\r\n\r\n\tdebugEventsExternal:false, //flag to console log events\r\n\tdebugEventsInternal:false, //flag to console log events\r\n\tdebugInvalidOptions:true, //allow toggling of invalid option warnings\r\n\tdebugInitialization:true, //allow toggling of invalid option warnings\r\n\r\n\theight:false, //height of tabulator\r\n\tminHeight:false, //minimum height of tabulator\r\n\tmaxHeight:false, //maximum height of tabulator\r\n\r\n\tcolumnHeaderVertAlign:\"top\", //vertical alignment of column headers\r\n\r\n\tpopupContainer:false,\r\n\r\n\tcolumns:[],//store for colum header info\r\n\tcolumnDefaults:{}, //store column default props\r\n\r\n\tdata:false, //default starting data\r\n\r\n\tautoColumns:false, //build columns from data row structure\r\n\tautoColumnsDefinitions:false,\r\n\r\n\tnestedFieldSeparator:\".\", //separator for nested data\r\n\r\n\tfooterElement:false, //hold footer element\r\n\r\n\tindex:\"id\", //filed for row index\r\n\r\n\ttextDirection:\"auto\",\r\n\r\n\taddRowPos:\"bottom\", //position to insert blank rows, top|bottom\r\n\r\n\theaderVisible:true, //hide header\r\n\r\n\trenderVertical:\"virtual\",\r\n\trenderHorizontal:\"basic\",\r\n\trenderVerticalBuffer:0, // set virtual DOM buffer size\r\n\r\n\tscrollToRowPosition:\"top\",\r\n\tscrollToRowIfVisible:true,\r\n\r\n\tscrollToColumnPosition:\"left\",\r\n\tscrollToColumnIfVisible:true,\r\n\r\n\trowFormatter:false,\r\n\trowFormatterPrint:null,\r\n\trowFormatterClipboard:null,\r\n\trowFormatterHtmlOutput:null,\r\n\r\n\trowHeight:null,\r\n\r\n\tplaceholder:false,\r\n\r\n\tdataLoader:true,\r\n\tdataLoaderLoading:false,\r\n\tdataLoaderError:false,\r\n\tdataLoaderErrorTimeout:3000,\r\n\r\n\tdataSendParams:{},\r\n\r\n\tdataReceiveParams:{},\r\n}\r\n","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defautlAccessors from './defaults/accessors.js';\r\n\r\nclass Accessor extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.allowedTypes = [\"\", \"data\", \"download\", \"clipboard\", \"print\", \"htmlOutput\"] //list of accessor types\r\n\r\n\t\tthis.registerColumnOption(\"accessor\");\r\n\t\tthis.registerColumnOption(\"accessorParams\");\r\n\t\tthis.registerColumnOption(\"accessorData\");\r\n\t\tthis.registerColumnOption(\"accessorDataParams\");\r\n\t\tthis.registerColumnOption(\"accessorDownload\");\r\n\t\tthis.registerColumnOption(\"accessorDownloadParams\");\r\n\t\tthis.registerColumnOption(\"accessorClipboard\");\r\n\t\tthis.registerColumnOption(\"accessorClipboardParams\");\r\n\t\tthis.registerColumnOption(\"accessorPrint\");\r\n\t\tthis.registerColumnOption(\"accessorPrintParams\");\r\n\t\tthis.registerColumnOption(\"accessorHtmlOutput\");\r\n\t\tthis.registerColumnOption(\"accessorHtmlOutputParams\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"row-data-retrieve\", this.transformRow.bind(this));\r\n\t}\r\n\r\n\t//initialize column accessor\r\n\tinitializeColumn(column){\r\n\t\tvar match = false,\r\n\t\tconfig = {};\r\n\r\n\t\tthis.allowedTypes.forEach((type) => {\r\n\t\t\tvar key = \"accessor\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\t\taccessor;\r\n\r\n\t\t\tif(column.definition[key]){\r\n\t\t\t\taccessor = this.lookupAccessor(column.definition[key]);\r\n\r\n\t\t\t\tif(accessor){\r\n\t\t\t\t\tmatch = true;\r\n\r\n\t\t\t\t\tconfig[key] = {\r\n\t\t\t\t\t\taccessor:accessor,\r\n\t\t\t\t\t\tparams: column.definition[key + \"Params\"] || {},\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(match){\r\n\t\t\tcolumn.modules.accessor = config;\r\n\t\t}\r\n\t}\r\n\r\n\tlookupAccessor(value){\r\n\t\tvar accessor = false;\r\n\r\n\t\t//set column accessor\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(Accessor.accessors[value]){\r\n\t\t\t\taccessor = Accessor.accessors[value]\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Accessor Error - No such accessor found, ignoring: \", value);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\taccessor = value;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn accessor;\r\n\t}\r\n\r\n\t//apply accessor to row\r\n\ttransformRow(row, type){\r\n\t\tvar key = \"accessor\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\trowComponent = row.getComponent();\r\n\r\n\t\t//clone data object with deep copy to isolate internal data from returned result\r\n\t\tvar data = Helpers.deepClone(row.data || {});\r\n\r\n\t\tthis.table.columnManager.traverse(function(column){\r\n\t\t\tvar value, accessor, params, colCompnent;\r\n\r\n\t\t\tif(column.modules.accessor){\r\n\r\n\t\t\t\taccessor = column.modules.accessor[key] || column.modules.accessor.accessor || false;\r\n\r\n\t\t\t\tif(accessor){\r\n\t\t\t\t\tvalue = column.getFieldValue(data);\r\n\r\n\t\t\t\t\tif(value != \"undefined\"){\r\n\t\t\t\t\t\tcolCompnent = column.getComponent();\r\n\t\t\t\t\t\tparams = typeof accessor.params === \"function\" ? accessor.params(value, data, type, colCompnent, rowComponent) : accessor.params;\r\n\t\t\t\t\t\tcolumn.setFieldValue(data, accessor.accessor(value, data, type, params, colCompnent, rowComponent));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n}\r\n\r\n//load defaults\r\nAccessor.moduleName = \"accessor\";\r\nAccessor.accessors = defautlAccessors;\r\n\r\nexport default Accessor;","export default {}","function generateParamsList(data, prefix){\r\n\tvar output = [];\r\n\r\n\tprefix = prefix || \"\";\r\n\r\n\tif(Array.isArray(data)){\r\n\t\tdata.forEach((item, i) => {\r\n\t\t\toutput = output.concat(generateParamsList(item, prefix ? prefix + \"[\" + i + \"]\" : i));\r\n\t\t});\r\n\t}else if (typeof data === \"object\"){\r\n\t\tfor (var key in data){\r\n\t\t\toutput = output.concat(generateParamsList(data[key], prefix ? prefix + \"[\" + key + \"]\" : key));\r\n\t\t}\r\n\t}else{\r\n\t\toutput.push({key:prefix, value:data});\r\n\t}\r\n\r\n\treturn output;\r\n}\r\n\r\nfunction serializeParams(params){\r\n\tvar output = generateParamsList(params),\r\n\tencoded = [];\r\n\r\n\toutput.forEach(function(item){\r\n\t\tencoded.push(encodeURIComponent(item.key) + \"=\" + encodeURIComponent(item.value));\r\n\t});\r\n\r\n\treturn encoded.join(\"&\");\r\n}\r\n\r\nexport default function(url, config, params){\r\n\tif(url){\r\n\t\tif(params && Object.keys(params).length){\r\n\t\t\tif(!config.method || config.method.toLowerCase() == \"get\"){\r\n\t\t\t\tconfig.method = \"get\";\r\n\r\n\t\t\t\turl += (url.includes(\"?\") ? \"&\" : \"?\") + serializeParams(params);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn url;\r\n};","function generateParamsList(data, prefix){\r\n\tvar output = [];\r\n\r\n\tprefix = prefix || \"\";\r\n\r\n\tif(Array.isArray(data)){\r\n\t\tdata.forEach((item, i) => {\r\n\t\t\toutput = output.concat(generateParamsList(item, prefix ? prefix + \"[\" + i + \"]\" : i));\r\n\t\t});\r\n\t}else if (typeof data === \"object\"){\r\n\t\tfor (var key in data){\r\n\t\t\toutput = output.concat(generateParamsList(data[key], prefix ? prefix + \"[\" + key + \"]\" : key));\r\n\t\t}\r\n\t}else{\r\n\t\toutput.push({key:prefix, value:data});\r\n\t}\r\n\r\n\treturn output;\r\n}\r\n\r\nexport default {\r\n\t\"json\":{\r\n\t\theaders:{\r\n\t\t\t'Content-Type': 'application/json',\r\n\t\t},\r\n\t\tbody:function(url, config, params){\r\n\t\t\treturn JSON.stringify(params);\r\n\t\t},\r\n\t},\r\n\t\"form\":{\r\n\t\theaders:{\r\n\t\t},\r\n\t\tbody:function(url, config, params){\r\n\r\n\t\t\tvar output = generateParamsList(params),\r\n\t\t\tform = new FormData();\r\n\r\n\t\t\toutput.forEach(function(item){\r\n\t\t\t\tform.append(item.key, item.value);\r\n\t\t\t});\r\n\r\n\t\t\treturn form;\r\n\t\t},\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultConfig from './defaults/config.js';\r\nimport defaultURLGenerator from './defaults/urlGenerator.js';\r\nimport defaultLoaderPromise from './defaults/loaderPromise.js';\r\nimport defaultContentTypeFormatters from './defaults/contentTypeFormatters.js';\r\n\r\nclass Ajax extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.config = {}; //hold config object for ajax request\r\n\t\tthis.url = \"\"; //request URL\r\n\t\tthis.urlGenerator = false;\r\n\t\tthis.params = false; //request parameters\r\n\t\t\r\n\t\tthis.loaderPromise = false;\r\n\t\t\r\n\t\tthis.registerTableOption(\"ajaxURL\", false); //url for ajax loading\r\n\t\tthis.registerTableOption(\"ajaxURLGenerator\", false);\r\n\t\tthis.registerTableOption(\"ajaxParams\", {}); //params for ajax loading\r\n\t\tthis.registerTableOption(\"ajaxConfig\", \"get\"); //ajax request type\r\n\t\tthis.registerTableOption(\"ajaxContentType\", \"form\"); //ajax request type\r\n\t\tthis.registerTableOption(\"ajaxRequestFunc\", false); //promise function\r\n\t\t\r\n\t\tthis.registerTableOption(\"ajaxRequesting\", function(){});\r\n\t\tthis.registerTableOption(\"ajaxResponse\", false);\r\n\t\t\r\n\t\tthis.contentTypeFormatters = Ajax.contentTypeFormatters;\r\n\t}\r\n\t\r\n\t//initialize setup options\r\n\tinitialize(){\r\n\t\tthis.loaderPromise = this.table.options.ajaxRequestFunc || Ajax.defaultLoaderPromise;\r\n\t\tthis.urlGenerator = this.table.options.ajaxURLGenerator || Ajax.defaultURLGenerator;\r\n\t\t\r\n\t\tif(this.table.options.ajaxURL){\r\n\t\t\tthis.setUrl(this.table.options.ajaxURL);\r\n\t\t}\r\n\r\n\r\n\t\tthis.setDefaultConfig(this.table.options.ajaxConfig);\r\n\t\t\r\n\t\tthis.registerTableFunction(\"getAjaxUrl\", this.getUrl.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"data-loading\", this.requestDataCheck.bind(this));\r\n\t\tthis.subscribe(\"data-params\", this.requestParams.bind(this));\r\n\t\tthis.subscribe(\"data-load\", this.requestData.bind(this));\r\n\t}\r\n\t\r\n\trequestParams(data, config, silent, params){\r\n\t\tvar ajaxParams = this.table.options.ajaxParams;\r\n\t\t\r\n\t\tif(ajaxParams){\r\n\t\t\tif(typeof ajaxParams === \"function\"){\r\n\t\t\t\tajaxParams = ajaxParams.call(this.table);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tparams = Object.assign(params, ajaxParams);\r\n\t\t}\t\t\r\n\t\t\r\n\t\treturn params;\r\n\t}\r\n\t\r\n\trequestDataCheck(data, params, config, silent){\r\n\t\treturn !!((!data && this.url) || typeof data === \"string\");\r\n\t}\r\n\t\r\n\trequestData(url, params, config, silent, previousData){\r\n\t\tvar ajaxConfig;\r\n\t\t\r\n\t\tif(!previousData && this.requestDataCheck(url)){\r\n\t\t\tif(url){\r\n\t\t\t\tthis.setUrl(url);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tajaxConfig = this.generateConfig(config);\r\n\t\t\t\r\n\t\t\treturn this.sendRequest(this.url, params, ajaxConfig);\r\n\t\t}else{\r\n\t\t\treturn previousData;\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetDefaultConfig(config = {}){\r\n\t\tthis.config = Object.assign({}, Ajax.defaultConfig);\r\n\r\n\t\tif(typeof config == \"string\"){\r\n\t\t\tthis.config.method = config;\r\n\t\t}else{\r\n\t\t\tObject.assign(this.config, config);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//load config object\r\n\tgenerateConfig(config = {}){\r\n\t\tvar ajaxConfig = Object.assign({}, this.config)\r\n\t\t\r\n\t\tif(typeof config == \"string\"){\r\n\t\t\tajaxConfig.method = config;\r\n\t\t}else{\r\n\t\t\tObject.assign(ajaxConfig, config);\r\n\t\t}\r\n\t\t\r\n\t\treturn ajaxConfig;\r\n\t}\r\n\t\r\n\t//set request url\r\n\tsetUrl(url){\r\n\t\tthis.url = url;\r\n\t}\r\n\t\r\n\t//get request url\r\n\tgetUrl(){\r\n\t\treturn this.url;\r\n\t}\r\n\t\r\n\t//send ajax request\r\n\tsendRequest(url, params, config){\r\n\t\tif(this.table.options.ajaxRequesting.call(this.table, url, params) !== false){\r\n\t\t\treturn this.loaderPromise(url, config, params)\r\n\t\t\t.then((data)=>{\r\n\t\t\t\tif(this.table.options.ajaxResponse){\r\n\t\t\t\t\tdata = this.table.options.ajaxResponse.call(this.table, url, params, data);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn data;\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n}\r\n\r\nAjax.moduleName = \"ajax\";\r\n\r\n//load defaults\r\nAjax.defaultConfig = defaultConfig;\r\nAjax.defaultURLGenerator = defaultURLGenerator;\r\nAjax.defaultLoaderPromise = defaultLoaderPromise;\r\nAjax.contentTypeFormatters = defaultContentTypeFormatters;\r\n\r\nexport default Ajax;","export default {\r\n\tmethod: \"GET\",\r\n};","export default function(url, config, params){\r\n\tvar contentType;\r\n\r\n\treturn new Promise((resolve, reject) => {\r\n\t\t//set url\r\n\t\turl = this.urlGenerator.call(this.table, url, config, params);\r\n\r\n\t\t//set body content if not GET request\r\n\t\tif(config.method.toUpperCase() != \"GET\"){\r\n\t\t\tcontentType = typeof this.table.options.ajaxContentType === \"object\" ? this.table.options.ajaxContentType : this.contentTypeFormatters[this.table.options.ajaxContentType];\r\n\t\t\tif(contentType){\r\n\r\n\t\t\t\tfor(var key in contentType.headers){\r\n\t\t\t\t\tif(!config.headers){\r\n\t\t\t\t\t\tconfig.headers = {};\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(typeof config.headers[key] === \"undefined\"){\r\n\t\t\t\t\t\tconfig.headers[key] = contentType.headers[key];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconfig.body = contentType.body.call(this, url, config, params);\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Ajax Error - Invalid ajaxContentType value:\", this.table.options.ajaxContentType);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(url){\r\n\t\t\t//configure headers\r\n\t\t\tif(typeof config.headers === \"undefined\"){\r\n\t\t\t\tconfig.headers = {};\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.headers.Accept === \"undefined\"){\r\n\t\t\t\tconfig.headers.Accept = \"application/json\";\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.headers[\"X-Requested-With\"] === \"undefined\"){\r\n\t\t\t\tconfig.headers[\"X-Requested-With\"] = \"XMLHttpRequest\";\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.mode === \"undefined\"){\r\n\t\t\t\tconfig.mode = \"cors\";\r\n\t\t\t}\r\n\r\n\t\t\tif(config.mode == \"cors\"){\r\n\t\t\t\tif(typeof config.headers[\"Origin\"] === \"undefined\"){\r\n\t\t\t\t\tconfig.headers[\"Origin\"] = window.location.origin;\r\n\t\t\t\t}\r\n \r\n\t\t\t\tif(typeof config.credentials === \"undefined\"){\r\n\t\t\t\t\tconfig.credentials = 'same-origin';\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(typeof config.credentials === \"undefined\"){\r\n\t\t\t\t\tconfig.credentials = 'include';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//send request\r\n\t\t\tfetch(url, config)\r\n\t\t\t.then((response)=>{\r\n\t\t\t\tif(response.ok) {\r\n\t\t\t\t\tresponse.json()\r\n\t\t\t\t\t.then((data)=>{\r\n\t\t\t\t\t\tresolve(data);\r\n\t\t\t\t\t}).catch((error)=>{\r\n\t\t\t\t\t\treject(error);\r\n\t\t\t\t\t\tconsole.warn(\"Ajax Load Error - Invalid JSON returned\", error);\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.error(\"Ajax Load Error - Connection Error: \" + response.status, response.statusText);\r\n\t\t\t\t\treject(response);\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.catch((error)=>{\r\n\t\t\t\tconsole.error(\"Ajax Load Error - Connection Error: \", error);\r\n\t\t\t\treject(error);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Ajax Load Error - No URL Set\");\r\n\t\t\tresolve([]);\r\n\t\t}\r\n\t});\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultPasteActions from './defaults/pasteActions.js';\r\nimport defaultPasteParsers from './defaults/pasteParsers.js';\r\n\r\nclass Clipboard extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.mode = true;\r\n\t\tthis.pasteParser = function(){};\r\n\t\tthis.pasteAction = function(){};\r\n\t\tthis.customSelection = false;\r\n\t\tthis.rowRange = false;\r\n\t\tthis.blocked = true; //block copy actions not originating from this command\r\n\r\n\t\tthis.registerTableOption(\"clipboard\", false); //enable clipboard\r\n\t\tthis.registerTableOption(\"clipboardCopyStyled\", true); //formatted table data\r\n\t\tthis.registerTableOption(\"clipboardCopyConfig\", false); //clipboard config\r\n\t\tthis.registerTableOption(\"clipboardCopyFormatter\", false); //DEPRICATED - REMOVE in 5.0\r\n\t\tthis.registerTableOption(\"clipboardCopyRowRange\", \"active\"); //restrict clipboard to visible rows only\r\n\t\tthis.registerTableOption(\"clipboardPasteParser\", \"table\"); //convert pasted clipboard data to rows\r\n\t\tthis.registerTableOption(\"clipboardPasteAction\", \"insert\"); //how to insert pasted data into the table\r\n\r\n\t\tthis.registerColumnOption(\"clipboard\");\r\n\t\tthis.registerColumnOption(\"titleClipboard\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.mode = this.table.options.clipboard;\r\n\r\n\t\tthis.rowRange = this.table.options.clipboardCopyRowRange;\r\n\r\n\t\tif(this.mode === true || this.mode === \"copy\"){\r\n\t\t\tthis.table.element.addEventListener(\"copy\", (e) => {\r\n\t\t\t\tvar plain, html, list;\r\n\r\n\t\t\t\tif(!this.blocked){\r\n\t\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\t\tif(this.customSelection){\r\n\t\t\t\t\t\tplain = this.customSelection;\r\n\r\n\t\t\t\t\t\tif(this.table.options.clipboardCopyFormatter){\r\n\t\t\t\t\t\t\tplain = this.table.options.clipboardCopyFormatter(\"plain\", plain);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\r\n\t\t\t\t\t\tvar list = this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig, this.table.options.clipboardCopyStyled, this.rowRange, \"clipboard\");\r\n\r\n\t\t\t\t\t\thtml = this.table.modules.export.genereateHTMLTable(list);\r\n\t\t\t\t\t\tplain = html ? this.generatePlainContent(list) : \"\";\r\n\r\n\t\t\t\t\t\tif(this.table.options.clipboardCopyFormatter){\r\n\t\t\t\t\t\t\tplain = this.table.options.clipboardCopyFormatter(\"plain\", plain);\r\n\t\t\t\t\t\t\thtml = this.table.options.clipboardCopyFormatter(\"html\", html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (window.clipboardData && window.clipboardData.setData) {\r\n\t\t\t\t\t\twindow.clipboardData.setData('Text', plain);\r\n\t\t\t\t\t} else if (e.clipboardData && e.clipboardData.setData) {\r\n\t\t\t\t\t\te.clipboardData.setData('text/plain', plain);\r\n\t\t\t\t\t\tif(html){\r\n\t\t\t\t\t\t\te.clipboardData.setData('text/html', html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (e.originalEvent && e.originalEvent.clipboardData.setData) {\r\n\t\t\t\t\t\te.originalEvent.clipboardData.setData('text/plain', plain);\r\n\t\t\t\t\t\tif(html){\r\n\t\t\t\t\t\t\te.originalEvent.clipboardData.setData('text/html', html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.dispatchExternal(\"clipboardCopied\", plain, html);\r\n\r\n\t\t\t\t\tthis.reset();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.mode === true || this.mode === \"paste\"){\r\n\t\t\tthis.table.element.addEventListener(\"paste\", (e) => {\r\n\t\t\t\tthis.paste(e);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.setPasteParser(this.table.options.clipboardPasteParser);\r\n\t\tthis.setPasteAction(this.table.options.clipboardPasteAction);\r\n\r\n\t\tthis.registerTableFunction(\"copyToClipboard\", this.copy.bind(this));\r\n\t}\r\n\r\n\treset(){\r\n\t\tthis.blocked = true;\r\n\t\tthis.customSelection = false;\r\n\t}\r\n\r\n\tgeneratePlainContent (list) {\r\n\t\tvar output = [];\r\n\r\n\t\tlist.forEach((row) => {\r\n\t\t\tvar rowData = [];\r\n\r\n\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\tvar value = \"\";\r\n\r\n\t\t\t\tif(col){\r\n\r\n\t\t\t\t\tif(row.type === \"group\"){\r\n\t\t\t\t\t\tcol.value = col.component.getKey();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(col.value === null){\r\n\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\t\tvalue = JSON.stringify(col.value);\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tvalue = col.value;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowData.push(value);\r\n\t\t\t});\r\n\r\n\t\t\toutput.push(rowData.join(\"\\t\"));\r\n\t\t});\r\n\r\n\t\treturn output.join(\"\\n\");\r\n\t}\r\n\r\n\tcopy (range, internal) {\r\n\t\tvar range, sel, textRange;\r\n\t\tthis.blocked = false;\r\n\t\tthis.customSelection = false;\r\n\r\n\t\tif (this.mode === true || this.mode === \"copy\") {\r\n\r\n\t\t\tthis.rowRange = range || this.table.options.clipboardCopyRowRange;\r\n\r\n\t\t\tif (typeof window.getSelection != \"undefined\" && typeof document.createRange != \"undefined\") {\r\n\t\t\t\trange = document.createRange();\r\n\t\t\t\trange.selectNodeContents(this.table.element);\r\n\t\t\t\tsel = window.getSelection();\r\n\r\n\t\t\t\tif (sel.toString() && internal) {\r\n\t\t\t\t\tthis.customSelection = sel.toString();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tsel.removeAllRanges();\r\n\t\t\t\tsel.addRange(range);\r\n\t\t\t} else if (typeof document.selection != \"undefined\" && typeof document.body.createTextRange != \"undefined\") {\r\n\t\t\t\ttextRange = document.body.createTextRange();\r\n\t\t\t\ttextRange.moveToElementText(this.table.element);\r\n\t\t\t\ttextRange.select();\r\n\t\t\t}\r\n\r\n\t\t\tdocument.execCommand('copy');\r\n\r\n\t\t\tif (sel) {\r\n\t\t\t\tsel.removeAllRanges();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//PASTE EVENT HANDLING\r\n\tsetPasteAction(action){\r\n\r\n\t\tswitch(typeof action){\r\n\t\t\tcase \"string\":\r\n\t\t\tthis.pasteAction = Clipboard.pasteActions[action];\r\n\r\n\t\t\tif(!this.pasteAction){\r\n\t\t\t\tconsole.warn(\"Clipboard Error - No such paste action found:\", action);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tthis.pasteAction = action;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tsetPasteParser(parser){\r\n\t\tswitch(typeof parser){\r\n\t\t\tcase \"string\":\r\n\t\t\tthis.pasteParser = Clipboard.pasteParsers[parser];\r\n\r\n\t\t\tif(!this.pasteParser){\r\n\t\t\t\tconsole.warn(\"Clipboard Error - No such paste parser found:\", parser);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tthis.pasteParser = parser;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tpaste(e){\r\n\t\tvar data, rowData, rows;\r\n\r\n\t\tif(this.checkPaseOrigin(e)){\r\n\r\n\t\t\tdata = this.getPasteData(e);\r\n\r\n\t\t\trowData = this.pasteParser.call(this, data);\r\n\r\n\t\t\tif(rowData){\r\n\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\t\t\trowData = this.mutateData(rowData);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trows = this.pasteAction.call(this, rowData);\r\n\r\n\t\t\t\tthis.dispatchExternal(\"clipboardPasted\", data, rowData, rows);\r\n\t\t\t}else{\r\n\t\t\t\tthis.dispatchExternal(\"clipboardPasteError\", data);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmutateData(data){\r\n\t\tvar output = [];\r\n\r\n\t\tif(Array.isArray(data)){\r\n\t\t\tdata.forEach((row) => {\r\n\t\t\t\toutput.push(this.table.modules.mutator.transformRow(row, \"clipboard\"));\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\toutput = data;\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\r\n\tcheckPaseOrigin(e){\r\n\t\tvar valid = true;\r\n\r\n\t\tif(e.target.tagName != \"DIV\" || this.table.modules.edit.currentCell){\r\n\t\t\tvalid = false;\r\n\t\t}\r\n\r\n\t\treturn valid;\r\n\t}\r\n\r\n\tgetPasteData(e){\r\n\t\tvar data;\r\n\r\n\t\tif (window.clipboardData && window.clipboardData.getData) {\r\n\t\t\tdata = window.clipboardData.getData('Text');\r\n\t\t} else if (e.clipboardData && e.clipboardData.getData) {\r\n\t\t\tdata = e.clipboardData.getData('text/plain');\r\n\t\t} else if (e.originalEvent && e.originalEvent.clipboardData.getData) {\r\n\t\t\tdata = e.originalEvent.clipboardData.getData('text/plain');\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n}\r\n\r\nClipboard.moduleName = \"clipboard\";\r\n\r\n//load defaults\r\nClipboard.pasteActions = defaultPasteActions;\r\nClipboard.pasteParsers = defaultPasteParsers;\r\n\r\nexport default Clipboard;","export default {\r\n\treplace:function(rows){\r\n\t\treturn this.table.setData(rows);\r\n\t},\r\n\tupdate:function(rows){\r\n\t\treturn this.table.updateOrAddData(rows);\r\n\t},\r\n\tinsert:function(rows){\r\n\t\treturn this.table.addData(rows);\r\n\t},\r\n};","export default {\r\n\ttable:function(clipboard){\r\n\t\tvar data = [],\r\n\t\tsuccess = false,\r\n\t\theaderFindSuccess = true,\r\n\t\tcolumns = this.table.columnManager.columns,\r\n\t\tcolumnMap = [],\r\n\t\trows = [];\r\n\r\n\t\t//get data from clipboard into array of columns and rows.\r\n\t\tclipboard = clipboard.split(\"\\n\");\r\n\r\n\t\tclipboard.forEach(function(row){\r\n\t\t\tdata.push(row.split(\"\\t\"));\r\n\t\t});\r\n\r\n\t\tif(data.length && !(data.length === 1 && data[0].length < 2)){\r\n\t\t\tsuccess = true;\r\n\r\n\t\t\t//check if headers are present by title\r\n\t\t\tdata[0].forEach(function(value){\r\n\t\t\t\tvar column = columns.find(function(column){\r\n\t\t\t\t\treturn value && column.definition.title && value.trim() && column.definition.title.trim() === value.trim();\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tcolumnMap.push(column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\theaderFindSuccess = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t//check if column headers are present by field\r\n\t\t\tif(!headerFindSuccess){\r\n\t\t\t\theaderFindSuccess = true;\r\n\t\t\t\tcolumnMap = [];\r\n\r\n\t\t\t\tdata[0].forEach(function(value){\r\n\t\t\t\t\tvar column = columns.find(function(column){\r\n\t\t\t\t\t\treturn value && column.field && value.trim() && column.field.trim() === value.trim();\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(column){\r\n\t\t\t\t\t\tcolumnMap.push(column);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\theaderFindSuccess = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(!headerFindSuccess){\r\n\t\t\t\t\tcolumnMap = this.table.columnManager.columnsByIndex;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//remove header row if found\r\n\t\t\tif(headerFindSuccess){\r\n\t\t\t\tdata.shift();\r\n\t\t\t}\r\n\r\n\t\t\tdata.forEach(function(item){\r\n\t\t\t\tvar row = {};\r\n\r\n\t\t\t\titem.forEach(function(value, i){\r\n\t\t\t\t\tif(columnMap[i]){\r\n\t\t\t\t\t\trow[columnMap[i].field] = value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\trows.push(row);\r\n\t\t\t});\r\n\r\n\t\t\treturn rows;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n};","class CalcComponent{\r\n\tconstructor (row){\r\n\t\tthis._row = row;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._row.table.componentFunctionBinder.handle(\"row\", target._row, name)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\tgetData(transform){\r\n\t\treturn this._row.getData(transform);\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._row.getElement();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._row.table;\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._row.getCells().forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tgetCell(column){\r\n\t\tvar cell = this._row.getCell(column);\r\n\t\treturn cell ? cell.getComponent() : false;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._row;\r\n\t}\r\n}\r\n\r\nexport default CalcComponent;","export default {\r\n\t\"avg\":function(values, data, calcParams){\r\n\t\tvar output = 0,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : 2\r\n\r\n\t\tif(values.length){\r\n\t\t\toutput = values.reduce(function(sum, value){\r\n\t\t\t\treturn Number(sum) + Number(value);\r\n\t\t\t});\r\n\r\n\t\t\toutput = output / values.length;\r\n\r\n\t\t\toutput = precision !== false ? output.toFixed(precision) : output;\r\n\t\t}\r\n\r\n\t\treturn parseFloat(output).toString();\r\n\t},\r\n\t\"max\":function(values, data, calcParams){\r\n\t\tvar output = null,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tvalues.forEach(function(value){\r\n\r\n\t\t\tvalue = Number(value);\r\n\r\n\t\t\tif(value > output || output === null){\r\n\t\t\t\toutput = value;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output !== null ? (precision !== false ? output.toFixed(precision) : output) : \"\";\r\n\t},\r\n\t\"min\":function(values, data, calcParams){\r\n\t\tvar output = null,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tvalues.forEach(function(value){\r\n\r\n\t\t\tvalue = Number(value);\r\n\r\n\t\t\tif(value < output || output === null){\r\n\t\t\t\toutput = value;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output !== null ? (precision !== false ? output.toFixed(precision) : output) : \"\";\r\n\t},\r\n\t\"sum\":function(values, data, calcParams){\r\n\t\tvar output = 0,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tif(values.length){\r\n\t\t\tvalues.forEach(function(value){\r\n\t\t\t\tvalue = Number(value);\r\n\r\n\t\t\t\toutput += !isNaN(value) ? Number(value) : 0;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn precision !== false ? output.toFixed(precision) : output;\r\n\t},\r\n\t\"concat\":function(values, data, calcParams){\r\n\t\tvar output = 0;\r\n\r\n\t\tif(values.length){\r\n\t\t\toutput = values.reduce(function(sum, value){\r\n\t\t\t\treturn String(sum) + String(value);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t},\r\n\t\"count\":function(values, data, calcParams){\r\n\t\tvar output = 0;\r\n\r\n\t\tif(values.length){\r\n\t\t\tvalues.forEach(function(value){\r\n\t\t\t\tif(value){\r\n\t\t\t\t\toutput ++;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport CalcComponent from './CalcComponent.js';\r\n\r\nimport Cell from '../../core/cell/Cell.js';\r\nimport Column from '../../core/column/Column.js';\r\nimport Row from '../../core/row/Row.js';\r\n\r\nimport defaultCalculations from './defaults/calculations.js';\r\n\r\nclass ColumnCalcs extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.topCalcs = [];\r\n\t\tthis.botCalcs = [];\r\n\t\tthis.genColumn = false;\r\n\t\tthis.topElement = this.createElement();\r\n\t\tthis.botElement = this.createElement();\r\n\t\tthis.topRow = false;\r\n\t\tthis.botRow = false;\r\n\t\tthis.topInitialized = false;\r\n\t\tthis.botInitialized = false;\r\n\r\n\t\tthis.registerTableOption(\"columnCalcs\", true);\r\n\r\n\t\tthis.registerColumnOption(\"topCalc\");\r\n\t\tthis.registerColumnOption(\"topCalcParams\");\r\n\t\tthis.registerColumnOption(\"topCalcFormatter\");\r\n\t\tthis.registerColumnOption(\"topCalcFormatterParams\");\r\n\t\tthis.registerColumnOption(\"bottomCalc\");\r\n\t\tthis.registerColumnOption(\"bottomCalcParams\");\r\n\t\tthis.registerColumnOption(\"bottomCalcFormatter\");\r\n\t\tthis.registerColumnOption(\"bottomCalcFormatterParams\");\r\n\t}\r\n\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tel.classList.add(\"tabulator-calcs-holder\");\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.genColumn = new Column({field:\"value\"}, this);\r\n\r\n\t\tthis.subscribe(\"cell-value-changed\", this.cellValueChanged.bind(this));\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumnCheck.bind(this));\r\n\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"row-added\", this.rowsUpdated.bind(this));\r\n\t\tthis.subscribe(\"column-moved\", this.recalcActiveRows.bind(this));\r\n\t\tthis.subscribe(\"column-add\", this.recalcActiveRows.bind(this));\r\n\t\tthis.subscribe(\"data-refreshed\", this.recalcActiveRowsRefresh.bind(this));\r\n\t\tthis.subscribe(\"table-redraw\", this.tableRedraw.bind(this));\r\n\t\tthis.subscribe(\"rows-visible\", this.visibleRows.bind(this));\r\n\r\n\t\tthis.registerTableFunction(\"getCalcResults\", this.getResults.bind(this));\r\n\t\tthis.registerTableFunction(\"recalc\", this.userRecalc.bind(this));\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\r\n\t\tif(force){\r\n\t\t\tthis.redraw();\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\tuserRecalc(){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tvisibleRows(viewable, rows){\r\n\t\tif(this.topRow){\r\n\t\t\trows.unshift(this.topRow);\r\n\t\t}\r\n\r\n\t\tif(this.botRow){\r\n\t\t\trows.push(this.botRow);\r\n\t\t}\r\n\t\r\n\t\treturn rows;\r\n\t}\r\n\r\n\trowsUpdated(row){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.recalcRowGroup(this);\r\n\t\t}else{\r\n\t\t\tthis.recalcActiveRows();\r\n\t\t}\r\n\t}\r\n\r\n\trecalcActiveRowsRefresh(){\r\n\t\tif(this.table.options.groupBy && this.table.options.dataTreeStartExpanded && this.table.options.dataTree){\r\n\t\t\tthis.recalcAll();\r\n\t\t}else{\r\n\t\t\tthis.recalcActiveRows();\r\n\t\t}\r\n\t}\r\n\r\n\trecalcActiveRows(){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\t}\r\n\r\n\tcellValueChanged(cell){\r\n\t\tif(cell.column.definition.topCalc || cell.column.definition.bottomCalc){\r\n\t\t\tif(this.table.options.groupBy){\r\n\t\t\t\tif(this.table.options.columnCalcs == \"table\" || this.table.options.columnCalcs == \"both\"){\r\n\t\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"table\"){\r\n\t\t\t\t\tthis.recalcRowGroup(cell.row);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeColumnCheck(column){\r\n\t\tif(column.definition.topCalc || column.definition.bottomCalc){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\r\n\t//initialize column calcs\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.definition\r\n\r\n\t\tvar config = {\r\n\t\t\ttopCalcParams:def.topCalcParams || {},\r\n\t\t\tbotCalcParams:def.bottomCalcParams || {},\r\n\t\t};\r\n\r\n\t\tif(def.topCalc){\r\n\r\n\t\t\tswitch(typeof def.topCalc){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tif(ColumnCalcs.calculations[def.topCalc]){\r\n\t\t\t\t\tconfig.topCalc = ColumnCalcs.calculations[def.topCalc]\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Column Calc Error - No such calculation found, ignoring: \", def.topCalc);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tconfig.topCalc = def.topCalc;\r\n\t\t\t\tbreak\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(config.topCalc){\r\n\t\t\t\tcolumn.modules.columnCalcs = config;\r\n\t\t\t\tthis.topCalcs.push(column);\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"group\"){\r\n\t\t\t\t\tthis.initializeTopRow();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tif(def.bottomCalc){\r\n\t\t\tswitch(typeof def.bottomCalc){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tif(ColumnCalcs.calculations[def.bottomCalc]){\r\n\t\t\t\t\tconfig.botCalc = ColumnCalcs.calculations[def.bottomCalc]\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Column Calc Error - No such calculation found, ignoring: \", def.bottomCalc);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tconfig.botCalc = def.bottomCalc;\r\n\t\t\t\tbreak\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(config.botCalc){\r\n\t\t\t\tcolumn.modules.columnCalcs = config;\r\n\t\t\t\tthis.botCalcs.push(column);\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"group\"){\r\n\t\t\t\t\tthis.initializeBottomRow();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t//dummy functions to handle being mock column manager\r\n\tregisterColumnField(){};\r\n\r\n\tremoveCalcs(){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(this.topInitialized){\r\n\t\t\tthis.topInitialized = false;\r\n\t\t\tthis.topElement.parentNode.removeChild(this.topElement);\r\n\t\t\tchanged = true;\r\n\t\t}\r\n\r\n\t\tif(this.botInitialized){\r\n\t\t\tthis.botInitialized = false;\r\n\t\t\tthis.footerRemove(this.botElement);\r\n\t\t\tchanged = true;\r\n\t\t}\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeTopRow(){\r\n\t\tif(!this.topInitialized){\r\n\t\t\tthis.table.columnManager.getElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling);\r\n\t\t\tthis.topInitialized = true;\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeBottomRow(){\r\n\t\tif(!this.botInitialized){\r\n\t\t\tthis.footerPrepend(this.botElement);\r\n\t\t\tthis.botInitialized = true;\r\n\t\t}\r\n\t}\r\n\r\n\tscrollHorizontal(left){\r\n\t\tif(this.botInitialized && this.botRow){\r\n\t\t\tthis.botRow.getElement().style.marginLeft = (-left) + \"px\";\r\n\t\t}\r\n\t}\r\n\r\n\trecalc(rows){\r\n\t\tvar data, row;\r\n\r\n\t\tif(this.topInitialized || this.botInitialized){\r\n\t\t\tdata = this.rowsToData(rows);\r\n\r\n\t\t\tif(this.topInitialized){\r\n\t\t\t\tif(this.topRow){\r\n\t\t\t\t\tthis.topRow.deleteCells();\r\n\t\t\t\t}\r\n\r\n\t\t\t\trow = this.generateRow(\"top\", this.rowsToData(rows))\r\n\t\t\t\tthis.topRow = row;\r\n\t\t\t\twhile(this.topElement.firstChild) this.topElement.removeChild(this.topElement.firstChild);\r\n\t\t\t\tthis.topElement.appendChild(row.getElement());\r\n\t\t\t\trow.initialize(true);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.botInitialized){\r\n\t\t\t\tif(this.botRow){\r\n\t\t\t\t\tthis.botRow.deleteCells();\r\n\t\t\t\t}\r\n\r\n\t\t\t\trow = this.generateRow(\"bottom\", this.rowsToData(rows))\r\n\t\t\t\tthis.botRow = row;\r\n\t\t\t\twhile(this.botElement.firstChild) this.botElement.removeChild(this.botElement.firstChild);\r\n\t\t\t\tthis.botElement.appendChild(row.getElement());\r\n\t\t\t\trow.initialize(true);\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\t//set resizable handles\r\n\t\t\tif(this.table.modExists(\"frozenColumns\")){\r\n\t\t\t\tthis.table.modules.frozenColumns.layout();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trecalcRowGroup(row){\r\n\t\tthis.recalcGroup(this.table.modules.groupRows.getRowGroup(row));\r\n\t}\r\n\r\n\trecalcAll(){\r\n\t\tif(this.topCalcs.length || this.botCalcs.length){\r\n\t\t\tif(this.table.options.columnCalcs !== \"group\"){\r\n\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.options.groupBy && this.table.options.columnCalcs !== \"table\"){\r\n\r\n\t\t\t\tvar groups = this.table.modules.groupRows.getChildGroups();\r\n\r\n\t\t\t\tgroups.forEach((group) => {\r\n\t\t\t\t\tthis.recalcGroup(group);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trecalcGroup(group){\r\n\t\tvar data, rowData;\r\n\r\n\t\tif(group){\r\n\t\t\tif(group.calcs){\r\n\t\t\t\tif(group.calcs.bottom){\r\n\t\t\t\t\tdata = this.rowsToData(group.rows);\r\n\t\t\t\t\trowData = this.generateRowData(\"bottom\", data);\r\n\r\n\t\t\t\t\tgroup.calcs.bottom.updateData(rowData);\r\n\t\t\t\t\tgroup.calcs.bottom.reinitialize();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(group.calcs.top){\r\n\t\t\t\t\tdata = this.rowsToData(group.rows);\r\n\t\t\t\t\trowData = this.generateRowData(\"top\", data);\r\n\r\n\t\t\t\t\tgroup.calcs.top.updateData(rowData);\r\n\t\t\t\t\tgroup.calcs.top.reinitialize();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//generate top stats row\r\n\tgenerateTopRow(rows){\r\n\t\treturn this.generateRow(\"top\", this.rowsToData(rows));\r\n\t}\r\n\t//generate bottom stats row\r\n\tgenerateBottomRow(rows){\r\n\t\treturn this.generateRow(\"bottom\", this.rowsToData(rows));\r\n\t}\r\n\r\n\trowsToData(rows){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\trows.forEach((row) => {\r\n\t\t\tdata.push(row.getData());\r\n\r\n\t\t\tif(this.table.options.dataTree && this.table.options.dataTreeChildColumnCalcs){\r\n\t\t\t\tif(row.modules.dataTree && row.modules.dataTree.open){\r\n\t\t\t\t\tvar children = this.rowsToData(this.table.modules.dataTree.getFilteredTreeChildren(row));\r\n\t\t\t\t\tdata = data.concat(children);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//generate stats row\r\n\tgenerateRow(pos, data){\r\n\t\tvar rowData = this.generateRowData(pos, data),\r\n\t\trow;\r\n\r\n\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\tthis.table.modules.mutator.disable();\r\n\t\t}\r\n\r\n\t\trow = new Row(rowData, this, \"calc\");\r\n\r\n\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\tthis.table.modules.mutator.enable();\r\n\t\t}\r\n\r\n\t\trow.getElement().classList.add(\"tabulator-calcs\", \"tabulator-calcs-\" + pos);\r\n\r\n\t\trow.component = false;\r\n\r\n\t\trow.getComponent = () => {\r\n\t\t\tif(!row.component){\r\n\t\t\t\trow.component = new CalcComponent(row);\r\n\t\t\t}\r\n\r\n\t\t\treturn row.component;\r\n\t\t};\r\n\r\n\t\trow.generateCells = () => {\r\n\r\n\t\t\tvar cells = [];\r\n\r\n\t\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\r\n\t\t\t\t\t//set field name of mock column\r\n\t\t\t\t\tthis.genColumn.setField(column.getField());\r\n\t\t\t\t\tthis.genColumn.hozAlign = column.hozAlign;\r\n\r\n\t\t\t\t\tif(column.definition[pos + \"CalcFormatter\"] && this.table.modExists(\"format\")){\r\n\t\t\t\t\t\tthis.genColumn.modules.format = {\r\n\t\t\t\t\t\t\tformatter: this.table.modules.format.getFormatter(column.definition[pos + \"CalcFormatter\"]),\r\n\t\t\t\t\t\t\tparams: column.definition[pos + \"CalcFormatterParams\"] || {},\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.genColumn.modules.format = {\r\n\t\t\t\t\t\t\tformatter: this.table.modules.format.getFormatter(\"plaintext\"),\r\n\t\t\t\t\t\t\tparams:{}\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//ensure css class defintion is replicated to calculation cell\r\n\t\t\t\t\tthis.genColumn.definition.cssClass = column.definition.cssClass;\r\n\r\n\t\t\t\t\t//generate cell and assign to correct column\r\n\t\t\t\t\tvar cell = new Cell(this.genColumn, row);\r\n\t\t\t\t\tcell.getElement();\r\n\t\t\t\t\tcell.column = column;\r\n\t\t\t\t\tcell.setWidth();\r\n\r\n\t\t\t\t\tcolumn.cells.push(cell);\r\n\t\t\t\t\tcells.push(cell);\r\n\r\n\t\t\t\t\tif(!column.visible){\r\n\t\t\t\t\t\tcell.hide();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\trow.cells = cells;\r\n\t\t};\r\n\r\n\t\treturn row;\r\n\t}\r\n\r\n\t//generate stats row\r\n\tgenerateRowData(pos, data){\r\n\t\tvar rowData = {},\r\n\t\tcalcs = pos == \"top\" ? this.topCalcs : this.botCalcs,\r\n\t\ttype = pos == \"top\" ? \"topCalc\" : \"botCalc\",\r\n\t\tparams, paramKey;\r\n\r\n\t\tcalcs.forEach(function(column){\r\n\t\t\tvar values = [];\r\n\r\n\t\t\tif(column.modules.columnCalcs && column.modules.columnCalcs[type]){\r\n\t\t\t\tdata.forEach(function(item){\r\n\t\t\t\t\tvalues.push(column.getFieldValue(item));\r\n\t\t\t\t});\r\n\r\n\t\t\t\tparamKey = type + \"Params\";\r\n\t\t\t\tparams = typeof column.modules.columnCalcs[paramKey] === \"function\" ? column.modules.columnCalcs[paramKey](values, data) : column.modules.columnCalcs[paramKey];\r\n\r\n\t\t\t\tcolumn.setFieldValue(rowData, column.modules.columnCalcs[type](values, data, params));\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowData;\r\n\t}\r\n\r\n\thasTopCalcs(){\r\n\t\treturn\t!!(this.topCalcs.length);\r\n\t}\r\n\r\n\thasBottomCalcs(){\r\n\t\treturn\t!!(this.botCalcs.length);\r\n\t}\r\n\r\n\t//handle table redraw\r\n\tredraw(){\r\n\t\tif(this.topRow){\r\n\t\t\tthis.topRow.normalizeHeight(true);\r\n\t\t}\r\n\t\tif(this.botRow){\r\n\t\t\tthis.botRow.normalizeHeight(true);\r\n\t\t}\r\n\t}\r\n\r\n\t//return the calculated\r\n\tgetResults(){\r\n\t\tvar results = {},\r\n\t\tgroups;\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tgroups = this.table.modules.groupRows.getGroups(true);\r\n\r\n\t\t\tgroups.forEach((group) => {\r\n\t\t\t\tresults[group.getKey()] = this.getGroupResults(group);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tresults = {\r\n\t\t\t\ttop: this.topRow ? this.topRow.getData() : {},\r\n\t\t\t\tbottom: this.botRow ? this.botRow.getData() : {},\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\t//get results from a group\r\n\tgetGroupResults(group){\r\n\t\tvar groupObj = group._getSelf(),\r\n\t\tsubGroups = group.getSubGroups(),\r\n\t\tsubGroupResults = {},\r\n\t\tresults = {};\r\n\r\n\t\tsubGroups.forEach((subgroup) => {\r\n\t\t\tsubGroupResults[subgroup.getKey()] = this.getGroupResults(subgroup);\r\n\t\t});\r\n\r\n\t\tresults = {\r\n\t\t\ttop: groupObj.calcs.top ? groupObj.calcs.top.getData() : {},\r\n\t\t\tbottom: groupObj.calcs.bottom ? groupObj.calcs.bottom.getData() : {},\r\n\t\t\tgroups: subGroupResults,\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n}\r\n\r\nColumnCalcs.moduleName = \"columnCalcs\";\r\n\r\n//load defaults\r\nColumnCalcs.calculations = defaultCalculations;\r\n\r\nexport default ColumnCalcs;","import Module from '../../core/Module.js';\r\n\r\nimport Row from '../../core/row/Row.js';\r\n\r\nclass DataTree extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.indent = 10;\r\n\t\tthis.field = \"\";\r\n\t\tthis.collapseEl = null;\r\n\t\tthis.expandEl = null;\r\n\t\tthis.branchEl = null;\r\n\t\tthis.elementField = false;\r\n\r\n\t\tthis.startOpen = function(){};\r\n\r\n\t\tthis.displayIndex = 0;\r\n\r\n\t\tthis.registerTableOption(\"dataTree\", false); //enable data tree\r\n\t\tthis.registerTableOption(\"dataTreeFilter\", true); //filter child rows\r\n\t\tthis.registerTableOption(\"dataTreeSort\", true); //sort child rows\r\n\t\tthis.registerTableOption(\"dataTreeElementColumn\", false);\r\n\t\tthis.registerTableOption(\"dataTreeBranchElement\", true);//show data tree branch element\r\n\t\tthis.registerTableOption(\"dataTreeChildIndent\", 9); //data tree child indent in px\r\n\t\tthis.registerTableOption(\"dataTreeChildField\", \"_children\");//data tre column field to look for child rows\r\n\t\tthis.registerTableOption(\"dataTreeCollapseElement\", false);//data tree row collapse element\r\n\t\tthis.registerTableOption(\"dataTreeExpandElement\", false);//data tree row expand element\r\n\t\tthis.registerTableOption(\"dataTreeStartExpanded\", false);\r\n\t\tthis.registerTableOption(\"dataTreeChildColumnCalcs\", false);//include visible data tree rows in column calculations\r\n\t\tthis.registerTableOption(\"dataTreeSelectPropagate\", false);//seleccting a parent row selects its children\r\n\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"treeCollapse\", this.collapseRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"treeExpand\", this.expandRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"treeToggle\", this.toggleRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"getTreeParent\", this.getTreeParent.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"getTreeChildren\", this.getRowChildren.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"addTreeChild\", this.addTreeChildRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isTreeExpanded\", this.isRowExpanded.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.dataTree){\r\n\t\t\tvar dummyEl = null,\r\n\t\t\toptions = this.table.options;\r\n\r\n\t\t\tthis.field = options.dataTreeChildField;\r\n\t\t\tthis.indent = options.dataTreeChildIndent;\r\n\r\n\t\t\tif(options.dataTreeBranchElement){\r\n\r\n\t\t\t\tif(options.dataTreeBranchElement === true){\r\n\t\t\t\t\tthis.branchEl = document.createElement(\"div\");\r\n\t\t\t\t\tthis.branchEl.classList.add(\"tabulator-data-tree-branch\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(typeof options.dataTreeBranchElement === \"string\"){\r\n\t\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\t\tdummyEl.innerHTML = options.dataTreeBranchElement;\r\n\t\t\t\t\t\tthis.branchEl = dummyEl.firstChild;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.branchEl = options.dataTreeBranchElement;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(options.dataTreeCollapseElement){\r\n\t\t\t\tif(typeof options.dataTreeCollapseElement === \"string\"){\r\n\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\tdummyEl.innerHTML = options.dataTreeCollapseElement;\r\n\t\t\t\t\tthis.collapseEl = dummyEl.firstChild;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.collapseEl = options.dataTreeCollapseElement;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.collapseEl = document.createElement(\"div\");\r\n\t\t\t\tthis.collapseEl.classList.add(\"tabulator-data-tree-control\");\r\n\t\t\t\tthis.collapseEl.tabIndex = 0;\r\n\t\t\t\tthis.collapseEl.innerHTML = \"
\";\r\n\t\t\t}\r\n\r\n\t\t\tif(options.dataTreeExpandElement){\r\n\t\t\t\tif(typeof options.dataTreeExpandElement === \"string\"){\r\n\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\tdummyEl.innerHTML = options.dataTreeExpandElement;\r\n\t\t\t\t\tthis.expandEl = dummyEl.firstChild;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.expandEl = options.dataTreeExpandElement;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.expandEl = document.createElement(\"div\");\r\n\t\t\t\tthis.expandEl.classList.add(\"tabulator-data-tree-control\");\r\n\t\t\t\tthis.expandEl.tabIndex = 0;\r\n\t\t\t\tthis.expandEl.innerHTML = \"
\";\r\n\t\t\t}\r\n\r\n\r\n\t\t\tswitch(typeof options.dataTreeStartExpanded){\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\tthis.startOpen = function(row, index){\r\n\t\t\t\t\treturn options.dataTreeStartExpanded;\r\n\t\t\t\t};\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tthis.startOpen = options.dataTreeStartExpanded;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\tthis.startOpen = function(row, index){\r\n\t\t\t\t\treturn options.dataTreeStartExpanded[index];\r\n\t\t\t\t};\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-layout-after\", this.layoutRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowDelete.bind(this),0);\r\n\t\t\tthis.subscribe(\"row-data-changed\", this.rowDataChanged.bind(this), 10);\r\n\t\t\tthis.subscribe(\"cell-value-updated\", this.cellValueChanged.bind(this));\r\n\t\t\tthis.subscribe(\"edit-cancelled\", this.cellValueChanged.bind(this));\r\n\t\t\tthis.subscribe(\"column-moving-rows\", this.columnMoving.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.initializeElementField.bind(this));\r\n\t\t\tthis.subscribe(\"table-redrawing\", this.tableRedrawing.bind(this));\r\n\r\n\t\t\tthis.registerDisplayHandler(this.getRows.bind(this), 30);\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedrawing(force){\r\n\t\tvar rows;\r\n\r\n\t\tif(force){\r\n\t\t\trows = this.table.rowManager.getRows();\r\n\t\t\t\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.reinitializeRowChildren(row);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeElementField(){\r\n\t\tvar firstCol = this.table.columnManager.getFirstVisibleColumn();\r\n\r\n\t\tthis.elementField = this.table.options.dataTreeElementColumn || (firstCol ? firstCol.field : false);\r\n\t}\r\n\t\r\n\tgetRowChildren(row){\r\n\t\treturn this.getTreeChildren(row, true);\r\n\t}\r\n\r\n\tcolumnMoving(){\r\n\t\tvar rows = [];\r\n\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\trows = rows.concat(this.getTreeChildren(row, false, true));\r\n\t\t});\r\n\r\n\t\treturn rows;\r\n\t}\r\n\r\n\trowDataChanged(row, visible, updatedData){\r\n\t\tif(this.redrawNeeded(updatedData)){\r\n\t\t\tthis.initializeRow(row);\r\n\r\n\t\t\tif(visible){\r\n\t\t\t\tthis.layoutRow(row);\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tcellValueChanged(cell){\r\n\t\tvar field = cell.column.getField();\r\n\r\n\t\tif(field === this.elementField){\r\n\t\t\tthis.layoutRow(cell.row);\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar childArray = row.getData()[this.field];\r\n\t\tvar isArray = Array.isArray(childArray);\r\n\r\n\t\tvar children = isArray || (!isArray && typeof childArray === \"object\" && childArray !== null);\r\n\r\n\t\tif(!children && row.modules.dataTree && row.modules.dataTree.branchEl){\r\n\t\t\trow.modules.dataTree.branchEl.parentNode.removeChild(row.modules.dataTree.branchEl);\r\n\t\t}\r\n\r\n\t\tif(!children && row.modules.dataTree && row.modules.dataTree.controlEl){\r\n\t\t\trow.modules.dataTree.controlEl.parentNode.removeChild(row.modules.dataTree.controlEl);\r\n\t\t}\r\n\r\n\t\trow.modules.dataTree = {\r\n\t\t\tindex: row.modules.dataTree ? row.modules.dataTree.index : 0,\r\n\t\t\topen: children ? (row.modules.dataTree ? row.modules.dataTree.open : this.startOpen(row.getComponent(), 0)) : false,\r\n\t\t\tcontrolEl: row.modules.dataTree && children ? row.modules.dataTree.controlEl : false,\r\n\t\t\tbranchEl: row.modules.dataTree && children ? row.modules.dataTree.branchEl : false,\r\n\t\t\tparent: row.modules.dataTree ? row.modules.dataTree.parent : false,\r\n\t\t\tchildren:children,\r\n\t\t};\r\n\t}\r\n\r\n\treinitializeRowChildren(row){\r\n\t\tvar children = this.getTreeChildren(row, false, true);\r\n\r\n\t\tchildren.forEach(function(child){\r\n\t\t\tchild.reinitialize(true);\r\n\t\t});\r\n\t}\r\n\r\n\tlayoutRow(row){\r\n\t\tvar cell = this.elementField ? row.getCell(this.elementField) : row.getCells()[0],\r\n\t\tel = cell.getElement(),\r\n\t\tconfig = row.modules.dataTree;\r\n\r\n\t\tif(config.branchEl){\r\n\t\t\tif(config.branchEl.parentNode){\r\n\t\t\t\tconfig.branchEl.parentNode.removeChild(config.branchEl);\r\n\t\t\t}\r\n\t\t\tconfig.branchEl = false;\r\n\t\t}\r\n\r\n\t\tif(config.controlEl){\r\n\t\t\tif(config.controlEl.parentNode){\r\n\t\t\t\tconfig.controlEl.parentNode.removeChild(config.controlEl);\r\n\t\t\t}\r\n\t\t\tconfig.controlEl = false;\r\n\t\t}\r\n\r\n\t\tthis.generateControlElement(row, el);\r\n\r\n\t\trow.getElement().classList.add(\"tabulator-tree-level-\" + config.index);\r\n\r\n\t\tif(config.index){\r\n\t\t\tif(this.branchEl){\r\n\t\t\t\tconfig.branchEl = this.branchEl.cloneNode(true);\r\n\t\t\t\tel.insertBefore(config.branchEl, el.firstChild);\r\n\r\n\t\t\t\tif(this.table.rtl){\r\n\t\t\t\t\tconfig.branchEl.style.marginRight = (((config.branchEl.offsetWidth + config.branchEl.style.marginLeft) * (config.index - 1)) + (config.index * this.indent)) + \"px\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconfig.branchEl.style.marginLeft = (((config.branchEl.offsetWidth + config.branchEl.style.marginRight) * (config.index - 1)) + (config.index * this.indent)) + \"px\";\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\r\n\t\t\t\tif(this.table.rtl){\r\n\t\t\t\t\tel.style.paddingRight = parseInt(window.getComputedStyle(el, null).getPropertyValue('padding-right')) + (config.index * this.indent) + \"px\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.style.paddingLeft = parseInt(window.getComputedStyle(el, null).getPropertyValue('padding-left')) + (config.index * this.indent) + \"px\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateControlElement(row, el){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\tel = el || row.getCells()[0].getElement(),\r\n\t\toldControl = config.controlEl;\r\n\r\n\t\tif(config.children !== false){\r\n\r\n\t\t\tif(config.open){\r\n\t\t\t\tconfig.controlEl = this.collapseEl.cloneNode(true);\r\n\t\t\t\tconfig.controlEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\tthis.collapseRow(row);\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconfig.controlEl = this.expandEl.cloneNode(true);\r\n\t\t\t\tconfig.controlEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\tthis.expandRow(row);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tconfig.controlEl.addEventListener(\"mousedown\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t});\r\n\r\n\t\t\tif(oldControl && oldControl.parentNode === el){\r\n\t\t\t\toldControl.parentNode.replaceChild(config.controlEl,oldControl);\r\n\t\t\t}else{\r\n\t\t\t\tel.insertBefore(config.controlEl, el.firstChild);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tsetDisplayIndex (index) {\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\r\n\tgetDisplayIndex () {\r\n\t\treturn this.displayIndex;\r\n\t}\r\n\r\n\tgetRows(rows){\r\n\t\tvar output = [];\r\n\r\n\t\trows.forEach((row, i) => {\r\n\t\t\tvar config, children;\r\n\r\n\t\t\toutput.push(row);\r\n\r\n\t\t\tif(row instanceof Row){\r\n\r\n\t\t\t\trow.create();\r\n\r\n\t\t\t\tconfig = row.modules.dataTree.children;\r\n\r\n\t\t\t\tif(!config.index && config.children !== false){\r\n\t\t\t\t\tchildren = this.getChildren(row);\r\n\r\n\t\t\t\t\tchildren.forEach((child) => {\r\n\t\t\t\t\t\tchild.create();\r\n\t\t\t\t\t\toutput.push(child);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetChildren(row, allChildren){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\tchildren = [],\r\n\t\toutput = [];\r\n\r\n\t\tif(config.children !== false && (config.open || allChildren)){\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"filter\") && this.table.options.dataTreeFilter){\r\n\t\t\t\tchildren = this.table.modules.filter.filter(config.children);\r\n\t\t\t}else{\r\n\t\t\t\tchildren = config.children;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"sort\") && this.table.options.dataTreeSort){\r\n\t\t\t\tthis.table.modules.sort.sort(children);\r\n\t\t\t}\r\n\r\n\t\t\tchildren.forEach((child) => {\r\n\t\t\t\toutput.push(child);\r\n\r\n\t\t\t\tvar subChildren = this.getChildren(child);\r\n\r\n\t\t\t\tsubChildren.forEach((sub) => {\r\n\t\t\t\t\toutput.push(sub);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgenerateChildren(row){\r\n\t\tvar children = [];\r\n\r\n\t\tvar childArray = row.getData()[this.field];\r\n\r\n\t\tif(!Array.isArray(childArray)){\r\n\t\t\tchildArray = [childArray];\r\n\t\t}\r\n\r\n\t\tchildArray.forEach((childData) => {\r\n\t\t\tvar childRow = new Row(childData || {}, this.table.rowManager);\r\n\r\n\t\t\tchildRow.create();\r\n\r\n\t\t\tchildRow.modules.dataTree.index = row.modules.dataTree.index + 1;\r\n\t\t\tchildRow.modules.dataTree.parent = row;\r\n\r\n\t\t\tif(childRow.modules.dataTree.children){\r\n\t\t\t\tchildRow.modules.dataTree.open = this.startOpen(childRow.getComponent(), childRow.modules.dataTree.index);\r\n\t\t\t}\r\n\t\t\tchildren.push(childRow);\r\n\t\t});\r\n\r\n\t\treturn children;\r\n\t}\r\n\r\n\texpandRow(row, silent){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tconfig.open = true;\r\n\r\n\t\t\trow.reinitialize();\r\n\r\n\t\t\tthis.refreshData(true);\r\n\r\n\t\t\tthis.dispatchExternal(\"dataTreeRowExpanded\", row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\t}\r\n\r\n\tcollapseRow(row){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tconfig.open = false;\r\n\r\n\t\t\trow.reinitialize();\r\n\r\n\t\t\tthis.refreshData(true);\r\n\r\n\t\t\tthis.dispatchExternal(\"dataTreeRowCollapsed\", row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\t}\r\n\r\n\ttoggleRow(row){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tif(config.open){\r\n\t\t\t\tthis.collapseRow(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.expandRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tisRowExpanded(row){\r\n\t\treturn row.modules.dataTree.open;\r\n\t}\r\n\r\n\tgetTreeParent(row){\r\n\t\treturn row.modules.dataTree.parent ? row.modules.dataTree.parent.getComponent() : false;\r\n\t}\r\n\r\n\tgetTreeParentRoot(row){\r\n\t\treturn row.modules.dataTree.parent ? this.getTreeParentRoot(row.modules.dataTree.parent) : row;\r\n\t}\r\n\r\n\tgetFilteredTreeChildren(row){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\toutput = [], children;\r\n\r\n\t\tif(config.children){\r\n\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"filter\") && this.table.options.dataTreeFilter){\r\n\t\t\t\tchildren = this.table.modules.filter.filter(config.children);\r\n\t\t\t}else{\r\n\t\t\t\tchildren = config.children;\r\n\t\t\t}\r\n\r\n\t\t\tchildren.forEach((childRow) => {\r\n\t\t\t\tif(childRow instanceof Row){\r\n\t\t\t\t\toutput.push(childRow);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\trowDelete(row){\r\n\t\tvar parent = row.modules.dataTree.parent,\r\n\t\tchildIndex;\r\n\r\n\t\tif(parent){\r\n\t\t\tchildIndex = this.findChildIndex(row, parent);\r\n\r\n\t\t\tif(childIndex !== false){\r\n\t\t\t\tparent.data[this.field].splice(childIndex, 1);\r\n\t\t\t}\r\n\r\n\t\t\tif(!parent.data[this.field].length){\r\n\t\t\t\tdelete parent.data[this.field];\r\n\t\t\t}\r\n\r\n\t\t\tthis.initializeRow(parent);\r\n\t\t\tthis.layoutRow(parent);\r\n\t\t}\r\n\r\n\t\tthis.refreshData(true);\r\n\t}\r\n\r\n\taddTreeChildRow(row, data, top, index){\r\n\t\tvar childIndex = false;\r\n\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\r\n\t\tif(!Array.isArray(row.data[this.field])){\r\n\t\t\trow.data[this.field] = [];\r\n\r\n\t\t\trow.modules.dataTree.open = this.startOpen(row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\r\n\t\tif(typeof index !== \"undefined\"){\r\n\t\t\tchildIndex = this.findChildIndex(index, row);\r\n\r\n\t\t\tif(childIndex !== false){\r\n\t\t\t\trow.data[this.field].splice((top ? childIndex : childIndex + 1), 0, data);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(childIndex === false){\r\n\t\t\tif(top){\r\n\t\t\t\trow.data[this.field].unshift(data);\r\n\t\t\t}else{\r\n\t\t\t\trow.data[this.field].push(data);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.initializeRow(row);\r\n\t\tthis.layoutRow(row);\r\n\r\n\t\tthis.refreshData(true);\r\n\t}\r\n\r\n\tfindChildIndex(subject, parent){\r\n\t\tvar match = false;\r\n\r\n\t\tif(typeof subject == \"object\"){\r\n\r\n\t\t\tif(subject instanceof Row){\r\n\t\t\t\t//subject is row element\r\n\t\t\t\tmatch = subject.data;\r\n\t\t\t}else if(subject instanceof RowComponent){\r\n\t\t\t\t//subject is public row component\r\n\t\t\t\tmatch = subject._getSelf().data;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\t\t\t\tif(parent.modules.dataTree){\r\n\t\t\t\t\tmatch = parent.modules.dataTree.children.find((childRow) => {\r\n\t\t\t\t\t\treturn childRow instanceof Row ? childRow.element === subject : false;\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(match){\r\n\t\t\t\t\t\tmatch = match.data;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}else if(typeof subject == \"undefined\" || subject === null){\r\n\t\t\tmatch = false\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the index of the row\r\n\t\t\tmatch = parent.data[this.field].find((row) => {\r\n\t\t\t\treturn row.data[this.table.options.index] == subject;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(match){\r\n\r\n\t\t\tif(Array.isArray(parent.data[this.field])){\r\n\t\t\t\tmatch = parent.data[this.field].indexOf(match);\r\n\t\t\t}\r\n\r\n\t\t\tif(match == -1){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//catch all for any other type of input\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tgetTreeChildren(row, component, recurse){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\toutput = [];\r\n\r\n\t\tif(config.children){\r\n\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tconfig.children.forEach((childRow) => {\r\n\t\t\t\tif(childRow instanceof Row){\r\n\t\t\t\t\toutput.push(component ? childRow.getComponent() : childRow);\r\n\r\n\t\t\t\t\tif(recurse){\r\n\t\t\t\t\t\toutput = output.concat(this.getTreeChildren(childRow, component, recurse));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetChildField(){\r\n\t\treturn this.field;\r\n\t}\r\n\r\n\tredrawNeeded(data){\r\n\t\treturn (this.field ? typeof data[this.field] !== \"undefined\" : false) || (this.elementField ? typeof data[this.elementField] !== \"undefined\" : false);\r\n\t}\r\n}\r\n\r\nDataTree.moduleName = \"dataTree\";\r\n\r\nexport default DataTree;","import csv from './downloaders/csv.js';\r\nimport json from './downloaders/json.js';\r\nimport pdf from './downloaders/pdf.js';\r\nimport xlsx from './downloaders/xlsx.js';\r\nimport html from './downloaders/html.js';\r\nimport jsonLines from './downloaders/jsonLines.js';\r\n\r\nexport default {\r\n\tcsv:csv,\r\n\tjson:json,\r\n\tjsonLines:jsonLines,\r\n\tpdf:pdf,\r\n\txlsx:xlsx,\r\n\thtml:html,\r\n};","export default function(list, options, setFileContents){\r\n\tvar delimiter = options && options.delimiter ? options.delimiter : \",\",\r\n\tfileContents = [],\r\n\theaders = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tvar item = [];\r\n\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"group\":\r\n\t\t\tconsole.warn(\"Download Warning - CSV downloader cannot process row groups\");\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\tconsole.warn(\"Download Warning - CSV downloader cannot process column calculations\");\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"header\":\r\n\t\t\trow.columns.forEach((col, i) => {\r\n\t\t\t\tif(col && col.depth === 1){\r\n\t\t\t\t\theaders[i] = typeof col.value == \"undefined\" || col.value === null ? \"\" : ('\"' + String(col.value).split('\"').join('\"\"') + '\"');\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\trow.columns.forEach((col) => {\r\n\r\n\t\t\t\tif(col){\r\n\r\n\t\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\tcol.value = col.value !== null ? JSON.stringify(col.value) : \"\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\tcol.value = \"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\titem.push('\"' + String(col.value).split('\"').join('\"\"') + '\"');\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tfileContents.push(item.join(delimiter));\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(headers.length){\r\n\t\tfileContents.unshift(headers.join(delimiter));\r\n\t}\r\n\r\n\tfileContents = fileContents.join(\"\\n\");\r\n\r\n\tif(options.bom){\r\n\t\tfileContents = \"\\ufeff\" + fileContents;\r\n\t}\r\n\r\n\tsetFileContents(fileContents, \"text/csv\");\r\n};\r\n","export default function(list, options, setFileContents){\r\n\tvar fileContents = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tvar item = {};\r\n\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"header\":\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process row groups\");\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process column calculations\");\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\tif(col){\r\n\t\t\t\t\titem[col.component.getTitleDownload() || col.component.getField()] = col.value;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tfileContents.push(item);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tfileContents = JSON.stringify(fileContents, null, '\\t');\r\n\r\n\tsetFileContents(fileContents, \"application/json\");\r\n};","export default function (list, options, setFileContents) {\r\n\tconst fileContents = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tconst item = {};\r\n\r\n\t\tswitch (row.type) {\r\n\t\t\tcase \"header\":\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process row groups\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process column calculations\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\t\tif (col) {\r\n\t\t\t\t\t\titem[col.component.getTitleDownload() || col.component.getField()] = col.value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tfileContents.push(JSON.stringify(item));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tsetFileContents(fileContents.join(\"\\n\"), \"application/x-ndjson\");\r\n};","export default function(list, options, setFileContents){\r\n\tvar header = [],\r\n\tbody = [],\r\n\tautoTableParams = {},\r\n\trowGroupStyles = options.rowGroupStyles || {\r\n\t\tfontStyle: \"bold\",\r\n\t\tfontSize: 12,\r\n\t\tcellPadding: 6,\r\n\t\tfillColor: 220,\r\n\t},\r\n\trowCalcStyles = options.rowCalcStyles || {\r\n\t\tfontStyle: \"bold\",\r\n\t\tfontSize: 10,\r\n\t\tcellPadding: 4,\r\n\t\tfillColor: 232,\r\n\t},\r\n\tjsPDFParams = options.jsPDF || {},\r\n\ttitle = options && options.title ? options.title : \"\";\r\n\r\n\tif(!jsPDFParams.orientation){\r\n\t\tjsPDFParams.orientation = options.orientation || \"landscape\";\r\n\t}\r\n\r\n\tif(!jsPDFParams.unit){\r\n\t\tjsPDFParams.unit = \"pt\";\r\n\t}\r\n\r\n\t//parse row list\r\n\tlist.forEach((row) => {\r\n\t\tvar item = {};\r\n\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"header\":\r\n\t\t\theader.push(parseRow(row));\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\tbody.push(parseRow(row, rowGroupStyles));\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\tbody.push(parseRow(row, rowCalcStyles));\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\tbody.push(parseRow(row));\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tfunction parseRow(row, styles){\r\n\t\tvar rowData = [];\r\n\r\n\t\trow.columns.forEach((col) =>{\r\n\t\t\tvar cell;\r\n\r\n\t\t\tif(col){\r\n\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\tcol.value = col.value !== null ? JSON.stringify(col.value) : \"\";\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\tcol.value = \"\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcell = {\r\n\t\t\t\t\tcontent:col.value,\r\n\t\t\t\t\tcolSpan:col.width,\r\n\t\t\t\t\trowSpan:col.height,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tif(styles){\r\n\t\t\t\t\tcell.styles = styles;\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowData.push(cell);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowData;\r\n\t}\r\n\r\n\r\n\t//configure PDF\r\n\tvar doc = new jspdf.jsPDF(jsPDFParams); //set document to landscape, better for most tables\r\n\r\n\tif(options && options.autoTable){\r\n\t\tif(typeof options.autoTable === \"function\"){\r\n\t\t\tautoTableParams = options.autoTable(doc) || {};\r\n\t\t}else{\r\n\t\t\tautoTableParams = options.autoTable;\r\n\t\t}\r\n\t}\r\n\r\n\tif(title){\r\n\t\tautoTableParams.didDrawPage = function(data) {\r\n\t\t\tdoc.text(title, 40, 30);\r\n\t\t};\r\n\t}\r\n\r\n\tautoTableParams.head = header;\r\n\tautoTableParams.body = body;\r\n\r\n\tdoc.autoTable(autoTableParams);\r\n\r\n\tif(options && options.documentProcessing){\r\n\t\toptions.documentProcessing(doc);\r\n\t}\r\n\r\n\tsetFileContents(doc.output(\"arraybuffer\"), \"application/pdf\");\r\n};\r\n","import CoreFeature from '../../../../core/CoreFeature.js';\r\n\r\nexport default function(list, options, setFileContents){\r\n\tvar self = this,\r\n\tsheetName = options.sheetName || \"Sheet1\",\r\n\tworkbook = XLSX.utils.book_new(),\r\n\ttableFeatures = new CoreFeature(this),\r\n\toutput;\r\n\r\n\tworkbook.SheetNames = [];\r\n\tworkbook.Sheets = {};\r\n\r\n\tfunction generateSheet(){\r\n\t\tvar rows = [],\r\n\t\tmerges = [],\r\n\t\tworksheet = {},\r\n\t\trange = {s: {c:0, r:0}, e: {c:(list[0] ? list[0].columns.reduce((a, b) => a + (b && b.width ? b.width : 1), 0) : 0), r:list.length }};\r\n\r\n\t\t//parse row list\r\n\t\tlist.forEach((row, i) => {\r\n\t\t\tvar rowData = [];\r\n\r\n\t\t\trow.columns.forEach(function(col, j){\r\n\r\n\t\t\t\tif(col){\r\n\t\t\t\t\trowData.push(!(col.value instanceof Date) && typeof col.value === \"object\" ? JSON.stringify(col.value) : col.value);\r\n\r\n\t\t\t\t\tif(col.width > 1 || col.height > -1){\r\n\t\t\t\t\t\tif(col.height > 1 || col.width > 1){\r\n\t\t\t\t\t\t\tmerges.push({s:{r:i,c:j},e:{r:i + col.height - 1,c:j + col.width - 1}});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\trowData.push(\"\");\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trows.push(rowData);\r\n\t\t});\r\n\r\n\t\t//convert rows to worksheet\r\n\t\tXLSX.utils.sheet_add_aoa(worksheet, rows);\r\n\r\n\t\tworksheet['!ref'] = XLSX.utils.encode_range(range);\r\n\r\n\t\tif(merges.length){\r\n\t\t\tworksheet[\"!merges\"] = merges;\r\n\t\t}\r\n\r\n\t\treturn worksheet;\r\n\t}\r\n\r\n\tif(options.sheetOnly){\r\n\t\tsetFileContents(generateSheet());\r\n\t\treturn;\r\n\t}\r\n\r\n\tif(options.sheets){\r\n\t\tfor(var sheet in options.sheets){\r\n\r\n\t\t\tif(options.sheets[sheet] === true){\r\n\t\t\t\tworkbook.SheetNames.push(sheet);\r\n\t\t\t\tworkbook.Sheets[sheet] = generateSheet();\r\n\t\t\t}else{\r\n\r\n\t\t\t\tworkbook.SheetNames.push(sheet);\r\n\r\n\t\t\t\ttableFeatures.commsSend(options.sheets[sheet], \"download\", \"intercept\",{\r\n\t\t\t\t\ttype:\"xlsx\",\r\n\t\t\t\t\toptions:{sheetOnly:true},\r\n\t\t\t\t\tactive:self.active,\r\n\t\t\t\t\tintercept:function(data){\r\n\t\t\t\t\t\tworkbook.Sheets[sheet] = data;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tworkbook.SheetNames.push(sheetName);\r\n\t\tworkbook.Sheets[sheetName] = generateSheet();\r\n\t}\r\n\r\n\tif(options.documentProcessing){\r\n\t\tworkbook = options.documentProcessing(workbook);\r\n\t}\r\n\r\n\t//convert workbook to binary array\r\n\tfunction s2ab(s) {\r\n\t\tvar buf = new ArrayBuffer(s.length);\r\n\t\tvar view = new Uint8Array(buf);\r\n\t\tfor (var i=0; i!=s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;\r\n\t\t\treturn buf;\r\n\t}\r\n\r\n\toutput = XLSX.write(workbook, {bookType:'xlsx', bookSST:true, type: 'binary'});\r\n\r\n\tsetFileContents(s2ab(output), \"application/octet-stream\");\r\n};","export default function(list, options, setFileContents){\r\n\tif(this.modExists(\"export\", true)){\r\n\t\tsetFileContents(this.modules.export.genereateHTMLTable(list), \"text/html\");\r\n\t}\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultDownloaders from './defaults/downloaders.js';\r\n\r\nclass Download extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.registerTableOption(\"downloadReady\", function(data, blob){return blob;}); //function to manipulate download data\r\n\t\tthis.registerTableOption(\"downloadConfig\", {}); //download config\r\n\t\tthis.registerTableOption(\"downloadRowRange\", \"active\"); //restrict download to active rows only\r\n\r\n\t\tthis.registerColumnOption(\"download\");\r\n\t\tthis.registerColumnOption(\"titleDownload\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"download\", this.download.bind(this));\r\n\t\tthis.registerTableFunction(\"downloadToTab\", this.downloadToTab.bind(this));\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tdownloadToTab(type, filename, options, active){\r\n\t\tthis.download(type, filename, options, active, true);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\t//trigger file download\r\n\tdownload(type, filename, options, range, interceptCallback){\r\n\t\tvar downloadFunc = false;\r\n\r\n\t\tfunction buildLink(data, mime){\r\n\t\t\tif(interceptCallback){\r\n\t\t\t\tif(interceptCallback === true){\r\n\t\t\t\t\tthis.triggerDownload(data, mime, type, filename, true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tinterceptCallback(data);\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tthis.triggerDownload(data, mime, type, filename);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(typeof type == \"function\"){\r\n\t\t\tdownloadFunc = type;\r\n\t\t}else{\r\n\t\t\tif(Download.downloaders[type]){\r\n\t\t\t\tdownloadFunc = Download.downloaders[type];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Download Error - No such download type found: \", type);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(downloadFunc){\r\n\t\t\tvar list = this.generateExportList(range);\r\n\r\n\t\t\tdownloadFunc.call(this.table, list , options || {}, buildLink.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateExportList(range){\r\n\t\tvar list = this.table.modules.export.generateExportList(this.table.options.downloadConfig, false, range || this.table.options.downloadRowRange, \"download\");\r\n\r\n\t\t//assign group header formatter\r\n\t\tvar groupHeader = this.table.options.groupHeaderDownload;\r\n\r\n\t\tif(groupHeader && !Array.isArray(groupHeader)){\r\n\t\t\tgroupHeader = [groupHeader];\r\n\t\t}\r\n\r\n\t\tlist.forEach((row) => {\r\n\t\t\tvar group;\r\n\r\n\t\t\tif(row.type === \"group\"){\r\n\t\t\t\tgroup = row.columns[0];\r\n\r\n\t\t\t\tif(groupHeader && groupHeader[row.indent]){\r\n\t\t\t\t\tgroup.value = groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn list;\r\n\t}\r\n\r\n\ttriggerDownload(data, mime, type, filename, newTab){\r\n\t\tvar element = document.createElement('a'),\r\n\t\tblob = new Blob([data],{type:mime}),\r\n\t\tfilename = filename || \"Tabulator.\" + (typeof type === \"function\" ? \"txt\" : type);\r\n\r\n\t\tblob = this.table.options.downloadReady(data, blob);\r\n\r\n\t\tif(blob){\r\n\r\n\t\t\tif(newTab){\r\n\t\t\t\twindow.open(window.URL.createObjectURL(blob));\r\n\t\t\t}else{\r\n\t\t\t\tif(navigator.msSaveOrOpenBlob){\r\n\t\t\t\t\tnavigator.msSaveOrOpenBlob(blob, filename);\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.setAttribute('href', window.URL.createObjectURL(blob));\r\n\r\n\t\t\t\t\t//set file title\r\n\t\t\t\t\telement.setAttribute('download', filename);\r\n\r\n\t\t\t\t\t//trigger download\r\n\t\t\t\t\telement.style.display = 'none';\r\n\t\t\t\t\tdocument.body.appendChild(element);\r\n\t\t\t\t\telement.click();\r\n\r\n\t\t\t\t\t//remove temporary link element\r\n\t\t\t\t\tdocument.body.removeChild(element);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"downloadComplete\");\r\n\t\t}\r\n\t}\r\n\r\n\tcommsReceived(table, action, data){\r\n\t\tswitch(action){\r\n\t\t\tcase \"intercept\":\r\n\t\t\tthis.download(data.type, \"\", data.options, data.active, data.intercept);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nDownload.moduleName = \"download\";\r\n\r\n//load defaults\r\nDownload.downloaders = defaultDownloaders;\r\n\r\nexport default Download;","export default function maskInput(el, options){\r\n\tvar mask = options.mask,\r\n\tmaskLetter = typeof options.maskLetterChar !== \"undefined\" ? options.maskLetterChar : \"A\",\r\n\tmaskNumber = typeof options.maskNumberChar !== \"undefined\" ? options.maskNumberChar : \"9\",\r\n\tmaskWildcard = typeof options.maskWildcardChar !== \"undefined\" ? options.maskWildcardChar : \"*\",\r\n\tsuccess = false;\r\n\r\n\tfunction fillSymbols(index){\r\n\t\tvar symbol = mask[index];\r\n\t\tif(typeof symbol !== \"undefined\" && symbol !== maskWildcard && symbol !== maskLetter && symbol !== maskNumber){\r\n\t\t\tel.value = el.value + \"\" + symbol;\r\n\t\t\tfillSymbols(index+1);\r\n\t\t}\r\n\t}\r\n\r\n\tel.addEventListener(\"keydown\", (e) => {\r\n\t\tvar index = el.value.length,\r\n\t\tchar = e.key;\r\n\r\n\t\tif(e.keyCode > 46){\r\n\t\t\tif(index >= mask.length){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tsuccess = false;\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\tswitch(mask[index]){\r\n\t\t\t\t\tcase maskLetter:\r\n\t\t\t\t\tif(char.toUpperCase() == char.toLowerCase()){\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\tsuccess = false;\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase maskNumber:\r\n\t\t\t\t\tif(isNaN(char)){\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\tsuccess = false;\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase maskWildcard:\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\tif(char !== mask[index]){\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\tsuccess = false;\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tsuccess = true;\r\n\t\t}\r\n\r\n\t\treturn;\r\n\t});\r\n\r\n\tel.addEventListener(\"keyup\", (e) => {\r\n\t\tif(e.keyCode > 46){\r\n\t\t\tif(options.maskAutoFill){\r\n\t\t\t\tfillSymbols(el.value.length);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\r\n\tif(!el.placeholder){\r\n\t\tel.placeholder = mask;\r\n\t}\r\n\r\n\tif(options.maskAutoFill){\r\n\t\tfillSymbols(el.value.length);\r\n\t}\r\n}","import maskInput from './inputMask.js';\r\nimport urlBuilder from '../Ajax/defaults/urlGenerator.js';\r\n\r\nexport default class Edit{\r\n constructor(editor, cell, onRendered, success, cancel, editorParams){\r\n this.edit = editor;\r\n this.table = editor.table;\r\n this.cell = cell;\r\n this.params = this._initializeParams(editorParams);\r\n \r\n this.data = [];\r\n this.displayItems = [];\r\n this.currentItems = [];\r\n this.focusedItem = null;\r\n \r\n this.input = this._createInputElement();\r\n this.listEl = this._createListElement();\r\n \r\n this.initialValues = null; \r\n \r\n this.isFilter = !cell._getSelf;\r\n \r\n this.filterTimeout = null;\r\n this.filtered = false;\r\n this.typing = false;\r\n \r\n this.values = []; \r\n this.popup = null; \r\n \r\n this.listIteration = 0;\r\n \r\n this.blurable = true;\r\n \r\n this.actions = {\r\n success:success,\r\n cancel:cancel\r\n }\r\n \r\n this._deprecationCheck();\r\n this._initializeValue();\r\n \r\n onRendered(this._onRendered.bind(this));\r\n }\r\n \r\n _deprecationCheck(){\r\n if(this.params.listItemFormatter){\r\n console.warn(\"The listItemFormatter editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n }\r\n \r\n if(this.params.sortValuesList){\r\n console.warn(\"The sortValuesList editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n }\r\n \r\n if(this.params.searchFunc){\r\n console.warn(\"The searchFunc editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n }\r\n \r\n if(this.params.searchingPlaceholder){\r\n console.warn(\"The searchingPlaceholder editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n }\r\n }\r\n \r\n _initializeValue(){\r\n var initialValue = this.cell.getValue();\r\n \r\n if(typeof initialValue === \"undefined\" && typeof this.params.defaultValue !== \"undefined\"){\r\n initialValue = this.params.defaultValue;\r\n }\r\n \r\n this.initialValues = this.params.multiselect ? initialValue : [initialValue];\r\n \r\n if(this.isFilter){\r\n this.input.value = this.initialValues ? this.initialValues.join(\",\") : \"\";\r\n this.headerFilterInitialListGen(); \r\n }\r\n }\r\n \r\n _onRendered(){\r\n var cellEl = this.cell.getElement();\r\n \r\n function clickStop(e){\r\n e.stopPropagation();\r\n }\r\n \r\n this.input.style.height = \"100%\";\r\n this.input.focus({preventScroll: true});\r\n \r\n \r\n cellEl.addEventListener(\"click\", clickStop);\r\n \r\n setTimeout(() => {\r\n cellEl.removeEventListener(\"click\", clickStop);\r\n }, 1000)\r\n }\r\n \r\n _createListElement(){\r\n var listEl = document.createElement(\"div\");\r\n listEl.classList.add(\"tabulator-edit-list\");\r\n \r\n listEl.addEventListener(\"mousedown\", this._preventBlur.bind(this));\r\n listEl.addEventListener(\"keydown\", this._inputKeyDown.bind(this))\r\n \r\n return listEl;\r\n }\r\n \r\n _setListWidth(){\r\n var element = this.isFilter ? this.input : this.cell.getElement();\r\n \r\n this.listEl.style.minWidth = element.offsetWidth + \"px\";\r\n \r\n if(this.params.maxWidth){\r\n if(this.params.maxWidth === true){\r\n this.listEl.style.maxWidth = element.offsetWidth + \"px\";\r\n }else if(typeof this.params.maxWidth === \"number\"){\r\n this.listEl.style.maxWidth = this.params.maxWidth + \"px\";\r\n }else{\r\n this.listEl.style.maxWidth = this.params.maxWidth;\r\n }\r\n }\r\n \r\n }\r\n \r\n _createInputElement(){\r\n var attribs = this.params.elementAttributes;\r\n var input = document.createElement(\"input\");\r\n \r\n input.setAttribute(\"type\", this.params.clearable ? \"search\" : \"text\");\r\n \r\n input.style.padding = \"4px\";\r\n input.style.width = \"100%\";\r\n input.style.boxSizing = \"border-box\";\r\n \r\n if(!this.params.autocomplete){\r\n input.style.cursor = \"default\";\r\n input.style.caretColor = \"transparent\";\r\n // input.readOnly = (this.edit.currentCell != false);\r\n }\r\n \r\n if(attribs && typeof attribs == \"object\"){\r\n for (let key in attribs){\r\n if(key.charAt(0) == \"+\"){\r\n key = key.slice(1);\r\n input.setAttribute(key, input.getAttribute(key) + attribs[\"+\" + key]);\r\n }else{\r\n input.setAttribute(key, attribs[key]);\r\n }\r\n }\r\n }\r\n \r\n if(this.params.mask){\r\n maskInput(input, this.params);\r\n }\r\n \r\n this._bindInputEvents(input);\r\n \r\n return input;\r\n }\r\n \r\n _initializeParams(params){\r\n var valueKeys = [\"values\", \"valuesURL\", \"valuesLookup\"],\r\n valueCheck;\r\n\r\n params = Object.assign({}, params);\r\n \r\n params.verticalNavigation = params.verticalNavigation || \"editor\";\r\n params.placeholderLoading = typeof params.placeholderLoading === \"undefined\" ? \"Searching ...\" : params.placeholderLoading;\r\n params.placeholderEmpty = typeof params.placeholderEmpty === \"undefined\" ? \"No Results Found\" : params.placeholderEmpty;\r\n params.filterDelay = typeof params.filterDelay === \"undefined\" ? 300 : params.filterDelay;\r\n \r\n params.emptyValue = Object.keys(params).includes(\"emptyValue\") ? params.emptyValue : \"\";\r\n\r\n valueCheck = Object.keys(params).filter(key => valueKeys.includes(key)).length;\r\n\r\n if(!valueCheck){\r\n console.warn(\"list editor config error - either the values, valuesURL, or valuesLookup option must be set\")\r\n }else if(valueCheck > 1){\r\n console.warn(\"list editor config error - only one of the values, valuesURL, or valuesLookup options can be set on the same editor\")\r\n }\r\n \r\n if(params.autocomplete){\r\n if(params.multiselect){\r\n params.multiselect = false;\r\n console.warn(\"list editor config error - multiselect option is not available when autocomplete is enabled\")\r\n }\r\n }else{\r\n if(params.freetext){\r\n params.freetext = false;\r\n console.warn(\"list editor config error - freetext option is only available when autocomplete is enabled\");\r\n }\r\n \r\n if(params.filterFunc){\r\n params.filterFunc = false;\r\n console.warn(\"list editor config error - filterFunc option is only available when autocomplete is enabled\");\r\n }\r\n \r\n if(params.filterRemote){\r\n params.filterRemote = false;\r\n console.warn(\"list editor config error - filterRemote option is only available when autocomplete is enabled\");\r\n }\r\n \r\n if(params.mask){\r\n params.mask = false;\r\n console.warn(\"list editor config error - mask option is only available when autocomplete is enabled\");\r\n }\r\n \r\n if(params.allowEmpty){\r\n params.allowEmpty = false;\r\n console.warn(\"list editor config error - allowEmpty option is only available when autocomplete is enabled\");\r\n }\r\n \r\n if(params.listOnEmpty){\r\n params.listOnEmpty = false;\r\n console.warn(\"list editor config error - listOnEmpty option is only available when autocomplete is enabled\");\r\n }\r\n }\r\n \r\n if(params.filterRemote && !(typeof params.valuesLookup === \"function\" || typeof params.valuesURL)){\r\n params.filterRemote = false;\r\n console.warn(\"list editor config error - filterRemote option should only be used when values list is populated from a remote source\");\r\n }\r\n return params;\r\n }\r\n //////////////////////////////////////\r\n ////////// Event Handling ////////////\r\n //////////////////////////////////////\r\n \r\n _bindInputEvents(input){\r\n input.addEventListener(\"focus\", this._inputFocus.bind(this))\r\n input.addEventListener(\"click\", this._inputClick.bind(this))\r\n input.addEventListener(\"blur\", this._inputBlur.bind(this))\r\n input.addEventListener(\"keydown\", this._inputKeyDown.bind(this))\r\n input.addEventListener(\"search\", this._inputSearch.bind(this))\r\n \r\n if(this.params.autocomplete){\r\n input.addEventListener(\"keyup\", this._inputKeyUp.bind(this))\r\n }\r\n }\r\n \r\n \r\n _inputFocus(e){\r\n this.rebuildOptionsList();\r\n }\r\n \r\n _filter(){\r\n if(this.params.filterRemote){\r\n clearTimeout(this.filterTimeout);\r\n \r\n this.filterTimeout = setTimeout(() => {\r\n this.rebuildOptionsList();\r\n }, this.params.filterDelay);\r\n }else{\r\n this._filterList();\r\n }\r\n }\r\n \r\n _inputClick(e){\r\n e.stopPropagation();\r\n }\r\n \r\n _inputBlur(e){\r\n if(this.blurable && this.popup){\r\n this.popup.hide();\r\n }\r\n }\r\n \r\n _inputSearch(){\r\n this._clearChoices();\r\n }\r\n \r\n _inputKeyDown(e){\r\n switch(e.keyCode){\r\n \r\n case 38: //up arrow\r\n this._keyUp(e);\r\n break\r\n \r\n case 40: //down arrow\r\n this._keyDown(e);\r\n break;\r\n \r\n case 37: //left arrow\r\n case 39: //right arrow\r\n this._keySide(e);\r\n break;\r\n \r\n case 13: //enter\r\n this._keyEnter();\r\n break;\r\n \r\n case 27: //escape\r\n this._keyEsc();\r\n break;\r\n \r\n case 36: //home\r\n case 35: //end\r\n this._keyHomeEnd(e);\r\n break;\r\n \r\n case 9: //tab\r\n break;\r\n \r\n default:\r\n this._keySelectLetter(e);\r\n }\r\n }\r\n \r\n _inputKeyUp(e){\r\n switch(e.keyCode){\r\n case 38: //up arrow\r\n case 37: //left arrow\r\n case 39: //up arrow\r\n case 40: //right arrow\r\n case 13: //enter\r\n case 27: //escape\r\n break;\r\n \r\n default:\r\n this._keyAutoCompLetter(e);\r\n }\r\n }\r\n \r\n _preventBlur(){\r\n this.blurable = false;\r\n \r\n setTimeout(function(){\r\n this.blurable = true;\r\n }, 10);\r\n }\r\n \r\n //////////////////////////////////////\r\n //////// Keyboard Navigation /////////\r\n //////////////////////////////////////\r\n \r\n _keyUp(e){\r\n var index = this.displayItems.indexOf(this.focusedItem);\r\n \r\n if(this.params.verticalNavigation == \"editor\" || (this.params.verticalNavigation == \"hybrid\" && index)){\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n e.preventDefault();\r\n \r\n if(index > 0){\r\n this._focusItem(this.displayItems[index - 1]);\r\n }\r\n }\r\n }\r\n \r\n _keyDown(e){\r\n var index = this.displayItems.indexOf(this.focusedItem);\r\n \r\n if(this.params.verticalNavigation == \"editor\" || (this.params.verticalNavigation == \"hybrid\" && index < this.displayItems.length - 1)){\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n e.preventDefault();\r\n \r\n if(index < this.displayItems.length - 1){\r\n if(index == -1){\r\n this._focusItem(this.displayItems[0]);\r\n }else{\r\n this._focusItem(this.displayItems[index + 1]);\r\n }\r\n }\r\n }\r\n }\r\n \r\n _keySide(e){\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n e.preventDefault();\r\n }\r\n \r\n _keyEnter(e){\r\n if(this.focusedItem){\r\n this._chooseItem(this.focusedItem);\r\n }else{\r\n this._cancel();\r\n }\r\n }\r\n \r\n _keyEsc(e){\r\n this._cancel();\r\n }\r\n \r\n _keyHomeEnd(e){\r\n if(this.params.autocomplete){\r\n //prevent table navigation while using input element\r\n e.stopImmediatePropagation();\r\n }\r\n }\r\n \r\n _keySelectLetter(e){\r\n if(!this.params.autocomplete){\r\n // if(this.edit.currentCell === false){\r\n e.preventDefault();\r\n // }\r\n \r\n if(e.keyCode >= 38 && e.keyCode <= 90){\r\n this._scrollToValue(e.keyCode);\r\n }\r\n }\r\n }\r\n \r\n _keyAutoCompLetter(e){\r\n this._filter();\r\n this.typing = true;\r\n }\r\n \r\n \r\n _scrollToValue(char){\r\n clearTimeout(this.filterTimeout);\r\n \r\n var character = String.fromCharCode(char).toLowerCase();\r\n this.filterTerm += character.toLowerCase();\r\n \r\n var match = this.displayItems.find((item) => {\r\n return typeof item.label !== \"undefined\" && item.label.toLowerCase().startsWith(this.filterTerm);\r\n });\r\n \r\n if(match){\r\n this._focusItem(match);\r\n }\r\n \r\n this.filterTimeout = setTimeout(() => {\r\n this.filterTerm = \"\";\r\n }, 800)\r\n }\r\n \r\n _focusItem(item){\r\n if(this.focusedItem && this.focusedItem.element){\r\n this.focusedItem.element.classList.remove(\"focused\");\r\n }\r\n \r\n this.focusedItem = item;\r\n \r\n if(item && item.element){\r\n item.element.classList.add(\"focused\");\r\n item.element.scrollIntoView({behavior: 'smooth', block: 'nearest', inline: 'start'});\r\n }\r\n }\r\n \r\n \r\n //////////////////////////////////////\r\n /////// Data List Generation /////////\r\n //////////////////////////////////////\r\n headerFilterInitialListGen(){\r\n this._generateOptions(true);\r\n }\r\n \r\n rebuildOptionsList(){\r\n this._generateOptions()\r\n .then(this._sortOptions.bind(this))\r\n .then(this._buildList.bind(this))\r\n .then(this._showList.bind(this))\r\n .catch((e) => {\r\n if(!Number.isInteger(e)){\r\n console.error(\"List generation error\", e);\r\n }\r\n })\r\n }\r\n \r\n _filterList(){\r\n this._buildList(this._filterOptions());\r\n this._showList();\r\n }\r\n \r\n _generateOptions(silent){\r\n var values = [];\r\n var itteration = ++ this.listIteration;\r\n \r\n this.filtered = false;\r\n \r\n if(this.params.values){\r\n values = this.params.values;\r\n }else if (this.params.valuesURL){\r\n values = this._ajaxRequest(this.params.valuesURL, this.input.value);\r\n }else{\r\n if(typeof this.params.valuesLookup === \"function\"){\r\n values = this.params.valuesLookup(this.cell, this.input.value);\r\n }else if(this.params.valuesLookup){\r\n values = this._uniqueColumnValues(this.params.valuesLookupField);\r\n }\r\n }\r\n \r\n if(values instanceof Promise){\r\n if(!silent){\r\n this._addPlaceholder(this.params.placeholderLoading);\r\n }\r\n \r\n return values.then()\r\n .then((responseValues) => {\r\n if(this.listIteration === itteration){\r\n return this._parseList(responseValues);\r\n }else{\r\n return Promise.reject(itteration);\r\n }\r\n });\r\n }else{\r\n return Promise.resolve(this._parseList(values))\r\n }\r\n }\r\n \r\n _addPlaceholder(contents){\r\n var placeholder = document.createElement(\"div\");\r\n \r\n if(typeof contents === \"function\"){\r\n contents = contents(cell.getComponent(), this.listEl);\r\n }\r\n \r\n if(contents){\r\n this._clearList();\r\n \r\n if(contents instanceof HTMLElement){\r\n placeholder = contents;\r\n }else{\r\n placeholder.classList.add(\"tabulator-edit-list-placeholder\")\r\n placeholder.innerHTML = contents;\r\n }\r\n \r\n this.listEl.appendChild(placeholder);\r\n \r\n this._showList();\r\n }\r\n }\r\n \r\n _ajaxRequest(url, term){\r\n var params = this.params.filterRemote ? {term:term} : {};\r\n url = urlBuilder(url, {}, params);\r\n \r\n return fetch(url)\r\n .then((response)=>{\r\n if(response.ok) {\r\n return response.json()\r\n .catch((error)=>{\r\n console.warn(\"List Ajax Load Error - Invalid JSON returned\", error);\r\n return Promise.reject(error);\r\n });\r\n }else{\r\n console.error(\"List Ajax Load Error - Connection Error: \" + response.status, response.statusText);\r\n return Promise.reject(response);\r\n }\r\n })\r\n .catch((error)=>{\r\n console.error(\"List Ajax Load Error - Connection Error: \", error);\r\n return Promise.reject(error);\r\n });\r\n }\r\n \r\n _uniqueColumnValues(field){\r\n var output = {},\r\n data = this.table.getData(this.params.valuesLookup),\r\n column;\r\n \r\n if(field){\r\n column = this.table.columnManager.getColumnByField(field);\r\n }else{\r\n column = this.cell.getColumn()._getSelf();\r\n }\r\n \r\n if(column){\r\n data.forEach((row) => {\r\n var val = column.getFieldValue(row);\r\n \r\n if(val !== null && typeof val !== \"undefined\" && val !== \"\"){\r\n output[val] = true;\r\n }\r\n });\r\n }else{\r\n console.warn(\"unable to find matching column to create select lookup list:\", field);\r\n output = [];\r\n }\r\n \r\n return Object.keys(output);\r\n }\r\n \r\n \r\n _parseList(inputValues){\r\n var data = [];\r\n \r\n if(!Array.isArray(inputValues)){\r\n inputValues = Object.entries(inputValues).map(([key, value]) => {\r\n return {\r\n label:value,\r\n value:key,\r\n };\r\n });\r\n }\r\n \r\n inputValues.forEach((value) => {\r\n if(typeof value !== \"object\"){\r\n value = {\r\n label:value,\r\n value:value,\r\n };\r\n }\r\n \r\n this._parseListItem(value, data, 0);\r\n });\r\n \r\n this.data = data;\r\n \r\n return data; \r\n }\r\n \r\n _parseListItem(option, data, level){\r\n var item = {};\r\n \r\n if(option.options){\r\n item = this._parseListGroup(option, level + 1);\r\n }else{\r\n item = {\r\n label:option.label,\r\n value:option.value,\r\n itemParams:option.itemParams,\r\n elementAttributes: option.elementAttributes,\r\n element:false,\r\n selected:false,\r\n visible:true,\r\n level:level,\r\n original:option,\r\n };\r\n \r\n if(this.initialValues && this.initialValues.indexOf(option.value) > -1){\r\n this._chooseItem(item, true);\r\n }\r\n }\r\n \r\n data.push(item);\r\n }\r\n \r\n _parseListGroup(option, level){\r\n var item = {\r\n label:option.label,\r\n group:true,\r\n itemParams:option.itemParams,\r\n elementAttributes:option.elementAttributes,\r\n element:false,\r\n visible:true,\r\n level:level,\r\n options:[],\r\n original:option,\r\n };\r\n \r\n option.options.forEach((child) => {\r\n this._parseListItem(child, item.options, level);\r\n });\r\n \r\n return item;\r\n }\r\n \r\n _sortOptions(options){\r\n var sorter;\r\n \r\n if(this.params.sort){\r\n sorter = typeof this.params.sort === \"function\" ? this.params.sort : this._defaultSortFunction.bind(this);\r\n \r\n this._sortGroup(sorter, options);\r\n }\r\n \r\n return options;\r\n }\r\n \r\n _sortGroup(sorter, options){\r\n options.sort((a,b) => {\r\n return sorter(a.label, b.label, a.value, b.value, a.original, b.original);\r\n });\r\n \r\n options.forEach((option) => {\r\n if(option.group){\r\n this._sortGroup(sorter, option.options);\r\n }\r\n })\r\n }\r\n \r\n _defaultSortFunction(as, bs){\r\n var a, b, a1, b1, i= 0, L, rx = /(\\d+)|(\\D+)/g, rd = /\\d/;\r\n var emptyAlign = 0;\r\n \r\n if(this.params.sort === \"desc\"){\r\n [as, bs] = [bs, as];\r\n }\r\n \r\n //handle empty values\r\n if(!as && as!== 0){\r\n emptyAlign = !bs && bs!== 0 ? 0 : -1;\r\n }else if(!bs && bs!== 0){\r\n emptyAlign = 1;\r\n }else{\r\n if(isFinite(as) && isFinite(bs)) return as - bs;\r\n a = String(as).toLowerCase();\r\n b = String(bs).toLowerCase();\r\n if(a === b) return 0;\r\n if(!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1;\r\n a = a.match(rx);\r\n b = b.match(rx);\r\n L = a.length > b.length ? b.length : a.length;\r\n while(i < L){\r\n a1= a[i];\r\n b1= b[i++];\r\n if(a1 !== b1){\r\n if(isFinite(a1) && isFinite(b1)){\r\n if(a1.charAt(0) === \"0\") a1 = \".\" + a1;\r\n if(b1.charAt(0) === \"0\") b1 = \".\" + b1;\r\n return a1 - b1;\r\n }\r\n else return a1 > b1 ? 1 : -1;\r\n }\r\n }\r\n \r\n return a.length > b.length;\r\n }\r\n \r\n return emptyAlign;\r\n }\r\n \r\n _filterOptions(){\r\n var filterFunc = this.params.filterFunc || this._defaultFilterFunc;\r\n var term = this.input.value;\r\n var results = [];\r\n \r\n if(term){\r\n this.filtered = true;\r\n \r\n this.data.forEach((item) => {\r\n this._filterItem(filterFunc, term, item);\r\n });\r\n }else{\r\n this.filtered = false;\r\n }\r\n \r\n return this.data;\r\n }\r\n \r\n _filterItem(func, term, item){\r\n var matches = false;\r\n \r\n if(!item.group){\r\n item.visible = func(term, item.label, item.value, item.original);\r\n }else{\r\n item.options.forEach((option) => {\r\n if(this._filterItem(func, term, option)){\r\n matches = true;\r\n }\r\n });\r\n \r\n item.visible = matches;\r\n }\r\n \r\n return item.visible;\r\n }\r\n \r\n _defaultFilterFunc(term, label, value, item){\r\n var term = String(term).toLowerCase();\r\n \r\n if(label !== null || typeof label !== \"undefined\"){\r\n if(String(label).toLowerCase().indexOf(term) > -1 || String(value).toLowerCase(term).indexOf() > -1){\r\n return true;\r\n }\r\n }\r\n \r\n return false;\r\n }\r\n \r\n //////////////////////////////////////\r\n /////////// Display List /////////////\r\n //////////////////////////////////////\r\n \r\n _clearList(){\r\n while(this.listEl.firstChild) this.listEl.removeChild(this.listEl.firstChild);\r\n \r\n this.displayItems = [];\r\n }\r\n \r\n _buildList(data){\r\n this._clearList();\r\n \r\n data.forEach((option) => {\r\n this._buildItem(option);\r\n });\r\n \r\n if(!this.displayItems.length){\r\n this._addPlaceholder(this.params.placeholderEmpty);\r\n } \r\n }\r\n \r\n _buildItem(item){\r\n var el = item.element,\r\n contents;\r\n \r\n if(!this.filtered || item.visible){\r\n \r\n if(!el){\r\n el = document.createElement(\"div\");\r\n el.tabIndex = 0;\r\n \r\n contents = this.params.itemFormatter ? this.params.itemFormatter(item.label, item.value, item.original, el) : item.label;\r\n \r\n if(contents instanceof HTMLElement){\r\n el.appendChild(contents)\r\n }else{\r\n el.innerHTML = contents;\r\n }\r\n \r\n if(item.group){\r\n el.classList.add(\"tabulator-edit-list-group\");\r\n }else{\r\n el.classList.add(\"tabulator-edit-list-item\");\r\n }\r\n \r\n el.classList.add(\"tabulator-edit-list-group-level-\" + item.level);\r\n \r\n if(item.elementAttributes && typeof item.elementAttributes == \"object\"){\r\n for (let key in item.elementAttributes){\r\n if(key.charAt(0) == \"+\"){\r\n key = key.slice(1);\r\n el.setAttribute(key, this.input.getAttribute(key) + item.elementAttributes[\"+\" + key]);\r\n }else{\r\n el.setAttribute(key, item.elementAttributes[key]);\r\n }\r\n }\r\n }\r\n \r\n if(item.group){\r\n el.addEventListener(\"click\", this._groupClick.bind(this, item));\r\n }else{\r\n el.addEventListener(\"click\", this._itemClick.bind(this, item));\r\n }\r\n \r\n el.addEventListener(\"mousedown\", this._preventBlur.bind(this));\r\n \r\n item.element = el;\r\n }\r\n \r\n this._styleItem(item);\r\n \r\n this.listEl.appendChild(el);\r\n \r\n if(item.group){\r\n item.options.forEach((option) => {\r\n this._buildItem(option);\r\n });\r\n }else{\r\n this.displayItems.push(item);\r\n }\r\n }\r\n }\r\n \r\n _showList(){\r\n var startVis = this.popup && this.popup.isVisible();\r\n \r\n if(this.input.parentNode){\r\n if(this.params.autocomplete && this.input.value === \"\" && !this.params.listOnEmpty){\r\n if(this.popup){\r\n this.popup.hide(true);\r\n return;\r\n }\r\n }\r\n \r\n this._setListWidth();\r\n \r\n if(!this.popup){\r\n this.popup = this.edit.popup(this.listEl);\r\n }\r\n \r\n this.popup.show(this.cell.getElement(), \"bottom\")\r\n \r\n if(!startVis){\r\n this.popup.hideOnBlur(this._resolveValue.bind(this, true));\r\n }\r\n }\r\n }\r\n \r\n _styleItem(item){\r\n if(item && item.element){\r\n if(item.selected){\r\n item.element.classList.add(\"active\");\r\n }else{\r\n item.element.classList.remove(\"active\");\r\n }\r\n }\r\n }\r\n \r\n //////////////////////////////////////\r\n ///////// User Interaction ///////////\r\n //////////////////////////////////////\r\n \r\n _itemClick(item, e){\r\n e.stopPropagation();\r\n \r\n this._chooseItem(item);\r\n }\r\n \r\n _groupClick(item, e){\r\n e.stopPropagation();\r\n }\r\n \r\n \r\n //////////////////////////////////////\r\n ////// Current Item Management ///////\r\n //////////////////////////////////////\r\n \r\n _cancel(){\r\n this.popup.hide(true);\r\n this.actions.cancel();\r\n }\r\n \r\n _clearChoices(){\r\n this.typing = true;\r\n \r\n this.currentItems.forEach((item) => {\r\n item.selected = false;\r\n this._styleItem(item);\r\n });\r\n \r\n this.currentItems = [];\r\n \r\n this.focusedItem = null;\r\n }\r\n \r\n _chooseItem(item, silent){\r\n var index;\r\n \r\n this.typing = false;\r\n \r\n if(this.params.multiselect){\r\n index = this.currentItems.indexOf(item);\r\n \r\n if(index > -1){\r\n this.currentItems.splice(index, 1);\r\n item.selected = false;\r\n }else{\r\n this.currentItems.push(item);\r\n item.selected = true;\r\n }\r\n \r\n this.input.value = this.currentItems.map(item => item.label).join(\",\");\r\n \r\n this._styleItem(item);\r\n \r\n }else{\r\n this.currentItems = [item];\r\n item.selected = true;\r\n \r\n this.input.value = item.label;\r\n \r\n this._styleItem(item);\r\n \r\n if(!silent){\r\n this._resolveValue();\r\n }\r\n }\r\n \r\n this._focusItem(item);\r\n }\r\n \r\n _resolveValue(blur){\r\n var output, initialValue;\r\n \r\n this.popup.hide(true);\r\n \r\n if(this.params.multiselect){\r\n output = this.currentItems.map(item => item.value);\r\n }else{\r\n if(blur && this.params.autocomplete && this.typing){\r\n if(this.params.freetext || (this.params.allowEmpty && this.input.value === \"\")){\r\n output = this.input.value;\r\n }else{\r\n this.actions.cancel();\r\n return;\r\n }\r\n }else{\r\n if(this.currentItems[0]){\r\n output = this.currentItems[0].value;\r\n }else{\r\n initialValue = this.initialValues[0];\r\n \r\n if(initialValue === null || typeof initialValue === \"undefined\" || initialValue === \"\"){\r\n output = initialValue;\r\n }else{\r\n output = this.params.emptyValue;\r\n }\r\n }\r\n \r\n }\r\n }\r\n \r\n if(output === \"\"){\r\n output = this.params.emptyValue;\r\n }\r\n \r\n this.actions.success(output);\r\n \r\n if(this.isFilter){\r\n this.initialValues = output && !Array.isArray[output] ? [output] : output;\r\n }\r\n }\r\n \r\n}\r\n","import input from './editors/input.js';\r\nimport textarea from './editors/textarea.js';\r\nimport number from './editors/number.js';\r\nimport range from './editors/range.js';\r\nimport select from './editors/select.js';\r\nimport list from './editors/list.js';\r\nimport autocomplete from './editors/autocomplete.js';\r\nimport star from './editors/star.js';\r\nimport progress from './editors/progress.js';\r\nimport tickCross from './editors/tickCross.js';\r\n\r\nexport default {\r\n\tinput:input,\r\n\ttextarea:textarea,\r\n number:number,\r\n range:range,\r\n\tselect:select,\r\n\tlist:list,\r\n\tautocomplete:autocomplete,\r\n\tstar:star,\r\n\tprogress:progress,\r\n\ttickCross:tickCross,\r\n};","import maskInput from '../../inputMask.js';\r\n\r\n//input element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\t//create and style input\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", editorParams.search ? \"search\" : \"text\");\r\n\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = typeof cellValue !== \"undefined\" ? cellValue : \"\";\r\n\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\r\n\tfunction onChange(e){\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && input.value !== \"\") || input.value !== cellValue){\r\n\t\t\tif(success(input.value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t// case 9:\r\n\t\t\tcase 13:\r\n\t\t\tonChange(e);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\tcancel();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\te.stopPropagation();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(editorParams.mask){\r\n\t\tmaskInput(input, editorParams);\r\n\t}\r\n\r\n\treturn input;\r\n};","import maskInput from '../../inputMask.js';\r\n\r\n//resizable text area element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n var self = this,\r\n cellValue = cell.getValue(),\r\n vertNav = editorParams.verticalNavigation || \"hybrid\",\r\n value = String(cellValue !== null && typeof cellValue !== \"undefined\" ? cellValue : \"\"),\r\n count = (value.match(/(?:\\r\\n|\\r|\\n)/g) || []).length + 1,\r\n input = document.createElement(\"textarea\"),\r\n scrollHeight = 0;\r\n\r\n //create and style input\r\n input.style.display = \"block\";\r\n input.style.padding = \"2px\";\r\n input.style.height = \"100%\";\r\n input.style.width = \"100%\";\r\n input.style.boxSizing = \"border-box\";\r\n input.style.whiteSpace = \"pre-wrap\";\r\n input.style.resize = \"none\";\r\n\r\n if(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n for (let key in editorParams.elementAttributes){\r\n if(key.charAt(0) == \"+\"){\r\n key = key.slice(1);\r\n input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n }else{\r\n input.setAttribute(key, editorParams.elementAttributes[key]);\r\n }\r\n }\r\n }\r\n\r\n input.value = value;\r\n\r\n onRendered(function(){\r\n input.focus({preventScroll: true});\r\n input.style.height = \"100%\";\r\n\r\n input.scrollHeight;\r\n input.style.height = input.scrollHeight + \"px\";\r\n cell.getRow().normalizeHeight();\r\n\r\n if(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n });\r\n\r\n function onChange(e){\r\n\r\n if(((cellValue === null || typeof cellValue === \"undefined\") && input.value !== \"\") || input.value !== cellValue){\r\n\r\n if(success(input.value)){\r\n cellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n }\r\n\r\n setTimeout(function(){\r\n cell.getRow().normalizeHeight();\r\n },300)\r\n }else{\r\n cancel();\r\n }\r\n }\r\n\r\n //submit new value on blur or change\r\n input.addEventListener(\"change\", onChange);\r\n input.addEventListener(\"blur\", onChange);\r\n\r\n input.addEventListener(\"keyup\", function(){\r\n\r\n input.style.height = \"\";\r\n\r\n var heightNow = input.scrollHeight;\r\n\r\n input.style.height = heightNow + \"px\";\r\n\r\n if(heightNow != scrollHeight){\r\n scrollHeight = heightNow;\r\n cell.getRow().normalizeHeight();\r\n }\r\n });\r\n\r\n input.addEventListener(\"keydown\", function(e){\r\n\r\n switch(e.keyCode){\r\n case 27:\r\n cancel();\r\n break;\r\n\r\n case 38: //up arrow\r\n if(vertNav == \"editor\" || (vertNav == \"hybrid\" && input.selectionStart)){\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n }\r\n\r\n break;\r\n\r\n case 40: //down arrow\r\n if(vertNav == \"editor\" || (vertNav == \"hybrid\" && input.selectionStart !== input.value.length)){\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n }\r\n break;\r\n\r\n case 35:\r\n case 36:\r\n e.stopPropagation();\r\n break;\r\n }\r\n });\r\n\r\n if(editorParams.mask){\r\n maskInput(input, editorParams);\r\n }\r\n\r\n return input;\r\n};","import maskInput from '../../inputMask.js';\r\n\r\n//input element with type of number\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar cellValue = cell.getValue(),\r\n\tvertNav = editorParams.verticalNavigation || \"editor\",\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", \"number\");\r\n\r\n\tif(typeof editorParams.max != \"undefined\"){\r\n\t\tinput.setAttribute(\"max\", editorParams.max);\r\n\t}\r\n\r\n\tif(typeof editorParams.min != \"undefined\"){\r\n\t\tinput.setAttribute(\"min\", editorParams.min);\r\n\t}\r\n\r\n\tif(typeof editorParams.step != \"undefined\"){\r\n\t\tinput.setAttribute(\"step\", editorParams.step);\r\n\t}\r\n\r\n\t//create and style input\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\r\n\tvar blurFunc = function(e){\r\n\t\tonChange();\r\n\t};\r\n\r\n\tonRendered(function () {\r\n\t\t//submit new value on blur\r\n\t\tinput.removeEventListener(\"blur\", blurFunc);\r\n\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\r\n\t\t//submit new value on blur\r\n\t\tinput.addEventListener(\"blur\", blurFunc);\r\n\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\r\n\tfunction onChange(){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(!isNaN(value) && value !==\"\"){\r\n\t\t\tvalue = Number(value);\r\n\t\t}\r\n\r\n\t\tif(value !== cellValue){\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 13:\r\n\t\t\t// case 9:\r\n\t\t\tonChange();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\tcancel();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 38: //up arrow\r\n\t\t\tcase 40: //down arrow\r\n\t\t\tif(vertNav == \"editor\"){\r\n\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\te.stopPropagation();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(editorParams.mask){\r\n\t\tmaskInput(input, editorParams);\r\n\t}\r\n\r\n\treturn input;\r\n};","//input element with type of number\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", \"range\");\r\n\r\n\tif (typeof editorParams.max != \"undefined\") {\r\n\t\tinput.setAttribute(\"max\", editorParams.max);\r\n\t}\r\n\r\n\tif (typeof editorParams.min != \"undefined\") {\r\n\t\tinput.setAttribute(\"min\", editorParams.min);\r\n\t}\r\n\r\n\tif (typeof editorParams.step != \"undefined\") {\r\n\t\tinput.setAttribute(\"step\", editorParams.step);\r\n\t}\r\n\r\n\t//create and style input\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\r\n\tonRendered(function () {\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\t});\r\n\r\n\tfunction onChange(){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(!isNaN(value) && value !==\"\"){\r\n\t\t\tvalue = Number(value);\r\n\t\t}\r\n\r\n\t\tif(value != cellValue){\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur\r\n\tinput.addEventListener(\"blur\", function(e){\r\n\t\tonChange();\r\n\t});\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 13:\r\n\t\t\t// case 9:\r\n\t\t\tonChange();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\tcancel();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\treturn input;\r\n};","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\r\n\t console.warn(\"The select editor has been deprecated, please use the new list editor\");\r\n\r\n var list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n return list.input;\r\n}","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n var list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n return list.input;\r\n}","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\r\n\tconsole.warn(\"The autocomplete editor has been deprecated, please use the new list editor with the 'autocomplete' editorParam\");\r\n\r\n\teditorParams.autocomplete = true;\r\n\r\n var list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n return list.input;\r\n}","//star rating\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar self = this,\r\n\telement = cell.getElement(),\r\n\tvalue = cell.getValue(),\r\n\tmaxStars = element.getElementsByTagName(\"svg\").length || 5,\r\n\tsize = element.getElementsByTagName(\"svg\")[0] ? element.getElementsByTagName(\"svg\")[0].getAttribute(\"width\") : 14,\r\n\tstars = [],\r\n\tstarsHolder = document.createElement(\"div\"),\r\n\tstar = document.createElementNS('http://www.w3.org/2000/svg', \"svg\");\r\n\r\n\r\n\t//change star type\r\n\tfunction starChange(val){\r\n\t\tstars.forEach(function(star, i){\r\n\t\t\tif(i < val){\r\n\t\t\t\tif(self.table.browser == \"ie\"){\r\n\t\t\t\t\tstar.setAttribute(\"class\", \"tabulator-star-active\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tstar.classList.replace(\"tabulator-star-inactive\", \"tabulator-star-active\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstar.innerHTML = '';\r\n\t\t\t}else{\r\n\t\t\t\tif(self.table.browser == \"ie\"){\r\n\t\t\t\t\tstar.setAttribute(\"class\", \"tabulator-star-inactive\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tstar.classList.replace(\"tabulator-star-active\", \"tabulator-star-inactive\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstar.innerHTML = '';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//build stars\r\n\tfunction buildStar(i){\r\n\r\n\t\tvar starHolder = document.createElement(\"span\");\r\n\t\tvar nextStar = star.cloneNode(true);\r\n\r\n\t\tstars.push(nextStar);\r\n\r\n\t\tstarHolder.addEventListener(\"mouseenter\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\tstarChange(i);\r\n\t\t});\r\n\r\n\t\tstarHolder.addEventListener(\"mousemove\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t});\r\n\r\n\t\tstarHolder.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\tsuccess(i);\r\n\t\t\telement.blur();\r\n\t\t});\r\n\r\n\t\tstarHolder.appendChild(nextStar);\r\n\t\tstarsHolder.appendChild(starHolder);\r\n\r\n\t}\r\n\r\n\t//handle keyboard navigation value change\r\n\tfunction changeValue(val){\r\n\t\tvalue = val;\r\n\t\tstarChange(val);\r\n\t}\r\n\r\n\t//style cell\r\n\telement.style.whiteSpace = \"nowrap\";\r\n\telement.style.overflow = \"hidden\";\r\n\telement.style.textOverflow = \"ellipsis\";\r\n\r\n\t//style holding element\r\n\tstarsHolder.style.verticalAlign = \"middle\";\r\n\tstarsHolder.style.display = \"inline-block\";\r\n\tstarsHolder.style.padding = \"4px\";\r\n\r\n\t//style star\r\n\tstar.setAttribute(\"width\", size);\r\n\tstar.setAttribute(\"height\", size);\r\n\tstar.setAttribute(\"viewBox\", \"0 0 512 512\");\r\n\tstar.setAttribute(\"xml:space\", \"preserve\");\r\n\tstar.style.padding = \"0 1px\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tstarsHolder.setAttribute(key, starsHolder.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tstarsHolder.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//create correct number of stars\r\n\tfor(var i=1;i<= maxStars;i++){\r\n\t\tbuildStar(i);\r\n\t}\r\n\r\n\t//ensure value does not exceed number of stars\r\n\tvalue = Math.min(parseInt(value), maxStars);\r\n\r\n\t// set initial styling of stars\r\n\tstarChange(value);\r\n\r\n\tstarsHolder.addEventListener(\"mousemove\", function(e){\r\n\t\tstarChange(0);\r\n\t});\r\n\r\n\tstarsHolder.addEventListener(\"click\", function(e){\r\n\t\tsuccess(0);\r\n\t});\r\n\r\n\telement.addEventListener(\"blur\", function(e){\r\n\t\tcancel();\r\n\t});\r\n\r\n\t//allow key based navigation\r\n\telement.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 39: //right arrow\r\n\t\t\tchangeValue(value + 1);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 37: //left arrow\r\n\t\t\tchangeValue(value - 1);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 13: //enter\r\n\t\t\tsuccess(value);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 27: //escape\r\n\t\t\tcancel();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\treturn starsHolder;\r\n};","//draggable progress bar\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar element = cell.getElement(),\r\n\tmax = typeof editorParams.max === \"undefined\" ? ((element.getElementsByTagName(\"div\")[0] && element.getElementsByTagName(\"div\")[0].getAttribute(\"max\")) || 100) : editorParams.max,\r\n\tmin = typeof editorParams.min === \"undefined\" ? ((element.getElementsByTagName(\"div\")[0] && element.getElementsByTagName(\"div\")[0].getAttribute(\"min\")) || 0) : editorParams.min,\r\n\tpercent = (max - min) / 100,\r\n\tvalue = cell.getValue() || 0,\r\n\thandle = document.createElement(\"div\"),\r\n\tbar = document.createElement(\"div\"),\r\n\tmouseDrag, mouseDragWidth;\r\n\r\n\t//set new value\r\n\tfunction updateValue(){\r\n\t\tvar style = window.getComputedStyle(element, null);\r\n\r\n\t\tvar calcVal = (percent * Math.round(bar.offsetWidth / ((element.clientWidth - parseInt(style.getPropertyValue(\"padding-left\")) - parseInt(style.getPropertyValue(\"padding-right\")))/100))) + min;\r\n\t\tsuccess(calcVal);\r\n\t\telement.setAttribute(\"aria-valuenow\", calcVal);\r\n\t\telement.setAttribute(\"aria-label\", value);\r\n\t}\r\n\r\n\t//style handle\r\n\thandle.style.position = \"absolute\";\r\n\thandle.style.right = \"0\";\r\n\thandle.style.top = \"0\";\r\n\thandle.style.bottom = \"0\";\r\n\thandle.style.width = \"5px\";\r\n\thandle.classList.add(\"tabulator-progress-handle\");\r\n\r\n\t//style bar\r\n\tbar.style.display = \"inline-block\";\r\n\tbar.style.position = \"relative\";\r\n\t// bar.style.top = \"8px\";\r\n\t// bar.style.bottom = \"8px\";\r\n\t// bar.style.left = \"4px\";\r\n\t// bar.style.marginRight = \"4px\";\r\n\tbar.style.height = \"100%\";\r\n\tbar.style.backgroundColor = \"#488CE9\";\r\n\tbar.style.maxWidth = \"100%\";\r\n\tbar.style.minWidth = \"0%\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tbar.setAttribute(key, bar.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tbar.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//style cell\r\n\telement.style.padding = \"4px 4px\";\r\n\r\n\t//make sure value is in range\r\n\tvalue = Math.min(parseFloat(value), max);\r\n\tvalue = Math.max(parseFloat(value), min);\r\n\r\n\t//workout percentage\r\n\tvalue = Math.round((value - min) / percent);\r\n\t// bar.style.right = value + \"%\";\r\n\tbar.style.width = value + \"%\";\r\n\r\n\telement.setAttribute(\"aria-valuemin\", min);\r\n\telement.setAttribute(\"aria-valuemax\", max);\r\n\r\n\tbar.appendChild(handle);\r\n\r\n\thandle.addEventListener(\"mousedown\", function(e){\r\n\t\tmouseDrag = e.screenX;\r\n\t\tmouseDragWidth = bar.offsetWidth;\r\n\t});\r\n\r\n\thandle.addEventListener(\"mouseover\", function(){\r\n\t\thandle.style.cursor = \"ew-resize\";\r\n\t});\r\n\r\n\telement.addEventListener(\"mousemove\", function(e){\r\n\t\tif(mouseDrag){\r\n\t\t\tbar.style.width = (mouseDragWidth + e.screenX - mouseDrag) + \"px\";\r\n\t\t}\r\n\t});\r\n\r\n\telement.addEventListener(\"mouseup\", function(e){\r\n\t\tif(mouseDrag){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\r\n\t\t\tmouseDrag = false;\r\n\t\t\tmouseDragWidth = false;\r\n\r\n\t\t\tupdateValue();\r\n\t\t}\r\n\t});\r\n\r\n\t//allow key based navigation\r\n\telement.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 39: //right arrow\r\n\t\t\te.preventDefault();\r\n\t\t\tbar.style.width = (bar.clientWidth + element.clientWidth/100) + \"px\";\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 37: //left arrow\r\n\t\t\te.preventDefault();\r\n\t\t\tbar.style.width = (bar.clientWidth - element.clientWidth/100) + \"px\";\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 9: //tab\r\n\t\t\tcase 13: //enter\r\n\t\t\tupdateValue();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 27: //escape\r\n\t\t\tcancel();\r\n\t\t\tbreak;\r\n\r\n\t\t}\r\n\t});\r\n\r\n\telement.addEventListener(\"blur\", function(){\r\n\t\tcancel();\r\n\t});\r\n\r\n\treturn bar;\r\n};","//checkbox\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar value = cell.getValue(),\r\n\tinput = document.createElement(\"input\"),\r\n\ttristate = editorParams.tristate,\r\n\tindetermValue = typeof editorParams.indeterminateValue === \"undefined\" ? null : editorParams.indeterminateValue,\r\n\tindetermState = false,\r\n\ttrueValueSet = Object.keys(editorParams).includes(\"trueValue\"),\r\n\tfalseValueSet = Object.keys(editorParams).includes(\"falseValue\");\r\n\r\n\tinput.setAttribute(\"type\", \"checkbox\");\r\n\tinput.style.marginTop = \"5px\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = value;\r\n\r\n\tif(tristate && (typeof value === \"undefined\" || value === indetermValue || value === \"\")){\r\n\t\tindetermState = true;\r\n\t\tinput.indeterminate = true;\r\n\t}\r\n\r\n\tif(this.table.browser != \"firefox\"){ //prevent blur issue on mac firefox\r\n\t\tonRendered(function(){\r\n\t\t\tinput.focus({preventScroll: true});\r\n\t\t});\r\n\t}\r\n\r\n\tinput.checked = trueValueSet ? value === editorParams.trueValue : (value === true || value === \"true\" || value === \"True\" || value === 1);\r\n\r\n\tonRendered(function(){\r\n\t\tinput.focus();\r\n\t});\r\n\r\n\tfunction setValue(blur){\r\n\t\tvar checkedValue = input.checked;\r\n\r\n\t\tif(trueValueSet && checkedValue){\r\n\t\t\tcheckedValue = editorParams.trueValue;\r\n\t\t}else if(falseValueSet && !checkedValue){\r\n\t\t\tcheckedValue = editorParams.falseValue;\r\n\t\t}else{\r\n\t\t\tcheckedValue = checkedValue;\r\n\t\t}\r\n\r\n\t\tif(tristate){\r\n\t\t\tif(!blur){\r\n\t\t\t\tif(input.checked && !indetermState){\r\n\t\t\t\t\tinput.checked = false;\r\n\t\t\t\t\tinput.indeterminate = true;\r\n\t\t\t\t\tindetermState = true;\r\n\t\t\t\t\treturn indetermValue;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tindetermState = false;\r\n\t\t\t\t\treturn checkedValue;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(indetermState){\r\n\t\t\t\t\treturn indetermValue;\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn checkedValue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn checkedValue;\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur\r\n\tinput.addEventListener(\"change\", function(e){\r\n\t\tsuccess(setValue());\r\n\t});\r\n\r\n\tinput.addEventListener(\"blur\", function(e){\r\n\t\tsuccess(setValue(true));\r\n\t});\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tif(e.keyCode == 13){\r\n\t\t\tsuccess(setValue());\r\n\t\t}\r\n\t\tif(e.keyCode == 27){\r\n\t\t\tcancel();\r\n\t\t}\r\n\t});\r\n\r\n\treturn input;\r\n};","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defaultEditors from './defaults/editors.js';\r\n\r\nclass Edit extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.currentCell = false; //hold currently editing cell\r\n\t\tthis.mouseClick = false; //hold mousedown state to prevent click binding being overriden by editor opening\r\n\t\tthis.recursionBlock = false; //prevent focus recursion\r\n\t\tthis.invalidEdit = false;\r\n\t\tthis.editedCells = [];\r\n\r\n\t\tthis.editors = Edit.editors;\r\n\r\n\t\tthis.registerColumnOption(\"editable\");\r\n\t\tthis.registerColumnOption(\"editor\");\r\n\t\tthis.registerColumnOption(\"editorParams\");\r\n\r\n\t\tthis.registerColumnOption(\"cellEditing\");\r\n\t\tthis.registerColumnOption(\"cellEdited\");\r\n\t\tthis.registerColumnOption(\"cellEditCancelled\");\r\n\r\n\t\tthis.registerTableFunction(\"getEditedCells\", this.getEditedCells.bind(this));\r\n\t\tthis.registerTableFunction(\"clearCellEdited\", this.clearCellEdited.bind(this));\r\n\t\tthis.registerTableFunction(\"navigatePrev\", this.navigatePrev.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateNext\", this.navigateNext.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateLeft\", this.navigateLeft.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateRight\", this.navigateRight.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateUp\", this.navigateUp.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateDown\", this.navigateDown.bind(this));\r\n\r\n\t\tthis.registerComponentFunction(\"cell\", \"isEdited\", this.cellisEdited.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"clearEdited\", this.clearEdited.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"edit\", this.editCell.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"cancelEdit\", this.cellCancelEdit.bind(this));\r\n\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigatePrev\", this.navigatePrev.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateNext\", this.navigateNext.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateLeft\", this.navigateLeft.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateRight\", this.navigateRight.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateUp\", this.navigateUp.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateDown\", this.navigateDown.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-init\", this.bindEditor.bind(this));\r\n\t\tthis.subscribe(\"cell-delete\", this.clearEdited.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumnCheck.bind(this));\r\n\t\tthis.subscribe(\"column-delete\", this.columnDeleteCheck.bind(this));\r\n\t\tthis.subscribe(\"row-deleting\", this.rowDeleteCheck.bind(this));\r\n\t\tthis.subscribe(\"data-refreshing\", this.cancelEdit.bind(this));\r\n\r\n\t\tthis.subscribe(\"keybinding-nav-prev\", this.navigatePrev.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-next\", this.keybindingNavigateNext.bind(this));\r\n\t\tthis.subscribe(\"keybinding-nav-left\", this.navigateLeft.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-right\", this.navigateRight.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-up\", this.navigateUp.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-down\", this.navigateDown.bind(this, undefined));\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t////// Keybinding Functions ///////\r\n\t///////////////////////////////////\r\n\r\n\tkeybindingNavigateNext(e){\r\n\t\tvar cell = this.currentCell,\r\n\t\tnewRow = this.options(\"tabEndNewRow\");\r\n\r\n\t\tif(cell){\r\n\t\t\tif(!this.navigateNext(cell, e)){\r\n\t\t\t\tif(newRow){\r\n\t\t\t\t\tcell.getElement().firstChild.blur();\r\n\r\n\t\t\t\t\tif(newRow === true){\r\n\t\t\t\t\t\tnewRow = this.table.addRow({})\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(typeof newRow == \"function\"){\r\n\t\t\t\t\t\t\tnewRow = this.table.addRow(newRow(cell.row.getComponent()))\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnewRow = this.table.addRow(Object.assign({}, newRow));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tnewRow.then(() => {\r\n\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\tcell.getComponent().navigateNext();\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Cell Functions //////////\r\n\t///////////////////////////////////\r\n\r\n\tcellisEdited(cell){\r\n\t\treturn !! cell.modules.edit && cell.modules.edit.edited;\r\n\t}\r\n\r\n\tcellCancelEdit(cell){\r\n\t\tif(cell === this.currentCell){\r\n\t\t\tthis.table.modules.edit.cancelEdit();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cancel Editor Error - This cell is not currently being edited \");\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\tclearCellEdited(cells){\r\n\t\tif(!cells){\r\n\t\t\tcells = this.table.modules.edit.getEditedCells();\r\n\t\t}\r\n\r\n\t\tif(!Array.isArray(cells)){\r\n\t\t\tcells = [cells];\r\n\t\t}\r\n\r\n\t\tcells.forEach((cell) => {\r\n\t\t\tthis.table.modules.edit.clearEdited(cell._getSelf());\r\n\t\t});\r\n\t}\r\n\r\n\tnavigatePrev(cell = this.currentCell, e){\r\n\t\tvar nextCell, prevRow;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tnextCell = this.navigateLeft();\r\n\r\n\t\t\tif(nextCell){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tprevRow = this.table.rowManager.prevDisplayRow(cell.row, true);\r\n\r\n\t\t\t\tif(prevRow){\r\n\t\t\t\t\tnextCell = this.findNextEditableCell(prevRow, prevRow.cells.length);\r\n\r\n\t\t\t\t\tif(nextCell){\r\n\t\t\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tnavigateNext(cell = this.currentCell, e){\r\n\t\tvar nextCell, nextRow;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tnextCell = this.navigateRight();\r\n\r\n\t\t\tif(nextCell){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tnextRow = this.table.rowManager.nextDisplayRow(cell.row, true);\r\n\r\n\t\t\t\tif(nextRow){\r\n\t\t\t\t\tnextCell = this.findNextEditableCell(nextRow, -1);\r\n\r\n\t\t\t\t\tif(nextCell){\r\n\t\t\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tnavigateLeft(cell = this.currentCell, e){\r\n\t\tvar index, nextCell;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextCell = this.findPrevEditableCell(cell.row, index);\r\n\r\n\t\t\tif(nextCell){\r\n\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tnavigateRight(cell = this.currentCell, e){\r\n\t\tvar index, nextCell;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextCell = this.findNextEditableCell(cell.row, index);\r\n\r\n\t\t\tif(nextCell){\r\n\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tnavigateUp(cell = this.currentCell, e){\r\n\t\tvar index, nextRow;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextRow = this.table.rowManager.prevDisplayRow(cell.row, true);\r\n\r\n\t\t\tif(nextRow){\r\n\t\t\t\tnextRow.cells[index].getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tnavigateDown(cell = this.currentCell, e){\r\n\t\tvar index, nextRow;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextRow = this.table.rowManager.nextDisplayRow(cell.row, true);\r\n\r\n\t\t\tif(nextRow){\r\n\t\t\t\tnextRow.cells[index].getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfindNextEditableCell(row, index){\r\n\t\tvar nextCell = false;\r\n\r\n\t\tif(index < row.cells.length-1){\r\n\t\t\tfor(var i = index+1; i < row.cells.length; i++){\r\n\t\t\t\tlet cell = row.cells[i];\r\n\r\n\t\t\t\tif(cell.column.modules.edit && Helpers.elVisible(cell.getElement())){\r\n\t\t\t\t\tlet allowEdit = true;\r\n\r\n\t\t\t\t\tif(typeof cell.column.modules.edit.check == \"function\"){\r\n\t\t\t\t\t\tallowEdit = cell.column.modules.edit.check(cell.getComponent());\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(allowEdit){\r\n\t\t\t\t\t\tnextCell = cell;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn nextCell;\r\n\t}\r\n\r\n\tfindPrevEditableCell(row, index){\r\n\t\tvar prevCell = false;\r\n\r\n\t\tif(index > 0){\r\n\t\t\tfor(var i = index-1; i >= 0; i--){\r\n\t\t\t\tlet cell = row.cells[i],\r\n\t\t\t\tallowEdit = true;\r\n\r\n\t\t\t\tif(cell.column.modules.edit && Helpers.elVisible(cell.getElement())){\r\n\t\t\t\t\tif(typeof cell.column.modules.edit.check == \"function\"){\r\n\t\t\t\t\t\tallowEdit = cell.column.modules.edit.check(cell.getComponent());\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(allowEdit){\r\n\t\t\t\t\t\tprevCell = cell;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn prevCell;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tinitializeColumnCheck(column){\r\n\t\tif(typeof column.definition.editor !== \"undefined\"){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\r\n\tcolumnDeleteCheck(column){\r\n\t\tif(this.currentCell && this.currentCell.column === column){\r\n\t\t\tthis.cancelEdit();\r\n\t\t}\r\n\t}\r\n\r\n\trowDeleteCheck(row){\r\n\t\tif(this.currentCell && this.currentCell.row === row){\r\n\t\t\tthis.cancelEdit();\r\n\t\t}\r\n\t}\r\n\r\n\t//initialize column editor\r\n\tinitializeColumn(column){\r\n\t\tvar self = this,\r\n\t\tconfig = {\r\n\t\t\teditor:false,\r\n\t\t\tblocked:false,\r\n\t\t\tcheck:column.definition.editable,\r\n\t\t\tparams:column.definition.editorParams || {}\r\n\t\t};\r\n\r\n\t\t//set column editor\r\n\t\tswitch(typeof column.definition.editor){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(this.editors[column.definition.editor]){\r\n\t\t\t\tconfig.editor = this.editors[column.definition.editor];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Editor Error - No such editor found: \", column.definition.editor);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tconfig.editor = column.definition.editor;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"boolean\":\r\n\t\t\tif(column.definition.editor === true){\r\n\t\t\t\tif(typeof column.definition.formatter !== \"function\"){\r\n\t\t\t\t\tif(this.editors[column.definition.formatter]){\r\n\t\t\t\t\t\tconfig.editor = this.editors[column.definition.formatter];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconfig.editor = this.editors[\"input\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Editor Error - Cannot auto lookup editor for a custom formatter: \", column.definition.formatter);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(config.editor){\r\n\t\t\tcolumn.modules.edit = config;\r\n\t\t}\r\n\t}\r\n\r\n\tgetCurrentCell(){\r\n\t\treturn this.currentCell ? this.currentCell.getComponent() : false;\r\n\t}\r\n\r\n\tclearEditor(cancel){\r\n\t\tvar cell = this.currentCell,\r\n\t\tcellEl;\r\n\r\n\t\tthis.invalidEdit = false;\r\n\r\n\t\tif(cell){\r\n\t\t\tthis.currentCell = false;\r\n\r\n\t\t\tcellEl = cell.getElement();\r\n\r\n\t\t\tthis.dispatch(\"edit-editor-clear\", cell, cancel);\r\n\r\n\t\t\tcellEl.classList.remove(\"tabulator-editing\");\r\n\r\n\t\t\twhile(cellEl.firstChild) cellEl.removeChild(cellEl.firstChild);\r\n\r\n\t\t\tcell.row.getElement().classList.remove(\"tabulator-row-editing\");\r\n\t\t}\r\n\t}\r\n\r\n\tcancelEdit(){\r\n\t\tif(this.currentCell){\r\n\t\t\tvar cell = this.currentCell;\r\n\t\t\tvar component = this.currentCell.getComponent();\r\n\r\n\t\t\tthis.clearEditor(true);\r\n\t\t\tcell.setValueActual(cell.getValue());\r\n\t\t\tcell.cellRendered();\r\n\r\n\t\t\tif(cell.column.definition.editor == \"textarea\" || cell.column.definition.variableHeight){\r\n\t\t\t\tcell.row.normalizeHeight(true);\r\n\t\t\t}\r\n\r\n\t\t\tif(cell.column.definition.cellEditCancelled){\r\n\t\t\t\tcell.column.definition.cellEditCancelled.call(this.table, component);\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatch(\"edit-cancelled\", cell);\r\n\t\t\tthis.dispatchExternal(\"cellEditCancelled\", component);\r\n\t\t}\r\n\t}\r\n\r\n\t//return a formatted value for a cell\r\n\tbindEditor(cell){\r\n\t\tif(cell.column.modules.edit){\r\n\t\t\tvar self = this,\r\n\t\t\telement = cell.getElement(true);\r\n\r\n\t\t\telement.setAttribute(\"tabindex\", 0);\r\n\r\n\t\t\telement.addEventListener(\"click\", function(e){\r\n\t\t\t\tif(!element.classList.contains(\"tabulator-editing\")){\r\n\t\t\t\t\telement.focus({preventScroll: true});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\telement.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif (e.button === 2) {\r\n\t\t\t\t\te.preventDefault();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself.mouseClick = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\telement.addEventListener(\"focus\", function(e){\r\n\t\t\t\tif(!self.recursionBlock){\r\n\t\t\t\t\tself.edit(cell, e, false);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tfocusCellNoEvent(cell, block){\r\n\t\tthis.recursionBlock = true;\r\n\r\n\t\tif(!(block && this.table.browser === \"ie\")){\r\n\t\t\tcell.getElement().focus({preventScroll: true});\r\n\t\t}\r\n\r\n\t\tthis.recursionBlock = false;\r\n\t}\r\n\r\n\teditCell(cell, forceEdit){\r\n\t\tthis.focusCellNoEvent(cell);\r\n\t\tthis.edit(cell, false, forceEdit);\r\n\t}\r\n\r\n\tfocusScrollAdjust(cell){\r\n\t\tif(this.table.rowManager.getRenderMode() == \"virtual\"){\r\n\t\t\tvar topEdge = this.table.rowManager.element.scrollTop,\r\n\t\t\tbottomEdge = this.table.rowManager.element.clientHeight + this.table.rowManager.element.scrollTop,\r\n\t\t\trowEl = cell.row.getElement(),\r\n\t\t\toffset = rowEl.offsetTop;\r\n\r\n\t\t\tif(rowEl.offsetTop < topEdge){\r\n\t\t\t\tthis.table.rowManager.element.scrollTop -= (topEdge - rowEl.offsetTop);\r\n\t\t\t}else{\r\n\t\t\t\tif(rowEl.offsetTop + rowEl.offsetHeight > bottomEdge){\r\n\t\t\t\t\tthis.table.rowManager.element.scrollTop += (rowEl.offsetTop + rowEl.offsetHeight - bottomEdge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar leftEdge = this.table.rowManager.element.scrollLeft,\r\n\t\t\trightEdge = this.table.rowManager.element.clientWidth + this.table.rowManager.element.scrollLeft,\r\n\t\t\tcellEl = cell.getElement(),\r\n\t\t\toffset = cellEl.offsetLeft;\r\n\r\n\t\t\tif(this.table.modExists(\"frozenColumns\")){\r\n\t\t\t\tleftEdge += parseInt(this.table.modules.frozenColumns.leftMargin);\r\n\t\t\t\trightEdge -= parseInt(this.table.modules.frozenColumns.rightMargin);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.options.renderHorizontal === \"virtual\"){\r\n\t\t\t\tleftEdge -= parseInt(this.table.columnManager.renderer.vDomPadLeft);\r\n\t\t\t\trightEdge -= parseInt(this.table.columnManager.renderer.vDomPadLeft);\r\n\t\t\t}\r\n\r\n\t\t\tif(cellEl.offsetLeft < leftEdge){\r\n\r\n\t\t\t\tthis.table.rowManager.element.scrollLeft -= (leftEdge - cellEl.offsetLeft);\r\n\t\t\t}else{\r\n\t\t\t\tif(cellEl.offsetLeft + cellEl.offsetWidth > rightEdge){\r\n\t\t\t\t\tthis.table.rowManager.element.scrollLeft += (cellEl.offsetLeft + cellEl.offsetWidth - rightEdge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tedit(cell, e, forceEdit){\r\n\t\tvar self = this,\r\n\t\tallowEdit = true,\r\n\t\trendered = function(){},\r\n\t\telement = cell.getElement(),\r\n\t\tcellEditor, component, params;\r\n\r\n\t\t//prevent editing if another cell is refusing to leave focus (eg. validation fail)\r\n\t\tif(this.currentCell){\r\n\t\t\tif(!this.invalidEdit){\r\n\t\t\t\tthis.cancelEdit();\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//handle successful value change\r\n\t\tfunction success(value){\r\n\t\t\tif(self.currentCell === cell){\r\n\t\t\t\tvar valid = self.chain(\"edit-success\", [cell, value], true, true);\r\n\r\n\t\t\t\tif(valid === true || self.table.options.validationMode === \"highlight\"){\r\n\t\t\t\t\tself.clearEditor();\r\n\r\n\r\n\t\t\t\t\tif(!cell.modules.edit){\r\n\t\t\t\t\t\tcell.modules.edit = {};\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tcell.modules.edit.edited = true;\r\n\r\n\t\t\t\t\tif(self.editedCells.indexOf(cell) == -1){\r\n\t\t\t\t\t\tself.editedCells.push(cell);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tcell.setValue(value, true);\r\n\r\n\t\t\t\t\treturn valid === true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself.invalidEdit = true;\r\n\t\t\t\t\tself.focusCellNoEvent(cell, true);\r\n\t\t\t\t\trendered();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t// console.warn(\"Edit Success Error - cannot call success on a cell that is no longer being edited\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//handle aborted edit\r\n\t\tfunction cancel(){\r\n\t\t\tif(self.currentCell === cell){\r\n\t\t\t\tself.cancelEdit();\r\n\t\t\t}else{\r\n\t\t\t\t// console.warn(\"Edit Success Error - cannot call cancel on a cell that is no longer being edited\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\trendered = callback;\r\n\t\t}\r\n\r\n\t\tif(!cell.column.modules.edit.blocked){\r\n\t\t\tif(e){\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t}\r\n\r\n\t\t\tswitch(typeof cell.column.modules.edit.check){\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tallowEdit = cell.column.modules.edit.check(cell.getComponent());\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\tallowEdit = cell.column.modules.edit.check;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(allowEdit || forceEdit){\r\n\r\n\t\t\t\tself.cancelEdit();\r\n\r\n\t\t\t\tself.currentCell = cell;\r\n\r\n\t\t\t\tthis.focusScrollAdjust(cell);\r\n\r\n\t\t\t\tcomponent = cell.getComponent();\r\n\r\n\t\t\t\tif(this.mouseClick){\r\n\t\t\t\t\tthis.mouseClick = false;\r\n\r\n\t\t\t\t\tif(cell.column.definition.cellClick){\r\n\t\t\t\t\t\tcell.column.definition.cellClick.call(this.table, e, component);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(cell.column.definition.cellEditing){\r\n\t\t\t\t\tcell.column.definition.cellEditing.call(this.table, component);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.dispatch(\"cell-editing\", cell);\r\n\t\t\t\tthis.dispatchExternal(\"cellEditing\", component);\r\n\r\n\t\t\t\tparams = typeof cell.column.modules.edit.params === \"function\" ? cell.column.modules.edit.params(component) : cell.column.modules.edit.params;\r\n\r\n\t\t\t\tcellEditor = cell.column.modules.edit.editor.call(self, component, onRendered, success, cancel, params);\r\n\r\n\t\t\t\t//if editor returned, add to DOM, if false, abort edit\r\n\t\t\t\tif(cellEditor !== false){\r\n\r\n\t\t\t\t\tif(cellEditor instanceof Node){\r\n\t\t\t\t\t\telement.classList.add(\"tabulator-editing\");\r\n\t\t\t\t\t\tcell.row.getElement().classList.add(\"tabulator-row-editing\");\r\n\t\t\t\t\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\t\t\t\t\telement.appendChild(cellEditor);\r\n\r\n\t\t\t\t\t\t//trigger onRendered Callback\r\n\t\t\t\t\t\trendered();\r\n\r\n\t\t\t\t\t\t//prevent editing from triggering rowClick event\r\n\t\t\t\t\t\tvar children = element.children;\r\n\r\n\t\t\t\t\t\tfor (var i = 0; i < children.length; i++) {\r\n\t\t\t\t\t\t\tchildren[i].addEventListener(\"click\", function(e){\r\n\t\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Edit Error - Editor should return an instance of Node, the editor returned:\", cellEditor);\r\n\t\t\t\t\t\telement.blur();\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.blur();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tthis.mouseClick = false;\r\n\t\t\t\telement.blur();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.mouseClick = false;\r\n\t\t\telement.blur();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tgetEditedCells(){\r\n\t\tvar output = [];\r\n\r\n\t\tthis.editedCells.forEach((cell) => {\r\n\t\t\toutput.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tclearEdited(cell){\r\n\t\tvar editIndex;\r\n\r\n\t\tif(cell.modules.edit && cell.modules.edit.edited){\r\n\t\t\tcell.modules.edit.edited = false;\r\n\r\n\t\t\tthis.dispatch(\"edit-edited-clear\", cell);\r\n\t\t}\r\n\r\n\t\teditIndex = this.editedCells.indexOf(cell);\r\n\r\n\t\tif(editIndex > -1){\r\n\t\t\tthis.editedCells.splice(editIndex, 1);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nEdit.moduleName = \"edit\";\r\n\r\n//load defaults\r\nEdit.editors = defaultEditors;\r\n\r\n\r\nexport default Edit;\r\n","class ExportRow{\r\n\tconstructor(type, columns, component, indent){\r\n\t\tthis.type = type;\r\n\t\tthis.columns = columns;\r\n\t\tthis.component = component || false;\r\n\t\tthis.indent = indent || 0;\r\n\t}\r\n}\r\n\r\nexport default ExportRow;","class ExportColumn{\r\n\tconstructor(value, component, width, height, depth){\r\n\t\tthis.value = value;\r\n\t\tthis.component = component || false;\r\n\t\tthis.width = width;\r\n\t\tthis.height = height;\r\n\t\tthis.depth = depth;\r\n\t}\r\n}\r\n\r\nexport default ExportColumn;","import Module from '../../core/Module.js';\r\n\r\nimport ExportRow from './ExportRow.js';\r\nimport ExportColumn from './ExportColumn.js';\r\n\r\nclass Export extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.config = {};\r\n\t\tthis.cloneTableStyle = true;\r\n\t\tthis.colVisProp = \"\";\r\n\r\n\t\tthis.registerTableOption(\"htmlOutputConfig\", false); //html outypu config\r\n\r\n\t\tthis.registerColumnOption(\"htmlOutput\");\r\n\t\tthis.registerColumnOption(\"titleHtmlOutput\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"getHtml\", this.getHtml.bind(this));\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tgenerateExportList(config, style, range, colVisProp){\r\n\t\tthis.cloneTableStyle = style;\r\n\t\tthis.config = config || {};\r\n\t\tthis.colVisProp = colVisProp;\r\n\r\n\t\tvar headers = this.config.columnHeaders !== false ? this.headersToExportRows(this.generateColumnGroupHeaders()) : [];\r\n\t\tvar body = this.bodyToExportRows(this.rowLookup(range));\r\n\r\n\t\treturn headers.concat(body);\r\n\t}\r\n\r\n\tgenereateTable(config, style, range, colVisProp){\r\n\t\tvar list = this.generateExportList(config, style, range, colVisProp);\r\n\r\n\t\treturn this.genereateTableElement(list);\r\n\t}\r\n\r\n\trowLookup(range){\r\n\t\tvar rows = [];\r\n\r\n\t\tif(typeof range == \"function\"){\r\n\t\t\trange.call(this.table).forEach((row) =>{\r\n\t\t\t\trow = this.table.rowManager.findRow(row);\r\n\r\n\t\t\t\tif(row){\r\n\t\t\t\t\trows.push(row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tswitch(range){\r\n\t\t\t\tcase true:\r\n\t\t\t\tcase \"visible\":\r\n\t\t\t\trows = this.table.rowManager.getVisibleRows(false, true);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"all\":\r\n\t\t\t\trows = this.table.rowManager.rows;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"selected\":\r\n\t\t\t\trows = this.table.modules.selectRow.selectedRows;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"active\":\r\n\t\t\t\tdefault:\r\n\t\t\t\tif(this.table.options.pagination){\r\n\t\t\t\t\trows = this.table.rowManager.getDisplayRows(this.table.rowManager.displayRows.length - 2);\r\n\t\t\t\t}else{\r\n\t\t\t\t\trows = this.table.rowManager.getDisplayRows();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Object.assign([], rows);\r\n\t}\r\n\r\n\tgenerateColumnGroupHeaders(){\r\n\t\tvar output = [];\r\n\r\n\t\tvar columns = this.config.columnGroups !== false ? this.table.columnManager.columns : this.table.columnManager.columnsByIndex;\r\n\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\tvar colData = this.processColumnGroup(column);\r\n\r\n\t\t\tif(colData){\r\n\t\t\t\toutput.push(colData);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tprocessColumnGroup(column){\r\n\t\tvar subGroups = column.columns,\r\n\t\tmaxDepth = 0,\r\n\t\ttitle = column.definition[\"title\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))] || column.definition.title;\r\n\r\n\t\tvar groupData = {\r\n\t\t\ttitle:title,\r\n\t\t\tcolumn:column,\r\n\t\t\tdepth:1,\r\n\t\t};\r\n\r\n\t\tif(subGroups.length){\r\n\t\t\tgroupData.subGroups = [];\r\n\t\t\tgroupData.width = 0;\r\n\r\n\t\t\tsubGroups.forEach((subGroup) => {\r\n\t\t\t\tvar subGroupData = this.processColumnGroup(subGroup);\r\n\r\n\t\t\t\tif(subGroupData){\r\n\t\t\t\t\tgroupData.width += subGroupData.width;\r\n\t\t\t\t\tgroupData.subGroups.push(subGroupData);\r\n\r\n\t\t\t\t\tif(subGroupData.depth > maxDepth){\r\n\t\t\t\t\t\tmaxDepth = subGroupData.depth;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tgroupData.depth += maxDepth;\r\n\r\n\t\t\tif(!groupData.width){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.columnVisCheck(column)){\r\n\t\t\t\tgroupData.width = 1;\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn groupData;\r\n\t}\r\n\r\n\tcolumnVisCheck(column){\r\n\t\treturn column.definition[this.colVisProp] !== false && (column.visible || (!column.visible && column.definition[this.colVisProp]));\r\n\t}\r\n\r\n\theadersToExportRows(columns){\r\n\t\tvar headers = [],\r\n\t\theaderDepth = 0,\r\n\t\texportRows = [];\r\n\r\n\t\tfunction parseColumnGroup(column, level){\r\n\r\n\t\t\tvar depth = headerDepth - level;\r\n\r\n\t\t\tif(typeof headers[level] === \"undefined\"){\r\n\t\t\t\theaders[level] = [];\r\n\t\t\t}\r\n\r\n\t\t\tcolumn.height = column.subGroups ? 1 : (depth - column.depth) + 1;\r\n\r\n\t\t\theaders[level].push(column);\r\n\r\n\t\t\tif(column.height > 1){\r\n\t\t\t\tfor(let i = 1; i < column.height; i ++){\r\n\r\n\t\t\t\t\tif(typeof headers[level + i] === \"undefined\"){\r\n\t\t\t\t\t\theaders[level + i] = [];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\theaders[level + i].push(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(column.width > 1){\r\n\t\t\t\tfor(let i = 1; i < column.width; i ++){\r\n\t\t\t\t\theaders[level].push(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(column.subGroups){\r\n\t\t\t\tcolumn.subGroups.forEach(function(subGroup){\r\n\t\t\t\t\tparseColumnGroup(subGroup, level+1);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//calculate maximum header debth\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tif(column.depth > headerDepth){\r\n\t\t\t\theaderDepth = column.depth;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tparseColumnGroup(column,0);\r\n\t\t});\r\n\r\n\t\theaders.forEach((header) => {\r\n\t\t\tvar columns = [];\r\n\r\n\t\t\theader.forEach((col) => {\r\n\t\t\t\tif(col){\r\n\t\t\t\t\tlet title = typeof col.title === \"undefined\" ? \"\" : col.title;\r\n\t\t\t\t\tcolumns.push(new ExportColumn(title, col.column.getComponent(), col.width, col.height, col.depth));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolumns.push(null);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\texportRows.push(new ExportRow(\"header\", columns));\r\n\t\t});\r\n\r\n\t\treturn exportRows;\r\n\t}\r\n\r\n\tbodyToExportRows(rows){\r\n\r\n\t\tvar columns = [];\r\n\t\tvar exportRows = [];\r\n\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tif (this.columnVisCheck(column)) {\r\n\t\t\t\tcolumns.push(column.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(this.config.columnCalcs !== false && this.table.modExists(\"columnCalcs\")){\r\n\t\t\tif(this.table.modules.columnCalcs.topInitialized){\r\n\t\t\t\trows.unshift(this.table.modules.columnCalcs.topRow);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modules.columnCalcs.botInitialized){\r\n\t\t\t\trows.push(this.table.modules.columnCalcs.botRow);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\trows = rows.filter((row) => {\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\treturn this.config.rowGroups !== false;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"calc\":\r\n\t\t\t\treturn this.config.columnCalcs !== false;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"row\":\r\n\t\t\t\treturn !(this.table.options.dataTree && this.config.dataTree === false && row.modules.dataTree.parent);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\trows.forEach((row, i) => {\r\n\t\t\tvar rowData = row.getData(this.colVisProp);\r\n\t\t\tvar exportCols = [];\r\n\t\t\tvar indent = 0;\r\n\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\tindent = row.level;\r\n\t\t\t\texportCols.push(new ExportColumn(row.key, row.getComponent(), columns.length, 1));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"calc\" :\r\n\t\t\t\tcase \"row\" :\r\n\t\t\t\tcolumns.forEach((col) => {\r\n\t\t\t\t\texportCols.push(new ExportColumn(col._column.getFieldValue(rowData), col, 1, 1));\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(this.table.options.dataTree && this.config.dataTree !== false){\r\n\t\t\t\t\tindent = row.modules.dataTree.index;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\texportRows.push(new ExportRow(row.type, exportCols, row.getComponent(), indent));\r\n\t\t});\r\n\r\n\t\treturn exportRows;\r\n\t}\r\n\r\n\tgenereateTableElement(list){\r\n\t\tvar table = document.createElement(\"table\"),\r\n\t\theaderEl = document.createElement(\"thead\"),\r\n\t\tbodyEl = document.createElement(\"tbody\"),\r\n\t\tstyles = this.lookupTableStyles(),\r\n\t\trowFormatter = this.table.options[\"rowFormatter\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))],\r\n\t\tsetup = {};\r\n\r\n\t\tsetup.rowFormatter = rowFormatter !== null ? rowFormatter : this.table.options.rowFormatter;\r\n\r\n\t\tif(this.table.options.dataTree &&this.config.dataTree !== false && this.table.modExists(\"columnCalcs\")){\r\n\t\t\tsetup.treeElementField = this.table.modules.dataTree.elementField;\r\n\t\t}\r\n\r\n\t\t//assign group header formatter\r\n\t\tsetup.groupHeader = this.table.options[\"groupHeader\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))];\r\n\r\n\t\tif(setup.groupHeader && !Array.isArray(setup.groupHeader)){\r\n\t\t\tsetup.groupHeader = [setup.groupHeader];\r\n\t\t}\r\n\r\n\t\ttable.classList.add(\"tabulator-print-table\");\r\n\r\n\t\tthis.mapElementStyles(this.table.columnManager.getHeadersElement(), headerEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"background-color\", \"color\", \"font-weight\", \"font-family\", \"font-size\"]);\r\n\r\n\r\n\t\tif(list.length > 1000){\r\n\t\t\tconsole.warn(\"It may take a long time to render an HTML table with more than 1000 rows\");\r\n\t\t}\r\n\r\n\t\tlist.forEach((row, i) => {\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"header\":\r\n\t\t\t\theaderEl.appendChild(this.genereateHeaderElement(row, setup, styles));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\tbodyEl.appendChild(this.genereateGroupElement(row, setup, styles));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"calc\":\r\n\t\t\t\tbodyEl.appendChild(this.genereateCalcElement(row, setup, styles));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"row\":\r\n\t\t\t\tlet rowEl = this.genereateRowElement(row, setup, styles);\r\n\t\t\t\tthis.mapElementStyles(((i % 2) && styles.evenRow) ? styles.evenRow : styles.oddRow, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\t\t\t\tbodyEl.appendChild(rowEl);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(headerEl.innerHTML){\r\n\t\t\ttable.appendChild(headerEl);\r\n\t\t}\r\n\r\n\t\ttable.appendChild(bodyEl);\r\n\r\n\r\n\t\tthis.mapElementStyles(this.table.element, table, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\"]);\r\n\t\treturn table;\r\n\t}\r\n\r\n\tlookupTableStyles(){\r\n\t\tvar styles = {};\r\n\r\n\t\t//lookup row styles\r\n\t\tif(this.cloneTableStyle && window.getComputedStyle){\r\n\t\t\tstyles.oddRow = this.table.element.querySelector(\".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.evenRow = this.table.element.querySelector(\".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.calcRow = this.table.element.querySelector(\".tabulator-row.tabulator-calcs\");\r\n\t\t\tstyles.firstRow = this.table.element.querySelector(\".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.firstGroup = this.table.element.getElementsByClassName(\"tabulator-group\")[0];\r\n\r\n\t\t\tif(styles.firstRow){\r\n\t\t\t\tstyles.styleCells = styles.firstRow.getElementsByClassName(\"tabulator-cell\");\r\n\t\t\t\tstyles.firstCell = styles.styleCells[0];\r\n\t\t\t\tstyles.lastCell = styles.styleCells[styles.styleCells.length - 1];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn styles;\r\n\t}\r\n\r\n\tgenereateHeaderElement(row, setup, styles){\r\n\t\tvar rowEl = document.createElement(\"tr\");\r\n\r\n\t\trow.columns.forEach((column) => {\r\n\t\t\tif(column){\r\n\t\t\t\tvar cellEl = document.createElement(\"th\");\r\n\t\t\t\tvar classNames = column.component._column.definition.cssClass ? column.component._column.definition.cssClass.split(\" \") : [];\r\n\r\n\t\t\t\tcellEl.colSpan = column.width;\r\n\t\t\t\tcellEl.rowSpan = column.height;\r\n\r\n\t\t\t\tcellEl.innerHTML = column.value;\r\n\r\n\t\t\t\tif(this.cloneTableStyle){\r\n\t\t\t\t\tcellEl.style.boxSizing = \"border-box\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\tclassNames.forEach(function(className) {\r\n\t\t\t\t\tcellEl.classList.add(className);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.mapElementStyles(column.component.getElement(), cellEl, [\"text-align\", \"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"background-color\", \"color\", \"font-weight\", \"font-family\", \"font-size\"]);\r\n\t\t\t\tthis.mapElementStyles(column.component._column.contentElement, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\"]);\r\n\r\n\t\t\t\tif(column.component._column.visible){\r\n\t\t\t\t\tthis.mapElementStyles(column.component.getElement(), cellEl, [\"width\"]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(column.component._column.definition.width){\r\n\t\t\t\t\t\tcellEl.style.width = column.component._column.definition.width + \"px\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(column.component._column.parent){\r\n\t\t\t\t\tthis.mapElementStyles(column.component._column.parent.groupElement, cellEl, [\"border-top\"]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowEl.appendChild(cellEl);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenereateGroupElement(row, setup, styles){\r\n\r\n\t\tvar rowEl = document.createElement(\"tr\"),\r\n\t\tcellEl = document.createElement(\"td\"),\r\n\t\tgroup = row.columns[0];\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-row\");\r\n\r\n\t\tif(setup.groupHeader && setup.groupHeader[row.indent]){\r\n\t\t\tgroup.value = setup.groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t}else{\r\n\t\t\tif(setup.groupHeader === false){\r\n\t\t\t\tgroup.value = group.value;\r\n\t\t\t}else{\r\n\t\t\t\tgroup.value = row.component._group.generator(group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcellEl.colSpan = group.width;\r\n\t\tcellEl.innerHTML = group.value;\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-group\");\r\n\t\trowEl.classList.add(\"tabulator-group-level-\" + row.indent);\r\n\r\n\t\tif(group.component.isVisible()){\r\n\t\t\trowEl.classList.add(\"tabulator-group-visible\");\r\n\t\t}\r\n\r\n\t\tthis.mapElementStyles(styles.firstGroup, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\t\tthis.mapElementStyles(styles.firstGroup, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\"]);\r\n\r\n\t\trowEl.appendChild(cellEl);\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenereateCalcElement(row, setup, styles){\r\n\t\tvar rowEl = this.genereateRowElement(row, setup, styles);\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-calcs\");\r\n\t\tthis.mapElementStyles(styles.calcRow, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenereateRowElement(row, setup, styles){\r\n\t\tvar rowEl = document.createElement(\"tr\");\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-row\");\r\n\r\n\t\trow.columns.forEach((col) => {\r\n\t\t\tif(col){\r\n\t\t\t\tvar cellEl = document.createElement(\"td\"),\r\n\t\t\t\tcolumn = col.component._column,\r\n\t\t\t\tindex = this.table.columnManager.findColumnIndex(column),\r\n\t\t\t\tvalue = col.value;\r\n\r\n\t\t\t\tvar cellWrapper = {\r\n\t\t\t\t\tmodules:{},\r\n\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetField:function(){\r\n\t\t\t\t\t\treturn column.definition.field;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\treturn cellEl;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetData:function(){\r\n\t\t\t\t\t\treturn row.component.getData();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\treturn row.component;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetComponent:function(){\r\n\t\t\t\t\t\treturn cellWrapper;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tcolumn:column,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tvar classNames = column.definition.cssClass ? column.definition.cssClass.split(\" \") : [];\r\n\r\n\t\t\t\tclassNames.forEach(function(className) {\r\n\t\t\t\t\tcellEl.classList.add(className);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(this.table.modExists(\"format\") && this.config.formatCells !== false){\r\n\t\t\t\t\tvalue = this.table.modules.format.formatExportValue(cellWrapper, this.colVisProp);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\tvalue = value !== null ? JSON.stringify(value) : \"\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tvalue = value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(value instanceof Node){\r\n\t\t\t\t\tcellEl.appendChild(value);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcellEl.innerHTML = value;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(styles.styleCells[index] || styles.firstCell){\r\n\t\t\t\t\tthis.mapElementStyles(styles.styleCells[index] || styles.firstCell, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\", \"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"text-align\"]);\r\n\r\n\t\t\t\t\tif(column.definition.align){\r\n\t\t\t\t\t\tcellEl.style.textAlign = column.definition.align;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(this.table.options.dataTree && this.config.dataTree !== false){\r\n\t\t\t\t\tif((setup.treeElementField && setup.treeElementField == column.field) || (!setup.treeElementField && i == 0)){\r\n\t\t\t\t\t\tif(row.component._row.modules.dataTree.controlEl){\r\n\t\t\t\t\t\t\tcellEl.insertBefore(row.component._row.modules.dataTree.controlEl.cloneNode(true), cellEl.firstChild);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(row.component._row.modules.dataTree.branchEl){\r\n\t\t\t\t\t\t\tcellEl.insertBefore(row.component._row.modules.dataTree.branchEl.cloneNode(true), cellEl.firstChild);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowEl.appendChild(cellEl);\r\n\r\n\t\t\t\tif(cellWrapper.modules.format && cellWrapper.modules.format.renderedCallback){\r\n\t\t\t\t\tcellWrapper.modules.format.renderedCallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(setup.rowFormatter && this.config.formatCells !== false){\r\n\t\t\t\t\tsetup.rowFormatter(row.component);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenereateHTMLTable(list){\r\n\t\tvar holder = document.createElement(\"div\");\r\n\r\n\t\tholder.appendChild(this.genereateTableElement(list));\r\n\r\n\t\treturn holder.innerHTML;\r\n\t}\r\n\r\n\tgetHtml(visible, style, config, colVisProp){\r\n\t\tvar list = this.generateExportList(config || this.table.options.htmlOutputConfig, style, visible, colVisProp || \"htmlOutput\");\r\n\r\n\t\treturn this.genereateHTMLTable(list);\r\n\t}\r\n\r\n\tmapElementStyles(from, to, props){\r\n\t\tif(this.cloneTableStyle && from && to){\r\n\r\n\t\t\tvar lookup = {\r\n\t\t\t\t\"background-color\" : \"backgroundColor\",\r\n\t\t\t\t\"color\" : \"fontColor\",\r\n\t\t\t\t\"width\" : \"width\",\r\n\t\t\t\t\"font-weight\" : \"fontWeight\",\r\n\t\t\t\t\"font-family\" : \"fontFamily\",\r\n\t\t\t\t\"font-size\" : \"fontSize\",\r\n\t\t\t\t\"text-align\" : \"textAlign\",\r\n\t\t\t\t\"border-top\" : \"borderTop\",\r\n\t\t\t\t\"border-left\" : \"borderLeft\",\r\n\t\t\t\t\"border-right\" : \"borderRight\",\r\n\t\t\t\t\"border-bottom\" : \"borderBottom\",\r\n\t\t\t\t\"padding-top\" : \"paddingTop\",\r\n\t\t\t\t\"padding-left\" : \"paddingLeft\",\r\n\t\t\t\t\"padding-right\" : \"paddingRight\",\r\n\t\t\t\t\"padding-bottom\" : \"paddingBottom\",\r\n\t\t\t};\r\n\r\n\t\t\tif(window.getComputedStyle){\r\n\t\t\t\tvar fromStyle = window.getComputedStyle(from);\r\n\r\n\t\t\t\tprops.forEach(function(prop){\r\n\t\t\t\t\tto.style[lookup[prop]] = fromStyle.getPropertyValue(prop);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nExport.moduleName = \"export\";\r\n\r\nexport default Export;\r\n","export default {\r\n\r\n\t//equal to\r\n\t\"=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal == filterVal ? true : false;\r\n\t},\r\n\r\n\t//less than\r\n\t\"<\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal < filterVal ? true : false;\r\n\t},\r\n\r\n\t//less than or equal to\r\n\t\"<=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal <= filterVal ? true : false;\r\n\t},\r\n\r\n\t//greater than\r\n\t\">\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal > filterVal ? true : false;\r\n\t},\r\n\r\n\t//greater than or equal to\r\n\t\">=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal >= filterVal ? true : false;\r\n\t},\r\n\r\n\t//not equal to\r\n\t\"!=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal != filterVal ? true : false;\r\n\t},\r\n\r\n\t\"regex\":function(filterVal, rowVal, rowData, filterParams){\r\n\r\n\t\tif(typeof filterVal == \"string\"){\r\n\t\t\tfilterVal = new RegExp(filterVal);\r\n\t\t}\r\n\r\n\t\treturn filterVal.test(rowVal);\r\n\t},\r\n\r\n\t//contains the string\r\n\t\"like\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().indexOf(filterVal.toLowerCase()) > -1;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//contains the keywords\r\n\t\"keywords\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tvar keywords = filterVal.toLowerCase().split(typeof filterParams.separator === \"undefined\" ? \" \" : filterParams.separator),\r\n\t\tvalue = String(rowVal === null || typeof rowVal === \"undefined\" ? \"\" : rowVal).toLowerCase(),\r\n\t\tmatches = [];\r\n\r\n\t\tkeywords.forEach((keyword) =>{\r\n\t\t\tif(value.includes(keyword)){\r\n\t\t\t\tmatches.push(true);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn filterParams.matchAll ? matches.length === keywords.length : !!matches.length;\r\n\t},\r\n\r\n\t//starts with the string\r\n\t\"starts\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().startsWith(filterVal.toLowerCase());\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//ends with the string\r\n\t\"ends\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().endsWith(filterVal.toLowerCase());\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//in array\r\n\t\"in\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(Array.isArray(filterVal)){\r\n\t\t\treturn filterVal.length ? filterVal.indexOf(rowVal) > -1 : true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Filter Error - filter value is not an array:\", filterVal);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultFilters from './defaults/filters.js';\r\n\r\nclass Filter extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.filterList = []; //hold filter list\r\n\t\tthis.headerFilters = {}; //hold column filters\r\n\t\tthis.headerFilterColumns = []; //hold columns that use header filters\r\n\r\n\t\tthis.prevHeaderFilterChangeCheck = \"\";\r\n\t\tthis.prevHeaderFilterChangeCheck = \"{}\";\r\n\r\n\t\tthis.changed = false; //has filtering changed since last render\r\n\t\tthis.tableInitialized = false;\r\n\r\n\t\tthis.registerTableOption(\"filterMode\", \"local\"); //local or remote filtering\r\n\r\n\t\tthis.registerTableOption(\"initialFilter\", false); //initial filtering criteria\r\n\t\tthis.registerTableOption(\"initialHeaderFilter\", false); //initial header filtering criteria\r\n\t\tthis.registerTableOption(\"headerFilterLiveFilterDelay\", 300); //delay before updating column after user types in header filter\r\n\r\n\t\tthis.registerColumnOption(\"headerFilter\");\r\n\t\tthis.registerColumnOption(\"headerFilterPlaceholder\");\r\n\t\tthis.registerColumnOption(\"headerFilterParams\");\r\n\t\tthis.registerColumnOption(\"headerFilterEmptyCheck\");\r\n\t\tthis.registerColumnOption(\"headerFilterFunc\");\r\n\t\tthis.registerColumnOption(\"headerFilterFuncParams\");\r\n\t\tthis.registerColumnOption(\"headerFilterLiveFilter\");\r\n\r\n\t\tthis.registerTableFunction(\"searchRows\", this.searchRows.bind(this));\r\n\t\tthis.registerTableFunction(\"searchData\", this.searchData.bind(this));\r\n\r\n\t\tthis.registerTableFunction(\"setFilter\", this.userSetFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"refreshFilter\", this.userRefreshFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"addFilter\", this.userAddFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"getFilters\", this.getFilters.bind(this));\r\n\t\tthis.registerTableFunction(\"setHeaderFilterFocus\", this.userSetHeaderFilterFocus.bind(this));\r\n\t\tthis.registerTableFunction(\"getHeaderFilterValue\", this.userGetHeaderFilterValue.bind(this));\r\n\t\tthis.registerTableFunction(\"setHeaderFilterValue\", this.userSetHeaderFilterValue.bind(this));\r\n\t\tthis.registerTableFunction(\"getHeaderFilters\", this.getHeaderFilters.bind(this));\r\n\t\tthis.registerTableFunction(\"removeFilter\", this.userRemoveFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"clearFilter\", this.userClearFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"clearHeaderFilter\", this.userClearHeaderFilter.bind(this));\r\n\r\n\t\tthis.registerComponentFunction(\"column\", \"headerFilterFocus\", this.setHeaderFilterFocus.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"reloadHeaderFilter\", this.reloadHeaderFilter.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"getHeaderFilterValue\", this.getHeaderFilterValue.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"setHeaderFilterValue\", this.setHeaderFilterValue.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumnHeaderFilter.bind(this));\r\n\t\tthis.subscribe(\"column-width-fit-before\", this.hideHeaderFilterElements.bind(this));\r\n\t\tthis.subscribe(\"column-width-fit-after\", this.showHeaderFilterElements.bind(this));\r\n\t\tthis.subscribe(\"table-built\", this.tableBuilt.bind(this));\r\n\r\n\t\tif(this.table.options.filterMode === \"remote\"){\r\n\t\t\tthis.subscribe(\"data-params\", this.remoteFilterParams.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerDataHandler(this.filter.bind(this), 10);\r\n\t}\r\n\r\n\ttableBuilt(){\r\n\t\tif(this.table.options.initialFilter){\r\n\t\t\tthis.setFilter(this.table.options.initialFilter);\r\n\t\t}\r\n\r\n\t\tif(this.table.options.initialHeaderFilter){\r\n\t\t\tthis.table.options.initialHeaderFilter.forEach((item) => {\r\n\r\n\t\t\t\tvar column = this.table.columnManager.findColumn(item.field);\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tthis.setHeaderFilterValue(column, item.value);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", item.field);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.tableInitialized = true;\r\n\t}\r\n\r\n\tremoteFilterParams(data, config, silent, params){\r\n\t\tparams.filter = this.getFilters(true, true);\r\n\t\treturn params;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\t//set standard filters\r\n\tuserSetFilter(field, type, value, params){\r\n\t\tthis.setFilter(field, type, value, params);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//set standard filters\r\n\tuserRefreshFilter(){\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//add filter to array\r\n\tuserAddFilter(field, type, value, params){\r\n\t\tthis.addFilter(field, type, value, params);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\tuserSetHeaderFilterFocus(field){\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\tthis.setHeaderFilterFocus(column);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Focus Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tuserGetHeaderFilterValue(field) {\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\treturn this.getHeaderFilterValue(column);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", field);\r\n\t\t}\r\n\t}\r\n\r\n\tuserSetHeaderFilterValue(field, value){\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\tthis.setHeaderFilterValue(column, value);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//remove filter from array\r\n\tuserRemoveFilter(field, type, value){\r\n\t\tthis.removeFilter(field, type, value);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//clear filters\r\n\tuserClearFilter(all){\r\n\t\tthis.clearFilter(all);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//clear header filters\r\n\tuserClearHeaderFilter(){\r\n\t\tthis.clearHeaderFilter();\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\r\n\t//search for specific row components\r\n\tsearchRows(field, type, value){\r\n\t\treturn this.search(\"rows\", field, type, value);\r\n\t}\r\n\r\n\t//search for specific data\r\n\tsearchData(field, type, value){\r\n\t\treturn this.search(\"data\", field, type, value);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tinitializeColumnHeaderFilter(column){\r\n\t\tvar def = column.definition;\r\n\r\n\t\tif(def.headerFilter){\r\n\r\n\t\t\tif(typeof def.headerFilterPlaceholder !== \"undefined\" && def.field){\r\n\t\t\t\tthis.module(\"localize\").setHeaderFilterColumnPlaceholder(def.field, def.headerFilterPlaceholder);\r\n\t\t\t}\r\n\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\r\n\t//initialize column header filter\r\n\tinitializeColumn(column, value){\r\n\t\tvar self = this,\r\n\t\tfield = column.getField(),\r\n\t\tparams;\r\n\r\n\t\t//handle successfull value change\r\n\t\tfunction success(value){\r\n\t\t\tvar filterType = (column.modules.filter.tagType == \"input\" && column.modules.filter.attrType == \"text\") || column.modules.filter.tagType == \"textarea\" ? \"partial\" : \"match\",\r\n\t\t\ttype = \"\",\r\n\t\t\tfilterChangeCheck = \"\",\r\n\t\t\tfilterFunc;\r\n\r\n\t\t\tif(typeof column.modules.filter.prevSuccess === \"undefined\" || column.modules.filter.prevSuccess !== value){\r\n\r\n\t\t\t\tcolumn.modules.filter.prevSuccess = value;\r\n\r\n\t\t\t\tif(!column.modules.filter.emptyFunc(value)){\r\n\t\t\t\t\tcolumn.modules.filter.value = value;\r\n\r\n\t\t\t\t\tswitch(typeof column.definition.headerFilterFunc){\r\n\t\t\t\t\t\tcase \"string\":\r\n\t\t\t\t\t\tif(Filter.filters[column.definition.headerFilterFunc]){\r\n\t\t\t\t\t\t\ttype = column.definition.headerFilterFunc;\r\n\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\tvar params = column.definition.headerFilterFuncParams || {};\r\n\t\t\t\t\t\t\t\tvar fieldVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\t\tparams = typeof params === \"function\" ? params(value, fieldVal, data) : params;\r\n\r\n\t\t\t\t\t\t\t\treturn Filter.filters[column.definition.headerFilterFunc](value, fieldVal, data, params);\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tconsole.warn(\"Header Filter Error - Matching filter function not found: \", column.definition.headerFilterFunc);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"function\":\r\n\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\tvar params = column.definition.headerFilterFuncParams || {};\r\n\t\t\t\t\t\t\tvar fieldVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\tparams = typeof params === \"function\" ? params(value, fieldVal, data) : params;\r\n\r\n\t\t\t\t\t\t\treturn column.definition.headerFilterFunc(value, fieldVal, data, params);\r\n\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\ttype = filterFunc;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(!filterFunc){\r\n\t\t\t\t\t\tswitch(filterType){\r\n\t\t\t\t\t\t\tcase \"partial\":\r\n\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\tvar colVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\t\tif(typeof colVal !== 'undefined' && colVal !== null){\r\n\t\t\t\t\t\t\t\t\treturn String(colVal).toLowerCase().indexOf(String(value).toLowerCase()) > -1;\r\n\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\ttype = \"like\";\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\treturn column.getFieldValue(data) == value;\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\ttype = \"=\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tself.headerFilters[field] = {value:value, func:filterFunc, type:type, params:params || {}};\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdelete self.headerFilters[field];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcolumn.modules.filter.value = value;\r\n\r\n\t\t\t\tfilterChangeCheck = JSON.stringify(self.headerFilters);\r\n\r\n\t\t\t\tif(self.prevHeaderFilterChangeCheck !== filterChangeCheck){\r\n\t\t\t\t\tself.prevHeaderFilterChangeCheck = filterChangeCheck;\r\n\r\n\t\t\t\t\tself.trackChanges();\r\n\t\t\t\t\tself.refreshFilter();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tcolumn.modules.filter = {\r\n\t\t\tsuccess:success,\r\n\t\t\tattrType:false,\r\n\t\t\ttagType:false,\r\n\t\t\temptyFunc:false,\r\n\t\t};\r\n\r\n\t\tthis.generateHeaderFilterElement(column);\r\n\t}\r\n\r\n\tgenerateHeaderFilterElement(column, initialValue, reinitialize){\r\n\t\tvar self = this,\r\n\t\tsuccess = column.modules.filter.success,\r\n\t\tfield = column.getField(),\r\n\t\tfilterElement, editor, editorElement, cellWrapper, typingTimer, searchTrigger, params;\r\n\r\n\t\tcolumn.modules.filter.value = initialValue;\r\n\r\n\t\t//handle aborted edit\r\n\t\tfunction cancel(){}\r\n\r\n\t\tif(column.modules.filter.headerElement && column.modules.filter.headerElement.parentNode){\r\n\t\t\tcolumn.contentElement.removeChild(column.modules.filter.headerElement.parentNode);\r\n\t\t}\r\n\r\n\t\tif(field){\r\n\r\n\t\t\t//set empty value function\r\n\t\t\tcolumn.modules.filter.emptyFunc = column.definition.headerFilterEmptyCheck || function(value){\r\n\t\t\t\treturn !value && value !== \"0\" && value !== 0;\r\n\t\t\t};\r\n\r\n\t\t\tfilterElement = document.createElement(\"div\");\r\n\t\t\tfilterElement.classList.add(\"tabulator-header-filter\");\r\n\r\n\t\t\t//set column editor\r\n\t\t\tswitch(typeof column.definition.headerFilter){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tif(self.table.modules.edit.editors[column.definition.headerFilter]){\r\n\t\t\t\t\teditor = self.table.modules.edit.editors[column.definition.headerFilter];\r\n\r\n\t\t\t\t\tif((column.definition.headerFilter === \"tick\" || column.definition.headerFilter === \"tickCross\") && !column.definition.headerFilterEmptyCheck){\r\n\t\t\t\t\t\tcolumn.modules.filter.emptyFunc = function(value){\r\n\t\t\t\t\t\t\treturn value !== true && value !== false;\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Filter Error - Cannot build header filter, No such editor found: \", column.definition.editor);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\teditor = column.definition.headerFilter;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\tif(column.modules.edit && column.modules.edit.editor){\r\n\t\t\t\t\teditor = column.modules.edit.editor;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(column.definition.formatter && self.table.modules.edit.editors[column.definition.formatter]){\r\n\t\t\t\t\t\teditor = self.table.modules.edit.editors[column.definition.formatter];\r\n\r\n\t\t\t\t\t\tif((column.definition.formatter === \"tick\" || column.definition.formatter === \"tickCross\") && !column.definition.headerFilterEmptyCheck){\r\n\t\t\t\t\t\t\tcolumn.modules.filter.emptyFunc = function(value){\r\n\t\t\t\t\t\t\t\treturn value !== true && value !== false;\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\teditor = self.table.modules.edit.editors[\"input\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(editor){\r\n\r\n\t\t\t\tcellWrapper = {\r\n\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\treturn typeof initialValue !== \"undefined\" ? initialValue : \"\";\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetField:function(){\r\n\t\t\t\t\t\treturn column.definition.field;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\treturn filterElement;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tnormalizeHeight:function(){\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\r\n\t\t\t\tparams = column.definition.headerFilterParams || {};\r\n\r\n\t\t\t\tparams = typeof params === \"function\" ? params.call(self.table, cellWrapper) : params;\r\n\r\n\t\t\t\teditorElement = editor.call(this.table.modules.edit, cellWrapper, function(){}, success, cancel, params);\r\n\r\n\t\t\t\tif(!editorElement){\r\n\t\t\t\t\tconsole.warn(\"Filter Error - Cannot add filter to \" + field + \" column, editor returned a value of false\");\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!(editorElement instanceof Node)){\r\n\t\t\t\t\tconsole.warn(\"Filter Error - Cannot add filter to \" + field + \" column, editor should return an instance of Node, the editor returned:\", editorElement);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//set Placeholder Text\r\n\t\t\t\tif(field){\r\n\t\t\t\t\tself.langBind(\"headerFilters|columns|\" + column.definition.field, function(value){\r\n\t\t\t\t\t\teditorElement.setAttribute(\"placeholder\", typeof value !== \"undefined\" && value ? value : self.langText(\"headerFilters|default\"));\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself.langBind(\"headerFilters|default\", function(value){\r\n\t\t\t\t\t\teditorElement.setAttribute(\"placeholder\", value);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//focus on element on click\r\n\t\t\t\teditorElement.addEventListener(\"click\", function(e){\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\teditorElement.focus();\r\n\t\t\t\t});\r\n\r\n\t\t\t\teditorElement.addEventListener(\"focus\", (e) => {\r\n\t\t\t\t\tvar left = this.table.columnManager.element.scrollLeft;\r\n\r\n\t\t\t\t\tvar headerPos = this.table.rowManager.element.scrollLeft + parseInt(this.table.columnManager.element.style.marginLeft);\r\n\r\n\t\t\t\t\tif(left !== headerPos){\r\n\t\t\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\t\t\tthis.table.columnManager.scrollHorizontal(left);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\t//live update filters as user types\r\n\t\t\t\ttypingTimer = false;\r\n\r\n\t\t\t\tsearchTrigger = function(e){\r\n\t\t\t\t\tif(typingTimer){\r\n\t\t\t\t\t\tclearTimeout(typingTimer);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\ttypingTimer = setTimeout(function(){\r\n\t\t\t\t\t\tsuccess(editorElement.value);\r\n\t\t\t\t\t},self.table.options.headerFilterLiveFilterDelay);\r\n\t\t\t\t};\r\n\r\n\t\t\t\tcolumn.modules.filter.headerElement = editorElement;\r\n\t\t\t\tcolumn.modules.filter.attrType = editorElement.hasAttribute(\"type\") ? editorElement.getAttribute(\"type\").toLowerCase() : \"\" ;\r\n\t\t\t\tcolumn.modules.filter.tagType = editorElement.tagName.toLowerCase();\r\n\r\n\t\t\t\tif(column.definition.headerFilterLiveFilter !== false){\r\n\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\t!(\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === 'autocomplete' ||\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === 'tickCross' ||\r\n\t\t\t\t\t\t\t((column.definition.editor === 'autocomplete' ||\r\n\t\t\t\t\t\t\t\tcolumn.definition.editor === 'tickCross') &&\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === true)\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t) {\r\n\t\t\t\t\t\teditorElement.addEventListener(\"keyup\", searchTrigger);\r\n\t\t\t\t\teditorElement.addEventListener(\"search\", searchTrigger);\r\n\r\n\r\n\t\t\t\t\t//update number filtered columns on change\r\n\t\t\t\t\tif(column.modules.filter.attrType == \"number\"){\r\n\t\t\t\t\t\teditorElement.addEventListener(\"change\", function(e){\r\n\t\t\t\t\t\t\tsuccess(editorElement.value);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//change text inputs to search inputs to allow for clearing of field\r\n\t\t\t\t\tif(column.modules.filter.attrType == \"text\" && this.table.browser !== \"ie\"){\r\n\t\t\t\t\t\teditorElement.setAttribute(\"type\", \"search\");\r\n\t\t\t\t\t\t// editorElement.off(\"change blur\"); //prevent blur from triggering filter and preventing selection click\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t\t//prevent input and select elements from propegating click to column sorters etc\r\n\t\t\t\t\tif(column.modules.filter.tagType == \"input\" || column.modules.filter.tagType == \"select\" || column.modules.filter.tagType == \"textarea\"){\r\n\t\t\t\t\t\teditorElement.addEventListener(\"mousedown\",function(e){\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfilterElement.appendChild(editorElement);\r\n\r\n\t\t\t\tcolumn.contentElement.appendChild(filterElement);\r\n\r\n\t\t\t\tif(!reinitialize){\r\n\t\t\t\t\tself.headerFilterColumns.push(column);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Filter Error - Cannot add header filter, column has no field set:\", column.definition.title);\r\n\t\t}\r\n\t}\r\n\r\n\t//hide all header filter elements (used to ensure correct column widths in \"fitData\" layout mode)\r\n\thideHeaderFilterElements(){\r\n\t\tthis.headerFilterColumns.forEach(function(column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tcolumn.modules.filter.headerElement.style.display = 'none';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//show all header filter elements (used to ensure correct column widths in \"fitData\" layout mode)\r\n\tshowHeaderFilterElements(){\r\n\t\tthis.headerFilterColumns.forEach(function(column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tcolumn.modules.filter.headerElement.style.display = '';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//programatically set focus of header filter\r\n\tsetHeaderFilterFocus(column){\r\n\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\tcolumn.modules.filter.headerElement.focus();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Focus Error - No header filter set on column:\", column.getField());\r\n\t\t}\r\n\t}\r\n\r\n\t//programmatically get value of header filter\r\n\tgetHeaderFilterValue(column){\r\n\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\treturn column.modules.filter.value;\r\n\t\t} else {\r\n\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t}\r\n\t}\r\n\r\n\t//programatically set value of header filter\r\n\tsetHeaderFilterValue(column, value){\r\n\t\tif (column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tthis.generateHeaderFilterElement(column, value, true);\r\n\t\t\t\tcolumn.modules.filter.success(value);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treloadHeaderFilter(column){\r\n\t\tif (column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tthis.generateHeaderFilterElement(column, column.modules.filter.value, true);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trefreshFilter(){\r\n\t\tif(this.tableInitialized){\r\n\t\t\tif(this.table.options.filterMode === \"remote\"){\r\n\t\t\t\tthis.reloadData(null, false, false);\r\n\t\t\t}else{\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//TODO - Persist left position of row manager\r\n\t\t// left = this.scrollLeft;\r\n\t\t// this.scrollHorizontal(left);\r\n\t}\r\n\r\n\t//check if the filters has changed since last use\r\n\ttrackChanges(){\r\n\t\tthis.changed = true;\r\n\t\tthis.dispatch(\"filter-changed\");\r\n\t}\r\n\r\n\t//check if the filters has changed since last use\r\n\thasChanged(){\r\n\t\tvar changed = this.changed;\r\n\t\tthis.changed = false;\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t//set standard filters\r\n\tsetFilter(field, type, value, params){\r\n\t\tthis.filterList = [];\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value, params:params}];\r\n\t\t}\r\n\r\n\t\tthis.addFilter(field);\r\n\t}\r\n\r\n\t//add filter to array\r\n\taddFilter(field, type, value, params){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value, params:params}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\tthis.filterList.push(filter);\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.trackChanges();\r\n\t\t}\r\n\t}\r\n\r\n\tfindFilter(filter){\r\n\t\tvar column;\r\n\r\n\t\tif(Array.isArray(filter)){\r\n\t\t\treturn this.findSubFilters(filter);\r\n\t\t}\r\n\r\n\t\tvar filterFunc = false;\r\n\r\n\t\tif(typeof filter.field == \"function\"){\r\n\t\t\tfilterFunc = function(data){\r\n\t\t\t\treturn filter.field(data, filter.type || {})// pass params to custom filter function\r\n\t\t\t};\r\n\t\t}else{\r\n\r\n\t\t\tif(Filter.filters[filter.type]){\r\n\r\n\t\t\t\tcolumn = this.table.columnManager.getColumnByField(filter.field);\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\treturn Filter.filters[filter.type](filter.value, column.getFieldValue(data), data, filter.params || {});\r\n\t\t\t\t\t};\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\treturn Filter.filters[filter.type](filter.value, data[filter.field], data, filter.params || {});\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Filter Error - No such filter type found, ignoring: \", filter.type);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfilter.func = filterFunc;\r\n\r\n\t\treturn filter.func ? filter : false;\r\n\t}\r\n\r\n\tfindSubFilters(filters){\r\n\t\tvar output = [];\r\n\r\n\t\tfilters.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\toutput.push(filter);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output.length ? output : false;\r\n\t}\r\n\r\n\t//get all filters\r\n\tgetFilters(all, ajax){\r\n\t\tvar output = [];\r\n\r\n\t\tif(all){\r\n\t\t\toutput = this.getHeaderFilters();\r\n\t\t}\r\n\r\n\t\tif(ajax){\r\n\t\t\toutput.forEach(function(item){\r\n\t\t\t\tif(typeof item.type == \"function\"){\r\n\t\t\t\t\titem.type = \"function\";\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\toutput = output.concat(this.filtersToArray(this.filterList, ajax));\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//filter to Object\r\n\tfiltersToArray(filterList, ajax){\r\n\t\tvar output = [];\r\n\r\n\t\tfilterList.forEach((filter) => {\r\n\t\t\tvar item;\r\n\r\n\t\t\tif(Array.isArray(filter)){\r\n\t\t\t\toutput.push(this.filtersToArray(filter, ajax));\r\n\t\t\t}else{\r\n\t\t\t\titem = {field:filter.field, type:filter.type, value:filter.value}\r\n\r\n\t\t\t\tif(ajax){\r\n\t\t\t\t\tif(typeof item.type == \"function\"){\r\n\t\t\t\t\t\titem.type = \"function\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\toutput.push(item);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//get all filters\r\n\tgetHeaderFilters(){\r\n\t\tvar output = [];\r\n\r\n\t\tfor(var key in this.headerFilters){\r\n\t\t\toutput.push({field:key, type:this.headerFilters[key].type, value:this.headerFilters[key].value});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//remove filter from array\r\n\tremoveFilter(field, type, value){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tvar index = -1;\r\n\r\n\t\t\tif(typeof filter.field == \"object\"){\r\n\t\t\t\tindex = this.filterList.findIndex((element) => {\r\n\t\t\t\t\treturn filter === element;\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tindex = this.filterList.findIndex((element) => {\r\n\t\t\t\t\treturn filter.field === element.field && filter.type === element.type && filter.value === element.value;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.filterList.splice(index, 1);\r\n\t\t\t\tchanged = true;\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Filter Error - No matching filter type found, ignoring: \", filter.type);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//clear filters\r\n\tclearFilter(all){\r\n\t\tthis.filterList = [];\r\n\r\n\t\tif(all){\r\n\t\t\tthis.clearHeaderFilter();\r\n\t\t}\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//clear header filters\r\n\tclearHeaderFilter(){\r\n\t\tthis.headerFilters = {};\r\n\t\tthis.prevHeaderFilterChangeCheck = \"{}\";\r\n\r\n\t\tthis.headerFilterColumns.forEach((column) => {\r\n\t\t\tif(typeof column.modules.filter.value !== \"undefined\"){\r\n\t\t\t\tdelete column.modules.filter.value;\r\n\t\t\t}\r\n\t\t\tcolumn.modules.filter.prevSuccess = undefined;\r\n\t\t\tthis.reloadHeaderFilter(column);\r\n\t\t});\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//search data and return matching rows\r\n\tsearch (searchType, field, type, value){\r\n\t\tvar activeRows = [],\r\n\t\tfilterList = [];\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\tfilterList.push(filter);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\tvar match = true;\r\n\r\n\t\t\tfilterList.forEach((filter) => {\r\n\t\t\t\tif(!this.filterRecurse(filter, row.getData())){\r\n\t\t\t\t\tmatch = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tactiveRows.push(searchType === \"data\" ? row.getData(\"data\") : row.getComponent());\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t\treturn activeRows;\r\n\t}\r\n\r\n\t//filter row array\r\n\tfilter(rowList, filters){\r\n\t\tvar activeRows = [],\r\n\t\tactiveRowComponents = [];\r\n\r\n\t\tif(this.subscribedExternal(\"dataFiltering\")){\r\n\t\t\tthis.dispatchExternal(\"dataFiltering\", this.getFilters(true));\r\n\t\t}\r\n\r\n\t\tif(this.table.options.filterMode !== \"remote\" && (this.filterList.length || Object.keys(this.headerFilters).length)){\r\n\r\n\t\t\trowList.forEach((row) => {\r\n\t\t\t\tif(this.filterRow(row)){\r\n\t\t\t\t\tactiveRows.push(row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t}else{\r\n\t\t\tactiveRows = rowList.slice(0);\r\n\t\t}\r\n\r\n\t\tif(this.subscribedExternal(\"dataFiltered\")){\r\n\r\n\t\t\tactiveRows.forEach((row) => {\r\n\t\t\t\tactiveRowComponents.push(row.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatchExternal(\"dataFiltered\", this.getFilters(true), activeRowComponents);\r\n\t\t}\r\n\r\n\t\treturn activeRows;\r\n\t}\r\n\r\n\t//filter individual row\r\n\tfilterRow(row, filters){\r\n\t\tvar match = true,\r\n\t\tdata = row.getData();\r\n\r\n\t\tthis.filterList.forEach((filter) => {\r\n\t\t\tif(!this.filterRecurse(filter, data)){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\tfor(var field in this.headerFilters){\r\n\t\t\tif(!this.headerFilters[field].func(data)){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tfilterRecurse(filter, data){\r\n\t\tvar match = false;\r\n\r\n\t\tif(Array.isArray(filter)){\r\n\t\t\tfilter.forEach((subFilter) => {\r\n\t\t\t\tif(this.filterRecurse(subFilter, data)){\r\n\t\t\t\t\tmatch = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tmatch = filter.func(data);\r\n\t\t}\r\n\r\n\t\treturn match;\r\n\t}\r\n}\r\n\r\nFilter.moduleName = \"filter\";\r\n\r\n//load defaults\r\nFilter.filters = defaultFilters;\r\n\r\nexport default Filter;","import plaintext from './formatters/plaintext.js';\r\nimport html from './formatters/html.js';\r\nimport textarea from './formatters/textarea.js';\r\nimport money from './formatters/money.js';\r\nimport link from './formatters/link.js';\r\nimport image from './formatters/image.js';\r\nimport tickCross from './formatters/tickCross.js';\r\nimport datetime from './formatters/datetime.js';\r\nimport datetimediff from './formatters/datetimediff.js';\r\nimport lookup from './formatters/lookup.js';\r\nimport star from './formatters/star.js';\r\nimport traffic from './formatters/traffic.js';\r\nimport progress from './formatters/progress.js';\r\nimport color from './formatters/color.js';\r\nimport buttonTick from './formatters/buttonTick.js';\r\nimport buttonCross from './formatters/buttonCross.js';\r\nimport rownum from './formatters/rownum.js';\r\nimport handle from './formatters/handle.js';\r\nimport responsiveCollapse from './formatters/responsiveCollapse.js';\r\nimport rowSelection from './formatters/rowSelection.js';\r\n\r\nexport default {\r\n\tplaintext:plaintext,\r\n\thtml:html,\r\n\ttextarea:textarea,\r\n\tmoney:money,\r\n\tlink:link,\r\n\timage:image,\r\n\ttickCross:tickCross,\r\n\tdatetime:datetime,\r\n\tdatetimediff:datetimediff,\r\n\tlookup:lookup,\r\n\tstar:star,\r\n\ttraffic:traffic,\r\n\tprogress:progress,\r\n\tcolor:color,\r\n\tbuttonTick:buttonTick,\r\n\tbuttonCross:buttonCross,\r\n\trownum:rownum,\r\n\thandle:handle,\r\n\tresponsiveCollapse:responsiveCollapse,\r\n\trowSelection:rowSelection,\r\n};","export default function(cell, formatterParams, onRendered){\r\n\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n};","export default function(cell, formatterParams, onRendered){\r\n\treturn cell.getValue();\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().style.whiteSpace = \"pre-wrap\";\r\n\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar floatVal = parseFloat(cell.getValue()),\r\n\tsign = \"\",\r\n\tnumber, integer, decimal, rgx;\r\n\r\n\tvar decimalSym = formatterParams.decimal || \".\";\r\n\tvar thousandSym = formatterParams.thousand || \",\";\r\n\tvar negativeSign = formatterParams.negativeSign || \"-\";\r\n\tvar symbol = formatterParams.symbol || \"\";\r\n\tvar after = !!formatterParams.symbolAfter;\r\n\tvar precision = typeof formatterParams.precision !== \"undefined\" ? formatterParams.precision : 2;\r\n\r\n\tif(isNaN(floatVal)){\r\n\t\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n\t}\r\n\r\n\tif(floatVal < 0){\r\n\t\tfloatVal = Math.abs(floatVal);\r\n\t\tsign = negativeSign;\r\n\t}\r\n\r\n\tnumber = precision !== false ? floatVal.toFixed(precision) : floatVal;\r\n\tnumber = String(number).split(\".\");\r\n\r\n\tinteger = number[0];\r\n\tdecimal = number.length > 1 ? decimalSym + number[1] : \"\";\r\n\r\n\tif (formatterParams.thousand !== false) {\r\n\t\trgx = /(\\d+)(\\d{3})/;\r\n\r\n\t\twhile (rgx.test(integer)){\r\n\t\t\tinteger = integer.replace(rgx, \"$1\" + thousandSym + \"$2\");\r\n\t\t}\r\n\t}\r\n\r\n\treturn after ? sign + integer + decimal + symbol : sign + symbol + integer + decimal;\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\turlPrefix = formatterParams.urlPrefix || \"\",\r\n\tdownload = formatterParams.download,\r\n\tlabel = value,\r\n\tel = document.createElement(\"a\"),\r\n\tdata;\r\n\r\n\tfunction labelTraverse(path, data){\r\n\t\tvar item = path.shift(),\r\n\t\tvalue = data[item];\r\n\t\t\r\n\t\tif(path.length && typeof value === \"object\"){\r\n\t\t\treturn labelTraverse(path, value);\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t};\r\n\r\n\tif(formatterParams.labelField){\r\n\t\tdata = cell.getData();\r\n\t\tlabel = labelTraverse(formatterParams.labelField.split(this.table.options.nestedFieldSeparator), data);\r\n\t}\r\n\r\n\tif(formatterParams.label){\r\n\t\tswitch(typeof formatterParams.label){\r\n\t\t\tcase \"string\":\r\n\t\t\tlabel = formatterParams.label;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tlabel = formatterParams.label(cell);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif(label){\r\n\t\tif(formatterParams.urlField){\r\n\t\t\tdata = cell.getData();\r\n\t\t\tvalue = data[formatterParams.urlField];\r\n\t\t}\r\n\r\n\t\tif(formatterParams.url){\r\n\t\t\tswitch(typeof formatterParams.url){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tvalue = formatterParams.url;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tvalue = formatterParams.url(cell);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tel.setAttribute(\"href\", urlPrefix + value);\r\n\r\n\t\tif(formatterParams.target){\r\n\t\t\tel.setAttribute(\"target\", formatterParams.target);\r\n\t\t}\r\n\r\n\t\tif(formatterParams.download){\r\n\r\n\t\t\tif(typeof download == \"function\"){\r\n\t\t\t\tdownload = download(cell);\r\n\t\t\t}else{\r\n\t\t\t\tdownload = download === true ? \"\" : download;\r\n\t\t\t}\r\n\r\n\t\t\tel.setAttribute(\"download\", download);\r\n\t\t}\r\n\r\n\t\tel.innerHTML = this.emptyToSpace(this.sanitizeHTML(label));\r\n\r\n\t\treturn el;\r\n\t}else{\r\n\t\treturn \" \";\r\n\t}\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar el = document.createElement(\"img\"),\r\n\tsrc = cell.getValue();\r\n\r\n\tif(formatterParams.urlPrefix){\r\n\t\tsrc = formatterParams.urlPrefix + cell.getValue();\r\n\t}\r\n\r\n\tif(formatterParams.urlSuffix){\r\n\t\tsrc = src + formatterParams.urlSuffix;\r\n\t}\r\n\r\n\tel.setAttribute(\"src\", src);\r\n\r\n\tswitch(typeof formatterParams.height){\r\n\t\tcase \"number\":\r\n\t\tel.style.height = formatterParams.height + \"px\";\r\n\t\tbreak;\r\n\r\n\t\tcase \"string\":\r\n\t\tel.style.height = formatterParams.height;\r\n\t\tbreak;\r\n\t}\r\n\r\n\tswitch(typeof formatterParams.width){\r\n\t\tcase \"number\":\r\n\t\tel.style.width = formatterParams.width + \"px\";\r\n\t\tbreak;\r\n\r\n\t\tcase \"string\":\r\n\t\tel.style.width = formatterParams.width;\r\n\t\tbreak;\r\n\t}\r\n\r\n\tel.addEventListener(\"load\", function(){\r\n\t\tcell.getRow().normalizeHeight();\r\n\t});\r\n\r\n\treturn el;\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\telement = cell.getElement(),\r\n\tempty = formatterParams.allowEmpty,\r\n\ttruthy = formatterParams.allowTruthy,\r\n\ttrueValueSet = Object.keys(formatterParams).includes(\"trueValue\"),\r\n\ttick = typeof formatterParams.tickElement !== \"undefined\" ? formatterParams.tickElement : '',\r\n\tcross = typeof formatterParams.crossElement !== \"undefined\" ? formatterParams.crossElement : '';\r\n\r\n\tif((trueValueSet && value === formatterParams.trueValue) || (!trueValueSet && ((truthy && value) || (value === true || value === \"true\" || value === \"True\" || value === 1 || value === \"1\")))){\r\n\t\telement.setAttribute(\"aria-checked\", true);\r\n\t\treturn tick || \"\";\r\n\t}else{\r\n\t\tif(empty && (value === \"null\" || value === \"\" || value === null || typeof value === \"undefined\")){\r\n\t\t\telement.setAttribute(\"aria-checked\", \"mixed\");\r\n\t\t\treturn \"\";\r\n\t\t}else{\r\n\t\t\telement.setAttribute(\"aria-checked\", false);\r\n\t\t\treturn cross || \"\";\r\n\t\t}\r\n\t}\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar inputFormat = formatterParams.inputFormat || \"yyyy-MM-dd HH:mm:ss\";\r\n\tvar\toutputFormat = formatterParams.outputFormat || \"dd/MM/yyyy HH:mm:ss\";\r\n\tvar\tinvalid = typeof formatterParams.invalidPlaceholder !== \"undefined\" ? formatterParams.invalidPlaceholder : \"\";\r\n\tvar value = cell.getValue();\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tvar newDatetime;\r\n\r\n\t\tif(DT.isDateTime(value)){\r\n\t\t\t newDatetime = value;\r\n\t\t }else if(inputFormat === \"iso\"){\r\n\t\t\t newDatetime = DT.fromISO(String(value));\r\n\t\t }else{\r\n\t\t\t newDatetime = DT.fromFormat(String(value), inputFormat);\r\n\t\t }\r\n\r\n\t\tif(newDatetime.isValid){\r\n\t\t\tif(formatterParams.timezone){\r\n\t\t\t\tnewDatetime = newDatetime.setZone(formatterParams.timezone);\r\n\t\t\t}\r\n\r\n\t\t\treturn newDatetime.toFormat(outputFormat);\r\n\t\t}else{\r\n\t\t\tif(invalid === true || !value){\r\n\t\t\t\treturn value;\r\n\t\t\t}else if(typeof invalid === \"function\"){\r\n\t\t\t\treturn invalid(value);\r\n\t\t\t}else{\r\n\t\t\t\treturn invalid;\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tconsole.error(\"Format Error - 'datetime' formatter is dependant on luxon.js\");\r\n\t}\r\n};","export default function (cell, formatterParams, onRendered) {\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar inputFormat = formatterParams.inputFormat || \"yyyy-MM-dd HH:mm:ss\";\r\n\tvar invalid = typeof formatterParams.invalidPlaceholder !== \"undefined\" ? formatterParams.invalidPlaceholder : \"\";\r\n\tvar suffix = typeof formatterParams.suffix !== \"undefined\" ? formatterParams.suffix : false;\r\n\tvar unit = typeof formatterParams.unit !== \"undefined\" ? formatterParams.unit : \"days\";\r\n\tvar humanize = typeof formatterParams.humanize !== \"undefined\" ? formatterParams.humanize : false;\r\n\tvar date = typeof formatterParams.date !== \"undefined\" ? formatterParams.date : DT.now();\r\n\tvar value = cell.getValue();\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tvar newDatetime;\r\n\r\n\t\tif(DT.isDateTime(value)){\r\n\t\t\t newDatetime = value;\r\n\t\t }else if(inputFormat === \"iso\"){\r\n\t\t\t newDatetime = DT.fromISO(String(value));\r\n\t\t }else{\r\n\t\t\t newDatetime = DT.fromFormat(String(value), inputFormat);\r\n\t\t }\r\n\r\n\t\tif (newDatetime.isValid){\r\n\t\t\tif(humanize){\r\n\t\t\t\treturn newDatetime.diff(date, unit).toHuman() + (suffix ? \" \" + suffix : \"\");\r\n\t\t\t}else{\r\n\t\t\t\treturn parseInt(newDatetime.diff(date, unit)[unit]) + (suffix ? \" \" + suffix : \"\");\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\tif (invalid === true) {\r\n\t\t\t\treturn value;\r\n\t\t\t} else if (typeof invalid === \"function\") {\r\n\t\t\t\treturn invalid(value);\r\n\t\t\t} else {\r\n\t\t\t\treturn invalid;\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tconsole.error(\"Format Error - 'datetimediff' formatter is dependant on luxon.js\");\r\n\t}\r\n};","export default function (cell, formatterParams, onRendered) {\r\n\tvar value = cell.getValue();\r\n\r\n\tif (typeof formatterParams[value] === \"undefined\") {\r\n\t\tconsole.warn('Missing display value for ' + value);\r\n\t\treturn value;\r\n\t}\r\n\r\n\treturn formatterParams[value];\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\telement = cell.getElement(),\r\n\tmaxStars = formatterParams && formatterParams.stars ? formatterParams.stars : 5,\r\n\tstars = document.createElement(\"span\"),\r\n\tstar = document.createElementNS('http://www.w3.org/2000/svg', \"svg\"),\r\n\tstarActive = '',\r\n\tstarInactive = '';\r\n\r\n\t//style stars holder\r\n\tstars.style.verticalAlign = \"middle\";\r\n\r\n\t//style star\r\n\tstar.setAttribute(\"width\", \"14\");\r\n\tstar.setAttribute(\"height\", \"14\");\r\n\tstar.setAttribute(\"viewBox\", \"0 0 512 512\");\r\n\tstar.setAttribute(\"xml:space\", \"preserve\");\r\n\tstar.style.padding = \"0 1px\";\r\n\r\n\tvalue = value && !isNaN(value) ? parseInt(value) : 0;\r\n\r\n\tvalue = Math.max(0, Math.min(value, maxStars));\r\n\r\n\tfor(var i=1;i<= maxStars;i++){\r\n\t\tvar nextStar = star.cloneNode(true);\r\n\t\tnextStar.innerHTML = i <= value ? starActive : starInactive;\r\n\r\n\t\tstars.appendChild(nextStar);\r\n\t}\r\n\r\n\telement.style.whiteSpace = \"nowrap\";\r\n\telement.style.overflow = \"hidden\";\r\n\telement.style.textOverflow = \"ellipsis\";\r\n\r\n\telement.setAttribute(\"aria-label\", value);\r\n\r\n\treturn stars;\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar value = this.sanitizeHTML(cell.getValue()) || 0,\r\n\tel = document.createElement(\"span\"),\r\n\tmax = formatterParams && formatterParams.max ? formatterParams.max : 100,\r\n\tmin = formatterParams && formatterParams.min ? formatterParams.min : 0,\r\n\tcolors = formatterParams && typeof formatterParams.color !== \"undefined\" ? formatterParams.color : [\"red\", \"orange\", \"green\"],\r\n\tcolor = \"#666666\",\r\n\tpercent, percentValue;\r\n\r\n\tif(isNaN(value) || typeof cell.getValue() === \"undefined\"){\r\n\t\treturn;\r\n\t}\r\n\r\n\tel.classList.add(\"tabulator-traffic-light\");\r\n\r\n\t//make sure value is in range\r\n\tpercentValue = parseFloat(value) <= max ? parseFloat(value) : max;\r\n\tpercentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min;\r\n\r\n\t//workout percentage\r\n\tpercent = (max - min) / 100;\r\n\tpercentValue = Math.round((percentValue - min) / percent);\r\n\r\n\t//set color\r\n\tswitch(typeof colors){\r\n\t\tcase \"string\":\r\n\t\tcolor = colors;\r\n\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\tcolor = colors(value);\r\n\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\tif(Array.isArray(colors)){\r\n\t\t\tvar unit = 100 / colors.length;\r\n\t\t\tvar index = Math.floor(percentValue / unit);\r\n\r\n\t\t\tindex = Math.min(index, colors.length - 1);\r\n\t\t\tindex = Math.max(index, 0);\r\n\t\t\tcolor = colors[index];\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tel.style.backgroundColor = color;\r\n\r\n\treturn el;\r\n};","import CellComponent from '../../../../core/cell/CellComponent.js';\r\n\r\nexport default function(cell, formatterParams, onRendered){ //progress bar\r\n\tvar value = this.sanitizeHTML(cell.getValue()) || 0,\r\n\telement = cell.getElement(),\r\n\tmax = formatterParams && formatterParams.max ? formatterParams.max : 100,\r\n\tmin = formatterParams && formatterParams.min ? formatterParams.min : 0,\r\n\tlegendAlign = formatterParams && formatterParams.legendAlign ? formatterParams.legendAlign : \"center\",\r\n\tpercent, percentValue, color, legend, legendColor, top, left, right, bottom;\r\n\r\n\t//make sure value is in range\r\n\tpercentValue = parseFloat(value) <= max ? parseFloat(value) : max;\r\n\tpercentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min;\r\n\r\n\t//workout percentage\r\n\tpercent = (max - min) / 100;\r\n\tpercentValue = Math.round((percentValue - min) / percent);\r\n\r\n\t//set bar color\r\n\tswitch(typeof formatterParams.color){\r\n\t\tcase \"string\":\r\n\t\tcolor = formatterParams.color;\r\n\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\tcolor = formatterParams.color(value);\r\n\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\tif(Array.isArray(formatterParams.color)){\r\n\t\t\tvar unit = 100 / formatterParams.color.length;\r\n\t\t\tvar index = Math.floor(percentValue / unit);\r\n\r\n\t\t\tindex = Math.min(index, formatterParams.color.length - 1);\r\n\t\t\tindex = Math.max(index, 0);\r\n\t\t\tcolor = formatterParams.color[index];\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tdefault:\r\n\t\tcolor = \"#2DC214\";\r\n\t}\r\n\r\n\t//generate legend\r\n\tswitch(typeof formatterParams.legend){\r\n\t\tcase \"string\":\r\n\t\tlegend = formatterParams.legend;\r\n\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\tlegend = formatterParams.legend(value);\r\n\t\tbreak;\r\n\t\tcase \"boolean\":\r\n\t\tlegend = value;\r\n\t\tbreak;\r\n\t\tdefault:\r\n\t\tlegend = false;\r\n\t}\r\n\r\n\t//set legend color\r\n\tswitch(typeof formatterParams.legendColor){\r\n\t\tcase \"string\":\r\n\t\tlegendColor = formatterParams.legendColor;\r\n\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\tlegendColor = formatterParams.legendColor(value);\r\n\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\tif(Array.isArray(formatterParams.legendColor)){\r\n\t\t\tvar unit = 100 / formatterParams.legendColor.length;\r\n\t\t\tvar index = Math.floor(percentValue / unit);\r\n\r\n\t\t\tindex = Math.min(index, formatterParams.legendColor.length - 1);\r\n\t\t\tindex = Math.max(index, 0);\r\n\t\t\tlegendColor = formatterParams.legendColor[index];\r\n\t\t}\r\n\t\tbreak;\r\n\t\tdefault:\r\n\t\tlegendColor = \"#000\";\r\n\t}\r\n\r\n\telement.style.minWidth = \"30px\";\r\n\telement.style.position = \"relative\";\r\n\r\n\telement.setAttribute(\"aria-label\", percentValue);\r\n\r\n\tvar barEl = document.createElement(\"div\");\r\n\tbarEl.style.display = \"inline-block\";\r\n\tbarEl.style.position = \"absolute\";\r\n\tbarEl.style.width = percentValue + \"%\";\r\n\tbarEl.style.backgroundColor = color;\r\n\tbarEl.style.height = \"100%\";\r\n\r\n\tbarEl.setAttribute('data-max', max);\r\n\tbarEl.setAttribute('data-min', min);\r\n\r\n\tvar barContainer = document.createElement(\"div\");\r\n\tbarContainer.style.position = \"relative\";\r\n\tbarContainer.style.width = \"100%\";\r\n\tbarContainer.style.height = \"100%\";\r\n\r\n\tif(legend){\r\n\t\tvar legendEl = document.createElement(\"div\");\r\n\t\tlegendEl.style.position = \"absolute\";\r\n\t\tlegendEl.style.top = 0;\r\n\t\tlegendEl.style.left = 0;\r\n\t\tlegendEl.style.textAlign = legendAlign;\r\n\t\tlegendEl.style.width = \"100%\";\r\n\t\tlegendEl.style.color = legendColor;\r\n\t\tlegendEl.innerHTML = legend;\r\n\t}\r\n\r\n\tonRendered(function(){\r\n\r\n\t\t//handle custom element needed if formatter is to be included in printed/downloaded output\r\n\t\tif(!(cell instanceof CellComponent)){\r\n\t\t\tvar holderEl = document.createElement(\"div\");\r\n\t\t\tholderEl.style.position = \"absolute\";\r\n\t\t\tholderEl.style.top = \"4px\";\r\n\t\t\tholderEl.style.bottom = \"4px\";\r\n\t\t\tholderEl.style.left = \"4px\";\r\n\t\t\tholderEl.style.right = \"4px\";\r\n\r\n\t\t\telement.appendChild(holderEl);\r\n\r\n\t\t\telement = holderEl;\r\n\t\t}\r\n\r\n\t\telement.appendChild(barContainer);\r\n\t\tbarContainer.appendChild(barEl);\r\n\r\n\t\tif(legend){\r\n\t\t\tbarContainer.appendChild(legendEl);\r\n\t\t}\r\n\t});\r\n\r\n\treturn \"\";\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().style.backgroundColor = this.sanitizeHTML(cell.getValue());\r\n\treturn \"\";\r\n};","export default function(cell, formatterParams, onRendered){\r\n\treturn '';\r\n};","export default function(cell, formatterParams, onRendered){\r\n\treturn '';\r\n};","export default function(cell, formatterParams, onRendered){\r\n\treturn this.table.rowManager.activeRows.indexOf(cell.getRow()._getSelf()) + 1 || \"\";\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().classList.add(\"tabulator-row-handle\");\r\n\treturn \"
\";\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar open = false,\r\n\tel = document.createElement(\"div\"),\r\n\tconfig = cell.getRow()._row.modules.responsiveLayout;\r\n\r\n\tel.classList.add(\"tabulator-responsive-collapse-toggle\");\r\n\tel.innerHTML = \"+-\";\r\n\r\n\tcell.getElement().classList.add(\"tabulator-row-handle\");\r\n\r\n\tfunction toggleList(isOpen){\r\n\t\tvar collapseEl = config.element;\r\n\r\n\t\tconfig.open = isOpen;\r\n\r\n\t\tif(collapseEl){\r\n\r\n\t\t\tif(config.open){\r\n\t\t\t\tel.classList.add(\"open\");\r\n\t\t\t\tcollapseEl.style.display = '';\r\n\t\t\t}else{\r\n\t\t\t\tel.classList.remove(\"open\");\r\n\t\t\t\tcollapseEl.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tel.addEventListener(\"click\", function(e){\r\n\t\te.stopImmediatePropagation();\r\n\t\ttoggleList(!config.open);\r\n\t});\r\n\r\n\ttoggleList(config.open);\r\n\r\n\treturn el;\r\n};","import RowComponent from '../../../../core/row/RowComponent.js';\r\n\r\nexport default function(cell, formatterParams, onRendered){\r\n\tvar checkbox = document.createElement(\"input\");\r\n\tvar blocked = false;\r\n\r\n\tcheckbox.type = 'checkbox';\r\n\r\n\tcheckbox.setAttribute(\"aria-label\", \"Select Row\");\r\n\t\r\n\tif(this.table.modExists(\"selectRow\", true)){\r\n\r\n\t\tcheckbox.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tif(typeof cell.getRow == 'function'){\r\n\t\t\tvar row = cell.getRow();\r\n\r\n\t\t\tif(row instanceof RowComponent){\r\n\r\n\t\t\t\tcheckbox.addEventListener(\"change\", (e) => {\r\n\t\t\t\t\tif(this.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\t\tif(!blocked){\r\n\t\t\t\t\t\t\trow.toggleSelect();\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tblocked = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trow.toggleSelect();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(this.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\tcheckbox.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\tblocked = true;\r\n\t\t\t\t\t\tthis.table.modules.selectRow.handleComplexRowClick(row._row, e);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcheckbox.checked = row.isSelected && row.isSelected();\r\n\t\t\t\tthis.table.modules.selectRow.registerRowSelectCheckbox(row, checkbox);\r\n\t\t\t}else{\r\n\t\t\t\tcheckbox = \"\";\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\tcheckbox.addEventListener(\"change\", (e) => {\r\n\t\t\t\tif(this.table.modules.selectRow.selectedRows.length){\r\n\t\t\t\t\tthis.table.deselectRow();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis.table.selectRow(formatterParams.rowRange);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.table.modules.selectRow.registerHeaderSelectCheckbox(checkbox);\r\n\t\t}\r\n\t}\r\n\r\n\treturn checkbox;\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultFormatters from './defaults/formatters.js';\r\n\r\nclass Format extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.registerColumnOption(\"formatter\");\r\n\t\tthis.registerColumnOption(\"formatterParams\");\r\n\r\n\t\tthis.registerColumnOption(\"formatterPrint\");\r\n\t\tthis.registerColumnOption(\"formatterPrintParams\");\r\n\t\tthis.registerColumnOption(\"formatterClipboard\");\r\n\t\tthis.registerColumnOption(\"formatterClipboardParams\");\r\n\t\tthis.registerColumnOption(\"formatterHtmlOutput\");\r\n\t\tthis.registerColumnOption(\"formatterHtmlOutputParams\");\r\n\t\tthis.registerColumnOption(\"titleFormatter\");\r\n\t\tthis.registerColumnOption(\"titleFormatterParams\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-format\", this.formatValue.bind(this));\r\n\t\tthis.subscribe(\"cell-rendered\", this.cellRendered.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"column-format\", this.formatHeader.bind(this));\r\n\t}\r\n\r\n\t//initialize column formatter\r\n\tinitializeColumn(column){\r\n\t\tcolumn.modules.format = this.lookupFormatter(column, \"\");\r\n\r\n\t\tif(typeof column.definition.formatterPrint !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.print = this.lookupFormatter(column, \"Print\");\r\n\t\t}\r\n\r\n\t\tif(typeof column.definition.formatterClipboard !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.clipboard = this.lookupFormatter(column, \"Clipboard\");\r\n\t\t}\r\n\r\n\t\tif(typeof column.definition.formatterHtmlOutput !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.htmlOutput = this.lookupFormatter(column, \"HtmlOutput\");\r\n\t\t}\r\n\t}\r\n\r\n\tlookupFormatter(column, type){\r\n\t\tvar config = {params:column.definition[\"formatter\" + type + \"Params\"] || {}},\r\n\t\tformatter = column.definition[\"formatter\" + type];\r\n\r\n\t\t//set column formatter\r\n\t\tswitch(typeof formatter){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(Format.formatters[formatter]){\r\n\t\t\t\tconfig.formatter = Format.formatters[formatter];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Formatter Error - No such formatter found: \", formatter);\r\n\t\t\t\tconfig.formatter = Format.formatters.plaintext;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tconfig.formatter = formatter;\r\n\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\tconfig.formatter = Format.formatters.plaintext;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn config;\r\n\t}\r\n\r\n\tcellRendered(cell){\r\n\t\tif(cell.modules.format && cell.modules.format.renderedCallback && !cell.modules.format.rendered){\r\n\t\t\tcell.modules.format.renderedCallback();\r\n\t\t\tcell.modules.format.rendered = true;\r\n\t\t}\r\n\t}\r\n\r\n\t//return a formatted value for a column header\r\n\tformatHeader(column, title, el){\r\n\t\tvar formatter, params, onRendered, mockCell;\r\n\r\n\t\tif(column.definition.titleFormatter){\r\n\t\t\tformatter = this.getFormatter(column.definition.titleFormatter);\r\n\r\n\t\t\tonRendered = (callback) => {\r\n\t\t\t\tcolumn.titleFormatterRendered = callback;\r\n\t\t\t};\r\n\r\n\t\t\tmockCell = {\r\n\t\t\t\tgetValue:function(){\r\n\t\t\t\t\treturn title;\r\n\t\t\t\t},\r\n\t\t\t\tgetElement:function(){\r\n\t\t\t\t\treturn el;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\tparams = column.definition.titleFormatterParams || {};\r\n\r\n\t\t\tparams = typeof params === \"function\" ? params() : params;\r\n\r\n\t\t\treturn formatter.call(this, mockCell, params, onRendered);\r\n\t\t}else{\r\n\t\t\treturn title;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t//return a formatted value for a cell\r\n\tformatValue(cell){\r\n\t\tvar component = cell.getComponent(),\r\n\t\tparams = typeof cell.column.modules.format.params === \"function\" ? cell.column.modules.format.params(component) : cell.column.modules.format.params;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\tif(!cell.modules.format){\r\n\t\t\t\tcell.modules.format = {};\r\n\t\t\t}\r\n\r\n\t\t\tcell.modules.format.renderedCallback = callback;\r\n\t\t\tcell.modules.format.rendered = false;\r\n\t\t}\r\n\r\n\t\treturn cell.column.modules.format.formatter.call(this, component, params, onRendered);\r\n\t}\r\n\r\n\tformatExportValue(cell, type){\r\n\t\tvar formatter = cell.column.modules.format[type],\r\n\t\tparams;\r\n\r\n\t\tif(formatter){\r\n\t\t\tparams = typeof formatter.params === \"function\" ? formatter.params(component) : formatter.params;\r\n\r\n\t\t\tfunction onRendered(callback){\r\n\t\t\t\tif(!cell.modules.format){\r\n\t\t\t\t\tcell.modules.format = {};\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcell.modules.format.renderedCallback = callback;\r\n\t\t\t\tcell.modules.format.rendered = false;\r\n\t\t\t}\r\n\r\n\t\t\treturn formatter.formatter.call(this, cell.getComponent(), params, onRendered);\r\n\r\n\t\t}else{\r\n\t\t\treturn this.formatValue(cell);\r\n\t\t}\r\n\t}\r\n\r\n\tsanitizeHTML(value){\r\n\t\tif(value){\r\n\t\t\tvar entityMap = {\r\n\t\t\t\t'&': '&',\r\n\t\t\t\t'<': '<',\r\n\t\t\t\t'>': '>',\r\n\t\t\t\t'\"': '"',\r\n\t\t\t\t\"'\": ''',\r\n\t\t\t\t'/': '/',\r\n\t\t\t\t'`': '`',\r\n\t\t\t\t'=': '='\r\n\t\t\t};\r\n\r\n\t\t\treturn String(value).replace(/[&<>\"'`=\\/]/g, function (s) {\r\n\t\t\t\treturn entityMap[s];\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn value;\r\n\t\t}\r\n\t}\r\n\r\n\temptyToSpace(value){\r\n\t\treturn value === null || typeof value === \"undefined\" || value === \"\" ? \" \" : value;\r\n\t}\r\n\r\n\t//get formatter for cell\r\n\tgetFormatter(formatter){\r\n\t\tvar formatter;\r\n\r\n\t\tswitch(typeof formatter){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(Format.formatters[formatter]){\r\n\t\t\t\tformatter = Format.formatters[formatter]\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Formatter Error - No such formatter found: \", formatter);\r\n\t\t\t\tformatter = Format.formatters.plaintext;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tformatter = formatter;\r\n\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\tformatter = Format.formatters.plaintext;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn formatter;\r\n\t}\r\n}\r\n\r\nFormat.moduleName = \"format\";\r\n\r\n//load defaults\r\nFormat.formatters = defaultFormatters;\r\n\r\nexport default Format;","import Module from '../../core/Module.js';\r\n\r\nclass FrozenColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.leftColumns = [];\r\n\t\tthis.rightColumns = [];\r\n\t\tthis.leftMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.rightPadding = 0;\r\n\t\tthis.initializationMode = \"left\";\r\n\t\tthis.active = false;\r\n\t\tthis.blocked = true;\r\n\t\t\r\n\t\tthis.registerColumnOption(\"frozen\");\r\n\t}\r\n\t\r\n\t//reset initial state\r\n\treset(){\r\n\t\tthis.initializationMode = \"left\";\r\n\t\tthis.leftColumns = [];\r\n\t\tthis.rightColumns = [];\r\n\t\tthis.leftMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.active = false;\r\n\t\t\r\n\t\tthis.table.columnManager.headersElement.style.marginLeft = 0;\r\n\t\tthis.table.columnManager.element.style.paddingRight = 0;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-layout\", this.layoutCell.bind(this));\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"column-width\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"row-layout-after\", this.layoutRow.bind(this));\r\n\t\tthis.subscribe(\"table-layout\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"columns-loading\", this.reset.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"column-add\", this.reinitializeColumns.bind(this));\r\n\t\tthis.subscribe(\"column-delete\", this.reinitializeColumns.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"table-redraw\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"layout-refreshing\", this.blockLayout.bind(this));\r\n\t\tthis.subscribe(\"layout-refreshed\", this.unblockLayout.bind(this));\r\n\t}\r\n\t\r\n\tblockLayout(){\r\n\t\tthis.blocked = true;\r\n\t}\r\n\t\r\n\tunblockLayout(){\r\n\t\tthis.blocked = false;\r\n\t}\r\n\t\r\n\tlayoutCell(cell){\r\n\t\tthis.layoutElement(cell.element, cell.column)\r\n\t}\r\n\t\r\n\treinitializeColumns(){\r\n\t\tthis.reset();\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//initialize specific column\r\n\tinitializeColumn(column){\r\n\t\tvar config = {margin:0, edge:false};\r\n\t\t\r\n\t\tif(!column.isGroup){\r\n\t\t\t\r\n\t\t\tif(this.frozenCheck(column)){\r\n\t\t\t\t\r\n\t\t\t\tconfig.position = this.initializationMode;\r\n\t\t\t\t\r\n\t\t\t\tif(this.initializationMode == \"left\"){\r\n\t\t\t\t\tthis.leftColumns.push(column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.rightColumns.unshift(column);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.active = true;\r\n\t\t\t\t\r\n\t\t\t\tcolumn.modules.frozen = config;\r\n\t\t\t}else{\r\n\t\t\t\tthis.initializationMode = \"right\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tfrozenCheck(column){\r\n\t\tif(column.parent.isGroup && column.definition.frozen){\r\n\t\t\tconsole.warn(\"Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups\");\r\n\t\t}\r\n\t\t\r\n\t\tif(column.parent.isGroup){\r\n\t\t\treturn this.frozenCheck(column.parent);\r\n\t\t}else{\r\n\t\t\treturn column.definition.frozen;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//quick layout to smooth horizontal scrolling\r\n\tscrollHorizontal(){\r\n\t\tvar rows;\r\n\t\t\r\n\t\tif(this.active){\t\t\r\n\t\t\tthis.calcMargins(true);\r\n\t\t\t\r\n\t\t\tthis.layoutColumnPosition();\r\n\t\t\t\r\n\t\t\tthis.layoutCalcRows();\r\n\t\t\t\r\n\t\t\tthis.reinitializeRows();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//calculate margins for rows\r\n\tcalcMargins(scroll){\r\n\t\t\r\n\t\tif(!scroll){\r\n\t\t\tthis.leftMargin = this._calcSpace(this.leftColumns, this.leftColumns.length) + \"px\";\t\t\t\r\n\t\t\tthis.rightMargin = this._calcSpace(this.rightColumns, this.rightColumns.length) + \"px\";\t\r\n\t\t\tthis.table.rowManager.tableElement.style.marginRight = this.rightMargin;\r\n\t\t}\r\n\t\t\r\n\t\t//calculate right frozen columns\r\n\t\tthis.rightPadding = this.table.rowManager.element.clientWidth + this.table.columnManager.scrollLeft;\r\n\t}\r\n\t\r\n\t//layout calculation rows\r\n\tlayoutCalcRows(){\r\n\t\tif(this.table.modExists(\"columnCalcs\")){\r\n\t\t\tif(this.table.modules.columnCalcs.topInitialized && this.table.modules.columnCalcs.topRow){\r\n\t\t\t\tthis.layoutRow(this.table.modules.columnCalcs.topRow);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.modules.columnCalcs.botInitialized && this.table.modules.columnCalcs.botRow){\r\n\t\t\t\tthis.layoutRow(this.table.modules.columnCalcs.botRow);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.modExists(\"groupRows\")){\r\n\t\t\t\tthis.layoutGroupCalcs(this.table.modules.groupRows.getGroups())\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tlayoutGroupCalcs(groups){\r\n\t\tgroups.forEach((group) => {\r\n\t\t\tif(group.calcs.top){\r\n\t\t\t\tthis.layoutRow(group.calcs.top);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(group.calcs.bottom){\r\n\t\t\t\tthis.layoutRow(group.calcs.bottom);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(group.groupList && group.groupList.length){\r\n\t\t\t\tthis.layoutGroupCalcs(group.groupList && group.groupList);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//calculate column positions and layout headers\r\n\tlayoutColumnPosition(allCells){\r\n\t\tvar leftParents = [];\r\n\t\t\r\n\t\tvar leftMargin = 0;\r\n\t\tvar rightMargin = 0;\r\n\t\t\r\n\t\tthis.table.columnManager.headersElement.style.marginLeft = this.leftMargin;\r\n\t\tthis.table.columnManager.element.style.paddingRight = this.rightMargin;\r\n\t\t\r\n\t\tthis.leftColumns.forEach((column, i) => {\t\r\n\t\t\tcolumn.modules.frozen.marginValue = leftMargin + this.table.columnManager.scrollLeft;\r\n\t\t\tcolumn.modules.frozen.margin = column.modules.frozen.marginValue + \"px\";\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\tleftMargin += column.getWidth();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(i == this.leftColumns.length - 1){\r\n\t\t\t\tcolumn.modules.frozen.edge = true;\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.modules.frozen.edge = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(column.parent.isGroup){\r\n\t\t\t\tvar parentEl = this.getColGroupParentElement(column);\r\n\t\t\t\tif(!leftParents.includes(parentEl)){\r\n\t\t\t\t\tthis.layoutElement(parentEl, column);\r\n\t\t\t\t\tleftParents.push(parentEl);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(column.modules.frozen.edge){\r\n\t\t\t\t\tparentEl.classList.add(\"tabulator-frozen-\" + column.modules.frozen.position);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.layoutElement(column.getElement(), column);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(allCells){\r\n\t\t\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.rightColumns.forEach((column, i) => {\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\trightMargin += column.getWidth();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.frozen.marginValue = this.rightPadding - rightMargin;\r\n\t\t\tcolumn.modules.frozen.margin = column.modules.frozen.marginValue + \"px\";\r\n\t\t\t\r\n\t\t\tif(i == this.rightColumns.length - 1){\r\n\t\t\t\tcolumn.modules.frozen.edge = true;\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.modules.frozen.edge = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif(column.parent.isGroup){\r\n\t\t\t\tthis.layoutElement(this.getColGroupParentElement(column), column);\r\n\t\t\t}else{\r\n\t\t\t\tthis.layoutElement(column.getElement(), column);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(allCells){\r\n\t\t\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetColGroupParentElement(column){\r\n\t\treturn column.parent.isGroup ? this.getColGroupParentElement(column.parent) : column.getElement();\r\n\t}\r\n\t\r\n\t//layout columns appropriately\r\n\tlayout(){\t\r\n\t\tif(this.active && !this.blocked){\r\n\t\t\t//calculate row padding\r\n\t\t\tthis.calcMargins();\r\n\t\t\t\r\n\t\t\t//calculate left columns\r\n\t\t\tthis.layoutColumnPosition();\r\n\r\n\t\t\tthis.reinitializeRows();\r\n\t\t\t\r\n\t\t\tthis.layoutCalcRows();\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeRows(){\r\n\t\tvar visibleRows = this.table.rowManager.getVisibleRows();\r\n\t\tvar otherRows = this.table.rowManager.getRows().filter(row => !visibleRows.includes(row));\r\n\r\n\t\totherRows.forEach((row) =>{\r\n\t\t\trow.deinitialize();\r\n\t\t});\r\n\t\t\r\n\t\tvisibleRows.forEach((row) =>{\r\n\t\t\tif(row.type === \"row\"){\r\n\t\t\t\tthis.layoutRow(row);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tlayoutRow(row){\r\n\t\t// console.trace(\"row\")\r\n\t\tvar rowEl = row.getElement();\r\n\t\t\r\n\t\trowEl.style.paddingLeft = this.leftMargin;\r\n\t\t\r\n\t\tif(this.table.options.layout === \"fitDataFill\" && this.rightColumns.length){\r\n\t\t\tthis.table.rowManager.getTableElement().style.minWidth = \"calc(100% - \" + this.rightMargin + \")\";\r\n\t\t}\r\n\t\t\r\n\t\tthis.leftColumns.forEach((column) => {\r\n\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\r\n\t\t\tif(cell){\r\n\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.rightColumns.forEach((column) => {\r\n\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\r\n\t\t\tif(cell){\r\n\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tlayoutElement(element, column){\r\n\t\t\r\n\t\tif(column.modules.frozen){\r\n\t\t\telement.style.position = \"absolute\";\r\n\t\t\telement.style.left = column.modules.frozen.margin;\r\n\t\t\t\r\n\t\t\telement.classList.add(\"tabulator-frozen\");\r\n\t\t\t\r\n\t\t\tif(column.modules.frozen.edge){\r\n\t\t\t\telement.classList.add(\"tabulator-frozen-\" + column.modules.frozen.position);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_calcSpace(columns, index){\r\n\t\tvar width = 0;\r\n\t\t\r\n\t\tfor (let i = 0; i < index; i++){\r\n\t\t\tif(columns[i].visible){\r\n\t\t\t\twidth += columns[i].getWidth();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn width;\r\n\t}\r\n}\r\n\r\nFrozenColumns.moduleName = \"frozenColumns\";\r\n\r\nexport default FrozenColumns;","import Module from '../../core/Module.js';\r\n\r\nclass FrozenRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.topElement = document.createElement(\"div\");\r\n\t\tthis.rows = [];\r\n\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"freeze\", this.freezeRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"unfreeze\", this.unfreezeRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isFrozen\", this.isRowFrozen.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.rows = [];\r\n\r\n\t\tthis.topElement.classList.add(\"tabulator-frozen-rows-holder\");\r\n\r\n\t\t// this.table.columnManager.element.append(this.topElement);\r\n\t\tthis.table.columnManager.getElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling);\r\n\r\n\t\tthis.subscribe(\"row-deleting\", this.detachRow.bind(this));\r\n\t\tthis.subscribe(\"rows-visible\", this.visibleRows.bind(this));\r\n\r\n\t\tthis.registerDisplayHandler(this.getRows.bind(this), 10);\r\n\t}\r\n\r\n\tisRowFrozen(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\t\treturn index > -1;\r\n\t}\r\n\r\n\tisFrozen(){\r\n\t\treturn !!this.rows.length;\r\n\t}\r\n\r\n\tvisibleRows(viewable, rows){\r\n\t\tthis.rows.forEach((row) => {\r\n\t\t\trows.push(row);\r\n\t\t});\r\n\r\n\t\treturn rows;\r\n\t}\r\n\r\n\t//filter frozen rows out of display data\r\n\tgetRows(rows){\r\n\t\tvar self = this,\r\n\t\tfrozen = [],\r\n\t\toutput = rows.slice(0);\r\n\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\tvar index = output.indexOf(row);\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\toutput.splice(index, 1);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tfreezeRow(row){\r\n\t\tif(!row.modules.frozen){\r\n\t\t\trow.modules.frozen = true;\r\n\t\t\tthis.topElement.appendChild(row.getElement());\r\n\t\t\trow.initialize();\r\n\t\t\trow.normalizeHeight();\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\tthis.rows.push(row);\r\n\r\n\t\t\tthis.refreshData(false, \"display\")\r\n\r\n\t\t\tthis.styleRows();\r\n\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Freeze Error - Row is already frozen\");\r\n\t\t}\r\n\t}\r\n\r\n\tunfreezeRow(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\r\n\t\tif(row.modules.frozen){\r\n\r\n\t\t\trow.modules.frozen = false;\r\n\r\n\t\t\tthis.detachRow(row);\r\n\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\tthis.refreshData(false, \"display\")\r\n\r\n\t\t\tif(this.rows.length){\r\n\t\t\t\tthis.styleRows();\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Freeze Error - Row is already unfrozen\");\r\n\t\t}\r\n\t}\r\n\r\n\tdetachRow(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tvar rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\r\n\t\t\tthis.rows.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\tstyleRows(row){\r\n\t\tthis.rows.forEach((row, i) => {\r\n\t\t\tthis.table.rowManager.styleRow(row, i);\r\n\t\t});\r\n\t}\r\n}\r\n\r\nFrozenRows.moduleName = \"frozenRows\";\r\n\r\nexport default FrozenRows;","//public group object\r\nclass GroupComponent {\r\n\tconstructor (group){\r\n\t\tthis._group = group;\r\n\t\tthis.type = \"GroupComponent\";\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._group.groupManager.table.componentFunctionBinder.handle(\"row\", target._group, name)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\tgetKey(){\r\n\t\treturn this._group.key;\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._group.field;\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._group.element;\r\n\t}\r\n\r\n\tgetRows(){\r\n\t\treturn this._group.getRows(true);\r\n\t}\r\n\r\n\tgetSubGroups(){\r\n\t\treturn this._group.getSubGroups(true);\r\n\t}\r\n\r\n\tgetParentGroup(){\r\n\t\treturn this._group.parent ? this._group.parent.getComponent() : false;\r\n\t}\r\n\r\n\tisVisible(){\r\n\t\treturn this._group.visible;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tthis._group.show();\r\n\t}\r\n\r\n\thide(){\r\n\t\tthis._group.hide();\r\n\t}\r\n\r\n\ttoggle(){\r\n\t\tthis._group.toggleVisibility();\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._group;\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._group.groupManager.table;\r\n\t}\r\n}\r\n\r\nexport default GroupComponent;","import Helpers from '../../core/tools/Helpers.js';\r\nimport GroupComponent from './GroupComponent.js';\r\n\r\n//Group functions\r\nclass Group{\r\n\t\r\n\tconstructor(groupManager, parent, level, key, field, generator, oldGroup){\r\n\t\tthis.groupManager = groupManager;\r\n\t\tthis.parent = parent;\r\n\t\tthis.key = key;\r\n\t\tthis.level = level;\r\n\t\tthis.field = field;\r\n\t\tthis.hasSubGroups = level < (groupManager.groupIDLookups.length - 1);\r\n\t\tthis.addRow = this.hasSubGroups ? this._addRowToGroup : this._addRow;\r\n\t\tthis.type = \"group\"; //type of element\r\n\t\tthis.old = oldGroup;\r\n\t\tthis.rows = [];\r\n\t\tthis.groups = [];\r\n\t\tthis.groupList = [];\r\n\t\tthis.generator = generator;\r\n\t\tthis.element = false;\r\n\t\tthis.elementContents = false;\r\n\t\tthis.height = 0;\r\n\t\tthis.outerHeight = 0;\r\n\t\tthis.initialized = false;\r\n\t\tthis.calcs = {};\r\n\t\tthis.initialized = false;\r\n\t\tthis.modules = {};\r\n\t\tthis.arrowElement = false;\r\n\t\t\r\n\t\tthis.visible = oldGroup ? oldGroup.visible : (typeof groupManager.startOpen[level] !== \"undefined\" ? groupManager.startOpen[level] : groupManager.startOpen[0]);\r\n\t\t\r\n\t\tthis.component = null;\r\n\t\t\r\n\t\tthis.createElements();\r\n\t\tthis.addBindings();\r\n\t\t\r\n\t\tthis.createValueGroups();\r\n\t}\r\n\t\r\n\twipe(){\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\tgroup.wipe();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\tif(row.modules){\r\n\t\t\t\t\tdelete row.modules.group;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tthis.element = false;\r\n\t\tthis.arrowElement = false;\r\n\t\tthis.elementContents = false;\r\n\t}\r\n\t\r\n\tcreateElements(){\r\n\t\tvar arrow = document.createElement(\"div\");\r\n\t\tarrow.classList.add(\"tabulator-arrow\");\r\n\t\t\r\n\t\tthis.element = document.createElement(\"div\");\r\n\t\tthis.element.classList.add(\"tabulator-row\");\r\n\t\tthis.element.classList.add(\"tabulator-group\");\r\n\t\tthis.element.classList.add(\"tabulator-group-level-\" + this.level);\r\n\t\tthis.element.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\tthis.arrowElement = document.createElement(\"div\");\r\n\t\tthis.arrowElement.classList.add(\"tabulator-group-toggle\");\r\n\t\tthis.arrowElement.appendChild(arrow);\r\n\t\t\r\n\t\t//setup movable rows\r\n\t\tif(this.groupManager.table.options.movableRows !== false && this.groupManager.table.modExists(\"moveRow\")){\r\n\t\t\tthis.groupManager.table.modules.moveRow.initializeGroupHeader(this);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcreateValueGroups(){\r\n\t\tvar level = this.level + 1;\r\n\t\tif(this.groupManager.allowedValues && this.groupManager.allowedValues[level]){\r\n\t\t\tthis.groupManager.allowedValues[level].forEach((value) => {\r\n\t\t\t\tthis._createGroup(value, level);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\taddBindings(){\r\n\t\tvar toggleElement;\r\n\t\t\r\n\t\tif(this.groupManager.table.options.groupToggleElement){\r\n\t\t\ttoggleElement = this.groupManager.table.options.groupToggleElement == \"arrow\" ? this.arrowElement : this.element;\r\n\t\t\t\r\n\t\t\ttoggleElement.addEventListener(\"click\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\tthis.toggleVisibility();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\t_createGroup(groupID, level){\r\n\t\tvar groupKey = level + \"_\" + groupID;\r\n\t\tvar group = new Group(this.groupManager, this, level, groupID, this.groupManager.groupIDLookups[level].field, this.groupManager.headerGenerator[level] || this.groupManager.headerGenerator[0], this.old ? this.old.groups[groupKey] : false);\r\n\t\t\r\n\t\tthis.groups[groupKey] = group;\r\n\t\tthis.groupList.push(group);\r\n\t}\r\n\t\r\n\t_addRowToGroup(row){\r\n\t\t\r\n\t\tvar level = this.level + 1;\r\n\t\t\r\n\t\tif(this.hasSubGroups){\r\n\t\t\tvar groupID = this.groupManager.groupIDLookups[level].func(row.getData()),\r\n\t\t\tgroupKey = level + \"_\" + groupID;\r\n\t\t\t\r\n\t\t\tif(this.groupManager.allowedValues && this.groupManager.allowedValues[level]){\r\n\t\t\t\tif(this.groups[groupKey]){\r\n\t\t\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(!this.groups[groupKey]){\r\n\t\t\t\t\tthis._createGroup(groupID, level);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_addRow(row){\r\n\t\tthis.rows.push(row);\r\n\t\trow.modules.group = this;\r\n\t}\r\n\t\r\n\tinsertRow(row, to, after){\r\n\t\tvar data = this.conformRowData({});\r\n\t\t\r\n\t\trow.updateData(data);\r\n\t\t\r\n\t\tvar toIndex = this.rows.indexOf(to);\r\n\t\t\r\n\t\tif(toIndex > -1){\r\n\t\t\tif(after){\r\n\t\t\t\tthis.rows.splice(toIndex+1, 0, row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.splice(toIndex, 0, row);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(after){\r\n\t\t\t\tthis.rows.push(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.unshift(row);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\trow.modules.group = this;\r\n\t\t\r\n\t\tthis.generateGroupHeaderContents();\r\n\t\t\r\n\t\tif(this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\tthis.groupManager.table.modules.columnCalcs.recalcGroup(this);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.updateGroupRows(true);\r\n\t}\r\n\t\r\n\tscrollHeader(left){\r\n\t\tif(this.arrowElement){\r\n\t\t\tthis.arrowElement.style.marginLeft = left;\r\n\t\t\t\r\n\t\t\tthis.groupList.forEach(function(child){\r\n\t\t\t\tchild.scrollHeader(left);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRowIndex(row){}\r\n\t\r\n\t//update row data to match grouping contraints\r\n\tconformRowData(data){\r\n\t\tif(this.field){\r\n\t\t\tdata[this.field] = this.key;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Data Conforming Error - Cannot conform row data to match new group as groupBy is a function\");\r\n\t\t}\r\n\t\t\r\n\t\tif(this.parent){\r\n\t\t\tdata = this.parent.conformRowData(data);\r\n\t\t}\r\n\t\t\r\n\t\treturn data;\r\n\t}\r\n\t\r\n\tremoveRow(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\t\tvar el = row.getElement();\r\n\t\t\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.rows.splice(index, 1);\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.groupManager.table.options.groupValues && !this.rows.length){\r\n\t\t\tif(this.parent){\r\n\t\t\t\tthis.parent.removeGroup(this);\r\n\t\t\t}else{\r\n\t\t\t\tthis.groupManager.removeGroup(this);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tif(el.parentNode){\r\n\t\t\t\tel.parentNode.removeChild(el);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.generateGroupHeaderContents();\r\n\t\t\t\r\n\t\t\tif(this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\t\tthis.groupManager.table.modules.columnCalcs.recalcGroup(this);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveGroup(group){\r\n\t\tvar groupKey = group.level + \"_\" + group.key,\r\n\t\tindex;\r\n\t\t\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tdelete this.groups[groupKey];\r\n\t\t\t\r\n\t\t\tindex = this.groupList.indexOf(group);\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.groupList.splice(index, 1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(!this.groupList.length){\r\n\t\t\t\tif(this.parent){\r\n\t\t\t\t\tthis.parent.removeGroup(this);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.groupManager.removeGroup(this);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetHeadersAndRows(noCalc){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\toutput.push(this);\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(this.visible){\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\t\toutput = output.concat(group.getHeadersAndRows(noCalc));\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tif(!noCalc && this.groupManager.table.options.columnCalcs != \"table\" && this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.modules.columnCalcs.hasTopCalcs()){\r\n\t\t\t\t\tif(this.calcs.top){\r\n\t\t\t\t\t\tthis.calcs.top.detachElement();\r\n\t\t\t\t\t\tthis.calcs.top.deleteCells();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows);\r\n\t\t\t\t\toutput.push(this.calcs.top);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\toutput = output.concat(this.rows);\r\n\t\t\t\t\r\n\t\t\t\tif(!noCalc && this.groupManager.table.options.columnCalcs != \"table\" && this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()){\r\n\t\t\t\t\tif(this.calcs.bottom){\r\n\t\t\t\t\t\tthis.calcs.bottom.detachElement();\r\n\t\t\t\t\t\tthis.calcs.bottom.deleteCells();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows);\r\n\t\t\t\t\toutput.push(this.calcs.bottom);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!this.groupList.length && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\t\t\r\n\t\t\t\tif(this.groupManager.table.modExists(\"columnCalcs\")){\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!noCalc && this.groupManager.table.modules.columnCalcs.hasTopCalcs()){\r\n\t\t\t\t\t\tif(this.calcs.top){\r\n\t\t\t\t\t\t\tthis.calcs.top.detachElement();\r\n\t\t\t\t\t\t\tthis.calcs.top.deleteCells();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.groupManager.table.options.groupClosedShowCalcs){\r\n\t\t\t\t\t\t\tthis.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows);\r\n\t\t\t\t\t\t\toutput.push(this.calcs.top);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!noCalc && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()){\r\n\t\t\t\t\t\tif(this.calcs.bottom){\r\n\t\t\t\t\t\t\tthis.calcs.bottom.detachElement();\r\n\t\t\t\t\t\t\tthis.calcs.bottom.deleteCells();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.groupManager.table.options.groupClosedShowCalcs){\r\n\t\t\t\t\t\t\tthis.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows);\r\n\t\t\t\t\t\t\toutput.push(this.calcs.bottom);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetData(visible, transform){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(!visible || (visible && this.visible)){\r\n\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\toutput.push(row.getData(transform || \"data\"));\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetRowCount(){\r\n\t\tvar count = 0;\r\n\t\t\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\tcount += group.getRowCount();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tcount = this.rows.length;\r\n\t\t}\r\n\t\treturn count;\r\n\t}\r\n\t\r\n\ttoggleVisibility(){\r\n\t\tif(this.visible){\r\n\t\t\tthis.hide();\r\n\t\t}else{\r\n\t\t\tthis.show();\r\n\t\t}\r\n\t}\r\n\t\r\n\thide(){\r\n\t\tthis.visible = false;\r\n\t\t\r\n\t\tif(this.groupManager.table.rowManager.getRenderMode() == \"classic\" && !this.groupManager.table.options.pagination){\r\n\t\t\t\r\n\t\t\tthis.element.classList.remove(\"tabulator-group-visible\");\r\n\t\t\t\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar rows = group.getHeadersAndRows();\r\n\t\t\t\t\t\r\n\t\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\t\trow.detachElement();\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());\r\n\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth();\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.table.externalEvents.dispatch(\"groupVisibilityChanged\", this.getComponent(), false);\r\n\t}\r\n\t\r\n\tshow(){\r\n\t\tthis.visible = true;\r\n\t\t\r\n\t\tif(this.groupManager.table.rowManager.getRenderMode() == \"classic\" && !this.groupManager.table.options.pagination){\r\n\t\t\t\r\n\t\t\tthis.element.classList.add(\"tabulator-group-visible\");\r\n\t\t\t\r\n\t\t\tvar prev = this.generateElement();\r\n\t\t\t\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\t\tvar rows = group.getHeadersAndRows();\r\n\t\t\t\t\t\r\n\t\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\t\tprev.parentNode.insertBefore(rowEl, prev.nextSibling);\r\n\t\t\t\t\t\trow.initialize();\r\n\t\t\t\t\t\tprev = rowEl;\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\tprev.parentNode.insertBefore(rowEl, prev.nextSibling);\r\n\t\t\t\t\trow.initialize();\r\n\t\t\t\t\tprev = rowEl;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());\r\n\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth();\r\n\t\t}else{\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.table.externalEvents.dispatch(\"groupVisibilityChanged\", this.getComponent(), true);\r\n\t}\r\n\t\r\n\t_visSet(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tif(typeof this.visible == \"function\"){\r\n\t\t\t\r\n\t\t\tthis.rows.forEach(function(row){\r\n\t\t\t\tdata.push(row.getData());\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.visible = this.visible(this.key, this.getRowCount(), data, this.getComponent());\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRowGroup(row){\r\n\t\tvar match = false;\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\tvar result = group.getRowGroup(row);\r\n\t\t\t\t\r\n\t\t\t\tif(result){\r\n\t\t\t\t\tmatch = result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tif(this.rows.find(function(item){\r\n\t\t\t\treturn item === row;\r\n\t\t\t})){\r\n\t\t\t\tmatch = this;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn match;\r\n\t}\r\n\t\r\n\tgetSubGroups(component){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.groupList.forEach(function(child){\r\n\t\t\toutput.push(component ? child.getComponent() : child);\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetRows(compoment){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\toutput.push(compoment ? row.getComponent() : row);\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgenerateGroupHeaderContents(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\tdata.push(row.getData());\r\n\t\t});\r\n\t\t\r\n\t\tthis.elementContents = this.generator(this.key, this.getRowCount(), data, this.getComponent());\r\n\t\t\r\n\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\r\n\t\tif(typeof this.elementContents === \"string\"){\r\n\t\t\tthis.element.innerHTML = this.elementContents;\r\n\t\t}else{\r\n\t\t\tthis.element.appendChild(this.elementContents);\r\n\t\t}\r\n\t\t\r\n\t\tthis.element.insertBefore(this.arrowElement, this.element.firstChild);\r\n\t}\r\n\t\r\n\tgetPath(path = []) {\r\n\t\tpath.unshift(this.key);\r\n\t\tif(this.parent) {\r\n\t\t\tthis.parent.getPath(path);\r\n\t\t}\r\n\t\treturn path;\r\n\t}\r\n\t\r\n\t////////////// Standard Row Functions //////////////\r\n\t\r\n\tgetElement(){\r\n\t\treturn this.elementContents ? this.element : this.generateElement();\r\n\t}\r\n\t\r\n\tgenerateElement(){\r\n\t\tthis.addBindings = false;\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(this.visible){\r\n\t\t\tthis.element.classList.add(\"tabulator-group-visible\");\r\n\t\t}else{\r\n\t\t\tthis.element.classList.remove(\"tabulator-group-visible\");\r\n\t\t}\r\n\t\t\r\n\t\tfor(var i = 0; i < this.element.childNodes.length; ++i){\r\n\t\t\tthis.element.childNodes[i].parentNode.removeChild(this.element.childNodes[i]);\r\n\t\t}\r\n\t\t\r\n\t\tthis.generateGroupHeaderContents();\r\n\t\t\r\n\t\t// this.addBindings();\r\n\t\t\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\tdetachElement(){\r\n\t\tif (this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//normalize the height of elements in the row\r\n\tnormalizeHeight(){\r\n\t\tthis.setHeight(this.element.clientHeight);\r\n\t}\r\n\t\r\n\tinitialize(force){\r\n\t\tif(!this.initialized || force){\r\n\t\t\tthis.normalizeHeight();\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitialize(){\r\n\t\tthis.initialized = false;\r\n\t\tthis.height = 0;\r\n\t\t\r\n\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\tthis.initialize(true);\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetHeight(height){\r\n\t\tif(this.height != height){\r\n\t\t\tthis.height = height;\r\n\t\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return rows outer height\r\n\tgetHeight(){\r\n\t\treturn this.outerHeight;\r\n\t}\r\n\t\r\n\tgetGroup(){\r\n\t\treturn this;\r\n\t}\r\n\t\r\n\treinitializeHeight(){}\r\n\t\r\n\tcalcHeight(){}\r\n\t\r\n\tsetCellHeight(){}\r\n\t\r\n\tclearCellHeight(){}\r\n\t\r\n\tdeinitializeHeight(){}\r\n\t\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new GroupComponent(this);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n\r\nexport default Group;","import Module from '../../core/Module.js';\r\n\r\nimport GroupComponent from './GroupComponent.js';\r\nimport Group from './Group.js';\r\n\r\nclass GroupRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.groupIDLookups = false; //enable table grouping and set field to group by\r\n\t\tthis.startOpen = [function(){return false;}]; //starting state of group\r\n\t\tthis.headerGenerator = [function(){return \"\";}];\r\n\t\tthis.groupList = []; //ordered list of groups\r\n\t\tthis.allowedValues = false;\r\n\t\tthis.groups = {}; //hold row groups\r\n\t\tthis.displayIndex = 0; //index in display pipeline\r\n\r\n\t\tthis.displayHandler = this.getRows.bind(this);\r\n\r\n\t\t//register table options\r\n\t\tthis.registerTableOption(\"groupBy\", false); //enable table grouping and set field to group by\r\n\t\tthis.registerTableOption(\"groupStartOpen\", true); //starting state of group\r\n\t\tthis.registerTableOption(\"groupValues\", false);\r\n\t\tthis.registerTableOption(\"groupUpdateOnCellEdit\", false);\r\n\t\tthis.registerTableOption(\"groupHeader\", false); //header generation function\r\n\t\tthis.registerTableOption(\"groupHeaderPrint\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderClipboard\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderHtmlOutput\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderDownload\", null);\r\n\t\tthis.registerTableOption(\"groupToggleElement\", \"arrow\");\r\n\t\tthis.registerTableOption(\"groupClosedShowCalcs\", false);\r\n\r\n\t\t//register table functions\r\n\t\tthis.registerTableFunction(\"setGroupBy\", this.setGroupBy.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupValues\", this.setGroupValues.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupStartOpen\", this.setGroupStartOpen.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupHeader\", this.setGroupHeader.bind(this));\r\n\t\tthis.registerTableFunction(\"getGroups\", this.userGetGroups.bind(this));\r\n\t\tthis.registerTableFunction(\"getGroupedData\", this.userGetGroupedData.bind(this));\r\n\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"getGroup\", this.rowGetGroup.bind(this));\r\n\t}\r\n\r\n\t//initialize group configuration\r\n\tinitialize(){\r\n\t\tif(this.table.options.groupBy){\r\n\r\n\t\t\tif(this.table.options.groupUpdateOnCellEdit){\r\n\t\t\t\tthis.subscribe(\"cell-value-updated\", this.cellUpdated.bind(this));\r\n\t\t\t\tthis.subscribe(\"row-data-changed\", this.reassignRowToGroup.bind(this), 0);\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"table-built\", this.configureGroupSetup.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"row-deleting\", this.rowDeleting.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHeaders.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.wipe.bind(this));\r\n\t\t\tthis.subscribe(\"rows-added\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"row-moving\", this.rowMoving.bind(this));\r\n\t\t\tthis.subscribe(\"row-adding-index\", this.rowAddingIndex.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"rows-sample\", this.rowSample.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"render-virtual-fill\", this.virtualRenderFill.bind(this));\r\n\r\n\t\t\tthis.registerDisplayHandler(this.displayHandler, 20);\r\n\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\r\n\tconfigureGroupSetup(){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tvar groupBy = this.table.options.groupBy,\r\n\t\t\tstartOpen = this.table.options.groupStartOpen,\r\n\t\t\tgroupHeader = this.table.options.groupHeader;\r\n\r\n\t\t\tthis.allowedValues = this.table.options.groupValues;\r\n\r\n\t\t\tif(Array.isArray(groupBy) && Array.isArray(groupHeader) && groupBy.length > groupHeader.length){\r\n\t\t\t\tconsole.warn(\"Error creating group headers, groupHeader array is shorter than groupBy array\");\r\n\t\t\t}\r\n\r\n\t\t\tthis.headerGenerator = [function(){return \"\";}];\r\n\t\t\tthis.startOpen = [function(){return false;}]; //starting state of group\r\n\r\n\t\t\tthis.langBind(\"groups|item\", (langValue, lang) => {\r\n\t\t\t\tthis.headerGenerator[0] = (value, count, data) => { //header layout function\r\n\t\t\t\t\treturn (typeof value === \"undefined\" ? \"\" : value) + \"(\" + count + \" \" + ((count === 1) ? langValue : lang.groups.items) + \")\";\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tthis.groupIDLookups = [];\r\n\r\n\t\t\tif(Array.isArray(groupBy) || groupBy){\r\n\t\t\t\tif(this.table.modExists(\"columnCalcs\") && this.table.options.columnCalcs != \"table\" && this.table.options.columnCalcs != \"both\"){\r\n\t\t\t\t\tthis.table.modules.columnCalcs.removeCalcs();\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.modExists(\"columnCalcs\") && this.table.options.columnCalcs != \"group\"){\r\n\r\n\t\t\t\t\tvar cols = this.table.columnManager.getRealColumns();\r\n\r\n\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\tif(col.definition.topCalc){\r\n\t\t\t\t\t\t\tthis.table.modules.columnCalcs.initializeTopRow();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(col.definition.bottomCalc){\r\n\t\t\t\t\t\t\tthis.table.modules.columnCalcs.initializeBottomRow();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(!Array.isArray(groupBy)){\r\n\t\t\t\tgroupBy = [groupBy];\r\n\t\t\t}\r\n\r\n\t\t\tgroupBy.forEach((group, i) => {\r\n\t\t\t\tvar lookupFunc, column;\r\n\r\n\t\t\t\tif(typeof group == \"function\"){\r\n\t\t\t\t\tlookupFunc = group;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolumn = this.table.columnManager.getColumnByField(group);\r\n\r\n\t\t\t\t\tif(column){\r\n\t\t\t\t\t\tlookupFunc = function(data){\r\n\t\t\t\t\t\t\treturn column.getFieldValue(data);\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tlookupFunc = function(data){\r\n\t\t\t\t\t\t\treturn data[group];\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.groupIDLookups.push({\r\n\t\t\t\t\tfield: typeof group === \"function\" ? false : group,\r\n\t\t\t\t\tfunc:lookupFunc,\r\n\t\t\t\t\tvalues:this.allowedValues ? this.allowedValues[i] : false,\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t\tif(startOpen){\r\n\t\t\t\tif(!Array.isArray(startOpen)){\r\n\t\t\t\t\tstartOpen = [startOpen];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstartOpen.forEach((level) => {\r\n\t\t\t\t\tlevel = typeof level == \"function\" ? level : function(){return true;};\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.startOpen = startOpen;\r\n\t\t\t}\r\n\r\n\t\t\tif(groupHeader){\r\n\t\t\t\tthis.headerGenerator = Array.isArray(groupHeader) ? groupHeader : [groupHeader];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trowSample(rows, prevValue){\r\n\t\tvar group = this.getGroups(false)[0];\r\n\r\n\t\tprevValue.push(group.getRows(false)[0]);\r\n\r\n\t\treturn prevValue;\r\n\t}\r\n\r\n\tvirtualRenderFill(){\r\n\t\tvar el = this.table.rowManager.tableElement;\r\n\t\tvar rows = this.table.rowManager.getVisibleRows();\r\n\r\n\t\trows = rows.filter((row) => {\r\n\t\t\treturn row.type !== \"group\";\r\n\t\t});\r\n\r\n\t\tel.style.minWidth = !rows.length ? this.table.columnManager.getWidth() + \"px\" : \"\";\r\n\r\n\t\t// if(this.table.options.groupBy){\r\n\t\t// \tif(this.layoutMode() != \"fitDataFill\" && rowsCount == this.table.modules.groupRows.countGroups()){\r\n\t\t// \t\tel.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t// \t}\r\n\t\t// }\r\n\t}\r\n\r\n\trowAddingIndex(row, index, top){\r\n\t\tthis.assignRowToGroup(row);\r\n\r\n\t\tvar groupRows = row.modules.group.rows;\r\n\r\n\t\tif(groupRows.length > 1){\r\n\t\t\tif(!index || (index && groupRows.indexOf(index) == -1)){\r\n\t\t\t\tif(top){\r\n\t\t\t\t\tif(groupRows[0] !== row){\r\n\t\t\t\t\t\tindex = groupRows[0];\r\n\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(groupRows[groupRows.length -1] !== row){\r\n\t\t\t\t\t\tindex = groupRows[groupRows.length -1];\r\n\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn index;\r\n\t}\r\n\r\n\ttrackChanges(){\r\n\t\tthis.dispatch(\"group-changed\");\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tsetGroupBy(groups){\r\n\t\tthis.table.options.groupBy = groups;\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.initialize();\r\n\t\t}else{\r\n\t\t\tthis.configureGroupSetup();\r\n\t\t}\r\n\r\n\t\tthis.refreshData();\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\tsetGroupValues(groupValues){\r\n\t\tthis.table.options.groupValues = groupValues;\r\n\t\tthis.configureGroupSetup();\r\n\t\tthis.refreshData();\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\tsetGroupStartOpen(values){\r\n\t\tthis.table.options.groupStartOpen = values;\r\n\t\tthis.configureGroupSetup();\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\r\n\t\t\tthis.trackChanges();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Grouping Update - cant refresh view, no groups have been set\");\r\n\t\t}\r\n\t}\r\n\r\n\tsetGroupHeader(values){\r\n\t\tthis.table.options.groupHeader = values;\r\n\t\tthis.configureGroupSetup();\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\r\n\t\t\tthis.trackChanges();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Grouping Update - cant refresh view, no groups have been set\");\r\n\t\t}\r\n\t}\r\n\r\n\tuserGetGroups(values){\r\n\t\treturn this.getGroups(true);\r\n\t}\r\n\r\n\t// get grouped table data in the same format as getData()\r\n\tuserGetGroupedData(){\r\n\t\treturn this.table.options.groupBy ?\r\n\t\tthis.getGroupedData() : this.getData()\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////////\r\n\t///////// Component Functions /////////\r\n\t///////////////////////////////////////\r\n\r\n\trowGetGroup(row){\r\n\t\treturn row.modules.group ? row.modules.group.getComponent() : false;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\trowMoving(from, to, after){\r\n\t\tif(!after && to instanceof Group){\r\n\t\t\tto = this.table.rowManager.prevDisplayRow(from) || to;\r\n\t\t}\r\n\r\n\t\tvar toGroup = to instanceof Group ? to : to.modules.group;\r\n\t\tvar fromGroup = from instanceof Group ? from : from.modules.group;\r\n\r\n\t\tif(toGroup === fromGroup){\r\n\t\t\tthis.table.rowManager.moveRowInArray(toGroup.rows, from, to, after);\r\n\t\t}else{\r\n\t\t\tif(fromGroup){\r\n\t\t\t\tfromGroup.removeRow(from);\r\n\t\t\t}\r\n\r\n\t\t\ttoGroup.insertRow(from, to, after);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trowDeleting(row){\r\n\t\t//remove from group\r\n\t\tif(row.modules.group){\r\n\t\t\trow.modules.group.removeRow(row);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trowsUpdated(row){\r\n\t\tthis.updateGroupRows(true);\r\n\t}\r\n\r\n\tcellUpdated(cell){\r\n\t\tthis.reassignRowToGroup(cell.row);\r\n\t}\r\n\r\n\r\n\tsetDisplayIndex(index){\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\r\n\tgetDisplayIndex(){\r\n\t\treturn this.displayIndex;\r\n\t}\r\n\r\n\t//return appropriate rows with group headers\r\n\tgetRows(rows){\r\n\t\tif(this.table.options.groupBy && this.groupIDLookups.length){\r\n\r\n\t\t\tthis.dispatchExternal(\"dataGrouping\");\r\n\r\n\t\t\tthis.generateGroups(rows);\r\n\r\n\t\t\tif(this.subscribedExternal(\"dataGrouped\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataGrouped\", this.getGroups(true));\r\n\t\t\t}\r\n\r\n\t\t\treturn this.updateGroupRows();\r\n\r\n\t\t}else{\r\n\t\t\treturn rows.slice(0);\r\n\t\t}\r\n\t}\r\n\r\n\tgetGroups(component){\r\n\t\tvar groupComponents = [];\r\n\r\n\t\tthis.groupList.forEach(function(group){\r\n\t\t\tgroupComponents.push(component ? group.getComponent() : group);\r\n\t\t});\r\n\r\n\t\treturn groupComponents;\r\n\t}\r\n\r\n\tgetChildGroups(group){\r\n\t\tvar groupComponents = [];\r\n\r\n\t\tif(!group){\r\n\t\t\tgroup = this;\r\n\t\t}\r\n\r\n\t\tgroup.groupList.forEach((child) => {\r\n\t\t\tif(child.groupList.length){\r\n\t\t\t\tgroupComponents = groupComponents.concat(this.getChildGroups(child));\r\n\t\t\t}else{\r\n\t\t\t\tgroupComponents.push(child);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn groupComponents;\r\n\t}\r\n\r\n\twipe(){\r\n\t\tthis.groupList.forEach(function(group){\r\n\t\t\tgroup.wipe();\r\n\t\t});\r\n\t}\r\n\r\n\tpullGroupListData(groupList) {\r\n\t\tvar groupListData = [];\r\n\r\n\t\tgroupList.forEach((group) => {\r\n\t\t\tvar groupHeader = {};\r\n\t\t\tgroupHeader.level = 0;\r\n\t\t\tgroupHeader.rowCount = 0;\r\n\t\t\tgroupHeader.headerContent = \"\";\r\n\t\t\tvar childData = [];\r\n\r\n\t\t\tif (group.hasSubGroups) {\r\n\t\t\t\tchildData = this.pullGroupListData(group.groupList);\r\n\r\n\t\t\t\tgroupHeader.level = group.level;\r\n\t\t\t\tgroupHeader.rowCount = childData.length - group.groupList.length; // data length minus number of sub-headers\r\n\t\t\t\tgroupHeader.headerContent = group.generator(group.key, groupHeader.rowCount, group.rows, group);\r\n\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\t\t\t\tgroupListData = groupListData.concat(childData);\r\n\t\t\t}\r\n\r\n\t\t\telse {\r\n\t\t\t\tgroupHeader.level = group.level;\r\n\t\t\t\tgroupHeader.headerContent = group.generator(group.key, group.rows.length, group.rows, group);\r\n\t\t\t\tgroupHeader.rowCount = group.getRows().length;\r\n\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\r\n\t\t\t\tgroup.getRows().forEach((row) => {\r\n\t\t\t\t\tgroupListData.push(row.getData(\"data\"));\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn groupListData\r\n\t}\r\n\r\n\tgetGroupedData(){\r\n\r\n\t\treturn this.pullGroupListData(this.groupList);\r\n\t}\r\n\r\n\tgetRowGroup(row){\r\n\t\tvar match = false;\r\n\r\n\t\tif(this.options(\"dataTree\")){\r\n\t\t\trow = this.table.modules.dataTree.getTreeParentRoot(row);\r\n\t\t}\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\tvar result = group.getRowGroup(row);\r\n\r\n\t\t\tif(result){\r\n\t\t\t\tmatch = result;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tcountGroups(){\r\n\t\treturn this.groupList.length;\r\n\t}\r\n\r\n\tgenerateGroups(rows){\r\n\t\tvar oldGroups = this.groups;\r\n\r\n\t\tthis.groups = {};\r\n\t\tthis.groupList = [];\r\n\r\n\t\tif(this.allowedValues && this.allowedValues[0]){\r\n\t\t\tthis.allowedValues[0].forEach((value) => {\r\n\t\t\t\tthis.createGroup(value, 0, oldGroups);\r\n\t\t\t});\r\n\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.assignRowToExistingGroup(row, oldGroups);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.assignRowToGroup(row, oldGroups);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tcreateGroup(groupID, level, oldGroups){\r\n\t\tvar groupKey = level + \"_\" + groupID,\r\n\t\tgroup;\r\n\r\n\t\toldGroups = oldGroups || [];\r\n\r\n\t\tgroup = new Group(this, false, level, groupID, this.groupIDLookups[0].field, this.headerGenerator[0], oldGroups[groupKey]);\r\n\r\n\t\tthis.groups[groupKey] = group;\r\n\t\tthis.groupList.push(group);\r\n\t}\r\n\r\n\tassignRowToExistingGroup(row, oldGroups){\r\n\t\tvar groupID = this.groupIDLookups[0].func(row.getData()),\r\n\t\tgroupKey = \"0_\" + groupID;\r\n\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t}\r\n\t}\r\n\r\n\tassignRowToGroup(row, oldGroups){\r\n\t\tvar groupID = this.groupIDLookups[0].func(row.getData()),\r\n\t\tnewGroupNeeded = !this.groups[\"0_\" + groupID];\r\n\r\n\t\tif(newGroupNeeded){\r\n\t\t\tthis.createGroup(groupID, 0, oldGroups);\r\n\t\t}\r\n\r\n\t\tthis.groups[\"0_\" + groupID].addRow(row);\r\n\r\n\t\treturn !newGroupNeeded;\r\n\t}\r\n\r\n\treassignRowToGroup(row){\r\n\t\tif(row.type === \"row\"){\r\n\t\t\tvar oldRowGroup = row.modules.group,\r\n\t\t\toldGroupPath = oldRowGroup.getPath(),\r\n\t\t\tnewGroupPath = this.getExpectedPath(row),\r\n\t\t\tsamePath = true;\r\n\r\n\t\t\t// figure out if new group path is the same as old group path\r\n\t\t\tvar samePath = (oldGroupPath.length == newGroupPath.length) && oldGroupPath.every((element, index) => {\r\n\t\t\t\treturn element === newGroupPath[index];\r\n\t\t\t});\r\n\r\n\t\t\t// refresh if they new path and old path aren't the same (aka the row's groupings have changed)\r\n\t\t\tif(!samePath) {\r\n\t\t\t\toldRowGroup.removeRow(row);\r\n\t\t\t\tthis.assignRowToGroup(row, this.groups);\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgetExpectedPath(row) {\r\n\t\tvar groupPath = [], rowData = row.getData();\r\n\r\n\t\tthis.groupIDLookups.forEach((groupId) => {\r\n\t\t\tgroupPath.push(groupId.func(rowData));\r\n\t\t});\r\n\r\n\t\treturn groupPath;\r\n\t}\r\n\r\n\tupdateGroupRows(force){\r\n\t\tvar output = [],\r\n\t\toldRowCount;\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\toutput = output.concat(group.getHeadersAndRows());\r\n\t\t});\r\n\r\n\t\tif(force){\r\n\t\t\tthis.refreshData(true, this.displayHandler);\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tscrollHeaders(left){\r\n\t\tif(this.table.options.renderHorizontal === \"virtual\"){\r\n\t\t\tleft -= this.table.columnManager.renderer.vDomPadLeft;\r\n\t\t}\r\n\r\n\t\tleft = left + \"px\";\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\tgroup.scrollHeader(left);\r\n\t\t});\r\n\t}\r\n\r\n\tremoveGroup(group){\r\n\t\tvar groupKey = group.level + \"_\" + group.key,\r\n\t\tindex;\r\n\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tdelete this.groups[groupKey];\r\n\r\n\t\t\tindex = this.groupList.indexOf(group);\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.groupList.splice(index, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nGroupRows.moduleName = \"groupRows\";\r\n\r\nexport default GroupRows;","import Module from '../../core/Module.js';\r\nimport Row from '../../core/row/Row.js';\r\nimport Cell from '../../core/cell/Cell.js';\r\n\r\nimport defaultUndoers from './defaults/undoers.js';\r\nimport defaultRedoers from './defaults/redoers.js';\r\n\r\nclass History extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.history = [];\r\n\t\tthis.index = -1;\r\n\r\n\t\tthis.registerTableOption(\"history\", false); //enable edit history\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.history){\r\n\t\t\tthis.subscribe(\"cell-value-updated\", this.cellUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"cell-delete\", this.clearComponentHistory.bind(this));\r\n\t\t\tthis.subscribe(\"row-delete\", this.rowDeleted.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.clear.bind(this));\r\n\t\t\tthis.subscribe(\"row-added\", this.rowAdded.bind(this));\r\n\t\t\tthis.subscribe(\"row-move\", this.rowMoved.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"undo\", this.undo.bind(this));\r\n\t\tthis.registerTableFunction(\"redo\", this.redo.bind(this));\r\n\t\tthis.registerTableFunction(\"getHistoryUndoSize\", this.getHistoryUndoSize.bind(this));\r\n\t\tthis.registerTableFunction(\"getHistoryRedoSize\", this.getHistoryRedoSize.bind(this));\r\n\t\tthis.registerTableFunction(\"clearHistory\", this.clear.bind(this));\r\n\t}\r\n\r\n\trowMoved(from, to, after){\r\n\t\tthis.action(\"rowMove\", from, {posFrom:this.table.rowManager.getRowPosition(from), posTo:this.table.rowManager.getRowPosition(to), to:to, after:after});\r\n\t}\r\n\r\n\trowAdded(row, data, pos, index){\r\n\t\tthis.action(\"rowAdd\", row, {data:data, pos:pos, index:index});\r\n\t}\r\n\r\n\trowDeleted(row){\r\n\t\tvar index, rows;\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\r\n\t\t\trows = row.getComponent().getGroup().rows\r\n\t\t\tindex = rows.indexOf(row);\r\n\r\n\t\t\tif(index){\r\n\t\t\t\tindex = rows[index-1];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tindex = row.table.rowManager.getRowIndex(row);\r\n\r\n\t\t\tif(index){\r\n\t\t\t\tindex = row.table.rowManager.rows[index-1];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.action(\"rowDelete\", row, {data:row.getData(), pos:!index, index:index});\r\n\t}\r\n\r\n\tcellUpdated(cell){\r\n\t\tthis.action(\"cellEdit\", cell, {oldValue:cell.oldValue, newValue:cell.value});\r\n\t}\r\n\r\n\tclear(){\r\n\t\tthis.history = [];\r\n\t\tthis.index = -1;\r\n\t}\r\n\r\n\taction(type, component, data){\r\n\t\tthis.history = this.history.slice(0, this.index + 1);\r\n\r\n\t\tthis.history.push({\r\n\t\t\ttype:type,\r\n\t\t\tcomponent:component,\r\n\t\t\tdata:data,\r\n\t\t});\r\n\r\n\t\tthis.index ++;\r\n\t}\r\n\r\n\tgetHistoryUndoSize(){\r\n\t\treturn this.index + 1;\r\n\t}\r\n\r\n\tgetHistoryRedoSize(){\r\n\t\treturn this.history.length - (this.index + 1);\r\n\t}\r\n\r\n\tclearComponentHistory(component){\r\n\t\tvar index = this.history.findIndex(function(item){\r\n\t\t\treturn item.component === component;\r\n\t\t});\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.history.splice(index, 1);\r\n\t\t\tif(index <= this.index){\r\n\t\t\t\tthis.index--;\r\n\t\t\t}\r\n\r\n\t\t\tthis.clearComponentHistory(component);\r\n\t\t}\r\n\t}\r\n\r\n\tundo(){\r\n\t\tif(this.index > -1){\r\n\t\t\tlet action = this.history[this.index];\r\n\r\n\t\t\tHistory.undoers[action.type].call(this, action);\r\n\r\n\t\t\tthis.index--;\r\n\r\n\t\t\tthis.dispatchExternal(\"historyUndo\", action.type, action.component.getComponent(), action.data);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"History Undo Error - No more history to undo\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tredo(){\r\n\t\tif(this.history.length-1 > this.index){\r\n\r\n\t\t\tthis.index++;\r\n\r\n\t\t\tlet action = this.history[this.index];\r\n\r\n\t\t\tHistory.redoers[action.type].call(this, action);\r\n\r\n\t\t\tthis.dispatchExternal(\"historyRedo\", action.type, action.component.getComponent(), action.data);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"History Redo Error - No more history to redo\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//rebind rows to new element after deletion\r\n\t_rebindRow(oldRow, newRow){\r\n\t\tthis.history.forEach(function(action){\r\n\t\t\tif(action.component instanceof Row){\r\n\t\t\t\tif(action.component === oldRow){\r\n\t\t\t\t\taction.component = newRow;\r\n\t\t\t\t}\r\n\t\t\t}else if(action.component instanceof Cell){\r\n\t\t\t\tif(action.component.row === oldRow){\r\n\t\t\t\t\tvar field = action.component.column.getField();\r\n\r\n\t\t\t\t\tif(field){\r\n\t\t\t\t\t\taction.component = newRow.getCell(field);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n\r\nHistory.moduleName = \"history\";\r\n\r\n//load defaults\r\nHistory.undoers = defaultUndoers;\r\nHistory.redoers = defaultRedoers;\r\n\r\nexport default History;","export default {\r\n\tcellEdit: function(action){\r\n\t\taction.component.setValueProcessData(action.data.oldValue);\r\n\t\taction.component.cellRendered();\r\n\t},\r\n\r\n\trowAdd: function(action){\r\n\t\taction.component.deleteActual();\r\n\t},\r\n\r\n\trowDelete: function(action){\r\n\t\tvar newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index);\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tthis.table.modules.groupRows.updateGroupRows(true);\r\n\t\t}\r\n\r\n\t\tthis._rebindRow(action.component, newRow);\r\n\t},\r\n\r\n\trowMove: function(action){\r\n\t\tthis.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posFrom], !action.data.after);\r\n\t\tthis.table.rowManager.redraw();\r\n\t},\r\n};","export default {\r\n\tcellEdit: function(action){\r\n\t\taction.component.setValueProcessData(action.data.newValue);\r\n\t\taction.component.cellRendered();\r\n\t},\r\n\r\n\trowAdd: function(action){\r\n\t\tvar newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index);\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tthis.table.modules.groupRows.updateGroupRows(true);\r\n\t\t}\r\n\r\n\t\tthis._rebindRow(action.component, newRow);\r\n\t},\r\n\r\n\trowDelete:function(action){\r\n\t\taction.component.deleteActual();\r\n\t},\r\n\r\n\trowMove: function(action){\r\n\t\tthis.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posTo], action.data.after);\r\n\t\tthis.table.rowManager.redraw();\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\nimport Column from '../../core/column/Column.js';\r\n\r\nclass HtmlTableImport extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.fieldIndex = [];\r\n\t\tthis.hasIndex = false;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.tableElementCheck();\r\n\t}\r\n\r\n\ttableElementCheck(){\r\n\t\tif(this.table.originalElement && this.table.originalElement.tagName === \"TABLE\"){\r\n\t\t\tif(this.table.originalElement.childNodes.length){\r\n\t\t\t\tthis.parseTable();\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Unable to parse data from empty table tag, Tabulator should be initialized on a div tag unless importing data from a table element.\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tparseTable(){\r\n\t\tvar element = this.table.originalElement,\r\n\t\toptions = this.table.options,\r\n\t\tcolumns = options.columns,\r\n\t\theaders = element.getElementsByTagName(\"th\"),\r\n\t\trows = element.getElementsByTagName(\"tbody\")[0],\r\n\t\tdata = [],\r\n\t\tnewTable;\r\n\r\n\t\tthis.hasIndex = false;\r\n\r\n\t\tthis.dispatchExternal(\"htmlImporting\");\r\n\r\n\t\trows = rows ? rows.getElementsByTagName(\"tr\") : [];\r\n\r\n\t\t//check for Tabulator inline options\r\n\t\tthis._extractOptions(element, options);\r\n\r\n\t\tif(headers.length){\r\n\t\t\tthis._extractHeaders(headers, rows);\r\n\t\t}else{\r\n\t\t\tthis._generateBlankHeaders(headers, rows);\r\n\t\t}\r\n\r\n\t\t//iterate through table rows and build data set\r\n\t\tfor(var index = 0; index < rows.length; index++){\r\n\t\t\tvar row = rows[index],\r\n\t\t\tcells = row.getElementsByTagName(\"td\"),\r\n\t\t\titem = {};\r\n\r\n\t\t\t//create index if the dont exist in table\r\n\t\t\tif(!this.hasIndex){\r\n\t\t\t\titem[options.index] = index;\r\n\t\t\t}\r\n\r\n\t\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\t\tvar cell = cells[i];\r\n\t\t\t\tif(typeof this.fieldIndex[i] !== \"undefined\"){\r\n\t\t\t\t\titem[this.fieldIndex[i]] = cell.innerHTML;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//add row data to item\r\n\t\t\tdata.push(item);\r\n\t\t}\r\n\r\n\t\toptions.data = data;\r\n\r\n\t\tthis.dispatchExternal(\"htmlImported\");\r\n\t}\r\n\r\n\t//extract tabulator attribute options\r\n\t_extractOptions(element, options, defaultOptions){\r\n\t\tvar attributes = element.attributes;\r\n\t\tvar optionsArr = defaultOptions ? Object.keys(defaultOptions) : Object.keys(options);\r\n\t\tvar optionsList = {};\r\n\r\n\t\toptionsArr.forEach((item) => {\r\n\t\t\toptionsList[item.toLowerCase()] = item;\r\n\t\t});\r\n\r\n\t\tfor(var index in attributes){\r\n\t\t\tvar attrib = attributes[index];\r\n\t\t\tvar name;\r\n\r\n\t\t\tif(attrib && typeof attrib == \"object\" && attrib.name && attrib.name.indexOf(\"tabulator-\") === 0){\r\n\t\t\t\tname = attrib.name.replace(\"tabulator-\", \"\");\r\n\r\n\t\t\t\tif(typeof optionsList[name] !== \"undefined\"){\r\n\t\t\t\t\toptions[optionsList[name]] = this._attribValue(attrib.value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//get value of attribute\r\n\t_attribValue(value){\r\n\t\tif(value === \"true\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif(value === \"false\"){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\t//find column if it has already been defined\r\n\t_findCol(title){\r\n\t\tvar match = this.table.options.columns.find((column) => {\r\n\t\t\treturn column.title === title;\r\n\t\t});\r\n\r\n\t\treturn match || false;\r\n\t}\r\n\r\n\t//extract column from headers\r\n\t_extractHeaders(headers, rows){\r\n\t\tfor(var index = 0; index < headers.length; index++){\r\n\t\t\tvar header = headers[index],\r\n\t\t\texists = false,\r\n\t\t\tcol = this._findCol(header.textContent),\r\n\t\t\twidth, attributes;\r\n\r\n\t\t\tif(col){\r\n\t\t\t\texists = true;\r\n\t\t\t}else{\r\n\t\t\t\tcol = {title:header.textContent.trim()};\r\n\t\t\t}\r\n\r\n\t\t\tif(!col.field) {\r\n\t\t\t\tcol.field = header.textContent.trim().toLowerCase().replace(\" \", \"_\");\r\n\t\t\t}\r\n\r\n\t\t\twidth = header.getAttribute(\"width\");\r\n\r\n\t\t\tif(width && !col.width)\t{\r\n\t\t\t\tcol.width = width;\r\n\t\t\t}\r\n\r\n\t\t\t//check for Tabulator inline options\r\n\t\t\tthis._extractOptions(header, col, this.table.columnManager.optionsList.registeredDefaults);\r\n\r\n\t\t\tthis.fieldIndex[index] = col.field;\r\n\r\n\t\t\tif(col.field == this.table.options.index){\r\n\t\t\t\tthis.hasIndex = true;\r\n\t\t\t}\r\n\r\n\t\t\tif(!exists){\r\n\t\t\t\tthis.table.options.columns.push(col);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\r\n\t//generate blank headers\r\n\t_generateBlankHeaders(headers, rows){\r\n\t\tfor(var index = 0; index < headers.length; index++){\r\n\t\t\tvar header = headers[index],\r\n\t\t\tcol = {title:\"\", field:\"col\" + index};\r\n\r\n\t\t\tthis.fieldIndex[index] = col.field;\r\n\r\n\t\t\tvar width = header.getAttribute(\"width\");\r\n\r\n\t\t\tif(width){\r\n\t\t\t\tcol.width = width;\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.options.columns.push(col);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nHtmlTableImport.moduleName = \"htmlTableImport\";\r\n\r\nexport default HtmlTableImport;","import csv from './importers/csv.js';\r\nimport json from './importers/json.js';\r\n\r\nexport default {\r\n\tcsv:csv,\r\n\tjson:json,\r\n};","function csvImporter(input){\r\n var data = [],\r\n row = 0, \r\n col = 0,\r\n inQuote = false;\r\n \r\n //Iterate over each character\r\n for (let index = 0; index < input.length; index++) {\r\n let char = input[index], \r\n nextChar = input[index+1]; \r\n \r\n //Initialize empty row\r\n if(!data[row]){\r\n data[row] = [];\r\n }\r\n\r\n //Initialize empty column\r\n if(!data[row][col]){\r\n data[row][col] = \"\";\r\n }\r\n \r\n //Handle quotation mark inside string\r\n if (char == '\"' && inQuote && nextChar == '\"') { \r\n data[row][col] += char; \r\n index++;\r\n continue; \r\n }\r\n \r\n //Begin / End Quote\r\n if (char == '\"') { \r\n inQuote = !inQuote;\r\n continue;\r\n }\r\n \r\n //Next column (if not in quote)\r\n if (char == ',' && !inQuote) { \r\n col++;\r\n continue; \r\n }\r\n \r\n //New row if new line and not in quote (CRLF) \r\n if (char == '\\r' && nextChar == '\\n' && !inQuote) { \r\n col = 0; \r\n row++; \r\n index++; \r\n continue; \r\n }\r\n \r\n //New row if new line and not in quote (CR or LF) \r\n if ((char == '\\r' || char == '\\n') && !inQuote) { \r\n col = 0;\r\n row++;\r\n continue; \r\n }\r\n\r\n //Normal Character, append to column\r\n data[row][col] += char;\r\n }\r\n\r\n return data;\r\n}\r\n\r\nexport default csvImporter;","export default function(input){\r\n try {\r\n return JSON.parse(input);\r\n } catch(e) {\r\n console.warn(\"JSON Import Error - File contents is invalid JSON\", e);\r\n return Promise.reject();\r\n }\r\n}","import Module from '../../core/Module.js';\r\n\r\nimport defaultImporters from './defaults/importers.js';\r\n\r\nclass Import extends Module{\r\n \r\n constructor(table){\r\n super(table);\r\n \r\n this.registerTableOption(\"importFormat\");\r\n this.registerTableOption(\"importReader\", \"text\");\r\n }\r\n \r\n initialize(){\r\n this.registerTableFunction(\"import\", this.importFromFile.bind(this));\r\n\r\n if(this.table.options.importFormat){\r\n this.subscribe(\"data-loading\", this.loadDataCheck.bind(this), 10);\r\n this.subscribe(\"data-load\", this.loadData.bind(this), 10);\r\n }\r\n }\r\n\r\n loadDataCheck(data){\r\n return typeof data === \"string\";\r\n }\r\n\r\n loadData(data, params, config, silent, previousData){\r\n return this.importData(this.lookupImporter(), data)\r\n .then(this.structureData.bind(this))\r\n .catch((err) => {\r\n console.error(\"Import Error:\", err || \"Unable to import data\")\r\n return Promise.reject(err);\r\n })\r\n }\r\n\r\n lookupImporter(importFormat){\r\n var importer;\r\n \r\n if(!importFormat){\r\n importFormat = this.table.options.importFormat;\r\n }\r\n \r\n if(typeof importFormat === \"string\"){\r\n importer = Import.importers[importFormat];\r\n }else{\r\n importer = importFormat;\r\n }\r\n\r\n if(!importer){\r\n console.error(\"Import Error - Importer not found:\", importFormat);\r\n }\r\n \r\n return importer;\r\n }\r\n \r\n importFromFile(importFormat, extension){\r\n var importer = this.lookupImporter(importFormat);\r\n \r\n if(importer){\r\n return this.pickFile(extension)\r\n .then(this.importData.bind(this, importer))\r\n .then(this.structureData.bind(this))\r\n .then(this.setData.bind(this))\r\n .catch((err) => {\r\n console.error(\"Import Error:\", err || \"Unable to import file\")\r\n return Promise.reject(err);\r\n })\r\n }\r\n }\r\n \r\n pickFile(extensions){\r\n return new Promise((resolve, reject) => {\r\n var input = document.createElement(\"input\");\r\n input.type = \"file\";\r\n input.accept = extensions;\r\n \r\n input.addEventListener(\"change\", (e) => {\r\n var file = input.files[0],\r\n reader = new FileReader(),\r\n data;\r\n \r\n switch(this.table.options.importReader){\r\n case \"buffer\":\r\n reader.readAsArrayBuffer(file);\r\n break;\r\n\r\n case \"binary\":\r\n reader.readAsBinaryString(file);\r\n break;\r\n\r\n case \"url\":\r\n reader.readAsDataURL(file);\r\n break;\r\n\r\n case \"text\":\r\n default:\r\n reader.readAsText(file);\r\n }\r\n \r\n reader.onload = (e) => {\r\n resolve(reader.result)\r\n };\r\n \r\n reader.onerror = (e) => {\r\n console.warn(\"File Load Error - Unable to read file\");\r\n reject();\r\n };\r\n });\r\n \r\n input.click();\r\n });\r\n }\r\n \r\n importData(importer, fileContents){\r\n var data = importer.call(this.table, fileContents);\r\n \r\n if(data instanceof Promise){\r\n return data;\r\n }else{\r\n return data ? Promise.resolve(data) : Promise.reject();\r\n }\r\n }\r\n\r\n structureData(parsedData){\r\n var data = [];\r\n \r\n if(Array.isArray(parsedData) && parsedData.length && Array.isArray(parsedData[0])){\r\n if(this.table.options.autoColumns){\r\n data = this.structureArrayToObject(parsedData);\r\n }else{\r\n data = this.structureArrayToColumns(parsedData);\r\n }\r\n\r\n return data;\r\n }else{\r\n return parsedData;\r\n }\r\n }\r\n\r\n structureArrayToObject(parsedData){\r\n var columns = parsedData.shift();\r\n\r\n var data = parsedData.map((values) => {\r\n var row = {};\r\n\r\n columns.forEach((key, i) => {\r\n row[key] = values[i];\r\n })\r\n\r\n return row;\r\n })\r\n\r\n return data;\r\n }\r\n\r\n structureArrayToColumns(parsedData){\r\n var data = [],\r\n columns = this.table.getColumns();\r\n\r\n //remove first row if it is the column names\r\n if(columns[0] && parsedData[0][0]){\r\n if(columns[0].getDefinition().title === parsedData[0][0]){\r\n parsedData.shift();\r\n }\r\n }\r\n \r\n //convert row arrays to objects\r\n parsedData.forEach((rowData) => {\r\n var row = {};\r\n\r\n rowData.forEach((value, index) => {\r\n var column = columns[index];\r\n\r\n if(column){\r\n row[column.getField()] = value;\r\n }\r\n })\r\n\r\n data.push(row);\r\n });\r\n\r\n return data;\r\n }\r\n \r\n setData(data){\r\n return this.table.setData(data);\r\n }\r\n}\r\n\r\nImport.moduleName = \"import\";\r\n\r\n//load defaults\r\nImport.importers = defaultImporters;\r\n\r\nexport default Import;","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport Cell from '../../core/cell/Cell.js';\r\nimport Column from '../../core/column/Column.js';\r\n\r\nclass Interaction extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.eventMap = {\r\n\t\t\t//row events\r\n\t\t\trowClick:\"row-click\",\r\n\t\t\trowDblClick:\"row-dblclick\",\r\n\t\t\trowContext:\"row-contextmenu\",\r\n\t\t\trowMouseEnter:\"row-mouseenter\",\r\n\t\t\trowMouseLeave:\"row-mouseleave\",\r\n\t\t\trowMouseOver:\"row-mouseover\",\r\n\t\t\trowMouseOut:\"row-mouseout\",\r\n\t\t\trowMouseMove:\"row-mousemove\",\r\n\t\t\trowTap:\"row\",\r\n\t\t\trowDblTap:\"row\",\r\n\t\t\trowTapHold:\"row\",\r\n\r\n\t\t\t//cell events\r\n\t\t\tcellClick:\"cell-click\",\r\n\t\t\tcellDblClick:\"cell-dblclick\",\r\n\t\t\tcellContext:\"cell-contextmenu\",\r\n\t\t\tcellMouseEnter:\"cell-mouseenter\",\r\n\t\t\tcellMouseLeave:\"cell-mouseleave\",\r\n\t\t\tcellMouseOver:\"cell-mouseover\",\r\n\t\t\tcellMouseOut:\"cell-mouseout\",\r\n\t\t\tcellMouseMove:\"cell-mousemove\",\r\n\t\t\tcellTap:\"cell\",\r\n\t\t\tcellDblTap:\"cell\",\r\n\t\t\tcellTapHold:\"cell\",\r\n\r\n\t\t\t//column header events\r\n\t\t\theaderClick:\"column-click\",\r\n\t\t\theaderDblClick:\"column-dblclick\",\r\n\t\t\theaderContext:\"column-contextmenu\",\r\n\t\t\theaderMouseEnter:\"column-mouseenter\",\r\n\t\t\theaderMouseLeave:\"column-mouseleave\",\r\n\t\t\theaderMouseOver:\"column-mouseover\",\r\n\t\t\theaderMouseOut:\"column-mouseout\",\r\n\t\t\theaderMouseMove:\"column-mousemove\",\r\n\t\t\theaderTap:\"column\",\r\n\t\t\theaderDblTap:\"column\",\r\n\t\t\theaderTapHold:\"column\",\r\n\r\n\t\t\t//group header\r\n\t\t\tgroupClick:\"group-click\",\r\n\t\t\tgroupDblClick:\"group-dblclick\",\r\n\t\t\tgroupContext:\"group-contextmenu\",\r\n\t\t\tgroupMouseEnter:\"group-mouseenter\",\r\n\t\t\tgroupMouseLeave:\"group-mouseleave\",\r\n\t\t\tgroupMouseOver:\"group-mouseover\",\r\n\t\t\tgroupMouseOut:\"group-mouseout\",\r\n\t\t\tgroupMouseMove:\"group-mousemove\",\r\n\t\t\tgroupTap:\"group\",\r\n\t\t\tgroupDblTap:\"group\",\r\n\t\t\tgroupTapHold:\"group\",\r\n\t\t}\r\n\r\n\t\tthis.subscribers = {};\r\n\r\n\t\tthis.touchSubscribers = {};\r\n\r\n\t\tthis.columnSubscribers = {};\r\n\r\n\t\tthis.touchWatchers = {\r\n\t\t\trow:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tcell:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tcolumn:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tgroup:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.registerColumnOption(\"headerClick\");\r\n\t\tthis.registerColumnOption(\"headerDblClick\");\r\n\t\tthis.registerColumnOption(\"headerContext\");\r\n\t\tthis.registerColumnOption(\"headerMouseEnter\");\r\n\t\tthis.registerColumnOption(\"headerMouseLeave\");\r\n\t\tthis.registerColumnOption(\"headerMouseOver\");\r\n\t\tthis.registerColumnOption(\"headerMouseOut\");\r\n\t\tthis.registerColumnOption(\"headerMouseMove\");\r\n\t\tthis.registerColumnOption(\"headerTap\");\r\n\t\tthis.registerColumnOption(\"headerDblTap\");\r\n\t\tthis.registerColumnOption(\"headerTapHold\");\r\n\r\n\t\tthis.registerColumnOption(\"cellClick\");\r\n\t\tthis.registerColumnOption(\"cellDblClick\");\r\n\t\tthis.registerColumnOption(\"cellContext\");\r\n\t\tthis.registerColumnOption(\"cellMouseEnter\");\r\n\t\tthis.registerColumnOption(\"cellMouseLeave\");\r\n\t\tthis.registerColumnOption(\"cellMouseOver\");\r\n\t\tthis.registerColumnOption(\"cellMouseOut\");\r\n\t\tthis.registerColumnOption(\"cellMouseMove\");\r\n\t\tthis.registerColumnOption(\"cellTap\");\r\n\t\tthis.registerColumnOption(\"cellDblTap\");\r\n\t\tthis.registerColumnOption(\"cellTapHold\");\r\n\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.initializeExternalEvents();\r\n\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this))\r\n\t\tthis.subscribe(\"cell-dblclick\", this.cellContentsSelectionFixer.bind(this))\r\n\t}\r\n\r\n\tcellContentsSelectionFixer(e, cell){\r\n\t\tif(this.table.modExists(\"edit\")){\r\n\t\t\tif (this.table.modules.edit.currentCell === this){\r\n\t\t\t\treturn; //prevent instant selection of editor content\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\ttry{\r\n\t\t\tif (document.selection) { // IE\r\n\t\t\t\tvar range = document.body.createTextRange();\r\n\t\t\t\trange.moveToElementText(this.element);\r\n\t\t\t\trange.select();\r\n\t\t\t} else if (window.getSelection) {\r\n\t\t\t\tvar range = document.createRange();\r\n\t\t\t\trange.selectNode(this.element);\r\n\t\t\t\twindow.getSelection().removeAllRanges();\r\n\t\t\t\twindow.getSelection().addRange(range);\r\n\t\t\t}\r\n\t\t}catch(e){}\r\n\t}\r\n\r\n\tinitializeExternalEvents(){\r\n\t\tfor(let key in this.eventMap){\r\n\t\t\tthis.subscriptionChangeExternal(key, this.subscriptionChanged.bind(this, key))\r\n\t\t}\r\n\t}\r\n\r\n\tsubscriptionChanged(key, added){\r\n\t\tvar index;\r\n\r\n\t\tif(added){\r\n\t\t\tif(!this.subscribers[key]){\r\n\t\t\t\tif(this.eventMap[key].includes(\"-\")){\r\n\t\t\t\t\tthis.subscribers[key] = this.handle.bind(this, key);\r\n\t\t\t\t\tthis.subscribe(this.eventMap[key], this.subscribers[key]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.subscribeTouchEvents(key);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.eventMap[key].includes(\"-\")){\r\n\t\t\t\tif(this.subscribers[key] && !this.columnSubscribers[key] && !this.subscribedExternal(key)){\r\n\t\t\t\t\tthis.unsubscribe(this.eventMap[key], this.subscribers[key]);\r\n\t\t\t\t\tdelete this.subscribers[key];\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.unsubscribeTouchEvents(key);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tsubscribeTouchEvents(key){\r\n\t\tvar type = this.eventMap[key];\r\n\r\n\t\tif(!this.touchSubscribers[type + \"-touchstart\"]){\r\n\t\t\tthis.touchSubscribers[type + \"-touchstart\"] = this.handleTouch.bind(this, type, \"start\");\r\n\t\t\tthis.touchSubscribers[type + \"-touchend\"] = this.handleTouch.bind(this, type, \"end\");\r\n\r\n\t\t\tthis.subscribe(type + \"-touchstart\", this.touchSubscribers[type + \"-touchstart\"]);\r\n\t\t\tthis.subscribe(type + \"-touchend\", this.touchSubscribers[type + \"-touchend\"]);\r\n\t\t}\r\n\r\n\t\tthis.subscribers[key] = true;\r\n\t}\r\n\r\n\tunsubscribeTouchEvents(key){\r\n\t\tvar notouch = true,\r\n\t\ttype = this.eventMap[key];\r\n\r\n\t\tif(this.subscribers[key] && !this.subscribedExternal(key)){\r\n\t\t\tdelete this.subscribers[key];\r\n\r\n\t\t\tfor(let i in this.eventMap){\r\n\t\t\t\tif(this.eventMap[i] === type){\r\n\t\t\t\t\tif(this.subscribers[i]){\r\n\t\t\t\t\t\tnotouch = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(notouch){\r\n\t\t\t\tthis.unsubscribe(type + \"-touchstart\", this.touchSubscribers[type + \"-touchstart\"]);\r\n\t\t\t\tthis.unsubscribe(type + \"-touchend\", this.touchSubscribers[type + \"-touchend\"]);\r\n\r\n\t\t\t\tdelete this.touchSubscribers[type + \"-touchstart\"];\r\n\t\t\t\tdelete this.touchSubscribers[type + \"-touchend\"];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.definition;\r\n\r\n\t\tfor(let key in this.eventMap){\r\n\t\t\tif(def[key]){\r\n\t\t\t\tthis.subscriptionChanged(key, true);\r\n\r\n\t\t\t\tif(!this.columnSubscribers[key]){\r\n\t\t\t\t\tthis.columnSubscribers[key] = [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.columnSubscribers[key].push(column);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\thandle(action, e, component){\r\n\t\tthis.dispatchEvent(action, e, component);\r\n\t}\r\n\r\n\thandleTouch(type, action, e, component){\r\n\t\tvar watchers = this.touchWatchers[type];\r\n\r\n\t\tif(type === \"column\"){\r\n\t\t\ttype = \"header\";\r\n\t\t}\r\n\r\n\t\tswitch(action){\r\n\t\t\tcase \"start\":\r\n\t\t\twatchers.tap = true;\r\n\r\n\t\t\tclearTimeout(watchers.tapHold);\r\n\r\n\t\t\twatchers.tapHold = setTimeout(() => {\r\n\t\t\t\tclearTimeout(watchers.tapHold);\r\n\t\t\t\twatchers.tapHold = null;\r\n\r\n\t\t\t\twatchers.tap = null;\r\n\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\twatchers.tapDbl = null;\r\n\r\n\t\t\t\tthis.dispatchEvent(type + \"TapHold\", e, component);\r\n\t\t\t}, 1000);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"end\":\r\n\t\t\tif(watchers.tap){\r\n\r\n\t\t\t\twatchers.tap = null;\r\n\t\t\t\tthis.dispatchEvent(type + \"Tap\", e, component);\r\n\t\t\t}\r\n\r\n\t\t\tif(watchers.tapDbl){\r\n\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\twatchers.tapDbl = null;\r\n\r\n\t\t\t\tthis.dispatchEvent(type + \"DblTap\", e, component);\r\n\t\t\t}else{\r\n\t\t\t\twatchers.tapDbl = setTimeout(() => {\r\n\t\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\t\twatchers.tapDbl = null;\r\n\t\t\t\t}, 300);\r\n\t\t\t}\r\n\r\n\t\t\tclearTimeout(watchers.tapHold);\r\n\t\t\twatchers.tapHold = null;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tdispatchEvent(action, e, component){\r\n\t\tvar componentObj = component.getComponent(),\r\n\t\tcallback;\r\n\r\n\t\tif(this.columnSubscribers[action]){\r\n\r\n\t\t\tif(component instanceof Cell){\r\n\t\t\t\tcallback = component.column.definition[action];\r\n\t\t\t}else if(component instanceof Column){\r\n\t\t\t\tcallback = component.definition[action];\r\n\t\t\t}\r\n\r\n\t\t\tif(callback){\r\n\t\t\t\tcallback(e, componentObj);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(action, e, componentObj);\r\n\t}\r\n}\r\n\r\nInteraction.moduleName = \"interaction\";\r\n\r\nexport default Interaction;\r\n","import Module from '../../core/Module.js';\r\n\r\nimport defaultBindings from './defaults/bindings.js';\r\nimport defaultActions from './defaults/actions.js';\r\n\r\nclass Keybindings extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.watchKeys = null;\r\n\t\tthis.pressedKeys = null;\r\n\t\tthis.keyupBinding = false;\r\n\t\tthis.keydownBinding = false;\r\n\r\n\t\tthis.registerTableOption(\"keybindings\", {}); //array for keybindings\r\n\t\tthis.registerTableOption(\"tabEndNewRow\", false); //create new row when tab to end of table\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tvar bindings = this.table.options.keybindings,\r\n\t\tmergedBindings = {};\r\n\r\n\t\tthis.watchKeys = {};\r\n\t\tthis.pressedKeys = [];\r\n\r\n\t\tif(bindings !== false){\r\n\t\t\tObject.assign(mergedBindings, Keybindings.bindings)\r\n\t\t\tObject.assign(mergedBindings, bindings)\r\n\r\n\t\t\tthis.mapBindings(mergedBindings);\r\n\t\t\tthis.bindEvents();\r\n\t\t}\r\n\r\n\t\tthis.subscribe(\"table-destroy\", this.clearBindings.bind(this));\r\n\t}\r\n\r\n\tmapBindings(bindings){\r\n\t\tfor(let key in bindings){\r\n\t\t\tif(Keybindings.actions[key]){\r\n\t\t\t\tif(bindings[key]){\r\n\t\t\t\t\tif(typeof bindings[key] !== \"object\"){\r\n\t\t\t\t\t\tbindings[key] = [bindings[key]];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbindings[key].forEach((binding) => {\r\n\t\t\t\t\t\tvar bindingList = Array.isArray(binding) ? binding : [binding];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tbindingList.forEach((item) => {\r\n\t\t\t\t\t\t\tthis.mapBinding(key, item);\r\n\t\t\t\t\t\t});\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Key Binding Error - no such action:\", key);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmapBinding(action, symbolsList){\r\n\t\tvar binding = {\r\n\t\t\taction: Keybindings.actions[action],\r\n\t\t\tkeys: [],\r\n\t\t\tctrl: false,\r\n\t\t\tshift: false,\r\n\t\t\tmeta: false,\r\n\t\t};\r\n\r\n\t\tvar symbols = symbolsList.toString().toLowerCase().split(\" \").join(\"\").split(\"+\");\r\n\r\n\t\tsymbols.forEach((symbol) => {\r\n\t\t\tswitch(symbol){\r\n\t\t\t\tcase \"ctrl\":\r\n\t\t\t\tbinding.ctrl = true;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"shift\":\r\n\t\t\t\tbinding.shift = true;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"meta\":\r\n\t\t\t\tbinding.meta = true;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\tsymbol = isNaN(symbol) ? symbol.toUpperCase().charCodeAt(0) : parseInt(symbol);\r\n\t\t\t\tbinding.keys.push(symbol);\r\n\r\n\t\t\t\tif(!this.watchKeys[symbol]){\r\n\t\t\t\t\tthis.watchKeys[symbol] = [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.watchKeys[symbol].push(binding);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tbindEvents(){\r\n\t\tvar self = this;\r\n\r\n\t\tthis.keyupBinding = function(e){\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tvar bindings = self.watchKeys[code];\r\n\r\n\t\t\tif(bindings){\r\n\r\n\t\t\t\tself.pressedKeys.push(code);\r\n\r\n\t\t\t\tbindings.forEach(function(binding){\r\n\t\t\t\t\tself.checkBinding(e, binding);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.keydownBinding = function(e){\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tvar bindings = self.watchKeys[code];\r\n\r\n\t\t\tif(bindings){\r\n\r\n\t\t\t\tvar index = self.pressedKeys.indexOf(code);\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tself.pressedKeys.splice(index, 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.table.element.addEventListener(\"keydown\", this.keyupBinding);\r\n\r\n\t\tthis.table.element.addEventListener(\"keyup\", this.keydownBinding);\r\n\t}\r\n\r\n\tclearBindings(){\r\n\t\tif(this.keyupBinding){\r\n\t\t\tthis.table.element.removeEventListener(\"keydown\", this.keyupBinding);\r\n\t\t}\r\n\r\n\t\tif(this.keydownBinding){\r\n\t\t\tthis.table.element.removeEventListener(\"keyup\", this.keydownBinding);\r\n\t\t}\r\n\t}\r\n\r\n\tcheckBinding(e, binding){\r\n\t\tvar match = true;\r\n\r\n\t\tif(e.ctrlKey == binding.ctrl && e.shiftKey == binding.shift && e.metaKey == binding.meta){\r\n\t\t\tbinding.keys.forEach((key) => {\r\n\t\t\t\tvar index = this.pressedKeys.indexOf(key);\r\n\r\n\t\t\t\tif(index == -1){\r\n\t\t\t\t\tmatch = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tbinding.action.call(this, e);\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\nKeybindings.moduleName = \"keybindings\";\r\n\r\n//load defaults\r\nKeybindings.bindings = defaultBindings;\r\nKeybindings.actions = defaultActions;\r\n\r\nexport default Keybindings;","export default {\r\n\tnavPrev:\"shift + 9\",\r\n\tnavNext:9,\r\n\tnavUp:38,\r\n\tnavDown:40,\r\n\tscrollPageUp:33,\r\n\tscrollPageDown:34,\r\n\tscrollToStart:36,\r\n\tscrollToEnd:35,\r\n\tundo:[\"ctrl + 90\", \"meta + 90\"],\r\n\tredo:[\"ctrl + 89\", \"meta + 89\"],\r\n\tcopyToClipboard:[\"ctrl + 67\", \"meta + 89\"],\r\n};","export default {\r\n\tkeyBlock:function(e){\r\n\t\te.stopPropagation();\r\n\t\te.preventDefault();\r\n\t},\r\n\tscrollPageUp:function(e){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tnewPos = rowManager.scrollTop - rowManager.element.clientHeight,\r\n\t\tscrollMax = rowManager.element.scrollHeight;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\tif(newPos >= 0){\r\n\t\t\t\trowManager.element.scrollTop = newPos;\r\n\t\t\t}else{\r\n\t\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[0]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tscrollPageDown:function(e){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tnewPos = rowManager.scrollTop + rowManager.element.clientHeight,\r\n\t\tscrollMax = rowManager.element.scrollHeight;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\tif(newPos <= scrollMax){\r\n\t\t\t\trowManager.element.scrollTop = newPos;\r\n\t\t\t}else{\r\n\t\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\r\n\t},\r\n\tscrollToStart:function(e){\r\n\t\tvar rowManager = this.table.rowManager;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[0]);\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tscrollToEnd:function(e){\r\n\t\tvar rowManager = this.table.rowManager;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]);\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tnavPrev:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-prev\", e);\r\n\t},\r\n\r\n\tnavNext:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-next\", e);\r\n\t},\r\n\r\n\tnavLeft:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-left\", e);\r\n\t},\r\n\r\n\tnavRight:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-right\", e);\r\n\t},\r\n\r\n\tnavUp:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-up\", e);\r\n\t},\r\n\r\n\tnavDown:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-down\", e);\r\n\t},\r\n\r\n\tundo:function(e){\r\n\t\tvar cell = false;\r\n\t\tif(this.table.options.history && this.table.modExists(\"history\") && this.table.modExists(\"edit\")){\r\n\r\n\t\t\tcell = this.table.modules.edit.currentCell;\r\n\r\n\t\t\tif(!cell){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tthis.table.modules.history.undo();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tredo:function(e){\r\n\t\tvar cell = false;\r\n\t\tif(this.table.options.history && this.table.modExists(\"history\") && this.table.modExists(\"edit\")){\r\n\r\n\t\t\tcell = this.table.modules.edit.currentCell;\r\n\r\n\t\t\tif(!cell){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tthis.table.modules.history.redo();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tcopyToClipboard:function(e){\r\n\t\tif(!this.table.modules.edit.currentCell){\r\n\t\t\tif(this.table.modExists(\"clipboard\", true)){\r\n\t\t\t\tthis.table.modules.clipboard.copy(false, true);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nclass Menu extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.menuContainer = null;\r\n\t\tthis.nestedMenuBlock = false;\r\n\t\t\r\n\t\tthis.currentComponent = null;\r\n\t\tthis.rootPopup = null;\r\n\t\t\r\n\t\tthis.columnSubscribers = {};\r\n\t\t\r\n\t\tthis.registerTableOption(\"menuContainer\", undefined); //deprecated\r\n\r\n\t\tthis.registerTableOption(\"rowContextMenu\", false);\r\n\t\tthis.registerTableOption(\"rowClickMenu\", false);\r\n\t\tthis.registerTableOption(\"groupContextMenu\", false);\r\n\t\tthis.registerTableOption(\"groupClickMenu\", false);\r\n\t\t\r\n\t\tthis.registerColumnOption(\"headerContextMenu\");\r\n\t\tthis.registerColumnOption(\"headerClickMenu\");\r\n\t\tthis.registerColumnOption(\"headerMenu\");\r\n\t\tthis.registerColumnOption(\"headerMenuIcon\");\r\n\t\tthis.registerColumnOption(\"contextMenu\");\r\n\t\tthis.registerColumnOption(\"clickMenu\");\r\n\t\t\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.deprecationCheck();\r\n\t\tthis.initializeRowWatchers();\r\n\t\tthis.initializeGroupWatchers();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\r\n\tdeprecationCheck(){\r\n\t\tif(typeof this.table.options.menuContainer !== \"undefined\"){\r\n\t\t\tconsole.warn(\"Use of the menuContainer option is now deprecated. Please use the popupContainer option instead\");\r\n\r\n\t\t\tthis.table.options.popupContainer = this.table.options.menuContainer;\r\n\t\t}\r\n\t}\t\r\n\t\r\n\tinitializeRowWatchers(){\r\n\t\tif(this.table.options.rowContextMenu){\r\n\t\t\tthis.subscribe(\"row-contextmenu\", this.loadMenuEvent.bind(this, this.table.options.rowContextMenu));\r\n\t\t\tthis.table.on(\"rowTapHold\", this.loadMenuEvent.bind(this, this.table.options.rowContextMenu));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.rowClickMenu){\r\n\t\t\tthis.subscribe(\"row-click\", this.loadMenuEvent.bind(this, this.table.options.rowClickMenu));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeGroupWatchers(){\r\n\t\tif(this.table.options.groupContextMenu){\r\n\t\t\tthis.subscribe(\"group-contextmenu\", this.loadMenuEvent.bind(this, this.table.options.groupContextMenu));\r\n\t\t\tthis.table.on(\"groupTapHold\", this.loadMenuEvent.bind(this, this.table.options.groupContextMenu));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.groupClickMenu){\r\n\t\t\tthis.subscribe(\"group-click\", this.loadMenuEvent.bind(this, this.table.options.groupClickMenu));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar options = [\"headerContextMenu\", \"headerClickMenu\"],\r\n\t\tdef = column.definition;\r\n\t\t\r\n\t\t//handle column events\r\n\t\tif(def.headerContextMenu && !this.columnSubscribers.headerContextMenu){\r\n\t\t\tthis.columnSubscribers.headerContextMenu = this.loadMenuTableColumnEvent.bind(this, \"headerContextMenu\");\r\n\t\t\tthis.subscribe(\"column-contextmenu\", this.columnSubscribers.headerContextMenu);\r\n\t\t\tthis.table.on(\"headerTapHold\", this.loadMenuTableColumnEvent.bind(this, \"headerContextMenu\"))\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerClickMenu && !this.columnSubscribers.headerClickMenu){\r\n\t\t\tthis.columnSubscribers.headerClickMenu = this.loadMenuTableColumnEvent.bind(this, \"headerClickMenu\");\r\n\t\t\tthis.subscribe(\"column-click\", this.columnSubscribers.headerClickMenu);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerMenu){\r\n\t\t\tthis.initializeColumnHeaderMenu(column);\r\n\t\t}\r\n\t\t\r\n\t\t//handle cell events\r\n\t\tif(def.contextMenu && !this.columnSubscribers.contextMenu){\r\n\t\t\tthis.columnSubscribers.contextMenu = this.loadMenuTableCellEvent.bind(this, \"contextMenu\");\r\n\t\t\tthis.subscribe(\"cell-contextmenu\", this.columnSubscribers.contextMenu);\r\n\t\t\tthis.table.on(\"cellTapHold\", this.loadMenuTableCellEvent.bind(this, \"contextMenu\"))\r\n\t\t}\r\n\t\t\r\n\t\tif(def.clickMenu && !this.columnSubscribers.clickMenu){\r\n\t\t\tthis.columnSubscribers.clickMenu = this.loadMenuTableCellEvent.bind(this, \"clickMenu\");\r\n\t\t\tthis.subscribe(\"cell-click\", this.columnSubscribers.clickMenu);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumnHeaderMenu(column){\r\n\t\tvar icon = column.definition.headerMenuIcon,\r\n\t\theaderMenuEl;\r\n\t\t\r\n\t\theaderMenuEl = document.createElement(\"span\");\r\n\t\theaderMenuEl.classList.add(\"tabulator-header-popup-button\");\r\n\r\n\t\tif(icon){\r\n\t\t\tif(typeof icon === \"function\"){\r\n\t\t\t\ticon = icon(column.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tif(icon instanceof HTMLElement){\r\n\t\t\t\theaderMenuEl.appendChild(icon);\r\n\t\t\t}else{\r\n\t\t\t\theaderMenuEl.innerHTML = icon;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\theaderMenuEl.innerHTML = \"⋮\";\r\n\t\t}\r\n\t\t\r\n\t\theaderMenuEl.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tthis.loadMenuEvent(column.definition.headerMenu, e, column);\r\n\t\t});\r\n\t\t\r\n\t\tcolumn.titleElement.insertBefore(headerMenuEl, column.titleElement.firstChild);\r\n\t}\r\n\t\r\n\tloadMenuTableCellEvent(option, e, cell){\r\n\t\tif(cell._cell){\r\n\t\t\tcell = cell._cell;\r\n\t\t}\r\n\t\t\r\n\t\tif(cell.column.definition[option]){\r\n\t\t\tthis.loadMenuEvent(cell.column.definition[option], e, cell);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadMenuTableColumnEvent(option, e, column){\r\n\t\tif(column._column){\r\n\t\t\tcolumn = column._column;\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition[option]){\r\n\t\t\tthis.loadMenuEvent(column.definition[option], e, column);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadMenuEvent(menu, e, component){\r\n\t\tif(component._group){\r\n\t\t\tcomponent = component._group;\r\n\t\t}else if(component._row){\r\n\t\t\tcomponent = component._row;\r\n\t\t}\r\n\t\t\r\n\t\tmenu = typeof menu == \"function\" ? menu.call(this.table, e, component.getComponent()) : menu;\r\n\t\t\r\n\t\tthis.loadMenu(e, component, menu);\r\n\t}\r\n\t\r\n\tloadMenu(e, component, menu, parentEl, parentPopup){\r\n\t\tvar touch = !(e instanceof MouseEvent),\t\t\r\n\t\tmenuEl = document.createElement(\"div\"),\r\n\t\tpopup;\r\n\t\t\r\n\t\tmenuEl.classList.add(\"tabulator-menu\");\r\n\t\t\r\n\t\tif(!touch){\r\n\t\t\te.preventDefault();\r\n\t\t}\r\n\t\t\r\n\t\t//abort if no menu set\r\n\t\tif(!menu || !menu.length){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif(!parentEl){\r\n\t\t\tif(this.nestedMenuBlock){\r\n\t\t\t\t//abort if child menu already open\r\n\t\t\t\tif(this.rootPopup){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.nestedMenuBlock = setTimeout(() => {\r\n\t\t\t\t\tthis.nestedMenuBlock = false;\r\n\t\t\t\t}, 100)\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.rootPopup){\r\n\t\t\t\tthis.rootPopup.hide();\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.rootPopup = popup = this.popup(menuEl);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tpopup = parentPopup.child(menuEl);\r\n\t\t}\r\n\t\t\r\n\t\tmenu.forEach((item) => {\r\n\t\t\tvar itemEl = document.createElement(\"div\"),\r\n\t\t\tlabel = item.label,\r\n\t\t\tdisabled = item.disabled;\r\n\t\t\t\r\n\t\t\tif(item.separator){\r\n\t\t\t\titemEl.classList.add(\"tabulator-menu-separator\");\r\n\t\t\t}else{\r\n\t\t\t\titemEl.classList.add(\"tabulator-menu-item\");\r\n\t\t\t\t\r\n\t\t\t\tif(typeof label == \"function\"){\r\n\t\t\t\t\tlabel = label.call(this.table, component.getComponent());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(label instanceof Node){\r\n\t\t\t\t\titemEl.appendChild(label);\r\n\t\t\t\t}else{\r\n\t\t\t\t\titemEl.innerHTML = label;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(typeof disabled == \"function\"){\r\n\t\t\t\t\tdisabled = disabled.call(this.table, component.getComponent());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(disabled){\r\n\t\t\t\t\titemEl.classList.add(\"tabulator-menu-item-disabled\");\r\n\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(item.menu && item.menu.length){\r\n\t\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\tthis.loadMenu(e, component, item.menu, itemEl, popup);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(item.action){\r\n\t\t\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\t\t\titem.action(e, component.getComponent());\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(item.menu && item.menu.length){\r\n\t\t\t\t\titemEl.classList.add(\"tabulator-menu-item-submenu\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmenuEl.appendChild(itemEl);\r\n\t\t});\r\n\t\t\r\n\t\tmenuEl.addEventListener(\"click\", (e) => {\r\n\t\t\tthis.rootPopup.hide();\r\n\t\t});\r\n\t\t\r\n\t\tpopup.show(parentEl || e);\r\n\t\t\r\n\t\tif(popup === this.rootPopup){\r\n\t\t\tthis.rootPopup.hideOnBlur(() => {\r\n\t\t\t\tthis.rootPopup = null;\r\n\t\t\t\t\r\n\t\t\t\tif(this.currentComponent){\r\n\t\t\t\t\tthis.dispatchExternal(\"menuClosed\", this.currentComponent.getComponent());\r\n\t\t\t\t\tthis.currentComponent = null;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.currentComponent = component;\r\n\r\n\t\t\tthis.dispatchExternal(\"menuOpened\", component.getComponent())\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMenu.moduleName = \"menu\";\r\n\r\nexport default Menu;\r\n","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nclass MoveColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.placeholderElement = this.createPlaceholderElement();\r\n\t\tthis.hoverElement = false; //floating column header element\r\n\t\tthis.checkTimeout = false; //click check timeout holder\r\n\t\tthis.checkPeriod = 250; //period to wait on mousedown to consider this a move and not a click\r\n\t\tthis.moving = false; //currently moving column\r\n\t\tthis.toCol = false; //destination column\r\n\t\tthis.toColAfter = false; //position of moving column relative to the desitnation column\r\n\t\tthis.startX = 0; //starting position within header element\r\n\t\tthis.autoScrollMargin = 40; //auto scroll on edge when within margin\r\n\t\tthis.autoScrollStep = 5; //auto scroll distance in pixels\r\n\t\tthis.autoScrollTimeout = false; //auto scroll timeout\r\n\t\tthis.touchMove = false;\r\n\t\t\r\n\t\tthis.moveHover = this.moveHover.bind(this);\r\n\t\tthis.endMove = this.endMove.bind(this);\r\n\t\t\r\n\t\tthis.registerTableOption(\"movableColumns\", false); //enable movable columns\r\n\t}\r\n\t\r\n\tcreatePlaceholderElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-col\");\r\n\t\tel.classList.add(\"tabulator-col-placeholder\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.movableColumns){\r\n\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar self = this,\r\n\t\tconfig = {},\r\n\t\tcolEl;\r\n\t\t\r\n\t\tif(!column.modules.frozen && !column.isGroup){\r\n\t\t\tcolEl = column.getElement();\r\n\t\t\t\r\n\t\t\tconfig.mousemove = function(e){\r\n\t\t\t\tif(column.parent === self.moving.parent){\r\n\t\t\t\t\tif((((self.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(colEl).left) + self.table.columnManager.element.scrollLeft) > (column.getWidth() / 2)){\r\n\t\t\t\t\t\tif(self.toCol !== column || !self.toColAfter){\r\n\t\t\t\t\t\t\tcolEl.parentNode.insertBefore(self.placeholderElement, colEl.nextSibling);\r\n\t\t\t\t\t\t\tself.moveColumn(column, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(self.toCol !== column || self.toColAfter){\r\n\t\t\t\t\t\t\tcolEl.parentNode.insertBefore(self.placeholderElement, colEl);\r\n\t\t\t\t\t\t\tself.moveColumn(column, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}.bind(self);\r\n\t\t\t\r\n\t\t\tcolEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tself.touchMove = false;\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, column);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tcolEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tself.bindTouchEvents(column);\r\n\t\t}\r\n\t\t\r\n\t\tcolumn.modules.moveColumn = config;\r\n\t}\r\n\t\r\n\tbindTouchEvents(column){\r\n\t\tvar colEl = column.getElement(),\r\n\t\tstartXMove = false, //shifting center position of the cell\r\n\t\tdir = false,\r\n\t\tcurrentCol, nextCol, prevCol, nextColWidth, prevColWidth, nextColWidthLast, prevColWidthLast;\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchstart\", (e) => {\r\n\t\t\tthis.checkTimeout = setTimeout(() => {\r\n\t\t\t\tthis.touchMove = true;\r\n\t\t\t\tcurrentCol = column;\r\n\t\t\t\tnextCol = column.nextColumn();\r\n\t\t\t\tnextColWidth = nextCol ? nextCol.getWidth()/2 : 0;\r\n\t\t\t\tprevCol = column.prevColumn();\r\n\t\t\t\tprevColWidth = prevCol ? prevCol.getWidth()/2 : 0;\r\n\t\t\t\tnextColWidthLast = 0;\r\n\t\t\t\tprevColWidthLast = 0;\r\n\t\t\t\tstartXMove = false;\r\n\t\t\t\t\r\n\t\t\t\tthis.startMove(e, column);\r\n\t\t\t}, this.checkPeriod);\r\n\t\t}, {passive: true});\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchmove\", (e) => {\r\n\t\t\tvar halfCol, diff, moveToCol;\r\n\t\t\t\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.moveHover(e);\r\n\t\t\t\t\r\n\t\t\t\tif(!startXMove){\r\n\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tdiff = e.touches[0].pageX - startXMove;\r\n\t\t\t\t\r\n\t\t\t\tif(diff > 0){\r\n\t\t\t\t\tif(nextCol && diff - nextColWidthLast > nextColWidth){\r\n\t\t\t\t\t\tmoveToCol = nextCol;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(moveToCol !== column){\r\n\t\t\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t\t\t\tmoveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement().nextSibling);\r\n\t\t\t\t\t\t\tthis.moveColumn(moveToCol, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(prevCol && -diff - prevColWidthLast > prevColWidth){\r\n\t\t\t\t\t\tmoveToCol = prevCol;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(moveToCol !== column){\r\n\t\t\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t\t\t\tmoveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement());\r\n\t\t\t\t\t\t\tthis.moveColumn(moveToCol, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(moveToCol){\r\n\t\t\t\t\tcurrentCol = moveToCol;\r\n\t\t\t\t\tnextCol = moveToCol.nextColumn();\r\n\t\t\t\t\tnextColWidthLast = nextColWidth;\r\n\t\t\t\t\tnextColWidth = nextCol ? nextCol.getWidth() / 2 : 0;\r\n\t\t\t\t\tprevCol = moveToCol.prevColumn();\r\n\t\t\t\t\tprevColWidthLast = prevColWidth;\r\n\t\t\t\t\tprevColWidth = prevCol ? prevCol.getWidth() / 2 : 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}, {passive: true});\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchend\", (e) => {\r\n\t\t\tif(this.checkTimeout){\r\n\t\t\t\tclearTimeout(this.checkTimeout);\r\n\t\t\t}\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.endMove(e);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tstartMove(e, column){\r\n\t\tvar element = column.getElement(),\r\n\t\theaderElement = this.table.columnManager.getElement(),\r\n\t\theadersElement = this.table.columnManager.getHeadersElement();\r\n\t\t\r\n\t\tthis.moving = column;\r\n\t\tthis.startX = (this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(element).left;\r\n\t\t\r\n\t\tthis.table.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\t//create placeholder\r\n\t\tthis.placeholderElement.style.width = column.getWidth() + \"px\";\r\n\t\tthis.placeholderElement.style.height = column.getHeight() + \"px\";\r\n\t\t\r\n\t\telement.parentNode.insertBefore(this.placeholderElement, element);\r\n\t\telement.parentNode.removeChild(element);\r\n\t\t\r\n\t\t//create hover element\r\n\t\tthis.hoverElement = element.cloneNode(true);\r\n\t\tthis.hoverElement.classList.add(\"tabulator-moving\");\r\n\t\t\r\n\t\tthis.table.columnManager.getElement().appendChild(this.hoverElement);\r\n\t\t\r\n\t\tthis.hoverElement.style.left = \"0\";\r\n\t\tthis.hoverElement.style.bottom = (headerElement.clientHeight - headersElement.offsetHeight) + \"px\";\r\n\t\t\r\n\t\tif(!this.touchMove){\r\n\t\t\tthis._bindMouseMove();\r\n\t\t\t\r\n\t\t\tdocument.body.addEventListener(\"mousemove\", this.moveHover);\r\n\t\t\tdocument.body.addEventListener(\"mouseup\", this.endMove);\r\n\t\t}\r\n\t\t\r\n\t\tthis.moveHover(e);\r\n\t}\r\n\t\r\n\t_bindMouseMove(){\r\n\t\tthis.table.columnManager.columnsByIndex.forEach(function(column){\r\n\t\t\tif(column.modules.moveColumn.mousemove){\r\n\t\t\t\tcolumn.getElement().addEventListener(\"mousemove\", column.modules.moveColumn.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t_unbindMouseMove(){\r\n\t\tthis.table.columnManager.columnsByIndex.forEach(function(column){\r\n\t\t\tif(column.modules.moveColumn.mousemove){\r\n\t\t\t\tcolumn.getElement().removeEventListener(\"mousemove\", column.modules.moveColumn.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tmoveColumn(column, after){\r\n\t\tvar movingCells = this.moving.getCells();\r\n\t\t\r\n\t\tthis.toCol = column;\r\n\t\tthis.toColAfter = after;\r\n\t\t\r\n\t\tif(after){\r\n\t\t\tcolumn.getCells().forEach(function(cell, i){\r\n\t\t\t\tvar cellEl = cell.getElement(true);\r\n\t\t\t\t\r\n\t\t\t\tif(cellEl.parentNode && movingCells[i]){\r\n\t\t\t\t\tcellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl.nextSibling);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tcolumn.getCells().forEach(function(cell, i){\r\n\t\t\t\tvar cellEl = cell.getElement(true);\r\n\t\t\t\t\r\n\t\t\t\tif(cellEl.parentNode && movingCells[i]){\r\n\t\t\t\t\tcellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tendMove(e){\r\n\t\tif(e.which === 1 || this.touchMove){\r\n\t\t\tthis._unbindMouseMove();\r\n\t\t\t\r\n\t\t\tthis.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling);\r\n\t\t\tthis.placeholderElement.parentNode.removeChild(this.placeholderElement);\r\n\t\t\tthis.hoverElement.parentNode.removeChild(this.hoverElement);\r\n\t\t\t\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-block-select\");\r\n\t\t\t\r\n\t\t\tif(this.toCol){\r\n\t\t\t\tthis.table.columnManager.moveColumnActual(this.moving, this.toCol, this.toColAfter);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.moving = false;\r\n\t\t\tthis.toCol = false;\r\n\t\t\tthis.toColAfter = false;\r\n\t\t\t\r\n\t\t\tif(!this.touchMove){\r\n\t\t\t\tdocument.body.removeEventListener(\"mousemove\", this.moveHover);\r\n\t\t\t\tdocument.body.removeEventListener(\"mouseup\", this.endMove);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveHover(e){\r\n\t\tvar columnHolder = this.table.columnManager.getElement(),\r\n\t\tscrollLeft = columnHolder.scrollLeft,\r\n\t\txPos = ((this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(columnHolder).left) + scrollLeft,\r\n\t\tscrollPos;\r\n\t\t\r\n\t\tthis.hoverElement.style.left = (xPos - this.startX) + \"px\";\r\n\t\t\r\n\t\tif(xPos - scrollLeft < this.autoScrollMargin){\r\n\t\t\tif(!this.autoScrollTimeout){\r\n\t\t\t\tthis.autoScrollTimeout = setTimeout(() => {\r\n\t\t\t\t\tscrollPos = Math.max(0,scrollLeft-5);\r\n\t\t\t\t\tthis.table.rowManager.getElement().scrollLeft = scrollPos;\r\n\t\t\t\t\tthis.autoScrollTimeout = false;\r\n\t\t\t\t}, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(scrollLeft + columnHolder.clientWidth - xPos < this.autoScrollMargin){\r\n\t\t\tif(!this.autoScrollTimeout){\r\n\t\t\t\tthis.autoScrollTimeout = setTimeout(() => {\r\n\t\t\t\t\tscrollPos = Math.min(columnHolder.clientWidth, scrollLeft+5);\r\n\t\t\t\t\tthis.table.rowManager.getElement().scrollLeft = scrollPos;\r\n\t\t\t\t\tthis.autoScrollTimeout = false;\r\n\t\t\t\t}, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMoveColumns.moduleName = \"moveColumn\";\r\n\r\nexport default MoveColumns;\r\n","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nclass MoveRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.placeholderElement = this.createPlaceholderElement();\r\n\t\tthis.hoverElement = false; //floating row header element\r\n\t\tthis.checkTimeout = false; //click check timeout holder\r\n\t\tthis.checkPeriod = 150; //period to wait on mousedown to consider this a move and not a click\r\n\t\tthis.moving = false; //currently moving row\r\n\t\tthis.toRow = false; //destination row\r\n\t\tthis.toRowAfter = false; //position of moving row relative to the desitnation row\r\n\t\tthis.hasHandle = false; //row has handle instead of fully movable row\r\n\t\tthis.startY = 0; //starting Y position within header element\r\n\t\tthis.startX = 0; //starting X position within header element\r\n\r\n\t\tthis.moveHover = this.moveHover.bind(this);\r\n\t\tthis.endMove = this.endMove.bind(this);\r\n\t\tthis.tableRowDropEvent = false;\r\n\r\n\t\tthis.touchMove = false;\r\n\r\n\t\tthis.connection = false;\r\n\t\tthis.connectionSelectorsTables = false;\r\n\t\tthis.connectionSelectorsElements = false;\r\n\t\tthis.connectionElements = [];\r\n\t\tthis.connections = [];\r\n\r\n\t\tthis.connectedTable = false;\r\n\t\tthis.connectedRow = false;\r\n\r\n\t\tthis.registerTableOption(\"movableRows\", false); //enable movable rows\r\n\t\tthis.registerTableOption(\"movableRowsConnectedTables\", false); //tables for movable rows to be connected to\r\n\t\tthis.registerTableOption(\"movableRowsConnectedElements\", false); //other elements for movable rows to be connected to\r\n\t\tthis.registerTableOption(\"movableRowsSender\", false);\r\n\t\tthis.registerTableOption(\"movableRowsReceiver\", \"insert\");\r\n\r\n\t\tthis.registerColumnOption(\"rowHandle\");\r\n\t}\r\n\r\n\tcreatePlaceholderElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-row\");\r\n\t\tel.classList.add(\"tabulator-row-placeholder\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.movableRows){\r\n\t\t\tthis.connectionSelectorsTables = this.table.options.movableRowsConnectedTables;\r\n\t\t\tthis.connectionSelectorsElements = this.table.options.movableRowsConnectedElements;\r\n\r\n\t\t\tthis.connection = this.connectionSelectorsTables || this.connectionSelectorsElements;\r\n\r\n\t\t\tthis.subscribe(\"cell-init\", this.initializeCell.bind(this));\r\n\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeGroupHeader(group){\r\n\t\tvar self = this,\r\n\t\tconfig = {},\r\n\t\trowEl;\r\n\r\n\t\t//inter table drag drop\r\n\t\tconfig.mouseup = function(e){\r\n\t\t\tself.tableRowDrop(e, row);\r\n\t\t}.bind(self);\r\n\r\n\t\t//same table drag drop\r\n\t\tconfig.mousemove = function(e){\r\n\t\t\tif(((e.pageY - Helpers.elOffset(group.element).top) + self.table.rowManager.element.scrollTop) > (group.getHeight() / 2)){\r\n\t\t\t\tif(self.toRow !== group || !self.toRowAfter){\r\n\t\t\t\t\tvar rowEl = group.getElement();\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);\r\n\t\t\t\t\tself.moveRow(group, true);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(self.toRow !== group || self.toRowAfter){\r\n\t\t\t\t\tvar rowEl = group.getElement();\r\n\t\t\t\t\tif(rowEl.previousSibling){\r\n\t\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl);\r\n\t\t\t\t\t\tself.moveRow(group, false);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.bind(self);\r\n\r\n\t\tgroup.modules.moveRow = config;\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\tconfig = {},\r\n\t\trowEl;\r\n\r\n\t\t//inter table drag drop\r\n\t\tconfig.mouseup = function(e){\r\n\t\t\tself.tableRowDrop(e, row);\r\n\t\t}.bind(self);\r\n\r\n\t\t//same table drag drop\r\n\t\tconfig.mousemove = function(e){\r\n\t\t\tvar rowEl = row.getElement();\r\n\r\n\t\t\tif(((e.pageY - Helpers.elOffset(rowEl).top) + self.table.rowManager.element.scrollTop) > (row.getHeight() / 2)){\r\n\t\t\t\tif(self.toRow !== row || !self.toRowAfter){\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);\r\n\t\t\t\t\tself.moveRow(row, true);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(self.toRow !== row || self.toRowAfter){\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl);\r\n\t\t\t\t\tself.moveRow(row, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.bind(self);\r\n\r\n\r\n\t\tif(!this.hasHandle){\r\n\r\n\t\t\trowEl = row.getElement();\r\n\r\n\t\t\trowEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, row);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trowEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.bindTouchEvents(row, row.getElement());\r\n\t\t}\r\n\r\n\t\trow.modules.moveRow = config;\r\n\t}\r\n\r\n\tinitializeColumn(column){\r\n\t\tif(column.definition.rowHandle && this.table.options.movableRows !== false){\r\n\t\t\tthis.hasHandle = true;\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeCell(cell){\r\n\t\tif(cell.column.definition.rowHandle && this.table.options.movableRows !== false){\r\n\t\t\tvar self = this,\r\n\t\t\tcellEl = cell.getElement(true);\r\n\r\n\t\t\tcellEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, cell.row);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tcellEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.bindTouchEvents(cell.row, cellEl);\r\n\t\t}\r\n\t}\r\n\r\n\tbindTouchEvents(row, element){\r\n\t\tvar startYMove = false, //shifting center position of the cell\r\n\t\tdir = false,\r\n\t\tcurrentRow, nextRow, prevRow, nextRowHeight, prevRowHeight, nextRowHeightLast, prevRowHeightLast;\r\n\r\n\t\telement.addEventListener(\"touchstart\", (e) => {\r\n\t\t\tthis.checkTimeout = setTimeout(() => {\r\n\t\t\t\tthis.touchMove = true;\r\n\t\t\t\tcurrentRow = row;\r\n\t\t\t\tnextRow = row.nextRow();\r\n\t\t\t\tnextRowHeight = nextRow ? nextRow.getHeight()/2 : 0;\r\n\t\t\t\tprevRow = row.prevRow();\r\n\t\t\t\tprevRowHeight = prevRow ? prevRow.getHeight()/2 : 0;\r\n\t\t\t\tnextRowHeightLast = 0;\r\n\t\t\t\tprevRowHeightLast = 0;\r\n\t\t\t\tstartYMove = false;\r\n\r\n\t\t\t\tthis.startMove(e, row);\r\n\t\t\t}, this.checkPeriod);\r\n\t\t}, {passive: true});\r\n\t\tthis.moving, this.toRow, this.toRowAfter\r\n\t\telement.addEventListener(\"touchmove\", (e) => {\r\n\r\n\t\t\tvar halfCol, diff, moveToRow;\r\n\r\n\t\t\tif(this.moving){\r\n\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\tthis.moveHover(e);\r\n\r\n\t\t\t\tif(!startYMove){\r\n\t\t\t\t\tstartYMove = e.touches[0].pageY;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdiff = e.touches[0].pageY - startYMove;\r\n\r\n\t\t\t\tif(diff > 0){\r\n\t\t\t\t\tif(nextRow && diff - nextRowHeightLast > nextRowHeight){\r\n\t\t\t\t\t\tmoveToRow = nextRow;\r\n\r\n\t\t\t\t\t\tif(moveToRow !== row){\r\n\t\t\t\t\t\t\tstartYMove = e.touches[0].pageY\r\n\t\t\t\t\t\t\tmoveToRow.getElement().parentNode.insertBefore(this.placeholderElement, moveToRow.getElement().nextSibling);\r\n\t\t\t\t\t\t\tthis.moveRow(moveToRow, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(prevRow && -diff - prevRowHeightLast > prevRowHeight){\r\n\t\t\t\t\t\tmoveToRow = prevRow;\r\n\r\n\t\t\t\t\t\tif(moveToRow !== row){\r\n\t\t\t\t\t\t\tstartYMove = e.touches[0].pageY;\r\n\t\t\t\t\t\t\tmoveToRow.getElement().parentNode.insertBefore(this.placeholderElement, moveToRow.getElement());\r\n\t\t\t\t\t\t\tthis.moveRow(moveToRow, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(moveToRow){\r\n\t\t\t\t\tcurrentRow = moveToRow;\r\n\t\t\t\t\tnextRow = moveToRow.nextRow();\r\n\t\t\t\t\tnextRowHeightLast = nextRowHeight;\r\n\t\t\t\t\tnextRowHeight = nextRow ? nextRow.getHeight() / 2 : 0;\r\n\t\t\t\t\tprevRow = moveToRow.prevRow();\r\n\t\t\t\t\tprevRowHeightLast = prevRowHeight;\r\n\t\t\t\t\tprevRowHeight = prevRow ? prevRow.getHeight() / 2 : 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\telement.addEventListener(\"touchend\", (e) => {\r\n\t\t\tif(this.checkTimeout){\r\n\t\t\t\tclearTimeout(this.checkTimeout);\r\n\t\t\t}\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.endMove(e);\r\n\t\t\t\tthis.touchMove = false;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t_bindMouseMove(){\r\n\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\tif((row.type === \"row\" || row.type === \"group\") && row.modules.moveRow && row.modules.moveRow.mousemove){\r\n\t\t\t\trow.getElement().addEventListener(\"mousemove\", row.modules.moveRow.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t_unbindMouseMove(){\r\n\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\tif((row.type === \"row\" || row.type === \"group\") && row.modules.moveRow && row.modules.moveRow.mousemove){\r\n\t\t\t\trow.getElement().removeEventListener(\"mousemove\", row.modules.moveRow.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tstartMove(e, row){\r\n\t\tvar element = row.getElement();\r\n\r\n\t\tthis.setStartPosition(e, row);\r\n\r\n\t\tthis.moving = row;\r\n\r\n\t\tthis.table.element.classList.add(\"tabulator-block-select\");\r\n\r\n\t\t//create placeholder\r\n\t\tthis.placeholderElement.style.width = row.getWidth() + \"px\";\r\n\t\tthis.placeholderElement.style.height = row.getHeight() + \"px\";\r\n\r\n\t\tif(!this.connection){\r\n\t\t\telement.parentNode.insertBefore(this.placeholderElement, element);\r\n\t\t\telement.parentNode.removeChild(element);\r\n\t\t}else{\r\n\t\t\tthis.table.element.classList.add(\"tabulator-movingrow-sending\");\r\n\t\t\tthis.connectToTables(row);\r\n\t\t}\r\n\r\n\t\t//create hover element\r\n\t\tthis.hoverElement = element.cloneNode(true);\r\n\t\tthis.hoverElement.classList.add(\"tabulator-moving\");\r\n\r\n\t\tif(this.connection){\r\n\t\t\tdocument.body.appendChild(this.hoverElement);\r\n\t\t\tthis.hoverElement.style.left = \"0\";\r\n\t\t\tthis.hoverElement.style.top = \"0\";\r\n\t\t\tthis.hoverElement.style.width = this.table.element.clientWidth + \"px\";\r\n\t\t\tthis.hoverElement.style.whiteSpace = \"nowrap\";\r\n\t\t\tthis.hoverElement.style.overflow = \"hidden\";\r\n\t\t\tthis.hoverElement.style.pointerEvents = \"none\";\r\n\t\t}else{\r\n\t\t\tthis.table.rowManager.getTableElement().appendChild(this.hoverElement);\r\n\r\n\t\t\tthis.hoverElement.style.left = \"0\";\r\n\t\t\tthis.hoverElement.style.top = \"0\";\r\n\r\n\t\t\tthis._bindMouseMove();\r\n\t\t}\r\n\r\n\t\tdocument.body.addEventListener(\"mousemove\", this.moveHover);\r\n\t\tdocument.body.addEventListener(\"mouseup\", this.endMove);\r\n\r\n\t\tthis.dispatchExternal(\"rowMoving\", row.getComponent());\r\n\r\n\t\tthis.moveHover(e);\r\n\t}\r\n\r\n\tsetStartPosition(e, row){\r\n\t\tvar pageX = this.touchMove ? e.touches[0].pageX : e.pageX,\r\n\t\tpageY = this.touchMove ? e.touches[0].pageY : e.pageY,\r\n\t\telement, position;\r\n\r\n\t\telement = row.getElement();\r\n\t\tif(this.connection){\r\n\t\t\tposition = element.getBoundingClientRect();\r\n\r\n\t\t\tthis.startX = position.left - pageX + window.pageXOffset;\r\n\t\t\tthis.startY = position.top - pageY + window.pageYOffset;\r\n\t\t}else{\r\n\t\t\tthis.startY = (pageY - element.getBoundingClientRect().top);\r\n\t\t}\r\n\t}\r\n\r\n\tendMove(e){\r\n\t\tif(!e || e.which === 1 || this.touchMove){\r\n\t\t\tthis._unbindMouseMove();\r\n\r\n\t\t\tif(!this.connection){\r\n\t\t\t\tthis.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling);\r\n\t\t\t\tthis.placeholderElement.parentNode.removeChild(this.placeholderElement);\r\n\t\t\t}\r\n\r\n\t\t\tthis.hoverElement.parentNode.removeChild(this.hoverElement);\r\n\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-block-select\");\r\n\r\n\t\t\tif(this.toRow){\r\n\t\t\t\tthis.table.rowManager.moveRow(this.moving, this.toRow, this.toRowAfter);\r\n\t\t\t}else{\r\n\t\t\t\tthis.dispatchExternal(\"rowMoveCancelled\", this.moving.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tthis.moving = false;\r\n\t\t\tthis.toRow = false;\r\n\t\t\tthis.toRowAfter = false;\r\n\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", this.moveHover);\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", this.endMove);\r\n\r\n\t\t\tif(this.connection){\r\n\t\t\t\tthis.table.element.classList.remove(\"tabulator-movingrow-sending\");\r\n\t\t\t\tthis.disconnectFromTables();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmoveRow(row, after){\r\n\t\tthis.toRow = row;\r\n\t\tthis.toRowAfter = after;\r\n\t}\r\n\r\n\tmoveHover(e){\r\n\t\tif(this.connection){\r\n\t\t\tthis.moveHoverConnections.call(this, e);\r\n\t\t}else{\r\n\t\t\tthis.moveHoverTable.call(this, e);\r\n\t\t}\r\n\t}\r\n\r\n\tmoveHoverTable(e){\r\n\t\tvar rowHolder = this.table.rowManager.getElement(),\r\n\t\tscrollTop = rowHolder.scrollTop,\r\n\t\tyPos = ((this.touchMove ? e.touches[0].pageY : e.pageY) - rowHolder.getBoundingClientRect().top) + scrollTop,\r\n\t\tscrollPos;\r\n\r\n\t\tthis.hoverElement.style.top = (yPos - this.startY) + \"px\";\r\n\t}\r\n\r\n\tmoveHoverConnections(e){\r\n\t\tthis.hoverElement.style.left = (this.startX + (this.touchMove ? e.touches[0].pageX : e.pageX)) + \"px\";\r\n\t\tthis.hoverElement.style.top = (this.startY + (this.touchMove ? e.touches[0].pageY : e.pageY)) + \"px\";\r\n\t}\r\n\r\n\telementRowDrop(e, element, row){\r\n\t\tthis.dispatchExternal(\"movableRowsElementDrop\", e, element, row ? row.getComponent() : false);\r\n\t}\r\n\r\n\t//establish connection with other tables\r\n\tconnectToTables(row){\r\n\t\tvar connectionTables;\r\n\r\n\t\tif(this.connectionSelectorsTables){\r\n\t\t\tconnectionTables = this.commsConnections(this.connectionSelectorsTables);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSendingStart\", connectionTables);\r\n\r\n\t\t\tthis.commsSend(this.connectionSelectorsTables, \"moveRow\", \"connect\", {\r\n\t\t\t\trow:row,\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.connectionSelectorsElements){\r\n\r\n\t\t\tthis.connectionElements = [];\r\n\r\n\t\t\tif(!Array.isArray(this.connectionSelectorsElements)){\r\n\t\t\t\tthis.connectionSelectorsElements = [this.connectionSelectorsElements];\r\n\t\t\t}\r\n\r\n\t\t\tthis.connectionSelectorsElements.forEach((query) => {\r\n\t\t\t\tif(typeof query === \"string\"){\r\n\t\t\t\t\tthis.connectionElements = this.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(query)));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.connectionElements.push(query);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.connectionElements.forEach((element) => {\r\n\t\t\t\tvar dropEvent = (e) => {\r\n\t\t\t\t\tthis.elementRowDrop(e, element, this.moving);\r\n\t\t\t\t};\r\n\r\n\t\t\t\telement.addEventListener(\"mouseup\", dropEvent);\r\n\t\t\t\telement.tabulatorElementDropEvent = dropEvent;\r\n\r\n\t\t\t\telement.classList.add(\"tabulator-movingrow-receiving\");\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t//disconnect from other tables\r\n\tdisconnectFromTables(){\r\n\t\tvar connectionTables;\r\n\r\n\t\tif(this.connectionSelectorsTables){\r\n\t\t\tconnectionTables = this.commsConnections(this.connectionSelectorsTables);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSendingStop\", connectionTables);\r\n\r\n\t\t\tthis.commsSend(this.connectionSelectorsTables, \"moveRow\", \"disconnect\");\r\n\t\t}\r\n\r\n\t\tthis.connectionElements.forEach((element) => {\r\n\t\t\telement.classList.remove(\"tabulator-movingrow-receiving\");\r\n\t\t\telement.removeEventListener(\"mouseup\", element.tabulatorElementDropEvent);\r\n\t\t\tdelete element.tabulatorElementDropEvent;\r\n\t\t});\r\n\t}\r\n\r\n\t//accept incomming connection\r\n\tconnect(table, row){\r\n\t\tif(!this.connectedTable){\r\n\t\t\tthis.connectedTable = table;\r\n\t\t\tthis.connectedRow = row;\r\n\r\n\t\t\tthis.table.element.classList.add(\"tabulator-movingrow-receiving\");\r\n\r\n\t\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\t\tif(row.type === \"row\" && row.modules.moveRow && row.modules.moveRow.mouseup){\r\n\t\t\t\t\trow.getElement().addEventListener(\"mouseup\", row.modules.moveRow.mouseup);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.tableRowDropEvent = this.tableRowDrop.bind(this);\r\n\r\n\t\t\tthis.table.element.addEventListener(\"mouseup\", this.tableRowDropEvent);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivingStart\", row, table);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Row Error - Table cannot accept connection, already connected to table:\", this.connectedTable);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//close incomming connection\r\n\tdisconnect(table){\r\n\t\tif(table === this.connectedTable){\r\n\t\t\tthis.connectedTable = false;\r\n\t\t\tthis.connectedRow = false;\r\n\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-movingrow-receiving\");\r\n\r\n\t\t\tthis.table.rowManager.getDisplayRows().forEach((row) =>{\r\n\t\t\t\tif(row.type === \"row\" && row.modules.moveRow && row.modules.moveRow.mouseup){\r\n\t\t\t\t\trow.getElement().removeEventListener(\"mouseup\", row.modules.moveRow.mouseup);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.table.element.removeEventListener(\"mouseup\", this.tableRowDropEvent);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivingStop\", table);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Row Error - trying to disconnect from non connected table\")\r\n\t\t}\r\n\t}\r\n\r\n\tdropComplete(table, row, success){\r\n\t\tvar sender = false;\r\n\r\n\t\tif(success){\r\n\r\n\t\t\tswitch(typeof this.table.options.movableRowsSender){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tsender = this.senders[this.table.options.movableRowsSender];\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tsender = this.table.options.movableRowsSender;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(sender){\r\n\t\t\t\tsender.call(this, this.moving.getComponent(), row ? row.getComponent() : undefined, table)\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.options.movableRowsSender){\r\n\t\t\t\t\tconsole.warn(\"Mover Row Error - no matching sender found:\", this.table.options.movableRowsSender);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSent\", this.moving.getComponent(), row ? row.getComponent() : undefined, table);\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"movableRowsSentFailed\", this.moving.getComponent(), row ? row.getComponent() : undefined, table);\r\n\t\t}\r\n\r\n\t\tthis.endMove();\r\n\t}\r\n\r\n\ttableRowDrop(e, row){\r\n\t\tvar receiver = false,\r\n\t\tsuccess = false;\r\n\r\n\t\te.stopImmediatePropagation();\r\n\r\n\t\tswitch(typeof this.table.options.movableRowsReceiver){\r\n\t\t\tcase \"string\":\r\n\t\t\treceiver = this.receivers[this.table.options.movableRowsReceiver];\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\treceiver = this.table.options.movableRowsReceiver;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(receiver){\r\n\t\t\tsuccess = receiver.call(this, this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable)\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Mover Row Error - no matching receiver found:\", this.table.options.movableRowsReceiver)\r\n\t\t}\r\n\r\n\t\tif(success){\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceived\", this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivedFailed\", this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);\r\n\t\t}\r\n\r\n\t\tthis.commsSend(this.connectedTable, \"moveRow\", \"dropcomplete\", {\r\n\t\t\trow:row,\r\n\t\t\tsuccess:success,\r\n\t\t});\r\n\t}\r\n\r\n\tcommsReceived(table, action, data){\r\n\t\tswitch(action){\r\n\t\t\tcase \"connect\":\r\n\t\t\treturn this.connect(table, data.row);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"disconnect\":\r\n\t\t\treturn this.disconnect(table);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"dropcomplete\":\r\n\t\t\treturn this.dropComplete(table, data.row, data.success);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMoveRows.prototype.receivers = {\r\n\tinsert:function(fromRow, toRow, fromTable){\r\n\t\tthis.table.addRow(fromRow.getData(), undefined, toRow);\r\n\t\treturn true;\r\n\t},\r\n\r\n\tadd:function(fromRow, toRow, fromTable){\r\n\t\tthis.table.addRow(fromRow.getData());\r\n\t\treturn true;\r\n\t},\r\n\r\n\tupdate:function(fromRow, toRow, fromTable){\r\n\t\tif(toRow){\r\n\t\t\ttoRow.update(fromRow.getData());\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n\r\n\treplace:function(fromRow, toRow, fromTable){\r\n\t\tif(toRow){\r\n\t\t\tthis.table.addRow(fromRow.getData(), undefined, toRow);\r\n\t\t\ttoRow.delete();\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n};\r\n\r\nMoveRows.prototype.senders = {\r\n\tdelete:function(fromRow, toRow, toTable){\r\n\t\tfromRow.delete();\r\n\t}\r\n};\r\n\r\nMoveRows.moduleName = \"moveRow\";\r\n\r\nexport default MoveRows;","import Module from '../../core/Module.js';\r\n\r\nimport defaultMutators from './defaults/mutators.js';\r\n\r\nclass Mutator extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.allowedTypes = [\"\", \"data\", \"edit\", \"clipboard\"]; //list of muatation types\r\n\t\tthis.enabled = true;\r\n\r\n\t\tthis.registerColumnOption(\"mutator\");\r\n\t\tthis.registerColumnOption(\"mutatorParams\");\r\n\t\tthis.registerColumnOption(\"mutatorData\");\r\n\t\tthis.registerColumnOption(\"mutatorDataParams\");\r\n\t\tthis.registerColumnOption(\"mutatorEdit\");\r\n\t\tthis.registerColumnOption(\"mutatorEditParams\");\r\n\t\tthis.registerColumnOption(\"mutatorClipboard\");\r\n\t\tthis.registerColumnOption(\"mutatorClipboardParams\");\r\n\t\tthis.registerColumnOption(\"mutateLink\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-value-changing\", this.transformCell.bind(this));\r\n\t\tthis.subscribe(\"cell-value-changed\", this.mutateLink.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"row-data-init-before\", this.rowDataChanged.bind(this));\r\n\t\tthis.subscribe(\"row-data-changing\", this.rowDataChanged.bind(this));\r\n\t}\r\n\r\n\trowDataChanged(row, tempData, updatedData){\r\n\t\treturn this.transformRow(tempData, \"data\", updatedData);\r\n\t}\r\n\r\n\t//initialize column mutator\r\n\tinitializeColumn(column){\r\n\t\tvar match = false,\r\n\t\tconfig = {};\r\n\r\n\t\tthis.allowedTypes.forEach((type) => {\r\n\t\t\tvar key = \"mutator\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\t\tmutator;\r\n\r\n\t\t\tif(column.definition[key]){\r\n\t\t\t\tmutator = this.lookupMutator(column.definition[key]);\r\n\r\n\t\t\t\tif(mutator){\r\n\t\t\t\t\tmatch = true;\r\n\r\n\t\t\t\t\tconfig[key] = {\r\n\t\t\t\t\t\tmutator:mutator,\r\n\t\t\t\t\t\tparams: column.definition[key + \"Params\"] || {},\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(match){\r\n\t\t\tcolumn.modules.mutate = config;\r\n\t\t}\r\n\t}\r\n\r\n\tlookupMutator(value){\r\n\t\tvar mutator = false;\r\n\r\n\t\t//set column mutator\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(Mutator.mutators[value]){\r\n\t\t\t\tmutator = Mutator.mutators[value];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Mutator Error - No such mutator found, ignoring: \", value);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tmutator = value;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn mutator;\r\n\t}\r\n\r\n\t//apply mutator to row\r\n\ttransformRow(data, type, updatedData){\r\n\t\tvar key = \"mutator\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\tvalue;\r\n\r\n\t\tif(this.enabled){\r\n\r\n\t\t\tthis.table.columnManager.traverse((column) => {\r\n\t\t\t\tvar mutator, params, component;\r\n\r\n\t\t\t\tif(column.modules.mutate){\r\n\t\t\t\t\tmutator = column.modules.mutate[key] || column.modules.mutate.mutator || false;\r\n\r\n\t\t\t\t\tif(mutator){\r\n\t\t\t\t\t\tvalue = column.getFieldValue(typeof updatedData !== \"undefined\" ? updatedData : data);\r\n\r\n\t\t\t\t\t\tif(type == \"data\" || typeof value !== \"undefined\"){\r\n\t\t\t\t\t\t\tcomponent = column.getComponent();\r\n\t\t\t\t\t\t\tparams = typeof mutator.params === \"function\" ? mutator.params(value, data, type, component) : mutator.params;\r\n\t\t\t\t\t\t\tcolumn.setFieldValue(data, mutator.mutator(value, data, type, params, component));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//apply mutator to new cell value\r\n\ttransformCell(cell, value){\r\n\t\tif(cell.column.modules.mutate){\r\n\t\t\tvar mutator = cell.column.modules.mutate.mutatorEdit || cell.column.modules.mutate.mutator || false,\r\n\t\t\ttempData = {};\r\n\r\n\t\t\tif(mutator){\r\n\t\t\t\ttempData = Object.assign(tempData, cell.row.getData());\r\n\t\t\t\tcell.column.setFieldValue(tempData, value);\r\n\t\t\t\treturn mutator.mutator(value, tempData, \"edit\", mutator.params, cell.getComponent());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\tmutateLink(cell){\r\n\t\tvar links = cell.column.definition.mutateLink;\r\n\r\n\t\tif(links){\r\n\t\t\tif(!Array.isArray(links)){\r\n\t\t\t\tlinks = [links];\r\n\t\t\t}\r\n\r\n\t\t\tlinks.forEach((link) => {\r\n\t\t\t\tvar linkCell = cell.row.getCell(link);\r\n\r\n\t\t\t\tif(linkCell){\r\n\t\t\t\t\tlinkCell.setValue(linkCell.getValue(), true, true);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tenable(){\r\n\t\tthis.enabled = true;\r\n\t}\r\n\r\n\tdisable(){\r\n\t\tthis.enabled = false;\r\n\t}\r\n}\r\n\r\nMutator.moduleName = \"mutator\";\r\n\r\n//load defaults\r\nMutator.mutators = defaultMutators;\r\n\r\nexport default Mutator;","export default {};","import rows from './pageCounters/rows.js';\r\nimport pages from './pageCounters/pages.js';\r\n\r\n\r\nexport default {\r\n\trows:rows,\r\n\tpages:pages,\r\n};","export default function(pageSize, currentRow, currentPage, totalRows, totalPages){\r\n\tvar el = document.createElement(\"span\"),\r\n\tshowingEl = document.createElement(\"span\"),\r\n\tvalueEl = document.createElement(\"span\"),\r\n\tofEl = document.createElement(\"span\"),\r\n\ttotalEl = document.createElement(\"span\"),\r\n\trowsEl = document.createElement(\"span\");\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|showing\", (value) => {\r\n\t\tshowingEl.innerHTML = value;\r\n\t});\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|of\", (value) => {\r\n\t\tofEl.innerHTML = value;\r\n\t});\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|rows\", (value) => {\r\n\t\trowsEl.innerHTML = value;\r\n\t});\r\n\r\n\tif(totalRows){\r\n\t\tvalueEl.innerHTML = \" \" + currentRow + \"-\" + Math.min((currentRow + pageSize - 1), totalRows) + \" \";\r\n\t\t\r\n\t\ttotalEl.innerHTML = \" \" + totalRows + \" \";\r\n\t\t\r\n\t\tel.appendChild(showingEl);\r\n\t\tel.appendChild(valueEl);\r\n\t\tel.appendChild(ofEl);\r\n\t\tel.appendChild(totalEl);\r\n\t\tel.appendChild(rowsEl);\r\n\t}else{\r\n\t\tvalueEl.innerHTML = \" 0 \";\r\n\r\n\t\tel.appendChild(showingEl);\r\n\t\tel.appendChild(valueEl);\r\n\t\tel.appendChild(rowsEl);\r\n\t}\r\n\t\r\n\treturn el;\r\n};","export default function(pageSize, currentRow, currentPage, totalRows, totalPages){\r\n\r\n var el = document.createElement(\"span\"),\r\n\tshowingEl = document.createElement(\"span\"),\r\n\tvalueEl = document.createElement(\"span\"),\r\n\tofEl = document.createElement(\"span\"),\r\n\ttotalEl = document.createElement(\"span\"),\r\n\trowsEl = document.createElement(\"span\");\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|showing\", (value) => {\r\n\t\tshowingEl.innerHTML = value;\r\n\t});\r\n\t\r\n\tvalueEl.innerHTML = \" \" + currentPage + \" \";\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|of\", (value) => {\r\n\t\tofEl.innerHTML = value;\r\n\t});\r\n\t\r\n\ttotalEl.innerHTML = \" \" + totalPages + \" \";\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|pages\", (value) => {\r\n\t\trowsEl.innerHTML = value;\r\n\t});\r\n\t\r\n\tel.appendChild(showingEl);\r\n\tel.appendChild(valueEl);\r\n\tel.appendChild(ofEl);\r\n\tel.appendChild(totalEl);\r\n\tel.appendChild(rowsEl);\r\n\t\r\n\treturn el;\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultPageCounters from './defaults/pageCounters.js';\r\n\r\nclass Page extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.mode = \"local\";\r\n\t\tthis.progressiveLoad = false;\r\n\t\t\r\n\t\tthis.element = null;\r\n\t\tthis.pageCounterElement = null;\r\n\t\tthis.pageCounter = null;\r\n\t\t\r\n\t\tthis.size = 0;\r\n\t\tthis.page = 1;\r\n\t\tthis.count = 5;\r\n\t\tthis.max = 1;\r\n\r\n\t\tthis.remoteRowCountEstimate = null;\r\n\t\t\r\n\t\tthis.displayIndex = 0; //index in display pipeline\r\n\t\t\r\n\t\tthis.initialLoad = true;\r\n\t\tthis.dataChanging = false; //flag to check if data is being changed by this module\r\n\t\t\r\n\t\tthis.pageSizes = [];\r\n\t\t\r\n\t\tthis.registerTableOption(\"pagination\", false); //set pagination type\r\n\t\tthis.registerTableOption(\"paginationMode\", \"local\"); //local or remote pagination\r\n\t\tthis.registerTableOption(\"paginationSize\", false); //set number of rows to a page\r\n\t\tthis.registerTableOption(\"paginationInitialPage\", 1); //initial page to show on load\r\n\t\tthis.registerTableOption(\"paginationCounter\", false); // set pagination counter\r\n\t\tthis.registerTableOption(\"paginationCounterElement\", false); // set pagination counter\r\n\t\tthis.registerTableOption(\"paginationButtonCount\", 5); // set count of page button\r\n\t\tthis.registerTableOption(\"paginationSizeSelector\", false); //add pagination size selector element\r\n\t\tthis.registerTableOption(\"paginationElement\", false); //element to hold pagination numbers\r\n\t\t// this.registerTableOption(\"paginationDataSent\", {}); //pagination data sent to the server\r\n\t\t// this.registerTableOption(\"paginationDataReceived\", {}); //pagination data received from the server\r\n\t\tthis.registerTableOption(\"paginationAddRow\", \"page\"); //add rows on table or page\r\n\t\t\r\n\t\tthis.registerTableOption(\"progressiveLoad\", false); //progressive loading\r\n\t\tthis.registerTableOption(\"progressiveLoadDelay\", 0); //delay between requests\r\n\t\tthis.registerTableOption(\"progressiveLoadScrollMargin\", 0); //margin before scroll begins\r\n\t\t\r\n\t\tthis.registerTableFunction(\"setMaxPage\", this.setMaxPage.bind(this));\r\n\t\tthis.registerTableFunction(\"setPage\", this.setPage.bind(this));\r\n\t\tthis.registerTableFunction(\"setPageToRow\", this.userSetPageToRow.bind(this));\r\n\t\tthis.registerTableFunction(\"setPageSize\", this.userSetPageSize.bind(this));\r\n\t\tthis.registerTableFunction(\"getPageSize\", this.getPageSize.bind(this));\r\n\t\tthis.registerTableFunction(\"previousPage\", this.previousPage.bind(this));\r\n\t\tthis.registerTableFunction(\"nextPage\", this.nextPage.bind(this));\r\n\t\tthis.registerTableFunction(\"getPage\", this.getPage.bind(this));\r\n\t\tthis.registerTableFunction(\"getPageMax\", this.getPageMax.bind(this));\r\n\t\t\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"pageTo\", this.setPageToRow.bind(this));\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"row-added\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"data-processed\", this.initialLoadComplete.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.calculatePageSizes.bind(this));\r\n\t\t\tthis.subscribe(\"footer-redraw\", this.footerRedraw.bind(this));\r\n\r\n\t\t\tif(this.table.options.paginationAddRow == \"page\"){\r\n\t\t\t\tthis.subscribe(\"row-adding-position\", this.rowAddingPosition.bind(this));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.options.paginationMode === \"remote\"){\r\n\t\t\t\tthis.subscribe(\"data-params\", this.remotePageParams.bind(this));\r\n\t\t\t\tthis.subscribe(\"data-loaded\", this._parseRemoteData.bind(this));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.options.progressiveLoad){\r\n\t\t\t\tconsole.error(\"Progressive Load Error - Pagination and progressive load cannot be used at the same time\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.registerDisplayHandler(this.restOnRenderBefore.bind(this), 40);\r\n\t\t\tthis.registerDisplayHandler(this.getRows.bind(this), 50);\r\n\t\t\t\r\n\t\t\tthis.createElements();\r\n\t\t\tthis.initializePageCounter();\r\n\t\t\tthis.initializePaginator();\r\n\t\t}else if(this.table.options.progressiveLoad){\r\n\t\t\tthis.subscribe(\"data-params\", this.remotePageParams.bind(this));\r\n\t\t\tthis.subscribe(\"data-loaded\", this._parseRemoteData.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.calculatePageSizes.bind(this));\r\n\t\t\tthis.subscribe(\"data-processed\", this.initialLoadComplete.bind(this));\r\n\t\t\t\r\n\t\t\tthis.initializeProgressive(this.table.options.progressiveLoad)\r\n\t\t\t\r\n\t\t\tif(this.table.options.progressiveLoad === \"scroll\"){\r\n\t\t\t\tthis.subscribe(\"scroll-vertical\", this.scrollVertical.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trowAddingPosition(row, top){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tdispRows = rowManager.getDisplayRows(),\r\n\t\tindex;\r\n\t\t\r\n\t\tif(top){\r\n\t\t\tif(dispRows.length){\r\n\t\t\t\tindex = dispRows[0];\r\n\t\t\t}else{\r\n\t\t\t\tif(rowManager.activeRows.length){\r\n\t\t\t\t\tindex = rowManager.activeRows[rowManager.activeRows.length-1];\r\n\t\t\t\t\ttop = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(dispRows.length){\r\n\t\t\t\tindex = dispRows[dispRows.length - 1];\r\n\t\t\t\ttop = dispRows.length < this.size ? false : true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn {index, top}\r\n\t}\r\n\t\r\n\tcalculatePageSizes(){\r\n\t\tvar testElRow, testElCell;\r\n\t\t\r\n\t\tif(this.table.options.paginationSize){\r\n\t\t\tthis.size = this.table.options.paginationSize;\r\n\t\t}else{\r\n\t\t\ttestElRow = document.createElement(\"div\");\r\n\t\t\ttestElRow.classList.add(\"tabulator-row\");\r\n\t\t\ttestElRow.style.visibility = \"hidden\";\r\n\t\t\t\r\n\t\t\ttestElCell = document.createElement(\"div\");\r\n\t\t\ttestElCell.classList.add(\"tabulator-cell\");\r\n\t\t\ttestElCell.innerHTML = \"Page Row Test\";\r\n\t\t\t\r\n\t\t\ttestElRow.appendChild(testElCell);\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.getTableElement().appendChild(testElRow);\r\n\t\t\t\r\n\t\t\tthis.size = Math.floor(this.table.rowManager.getElement().clientHeight / testElRow.offsetHeight);\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.getTableElement().removeChild(testElRow);\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(\"pageSizeChanged\", this.size);\r\n\t\t\r\n\t\tthis.generatePageSizeSelectList();\r\n\t}\r\n\t\r\n\tinitialLoadComplete(){\r\n\t\tthis.initialLoad = false;\r\n\t}\r\n\t\r\n\tremotePageParams(data, config, silent, params){\r\n\t\tif(!this.initialLoad){\r\n\t\t\tif((this.progressiveLoad && !silent) || (!this.progressiveLoad && !this.dataChanging)){\r\n\t\t\t\tthis.reset(true);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//configure request params\r\n\t\tparams.page = this.page;\r\n\t\t\r\n\t\t//set page size if defined\r\n\t\tif(this.size){\r\n\t\t\tparams.size = this.size;\r\n\t\t}\r\n\t\t\r\n\t\treturn params;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\tuserSetPageToRow(row){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\trow = this.rowManager.findRow(row);\r\n\t\t\t\r\n\t\t\tif(row){\r\n\t\t\t\treturn this.setPageToRow(row)\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn Promise.reject();\r\n\t}\r\n\t\r\n\tuserSetPageSize(size){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\tthis.setPageSize(size);\r\n\t\t\treturn this.setPage(1);\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tscrollVertical(top, dir){\r\n\t\tvar element, diff, margin;\r\n\t\tif(!dir && !this.table.dataLoader.loading){\r\n\t\t\telement = this.table.rowManager.getElement();\r\n\t\t\tdiff = element.scrollHeight - element.clientHeight - top;\r\n\t\t\tmargin = this.table.options.progressiveLoadScrollMargin || (element.clientHeight * 2);\r\n\t\t\t\r\n\t\t\tif(diff < margin){\r\n\t\t\t\tthis.nextPage()\r\n\t\t\t\t.catch(() => {}); //consume the exception thrown when on the last page\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trestOnRenderBefore(rows, renderInPosition){\r\n\t\tif(!renderInPosition){\r\n\t\t\tif(this.mode === \"local\"){\r\n\t\t\t\tthis.reset();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\trowsUpdated(){\r\n\t\tthis.refreshData(true, \"all\");\r\n\t}\r\n\t\r\n\tcreateElements(){\r\n\t\tvar button;\r\n\t\t\r\n\t\tthis.element = document.createElement(\"span\");\r\n\t\tthis.element.classList.add(\"tabulator-paginator\");\r\n\t\t\r\n\t\tthis.pagesElement = document.createElement(\"span\");\r\n\t\tthis.pagesElement.classList.add(\"tabulator-pages\");\r\n\t\t\r\n\t\tbutton = document.createElement(\"button\");\r\n\t\tbutton.classList.add(\"tabulator-page\");\r\n\t\tbutton.setAttribute(\"type\", \"button\");\r\n\t\tbutton.setAttribute(\"role\", \"button\");\r\n\t\tbutton.setAttribute(\"aria-label\", \"\");\r\n\t\tbutton.setAttribute(\"title\", \"\");\r\n\t\t\r\n\t\tthis.firstBut = button.cloneNode(true);\r\n\t\tthis.firstBut.setAttribute(\"data-page\", \"first\");\r\n\t\t\r\n\t\tthis.prevBut = button.cloneNode(true);\r\n\t\tthis.prevBut.setAttribute(\"data-page\", \"prev\");\r\n\t\t\r\n\t\tthis.nextBut = button.cloneNode(true);\r\n\t\tthis.nextBut.setAttribute(\"data-page\", \"next\");\r\n\t\t\r\n\t\tthis.lastBut = button.cloneNode(true);\r\n\t\tthis.lastBut.setAttribute(\"data-page\", \"last\");\r\n\t\t\r\n\t\tif(this.table.options.paginationSizeSelector){\r\n\t\t\tthis.pageSizeSelect = document.createElement(\"select\");\r\n\t\t\tthis.pageSizeSelect.classList.add(\"tabulator-page-size\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tgeneratePageSizeSelectList(){\r\n\t\tvar pageSizes = [];\r\n\t\t\r\n\t\tif(this.pageSizeSelect){\r\n\t\t\t\r\n\t\t\tif(Array.isArray(this.table.options.paginationSizeSelector)){\r\n\t\t\t\tpageSizes = this.table.options.paginationSizeSelector;\r\n\t\t\t\tthis.pageSizes = pageSizes;\r\n\t\t\t\t\r\n\t\t\t\tif(this.pageSizes.indexOf(this.size) == -1){\r\n\t\t\t\t\tpageSizes.unshift(this.size);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t\r\n\t\t\t\tif(this.pageSizes.indexOf(this.size) == -1){\r\n\t\t\t\t\tpageSizes = [];\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (let i = 1; i < 5; i++){\r\n\t\t\t\t\t\tpageSizes.push(this.size * i);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.pageSizes = pageSizes;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tpageSizes = this.pageSizes;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\twhile(this.pageSizeSelect.firstChild) this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);\r\n\t\t\t\r\n\t\t\tpageSizes.forEach((item) => {\r\n\t\t\t\tvar itemEl = document.createElement(\"option\");\r\n\t\t\t\titemEl.value = item;\r\n\t\t\t\t\r\n\t\t\t\tif(item === true){\r\n\t\t\t\t\tthis.langBind(\"pagination|all\", function(value){\r\n\t\t\t\t\t\titemEl.innerHTML = value;\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\titemEl.innerHTML = item;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tthis.pageSizeSelect.appendChild(itemEl);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.pageSizeSelect.value = this.size;\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializePageCounter(){\r\n\t\tvar counter = this.table.options.paginationCounter,\r\n\t\tpageCounter = null;\r\n\t\t\r\n\t\tif(counter){\r\n\t\t\tif(typeof counter === \"function\"){\r\n\t\t\t\tpageCounter = counter;\r\n\t\t\t}else{\r\n\t\t\t\tpageCounter = Page.pageCounters[counter];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(pageCounter){\r\n\t\t\t\tthis.pageCounter = pageCounter;\r\n\t\t\t\t\r\n\t\t\t\tthis.pageCounterElement = document.createElement(\"span\");\r\n\t\t\t\tthis.pageCounterElement.classList.add(\"tabulator-page-counter\");\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Pagination Error - No such page counter found: \", counter);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//setup pagination\r\n\tinitializePaginator(hidden){\r\n\t\tvar pageSelectLabel, paginationCounterHolder;\r\n\t\t\r\n\t\tif(!hidden){\r\n\t\t\t//build pagination element\r\n\t\t\t\r\n\t\t\t//bind localizations\r\n\t\t\tthis.langBind(\"pagination|first\", (value) => {\r\n\t\t\t\tthis.firstBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|first_title\", (value) => {\r\n\t\t\t\tthis.firstBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.firstBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|prev\", (value) => {\r\n\t\t\t\tthis.prevBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|prev_title\", (value) => {\r\n\t\t\t\tthis.prevBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.prevBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|next\", (value) => {\r\n\t\t\t\tthis.nextBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|next_title\", (value) => {\r\n\t\t\t\tthis.nextBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.nextBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|last\", (value) => {\r\n\t\t\t\tthis.lastBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|last_title\", (value) => {\r\n\t\t\t\tthis.lastBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.lastBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t//click bindings\r\n\t\t\tthis.firstBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.setPage(1)\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.prevBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.previousPage()\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.nextBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.nextPage()\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.lastBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.setPage(this.max)\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(this.table.options.paginationElement){\r\n\t\t\t\tthis.element = this.table.options.paginationElement;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.pageSizeSelect){\r\n\t\t\t\tpageSelectLabel = document.createElement(\"label\");\r\n\t\t\t\t\r\n\t\t\t\tthis.langBind(\"pagination|page_size\", (value) => {\r\n\t\t\t\t\tthis.pageSizeSelect.setAttribute(\"aria-label\", value);\r\n\t\t\t\t\tthis.pageSizeSelect.setAttribute(\"title\", value);\r\n\t\t\t\t\tpageSelectLabel.innerHTML = value;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.element.appendChild(pageSelectLabel);\r\n\t\t\t\tthis.element.appendChild(this.pageSizeSelect);\r\n\t\t\t\t\r\n\t\t\t\tthis.pageSizeSelect.addEventListener(\"change\", (e) => {\r\n\t\t\t\t\tthis.setPageSize(this.pageSizeSelect.value == \"true\" ? true : this.pageSizeSelect.value);\r\n\t\t\t\t\tthis.setPage(1)\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//append to DOM\r\n\t\t\tthis.element.appendChild(this.firstBut);\r\n\t\t\tthis.element.appendChild(this.prevBut);\r\n\t\t\tthis.element.appendChild(this.pagesElement);\r\n\t\t\tthis.element.appendChild(this.nextBut);\r\n\t\t\tthis.element.appendChild(this.lastBut);\r\n\t\t\t\r\n\t\t\tif(!this.table.options.paginationElement && !hidden){\r\n\t\t\t\tif(this.table.options.paginationCounter){\r\n\r\n\t\t\t\t\tpaginationCounterHolder \r\n\r\n\t\t\t\t\tif(this.table.options.paginationCounterElement){\r\n\t\t\t\t\t\tif(this.table.options.paginationCounterElement instanceof HTMLElement){\r\n\t\t\t\t\t\t\tthis.table.options.paginationCounterElement.appendChild(this.pageCounterElement);\r\n\t\t\t\t\t\t}else if(typeof this.table.options.paginationCounterElement === \"string\"){\r\n\t\t\t\t\t\t\tpaginationCounterHolder = document.querySelector(this.table.options.paginationCounterElement);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(paginationCounterHolder){\r\n\t\t\t\t\t\t\t\tpaginationCounterHolder.appendChild(this.pageCounterElement);\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Pagination Error - Unable to find element matching paginationCounterElement selector:\", this.table.options.paginationCounterElement);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.footerAppend(this.pageCounterElement);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.footerAppend(this.element);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.page = this.table.options.paginationInitialPage;\r\n\t\t\tthis.count = this.table.options.paginationButtonCount;\r\n\t\t}\r\n\t\t\r\n\t\t//set default values\r\n\t\tthis.mode = this.table.options.paginationMode;\r\n\t}\r\n\t\r\n\tinitializeProgressive(mode){\r\n\t\tthis.initializePaginator(true);\r\n\t\tthis.mode = \"progressive_\" + mode;\r\n\t\tthis.progressiveLoad = true;\r\n\t}\r\n\t\r\n\ttrackChanges(){\r\n\t\tthis.dispatch(\"page-changed\");\r\n\t}\r\n\t\r\n\tsetDisplayIndex(index){\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\t\r\n\tgetDisplayIndex(){\r\n\t\treturn this.displayIndex;\r\n\t}\r\n\t\r\n\t//calculate maximum page from number of rows\r\n\tsetMaxRows(rowCount){\r\n\t\tif(!rowCount){\r\n\t\t\tthis.max = 1;\r\n\t\t}else{\r\n\t\t\tthis.max = this.size === true ? 1 : Math.ceil(rowCount/this.size);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.page > this.max){\r\n\t\t\tthis.page = this.max;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//reset to first page without triggering action\r\n\treset(force){\r\n\t\tif(!this.initialLoad){\r\n\t\t\tif(this.mode == \"local\" || force){\r\n\t\t\t\tthis.page = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set the maximum page\r\n\tsetMaxPage(max){\r\n\t\t\r\n\t\tmax = parseInt(max);\r\n\t\t\r\n\t\tthis.max = max || 1;\r\n\t\t\r\n\t\tif(this.page > this.max){\r\n\t\t\tthis.page = this.max;\r\n\t\t\tthis.trigger();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set current page number\r\n\tsetPage(page){\r\n\t\tswitch(page){\r\n\t\t\tcase \"first\":\r\n\t\t\treturn this.setPage(1);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"prev\":\r\n\t\t\treturn this.previousPage();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"next\":\r\n\t\t\treturn this.nextPage();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"last\":\r\n\t\t\treturn this.setPage(this.max);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\tpage = parseInt(page);\r\n\t\t\r\n\t\tif((page > 0 && page <= this.max) || this.mode !== \"local\"){\r\n\t\t\tthis.page = page;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Requested page is out of range of 1 - \" + this.max + \":\", page);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetPageToRow(row){\r\n\t\tvar rows = this.table.rowManager.getDisplayRows(this.displayIndex - 1);\r\n\t\tvar index = rows.indexOf(row);\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tvar page = this.size === true ? 1 : Math.ceil((index + 1) / this.size);\r\n\t\t\t\r\n\t\t\treturn this.setPage(page)\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Requested row is not visible\");\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetPageSize(size){\r\n\t\tif(size !== true){\r\n\t\t\tsize = parseInt(size);\r\n\t\t}\r\n\r\n\t\tif(size > 0){\r\n\t\t\tthis.size = size;\r\n\t\t\tthis.dispatchExternal(\"pageSizeChanged\", size);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.pageSizeSelect){\r\n\t\t\t// this.pageSizeSelect.value = size;\r\n\t\t\tthis.generatePageSizeSelectList();\r\n\t\t}\r\n\t\t\r\n\t\tthis.trackChanges();\r\n\t}\r\n\t\r\n\t_setPageCounter(totalRows, size, currentRow){\r\n\t\tvar content;\r\n\t\t\r\n\t\tif(this.pageCounter){\r\n\r\n\t\t\tif(this.mode === \"remote\"){\r\n\t\t\t\tsize = this.size;\r\n\t\t\t\tcurrentRow = ((this.page - 1) * this.size) + 1;\r\n\t\t\t\ttotalRows = this.remoteRowCountEstimate;\r\n\t\t\t}\r\n\r\n\t\t\tcontent = this.pageCounter.call(this, size, currentRow, this.page, totalRows, this.max);\r\n\t\t\t\r\n\t\t\tswitch(typeof content){\r\n\t\t\t\tcase \"object\":\r\n\t\t\t\tif(content instanceof Node){\r\n\t\t\t\t\t\r\n\t\t\t\t\t//clear previous cell contents\r\n\t\t\t\t\twhile(this.pageCounterElement.firstChild) this.pageCounterElement.removeChild(this.pageCounterElement.firstChild);\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.pageCounterElement.appendChild(content);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.pageCounterElement.innerHTML = \"\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(content != null){\r\n\t\t\t\t\t\tconsole.warn(\"Page Counter Error - Page Counter has returned a type of object, the only valid page counter object return is an instance of Node, the page counter returned:\", content);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"undefined\":\r\n\t\t\t\tthis.pageCounterElement.innerHTML = \"\";\r\n\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\tthis.pageCounterElement.innerHTML = content;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//setup the pagination buttons\r\n\t_setPageButtons(){\r\n\t\tlet leftSize = Math.floor((this.count-1) / 2);\r\n\t\tlet rightSize = Math.ceil((this.count-1) / 2);\r\n\t\tlet min = this.max - this.page + leftSize + 1 < this.count ? this.max-this.count+1: Math.max(this.page-leftSize,1);\r\n\t\tlet max = this.page <= rightSize? Math.min(this.count, this.max) :Math.min(this.page+rightSize, this.max);\r\n\t\t\r\n\t\twhile(this.pagesElement.firstChild) this.pagesElement.removeChild(this.pagesElement.firstChild);\r\n\t\t\r\n\t\tif(this.page == 1){\r\n\t\t\tthis.firstBut.disabled = true;\r\n\t\t\tthis.prevBut.disabled = true;\r\n\t\t}else{\r\n\t\t\tthis.firstBut.disabled = false;\r\n\t\t\tthis.prevBut.disabled = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.page == this.max){\r\n\t\t\tthis.lastBut.disabled = true;\r\n\t\t\tthis.nextBut.disabled = true;\r\n\t\t}else{\r\n\t\t\tthis.lastBut.disabled = false;\r\n\t\t\tthis.nextBut.disabled = false;\r\n\t\t}\r\n\t\t\r\n\t\tfor(let i = min; i <= max; i++){\r\n\t\t\tif(i>0 && i <= this.max){\r\n\t\t\t\tthis.pagesElement.appendChild(this._generatePageButton(i));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.footerRedraw();\r\n\t}\r\n\t\r\n\t_generatePageButton(page){\r\n\t\tvar button = document.createElement(\"button\");\r\n\t\t\r\n\t\tbutton.classList.add(\"tabulator-page\");\r\n\t\tif(page == this.page){\r\n\t\t\tbutton.classList.add(\"active\");\r\n\t\t}\r\n\t\t\r\n\t\tbutton.setAttribute(\"type\", \"button\");\r\n\t\tbutton.setAttribute(\"role\", \"button\");\r\n\t\t\r\n\t\tthis.langBind(\"pagination|page_title\", (value) => {\r\n\t\t\tbutton.setAttribute(\"aria-label\", value + \" \" + page);\r\n\t\t\tbutton.setAttribute(\"title\", value + \" \" + page);\r\n\t\t});\r\n\t\t\r\n\t\tbutton.setAttribute(\"data-page\", page);\r\n\t\tbutton.textContent = page;\r\n\t\t\r\n\t\tbutton.addEventListener(\"click\", (e) => {\r\n\t\t\tthis.setPage(page)\r\n\t\t});\r\n\t\t\r\n\t\treturn button;\r\n\t}\r\n\t\r\n\t//previous page\r\n\tpreviousPage(){\r\n\t\tif(this.page > 1){\r\n\t\t\tthis.page--;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger()\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Previous page would be less than page 1:\", 0);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//next page\r\n\tnextPage(){\r\n\t\tif(this.page < this.max){\r\n\t\t\tthis.page++;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger();\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tif(!this.progressiveLoad){\r\n\t\t\t\tconsole.warn(\"Pagination Error - Next page would be greater than maximum page of \" + this.max + \":\", this.max + 1);\r\n\t\t\t}\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return current page number\r\n\tgetPage(){\r\n\t\treturn this.page;\r\n\t}\r\n\t\r\n\t//return max page number\r\n\tgetPageMax(){\r\n\t\treturn this.max;\r\n\t}\r\n\t\r\n\tgetPageSize(size){\r\n\t\treturn this.size;\r\n\t}\r\n\t\r\n\tgetMode(){\r\n\t\treturn this.mode;\r\n\t}\r\n\t\r\n\t//return appropriate rows for current page\r\n\tgetRows(data){\r\n\t\tvar actualRowPageSize = 0,\r\n\t\toutput, start, end, actualStartRow;\r\n\r\n\t\tvar actualRows = data.filter((row) => {\r\n\t\t\treturn row.type === \"row\";\r\n\t\t});\r\n\t\t\r\n\t\tif(this.mode == \"local\"){\r\n\t\t\toutput = [];\r\n\t\t\t\r\n\t\t\tthis.setMaxRows(data.length);\r\n\t\t\t\r\n\t\t\tif(this.size === true){\r\n\t\t\t\tstart = 0;\r\n\t\t\t\tend = data.length;\r\n\t\t\t}else{\r\n\t\t\t\tstart = this.size * (this.page - 1);\r\n\t\t\t\tend = start + parseInt(this.size);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._setPageButtons();\r\n\t\t\t\r\n\t\t\tfor(let i = start; i < end; i++){\r\n\t\t\t\tlet row = data[i];\r\n\r\n\t\t\t\tif(row){\r\n\t\t\t\t\toutput.push(row);\r\n\r\n\t\t\t\t\tif(row.type === \"row\"){\r\n\t\t\t\t\t\tif(!actualStartRow){\r\n\t\t\t\t\t\t\tactualStartRow = row;\r\n\t\t\t\t\t\t}\t\r\n\r\n\t\t\t\t\t\tactualRowPageSize++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._setPageCounter(actualRows.length, actualRowPageSize, actualStartRow ? (actualRows.indexOf(actualStartRow) + 1) : 0);\r\n\t\t\t\r\n\t\t\treturn output;\r\n\t\t}else{\r\n\t\t\tthis._setPageButtons();\r\n\t\t\tthis._setPageCounter(actualRows.length);\r\n\t\t\t\r\n\t\t\treturn data.slice(0);\r\n\t\t}\r\n\t}\r\n\t\r\n\ttrigger(){\r\n\t\tvar left;\r\n\t\t\r\n\t\tswitch(this.mode){\r\n\t\t\tcase \"local\":\r\n\t\t\tleft = this.table.rowManager.scrollLeft;\r\n\t\t\t\r\n\t\t\tthis.refreshData();\r\n\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"pageLoaded\", this.getPage());\r\n\t\t\t\r\n\t\t\treturn Promise.resolve();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"remote\":\r\n\t\t\tthis.dataChanging = true;\r\n\t\t\treturn this.reloadData(null)\r\n\t\t\t.finally(() => {\r\n\t\t\t\tthis.dataChanging = false;\r\n\t\t\t})\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"progressive_load\":\r\n\t\t\tcase \"progressive_scroll\":\r\n\t\t\treturn this.reloadData(null, true);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\tconsole.warn(\"Pagination Error - no such pagination mode:\", this.mode);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_parseRemoteData(data){\r\n\t\tvar left, data, margin;\r\n\t\t\r\n\t\tif(typeof data.last_page === \"undefined\"){\r\n\t\t\tconsole.warn(\"Remote Pagination Error - Server response missing '\" + (this.options(\"dataReceiveParams\").last_page || \"last_page\") + \"' property\");\r\n\t\t}\r\n\t\t\r\n\t\tif(data.data){\r\n\t\t\tthis.max = parseInt(data.last_page) || 1;\r\n\r\n\t\t\tthis.remoteRowCountEstimate = typeof data.last_row !== \"undefined\" ? data.last_row : (data.last_page * this.size - (this.page == data.last_page ? (this.size - data.data.length) : 0));\r\n\t\t\t\r\n\t\t\tif(this.progressiveLoad){\r\n\t\t\t\tswitch(this.mode){\r\n\t\t\t\t\tcase \"progressive_load\":\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.page == 1){\r\n\t\t\t\t\t\tthis.table.rowManager.setData(data.data, false, this.page == 1)\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.table.rowManager.addRows(data.data);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.page < this.max){\r\n\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\tthis.nextPage();\r\n\t\t\t\t\t\t}, this.table.options.progressiveLoadDelay);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"progressive_scroll\":\r\n\t\t\t\t\tdata = this.page === 1 ? data.data : this.table.rowManager.getData().concat(data.data);\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.table.rowManager.setData(data, this.page !== 1, this.page == 1);\r\n\t\t\t\t\t\r\n\t\t\t\t\tmargin = this.table.options.progressiveLoadScrollMargin || (this.table.rowManager.element.clientHeight * 2);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.table.rowManager.element.scrollHeight <= (this.table.rowManager.element.clientHeight + margin)){\r\n\t\t\t\t\t\tif(this.page < this.max){\r\n\t\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\t\tthis.nextPage();\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\t// left = this.table.rowManager.scrollLeft;\r\n\t\t\t\tthis.dispatchExternal(\"pageLoaded\", this.getPage());\r\n\t\t\t\t// this.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\t// this.table.columnManager.scrollHorizontal(left);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Remote Pagination Error - Server response missing '\" + (this.options(\"dataReceiveParams\").data || \"data\") + \"' property\");\r\n\t\t}\r\n\t\t\r\n\t\treturn data.data;\r\n\t}\r\n\t\r\n\t//handle the footer element being redrawn\r\n\tfooterRedraw(){\r\n\t\tvar footer = this.table.footerManager.containerElement;\r\n\r\n\t\tif((Math.ceil(footer.clientWidth) - footer.scrollWidth) < 0){\r\n\t\t\tthis.pagesElement.style.display = 'none';\r\n\t\t}else{\r\n\t\t\tthis.pagesElement.style.display = '';\r\n\t\t\t\r\n\t\t\tif((Math.ceil(footer.clientWidth) - footer.scrollWidth) < 0){\r\n\t\t\t\tthis.pagesElement.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nPage.moduleName = \"page\";\r\n\r\n//load defaults\r\nPage.pageCounters = defaultPageCounters;\r\n\r\nexport default Page;\r\n","// read peristence information from storage\r\nexport default {\r\n\tlocal:function(id, type){\r\n\t\tvar data = localStorage.getItem(id + \"-\" + type);\r\n\r\n\t\treturn data ? JSON.parse(data) : false;\r\n\t},\r\n\tcookie:function(id, type){\r\n\t\tvar cookie = document.cookie,\r\n\t\tkey = id + \"-\" + type,\r\n\t\tcookiePos = cookie.indexOf(key + \"=\"),\r\n\t\tend, data;\r\n\r\n\t\t//if cookie exists, decode and load column data into tabulator\r\n\t\tif(cookiePos > -1){\r\n\t\t\tcookie = cookie.slice(cookiePos);\r\n\r\n\t\t\tend = cookie.indexOf(\";\");\r\n\r\n\t\t\tif(end > -1){\r\n\t\t\t\tcookie = cookie.slice(0, end);\r\n\t\t\t}\r\n\r\n\t\t\tdata = cookie.replace(key + \"=\", \"\");\r\n\t\t}\r\n\r\n\t\treturn data ? JSON.parse(data) : false;\r\n\t}\r\n};\r\n","//write persistence information to storage\r\nexport default {\r\n\tlocal:function(id, type, data){\r\n\t\tlocalStorage.setItem(id + \"-\" + type, JSON.stringify(data));\r\n\t},\r\n\tcookie:function(id, type, data){\r\n\t\tvar expireDate = new Date();\r\n\r\n\t\texpireDate.setDate(expireDate.getDate() + 10000);\r\n\r\n\t\tdocument.cookie = id + \"-\" + type + \"=\" + JSON.stringify(data) + \"; expires=\" + expireDate.toUTCString();\r\n\t}\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultReaders from './defaults/readers.js';\r\nimport defaultWriters from './defaults/writers.js';\r\n\r\nclass Persistence extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.mode = \"\";\r\n\t\tthis.id = \"\";\r\n\t\t// this.persistProps = [\"field\", \"width\", \"visible\"];\r\n\t\tthis.defWatcherBlock = false;\r\n\t\tthis.config = {};\r\n\t\tthis.readFunc = false;\r\n\t\tthis.writeFunc = false;\r\n\r\n\t\tthis.registerTableOption(\"persistence\", false);\r\n\t\tthis.registerTableOption(\"persistenceID\", \"\"); //key for persistent storage\r\n\t\tthis.registerTableOption(\"persistenceMode\", true); //mode for storing persistence information\r\n\t\tthis.registerTableOption(\"persistenceReaderFunc\", false); //function for handling persistence data reading\r\n\t\tthis.registerTableOption(\"persistenceWriterFunc\", false); //function for handling persistence data writing\r\n\t}\r\n\r\n\t// Test for whether localStorage is available for use.\r\n\tlocalStorageTest() {\r\n\t\tvar testKey = \"_tabulator_test\";\r\n\r\n\t\ttry {\r\n\t\t\twindow.localStorage.setItem( testKey, testKey);\r\n\t\t\twindow.localStorage.removeItem( testKey );\r\n\t\t\treturn true;\r\n\t\t} catch(e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//setup parameters\r\n\tinitialize(){\r\n\t\tif(this.table.options.persistence){\r\n\t\t\t//determine persistent layout storage type\r\n\t\t\tvar mode = this.table.options.persistenceMode,\r\n\t\t\tid = this.table.options.persistenceID,\r\n\t\t\tretreivedData;\r\n\r\n\t\t\tthis.mode = mode !== true ? mode : (this.localStorageTest() ? \"local\" : \"cookie\");\r\n\r\n\t\t\tif(this.table.options.persistenceReaderFunc){\r\n\t\t\t\tif(typeof this.table.options.persistenceReaderFunc === \"function\"){\r\n\t\t\t\t\tthis.readFunc = this.table.options.persistenceReaderFunc;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(Persistence.readers[this.table.options.persistenceReaderFunc]){\r\n\t\t\t\t\t\tthis.readFunc = Persistence.readers[this.table.options.persistenceReaderFunc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Persistence Read Error - invalid reader set\", this.table.options.persistenceReaderFunc);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(Persistence.readers[this.mode]){\r\n\t\t\t\t\tthis.readFunc = Persistence.readers[this.mode];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Persistence Read Error - invalid reader set\", this.mode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.options.persistenceWriterFunc){\r\n\t\t\t\tif(typeof this.table.options.persistenceWriterFunc === \"function\"){\r\n\t\t\t\t\tthis.writeFunc = this.table.options.persistenceWriterFunc;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(Persistence.writers[this.table.options.persistenceWriterFunc]){\r\n\t\t\t\t\t\tthis.writeFunc = Persistence.writers[this.table.options.persistenceWriterFunc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Persistence Write Error - invalid reader set\", this.table.options.persistenceWriterFunc);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(Persistence.writers[this.mode]){\r\n\t\t\t\t\tthis.writeFunc = Persistence.writers[this.mode];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Persistence Write Error - invalid writer set\", this.mode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//set storage tag\r\n\t\t\tthis.id = \"tabulator-\" + (id || (this.table.element.getAttribute(\"id\") || \"\"));\r\n\r\n\t\t\tthis.config = {\r\n\t\t\t\tsort:this.table.options.persistence === true || this.table.options.persistence.sort,\r\n\t\t\t\tfilter:this.table.options.persistence === true || this.table.options.persistence.filter,\r\n\t\t\t\tgroup:this.table.options.persistence === true || this.table.options.persistence.group,\r\n\t\t\t\tpage:this.table.options.persistence === true || this.table.options.persistence.page,\r\n\t\t\t\tcolumns:this.table.options.persistence === true ? [\"title\", \"width\", \"visible\"] : this.table.options.persistence.columns,\r\n\t\t\t};\r\n\r\n\t\t\t//load pagination data if needed\r\n\t\t\tif(this.config.page){\r\n\t\t\t\tretreivedData = this.retreiveData(\"page\");\r\n\r\n\t\t\t\tif(retreivedData){\r\n\t\t\t\t\tif(typeof retreivedData.paginationSize !== \"undefined\" && (this.config.page === true || this.config.page.size)){\r\n\t\t\t\t\t\tthis.table.options.paginationSize = retreivedData.paginationSize;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(typeof retreivedData.paginationInitialPage !== \"undefined\" && (this.config.page === true || this.config.page.page)){\r\n\t\t\t\t\t\tthis.table.options.paginationInitialPage = retreivedData.paginationInitialPage;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//load group data if needed\r\n\t\t\tif(this.config.group){\r\n\t\t\t\tretreivedData = this.retreiveData(\"group\");\r\n\r\n\t\t\t\tif(retreivedData){\r\n\t\t\t\t\tif(typeof retreivedData.groupBy !== \"undefined\" && (this.config.group === true || this.config.group.groupBy)){\r\n\t\t\t\t\t\tthis.table.options.groupBy = retreivedData.groupBy;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(typeof retreivedData.groupStartOpen !== \"undefined\" && (this.config.group === true || this.config.group.groupStartOpen)){\r\n\t\t\t\t\t\tthis.table.options.groupStartOpen = retreivedData.groupStartOpen;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(typeof retreivedData.groupHeader !== \"undefined\" && (this.config.group === true || this.config.group.groupHeader)){\r\n\t\t\t\t\t\tthis.table.options.groupHeader = retreivedData.groupHeader;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.columns){\r\n\t\t\t\tthis.table.options.columns = this.load(\"columns\", this.table.options.columns);\r\n\t\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t\t\tthis.subscribe(\"column-show\", this.save.bind(this, \"columns\"));\r\n\t\t\t\tthis.subscribe(\"column-hide\", this.save.bind(this, \"columns\"));\r\n\t\t\t\tthis.subscribe(\"column-moved\", this.save.bind(this, \"columns\"));\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"table-built\", this.tableBuilt.bind(this), 0);\r\n\r\n\t\t\tthis.subscribe(\"table-redraw\", this.tableRedraw.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"filter-changed\", this.eventSave.bind(this, \"filter\"));\r\n\t\t\tthis.subscribe(\"sort-changed\", this.eventSave.bind(this, \"sort\"));\r\n\t\t\tthis.subscribe(\"group-changed\", this.eventSave.bind(this, \"group\"));\r\n\t\t\tthis.subscribe(\"page-changed\", this.eventSave.bind(this, \"page\"));\r\n\t\t\tthis.subscribe(\"column-resized\", this.eventSave.bind(this, \"columns\"));\r\n\t\t\tthis.subscribe(\"layout-refreshed\", this.eventSave.bind(this, \"columns\"));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"getColumnLayout\", this.getColumnLayout.bind(this));\r\n\t\tthis.registerTableFunction(\"setColumnLayout\", this.setColumnLayout.bind(this));\r\n\t}\r\n\r\n\teventSave(type){\r\n\t\tif(this.config[type]){\r\n\t\t\tthis.save(type);\r\n\t\t}\r\n\t}\r\n\r\n\ttableBuilt(){\r\n\t\tvar options = this.table.options,\r\n\t\tsorters, filters;\r\n\r\n\t\tif(this.config.sort){\r\n\t\t\tsorters = this.load(\"sort\");\r\n\r\n\t\t\tif(!sorters === false){\r\n\t\t\t\tthis.table.options.initialSort = sorters;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this.config.filter){\r\n\t\t\tfilters = this.load(\"filter\");\r\n\r\n\t\t\tif(!filters === false){\r\n\t\t\t\tthis.table.options.initialFilter = filters;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tif(force && this.config.columns){\r\n\t\t\tthis.save(\"columns\");\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tgetColumnLayout(){\r\n\t\treturn this.parseColumns(this.table.columnManager.getColumns());\r\n\t}\r\n\r\n\tsetColumnLayout(layout){\r\n\t\tthis.table.columnManager.setColumns(this.mergeDefinition(this.table.options.columns, layout))\r\n\t\treturn true;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tinitializeColumn(column){\r\n\t\tvar def, keys;\r\n\r\n\t\tif(this.config.columns){\r\n\t\t\tthis.defWatcherBlock = true;\r\n\r\n\t\t\tdef = column.getDefinition();\r\n\r\n\t\t\tkeys = this.config.columns === true ? Object.keys(def) : this.config.columns;\r\n\r\n\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\tvar props = Object.getOwnPropertyDescriptor(def, key);\r\n\t\t\t\tvar value = def[key];\r\n\t\t\t\tif(props){\r\n\t\t\t\t\tObject.defineProperty(def, key, {\r\n\t\t\t\t\t\tset: function(newValue){\r\n\t\t\t\t\t\t\tvalue = newValue;\r\n\r\n\t\t\t\t\t\t\tif(!this.defWatcherBlock){\r\n\t\t\t\t\t\t\t\tthis.save(\"columns\");\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif(props.set){\r\n\t\t\t\t\t\t\t\tprops.set(newValue);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tget:function(){\r\n\t\t\t\t\t\t\tif(props.get){\r\n\t\t\t\t\t\t\t\tprops.get();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.defWatcherBlock = false;\r\n\t\t}\r\n\t}\r\n\r\n\t//load saved definitions\r\n\tload(type, current){\r\n\t\tvar data = this.retreiveData(type);\r\n\r\n\t\tif(current){\r\n\t\t\tdata = data ? this.mergeDefinition(current, data) : current;\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//retreive data from memory\r\n\tretreiveData(type){\r\n\t\treturn this.readFunc ? this.readFunc(this.id, type) : false;\r\n\t}\r\n\r\n\t//merge old and new column definitions\r\n\tmergeDefinition(oldCols, newCols){\r\n\t\tvar output = [];\r\n\r\n\t\tnewCols = newCols || [];\r\n\r\n\t\tnewCols.forEach((column, to) => {\r\n\t\t\tvar from = this._findColumn(oldCols, column),\r\n\t\t\tkeys;\r\n\r\n\t\t\tif(from){\r\n\t\t\t\tif(this.config.columns === true || this.config.columns == undefined){\r\n\t\t\t\t\tkeys = Object.keys(from);\r\n\t\t\t\t\tkeys.push(\"width\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tkeys = this.config.columns;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\t\tif(key !== \"columns\" && typeof column[key] !== \"undefined\"){\r\n\t\t\t\t\t\tfrom[key] = column[key];\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(from.columns){\r\n\t\t\t\t\tfrom.columns = this.mergeDefinition(from.columns, column.columns);\r\n\t\t\t\t}\r\n\r\n\t\t\t\toutput.push(from);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\toldCols.forEach((column, i) => {\r\n\t\t\tvar from = this._findColumn(newCols, column);\r\n\r\n\t\t\tif (!from) {\r\n\t\t\t\tif(output.length>i){\r\n\t\t\t\t\toutput.splice(i, 0, column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\toutput.push(column);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//find matching columns\r\n\t_findColumn(columns, subject){\r\n\t\tvar type = subject.columns ? \"group\" : (subject.field ? \"field\" : \"object\");\r\n\r\n\t\treturn columns.find(function(col){\r\n\t\t\tswitch(type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\treturn col.title === subject.title && col.columns.length === subject.columns.length;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"field\":\r\n\t\t\t\treturn col.field === subject.field;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"object\":\r\n\t\t\t\treturn col === subject;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//save data\r\n\tsave(type){\r\n\t\tvar data = {};\r\n\r\n\t\tswitch(type){\r\n\t\t\tcase \"columns\":\r\n\t\t\tdata = this.parseColumns(this.table.columnManager.getColumns())\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"filter\":\r\n\t\t\tdata = this.table.modules.filter.getFilters();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"sort\":\r\n\t\t\tdata = this.validateSorters(this.table.modules.sort.getSort());\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\tdata = this.getGroupConfig();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"page\":\r\n\t\t\tdata = this.getPageConfig();\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(this.writeFunc){\r\n\t\t\tthis.writeFunc(this.id, type, data);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t//ensure sorters contain no function data\r\n\tvalidateSorters(data){\r\n\t\tdata.forEach(function(item){\r\n\t\t\titem.column = item.field;\r\n\t\t\tdelete item.field;\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tgetGroupConfig(){\r\n\t\tvar data = {};\r\n\r\n\t\tif(this.config.group){\r\n\t\t\tif(this.config.group === true || this.config.group.groupBy){\r\n\t\t\t\tdata.groupBy = this.table.options.groupBy;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.group === true || this.config.group.groupStartOpen){\r\n\t\t\t\tdata.groupStartOpen = this.table.options.groupStartOpen;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.group === true || this.config.group.groupHeader){\r\n\t\t\t\tdata.groupHeader = this.table.options.groupHeader;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tgetPageConfig(){\r\n\t\tvar data = {};\r\n\r\n\t\tif(this.config.page){\r\n\t\t\tif(this.config.page === true || this.config.page.size){\r\n\t\t\t\tdata.paginationSize = this.table.modules.page.getPageSize();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.page === true || this.config.page.page){\r\n\t\t\t\tdata.paginationInitialPage = this.table.modules.page.getPage();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\r\n\t//parse columns for data to store\r\n\tparseColumns(columns){\r\n\t\tvar definitions = [],\r\n\t\texcludedKeys = [\"headerContextMenu\", \"headerMenu\", \"contextMenu\", \"clickMenu\"];\r\n\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\tvar defStore = {},\r\n\t\t\tcolDef = column.getDefinition(),\r\n\t\t\tkeys;\r\n\r\n\t\t\tif(column.isGroup){\r\n\t\t\t\tdefStore.title = colDef.title;\r\n\t\t\t\tdefStore.columns = this.parseColumns(column.getColumns());\r\n\t\t\t}else{\r\n\t\t\t\tdefStore.field = column.getField();\r\n\r\n\t\t\t\tif(this.config.columns === true || this.config.columns == undefined){\r\n\t\t\t\t\tkeys = Object.keys(colDef);\r\n\t\t\t\t\tkeys.push(\"width\");\r\n\t\t\t\t\tkeys.push(\"visible\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tkeys = this.config.columns;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\t\tswitch(key){\r\n\t\t\t\t\t\tcase \"width\":\r\n\t\t\t\t\t\tdefStore.width = column.getWidth();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"visible\":\r\n\t\t\t\t\t\tdefStore.visible = column.visible;\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tif(typeof colDef[key] !== \"function\" && excludedKeys.indexOf(key) === -1){\r\n\t\t\t\t\t\t\tdefStore[key] = colDef[key];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tdefinitions.push(defStore);\r\n\t\t});\r\n\r\n\t\treturn definitions;\r\n\t}\r\n}\r\n\r\nPersistence.moduleName = \"persistence\";\r\n\r\nPersistence.moduleInitOrder = -10;\r\n\r\n//load defaults\r\nPersistence.readers = defaultReaders;\r\nPersistence.writers = defaultWriters;\r\n\r\nexport default Persistence;","import Module from '../../core/Module.js';\r\n\r\nclass Popup extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.columnSubscribers = {};\r\n\t\t\r\n\t\tthis.registerTableOption(\"rowContextPopup\", false);\r\n\t\tthis.registerTableOption(\"rowClickPopup\", false);\r\n\t\tthis.registerTableOption(\"groupContextPopup\", false);\r\n\t\tthis.registerTableOption(\"groupClickPopup\", false);\r\n\t\t\r\n\t\tthis.registerColumnOption(\"headerContextPopup\");\r\n\t\tthis.registerColumnOption(\"headerClickPopup\");\r\n\t\tthis.registerColumnOption(\"headerPopup\");\r\n\t\tthis.registerColumnOption(\"headerPopupIcon\");\r\n\t\tthis.registerColumnOption(\"contextPopup\");\r\n\t\tthis.registerColumnOption(\"clickPopup\");\r\n\t\t\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.initializeRowWatchers();\r\n\t\tthis.initializeGroupWatchers();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\t\r\n\tinitializeRowWatchers(){\r\n\t\tif(this.table.options.rowContextPopup){\r\n\t\t\tthis.subscribe(\"row-contextmenu\", this.loadPopupEvent.bind(this, this.table.options.rowContextPopup));\r\n\t\t\tthis.table.on(\"rowTapHold\", this.loadPopupEvent.bind(this, this.table.options.rowContextPopup));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.rowClickPopup){\r\n\t\t\tthis.subscribe(\"row-click\", this.loadPopupEvent.bind(this, this.table.options.rowClickPopup));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeGroupWatchers(){\r\n\t\tif(this.table.options.groupContextPopup){\r\n\t\t\tthis.subscribe(\"group-contextmenu\", this.loadPopupEvent.bind(this, this.table.options.groupContextPopup));\r\n\t\t\tthis.table.on(\"groupTapHold\", this.loadPopupEvent.bind(this, this.table.options.groupContextPopup));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.groupClickPopup){\r\n\t\t\tthis.subscribe(\"group-click\", this.loadPopupEvent.bind(this, this.table.options.groupClickPopup));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar options = [\"headerContextPopup\", \"headerClickPopup\"],\r\n\t\tdef = column.definition;\r\n\t\t\r\n\t\t//handle column events\r\n\t\tif(def.headerContextPopup && !this.columnSubscribers.headerContextPopup){\r\n\t\t\tthis.columnSubscribers.headerContextPopup = this.loadPopupTableColumnEvent.bind(this, \"headerContextPopup\");\r\n\t\t\tthis.subscribe(\"column-contextmenu\", this.columnSubscribers.headerContextPopup);\r\n\t\t\tthis.table.on(\"headerTapHold\", this.loadPopupTableColumnEvent.bind(this, \"headerContextPopup\"))\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerClickPopup && !this.columnSubscribers.headerClickPopup){\r\n\t\t\tthis.columnSubscribers.headerClickPopup = this.loadPopupTableColumnEvent.bind(this, \"headerClickPopup\");\r\n\t\t\tthis.subscribe(\"column-click\", this.columnSubscribers.headerClickPopup);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerPopup){\r\n\t\t\tthis.initializeColumnHeaderPopup(column);\r\n\t\t}\r\n\t\t\r\n\t\t//handle cell events\r\n\t\tif(def.contextPopup && !this.columnSubscribers.contextPopup){\r\n\t\t\tthis.columnSubscribers.contextPopup = this.loadPopupTableCellEvent.bind(this, \"contextPopup\");\r\n\t\t\tthis.subscribe(\"cell-contextmenu\", this.columnSubscribers.contextPopup);\r\n\t\t\tthis.table.on(\"cellTapHold\", this.loadPopupTableCellEvent.bind(this, \"contextPopup\"))\r\n\t\t}\r\n\t\t\r\n\t\tif(def.clickPopup && !this.columnSubscribers.clickPopup){\r\n\t\t\tthis.columnSubscribers.clickPopup = this.loadPopupTableCellEvent.bind(this, \"clickPopup\");\r\n\t\t\tthis.subscribe(\"cell-click\", this.columnSubscribers.clickPopup);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumnHeaderPopup(column){\r\n\t\tvar icon = column.definition.headerPopupIcon,\r\n\t\theaderPopupEl;\r\n\t\t\r\n\t\theaderPopupEl = document.createElement(\"span\");\r\n\t\theaderPopupEl.classList.add(\"tabulator-header-popup-button\");\r\n\r\n\t\tif(icon){\r\n\t\t\tif(typeof icon === \"function\"){\r\n\t\t\t\ticon = icon(column.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tif(icon instanceof HTMLElement){\r\n\t\t\t\theaderPopupEl.appendChild(icon);\r\n\t\t\t}else{\r\n\t\t\t\theaderPopupEl.innerHTML = icon;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\theaderPopupEl.innerHTML = \"⋮\";\r\n\t\t}\r\n\t\t\r\n\t\theaderPopupEl.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tthis.loadPopupEvent(column.definition.headerPopup, e, column);\r\n\t\t});\r\n\t\t\r\n\t\tcolumn.titleElement.insertBefore(headerPopupEl, column.titleElement.firstChild);\r\n\t}\r\n\t\r\n\tloadPopupTableCellEvent(option, e, cell){\r\n\t\tif(cell._cell){\r\n\t\t\tcell = cell._cell;\r\n\t\t}\r\n\t\t\r\n\t\tif(cell.column.definition[option]){\r\n\t\t\tthis.loadPopupEvent(cell.column.definition[option], e, cell);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadPopupTableColumnEvent(option, e, column){\r\n\t\tif(column._column){\r\n\t\t\tcolumn = column._column;\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition[option]){\r\n\t\t\tthis.loadPopupEvent(column.definition[option], e, column);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadPopupEvent(contents, e, component){\r\n\t\tvar renderedCallback;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\trenderedCallback = callback;\r\n\t\t}\r\n\t\t\r\n\t\tif(component._group){\r\n\t\t\tcomponent = component._group;\r\n\t\t}else if(component._row){\r\n\t\t\tcomponent = component._row;\r\n\t\t}\r\n\t\t\r\n\t\tcontents = typeof contents == \"function\" ? contents.call(this.table, e, component.getComponent(), onRendered) : contents;\r\n\t\t\r\n\t\tthis.loadPopup(e, component, contents, renderedCallback);\r\n\t}\r\n\t\r\n\tloadPopup(e, component, contents, renderedCallback){\r\n\t\tvar touch = !(e instanceof MouseEvent),\r\n\t\tcontentsEl, popup;\r\n\t\t\r\n\t\tif(contents instanceof HTMLElement){\r\n\t\t\tcontentsEl = contents;\r\n\t\t}else{\r\n\t\t\tcontentsEl = document.createElement(\"div\");\r\n\t\t\tcontentsEl.innerHTML = contents;\r\n\t\t}\r\n\t\t\r\n\t\tcontentsEl.classList.add(\"tabulator-popup\");\r\n\r\n\t\tcontentsEl.addEventListener(\"click\", (e) =>{\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tif(!touch){\r\n\t\t\te.preventDefault();\r\n\t\t}\r\n\t\t\r\n\t\tpopup = this.popup(contentsEl);\r\n\r\n\t\tif(typeof renderedCallback === \"function\"){\r\n\t\t\tpopup.renderCallback(renderedCallback);\r\n\t\t}\r\n\t\t\r\n\t\tpopup.show(e).hideOnBlur(() => {\r\n\t\t\tthis.dispatchExternal(\"popupClosed\", component.getComponent());\r\n\t\t});\r\n\r\n\r\n\r\n\t\tthis.dispatchExternal(\"popupOpened\", component.getComponent())\r\n\t}\r\n}\r\n\r\nPopup.moduleName = \"popup\";\r\n\r\nexport default Popup;\r\n","import Module from '../../core/Module.js';\r\n\r\nclass Print extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.element = false;\r\n\t\tthis.manualBlock = false;\r\n\r\n\t\tthis.registerTableOption(\"printAsHtml\", false); //enable print as html\r\n\t\tthis.registerTableOption(\"printFormatter\", false); //printing page formatter\r\n\t\tthis.registerTableOption(\"printHeader\", false); //page header contents\r\n\t\tthis.registerTableOption(\"printFooter\", false); //page footer contents\r\n\t\tthis.registerTableOption(\"printStyled\", true); //enable print as html styling\r\n\t\tthis.registerTableOption(\"printRowRange\", \"visible\"); //restrict print to visible rows only\r\n\t\tthis.registerTableOption(\"printConfig\", {}); //print config options\r\n\r\n\t\tthis.registerColumnOption(\"print\");\r\n\t\tthis.registerColumnOption(\"titlePrint\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.printAsHtml){\r\n\t\t\twindow.addEventListener(\"beforeprint\", this.replaceTable.bind(this));\r\n\t\t\twindow.addEventListener(\"afterprint\", this.cleanup.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"print\", this.printFullscreen.bind(this));\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\treplaceTable(){\r\n\t\tif(!this.manualBlock){\r\n\t\t\tthis.element = document.createElement(\"div\");\r\n\t\t\tthis.element.classList.add(\"tabulator-print-table\");\r\n\r\n\t\t\tthis.element.appendChild(this.table.modules.export.genereateTable(this.table.options.printConfig, this.table.options.printStyled, this.table.options.printRowRange, \"print\"));\r\n\r\n\t\t\tthis.table.element.style.display = \"none\";\r\n\r\n\t\t\tthis.table.element.parentNode.insertBefore(this.element, this.table.element);\r\n\t\t}\r\n\t}\r\n\r\n\tcleanup(){\r\n\t\tdocument.body.classList.remove(\"tabulator-print-fullscreen-hide\");\r\n\r\n\t\tif(this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\tthis.table.element.style.display = \"\";\r\n\t\t}\r\n\t}\r\n\r\n\tprintFullscreen(visible, style, config){\r\n\t\tvar scrollX = window.scrollX,\r\n\t\tscrollY = window.scrollY,\r\n\t\theaderEl = document.createElement(\"div\"),\r\n\t\tfooterEl = document.createElement(\"div\"),\r\n\t\ttableEl = this.table.modules.export.genereateTable(typeof config != \"undefined\" ? config : this.table.options.printConfig, typeof style != \"undefined\" ? style : this.table.options.printStyled, visible || this.table.options.printRowRange, \"print\"),\r\n\t\theaderContent, footerContent;\r\n\r\n\t\tthis.manualBlock = true;\r\n\r\n\t\tthis.element = document.createElement(\"div\");\r\n\t\tthis.element.classList.add(\"tabulator-print-fullscreen\");\r\n\r\n\t\tif(this.table.options.printHeader){\r\n\t\t\theaderEl.classList.add(\"tabulator-print-header\");\r\n\r\n\t\t\theaderContent = typeof this.table.options.printHeader == \"function\" ? this.table.options.printHeader.call(this.table) : this.table.options.printHeader;\r\n\r\n\t\t\tif(typeof headerContent == \"string\"){\r\n\t\t\t\theaderEl.innerHTML = headerContent;\r\n\t\t\t}else{\r\n\t\t\t\theaderEl.appendChild(headerContent);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element.appendChild(headerEl);\r\n\t\t}\r\n\r\n\t\tthis.element.appendChild(tableEl);\r\n\r\n\t\tif(this.table.options.printFooter){\r\n\t\t\tfooterEl.classList.add(\"tabulator-print-footer\");\r\n\r\n\t\t\tfooterContent = typeof this.table.options.printFooter == \"function\" ? this.table.options.printFooter.call(this.table) : this.table.options.printFooter;\r\n\r\n\r\n\t\t\tif(typeof footerContent == \"string\"){\r\n\t\t\t\tfooterEl.innerHTML = footerContent;\r\n\t\t\t}else{\r\n\t\t\t\tfooterEl.appendChild(footerContent);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element.appendChild(footerEl);\r\n\t\t}\r\n\r\n\t\tdocument.body.classList.add(\"tabulator-print-fullscreen-hide\");\r\n\t\tdocument.body.appendChild(this.element);\r\n\r\n\t\tif(this.table.options.printFormatter){\r\n\t\t\tthis.table.options.printFormatter(this.element, tableEl);\r\n\t\t}\r\n\r\n\t\twindow.print();\r\n\r\n\t\tthis.cleanup();\r\n\r\n\t\twindow.scrollTo(scrollX, scrollY);\r\n\r\n\t\tthis.manualBlock = false;\r\n\t}\r\n}\r\n\r\nPrint.moduleName = \"print\";\r\n\r\nexport default Print;","import Module from '../../core/Module.js';\r\n\r\nclass ReactiveData extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.data = false;\r\n\t\tthis.blocked = false; //block reactivity while performing update\r\n\t\tthis.origFuncs = {}; // hold original data array functions to allow replacement after data is done with\r\n\t\tthis.currentVersion = 0;\r\n\r\n\t\tthis.registerTableOption(\"reactiveData\", false); //enable data reactivity\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.reactiveData){\r\n\t\t\tthis.subscribe(\"cell-value-save-before\", this.block.bind(this));\r\n\t\t\tthis.subscribe(\"cell-value-save-after\", this.unblock.bind(this));\r\n\t\t\tthis.subscribe(\"row-data-save-before\", this.block.bind(this));\r\n\t\t\tthis.subscribe(\"row-data-save-after\", this.unblock.bind(this));\r\n\t\t\tthis.subscribe(\"row-data-init-after\", this.watchRow.bind(this));\r\n\t\t\tthis.subscribe(\"data-processing\", this.watchData.bind(this));\r\n\t\t\tthis.subscribe(\"table-destroy\", this.unwatchData.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\twatchData(data){\r\n\t\tvar self = this,\r\n\t\tpushFunc, version;\r\n\r\n\t\tthis.currentVersion ++;\r\n\r\n\t\tversion = this.currentVersion;\r\n\r\n\t\tthis.unwatchData();\r\n\r\n\t\tthis.data = data;\r\n\r\n\t\t//override array push function\r\n\t\tthis.origFuncs.push = data.push;\r\n\r\n\t\tObject.defineProperty(this.data, \"push\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments);\r\n\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\targs.forEach((arg) => {\r\n\t\t\t\t\t\tself.table.rowManager.addRowActual(arg, false);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.origFuncs.push.apply(data, arguments);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t//override array unshift function\r\n\t\tthis.origFuncs.unshift = data.unshift;\r\n\r\n\t\tObject.defineProperty(this.data, \"unshift\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments);\r\n\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\targs.forEach((arg) => {\r\n\t\t\t\t\t\tself.table.rowManager.addRowActual(arg, true);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.origFuncs.unshift.apply(data, arguments);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\t//override array shift function\r\n\t\tthis.origFuncs.shift = data.shift;\r\n\r\n\t\tObject.defineProperty(this.data, \"shift\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar row;\r\n\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tif(self.data.length){\r\n\t\t\t\t\t\trow = self.table.rowManager.getRowFromDataObject(self.data[0]);\r\n\r\n\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\trow.deleteActual();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.origFuncs.shift.call(data);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t//override array pop function\r\n\t\tthis.origFuncs.pop = data.pop;\r\n\r\n\t\tObject.defineProperty(this.data, \"pop\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar row;\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tif(self.data.length){\r\n\t\t\t\t\t\trow = self.table.rowManager.getRowFromDataObject(self.data[self.data.length - 1]);\r\n\r\n\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\trow.deleteActual();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn self.origFuncs.pop.call(data);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\t//override array splice function\r\n\t\tthis.origFuncs.splice = data.splice;\r\n\r\n\t\tObject.defineProperty(this.data, \"splice\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments),\r\n\t\t\t\tstart = args[0] < 0 ? data.length + args[0] : args[0],\r\n\t\t\t\tend = args[1],\r\n\t\t\t\tnewRows = args[2] ? args.slice(2) : false,\r\n\t\t\t\tstartRow;\r\n\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\r\n\t\t\t\t\t//add new rows\r\n\t\t\t\t\tif(newRows){\r\n\t\t\t\t\t\tstartRow = data[start] ? self.table.rowManager.getRowFromDataObject(data[start]) : false;\r\n\r\n\t\t\t\t\t\tif(startRow){\r\n\t\t\t\t\t\t\tnewRows.forEach((rowData) => {\r\n\t\t\t\t\t\t\t\tself.table.rowManager.addRowActual(rowData, true, startRow, true);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnewRows = newRows.slice().reverse();\r\n\r\n\t\t\t\t\t\t\tnewRows.forEach((rowData) => {\r\n\t\t\t\t\t\t\t\tself.table.rowManager.addRowActual(rowData, true, false, true);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//delete removed rows\r\n\t\t\t\t\tif(end !== 0){\r\n\t\t\t\t\t\tvar oldRows = data.slice(start, typeof args[1] === \"undefined\" ? args[1] : start + end);\r\n\r\n\t\t\t\t\t\toldRows.forEach((rowData, i) => {\r\n\t\t\t\t\t\t\tvar row = self.table.rowManager.getRowFromDataObject(rowData);\r\n\r\n\t\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\t\trow.deleteActual(i !== oldRows.length - 1);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(newRows || end !== 0){\r\n\t\t\t\t\t\tself.table.rowManager.reRenderInPosition();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.origFuncs.splice.apply(data, arguments);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tunwatchData(){\r\n\t\tif(this.data !== false){\r\n\t\t\tfor(var key in this.origFuncs){\r\n\t\t\t\tObject.defineProperty(this.data, key, {\r\n\t\t\t\t\tenumerable: true,\r\n\t\t\t\t\tconfigurable:true,\r\n\t\t\t\t\twritable:true,\r\n\t\t\t\t\tvalue: this.origFuncs.key,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\twatchRow(row){\r\n\t\tvar data = row.getData();\r\n\r\n\t\tthis.blocked = true;\r\n\r\n\t\tfor(var key in data){\r\n\t\t\tthis.watchKey(row, data, key);\r\n\t\t}\r\n\r\n\t\tif(this.table.options.dataTree){\r\n\t\t\tthis.watchTreeChildren(row);\r\n\t\t}\r\n\r\n\t\tthis.blocked = false;\r\n\t}\r\n\r\n\twatchTreeChildren (row){\r\n\t\tvar childField = row.getData()[this.table.options.dataTreeChildField],\r\n\t\torigFuncs = {};\r\n\r\n\t\tfunction rebuildTree(){\r\n\t\t\tthis.table.modules.dataTree.initializeRow(row);\r\n\t\t\tthis.table.modules.dataTree.layoutRow(row);\r\n\t\t\tthis.table.rowManager.refreshActiveData(\"tree\", false, true);\r\n\t\t}\r\n\r\n\t\tif(childField){\r\n\r\n\t\t\torigFuncs.push = childField.push;\r\n\r\n\t\t\tObject.defineProperty(childField, \"push\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tvar result = origFuncs.push.apply(childField, arguments);\r\n\r\n\t\t\t\t\trebuildTree();\r\n\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\torigFuncs.unshift = childField.unshift;\r\n\r\n\t\t\tObject.defineProperty(childField, \"unshift\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tvar result = origFuncs.unshift.apply(childField, arguments);\r\n\r\n\t\t\t\t\trebuildTree();\r\n\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\torigFuncs.shift = childField.shift;\r\n\r\n\t\t\tObject.defineProperty(childField, \"shift\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tvar result = origFuncs.shift.call(childField);\r\n\r\n\t\t\t\t\trebuildTree();\r\n\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\torigFuncs.pop = childField.pop;\r\n\r\n\t\t\tObject.defineProperty(childField, \"pop\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tvar result = origFuncs.pop.call(childField);\r\n\r\n\t\t\t\t\trebuildTree();\r\n\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\torigFuncs.splice = childField.splice;\r\n\r\n\t\t\tObject.defineProperty(childField, \"splice\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tvar result = origFuncs.splice.apply(childField, arguments);\r\n\r\n\t\t\t\t\trebuildTree();\r\n\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\twatchKey(row, data, key){\r\n\t\tvar props = Object.getOwnPropertyDescriptor(data, key),\r\n\t\tvalue = data[key],\r\n\t\tversion = this.currentVersion;\r\n\r\n\t\tObject.defineProperty(data, key, {\r\n\t\t\tset: (newValue) => {\r\n\t\t\t\tvalue = newValue;\r\n\t\t\t\tif(!this.blocked && version === this.currentVersion){\r\n\t\t\t\t\tvar update = {};\r\n\t\t\t\t\tupdate[key] = newValue;\r\n\t\t\t\t\trow.updateData(update);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(props.set){\r\n\t\t\t\t\tprops.set(newValue);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tget:() => {\r\n\r\n\t\t\t\tif(props.get){\r\n\t\t\t\t\tprops.get();\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn value;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tunwatchRow(row){\r\n\t\tvar data = row.getData();\r\n\r\n\t\tfor(var key in data){\r\n\t\t\tObject.defineProperty(data, key, {\r\n\t\t\t\tvalue:data[key],\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tblock(){\r\n\t\tthis.blocked = true;\r\n\t}\r\n\r\n\tunblock(){\r\n\t\tthis.blocked = false;\r\n\t}\r\n}\r\n\r\nReactiveData.moduleName = \"reactiveData\";\r\n\r\nexport default ReactiveData;\r\n\r\n\r\n\r\n","import Module from '../../core/Module.js';\r\n\r\nclass ResizeColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.startColumn = false;\r\n\t\tthis.startX = false;\r\n\t\tthis.startWidth = false;\r\n\t\tthis.latestX = false;\r\n\t\tthis.handle = null;\r\n\t\tthis.initialNextColumn = null;\r\n\t\tthis.nextColumn = null;\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.registerColumnOption(\"resizable\", true);\r\n\t\tthis.registerTableOption(\"resizableColumnFit\", false);\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-rendered\", this.layoutColumnHeader.bind(this));\r\n\t}\r\n\t\r\n\tinitializeEventWatchers(){\r\n\t\tif(!this.initialized){\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-rendered\", this.layoutCellHandles.bind(this));\r\n\t\t\tthis.subscribe(\"cell-delete\", this.deInitializeComponent.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-height\", this.resizeHandle.bind(this));\r\n\t\t\tthis.subscribe(\"column-moved\", this.columnLayoutUpdated.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-hide\", this.deInitializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"column-show\", this.columnLayoutUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"column-width\", this.columnWidthUpdated.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-delete\", this.deInitializeComponent.bind(this));\r\n\t\t\tthis.subscribe(\"column-height\", this.resizeHandle.bind(this));\r\n\t\t\t\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\tlayoutCellHandles(cell){\r\n\t\tif(cell.row.type === \"row\"){\r\n\t\t\tthis.deInitializeComponent(cell);\r\n\t\t\tthis.initializeColumn(\"cell\", cell, cell.column, cell.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tlayoutColumnHeader(column){\r\n\t\tif(column.definition.resizable){\r\n\t\t\tthis.initializeEventWatchers();\r\n\t\t\tthis.deInitializeComponent(column);\r\n\t\t\tthis.initializeColumn(\"header\", column, column, column.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolumnLayoutUpdated(column){\r\n\t\tvar prev = column.prevColumn();\r\n\t\t\r\n\t\tthis.reinitializeColumn(column);\r\n\t\t\r\n\t\tif(prev){\r\n\t\t\tthis.reinitializeColumn(prev);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolumnWidthUpdated(column){\r\n\t\tif(column.modules.frozen){\r\n\t\t\tif(this.table.modules.frozenColumns.leftColumns.includes(column)){\r\n\t\t\t\tthis.table.modules.frozenColumns.leftColumns.forEach((col) => {\r\n\t\t\t\t\tthis.reinitializeColumn(col);\r\n\t\t\t\t});\r\n\t\t\t}else if(this.table.modules.frozenColumns.rightColumns.includes(column)){\r\n\t\t\t\tthis.table.modules.frozenColumns.rightColumns.forEach((col) => {\r\n\t\t\t\t\tthis.reinitializeColumn(col);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeColumn(column){\r\n\t\tvar frozenOffset = column.modules.frozen ? (column.modules.frozen.marginValue + column.getWidth() + \"px\") : false;\r\n\t\t;\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tif(cell.modules.resize && cell.modules.resize.handleEl){\r\n\t\t\t\tif(frozenOffset){\r\n\t\t\t\t\tcell.modules.resize.handleEl.style.left = frozenOffset;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcell.element.after(cell.modules.resize.handleEl);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(column.modules.resize && column.modules.resize.handleEl){\r\n\t\t\tif(frozenOffset){\r\n\t\t\t\tcolumn.modules.resize.handleEl.style.left = frozenOffset;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.element.after(column.modules.resize.handleEl);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(type, component, column, element){\r\n\t\tvar self = this,\r\n\t\tvariableHeight = false,\r\n\t\tmode = column.definition.resizable,\r\n\t\tconfig = {},\r\n\t\tnearestColumn = column.getLastColumn();\r\n\t\t\r\n\t\t//set column resize mode\r\n\t\tif(type === \"header\"){\r\n\t\t\tvariableHeight = column.definition.formatter == \"textarea\" || column.definition.variableHeight;\r\n\t\t\tconfig = {variableHeight:variableHeight};\r\n\t\t}\r\n\t\t\r\n\t\tif((mode === true || mode == type) && this._checkResizability(nearestColumn)){\r\n\t\t\t\r\n\t\t\tvar handle = document.createElement('span');\r\n\t\t\thandle.className = \"tabulator-col-resize-handle\";\r\n\t\t\t\r\n\t\t\thandle.addEventListener(\"click\", function(e){\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tvar handleDown = function(e){\r\n\t\t\t\tself.startColumn = column;\r\n\t\t\t\tself.initialNextColumn = self.nextColumn = nearestColumn.nextColumn();\r\n\t\t\t\tself._mouseDown(e, nearestColumn, handle);\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\thandle.addEventListener(\"mousedown\", handleDown);\r\n\t\t\thandle.addEventListener(\"touchstart\", handleDown, {passive: true});\r\n\t\t\t\r\n\t\t\t//resize column on double click\r\n\t\t\thandle.addEventListener(\"dblclick\", (e) => {\r\n\t\t\t\tvar oldWidth = nearestColumn.getWidth();\r\n\t\t\t\t\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tnearestColumn.reinitializeWidth(true);\r\n\t\t\t\t\r\n\t\t\t\tif(oldWidth !== nearestColumn.getWidth()){\r\n\t\t\t\t\tself.dispatch(\"column-resized\", nearestColumn);\r\n\t\t\t\t\tself.table.externalEvents.dispatch(\"columnResized\", nearestColumn.getComponent());\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(column.modules.frozen){\r\n\t\t\t\thandle.style.position = \"absolute\";\r\n\t\t\t\thandle.style.left = column.modules.frozen.marginValue + column.getWidth() + \"px\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconfig.handleEl = handle;\r\n\t\t\t\r\n\t\t\tif(element.parentNode && column.visible){\r\n\t\t\t\telement.after(handle);\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcomponent.modules.resize = config;\r\n\t}\r\n\t\r\n\tdeInitializeColumn(column){\r\n\t\tthis.deInitializeComponent(column);\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tthis.deInitializeComponent(cell);\r\n\t\t});\r\n\t}\r\n\t\r\n\tdeInitializeComponent(component){\r\n\t\tvar handleEl;\r\n\t\t\r\n\t\tif(component.modules.resize){\r\n\t\t\thandleEl = component.modules.resize.handleEl;\r\n\t\t\t\r\n\t\t\tif(handleEl && handleEl.parentElement){\r\n\t\t\t\thandleEl.parentElement.removeChild(handleEl);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tresizeHandle(component, height){\r\n\t\tif(component.modules.resize && component.modules.resize.handleEl){\r\n\t\t\tcomponent.modules.resize.handleEl.style.height = height;\r\n\t\t}\r\n\t}\r\n\t\r\n\t_checkResizability(column){\r\n\t\treturn column.definition.resizable;\r\n\t}\r\n\t\r\n\t_mouseDown(e, column, handle){\r\n\t\tvar self = this;\r\n\t\t\r\n\t\tself.table.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\tfunction mouseMove(e){\r\n\t\t\tvar x = typeof e.screenX === \"undefined\" ? e.touches[0].screenX : e.screenX,\r\n\t\t\tstartDiff = x - self.startX,\r\n\t\t\tmoveDiff = x - self.latestX,\r\n\t\t\tblockedBefore, blockedAfter;\r\n\t\t\t\r\n\t\t\tself.latestX = x;\r\n\t\t\t\r\n\t\t\tif(self.table.rtl){\r\n\t\t\t\tstartDiff = -startDiff;\r\n\t\t\t\tmoveDiff = -moveDiff;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tblockedBefore = column.width == column.minWidth || column.width == column.maxWidth;\r\n\t\t\t\r\n\t\t\tcolumn.setWidth(self.startWidth + startDiff);\r\n\t\t\t\r\n\t\t\tblockedAfter = column.width == column.minWidth || column.width == column.maxWidth;\r\n\t\t\t\r\n\t\t\tif(moveDiff < 0){\r\n\t\t\t\tself.nextColumn = self.initialNextColumn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(self.table.options.resizableColumnFit && self.nextColumn && !(blockedBefore && blockedAfter)){\r\n\t\t\t\tlet colWidth = self.nextColumn.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tif(moveDiff > 0){\r\n\t\t\t\t\tif(colWidth <= self.nextColumn.minWidth){\r\n\t\t\t\t\t\tself.nextColumn = self.nextColumn.nextColumn();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(self.nextColumn){\r\n\t\t\t\t\tself.nextColumn.setWidth(self.nextColumn.getWidth() - moveDiff);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tself.table.columnManager.renderer.rerenderColumns(true);\r\n\t\t\t\r\n\t\t\tif(!self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight){\r\n\t\t\t\tcolumn.checkCellHeights();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfunction mouseUp(e){\r\n\t\t\t\r\n\t\t\t//block editor from taking action while resizing is taking place\r\n\t\t\tif(self.startColumn.modules.edit){\r\n\t\t\t\tself.startColumn.modules.edit.blocked = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight){\r\n\t\t\t\tcolumn.checkCellHeights();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", mouseUp);\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", mouseMove);\r\n\t\t\t\r\n\t\t\thandle.removeEventListener(\"touchmove\", mouseMove);\r\n\t\t\thandle.removeEventListener(\"touchend\", mouseUp);\r\n\t\t\t\r\n\t\t\tself.table.element.classList.remove(\"tabulator-block-select\");\r\n\t\t\t\r\n\t\t\tif(self.startWidth !== column.getWidth()){\r\n\t\t\t\tself.dispatch(\"column-resized\", column);\r\n\t\t\t\tself.table.externalEvents.dispatch(\"columnResized\", column.getComponent());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\te.stopPropagation(); //prevent resize from interfereing with movable columns\r\n\t\t\r\n\t\t//block editor from taking action while resizing is taking place\r\n\t\tif(self.startColumn.modules.edit){\r\n\t\t\tself.startColumn.modules.edit.blocked = true;\r\n\t\t}\r\n\t\t\r\n\t\tself.startX = typeof e.screenX === \"undefined\" ? e.touches[0].screenX : e.screenX;\r\n\t\tself.latestX = self.startX;\r\n\t\tself.startWidth = column.getWidth();\r\n\t\t\r\n\t\tdocument.body.addEventListener(\"mousemove\", mouseMove);\r\n\t\tdocument.body.addEventListener(\"mouseup\", mouseUp);\r\n\t\thandle.addEventListener(\"touchmove\", mouseMove, {passive: true});\r\n\t\thandle.addEventListener(\"touchend\", mouseUp);\r\n\t}\r\n}\r\n\r\nResizeColumns.moduleName = \"resizeColumns\";\r\n\r\nexport default ResizeColumns;","import Module from '../../core/Module.js';\r\n\r\nclass ResizeRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.startColumn = false;\r\n\t\tthis.startY = false;\r\n\t\tthis.startHeight = false;\r\n\t\tthis.handle = null;\r\n\t\tthis.prevHandle = null;\r\n\r\n\t\tthis.registerTableOption(\"resizableRows\", false); //resizable rows\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.resizableRows){\r\n\t\t\tthis.subscribe(\"row-layout-after\", this.initializeRow.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\trowEl = row.getElement();\r\n\r\n\t\tvar handle = document.createElement('div');\r\n\t\thandle.className = \"tabulator-row-resize-handle\";\r\n\r\n\t\tvar prevHandle = document.createElement('div');\r\n\t\tprevHandle.className = \"tabulator-row-resize-handle prev\";\r\n\r\n\t\thandle.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tvar handleDown = function(e){\r\n\t\t\tself.startRow = row;\r\n\t\t\tself._mouseDown(e, row, handle);\r\n\t\t};\r\n\r\n\t\thandle.addEventListener(\"mousedown\", handleDown);\r\n\t\thandle.addEventListener(\"touchstart\", handleDown, {passive: true});\r\n\r\n\t\tprevHandle.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tvar prevHandleDown = function(e){\r\n\t\t\tvar prevRow = self.table.rowManager.prevDisplayRow(row);\r\n\r\n\t\t\tif(prevRow){\r\n\t\t\t\tself.startRow = prevRow;\r\n\t\t\t\tself._mouseDown(e, prevRow, prevHandle);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tprevHandle.addEventListener(\"mousedown\",prevHandleDown);\r\n\t\tprevHandle.addEventListener(\"touchstart\",prevHandleDown, {passive: true});\r\n\r\n\t\trowEl.appendChild(handle);\r\n\t\trowEl.appendChild(prevHandle);\r\n\t}\r\n\r\n\t_mouseDown(e, row, handle){\r\n\t\tvar self = this;\r\n\r\n\t\tself.table.element.classList.add(\"tabulator-block-select\");\r\n\r\n\t\tfunction mouseMove(e){\r\n\t\t\trow.setHeight(self.startHeight + ((typeof e.screenY === \"undefined\" ? e.touches[0].screenY : e.screenY) - self.startY));\r\n\t\t}\r\n\r\n\t\tfunction mouseUp(e){\r\n\r\n\t\t\t// //block editor from taking action while resizing is taking place\r\n\t\t\t// if(self.startColumn.modules.edit){\r\n\t\t\t// \tself.startColumn.modules.edit.blocked = false;\r\n\t\t\t// }\r\n\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", mouseMove);\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", mouseMove);\r\n\r\n\t\t\thandle.removeEventListener(\"touchmove\", mouseMove);\r\n\t\t\thandle.removeEventListener(\"touchend\", mouseUp);\r\n\r\n\t\t\tself.table.element.classList.remove(\"tabulator-block-select\");\r\n\r\n\t\t\tself.dispatchExternal(\"rowResized\", row.getComponent());\r\n\t\t}\r\n\r\n\t\te.stopPropagation(); //prevent resize from interfereing with movable columns\r\n\r\n\t\t//block editor from taking action while resizing is taking place\r\n\t\t// if(self.startColumn.modules.edit){\r\n\t\t// \tself.startColumn.modules.edit.blocked = true;\r\n\t\t// }\r\n\r\n\t\tself.startY = typeof e.screenY === \"undefined\" ? e.touches[0].screenY : e.screenY;\r\n\t\tself.startHeight = row.getHeight();\r\n\r\n\t\tdocument.body.addEventListener(\"mousemove\", mouseMove);\r\n\t\tdocument.body.addEventListener(\"mouseup\", mouseUp);\r\n\r\n\t\thandle.addEventListener(\"touchmove\", mouseMove, {passive: true});\r\n\t\thandle.addEventListener(\"touchend\", mouseUp);\r\n\t}\r\n}\r\n\r\nResizeRows.moduleName = \"resizeRows\";\r\n\r\nexport default ResizeRows;","import Module from '../../core/Module.js';\r\n\r\nclass ResizeTable extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.binding = false;\r\n\t\tthis.observer = false;\r\n\t\tthis.containerObserver = false;\r\n\r\n\t\tthis.tableHeight = 0;\r\n\t\tthis.tableWidth = 0;\r\n\t\tthis.containerHeight = 0;\r\n\t\tthis.containerWidth = 0;\r\n\r\n\t\tthis.autoResize = false;\r\n\r\n\t\tthis.registerTableOption(\"autoResize\", true); //auto resize table\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.autoResize){\r\n\t\t\tvar table = this.table,\r\n\t\t\ttableStyle;\r\n\r\n\t\t\tthis.tableHeight = table.element.clientHeight;\r\n\t\t\tthis.tableWidth = table.element.clientWidth;\r\n\r\n\t\t\tif(table.element.parentNode){\r\n\t\t\t\tthis.containerHeight = table.element.parentNode.clientHeight;\r\n\t\t\t\tthis.containerWidth = table.element.parentNode.clientWidth;\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof ResizeObserver !== \"undefined\" && table.rowManager.getRenderMode() === \"virtual\"){\r\n\r\n\t\t\t\tthis.autoResize = true;\r\n\r\n\t\t\t\tthis.observer = new ResizeObserver((entry) => {\r\n\t\t\t\t\tif(!table.browserMobile || (table.browserMobile &&!table.modules.edit.currentCell)){\r\n\r\n\t\t\t\t\t\tvar nodeHeight = Math.floor(entry[0].contentRect.height);\r\n\t\t\t\t\t\tvar nodeWidth = Math.floor(entry[0].contentRect.width);\r\n\r\n\t\t\t\t\t\tif(this.tableHeight != nodeHeight || this.tableWidth != nodeWidth){\r\n\t\t\t\t\t\t\tthis.tableHeight = nodeHeight;\r\n\t\t\t\t\t\t\tthis.tableWidth = nodeWidth;\r\n\r\n\t\t\t\t\t\t\tif(table.element.parentNode){\r\n\t\t\t\t\t\t\t\tthis.containerHeight = table.element.parentNode.clientHeight;\r\n\t\t\t\t\t\t\t\tthis.containerWidth = table.element.parentNode.clientWidth;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tthis.table.columnManager.renderer.rerenderColumns(true);\r\n\r\n\t\t\t\t\t\t\ttable.redraw();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.observer.observe(table.element);\r\n\r\n\t\t\t\ttableStyle = window.getComputedStyle(table.element);\r\n\r\n\t\t\t\tif(this.table.element.parentNode && !this.table.rowManager.fixedHeight && (tableStyle.getPropertyValue(\"max-height\") || tableStyle.getPropertyValue(\"min-height\"))){\r\n\r\n\t\t\t\t\tthis.containerObserver = new ResizeObserver((entry) => {\r\n\t\t\t\t\t\tif(!table.browserMobile || (table.browserMobile &&!table.modules.edit.currentCell)){\r\n\r\n\t\t\t\t\t\t\tvar nodeHeight = Math.floor(entry[0].contentRect.height);\r\n\t\t\t\t\t\t\tvar nodeWidth = Math.floor(entry[0].contentRect.width);\r\n\r\n\t\t\t\t\t\t\tif(this.containerHeight != nodeHeight || this.containerWidth != nodeWidth){\r\n\t\t\t\t\t\t\t\tthis.containerHeight = nodeHeight;\r\n\t\t\t\t\t\t\t\tthis.containerWidth = nodeWidth;\r\n\t\t\t\t\t\t\t\tthis.tableHeight = table.element.clientHeight;\r\n\t\t\t\t\t\t\t\tthis.tableWidth = table.element.clientWidth;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\ttable.columnManager.renderer.rerenderColumns(true);\r\n\r\n\t\t\t\t\t\t\ttable.redraw();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tthis.containerObserver.observe(this.table.element.parentNode);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.subscribe(\"table-resize\", this.tableResized.bind(this));\r\n\r\n\t\t\t}else{\r\n\t\t\t\tthis.binding = function(){\r\n\t\t\t\t\tif(!table.browserMobile || (table.browserMobile && !table.modules.edit.currentCell)){\r\n\r\n\t\t\t\t\t\ttable.columnManager.renderer.rerenderColumns(true);\r\n\r\n\t\t\t\t\t\ttable.redraw();\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\r\n\t\t\t\twindow.addEventListener(\"resize\", this.binding);\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"table-destroy\", this.clearBindings.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\ttableResized(){\r\n\t\tthis.table.rowManager.redraw();\r\n\t}\r\n\r\n\tclearBindings(){\r\n\t\tif(this.binding){\r\n\t\t\twindow.removeEventListener(\"resize\", this.binding);\r\n\t\t}\r\n\r\n\t\tif(this.observer){\r\n\t\t\tthis.observer.unobserve(this.table.element);\r\n\t\t}\r\n\r\n\t\tif(this.containerObserver){\r\n\t\t\tthis.containerObserver.unobserve(this.table.element.parentNode);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nResizeTable.moduleName = \"resizeTable\";\r\n\r\nexport default ResizeTable;","import Module from '../../core/Module.js';\r\n\r\nclass ResponsiveLayout extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.columns = [];\r\n\t\tthis.hiddenColumns = [];\r\n\t\tthis.mode = \"\";\r\n\t\tthis.index = 0;\r\n\t\tthis.collapseFormatter = [];\r\n\t\tthis.collapseStartOpen = true;\r\n\t\tthis.collapseHandleColumn = false;\r\n\r\n\t\tthis.registerTableOption(\"responsiveLayout\", false); //responsive layout flags\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseStartOpen\", true); //start showing collapsed data\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseUseFormatters\", true); //responsive layout collapse formatter\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseFormatter\", false); //responsive layout collapse formatter\r\n\r\n\t\tthis.registerColumnOption(\"responsive\");\r\n\t}\r\n\r\n\t//generate responsive columns list\r\n\tinitialize(){\r\n\t\tvar self = this,\r\n\t\tcolumns = [];\r\n\r\n\t\tif(this.table.options.responsiveLayout){\r\n\t\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"column-show\", this.updateColumnVisibility.bind(this));\r\n\t\t\tthis.subscribe(\"column-hide\", this.updateColumnVisibility.bind(this));\r\n\t\t\tthis.subscribe(\"columns-loaded\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-moved\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-add\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-delete\", this.initializeResponsivity.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"table-redrawing\", this.tableRedraw.bind(this));\r\n\r\n\t\t\tif(this.table.options.responsiveLayout === \"collapse\"){\r\n\t\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\t\tthis.subscribe(\"row-layout\", this.layoutRow.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tif([\"fitColumns\", \"fitDataStretch\"].indexOf(this.layoutMode()) === -1){\r\n\t\t\tif(!force){\r\n\t\t\t\tthis.update();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeResponsivity(){\r\n\t\tvar columns = [];\r\n\r\n\t\tthis.mode = this.table.options.responsiveLayout;\r\n\t\tthis.collapseFormatter = this.table.options.responsiveLayoutCollapseFormatter || this.formatCollapsedData;\r\n\t\tthis.collapseStartOpen = this.table.options.responsiveLayoutCollapseStartOpen;\r\n\t\tthis.hiddenColumns = [];\r\n\r\n\t\t//determine level of responsivity for each column\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column, i) => {\r\n\t\t\tif(column.modules.responsive){\r\n\t\t\t\tif(column.modules.responsive.order && column.modules.responsive.visible){\r\n\t\t\t\t\tcolumn.modules.responsive.index = i;\r\n\t\t\t\t\tcolumns.push(column);\r\n\r\n\t\t\t\t\tif(!column.visible && this.mode === \"collapse\"){\r\n\t\t\t\t\t\tthis.hiddenColumns.push(column);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t//sort list by responsivity\r\n\t\tcolumns = columns.reverse();\r\n\t\tcolumns = columns.sort((a, b) => {\r\n\t\t\tvar diff = b.modules.responsive.order - a.modules.responsive.order;\r\n\t\t\treturn diff || (b.modules.responsive.index - a.modules.responsive.index);\r\n\t\t});\r\n\r\n\t\tthis.columns = columns;\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tthis.generateCollapsedContent();\r\n\t\t}\r\n\r\n\t\t//assign collapse column\r\n\t\tfor (let col of this.table.columnManager.columnsByIndex){\r\n\t\t\tif(col.definition.formatter == \"responsiveCollapse\"){\r\n\t\t\t\tthis.collapseHandleColumn = col;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this.collapseHandleColumn){\r\n\t\t\tif(this.hiddenColumns.length){\r\n\t\t\t\tthis.collapseHandleColumn.show();\r\n\t\t\t}else{\r\n\t\t\t\tthis.collapseHandleColumn.hide();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//define layout information\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.getDefinition();\r\n\r\n\t\tcolumn.modules.responsive = {order: typeof def.responsive === \"undefined\" ? 1 : def.responsive, visible:def.visible === false ? false : true};\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar el;\r\n\r\n\t\tif(row.type !== \"calc\"){\r\n\t\t\tel = document.createElement(\"div\");\r\n\t\t\tel.classList.add(\"tabulator-responsive-collapse\");\r\n\r\n\t\t\trow.modules.responsiveLayout = {\r\n\t\t\t\telement:el,\r\n\t\t\t\topen:this.collapseStartOpen,\r\n\t\t\t};\r\n\r\n\t\t\tif(!this.collapseStartOpen){\r\n\t\t\t\tel.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tlayoutRow(row){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tif(row.modules.responsiveLayout){\r\n\t\t\trowEl.appendChild(row.modules.responsiveLayout.element);\r\n\t\t\tthis.generateCollapsedRowContent(row);\r\n\t\t}\r\n\t}\r\n\r\n\t//update column visibility\r\n\tupdateColumnVisibility(column, responsiveToggle){\r\n\t\tif(!responsiveToggle && column.modules.responsive){\r\n\t\t\tcolumn.modules.responsive.visible = column.visible;\r\n\t\t\tthis.initializeResponsivity();\r\n\t\t}\r\n\t}\r\n\r\n\thideColumn(column){\r\n\t\tvar colCount = this.hiddenColumns.length;\r\n\r\n\t\tcolumn.hide(false, true);\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tthis.hiddenColumns.unshift(column);\r\n\t\t\tthis.generateCollapsedContent();\r\n\r\n\t\t\tif(this.collapseHandleColumn && !colCount){\r\n\t\t\t\tthis.collapseHandleColumn.show();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tshowColumn(column){\r\n\t\tvar index;\r\n\r\n\t\tcolumn.show(false, true);\r\n\t\t//set column width to prevent calculation loops on uninitialized columns\r\n\t\tcolumn.setWidth(column.getWidth());\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tindex = this.hiddenColumns.indexOf(column);\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.hiddenColumns.splice(index, 1);\r\n\t\t\t}\r\n\r\n\t\t\tthis.generateCollapsedContent();\r\n\r\n\t\t\tif(this.collapseHandleColumn && !this.hiddenColumns.length){\r\n\t\t\t\tthis.collapseHandleColumn.hide();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//redraw columns to fit space\r\n\tupdate(){\r\n\t\tvar self = this,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\r\n\t\t\tlet width = self.table.modules.layout.getMode() == \"fitColumns\" ? self.table.columnManager.getFlexBaseWidth() : self.table.columnManager.getWidth();\r\n\r\n\t\t\tlet diff = (self.table.options.headerVisible ? self.table.columnManager.element.clientWidth : self.table.element.clientWidth) - width;\r\n\r\n\t\t\tif(diff < 0){\r\n\t\t\t\t//table is too wide\r\n\t\t\t\tlet column = self.columns[self.index];\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tself.hideColumn(column);\r\n\t\t\t\t\tself.index ++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\r\n\t\t\t\t//table has spare space\r\n\t\t\t\tlet column = self.columns[self.index -1];\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tif(diff > 0){\r\n\t\t\t\t\t\tif(diff >= column.getWidth()){\r\n\t\t\t\t\t\t\tself.showColumn(column);\r\n\t\t\t\t\t\t\tself.index --;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tworking = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tworking = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(!self.table.rowManager.activeRowsCount){\r\n\t\t\t\tself.table.rowManager.renderEmptyScroll();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateCollapsedContent(){\r\n\t\tvar self = this,\r\n\t\trows = this.table.rowManager.getDisplayRows();\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\tself.generateCollapsedRowContent(row);\r\n\t\t});\r\n\t}\r\n\r\n\tgenerateCollapsedRowContent(row){\r\n\t\tvar el, contents;\r\n\r\n\t\tif(row.modules.responsiveLayout){\r\n\t\t\tel = row.modules.responsiveLayout.element;\r\n\r\n\t\t\twhile(el.firstChild) el.removeChild(el.firstChild);\r\n\r\n\t\t\tcontents = this.collapseFormatter(this.generateCollapsedRowData(row));\r\n\t\t\tif(contents){\r\n\t\t\t\tel.appendChild(contents);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateCollapsedRowData(row){\r\n\t\tvar self = this,\r\n\t\tdata = row.getData(),\r\n\t\toutput = [],\r\n\t\tmockCellComponent;\r\n\r\n\t\tthis.hiddenColumns.forEach(function(column){\r\n\t\t\tvar value = column.getFieldValue(data);\r\n\r\n\t\t\tif(column.definition.title && column.field){\r\n\t\t\t\tif(column.modules.format && self.table.options.responsiveLayoutCollapseUseFormatters){\r\n\r\n\t\t\t\t\tmockCellComponent = {\r\n\t\t\t\t\t\tvalue:false,\r\n\t\t\t\t\t\tdata:{},\r\n\t\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetData:function(){\r\n\t\t\t\t\t\t\treturn data;\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\t\treturn document.createElement(\"div\");\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\t\treturn row.getComponent();\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tfunction onRendered(callback){\r\n\t\t\t\t\t\tcallback();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\toutput.push({\r\n\t\t\t\t\t\tfield: column.field,\r\n\t\t\t\t\t\ttitle: column.definition.title,\r\n\t\t\t\t\t\tvalue: column.modules.format.formatter.call(self.table.modules.format, mockCellComponent, column.modules.format.params, onRendered)\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\toutput.push({\r\n\t\t\t\t\t\tfield: column.field,\r\n\t\t\t\t\t\ttitle: column.definition.title,\r\n\t\t\t\t\t\tvalue: value\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tformatCollapsedData(data){\r\n\t\tvar list = document.createElement(\"table\");\r\n\r\n\t\tdata.forEach(function(item){\r\n\t\t\tvar row = document.createElement(\"tr\");\r\n\t\t\tvar titleData = document.createElement(\"td\");\r\n\t\t\tvar valueData = document.createElement(\"td\");\r\n\t\t\tvar node_content;\r\n\r\n\t\t\tvar titleHighlight = document.createElement(\"strong\");\r\n\t\t\ttitleData.appendChild(titleHighlight);\r\n\t\t\tthis.langBind(\"columns|\" + item.field, function(text){\r\n\t\t\t\ttitleHighlight.innerHTML = text || item.title;\r\n\t\t\t});\r\n\r\n\t\t\tif(item.value instanceof Node){\r\n\t\t\t\tnode_content = document.createElement(\"div\");\r\n\t\t\t\tnode_content.appendChild(item.value);\r\n\t\t\t\tvalueData.appendChild(node_content);\r\n\t\t\t}else{\r\n\t\t\t\tvalueData.innerHTML = item.value;\r\n\t\t\t}\r\n\r\n\t\t\trow.appendChild(titleData);\r\n\t\t\trow.appendChild(valueData);\r\n\t\t\tlist.appendChild(row);\r\n\t\t}, this);\r\n\r\n\t\treturn Object.keys(data).length ? list : \"\";\r\n\t}\r\n}\r\n\r\nResponsiveLayout.moduleName = \"responsiveLayout\";\r\n\r\nexport default ResponsiveLayout;","import Module from '../../core/Module.js';\r\n\r\nclass SelectRow extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.selecting = false; //flag selecting in progress\r\n\t\tthis.lastClickedRow = false; //last clicked row\r\n\t\tthis.selectPrev = []; //hold previously selected element for drag drop selection\r\n\t\tthis.selectedRows = []; //hold selected rows\r\n\t\tthis.headerCheckboxElement = null; // hold header select element\r\n\t\t\r\n\t\tthis.registerTableOption(\"selectable\", \"highlight\"); //highlight rows on hover\r\n\t\tthis.registerTableOption(\"selectableRangeMode\", \"drag\"); //highlight rows on hover\r\n\t\tthis.registerTableOption(\"selectableRollingSelection\", true); //roll selection once maximum number of selectable rows is reached\r\n\t\tthis.registerTableOption(\"selectablePersistence\", true); // maintain selection when table view is updated\r\n\t\tthis.registerTableOption(\"selectableCheck\", function(data, row){return true;}); //check wheather row is selectable\r\n\t\t\r\n\t\tthis.registerTableFunction(\"selectRow\", this.selectRows.bind(this));\r\n\t\tthis.registerTableFunction(\"deselectRow\", this.deselectRows.bind(this));\r\n\t\tthis.registerTableFunction(\"toggleSelectRow\", this.toggleRow.bind(this));\r\n\t\tthis.registerTableFunction(\"getSelectedRows\", this.getSelectedRows.bind(this));\r\n\t\tthis.registerTableFunction(\"getSelectedData\", this.getSelectedData.bind(this));\r\n\t\t\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"select\", this.selectRows.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"deselect\", this.deselectRows.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"toggleSelect\", this.toggleRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isSelected\", this.isRowSelected.bind(this));\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.selectable !== false){\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleting\", this.rowDeleted.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.clearSelectionData.bind(this));\r\n\t\t\tthis.subscribe(\"rows-retrieve\", this.rowRetrieve.bind(this));\r\n\t\t\t\r\n\t\t\tif(this.table.options.selectable && !this.table.options.selectablePersistence){\r\n\t\t\t\tthis.subscribe(\"data-refreshing\", this.deselectRows.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trowRetrieve(type, prevValue){\r\n\t\treturn type === \"selected\" ? this.selectedRows : prevValue;\r\n\t}\r\n\t\r\n\trowDeleted(row){\r\n\t\tthis._deselectRow(row, true);\r\n\t}\r\n\t\r\n\tclearSelectionData(silent){\r\n\t\tthis.selecting = false;\r\n\t\tthis.lastClickedRow = false;\r\n\t\tthis.selectPrev = [];\r\n\t\tthis.selectedRows = [];\r\n\t\t\r\n\t\tif(silent !== true){\r\n\t\t\tthis._rowSelectionChanged();\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\telement = row.getElement();\r\n\t\t\r\n\t\t// trigger end of row selection\r\n\t\tvar endSelect = function(){\r\n\t\t\t\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tself.selecting = false;\r\n\t\t\t}, 50);\r\n\t\t\t\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", endSelect);\r\n\t\t};\r\n\t\t\r\n\t\trow.modules.select = {selected:false};\r\n\t\t\r\n\t\t//set row selection class\r\n\t\tif(self.table.options.selectableCheck.call(this.table, row.getComponent())){\r\n\t\t\telement.classList.add(\"tabulator-selectable\");\r\n\t\t\telement.classList.remove(\"tabulator-unselectable\");\r\n\t\t\t\r\n\t\t\tif(self.table.options.selectable && self.table.options.selectable != \"highlight\"){\r\n\t\t\t\tif(self.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\telement.addEventListener(\"click\", this.handleComplexRowClick.bind(this, row));\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.addEventListener(\"click\", function(e){\r\n\t\t\t\t\t\tif(!self.table.modExists(\"edit\") || !self.table.modules.edit.getCurrentCell()){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!self.selecting){\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\t\t\tif(e.shiftKey){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.selecting = true;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.selectPrev = [];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tdocument.body.addEventListener(\"mouseup\", endSelect);\r\n\t\t\t\t\t\t\tdocument.body.addEventListener(\"keyup\", endSelect);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mouseenter\", function(e){\r\n\t\t\t\t\t\tif(self.selecting){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(self.selectPrev[1] == row){\r\n\t\t\t\t\t\t\t\tself.toggleRow(self.selectPrev[0]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mouseout\", function(e){\r\n\t\t\t\t\t\tif(self.selecting){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\tself.selectPrev.unshift(row);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\telement.classList.add(\"tabulator-unselectable\");\r\n\t\t\telement.classList.remove(\"tabulator-selectable\");\r\n\t\t}\r\n\t}\r\n\t\r\n\thandleComplexRowClick(row, e){\r\n\t\tif(e.shiftKey){\r\n\t\t\tthis.table._clearSelection();\r\n\t\t\tthis.lastClickedRow = this.lastClickedRow || row;\r\n\t\t\t\r\n\t\t\tvar lastClickedRowIdx = this.table.rowManager.getDisplayRowIndex(this.lastClickedRow);\r\n\t\t\tvar rowIdx = this.table.rowManager.getDisplayRowIndex(row);\r\n\t\t\t\r\n\t\t\tvar fromRowIdx = lastClickedRowIdx <= rowIdx ? lastClickedRowIdx : rowIdx;\r\n\t\t\tvar toRowIdx = lastClickedRowIdx >= rowIdx ? lastClickedRowIdx : rowIdx;\r\n\t\t\t\r\n\t\t\tvar rows = this.table.rowManager.getDisplayRows().slice(0);\r\n\t\t\tvar toggledRows = rows.splice(fromRowIdx, toRowIdx - fromRowIdx + 1);\r\n\t\t\t\r\n\t\t\tif(e.ctrlKey || e.metaKey){\r\n\t\t\t\ttoggledRows.forEach((toggledRow)=>{\r\n\t\t\t\t\tif(toggledRow !== this.lastClickedRow){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.table.options.selectable !== true && !this.isRowSelected(row)){\r\n\t\t\t\t\t\t\tif(this.selectedRows.length < this.table.options.selectable){\r\n\t\t\t\t\t\t\t\tthis.toggleRow(toggledRow);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.toggleRow(toggledRow);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tthis.lastClickedRow = row;\r\n\t\t\t}else{\r\n\t\t\t\tthis.deselectRows(undefined, true);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.selectable !== true){\r\n\t\t\t\t\tif(toggledRows.length > this.table.options.selectable){\r\n\t\t\t\t\t\ttoggledRows = toggledRows.slice(0, this.table.options.selectable)\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.selectRows(toggledRows);\r\n\t\t\t}\r\n\t\t\tthis.table._clearSelection();\r\n\t\t}\r\n\t\telse if(e.ctrlKey || e.metaKey){\r\n\t\t\tthis.toggleRow(row);\r\n\t\t\tthis.lastClickedRow = row;\r\n\t\t}else{\r\n\t\t\tthis.deselectRows(undefined, true);\r\n\t\t\tthis.selectRows(row);\r\n\t\t\tthis.lastClickedRow = row;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//toggle row selection\r\n\ttoggleRow(row){\r\n\t\tif(this.table.options.selectableCheck.call(this.table, row.getComponent())){\r\n\t\t\tif(row.modules.select && row.modules.select.selected){\r\n\t\t\t\tthis._deselectRow(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis._selectRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//select a number of rows\r\n\tselectRows(rows){\r\n\t\tvar rowMatch;\r\n\t\t\r\n\t\tswitch(typeof rows){\r\n\t\t\tcase \"undefined\":\r\n\t\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis._rowSelectionChanged();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"string\":\r\n\t\t\t\r\n\t\t\trowMatch = this.table.rowManager.findRow(rows);\r\n\t\t\t\r\n\t\t\tif(rowMatch){\r\n\t\t\t\tthis._selectRow(rowMatch, true, true);\r\n\t\t\t}else{\r\n\t\t\t\tthis.table.rowManager.getRows(rows).forEach((row) => {\r\n\t\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._rowSelectionChanged();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\tif(Array.isArray(rows)){\r\n\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis._rowSelectionChanged();\r\n\t\t\t}else{\r\n\t\t\t\tthis._selectRow(rows, false, true);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//select an individual row\r\n\t_selectRow(rowInfo, silent, force){\r\n\t\tvar index;\r\n\t\t\r\n\t\t//handle max row count\r\n\t\tif(!isNaN(this.table.options.selectable) && this.table.options.selectable !== true && !force){\r\n\t\t\tif(this.selectedRows.length >= this.table.options.selectable){\r\n\t\t\t\tif(this.table.options.selectableRollingSelection){\r\n\t\t\t\t\tthis._deselectRow(this.selectedRows[0]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tvar row = this.table.rowManager.findRow(rowInfo);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\tif(this.selectedRows.indexOf(row) == -1){\r\n\t\t\t\trow.getElement().classList.add(\"tabulator-selected\");\r\n\t\t\t\tif(!row.modules.select){\r\n\t\t\t\t\trow.modules.select = {};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\trow.modules.select.selected = true;\r\n\t\t\t\tif(row.modules.select.checkboxEl){\r\n\t\t\t\t\trow.modules.select.checkboxEl.checked = true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.selectedRows.push(row);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.dataTreeSelectPropagate){\r\n\t\t\t\t\tthis.childRowSelection(row, true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatchExternal(\"rowSelected\", row.getComponent());\r\n\t\t\t\t\r\n\t\t\t\tthis._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Selection Error - No such row found, ignoring selection:\" + rowInfo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tisRowSelected(row){\r\n\t\treturn this.selectedRows.indexOf(row) !== -1;\r\n\t}\r\n\t\r\n\t//deselect a number of rows\r\n\tdeselectRows(rows, silent){\r\n\t\tvar self = this,\r\n\t\trowCount;\r\n\t\t\r\n\t\tif(typeof rows == \"undefined\"){\r\n\t\t\t\r\n\t\t\trowCount = self.selectedRows.length;\r\n\t\t\t\r\n\t\t\tfor(let i = 0; i < rowCount; i++){\r\n\t\t\t\tself._deselectRow(self.selectedRows[0], true);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(rowCount){\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tif(Array.isArray(rows)){\r\n\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\tself._deselectRow(row, true);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}else{\r\n\t\t\t\tself._deselectRow(rows, silent);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//deselect an individual row\r\n\t_deselectRow(rowInfo, silent){\r\n\t\tvar self = this,\r\n\t\trow = self.table.rowManager.findRow(rowInfo),\r\n\t\tindex;\r\n\t\t\r\n\t\tif(row){\r\n\t\t\tindex = self.selectedRows.findIndex(function(selectedRow){\r\n\t\t\t\treturn selectedRow == row;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\t\r\n\t\t\t\trow.getElement().classList.remove(\"tabulator-selected\");\r\n\t\t\t\tif(!row.modules.select){\r\n\t\t\t\t\trow.modules.select = {};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\trow.modules.select.selected = false;\r\n\t\t\t\tif(row.modules.select.checkboxEl){\r\n\t\t\t\t\trow.modules.select.checkboxEl.checked = false;\r\n\t\t\t\t}\r\n\t\t\t\tself.selectedRows.splice(index, 1);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.dataTreeSelectPropagate){\r\n\t\t\t\t\tthis.childRowSelection(row, false);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatchExternal(\"rowDeselected\", row.getComponent());\r\n\t\t\t\t\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Deselection Error - No such row found, ignoring selection:\" + rowInfo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetSelectedData(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tthis.selectedRows.forEach(function(row){\r\n\t\t\tdata.push(row.getData());\r\n\t\t});\r\n\t\t\r\n\t\treturn data;\r\n\t}\r\n\t\r\n\tgetSelectedRows(){\r\n\t\t\r\n\t\tvar rows = [];\r\n\t\t\r\n\t\tthis.selectedRows.forEach(function(row){\r\n\t\t\trows.push(row.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t_rowSelectionChanged(silent){\r\n\t\tif(this.headerCheckboxElement){\r\n\t\t\tif(this.selectedRows.length === 0){\r\n\t\t\t\tthis.headerCheckboxElement.checked = false;\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = false;\r\n\t\t\t} else if(this.table.rowManager.rows.length === this.selectedRows.length){\r\n\t\t\t\tthis.headerCheckboxElement.checked = true;\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = false;\r\n\t\t\t} else {\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = true;\r\n\t\t\t\tthis.headerCheckboxElement.checked = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(!silent){\r\n\t\t\tthis.dispatchExternal(\"rowSelectionChanged\", this.getSelectedData(), this.getSelectedRows());\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterRowSelectCheckbox (row, element) {\r\n\t\tif(!row._row.modules.select){\r\n\t\t\trow._row.modules.select = {};\r\n\t\t}\r\n\t\t\r\n\t\trow._row.modules.select.checkboxEl = element;\r\n\t}\r\n\t\r\n\tregisterHeaderSelectCheckbox (element) {\r\n\t\tthis.headerCheckboxElement = element;\r\n\t}\r\n\t\r\n\tchildRowSelection(row, select){\r\n\t\tvar children = this.table.modules.dataTree.getChildren(row, true);\r\n\t\t\r\n\t\tif(select){\r\n\t\t\tfor(let child of children){\r\n\t\t\t\tthis._selectRow(child, true);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tfor(let child of children){\r\n\t\t\t\tthis._deselectRow(child, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nSelectRow.moduleName = \"selectRow\";\r\n\r\nexport default SelectRow;","//sort datetime\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar format = params.format || \"dd/MM/yyyy HH:mm:ss\",\r\n\talignEmptyValues = params.alignEmptyValues,\r\n\temptyAlign = 0;\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tif(DT.isDateTime(a)){\r\n\t\t\t a = a;\r\n\t\t}else if(format === \"iso\"){\r\n\t\t\t a = DT.fromISO(String(a));\r\n\t\t}else{\r\n\t\t\t a = DT.fromFormat(String(a), format);\r\n\t\t}\r\n\r\n\t\tif(DT.isDateTime(b)){\r\n\t\t\t b = b;\r\n\t\t}else if(format === \"iso\"){\r\n\t\t\t b = DT.fromISO(String(b));\r\n\t\t}else{\r\n\t\t\t b = DT.fromFormat(String(b), format);\r\n\t\t}\r\n\r\n\t\tif(!a.isValid){\r\n\t\t\temptyAlign = !b.isValid ? 0 : -1;\r\n\t\t}else if(!b.isValid){\r\n\t\t\temptyAlign = 1;\r\n\t\t}else{\r\n\t\t\t//compare valid values\r\n\t\t\treturn a - b;\r\n\t\t}\r\n\r\n\t\t//fix empty values in position\r\n\t\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\t\temptyAlign *= -1;\r\n\t\t}\r\n\r\n\t\treturn emptyAlign;\r\n\r\n\t}else{\r\n\t\tconsole.error(\"Sort Error - 'datetime' sorter is dependant on luxon.js\");\r\n\t}\r\n};","import number from './sorters/number.js';\r\nimport string from './sorters/string.js';\r\nimport date from './sorters/date.js';\r\nimport time from './sorters/time.js';\r\nimport datetime from './sorters/datetime.js';\r\nimport boolean from './sorters/boolean.js';\r\nimport array from './sorters/array.js';\r\nimport exists from './sorters/exists.js';\r\nimport alphanum from './sorters/alphanum.js';\r\n\r\nexport default {\r\n\tnumber:number,\r\n\tstring:string,\r\n\tdate:date,\r\n\ttime:time,\r\n\tdatetime:datetime,\r\n\tboolean:boolean,\r\n\tarray:array,\r\n\texists:exists,\r\n\talphanum:alphanum\r\n};","//sort numbers\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar decimal = params.decimalSeparator;\r\n\tvar thousand = params.thousandSeparator;\r\n\tvar emptyAlign = 0;\r\n\r\n\ta = String(a);\r\n\tb = String(b);\r\n\r\n\tif(thousand){\r\n\t\ta = a.split(thousand).join(\"\");\r\n\t\tb = b.split(thousand).join(\"\");\r\n\t}\r\n\r\n\tif(decimal){\r\n\t\ta = a.split(decimal).join(\".\");\r\n\t\tb = b.split(decimal).join(\".\");\r\n\t}\r\n\r\n\ta = parseFloat(a);\r\n\tb = parseFloat(b);\r\n\r\n\t//handle non numeric values\r\n\tif(isNaN(a)){\r\n\t\temptyAlign = isNaN(b) ? 0 : -1;\r\n\t}else if(isNaN(b)){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\t\t//compare valid values\r\n\t\treturn a - b;\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n};","//sort strings\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar emptyAlign = 0;\r\n\tvar locale;\r\n\r\n\t//handle empty values\r\n\tif(!a){\r\n\t\temptyAlign = !b ? 0 : -1;\r\n\t}else if(!b){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\t\t//compare valid values\r\n\t\tswitch(typeof params.locale){\r\n\t\t\tcase \"boolean\":\r\n\t\t\tif(params.locale){\r\n\t\t\t\tlocale = this.langLocale();\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\tcase \"string\":\r\n\t\t\tlocale = params.locale;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn String(a).toLowerCase().localeCompare(String(b).toLowerCase(), locale);\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n};","import datetime from './datetime.js';\r\n\r\n//sort date\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tif(!params.format){\r\n\t\tparams.format = \"dd/MM/yyyy\";\r\n\t}\r\n\r\n\treturn datetime.call(this, a, b, aRow, bRow, column, dir, params);\r\n};","import datetime from './datetime.js';\r\n\r\n//sort times\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tif(!params.format){\r\n\t\tparams.format = \"HH:mm\";\r\n\t}\r\n\r\n\treturn datetime.call(this, a, b, aRow, bRow, column, dir, params);\r\n};","//sort booleans\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar el1 = a === true || a === \"true\" || a === \"True\" || a === 1 ? 1 : 0;\r\n\tvar el2 = b === true || b === \"true\" || b === \"True\" || b === 1 ? 1 : 0;\r\n\r\n\treturn el1 - el2;\r\n};","//sort if element contains any data\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar el1 = 0;\r\n\tvar el2 = 0;\r\n\tvar type = params.type || \"length\";\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar emptyAlign = 0;\r\n\r\n\tfunction calc(value){\r\n\r\n\t\tswitch(type){\r\n\t\t\tcase \"length\":\r\n\t\t\treturn value.length;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"sum\":\r\n\t\t\treturn value.reduce(function(c, d){\r\n\t\t\t\treturn c + d;\r\n\t\t\t});\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"max\":\r\n\t\t\treturn Math.max.apply(null, value) ;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"min\":\r\n\t\t\treturn Math.min.apply(null, value) ;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"avg\":\r\n\t\t\treturn value.reduce(function(c, d){\r\n\t\t\t\treturn c + d;\r\n\t\t\t}) / value.length;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\t//handle non array values\r\n\tif(!Array.isArray(a)){\r\n\t\talignEmptyValues = !Array.isArray(b) ? 0 : -1;\r\n\t}else if(!Array.isArray(b)){\r\n\t\talignEmptyValues = 1;\r\n\t}else{\r\n\r\n\t\t//compare valid values\r\n\t\tel1 = a ? calc(a) : 0;\r\n\t\tel2 = b ? calc(b) : 0;\r\n\r\n\t\treturn el1 - el2;\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n};","//sort if element contains any data\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar el1 = typeof a == \"undefined\" ? 0 : 1;\r\n\tvar el2 = typeof b == \"undefined\" ? 0 : 1;\r\n\r\n\treturn el1 - el2;\r\n};","//sort alpha numeric strings\r\nexport default function(as, bs, aRow, bRow, column, dir, params){\r\n\tvar a, b, a1, b1, i= 0, L, rx = /(\\d+)|(\\D+)/g, rd = /\\d/;\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar emptyAlign = 0;\r\n\r\n\t//handle empty values\r\n\tif(!as && as!== 0){\r\n\t\temptyAlign = !bs && bs!== 0 ? 0 : -1;\r\n\t}else if(!bs && bs!== 0){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\r\n\t\tif(isFinite(as) && isFinite(bs)) return as - bs;\r\n\t\ta = String(as).toLowerCase();\r\n\t\tb = String(bs).toLowerCase();\r\n\t\tif(a === b) return 0;\r\n\t\tif(!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1;\r\n\t\ta = a.match(rx);\r\n\t\tb = b.match(rx);\r\n\t\tL = a.length > b.length ? b.length : a.length;\r\n\t\twhile(i < L){\r\n\t\t\ta1= a[i];\r\n\t\t\tb1= b[i++];\r\n\t\t\tif(a1 !== b1){\r\n\t\t\t\tif(isFinite(a1) && isFinite(b1)){\r\n\t\t\t\t\tif(a1.charAt(0) === \"0\") a1 = \".\" + a1;\r\n\t\t\t\t\tif(b1.charAt(0) === \"0\") b1 = \".\" + b1;\r\n\t\t\t\t\treturn a1 - b1;\r\n\t\t\t\t}\r\n\t\t\t\telse return a1 > b1 ? 1 : -1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn a.length > b.length;\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultSorters from './defaults/sorters.js';\r\n\r\nclass Sort extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t \tthis.sortList = []; //holder current sort\r\n\t \tthis.changed = false; //has the sort changed since last render\r\n\r\n\t \tthis.registerTableOption(\"sortMode\", \"local\"); //local or remote sorting\r\n\r\n\t \tthis.registerTableOption(\"initialSort\", false); //initial sorting criteria\r\n\t \tthis.registerTableOption(\"columnHeaderSortMulti\", true); //multiple or single column sorting\r\n\t \tthis.registerTableOption(\"sortOrderReverse\", false); //reverse internal sort ordering\r\n\t \tthis.registerTableOption(\"headerSortElement\", \"
\"); //header sort element\r\n\r\n\t \tthis.registerColumnOption(\"sorter\");\r\n\t \tthis.registerColumnOption(\"sorterParams\");\r\n\r\n\t \tthis.registerColumnOption(\"headerSort\", true);\r\n\t \tthis.registerColumnOption(\"headerSortStartingDir\");\r\n\t \tthis.registerColumnOption(\"headerSortTristate\");\r\n\r\n\t }\r\n\r\n\t initialize(){\r\n\t \tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t \tthis.subscribe(\"table-built\", this.tableBuilt.bind(this));\r\n\t \tthis.registerDataHandler(this.sort.bind(this), 20);\r\n\r\n\t \tthis.registerTableFunction(\"setSort\", this.userSetSort.bind(this));\r\n\t \tthis.registerTableFunction(\"getSorters\", this.getSort.bind(this));\r\n\t \tthis.registerTableFunction(\"clearSort\", this.clearSort.bind(this));\r\n\r\n\t \tif(this.table.options.sortMode === \"remote\"){\r\n\t \t\tthis.subscribe(\"data-params\", this.remoteSortParams.bind(this));\r\n\t \t}\r\n\t }\r\n\r\n\t tableBuilt(){\r\n\t \tif(this.table.options.initialSort){\r\n\t \t\tthis.setSort(this.table.options.initialSort);\r\n\t \t}\r\n\t }\r\n\r\n\t remoteSortParams(data, config, silent, params){\r\n\t \tvar sorters = this.getSort();\r\n\r\n\t \tsorters.forEach((item) => {\r\n\t \t\tdelete item.column;\r\n\t \t});\r\n\r\n\t \tparams.sort = sorters;\r\n\r\n\t \treturn params;\r\n\t }\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tuserSetSort(sortList, dir){\r\n\t\tthis.setSort(sortList, dir);\r\n\t\t// this.table.rowManager.sorterRefresh();\r\n\t\tthis.refreshSort();\r\n\t}\r\n\r\n\tclearSort(){\r\n\t\tthis.clear();\r\n\t\t// this.table.rowManager.sorterRefresh();\r\n\t\tthis.refreshSort();\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\t//initialize column header for sorting\r\n\tinitializeColumn(column){\r\n\t\tvar sorter = false,\r\n\t\tcolEl,\r\n\t\tarrowEl;\r\n\r\n\t\tswitch(typeof column.definition.sorter){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(Sort.sorters[column.definition.sorter]){\r\n\t\t\t\tsorter = Sort.sorters[column.definition.sorter];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Sort Error - No such sorter found: \", column.definition.sorter);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tsorter = column.definition.sorter;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcolumn.modules.sort = {\r\n\t\t\tsorter:sorter, dir:\"none\",\r\n\t\t\tparams:column.definition.sorterParams || {},\r\n\t\t\tstartingDir:column.definition.headerSortStartingDir || \"asc\",\r\n\t\t\ttristate: column.definition.headerSortTristate,\r\n\t\t};\r\n\r\n\t\tif(column.definition.headerSort !== false){\r\n\r\n\t\t\tcolEl = column.getElement();\r\n\r\n\t\t\tcolEl.classList.add(\"tabulator-sortable\");\r\n\r\n\r\n\t\t\tarrowEl = document.createElement(\"div\");\r\n\t\t\tarrowEl.classList.add(\"tabulator-col-sorter\");\r\n\r\n\t\t\tif(typeof this.table.options.headerSortElement == \"object\"){\r\n\t\t\t\tarrowEl.appendChild(this.table.options.headerSortElement);\r\n\t\t\t}else{\r\n\t\t\t\tarrowEl.innerHTML = this.table.options.headerSortElement;\r\n\t\t\t}\r\n\r\n\t\t\t//create sorter arrow\r\n\t\t\tcolumn.titleHolderElement.appendChild(arrowEl);\r\n\r\n\t\t\tcolumn.modules.sort.element = arrowEl;\r\n\r\n\t\t\t//sort on click\r\n\t\t\tcolEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\tvar dir = \"\",\r\n\t\t\t\tsorters=[],\r\n\t\t\t\tmatch = false;\r\n\r\n\t\t\t\tif(column.modules.sort){\r\n\t\t\t\t\tif(column.modules.sort.tristate){\r\n\t\t\t\t\t\tif(column.modules.sort.dir == \"none\"){\r\n\t\t\t\t\t\t\tdir = column.modules.sort.startingDir;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(column.modules.sort.dir == column.modules.sort.startingDir){\r\n\t\t\t\t\t\t\t\tdir = column.modules.sort.dir == \"asc\" ? \"desc\" : \"asc\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tdir = \"none\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tswitch(column.modules.sort.dir){\r\n\t\t\t\t\t\t\tcase \"asc\":\r\n\t\t\t\t\t\t\tdir = \"desc\";\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase \"desc\":\r\n\t\t\t\t\t\t\tdir = \"asc\";\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tdir = column.modules.sort.startingDir;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\tif (this.table.options.columnHeaderSortMulti && (e.shiftKey || e.ctrlKey)) {\r\n\t\t\t\t\t\tsorters = this.getSort();\r\n\r\n\t\t\t\t\t\tmatch = sorters.findIndex((sorter) => {\r\n\t\t\t\t\t\t\treturn sorter.field === column.getField();\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\tif(match > -1){\r\n\t\t\t\t\t\t\tsorters[match].dir = dir;\r\n\r\n\t\t\t\t\t\t\tif(match != sorters.length -1){\r\n\t\t\t\t\t\t\t\tmatch = sorters.splice(match, 1)[0];\r\n\t\t\t\t\t\t\t\tif(dir != \"none\"){\r\n\t\t\t\t\t\t\t\t\tsorters.push(match);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(dir != \"none\"){\r\n\t\t\t\t\t\t\t\tsorters.push({column:column, dir:dir});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t//add to existing sort\r\n\t\t\t\t\t\tthis.setSort(sorters);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(dir == \"none\"){\r\n\t\t\t\t\t\t\tthis.clear();\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t//sort by column only\r\n\t\t\t\t\t\t\tthis.setSort(column, dir);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// this.table.rowManager.sorterRefresh(!this.sortList.length);\r\n\t\t\t\t\tthis.refreshSort();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\trefreshSort(){\r\n\t\tif(this.table.options.sortMode === \"remote\"){\r\n\t\t\tthis.reloadData(null, false, false);\r\n\t\t}else{\r\n\t\t\tthis.refreshData(true);\r\n\t\t}\r\n\r\n\t\t//TODO - Persist left position of row manager\r\n\t\t// left = this.scrollLeft;\r\n\t\t// this.scrollHorizontal(left);\r\n\t}\r\n\r\n\t//check if the sorters have changed since last use\r\n\thasChanged(){\r\n\t\tvar changed = this.changed;\r\n\t\tthis.changed = false;\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t//return current sorters\r\n\tgetSort(){\r\n\t\tvar self = this,\r\n\t\tsorters = [];\r\n\r\n\t\tself.sortList.forEach(function(item){\r\n\t\t\tif(item.column){\r\n\t\t\t\tsorters.push({column:item.column.getComponent(), field:item.column.getField(), dir:item.dir});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn sorters;\r\n\t}\r\n\r\n\t//change sort list and trigger sort\r\n\tsetSort(sortList, dir){\r\n\t\tvar self = this,\r\n\t\tnewSortList = [];\r\n\r\n\t\tif(!Array.isArray(sortList)){\r\n\t\t\tsortList = [{column: sortList, dir:dir}];\r\n\t\t}\r\n\r\n\t\tsortList.forEach(function(item){\r\n\t\t\tvar column;\r\n\r\n\t\t\tcolumn = self.table.columnManager.findColumn(item.column);\r\n\r\n\t\t\tif(column){\r\n\t\t\t\titem.column = column;\r\n\t\t\t\tnewSortList.push(item);\r\n\t\t\t\tself.changed = true;\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Sort Warning - Sort field does not exist and is being ignored: \", item.column);\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t\tself.sortList = newSortList;\r\n\r\n\t\tthis.dispatch(\"sort-changed\");\r\n\t}\r\n\r\n\t//clear sorters\r\n\tclear(){\r\n\t\tthis.setSort([]);\r\n\t}\r\n\r\n\t//find appropriate sorter for column\r\n\tfindSorter(column){\r\n\t\tvar row = this.table.rowManager.activeRows[0],\r\n\t\tsorter = \"string\",\r\n\t\tfield, value;\r\n\r\n\t\tif(row){\r\n\t\t\trow = row.getData();\r\n\t\t\tfield = column.getField();\r\n\r\n\t\t\tif(field){\r\n\r\n\t\t\t\tvalue = column.getFieldValue(row);\r\n\r\n\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\tsorter = \"boolean\";\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\tif(!isNaN(value) && value !== \"\"){\r\n\t\t\t\t\t\tsorter = \"number\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)){\r\n\t\t\t\t\t\t\tsorter = \"alphanum\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Sort.sorters[sorter];\r\n\t}\r\n\r\n\t//work through sort list sorting data\r\n\tsort(data){\r\n\t\tvar self = this,\r\n\t\tsortList = this.table.options.sortOrderReverse ? self.sortList.slice().reverse() : self.sortList,\r\n\t\tsortListActual = [],\r\n\t\trowComponents = [],\r\n\t\tlastSort;\r\n\r\n\t\tif(this.subscribedExternal(\"dataSorting\")){\r\n\t\t\tthis.dispatchExternal(\"dataSorting\", self.getSort());\r\n\t\t}\r\n\r\n\t\tself.clearColumnHeaders();\r\n\r\n\t\tif(this.table.options.sortMode !== \"remote\"){\r\n\r\n\t\t\t//build list of valid sorters and trigger column specific callbacks before sort begins\r\n\t\t\tsortList.forEach(function(item, i){\r\n\t\t\t\tvar sortObj = item.column.modules.sort;\r\n\r\n\t\t\t\tif(item.column && sortObj){\r\n\r\n\t\t\t\t\t//if no sorter has been defined, take a guess\r\n\t\t\t\t\tif(!sortObj.sorter){\r\n\t\t\t\t\t\tsortObj.sorter = self.findSorter(item.column);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\titem.params = typeof sortObj.params === \"function\" ? sortObj.params(item.column.getComponent(), item.dir) : sortObj.params;\r\n\r\n\t\t\t\t\tsortListActual.push(item);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tself.setColumnHeader(item.column, item.dir);\r\n\t\t\t});\r\n\r\n\t\t\t//sort data\r\n\t\t\tif (sortListActual.length) {\r\n\t\t\t\tself._sortItems(data, sortListActual);\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tsortList.forEach(function(item, i){\r\n\t\t\t\tself.setColumnHeader(item.column, item.dir);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.subscribedExternal(\"dataSorted\")){\r\n\t\t\tdata.forEach((row) => {\r\n\t\t\t\trowComponents.push(row.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatchExternal(\"dataSorted\", self.getSort(), rowComponents);\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//clear sort arrows on columns\r\n\tclearColumnHeaders(){\r\n\t\tthis.table.columnManager.getRealColumns().forEach(function(column){\r\n\t\t\tif(column.modules.sort){\r\n\t\t\t\tcolumn.modules.sort.dir = \"none\";\r\n\t\t\t\tcolumn.getElement().setAttribute(\"aria-sort\", \"none\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//set the column header sort direction\r\n\tsetColumnHeader(column, dir){\r\n\t\tcolumn.modules.sort.dir = dir;\r\n\t\tcolumn.getElement().setAttribute(\"aria-sort\", dir === \"asc\" ? \"ascending\" : \"descending\");\r\n\t}\r\n\r\n\t//sort each item in sort list\r\n\t_sortItems(data, sortList){\r\n\t\tvar sorterCount = sortList.length - 1;\r\n\r\n\t\tdata.sort((a, b) => {\r\n\t\t\tvar result;\r\n\r\n\t\t\tfor(var i = sorterCount; i>= 0; i--){\r\n\t\t\t\tlet sortItem = sortList[i];\r\n\r\n\t\t\t\tresult = this._sortRow(a, b, sortItem.column, sortItem.dir, sortItem.params);\r\n\r\n\t\t\t\tif(result !== 0){\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn result;\r\n\t\t});\r\n\t}\r\n\r\n\t//process individual rows for a sort function on active data\r\n\t_sortRow(a, b, column, dir, params){\r\n\t\tvar el1Comp, el2Comp, colComp;\r\n\r\n\t\t//switch elements depending on search direction\r\n\t\tvar el1 = dir == \"asc\" ? a : b;\r\n\t\tvar el2 = dir == \"asc\" ? b : a;\r\n\r\n\t\ta = column.getFieldValue(el1.getData());\r\n\t\tb = column.getFieldValue(el2.getData());\r\n\r\n\t\ta = typeof a !== \"undefined\" ? a : \"\";\r\n\t\tb = typeof b !== \"undefined\" ? b : \"\";\r\n\r\n\t\tel1Comp = el1.getComponent();\r\n\t\tel2Comp = el2.getComponent();\r\n\r\n\t\treturn column.modules.sort.sorter.call(this, a, b, el1Comp, el2Comp, column.getComponent(), dir, params);\r\n\t}\r\n}\r\n\r\nSort.moduleName = \"sort\";\r\n\r\n//load defaults\r\nSort.sorters = defaultSorters;\r\n\r\nexport default Sort;","import Module from '../../core/Module.js';\r\nimport Cell from '../../core/cell/Cell.js';\r\n\r\nclass Tooltip extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.tooltipSubscriber = null,\r\n\t\tthis.headerSubscriber = null,\r\n\t\t\r\n\t\tthis.timeout = null;\r\n\t\tthis.popupInstance = null;\r\n\t\t\r\n\t\tthis.registerTableOption(\"tooltipGenerationMode\", undefined); //deprecated\r\n\t\tthis.registerTableOption(\"tooltipDelay\", 300); \r\n\t\t\r\n\t\tthis.registerColumnOption(\"tooltip\");\r\n\t\tthis.registerColumnOption(\"headerTooltip\");\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.deprecationCheck();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\t\r\n\tdeprecationCheck(){\r\n\t\tif(typeof this.table.options.tooltipGenerationMode !== \"undefined\"){\r\n\t\t\tconsole.warn(\"Use of the tooltipGenerationMode option is now deprecated. This option is no longer needed as tooltips are always generated on hover now\");\r\n\t\t}\r\n\t}\t\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tif(column.definition.headerTooltip && !this.headerSubscriber){\r\n\t\t\tthis.headerSubscriber = true;\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-mousemove\", this.mousemoveCheck.bind(this, \"headerTooltip\"));\r\n\t\t\tthis.subscribe(\"column-mouseout\", this.mouseoutCheck.bind(this, \"headerTooltip\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition.tooltip && !this.tooltipSubscriber){\r\n\t\t\tthis.tooltipSubscriber = true;\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-mousemove\", this.mousemoveCheck.bind(this, \"tooltip\"));\r\n\t\t\tthis.subscribe(\"cell-mouseout\", this.mouseoutCheck.bind(this, \"tooltip\"));\r\n\t\t}\r\n\t}\r\n\t\r\n\tmousemoveCheck(action, e, component){\r\n\t\tvar tooltip = action === \"tooltip\" ? component.column.definition.tooltip : component.definition.headerTooltip;\r\n\t\t\r\n\t\tif(tooltip){\r\n\t\t\tthis.clearPopup();\r\n\t\t\tthis.timeout = setTimeout(this.loadTooltip.bind(this, e, component, tooltip), this.table.options.tooltipDelay);\r\n\t\t}\r\n\t}\r\n\r\n\tmouseoutCheck(action, e, component){\r\n\t\tif(!this.popupInstance){\r\n\t\t\tthis.clearPopup();\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearPopup(action, e, component){\r\n\t\tclearTimeout(this.timeout);\r\n\t\tthis.timeout = null;\r\n\t\t\r\n\t\tif(this.popupInstance){\r\n\t\t\tthis.popupInstance.hide();\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadTooltip(e, component, tooltip){\r\n\t\tvar contentsEl, renderedCallback, coords;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\trenderedCallback = callback;\r\n\t\t}\r\n\t\t\r\n\t\tif(typeof tooltip === \"function\"){\r\n\t\t\ttooltip = tooltip(e, component.getComponent(), onRendered);\r\n\t\t}\r\n\t\t\r\n\t\tif(tooltip instanceof HTMLElement){\r\n\t\t\tcontentsEl = tooltip;\r\n\t\t}else{\r\n\t\t\tcontentsEl = document.createElement(\"div\");\r\n\t\t\t\r\n\t\t\tif(tooltip === true){\r\n\t\t\t\tif(component instanceof Cell){\r\n\t\t\t\t\ttooltip = component.value;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(component.definition.field){\r\n\t\t\t\t\t\tthis.langBind(\"columns|\" + component.definition.field, (value) => {\r\n\t\t\t\t\t\t\tcontentsEl.innerHTML = tooltip = value || component.definition.title;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\ttooltip = component.definition.title;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcontentsEl.innerHTML = tooltip;\r\n\t\t}\r\n\t\t\r\n\t\tif(tooltip || tooltip === 0 || tooltip === \"0\" || tooltip === false){\r\n\t\t\tcontentsEl.classList.add(\"tabulator-tooltip\");\r\n\r\n\t\t\tcontentsEl.addEventListener(\"mousemove\", e => e.preventDefault())\r\n\t\t\t\r\n\t\t\tthis.popupInstance = this.popup(contentsEl);\r\n\t\t\t\r\n\t\t\tif(typeof renderedCallback === \"function\"){\r\n\t\t\t\tthis.popupInstance.renderCallback(renderedCallback);\r\n\t\t\t}\r\n\r\n\t\t\tcoords = this.popupInstance.containerEventCoords(e);\r\n\t\t\t\r\n\t\t\tthis.popupInstance.show(coords.x + 15, coords.y + 15).hideOnBlur(() => {\r\n\t\t\t\tthis.dispatchExternal(\"TooltipClosed\", component.getComponent());\r\n\t\t\t\tthis.popupInstance = null;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"TooltipOpened\", component.getComponent());\r\n\t\t}\r\n\t}\r\n}\r\n\r\nTooltip.moduleName = \"tooltip\";\r\n\r\nexport default Tooltip;\r\n","export default {\r\n\t//is integer\r\n\tinteger: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvalue = Number(value);\r\n\t\treturn typeof value === 'number' && isFinite(value) && Math.floor(value) === value;\r\n\t},\r\n\r\n\t//is float\r\n\tfloat: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvalue = Number(value);\r\n\t\treturn typeof value === 'number' && isFinite(value) && value % 1 !== 0;\r\n\t},\r\n\r\n\t//must be a number\r\n\tnumeric: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn !isNaN(value);\r\n\t},\r\n\r\n\t//must be a string\r\n\tstring: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn isNaN(value);\r\n\t},\r\n\r\n\t//maximum value\r\n\tmax: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn parseFloat(value) <= parameters;\r\n\t},\r\n\r\n\t//minimum value\r\n\tmin: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn parseFloat(value) >= parameters;\r\n\t},\r\n\r\n\t//starts with value\r\n\tstarts: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).toLowerCase().startsWith(String(parameters).toLowerCase());\r\n\t},\r\n\r\n\t//ends with value\r\n\tends: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).toLowerCase().endsWith(String(parameters).toLowerCase());\r\n\t},\r\n\r\n\r\n\t//minimum string length\r\n\tminLength: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).length >= parameters;\r\n\t},\r\n\r\n\t//maximum string length\r\n\tmaxLength: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).length <= parameters;\r\n\t},\r\n\r\n\t//in provided value list\r\n\tin: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif(typeof parameters == \"string\"){\r\n\t\t\tparameters = parameters.split(\"|\");\r\n\t\t}\r\n\r\n\t\treturn value === \"\" || parameters.indexOf(value) > -1;\r\n\t},\r\n\r\n\t//must match provided regex\r\n\tregex: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar reg = new RegExp(parameters);\r\n\r\n\t\treturn reg.test(value);\r\n\t},\r\n\r\n\t//value must be unique in this column\r\n\tunique: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar unique = true;\r\n\r\n\t\tvar cellData = cell.getData();\r\n\t\tvar column = cell.getColumn()._getSelf();\r\n\r\n\t\tthis.table.rowManager.rows.forEach(function(row){\r\n\t\t\tvar data = row.getData();\r\n\r\n\t\t\tif(data !== cellData){\r\n\t\t\t\tif(value == column.getFieldValue(data)){\r\n\t\t\t\t\tunique = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn unique;\r\n\t},\r\n\r\n\t//must have a value\r\n\trequired:function(cell, value, parameters){\r\n\t\treturn value !== \"\" && value !== null && typeof value !== \"undefined\";\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultValidators from './defaults/validators.js';\r\n\r\nclass Validate extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.invalidCells = [];\r\n\t\t\r\n\t\tthis.registerTableOption(\"validationMode\", \"blocking\");\r\n\t\t\r\n\t\tthis.registerColumnOption(\"validator\");\r\n\t\t\r\n\t\tthis.registerTableFunction(\"getInvalidCells\", this.getInvalidCells.bind(this));\r\n\t\tthis.registerTableFunction(\"clearCellValidation\", this.userClearCellValidation.bind(this));\r\n\t\tthis.registerTableFunction(\"validate\", this.userValidate.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"cell\", \"isValid\", this.cellIsValid.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"clearValidation\", this.clearValidation.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"validate\", this.cellValidate.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"column\", \"validate\", this.columnValidate.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"validate\", this.rowValidate.bind(this));\r\n\t}\r\n\t\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-delete\", this.clearValidation.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumnCheck.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"edit-success\", this.editValidate.bind(this));\r\n\t\tthis.subscribe(\"edit-editor-clear\", this.editorClear.bind(this));\r\n\t\tthis.subscribe(\"edit-edited-clear\", this.editedClear.bind(this));\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Event Handling //////////\r\n\t///////////////////////////////////\r\n\t\r\n\teditValidate(cell, value, previousValue){\r\n\t\tvar valid = this.table.options.validationMode !== \"manual\" ? this.validate(cell.column.modules.validate, cell, value) : true;\r\n\t\t\r\n\t\t// allow time for editor to make render changes then style cell\r\n\t\tif(valid !== true){\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tcell.getElement().classList.add(\"tabulator-validation-fail\");\r\n\t\t\t\tthis.dispatchExternal(\"validationFailed\", cell.getComponent(), value, valid);\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\treturn valid;\r\n\t}\r\n\t\r\n\teditorClear(cell, cancelled){\r\n\t\tif(cancelled){\r\n\t\t\tif(cell.column.modules.validate){\r\n\t\t\t\tthis.cellValidate(cell);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t}\r\n\t\r\n\teditedClear(cell){\r\n\t\tif(cell.modules.validate){\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t////////// Cell Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\tcellIsValid(cell){\r\n\t\treturn cell.modules.validate ? (cell.modules.validate.invalid || true) : true;\r\n\t}\r\n\t\r\n\tcellValidate(cell){\r\n\t\treturn this.validate(cell.column.modules.validate, cell, cell.getValue());\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Column Functions ////////\r\n\t///////////////////////////////////\r\n\t\r\n\tcolumnValidate(column){\r\n\t\tvar invalid = [];\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tif(this.cellValidate(cell) !== true){\r\n\t\t\t\tinvalid.push(cell.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn invalid.length ? invalid : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t////////// Row Functions //////////\r\n\t///////////////////////////////////\r\n\t\r\n\trowValidate(row){\r\n\t\tvar invalid = [];\r\n\t\t\r\n\t\trow.cells.forEach((cell) => {\r\n\t\t\tif(this.cellValidate(cell) !== true){\r\n\t\t\t\tinvalid.push(cell.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn invalid.length ? invalid : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\t\r\n\tuserClearCellValidation(cells){\r\n\t\tif(!cells){\r\n\t\t\tcells = this.getInvalidCells();\r\n\t\t}\r\n\t\t\r\n\t\tif(!Array.isArray(cells)){\r\n\t\t\tcells = [cells];\r\n\t\t}\r\n\t\t\r\n\t\tcells.forEach((cell) => {\r\n\t\t\tthis.clearValidation(cell._getSelf());\r\n\t\t});\r\n\t}\r\n\t\r\n\tuserValidate(cells){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\t//clear row data\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\trow = row.getComponent();\r\n\t\t\t\r\n\t\t\tvar valid = row.validate();\r\n\t\t\t\r\n\t\t\tif(valid !== true){\r\n\t\t\t\toutput = output.concat(valid);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn output.length ? output : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tinitializeColumnCheck(column){\r\n\t\tif(typeof column.definition.validator !== \"undefined\"){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//validate\r\n\tinitializeColumn(column){\r\n\t\tvar self = this,\r\n\t\tconfig = [],\r\n\t\tvalidator;\r\n\t\t\r\n\t\tif(column.definition.validator){\r\n\t\t\t\r\n\t\t\tif(Array.isArray(column.definition.validator)){\r\n\t\t\t\tcolumn.definition.validator.forEach((item) => {\r\n\t\t\t\t\tvalidator = self._extractValidator(item);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(validator){\r\n\t\t\t\t\t\tconfig.push(validator);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tvalidator = this._extractValidator(column.definition.validator);\r\n\t\t\t\t\r\n\t\t\t\tif(validator){\r\n\t\t\t\t\tconfig.push(validator);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.validate = config.length ? config : false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t_extractValidator(value){\r\n\t\tvar type, params, pos;\r\n\t\t\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\tpos = value.indexOf(':');\r\n\t\t\t\r\n\t\t\tif(pos > -1){\r\n\t\t\t\ttype = value.substring(0,pos);\r\n\t\t\t\tparams = value.substring(pos+1);\r\n\t\t\t}else{\r\n\t\t\t\ttype = value;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn this._buildValidator(type, params);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"function\":\r\n\t\t\treturn this._buildValidator(value);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"object\":\r\n\t\t\treturn this._buildValidator(value.type, value.parameters);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t\r\n\t_buildValidator(type, params){\r\n\t\t\r\n\t\tvar func = typeof type == \"function\" ? type : Validate.validators[type];\r\n\t\t\r\n\t\tif(!func){\r\n\t\t\tconsole.warn(\"Validator Setup Error - No matching validator found:\", type);\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn {\r\n\t\t\t\ttype:typeof type == \"function\" ? \"function\" : type,\r\n\t\t\t\tfunc:func,\r\n\t\t\t\tparams:params,\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n\t\r\n\tvalidate(validators, cell, value){\r\n\t\tvar self = this,\r\n\t\tfailedValidators = [],\r\n\t\tinvalidIndex = this.invalidCells.indexOf(cell);\r\n\t\t\r\n\t\tif(validators){\r\n\t\t\tvalidators.forEach((item) => {\r\n\t\t\t\tif(!item.func.call(self, cell.getComponent(), value, item.params)){\r\n\t\t\t\t\tfailedValidators.push({\r\n\t\t\t\t\t\ttype:item.type,\r\n\t\t\t\t\t\tparameters:item.params\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tif(!cell.modules.validate){\r\n\t\t\tcell.modules.validate = {};\r\n\t\t}\r\n\t\t\r\n\t\tif(!failedValidators.length){\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t\t\t\r\n\t\t\tif(invalidIndex > -1){\r\n\t\t\t\tthis.invalidCells.splice(invalidIndex, 1);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcell.modules.validate.invalid = failedValidators;\r\n\t\t\t\r\n\t\t\tif(this.table.options.validationMode !== \"manual\"){\r\n\t\t\t\tcell.getElement().classList.add(\"tabulator-validation-fail\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(invalidIndex == -1){\r\n\t\t\t\tthis.invalidCells.push(cell);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn failedValidators.length ? failedValidators : true;\r\n\t}\r\n\t\r\n\tgetInvalidCells(){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.invalidCells.forEach((cell) => {\r\n\t\t\toutput.push(cell.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tclearValidation(cell){\r\n\t\tvar invalidIndex;\r\n\t\t\r\n\t\tif(cell.modules.validate && cell.modules.validate.invalid){\r\n\t\t\t\r\n\t\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t\t\r\n\t\t\tinvalidIndex = this.invalidCells.indexOf(cell);\r\n\t\t\t\r\n\t\t\tif(invalidIndex > -1){\r\n\t\t\t\tthis.invalidCells.splice(invalidIndex, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nValidate.moduleName = \"validate\";\r\n\r\n//load defaults\r\nValidate.validators = defaultValidators;\r\n\r\nexport default Validate;\r\n","//tabulator with all modules installed\r\nimport {default as Tabulator} from './Tabulator.js';\r\nimport * as modules from '../core/modules/optional.js';\r\nimport ModuleBinder from './tools/ModuleBinder.js';\r\n\r\nclass TabulatorFull extends Tabulator {};\r\n\r\n//bind modules and static functionality\r\nnew ModuleBinder(TabulatorFull, modules);\r\n\r\nexport default TabulatorFull;"],"names":["CoreFeature","table","data","silent","columnsChanged","this","dataLoader","load","undefined","modules","localize","getText","arguments","bind","getLocale","comms","getConnections","send","layout","getMode","eventBus","subscribe","unsubscribe","key","subscribed","subscriptionChange","dispatch","chain","confirm","externalEvents","options","value","module","ColumnComponent","column","_column","type","Proxy","get","target","name","receiver","componentFunctionBinder","handle","getElement","getDefinition","getField","getTitleDownload","cells","forEach","cell","push","getComponent","visible","isGroup","columns","show","hide","output","length","parent","Column","columnManager","scrollToColumn","to","after","toColumn","findColumn","moveColumn","console","warn","nextCol","nextColumn","prevCol","prevColumn","updates","updateDefinition","getWidth","width","result","reinitializeWidth","setWidth","renderer","rerenderColumns","CellComponent","_cell","getValue","getOldValue","initialValue","row","getData","mutate","setValue","setValueActual","checkHeight","Cell","element","oldValue","height","minWidth","component","loaded","build","generateElement","_configureCell","getFieldValue","document","createElement","className","setAttribute","field","style","textAlign","hozAlign","vertAlign","display","alignItems","top","bottom","middle","justifyContent","left","right","center","definition","cssClass","split","classList","add","val","_this2","innerHTML","Node","firstChild","removeChild","appendChild","containerOnly","layoutElement","force","setValueProcessData","cellRendered","cellEdited","call","dispatchExternal","subscribedExternal","rowManager","changed","setFieldValue","_generateContents","widthStyled","offsetWidth","minWidthStyled","maxWidth","maxWidthStyled","reinitializeHeight","heightStyled","offsetHeight","redrawBlock","parentNode","deleteCell","calcs","getCellIndex","def","_this","contentElement","titleHolderElement","titleElement","groupElement","createGroupElement","fieldStructure","titleDownload","titleFormatterRendered","mapDefinitions","setField","maxInitialWidth","widthFixed","i","newCol","attachColumn","checkColumnVisibility","registerColumnField","_initialize","bindModuleColumns","el","defaults","columnDefaults","optionsList","generate","defaultOptionList","Object","keys","indexOf","title","nestedFieldSeparator","_getNestedData","_getFlatData","_setNestedData","_setFlatData","registerColumnPosition","reRegisterPosition","headerVertical","_buildColumnHeaderContent","_buildGroupHeader","_buildColumnHeader","_this3","setMinWidth","parseInt","setMaxWidth","headerHozAlign","_buildColumnHeaderTitle","editableTitle","addEventListener","e","stopPropagation","focus","_this4","langBind","text","_formatColumnHeaderTitle","contents","_this5","dataObj","structure","columnRendered","alignment","parentHeight","getGroupElement","clientHeight","getHeadersElement","minHeight","paddingTop","verticalAlign","clearVerticalAlign","formatter","rowNumColumn","getFirstColumn","getLastColumn","getTopColumn","updateBranches","colDefs","responsiveToggle","verticalAlignHeaders","matchChildWidths","childWidth","child","index","splice","setWidthActual","isNaN","Math","floor","clientWidth","max","min","rows","heightInitialized","offsetParent","clearCellHeight","calcHeight","setCellHeight","ceil","getBoundingClientRect","Promise","resolve","reject","_this6","cellCount","deregisterColumn","findColumnIndex","_nextVisibleColumn","getColumnByIndex","_prevVisibleColumn","fitToData","clearWidth","setTo","error","assign","addColumn","then","_this7","defaultOptions","Helpers","box","window","pageYOffset","documentElement","clientTop","pageXOffset","clientLeft","obj","clone","list","objectProto","__proto__","arrayProto","Array","isArray","subject","match","copy","_typeof","findIndex","item","unshift","deepClone","OptionsList","msgType","registeredDefaults","option","userOptions","debugInvalidOptions","hasOwnProperty","Renderer","elementVertical","elementHorizontal","tableElement","verticalFillMode","callback","update","blockRedraw","dir","includingBuffer","getDisplayRows","rowEl","remove","clearRows","clearColumns","renderRows","renderColumns","rerenderRows","position","ifVisible","rowIndex","offset","scrollToRowIfVisible","elVisible","elOffset","scrollToRowPosition","scrollToRowNearestTop","scrollToRow","scrollHeight","scrollTop","offsetTop","BaiscHorizontal","VirtualDomHorizontal","leftCol","rightCol","scrollLeft","vDomScrollPosLeft","vDomScrollPosRight","vDomPadLeft","vDomPadRight","fitDataColAvg","windowBuffer","visibleRows","initialized","isFitData","compatibilityCheck","layoutCheck","vertScrollListen","ok","find","col","frozen","startsWith","clearVisRowCache","dataChange","scroll","buffer","columnsByIndex","old","cols","colPos","clear","calcWindowBuffer","config","leftPos","rightPos","fitDataCheck","vdomHoz","paddingLeft","paddingRight","reinitChanged","reinitializeRows","initializeRow","reinitializeRow","change","colEnd","generateCells","layoutRefresh","getVisibleRows","diff","abs","addColRight","removeColLeft","addColLeft","removeColRight","start","end","changes","getCell","fitDataColActualWidthCheck","prepend","_this8","ex","message","_this9","newWidth","widthDiff","colPositionAdjust","ColumnManager","blockHozScrollEvent","headersElement","columnsByField","defaultColumnOptions","initializeRenderer","createHeadersElement","createHeaderElement","insertBefore","scrollHorizontal","renderClass","renderers","RendererVirtualDomHorizontal","RendererBasicHorizontal","renderHorizontal","initialize","headerVisible","hozAdjust","scrollWidth","marginLeft","scrollColumns","sorter","definitions","autoColumnsDefinitions","setColumns","_addColumn","_reIndexColumns","redraw","before","nextToColumn","colEl","topColumn","parentIndex","nextEl","nextSibling","getHeight","columnHeaderVertAlign","adjustTableSize","_getSelf","HTMLElement","root","matches","active","structured","from","moveColumnActual","reinitialize","_moveColumnInArray","getComponents","updateRows","toIndex","fromIndex","concat","adjust","scrollToColumnPosition","scrollToColumnIfVisible","offsetLeft","generateCell","totalWidth","fixedWidth","colWidth","layoutMode","resetScroll","footerManager","RowComponent","_row","transform","getCells","getRowPosition","moveToRow","updateData","normalizeHeight","nextRow","prevRow","Row","manualHeight","outerHeight","created","setData","create","deleteCells","renderRowCells","rowFormatter","rerenderRowCells","children","maxHeight","rowHeight","resizableRows","setHeight","clearHeight","updatedData","newRowData","tempData","attrname","JSON","parse","getColumnsByFieldRoot","findCell","nextDisplayRow","prevDisplayRow","toRow","findRow","moveRowActual","refreshActiveData","deleteActual","getRowIndex","detatchModules","deleteRow","group","BaiscVertical","visibility","onlyGroupHeaders","styleRow","rowTop","VirtualDomVertical","vDomRowHeight","vDomTop","vDomBottom","vDomScrollPosTop","vDomScrollPosBottom","vDomTopPad","vDomBottomPad","vDomMaxRenderChain","vDomWindowBuffer","vDomWindowMinTotalRows","vDomWindowMinMarginRows","vDomTopNewRows","vDomBottomNewRows","paddingBottom","_virtualRenderFill","topRow","topOffset","deinitializeHeight","topDiff","bottomDiff","margin","_addTopRow","vDomScrollHeight","_removeBottomRow","_addBottomRow","_removeTopRow","renderVerticalBuffer","topEdge","bottomEdge","topFound","bottomRow","slice","forceMove","holder","topPad","rowsHeight","heightOccupied","topPadHeight","rowsCount","containerHeight","fillableSpace","addedRows","paddingAdjust","_quickNormalizeRowHeight","removableRows","RowManager","createHolderElement","createTableElement","heightFixer","placeholder","placeholderContents","firstRender","renderMode","fixedHeight","activeRowsPipeline","activeRows","activeRowsCount","displayRows","displayRowsCount","redrawBlockRestoreConfig","redrawBlockRenderInPosition","dataPipeline","displayPipeline","initializePlaceholder","leftDir","topDir","_positionPlaceholder","scrollRows","renderInPosition","pagination","_setDataActual","reRenderInPosition","autoColumns","generateColumnsFromRowData","_wipeElements","wipe","allIndex","activeIndex","setActiveRows","displayRowIterator","displayIndex","regenerateRowNumbers","_showPlaceholder","pos","addRowActual","findAddRowPos","reverse","addRow","_clearPlaceholder","addRowPos","chainResult","moveRowInArray","findRowIndex","rowOnly","getDisplayRowIndex","getRows","handler","priority","sort","a","b","skipStage","stage","cascadeOrder","refreshPipelines","renderTable","layoutColumnsOnNewData","resetDisplayRows","setDisplayRows","viewable","RendererVirtualDomVertical","RendererBasicVertical","renderVertical","_clearTable","renderEmptyScroll","initialHeight","otherHeight","external","resize","tableWidth","browser","event","createEvent","initEvent","dispatchEvent","Event","FooterManager","containerElement","createContainerElement","initializeElement","footerElement","querySelector","activate","deactivate","InteractionManager","abortClasses","previousTargets","listeners","componentMap","pseudoTrackers","subscriber","pseudoTracking","buildListenerMap","bindSubscriptionWatchers","listenerMap","listener","components","pseudoMouseEnter","pseudoMouseLeave","leaveList","linkedKeys","filter","links","includes","values","comp","subscriptionChanged","clearWatchers","added","bindPseudoEvents","updateEventListeners","track","removeEventListener","path","composedPath","targets","findTargets","bindComponents","triggerEvents","targetMatches","previousTarget","closest","ComponentFunctionBinder","bindings","funcName","DataLoader","requestOrder","loading","params","replace","requestNo","alertLoader","mapParams","dataSendParams","response","objectInvert","dataReceiveParams","rowData","clearAlert","alertError","setTimeout","dataLoaderErrorTimeout","map","alertManager","alert","dataLoaderLoading","langText","dataLoaderError","ExternalEventBus","debug","events","subscriptionNotifiers","_debugDispatch","_dispatch","_notifiySubscriptionChange","notifiers","args","shift","callResult","apply","log","InternalEventBus","_debugChain","_chain","_debugConfirm","_confirm","fallback","confirmed","TableRegistry","tables","query","results","querySelectorAll","matchElement","Tabulator","lookupTable","Popup","container","_lookupContainer","reversedX","childPopup","blurable","blurCallback","renderedCallback","blurEvent","escEvent","_escapeCheck","destroyBinding","popupContainer","_checkContainerIsParent","body","touch","MouseEvent","x","touches","pageX","y","pageY","parentOffset","containerOffset","origin","parentEl","coords","elementPositionCoords","containerEventCoords","_fitToScreen","keyCode","Module","_handler","register","func","initGuard","registerDataPipelineHandler","registerDisplayPipelineHandler","append","menuEl","menuContainer","content","responsiveLayout","modExists","fitData","reinitializeColumnWidths","fitDataFill","fitDataGeneral","fitDataTable","fitDataStretch","colsWidth","gap","lastCol","responsive","fitColumns","flexColWidth","overflowWidth","flexWidth","flexGrowUnits","flexColumns","fixedShrinkColumns","flexShrinkUnits","gapFill","calcWidth","scaleColumns","freeSpace","shrinkCols","oversizeCols","oversizeSpace","remainingSpace","nextColWidth","remainingFlexGrowUnits","changeUnits","undersizeCols","calcGrow","widthGrow","calcShrink","widthShrink","Layout","mode","registerTableOption","registerColumnOption","modes","moduleName","defaultModes","Localize","locale","lang","langList","langs","headerFilterPlaceholder","setHeaderFilterPlaceholder","installLang","setLocale","registerTableFunction","getLang","headerFilters","_setLangProp","desiredLocale","navigator","language","toLowerCase","prefix","traverseLang","trans","prop","_executeBindings","pathArray","_getLangElement","level","rootPath","binding","Comms","receive","selectors","connections","con","action","connection","tableComms","commsReceived","ModuleBinder","tabulator","bindStaticFuctionality","bindModules","coreModules","moduleBindings","extendModule","property","source","registerModule","mod","registerModuleBinding","findTable","prototype","orderedStartMods","orderedEndMods","unOrderedMods","moduleCore","modulesCore","moduleInitOrder","modulesRegular","core","mods","Alert","_createAlertElement","msgElement","_createMsgElement","_typeClass","interactionMonitor","browserSlow","browserMobile","rtl","originalElement","initializeCoreSystems","_create","_clearObjectPointers","_mapDeprecatedFunctionality","debugEventsExternal","debugEventsInternal","InteractionMonitor","getSelection","empty","removeAllRanges","selection","_rtlCheck","_buildElement","_initializeTable","_loadInitialData","getComputedStyle","textDirection","direction","reactiveData","newElement","tagName","attributes","replaceChild","_detectBrowser","deregister","ua","userAgent","vendor","opera","test","msg","stack","line","debugInitialization","Error","trim","restoreRedraw","blockActiveLoad","clearData","getDataCount","responses","addRows","newRows","getRowFromPosition","foundRows","fromRow","getDefinitionTree","fromColumn","plugin","required","rowFormatterPrint","rowFormatterClipboard","rowFormatterHtmlOutput","Accessor","allowedTypes","initializeColumn","transformRow","accessor","charAt","toUpperCase","lookupAccessor","accessors","rowComponent","traverse","colCompnent","generateParamsList","serializeParams","encoded","encodeURIComponent","join","url","method","headers","stringify","form","FormData","Ajax","urlGenerator","loaderPromise","contentTypeFormatters","ajaxRequestFunc","defaultLoaderPromise","ajaxURLGenerator","defaultURLGenerator","ajaxURL","setUrl","setDefaultConfig","ajaxConfig","getUrl","requestDataCheck","requestParams","requestData","ajaxParams","previousData","generateConfig","sendRequest","defaultConfig","ajaxRequesting","ajaxResponse","contentType","ajaxContentType","Accept","location","credentials","fetch","json","status","statusText","defaultContentTypeFormatters","Clipboard","pasteParser","pasteAction","customSelection","rowRange","blocked","clipboard","clipboardCopyRowRange","plain","html","preventDefault","clipboardCopyFormatter","generateExportList","clipboardCopyConfig","clipboardCopyStyled","genereateHTMLTable","generatePlainContent","clipboardData","originalEvent","reset","paste","setPasteParser","clipboardPasteParser","setPasteAction","clipboardPasteAction","getKey","range","internal","sel","textRange","createRange","selectNodeContents","toString","addRange","createTextRange","moveToElementText","select","execCommand","pasteActions","parser","pasteParsers","checkPaseOrigin","getPasteData","mutateData","mutator","valid","edit","currentCell","updateOrAddData","insert","addData","headerFindSuccess","columnMap","CalcComponent","calcParams","precision","reduce","sum","Number","toFixed","parseFloat","String","ColumnCalcs","topCalcs","botCalcs","genColumn","topElement","botElement","botRow","topInitialized","botInitialized","cellValueChanged","initializeColumnCheck","rowsUpdated","recalcActiveRows","recalcActiveRowsRefresh","tableRedraw","getResults","userRecalc","recalc","groupBy","recalcRowGroup","dataTreeStartExpanded","dataTree","recalcAll","topCalc","bottomCalc","columnCalcs","topCalcParams","botCalcParams","bottomCalcParams","calculations","initializeTopRow","botCalc","initializeBottomRow","footerRemove","footerPrepend","rowsToData","generateRow","frozenColumns","recalcGroup","groupRows","getRowGroup","getChildGroups","generateRowData","dataTreeChildColumnCalcs","open","getFilteredTreeChildren","disable","enable","format","getFormatter","paramKey","getGroups","getGroupResults","groupObj","subGroups","getSubGroups","subGroupResults","subgroup","groups","defaultCalculations","DataTree","indent","collapseEl","expandEl","branchEl","elementField","startOpen","registerComponentFunction","collapseRow","expandRow","toggleRow","getTreeParent","getRowChildren","addTreeChildRow","isRowExpanded","dummyEl","dataTreeChildField","dataTreeChildIndent","dataTreeBranchElement","dataTreeCollapseElement","tabIndex","dataTreeExpandElement","layoutRow","rowDelete","rowDataChanged","columnMoving","initializeElementField","tableRedrawing","registerDisplayHandler","reinitializeRowChildren","firstCol","getFirstVisibleColumn","dataTreeElementColumn","getTreeChildren","redrawNeeded","refreshData","childArray","controlEl","generateControlElement","cloneNode","marginRight","getPropertyValue","oldControl","getChildren","allChildren","generateChildren","dataTreeFilter","dataTreeSort","sub","childData","childRow","getTreeParentRoot","childIndex","findChildIndex","recurse","csv","setFileContents","delimiter","fileContents","depth","bom","jsonLines","pdf","header","autoTableParams","rowGroupStyles","fontStyle","fontSize","cellPadding","fillColor","rowCalcStyles","jsPDFParams","jsPDF","parseRow","styles","colSpan","rowSpan","orientation","unit","doc","jspdf","autoTable","didDrawPage","head","documentProcessing","xlsx","sheetName","workbook","XLSX","utils","book_new","tableFeatures","generateSheet","merges","worksheet","s","c","r","j","Date","sheet_add_aoa","encode_range","SheetNames","Sheets","sheetOnly","sheets","sheet","commsSend","intercept","buf","ArrayBuffer","view","Uint8Array","charCodeAt","s2ab","write","bookType","bookSST","Download","blob","download","downloadToTab","filename","interceptCallback","downloadFunc","downloaders","mime","triggerDownload","downloadConfig","downloadRowRange","groupHeader","groupHeaderDownload","_group","getRowCount","newTab","Blob","downloadReady","URL","createObjectURL","msSaveOrOpenBlob","click","maskInput","mask","maskLetter","maskLetterChar","maskNumber","maskNumberChar","maskWildcard","maskWildcardChar","fillSymbols","symbol","char","maskAutoFill","defaultDownloaders","Edit","editor","onRendered","success","cancel","editorParams","_initializeParams","displayItems","currentItems","focusedItem","input","_createInputElement","listEl","_createListElement","initialValues","isFilter","filterTimeout","filtered","typing","popup","listIteration","actions","_deprecationCheck","_initializeValue","_onRendered","listItemFormatter","sortValuesList","searchFunc","searchingPlaceholder","defaultValue","multiselect","headerFilterInitialListGen","cellEl","clickStop","preventScroll","_preventBlur","_inputKeyDown","attribs","elementAttributes","clearable","padding","boxSizing","autocomplete","cursor","caretColor","getAttribute","_bindInputEvents","valueCheck","valueKeys","verticalNavigation","placeholderLoading","placeholderEmpty","filterDelay","emptyValue","freetext","filterFunc","filterRemote","allowEmpty","listOnEmpty","valuesLookup","valuesURL","_inputFocus","_inputClick","_inputBlur","_inputSearch","_inputKeyUp","rebuildOptionsList","clearTimeout","_filterList","_clearChoices","_keyUp","_keyDown","_keySide","_keyEnter","_keyEsc","_keyHomeEnd","_keySelectLetter","_keyAutoCompLetter","stopImmediatePropagation","_focusItem","_chooseItem","_cancel","_scrollToValue","_filter","character","fromCharCode","filterTerm","label","scrollIntoView","behavior","block","inline","_generateOptions","_sortOptions","_buildList","_showList","isInteger","_filterOptions","itteration","_ajaxRequest","_uniqueColumnValues","valuesLookupField","_addPlaceholder","responseValues","_parseList","_clearList","term","urlBuilder","getColumnByField","getColumn","inputValues","entries","_parseListItem","_parseListGroup","itemParams","selected","original","_defaultSortFunction","_sortGroup","as","bs","a1","b1","L","rx","rd","emptyAlign","isFinite","_defaultFilterFunc","_filterItem","_buildItem","itemFormatter","_groupClick","_itemClick","_styleItem","_this10","startVis","isVisible","_setListWidth","hideOnBlur","_resolveValue","_this11","blur","cellValue","search","onChange","selectContents","textarea","vertNav","whiteSpace","getRow","heightNow","selectionStart","number","step","blurFunc","List","star","self","maxStars","getElementsByTagName","size","stars","starsHolder","createElementNS","starChange","buildStar","starHolder","nextStar","changeValue","overflow","textOverflow","progress","mouseDrag","mouseDragWidth","percent","bar","updateValue","calcVal","round","backgroundColor","screenX","tickCross","tristate","indetermValue","indeterminateValue","indetermState","trueValueSet","falseValueSet","marginTop","checkedValue","checked","trueValue","falseValue","indeterminate","mouseClick","recursionBlock","invalidEdit","editedCells","editors","getEditedCells","clearCellEdited","navigatePrev","navigateNext","navigateLeft","navigateRight","navigateUp","navigateDown","cellisEdited","clearEdited","editCell","cellCancelEdit","bindEditor","columnDeleteCheck","rowDeleteCheck","cancelEdit","keybindingNavigateNext","newRow","edited","nextCell","findNextEditableCell","getIndex","findPrevEditableCell","allowEdit","check","prevCell","editable","clearEditor","variableHeight","cellEditCancelled","contains","button","forceEdit","focusCellNoEvent","getRenderMode","leftEdge","rightEdge","leftMargin","rightMargin","cellEditor","rendered","focusScrollAdjust","cellClick","cellEditing","validationMode","editIndex","defaultEditors","ExportRow","ExportColumn","Export","cloneTableStyle","colVisProp","getHtml","columnHeaders","headersToExportRows","generateColumnGroupHeaders","bodyToExportRows","rowLookup","genereateTableElement","selectRow","selectedRows","columnGroups","colData","processColumnGroup","maxDepth","groupData","subGroup","subGroupData","columnVisCheck","headerDepth","exportRows","parseColumnGroup","rowGroups","exportCols","headerEl","bodyEl","lookupTableStyles","setup","treeElementField","mapElementStyles","genereateHeaderElement","genereateGroupElement","genereateCalcElement","genereateRowElement","evenRow","oddRow","calcRow","firstRow","firstGroup","getElementsByClassName","styleCells","firstCell","lastCell","classNames","generator","cellWrapper","formatCells","formatExportValue","align","htmlOutputConfig","props","lookup","fromStyle","filterVal","rowVal","filterParams","RegExp","keywords","separator","keyword","matchAll","endsWith","Filter","filterList","headerFilterColumns","prevHeaderFilterChangeCheck","tableInitialized","searchRows","searchData","userSetFilter","userRefreshFilter","userAddFilter","getFilters","userSetHeaderFilterFocus","userGetHeaderFilterValue","userSetHeaderFilterValue","getHeaderFilters","userRemoveFilter","userClearFilter","userClearHeaderFilter","setHeaderFilterFocus","reloadHeaderFilter","getHeaderFilterValue","setHeaderFilterValue","initializeColumnHeaderFilter","hideHeaderFilterElements","showHeaderFilterElements","tableBuilt","filterMode","remoteFilterParams","registerDataHandler","initialFilter","setFilter","initialHeaderFilter","refreshFilter","addFilter","removeFilter","all","clearFilter","clearHeaderFilter","headerFilter","setHeaderFilterColumnPlaceholder","filterType","tagType","attrType","filterChangeCheck","prevSuccess","emptyFunc","headerFilterFunc","filters","headerFilterFuncParams","fieldVal","colVal","trackChanges","generateHeaderFilterElement","filterElement","editorElement","typingTimer","searchTrigger","headerElement","headerFilterEmptyCheck","headerFilterParams","headerFilterLiveFilterDelay","hasAttribute","headerFilterLiveFilter","reloadData","findFilter","findSubFilters","ajax","filtersToArray","searchType","filterRecurse","rowList","activeRowComponents","filterRow","subFilter","_this12","defaultFilters","plaintext","formatterParams","emptyToSpace","sanitizeHTML","money","integer","decimal","rgx","floatVal","sign","decimalSym","thousandSym","thousand","negativeSign","symbolAfter","link","urlPrefix","labelField","labelTraverse","urlField","image","src","urlSuffix","truthy","allowTruthy","tick","tickElement","cross","crossElement","datetime","newDatetime","DT","DateTime","luxon","inputFormat","outputFormat","invalid","invalidPlaceholder","isDateTime","fromISO","fromFormat","isValid","timezone","setZone","toFormat","datetimediff","suffix","humanize","date","now","toHuman","traffic","percentValue","colors","color","legend","legendColor","legendAlign","barEl","barContainer","legendEl","holderEl","buttonTick","buttonCross","rownum","responsiveCollapse","toggleList","isOpen","rowSelection","checkbox","selectableRangeMode","toggleSelect","handleComplexRowClick","isSelected","registerRowSelectCheckbox","deselectRow","registerHeaderSelectCheckbox","Format","formatValue","formatHeader","lookupFormatter","formatterPrint","print","formatterClipboard","formatterHtmlOutput","htmlOutput","formatters","mockCell","titleFormatter","titleFormatterParams","entityMap","defaultFormatters","FrozenColumns","leftColumns","rightColumns","rightPadding","initializationMode","layoutCell","reinitializeColumns","blockLayout","unblockLayout","edge","frozenCheck","calcMargins","layoutColumnPosition","layoutCalcRows","_calcSpace","layoutGroupCalcs","groupList","allCells","leftParents","marginValue","getColGroupParentElement","deinitialize","getTableElement","FrozenRows","freezeRow","unfreezeRow","isRowFrozen","detachRow","styleRows","GroupComponent","groupManager","toggleVisibility","Group","oldGroup","hasSubGroups","groupIDLookups","_addRowToGroup","_addRow","elementContents","arrowElement","createElements","addBindings","createValueGroups","arrow","movableRows","moveRow","initializeGroupHeader","allowedValues","_createGroup","groupToggleElement","groupID","groupKey","headerGenerator","conformRowData","generateGroupHeaderContents","updateGroupRows","scrollHeader","groupValues","removeGroup","noCalc","_visSet","getHeadersAndRows","hasTopCalcs","detachElement","generateTopRow","hasBottomCalcs","generateBottomRow","groupClosedShowCalcs","count","getDisplayIndex","checkClassicModeGroupHeaderWidth","prev","compoment","getPath","childNodes","GroupRows","displayHandler","setGroupBy","setGroupValues","setGroupStartOpen","setGroupHeader","userGetGroups","userGetGroupedData","rowGetGroup","groupUpdateOnCellEdit","cellUpdated","reassignRowToGroup","configureGroupSetup","rowDeleting","scrollHeaders","rowMoving","rowAddingIndex","rowSample","virtualRenderFill","groupStartOpen","langValue","items","removeCalcs","getRealColumns","lookupFunc","prevValue","assignRowToGroup","getGroupedData","toGroup","fromGroup","removeRow","insertRow","generateGroups","groupComponents","groupListData","pullGroupListData","rowCount","headerContent","oldGroups","createGroup","assignRowToExistingGroup","newGroupNeeded","oldRowGroup","oldGroupPath","newGroupPath","getExpectedPath","every","groupPath","groupId","History","history","clearComponentHistory","rowDeleted","rowAdded","rowMoved","undo","redo","getHistoryUndoSize","getHistoryRedoSize","posFrom","posTo","getGroup","newValue","undoers","redoers","oldRow","cellEdit","rowAdd","_rebindRow","rowMove","HtmlTableImport","fieldIndex","hasIndex","tableElementCheck","parseTable","_extractOptions","_extractHeaders","_generateBlankHeaders","optionsArr","attrib","_attribValue","exists","_findCol","textContent","inQuote","nextChar","Import","importFromFile","importFormat","loadDataCheck","loadData","importData","lookupImporter","structureData","err","importer","importers","extension","pickFile","extensions","accept","file","files","reader","FileReader","importReader","readAsArrayBuffer","readAsBinaryString","readAsDataURL","readAsText","onload","onerror","parsedData","structureArrayToObject","structureArrayToColumns","getColumns","defaultImporters","Interaction","eventMap","rowClick","rowDblClick","rowContext","rowMouseEnter","rowMouseLeave","rowMouseOver","rowMouseOut","rowMouseMove","rowTap","rowDblTap","rowTapHold","cellDblClick","cellContext","cellMouseEnter","cellMouseLeave","cellMouseOver","cellMouseOut","cellMouseMove","cellTap","cellDblTap","cellTapHold","headerClick","headerDblClick","headerContext","headerMouseEnter","headerMouseLeave","headerMouseOver","headerMouseOut","headerMouseMove","headerTap","headerDblTap","headerTapHold","groupClick","groupDblClick","groupContext","groupMouseEnter","groupMouseLeave","groupMouseOver","groupMouseOut","groupMouseMove","groupTap","groupDblTap","groupTapHold","subscribers","touchSubscribers","columnSubscribers","touchWatchers","tap","tapDbl","tapHold","initializeExternalEvents","cellContentsSelectionFixer","selectNode","subscriptionChangeExternal","subscribeTouchEvents","unsubscribeTouchEvents","handleTouch","notouch","watchers","componentObj","Keybindings","watchKeys","pressedKeys","keyupBinding","keydownBinding","keybindings","mergedBindings","mapBindings","bindEvents","clearBindings","mapBinding","symbolsList","ctrl","meta","code","checkBinding","ctrlKey","shiftKey","metaKey","navPrev","navNext","navUp","navDown","scrollPageUp","scrollPageDown","scrollToStart","scrollToEnd","copyToClipboard","keyBlock","newPos","scrollMax","navLeft","navRight","Menu","nestedMenuBlock","currentComponent","rootPopup","deprecationCheck","initializeRowWatchers","initializeGroupWatchers","rowContextMenu","loadMenuEvent","on","rowClickMenu","groupContextMenu","groupClickMenu","headerContextMenu","loadMenuTableColumnEvent","headerClickMenu","headerMenu","initializeColumnHeaderMenu","contextMenu","loadMenuTableCellEvent","clickMenu","headerMenuEl","icon","headerMenuIcon","menu","loadMenu","parentPopup","itemEl","disabled","MoveColumns","placeholderElement","createPlaceholderElement","hoverElement","checkTimeout","checkPeriod","moving","toCol","toColAfter","startX","autoScrollMargin","autoScrollStep","autoScrollTimeout","touchMove","moveHover","endMove","movableColumns","mousemove","which","startMove","bindTouchEvents","prevColWidth","nextColWidthLast","prevColWidthLast","startXMove","passive","moveToCol","_bindMouseMove","movingCells","_unbindMouseMove","scrollPos","columnHolder","xPos","MoveRows","toRowAfter","hasHandle","startY","tableRowDropEvent","connectionSelectorsTables","connectionSelectorsElements","connectionElements","connectedTable","connectedRow","movableRowsConnectedTables","movableRowsConnectedElements","initializeCell","mouseup","tableRowDrop","previousSibling","rowHandle","nextRowHeight","prevRowHeight","nextRowHeightLast","prevRowHeightLast","startYMove","setStartPosition","connectToTables","pointerEvents","disconnectFromTables","moveHoverConnections","moveHoverTable","rowHolder","yPos","connectionTables","commsConnections","dropEvent","elementRowDrop","tabulatorElementDropEvent","sender","movableRowsSender","senders","movableRowsReceiver","receivers","connect","disconnect","dropComplete","fromTable","toTable","Mutator","enabled","transformCell","mutateLink","lookupMutator","mutators","mutatorEdit","linkCell","pageSize","currentRow","currentPage","totalRows","totalPages","showingEl","valueEl","ofEl","totalEl","rowsEl","pages","Page","progressiveLoad","pageCounterElement","pageCounter","page","remoteRowCountEstimate","initialLoad","dataChanging","pageSizes","setMaxPage","setPage","userSetPageToRow","userSetPageSize","getPageSize","previousPage","nextPage","getPage","getPageMax","setPageToRow","initialLoadComplete","calculatePageSizes","footerRedraw","paginationAddRow","rowAddingPosition","paginationMode","remotePageParams","_parseRemoteData","restOnRenderBefore","initializePageCounter","initializePaginator","initializeProgressive","scrollVertical","dispRows","testElRow","testElCell","paginationSize","generatePageSizeSelectList","setPageSize","progressiveLoadScrollMargin","pagesElement","firstBut","prevBut","nextBut","lastBut","paginationSizeSelector","pageSizeSelect","counter","paginationCounter","pageCounters","hidden","pageSelectLabel","paginationCounterHolder","paginationElement","paginationCounterElement","footerAppend","paginationInitialPage","paginationButtonCount","trigger","leftSize","rightSize","_generatePageButton","actualStartRow","actualRowPageSize","actualRows","setMaxRows","_setPageButtons","_setPageCounter","last_page","last_row","progressiveLoadDelay","footer","defaultPageCounters","local","id","localStorage","getItem","cookie","cookiePos","setItem","expireDate","setDate","getDate","toUTCString","Persistence","defWatcherBlock","readFunc","writeFunc","testKey","removeItem","persistence","retreivedData","persistenceMode","persistenceID","localStorageTest","persistenceReaderFunc","readers","persistenceWriterFunc","writers","retreiveData","save","eventSave","getColumnLayout","setColumnLayout","sorters","initialSort","parseColumns","mergeDefinition","getOwnPropertyDescriptor","defineProperty","set","current","oldCols","newCols","_findColumn","validateSorters","getSort","getGroupConfig","getPageConfig","excludedKeys","defStore","colDef","defaultReaders","defaultWriters","rowContextPopup","loadPopupEvent","rowClickPopup","groupContextPopup","groupClickPopup","headerContextPopup","loadPopupTableColumnEvent","headerClickPopup","headerPopup","initializeColumnHeaderPopup","contextPopup","loadPopupTableCellEvent","clickPopup","headerPopupEl","headerPopupIcon","loadPopup","contentsEl","renderCallback","Print","manualBlock","printAsHtml","replaceTable","cleanup","printFullscreen","genereateTable","printConfig","printStyled","printRowRange","footerContent","scrollX","scrollY","footerEl","tableEl","printHeader","printFooter","printFormatter","scrollTo","ReactiveData","origFuncs","currentVersion","unblock","watchRow","watchData","unwatchData","version","enumerable","configurable","arg","getRowFromDataObject","pop","startRow","oldRows","writable","watchKey","watchTreeChildren","childField","rebuildTree","ResizeColumns","startColumn","startWidth","latestX","initialNextColumn","layoutColumnHeader","layoutCellHandles","deInitializeComponent","resizeHandle","columnLayoutUpdated","deInitializeColumn","columnWidthUpdated","resizable","initializeEventWatchers","reinitializeColumn","frozenOffset","handleEl","nearestColumn","_checkResizability","handleDown","_mouseDown","oldWidth","parentElement","mouseMove","blockedBefore","blockedAfter","startDiff","moveDiff","resizableColumnFit","checkCellHeights","mouseUp","ResizeRows","startHeight","prevHandle","prevHandleDown","screenY","ResizeTable","observer","containerObserver","tableHeight","containerWidth","autoResize","tableStyle","ResizeObserver","entry","nodeHeight","contentRect","nodeWidth","observe","tableResized","unobserve","ResponsiveLayout","hiddenColumns","collapseFormatter","collapseStartOpen","collapseHandleColumn","updateColumnVisibility","initializeResponsivity","responsiveLayoutCollapseFormatter","formatCollapsedData","responsiveLayoutCollapseStartOpen","order","generateCollapsedContent","generateCollapsedRowContent","colCount","working","getFlexBaseWidth","hideColumn","showColumn","generateCollapsedRowData","mockCellComponent","responsiveLayoutCollapseUseFormatters","node_content","titleData","valueData","titleHighlight","SelectRow","selecting","lastClickedRow","selectPrev","headerCheckboxElement","selectRows","deselectRows","getSelectedRows","getSelectedData","isRowSelected","selectable","clearSelectionData","rowRetrieve","selectablePersistence","_deselectRow","_rowSelectionChanged","endSelect","selectableCheck","getCurrentCell","_clearSelection","lastClickedRowIdx","rowIdx","fromRowIdx","toRowIdx","toggledRows","toggledRow","_selectRow","rowMatch","rowInfo","selectableRollingSelection","checkboxEl","dataTreeSelectPropagate","childRowSelection","selectedRow","aRow","bRow","alignEmptyValues","decimalSeparator","thousandSeparator","string","langLocale","localeCompare","time","array","calc","d","alphanum","Sort","sortList","userSetSort","clearSort","sortMode","remoteSortParams","setSort","refreshSort","arrowEl","sorterParams","startingDir","headerSortStartingDir","headerSortTristate","headerSort","headerSortElement","columnHeaderSortMulti","newSortList","sortOrderReverse","sortListActual","rowComponents","clearColumnHeaders","sortObj","findSorter","setColumnHeader","_sortItems","sorterCount","sortItem","_sortRow","el1Comp","el2Comp","el1","el2","defaultSorters","Tooltip","tooltipSubscriber","headerSubscriber","timeout","popupInstance","tooltipGenerationMode","headerTooltip","mousemoveCheck","mouseoutCheck","tooltip","clearPopup","loadTooltip","tooltipDelay","parameters","numeric","starts","ends","minLength","maxLength","regex","unique","cellData","Validate","invalidCells","getInvalidCells","userClearCellValidation","userValidate","cellIsValid","clearValidation","cellValidate","columnValidate","rowValidate","editValidate","editorClear","editedClear","previousValue","validate","cancelled","validator","_extractValidator","substring","_buildValidator","validators","failedValidators","invalidIndex","defaultValidators","TabulatorFull"],"mappings":";4sHAAqBA,wBAERC,kBACNA,MAAQA,+CAO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,aAAamF,UAAUqM,OAAO,6BACnClR,EAAKzC,QAAQk/E,SAASz0B,SAAU,GAEhCi1B,EAAe9/E,KAAKy+E,aAAa/yE,QAAQ7I,KAEtB,QACb47E,aAAaxvE,OAAO6wE,EAAc,WApSpBrvD,GA0SvB+tD,GAAS3qD,WAAa,WAGtB2qD,GAASoB,WAAaG,grBC5ShBC,iGAAsBxxD,UAG5B,IAAI2H,EAAa6pD,GAAe5/E"} \ No newline at end of file diff --git a/dist/js/tabulator_esm.js b/dist/js/tabulator_esm.js index 3167eb371..ebc18b024 100644 --- a/dist/js/tabulator_esm.js +++ b/dist/js/tabulator_esm.js @@ -1,4 +1,4 @@ -/* Tabulator v5.2.4 (c) Oliver Folkerd 2022 */ +/* Tabulator v5.2.5 (c) Oliver Folkerd 2022 */ class CoreFeature{ constructor(table){ diff --git a/dist/js/tabulator_esm.min.js b/dist/js/tabulator_esm.min.js index 7f06fdf57..686b1c2bc 100644 --- a/dist/js/tabulator_esm.min.js +++ b/dist/js/tabulator_esm.min.js @@ -1,3 +1,3 @@ -/* Tabulator v5.2.4 (c) Oliver Folkerd 2022 */ -class e{constructor(e){this.table=e}reloadData(e,t,i){return this.table.dataLoader.load(e,void 0,void 0,void 0,t,i)}langText(){return this.table.modules.localize.getText(...arguments)}langBind(){return this.table.modules.localize.bind(...arguments)}langLocale(){return this.table.modules.localize.getLocale(...arguments)}commsConnections(){return this.table.modules.comms.getConnections(...arguments)}commsSend(){return this.table.modules.comms.send(...arguments)}layoutMode(){return this.table.modules.layout.getMode()}layoutRefresh(){return this.table.modules.layout.layout()}subscribe(){return this.table.eventBus.subscribe(...arguments)}unsubscribe(){return this.table.eventBus.unsubscribe(...arguments)}subscribed(e){return this.table.eventBus.subscribed(e)}subscriptionChange(){return this.table.eventBus.subscriptionChange(...arguments)}dispatch(){return this.table.eventBus.dispatch(...arguments)}chain(){return this.table.eventBus.chain(...arguments)}confirm(){return this.table.eventBus.confirm(...arguments)}dispatchExternal(){return this.table.externalEvents.dispatch(...arguments)}subscribedExternal(e){return this.table.externalEvents.subscribed(e)}subscriptionChangeExternal(){return this.table.externalEvents.subscriptionChange(...arguments)}options(e){return this.table.options[e]}setOption(e,t){return void 0!==t&&(this.table.options[e]=t),this.table.options[e]}module(e){return this.table.module(e)}}class t{static elVisible(e){return!(e.offsetWidth<=0&&e.offsetHeight<=0)}static elOffset(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}}static deepClone(e,t,i=[]){var s={}.__proto__,o=[].__proto__;for(var n in t||(t=Object.assign(Array.isArray(e)?[]:{},e)),e){let r,a,l=e[n];null==l||"object"!=typeof l||l.__proto__!==s&&l.__proto__!==o||(r=i.findIndex((e=>e.subject===l)),r>-1?t[n]=i[r].copy:(a=Object.assign(Array.isArray(l)?[]:{},l),i.unshift({subject:l,copy:a}),t[n]=this.deepClone(l,a,i)))}return t}}class s extends e{constructor(e,t,i){super(e),this.element=t,this.container=this._lookupContainer(),this.parent=i,this.reversedX=!1,this.childPopup=null,this.blurable=!1,this.blurCallback=null,this.renderedCallback=null,this.visible=!1,this.element.classList.add("tabulator-popup-container"),this.blurEvent=this.hide.bind(this,!1),this.escEvent=this._escapeCheck.bind(this)}_lookupContainer(){var e=this.table.options.popupContainer;return"string"==typeof e?(e=document.querySelector(e))||console.warn("Menu Error - no container element found matching selector:",this.table.options.popupContainer,"(defaulting to document body)"):!0===e&&(e=this.table.element),e&&!this._checkContainerIsParent(e)&&(e=!1,console.warn("Menu Error - container element does not contain this table:",this.table.options.popupContainer,"(defaulting to document body)")),e||(e=document.body),e}_checkContainerIsParent(e,t=this.table.element){return e===t||!!t.parentNode&&this._checkContainerIsParent(e,t.parentNode)}renderCallback(e){this.renderedCallback=e}containerEventCoords(e){var i=!(e instanceof MouseEvent),s=i?e.touches[0].pageX:e.pageX,o=i?e.touches[0].pageY:e.pageY;if(this.container!==document.body){let e=t.elOffset(this.container);s-=e.left,o-=e.top}return{x:s,y:o}}elementPositionCoords(e,i="right"){var s,o,n,r=t.elOffset(e);switch(this.container!==document.body&&(s=t.elOffset(this.container),r.left-=s.left,r.top-=s.top),i){case"right":o=r.left+e.offsetWidth,n=r.top-1;break;case"bottom":o=r.left,n=r.top+e.offsetHeight}return{x:o,y:n,offset:r}}show(e,t){var i,s,o,n,r;return e instanceof HTMLElement?(o=e,n=(r=this.elementPositionCoords(e,t)).offset,i=r.x,s=r.y):"number"==typeof e?(n={top:0,left:0},i=e,s=t):(i=(r=this.containerEventCoords(e)).x,s=r.y,this.reversedX=!1),this.element.style.top=s+"px",this.element.style.left=i+"px",this.container.appendChild(this.element),"function"==typeof this.renderedCallback&&this.renderedCallback(),this._fitToScreen(i,s,o,n,t),this.visible=!0,this}_fitToScreen(e,t,i,s,o){var n=this.container===document.body?document.documentElement.scrollTop:this.container.scrollTop;if((e+this.element.offsetWidth>=this.container.offsetWidth||this.reversedX)&&(this.element.style.left="",this.element.style.right=i?this.container.offsetWidth-s.left+"px":this.container.offsetWidth-e+"px",this.reversedX=!0),t+this.element.offsetHeight>Math.max(this.container.offsetHeight,n?this.container.scrollHeight:0))if(i)switch(o){case"bottom":this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight-i.offsetHeight-1+"px";break;default:this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+i.offsetHeight+1+"px"}else this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+"px"}isVisible(){return this.visible}hideOnBlur(e){return this.blurable=!0,this.visible&&(setTimeout((()=>{this.table.rowManager.element.addEventListener("scroll",this.blurEvent),this.subscribe("cell-editing",this.blurEvent),document.body.addEventListener("click",this.blurEvent),document.body.addEventListener("contextmenu",this.blurEvent),window.addEventListener("resize",this.blurEvent),document.body.addEventListener("keydown",this.escEvent)}),100),this.blurCallback=e),this}_escapeCheck(e){27==e.keyCode&&this.hide()}hide(e=!1){return this.visible&&(this.blurable&&(document.body.removeEventListener("keydown",this.escEvent),document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),window.removeEventListener("resize",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent),this.unsubscribe("cell-editing",this.blurEvent)),this.childPopup&&this.childPopup.hide(),this.parent&&(this.parent.childPopup=null),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.visible=!1,this.blurCallback&&!e&&this.blurCallback()),this}child(e){return this.childPopup&&this.childPopup.hide(),this.childPopup=new s(this.table,e,this),this.childPopup}}class o extends e{constructor(e,t){super(e),this._handler=null}initialize(){}registerTableOption(e,t){this.table.optionsList.register(e,t)}registerColumnOption(e,t){this.table.columnManager.optionsList.register(e,t)}registerTableFunction(e,t){void 0===this.table[e]?this.table[e]=(...i)=>(this.table.initGuard(e),t(...i)):console.warn("Unable to bind table function, name already in use",e)}registerComponentFunction(e,t,i){return this.table.componentFunctionBinder.bind(e,t,i)}registerDataHandler(e,t){this.table.rowManager.registerDataPipelineHandler(e,t),this._handler=e}registerDisplayHandler(e,t){this.table.rowManager.registerDisplayPipelineHandler(e,t),this._handler=e}refreshData(e,t){t||(t=this._handler),t&&this.table.rowManager.refreshActiveData(t,!1,e)}footerAppend(e){return this.table.footerManager.append(e)}footerPrepend(e){return this.table.footerManager.prepend(e)}footerRemove(e){return this.table.footerManager.remove(e)}popup(e,t){return new s(this.table,e,t)}alert(e,t){return this.table.alertManager.alert(e,t)}clearAlert(){return this.table.alertManager.clear()}}class n extends o{constructor(e){super(e),this.allowedTypes=["","data","download","clipboard","print","htmlOutput"],this.registerColumnOption("accessor"),this.registerColumnOption("accessorParams"),this.registerColumnOption("accessorData"),this.registerColumnOption("accessorDataParams"),this.registerColumnOption("accessorDownload"),this.registerColumnOption("accessorDownloadParams"),this.registerColumnOption("accessorClipboard"),this.registerColumnOption("accessorClipboardParams"),this.registerColumnOption("accessorPrint"),this.registerColumnOption("accessorPrintParams"),this.registerColumnOption("accessorHtmlOutput"),this.registerColumnOption("accessorHtmlOutputParams")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-retrieve",this.transformRow.bind(this))}initializeColumn(e){var t=!1,i={};this.allowedTypes.forEach((s=>{var o,n="accessor"+(s.charAt(0).toUpperCase()+s.slice(1));e.definition[n]&&(o=this.lookupAccessor(e.definition[n]))&&(t=!0,i[n]={accessor:o,params:e.definition[n+"Params"]||{}})})),t&&(e.modules.accessor=i)}lookupAccessor(e){var t=!1;switch(typeof e){case"string":n.accessors[e]?t=n.accessors[e]:console.warn("Accessor Error - No such accessor found, ignoring: ",e);break;case"function":t=e}return t}transformRow(e,i){var s="accessor"+(i.charAt(0).toUpperCase()+i.slice(1)),o=e.getComponent(),n=t.deepClone(e.data||{});return this.table.columnManager.traverse((function(e){var t,r,a,l;e.modules.accessor&&(r=e.modules.accessor[s]||e.modules.accessor.accessor||!1)&&"undefined"!=(t=e.getFieldValue(n))&&(l=e.getComponent(),a="function"==typeof r.params?r.params(t,n,i,l,o):r.params,e.setFieldValue(n,r.accessor(t,n,i,a,l,o)))})),n}}n.moduleName="accessor",n.accessors={};function r(e,t){var i=[];if(t=t||"",Array.isArray(e))e.forEach(((e,s)=>{i=i.concat(r(e,t?t+"["+s+"]":s))}));else if("object"==typeof e)for(var s in e)i=i.concat(r(e[s],t?t+"["+s+"]":s));else i.push({key:t,value:e});return i}function a(e){var t=r(e),i=[];return t.forEach((function(e){i.push(encodeURIComponent(e.key)+"="+encodeURIComponent(e.value))})),i.join("&")}function l(e,t,i){return e&&i&&Object.keys(i).length&&(t.method&&"get"!=t.method.toLowerCase()||(t.method="get",e+=(e.includes("?")?"&":"?")+a(i))),e}function h(e,t){var i=[];if(t=t||"",Array.isArray(e))e.forEach(((e,s)=>{i=i.concat(h(e,t?t+"["+s+"]":s))}));else if("object"==typeof e)for(var s in e)i=i.concat(h(e[s],t?t+"["+s+"]":s));else i.push({key:t,value:e});return i}var d={json:{headers:{"Content-Type":"application/json"},body:function(e,t,i){return JSON.stringify(i)}},form:{headers:{},body:function(e,t,i){var s=h(i),o=new FormData;return s.forEach((function(e){o.append(e.key,e.value)})),o}}};class c extends o{constructor(e){super(e),this.config={},this.url="",this.urlGenerator=!1,this.params=!1,this.loaderPromise=!1,this.registerTableOption("ajaxURL",!1),this.registerTableOption("ajaxURLGenerator",!1),this.registerTableOption("ajaxParams",{}),this.registerTableOption("ajaxConfig","get"),this.registerTableOption("ajaxContentType","form"),this.registerTableOption("ajaxRequestFunc",!1),this.registerTableOption("ajaxRequesting",(function(){})),this.registerTableOption("ajaxResponse",!1),this.contentTypeFormatters=c.contentTypeFormatters}initialize(){this.loaderPromise=this.table.options.ajaxRequestFunc||c.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||c.defaultURLGenerator,this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.setDefaultConfig(this.table.options.ajaxConfig),this.registerTableFunction("getAjaxUrl",this.getUrl.bind(this)),this.subscribe("data-loading",this.requestDataCheck.bind(this)),this.subscribe("data-params",this.requestParams.bind(this)),this.subscribe("data-load",this.requestData.bind(this))}requestParams(e,t,i,s){var o=this.table.options.ajaxParams;return o&&("function"==typeof o&&(o=o.call(this.table)),s=Object.assign(s,o)),s}requestDataCheck(e,t,i,s){return!((e||!this.url)&&"string"!=typeof e)}requestData(e,t,i,s,o){var n;return!o&&this.requestDataCheck(e)?(e&&this.setUrl(e),n=this.generateConfig(i),this.sendRequest(this.url,t,n)):o}setDefaultConfig(e={}){this.config=Object.assign({},c.defaultConfig),"string"==typeof e?this.config.method=e:Object.assign(this.config,e)}generateConfig(e={}){var t=Object.assign({},this.config);return"string"==typeof e?t.method=e:Object.assign(t,e),t}setUrl(e){this.url=e}getUrl(){return this.url}sendRequest(e,t,i){return!1!==this.table.options.ajaxRequesting.call(this.table,e,t)?this.loaderPromise(e,i,t).then((i=>(this.table.options.ajaxResponse&&(i=this.table.options.ajaxResponse.call(this.table,e,t,i)),i))):Promise.reject()}}c.moduleName="ajax",c.defaultConfig={method:"GET"},c.defaultURLGenerator=l,c.defaultLoaderPromise=function(e,t,i){var s;return new Promise(((o,n)=>{if(e=this.urlGenerator.call(this.table,e,t,i),"GET"!=t.method.toUpperCase())if(s="object"==typeof this.table.options.ajaxContentType?this.table.options.ajaxContentType:this.contentTypeFormatters[this.table.options.ajaxContentType]){for(var r in s.headers)t.headers||(t.headers={}),void 0===t.headers[r]&&(t.headers[r]=s.headers[r]);t.body=s.body.call(this,e,t,i)}else console.warn("Ajax Error - Invalid ajaxContentType value:",this.table.options.ajaxContentType);e?(void 0===t.headers&&(t.headers={}),void 0===t.headers.Accept&&(t.headers.Accept="application/json"),void 0===t.headers["X-Requested-With"]&&(t.headers["X-Requested-With"]="XMLHttpRequest"),void 0===t.mode&&(t.mode="cors"),"cors"==t.mode?(void 0===t.headers.Origin&&(t.headers.Origin=window.location.origin),void 0===t.credentials&&(t.credentials="same-origin")):void 0===t.credentials&&(t.credentials="include"),fetch(e,t).then((e=>{e.ok?e.json().then((e=>{o(e)})).catch((e=>{n(e),console.warn("Ajax Load Error - Invalid JSON returned",e)})):(console.error("Ajax Load Error - Connection Error: "+e.status,e.statusText),n(e))})).catch((e=>{console.error("Ajax Load Error - Connection Error: ",e),n(e)}))):(console.warn("Ajax Load Error - No URL Set"),o([]))}))},c.contentTypeFormatters=d;class u extends o{constructor(e){super(e),this.mode=!0,this.pasteParser=function(){},this.pasteAction=function(){},this.customSelection=!1,this.rowRange=!1,this.blocked=!0,this.registerTableOption("clipboard",!1),this.registerTableOption("clipboardCopyStyled",!0),this.registerTableOption("clipboardCopyConfig",!1),this.registerTableOption("clipboardCopyFormatter",!1),this.registerTableOption("clipboardCopyRowRange","active"),this.registerTableOption("clipboardPasteParser","table"),this.registerTableOption("clipboardPasteAction","insert"),this.registerColumnOption("clipboard"),this.registerColumnOption("titleClipboard")}initialize(){this.mode=this.table.options.clipboard,this.rowRange=this.table.options.clipboardCopyRowRange,!0!==this.mode&&"copy"!==this.mode||this.table.element.addEventListener("copy",(e=>{var t,i;if(!this.blocked){if(e.preventDefault(),this.customSelection)t=this.customSelection,this.table.options.clipboardCopyFormatter&&(t=this.table.options.clipboardCopyFormatter("plain",t));else{var s=this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig,this.table.options.clipboardCopyStyled,this.rowRange,"clipboard");t=(i=this.table.modules.export.genereateHTMLTable(s))?this.generatePlainContent(s):"",this.table.options.clipboardCopyFormatter&&(t=this.table.options.clipboardCopyFormatter("plain",t),i=this.table.options.clipboardCopyFormatter("html",i))}window.clipboardData&&window.clipboardData.setData?window.clipboardData.setData("Text",t):e.clipboardData&&e.clipboardData.setData?(e.clipboardData.setData("text/plain",t),i&&e.clipboardData.setData("text/html",i)):e.originalEvent&&e.originalEvent.clipboardData.setData&&(e.originalEvent.clipboardData.setData("text/plain",t),i&&e.originalEvent.clipboardData.setData("text/html",i)),this.dispatchExternal("clipboardCopied",t,i),this.reset()}})),!0!==this.mode&&"paste"!==this.mode||this.table.element.addEventListener("paste",(e=>{this.paste(e)})),this.setPasteParser(this.table.options.clipboardPasteParser),this.setPasteAction(this.table.options.clipboardPasteAction),this.registerTableFunction("copyToClipboard",this.copy.bind(this))}reset(){this.blocked=!0,this.customSelection=!1}generatePlainContent(e){var t=[];return e.forEach((e=>{var i=[];e.columns.forEach((t=>{var s="";if(t)if("group"===e.type&&(t.value=t.component.getKey()),null===t.value)s="";else switch(typeof t.value){case"object":s=JSON.stringify(t.value);break;case"undefined":s="";break;default:s=t.value}i.push(s)})),t.push(i.join("\t"))})),t.join("\n")}copy(e,t){var i,s;this.blocked=!1,this.customSelection=!1,!0!==this.mode&&"copy"!==this.mode||(this.rowRange=e||this.table.options.clipboardCopyRowRange,void 0!==window.getSelection&&void 0!==document.createRange?((e=document.createRange()).selectNodeContents(this.table.element),(i=window.getSelection()).toString()&&t&&(this.customSelection=i.toString()),i.removeAllRanges(),i.addRange(e)):void 0!==document.selection&&void 0!==document.body.createTextRange&&((s=document.body.createTextRange()).moveToElementText(this.table.element),s.select()),document.execCommand("copy"),i&&i.removeAllRanges())}setPasteAction(e){switch(typeof e){case"string":this.pasteAction=u.pasteActions[e],this.pasteAction||console.warn("Clipboard Error - No such paste action found:",e);break;case"function":this.pasteAction=e}}setPasteParser(e){switch(typeof e){case"string":this.pasteParser=u.pasteParsers[e],this.pasteParser||console.warn("Clipboard Error - No such paste parser found:",e);break;case"function":this.pasteParser=e}}paste(e){var t,i,s;this.checkPaseOrigin(e)&&(t=this.getPasteData(e),(i=this.pasteParser.call(this,t))?(e.preventDefault(),this.table.modExists("mutator")&&(i=this.mutateData(i)),s=this.pasteAction.call(this,i),this.dispatchExternal("clipboardPasted",t,i,s)):this.dispatchExternal("clipboardPasteError",t))}mutateData(e){var t=[];return Array.isArray(e)?e.forEach((e=>{t.push(this.table.modules.mutator.transformRow(e,"clipboard"))})):t=e,t}checkPaseOrigin(e){var t=!0;return("DIV"!=e.target.tagName||this.table.modules.edit.currentCell)&&(t=!1),t}getPasteData(e){var t;return window.clipboardData&&window.clipboardData.getData?t=window.clipboardData.getData("Text"):e.clipboardData&&e.clipboardData.getData?t=e.clipboardData.getData("text/plain"):e.originalEvent&&e.originalEvent.clipboardData.getData&&(t=e.originalEvent.clipboardData.getData("text/plain")),t}}u.moduleName="clipboard",u.pasteActions={replace:function(e){return this.table.setData(e)},update:function(e){return this.table.updateOrAddData(e)},insert:function(e){return this.table.addData(e)}},u.pasteParsers={table:function(e){var t=[],i=!0,s=this.table.columnManager.columns,o=[],n=[];return(e=e.split("\n")).forEach((function(e){t.push(e.split("\t"))})),!(!t.length||1===t.length&&t[0].length<2)&&(t[0].forEach((function(e){var t=s.find((function(t){return e&&t.definition.title&&e.trim()&&t.definition.title.trim()===e.trim()}));t?o.push(t):i=!1})),i||(i=!0,o=[],t[0].forEach((function(e){var t=s.find((function(t){return e&&t.field&&e.trim()&&t.field.trim()===e.trim()}));t?o.push(t):i=!1})),i||(o=this.table.columnManager.columnsByIndex)),i&&t.shift(),t.forEach((function(e){var t={};e.forEach((function(e,i){o[i]&&(t[o[i].field]=e)})),n.push(t)})),n)}};class m{constructor(e){return this._row=e,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._row.table.componentFunctionBinder.handle("row",e._row,t)}})}getData(e){return this._row.getData(e)}getElement(){return this._row.getElement()}getTable(){return this._row.table}getCells(){var e=[];return this._row.getCells().forEach((function(t){e.push(t.getComponent())})),e}getCell(e){var t=this._row.getCell(e);return!!t&&t.getComponent()}_getSelf(){return this._row}}class p{constructor(e){return this._cell=e,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._cell.table.componentFunctionBinder.handle("cell",e._cell,t)}})}getValue(){return this._cell.getValue()}getOldValue(){return this._cell.getOldValue()}getInitialValue(){return this._cell.initialValue}getElement(){return this._cell.getElement()}getRow(){return this._cell.row.getComponent()}getData(){return this._cell.row.getData()}getField(){return this._cell.column.getField()}getColumn(){return this._cell.column.getComponent()}setValue(e,t){void 0===t&&(t=!0),this._cell.setValue(e,t)}restoreOldValue(){this._cell.setValueActual(this._cell.getOldValue())}restoreInitialValue(){this._cell.setValueActual(this._cell.initialValue)}checkHeight(){this._cell.checkHeight()}getTable(){return this._cell.table}_getSelf(){return this._cell}}class g extends e{constructor(e,t){super(e.table),this.table=e.table,this.column=e,this.row=t,this.element=null,this.value=null,this.initialValue,this.oldValue=null,this.modules={},this.height=null,this.width=null,this.minWidth=null,this.component=null,this.loaded=!1,this.build()}build(){this.generateElement(),this.setWidth(),this._configureCell(),this.setValueActual(this.column.getFieldValue(this.row.data)),this.initialValue=this.value}generateElement(){this.element=document.createElement("div"),this.element.className="tabulator-cell",this.element.setAttribute("role","gridcell"),this.element=this.element}_configureCell(){var e=this.element,t=this.column.getField();(e.style.textAlign=this.column.hozAlign,this.column.vertAlign&&(e.style.display="inline-flex",e.style.alignItems={top:"flex-start",bottom:"flex-end",middle:"center"}[this.column.vertAlign]||"",this.column.hozAlign&&(e.style.justifyContent={left:"flex-start",right:"flex-end",center:"center"}[this.column.hozAlign]||"")),t&&e.setAttribute("tabulator-field",t),this.column.definition.cssClass)&&this.column.definition.cssClass.split(" ").forEach((t=>{e.classList.add(t)}));this.dispatch("cell-init",this),this.column.visible||this.hide()}_generateContents(){var e;switch(typeof(e=this.chain("cell-format",this,null,(()=>this.element.innerHTML=this.value)))){case"object":if(e instanceof Node){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.appendChild(e)}else this.element.innerHTML="",null!=e&&console.warn("Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",e);break;case"undefined":case"null":this.element.innerHTML="";break;default:this.element.innerHTML=e}}cellRendered(){this.dispatch("cell-rendered",this)}getElement(e){return this.loaded||(this.loaded=!0,e||this.layoutElement()),this.element}getValue(){return this.value}getOldValue(){return this.oldValue}setValue(e,t,i){this.setValueProcessData(e,t,i)&&(this.dispatch("cell-value-updated",this),this.cellRendered(),this.column.definition.cellEdited&&this.column.definition.cellEdited.call(this.table,this.getComponent()),this.dispatchExternal("cellEdited",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()))}setValueProcessData(e,t,i){var s=!1;return(this.value!==e||i)&&(s=!0,t&&(e=this.chain("cell-value-changing",[this,e],null,e))),this.setValueActual(e),s&&this.dispatch("cell-value-changed",this),s}setValueActual(e){this.oldValue=this.value,this.value=e,this.dispatch("cell-value-save-before",this),this.column.setFieldValue(this.row.data,e),this.dispatch("cell-value-save-after",this),this.loaded&&this.layoutElement()}layoutElement(){this._generateContents(),this.dispatch("cell-layout",this)}setWidth(){this.width=this.column.width,this.element.style.width=this.column.widthStyled}clearWidth(){this.width="",this.element.style.width=""}getWidth(){return this.width||this.element.offsetWidth}setMinWidth(){this.minWidth=this.column.minWidth,this.element.style.minWidth=this.column.minWidthStyled}setMaxWidth(){this.maxWidth=this.column.maxWidth,this.element.style.maxWidth=this.column.maxWidthStyled}checkHeight(){this.row.reinitializeHeight()}clearHeight(){this.element.style.height="",this.height=null,this.dispatch("cell-height",this,"")}setHeight(){this.height=this.row.height,this.element.style.height=this.row.heightStyled,this.dispatch("cell-height",this,this.row.heightStyled)}getHeight(){return this.height||this.element.offsetHeight}show(){this.element.style.display=this.column.vertAlign?"inline-flex":""}hide(){this.element.style.display="none"}delete(){this.dispatch("cell-delete",this),!this.table.rowManager.redrawBlock&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=!1,this.column.deleteCell(this),this.row.deleteCell(this),this.calcs={}}getIndex(){return this.row.getCellIndex(this)}getComponent(){return this.component||(this.component=new p(this)),this.component}}class b{constructor(e){return this._column=e,this.type="ColumnComponent",new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._column.table.componentFunctionBinder.handle("column",e._column,t)}})}getElement(){return this._column.getElement()}getDefinition(){return this._column.getDefinition()}getField(){return this._column.getField()}getTitleDownload(){return this._column.getTitleDownload()}getCells(){var e=[];return this._column.cells.forEach((function(t){e.push(t.getComponent())})),e}isVisible(){return this._column.visible}show(){this._column.isGroup?this._column.columns.forEach((function(e){e.show()})):this._column.show()}hide(){this._column.isGroup?this._column.columns.forEach((function(e){e.hide()})):this._column.hide()}toggle(){this._column.visible?this.hide():this.show()}delete(){return this._column.delete()}getSubColumns(){var e=[];return this._column.columns.length&&this._column.columns.forEach((function(t){e.push(t.getComponent())})),e}getParentColumn(){return this._column.parent instanceof v&&this._column.parent.getComponent()}_getSelf(){return this._column}scrollTo(){return this._column.table.columnManager.scrollToColumn(this._column)}getTable(){return this._column.table}move(e,t){var i=this._column.table.columnManager.findColumn(e);i?this._column.table.columnManager.moveColumn(this._column,i,t):console.warn("Move Error - No matching column found:",i)}getNextColumn(){var e=this._column.nextColumn();return!!e&&e.getComponent()}getPrevColumn(){var e=this._column.prevColumn();return!!e&&e.getComponent()}updateDefinition(e){return this._column.updateDefinition(e)}getWidth(){return this._column.getWidth()}setWidth(e){var t;return t=!0===e?this._column.reinitializeWidth(!0):this._column.setWidth(e),this._column.table.columnManager.renderer.rerenderColumns(!0),t}}var f={title:void 0,field:void 0,columns:void 0,visible:void 0,hozAlign:void 0,vertAlign:void 0,width:void 0,minWidth:40,maxWidth:void 0,maxInitialWidth:void 0,cssClass:void 0,variableHeight:void 0,headerVertical:void 0,headerHozAlign:void 0,editableTitle:void 0};class v extends e{constructor(e,t){super(t.table),this.definition=e,this.parent=t,this.type="column",this.columns=[],this.cells=[],this.element=this.createElement(),this.contentElement=!1,this.titleHolderElement=!1,this.titleElement=!1,this.groupElement=this.createGroupElement(),this.isGroup=!1,this.hozAlign="",this.vertAlign="",this.field="",this.fieldStructure="",this.getFieldValue="",this.setFieldValue="",this.titleDownload=null,this.titleFormatterRendered=!1,this.mapDefinitions(),this.setField(this.definition.field),this.modules={},this.width=null,this.widthStyled="",this.maxWidth=null,this.maxWidthStyled="",this.maxInitialWidth=null,this.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,this.component=null,this.definition.columns?(this.isGroup=!0,this.definition.columns.forEach(((e,t)=>{var i=new v(e,this);this.attachColumn(i)})),this.checkColumnVisibility()):t.registerColumnField(this),this._initialize(),this.bindModuleColumns()}createElement(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.setAttribute("role","columnheader"),e.setAttribute("aria-sort","none"),e}createGroupElement(){var e=document.createElement("div");return e.classList.add("tabulator-col-group-cols"),e}mapDefinitions(){var e=this.table.options.columnDefaults;if(e)for(let t in e)void 0===this.definition[t]&&(this.definition[t]=e[t]);this.definition=this.table.columnManager.optionsList.generate(v.defaultOptionList,this.definition)}checkDefinition(){Object.keys(this.definition).forEach((e=>{-1===v.defaultOptionList.indexOf(e)&&console.warn("Invalid column definition option in '"+(this.field||this.definition.title)+"' column:",e)}))}setField(e){this.field=e,this.fieldStructure=e?this.table.options.nestedFieldSeparator?e.split(this.table.options.nestedFieldSeparator):[e]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData}registerColumnPosition(e){this.parent.registerColumnPosition(e)}registerColumnField(e){this.parent.registerColumnField(e)}reRegisterPosition(){this.isGroup?this.columns.forEach((function(e){e.reRegisterPosition()})):this.registerColumnPosition(this)}_mapDepricatedFunctionality(){}_initialize(){for(var e=this.definition;this.element.firstChild;)this.element.removeChild(this.element.firstChild);e.headerVertical&&(this.element.classList.add("tabulator-col-vertical"),"flip"===e.headerVertical&&this.element.classList.add("tabulator-col-vertical-flip")),this.contentElement=this._bindEvents(),this.contentElement=this._buildColumnHeaderContent(),this.element.appendChild(this.contentElement),this.isGroup?this._buildGroupHeader():this._buildColumnHeader(),this.dispatch("column-init",this)}_bindEvents(){var e,t,i,s=this.definition;"function"==typeof s.headerClick&&this.element.addEventListener("click",(e=>{s.headerClick(e,this.getComponent())})),"function"==typeof s.headerDblClick&&this.element.addEventListener("dblclick",(e=>{s.headerDblClick(e,this.getComponent())})),"function"==typeof s.headerContext&&this.element.addEventListener("contextmenu",(e=>{s.headerContext(e,this.getComponent())})),"function"==typeof s.headerTap&&(i=!1,this.element.addEventListener("touchstart",(e=>{i=!0}),{passive:!0}),this.element.addEventListener("touchend",(e=>{i&&s.headerTap(e,this.getComponent()),i=!1}))),"function"==typeof s.headerDblTap&&(e=null,this.element.addEventListener("touchend",(t=>{e?(clearTimeout(e),e=null,s.headerDblTap(t,this.getComponent())):e=setTimeout((()=>{clearTimeout(e),e=null}),300)}))),"function"==typeof s.headerTapHold&&(t=null,this.element.addEventListener("touchstart",(e=>{clearTimeout(t),t=setTimeout((function(){clearTimeout(t),t=null,i=!1,s.headerTapHold(e,this.getComponent())}),1e3)}),{passive:!0}),this.element.addEventListener("touchend",(e=>{clearTimeout(t),t=null})))}_buildColumnHeader(){var e=this.definition;this.table;(this.dispatch("column-layout",this),void 0!==e.visible&&(e.visible?this.show(!0):this.hide(!0)),e.cssClass)&&e.cssClass.split(" ").forEach((e=>{this.element.classList.add(e)}));e.field&&this.element.setAttribute("tabulator-field",e.field),this.setMinWidth(parseInt(e.minWidth)),e.maxInitialWidth&&(this.maxInitialWidth=parseInt(e.maxInitialWidth)),e.maxWidth&&this.setMaxWidth(parseInt(e.maxWidth)),this.reinitializeWidth(),this.hozAlign=this.definition.hozAlign,this.vertAlign=this.definition.vertAlign,this.titleElement.style.textAlign=this.definition.headerHozAlign}_buildColumnHeaderContent(){this.definition,this.table;var e=document.createElement("div");return e.classList.add("tabulator-col-content"),this.titleHolderElement=document.createElement("div"),this.titleHolderElement.classList.add("tabulator-col-title-holder"),e.appendChild(this.titleHolderElement),this.titleElement=this._buildColumnHeaderTitle(),this.titleHolderElement.appendChild(this.titleElement),e}_buildColumnHeaderTitle(){var e=this.definition,t=document.createElement("div");if(t.classList.add("tabulator-col-title"),e.editableTitle){var i=document.createElement("input");i.classList.add("tabulator-title-editor"),i.addEventListener("click",(e=>{e.stopPropagation(),i.focus()})),i.addEventListener("change",(()=>{e.title=i.value,this.dispatchExternal("columnTitleChanged",this.getComponent())})),t.appendChild(i),e.field?this.langBind("columns|"+e.field,(t=>{i.value=t||e.title||" "})):i.value=e.title||" "}else e.field?this.langBind("columns|"+e.field,(i=>{this._formatColumnHeaderTitle(t,i||e.title||" ")})):this._formatColumnHeaderTitle(t,e.title||" ");return t}_formatColumnHeaderTitle(e,t){var i=this.chain("column-format",[this,t,e],null,(()=>t));switch(typeof i){case"object":i instanceof Node?e.appendChild(i):(e.innerHTML="",console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",i));break;case"undefined":case"null":e.innerHTML="";break;default:e.innerHTML=i}}_buildGroupHeader(){(this.element.classList.add("tabulator-col-group"),this.element.setAttribute("role","columngroup"),this.element.setAttribute("aria-title",this.definition.title),this.definition.cssClass)&&this.definition.cssClass.split(" ").forEach((e=>{this.element.classList.add(e)}));this.titleElement.style.textAlign=this.definition.headerHozAlign,this.element.appendChild(this.groupElement)}_getFlatData(e){return e[this.field]}_getNestedData(e){var t,i=e,s=this.fieldStructure,o=s.length;for(let e=0;e-1&&this.columns.splice(t,1),this.columns.length||this.delete()}setWidth(e){this.widthFixed=!0,this.setWidthActual(e)}setWidthActual(e){isNaN(e)&&(e=Math.floor(this.table.element.clientWidth/100*parseInt(e))),e=Math.max(this.minWidth,e),this.maxWidth&&(e=Math.min(this.maxWidth,e)),this.width=e,this.widthStyled=e?e+"px":"",this.element.style.width=this.widthStyled,this.isGroup||this.cells.forEach((function(e){e.setWidth()})),this.parent.isGroup&&this.parent.matchChildWidths(),this.dispatch("column-width",this)}checkCellHeights(){var e=[];this.cells.forEach((function(t){t.row.heightInitialized&&(null!==t.row.getElement().offsetParent?(e.push(t.row),t.row.clearCellHeight()):t.row.heightInitialized=!1)})),e.forEach((function(e){e.calcHeight()})),e.forEach((function(e){e.setCellHeight()}))}getWidth(){var e=0;return this.isGroup?this.columns.forEach((function(t){t.visible&&(e+=t.getWidth())})):e=this.width,e}getHeight(){return Math.ceil(this.element.getBoundingClientRect().height)}setMinWidth(e){this.minWidth=e,this.minWidthStyled=e?e+"px":"",this.element.style.minWidth=this.minWidthStyled,this.cells.forEach((function(e){e.setMinWidth()}))}setMaxWidth(e){this.maxWidth=e,this.maxWidthStyled=e?e+"px":"",this.element.style.maxWidth=this.maxWidthStyled,this.cells.forEach((function(e){e.setMaxWidth()}))}delete(){return new Promise(((e,t)=>{this.isGroup&&this.columns.forEach((function(e){e.delete()})),this.dispatch("column-delete",this);var i=this.cells.length;for(let e=0;e-1&&this._nextVisibleColumn(e+1)}_nextVisibleColumn(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._nextVisibleColumn(e+1)}prevColumn(){var e=this.table.columnManager.findColumnIndex(this);return e>-1&&this._prevVisibleColumn(e-1)}_prevVisibleColumn(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._prevVisibleColumn(e-1)}reinitializeWidth(e){this.widthFixed=!1,void 0===this.definition.width||e||this.setWidth(this.definition.width),this.dispatch("column-width-fit-before",this),this.fitToData(e),this.dispatch("column-width-fit-after",this)}fitToData(e){if(!this.isGroup){this.widthFixed||(this.element.style.width="",this.cells.forEach((e=>{e.clearWidth()})));var t=this.element.offsetWidth;if((!this.width||!this.widthFixed)&&(this.cells.forEach((e=>{var i=e.getWidth();i>t&&(t=i)})),t)){var i=t+1;this.maxInitialWidth&&!e&&(i=Math.min(i,this.maxInitialWidth)),this.setWidthActual(i)}}}updateDefinition(e){var t;return this.isGroup||this.parent.isGroup?(console.error("Column Update Error - The updateDefinition function is only available on ungrouped columns"),Promise.reject("Column Update Error - The updateDefinition function is only available on columns, not column groups")):(t=Object.assign({},this.getDefinition()),t=Object.assign(t,e),this.table.columnManager.addColumn(t,!1,this).then((e=>(t.field==this.field&&(this.field=!1),this.delete().then((()=>e.getComponent()))))))}deleteCell(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}getComponent(){return this.component||(this.component=new b(this)),this.component}}v.defaultOptionList=f;class w{constructor(e){return this._row=e,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._row.table.componentFunctionBinder.handle("row",e._row,t)}})}getData(e){return this._row.getData(e)}getElement(){return this._row.getElement()}getCells(){var e=[];return this._row.getCells().forEach((function(t){e.push(t.getComponent())})),e}getCell(e){var t=this._row.getCell(e);return!!t&&t.getComponent()}getIndex(){return this._row.getData("data")[this._row.table.options.index]}getPosition(e){return this._row.table.rowManager.getRowPosition(this._row,e)}delete(){return this._row.delete()}scrollTo(){return this._row.table.rowManager.scrollToRow(this._row)}move(e,t){this._row.moveToRow(e,t)}update(e){return this._row.updateData(e)}normalizeHeight(){this._row.normalizeHeight(!0)}_getSelf(){return this._row}reformat(){return this._row.reinitialize()}getTable(){return this._row.table}getNextRow(){var e=this._row.nextRow();return e?e.getComponent():e}getPrevRow(){var e=this._row.prevRow();return e?e.getComponent():e}}class C extends e{constructor(e,t,i="row"){super(t.table),this.parent=t,this.data={},this.type=i,this.element=!1,this.modules={},this.cells=[],this.height=0,this.heightStyled="",this.manualHeight=!1,this.outerHeight=0,this.initialized=!1,this.heightInitialized=!1,this.component=null,this.created=!1,this.setData(e)}create(){this.created||(this.created=!0,this.generateElement())}createElement(){var e=document.createElement("div");e.classList.add("tabulator-row"),e.setAttribute("role","row"),this.element=e}getElement(){return this.create(),this.element}detachElement(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}generateElement(){this.createElement(),this.dispatch("row-init",this)}generateCells(){this.cells=this.table.columnManager.generateCells(this)}initialize(e){if(this.create(),!this.initialized||e){for(this.deleteCells();this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.dispatch("row-layout-before",this),this.generateCells(),this.initialized=!0,this.table.columnManager.renderer.renderRowCells(this),e&&this.normalizeHeight(),this.dispatch("row-layout",this),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent()),this.dispatch("row-layout-after",this)}else this.table.columnManager.renderer.rerenderRowCells(this)}reinitializeHeight(){this.heightInitialized=!1,this.element&&null!==this.element.offsetParent&&this.normalizeHeight(!0)}deinitialize(){this.initialized=!1}deinitializeHeight(){this.heightInitialized=!1}reinitialize(e){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),this.element&&null!==this.element.offsetParent&&this.initialize(!0),this.dispatch("row-relayout",this)}calcHeight(e){var t,i=0;this.table.options.rowHeight?this.height=this.table.options.rowHeight:(t=this.table.options.resizableRows?this.element.clientHeight:0,this.cells.forEach((function(e){var t=e.getHeight();t>i&&(i=t)})),this.height=e?Math.max(i,t):this.manualHeight?this.height:Math.max(i,t)),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight}setCellHeight(){this.cells.forEach((function(e){e.setHeight()})),this.heightInitialized=!0}clearCellHeight(){this.cells.forEach((function(e){e.clearHeight()}))}normalizeHeight(e){e&&!this.table.options.rowHeight&&this.clearCellHeight(),this.calcHeight(e),this.setCellHeight()}setHeight(e,t){(this.height!=e||t)&&(this.manualHeight=!0,this.height=e,this.heightStyled=e?e+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight)}getHeight(){return this.outerHeight}getWidth(){return this.element.offsetWidth}deleteCell(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}setData(e){this.data=this.chain("row-data-init-before",[this,e],void 0,e),this.dispatch("row-data-init-after",this)}updateData(e){var i,s=this.element&&t.elVisible(this.element),o={};return new Promise(((t,n)=>{for(var r in"string"==typeof e&&(e=JSON.parse(e)),this.dispatch("row-data-save-before",this),this.subscribed("row-data-changing")&&(o=Object.assign(o,this.data),o=Object.assign(o,e)),i=this.chain("row-data-changing",[this,o,e],null,e))this.data[r]=i[r];for(var r in this.dispatch("row-data-save-after",this),e){this.table.columnManager.getColumnsByFieldRoot(r).forEach((e=>{let t=this.getCell(e.getField());if(t){let o=e.getFieldValue(i);t.getValue()!=o&&(t.setValueProcessData(o),s&&t.cellRendered())}}))}s?(this.normalizeHeight(!0),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent())):(this.initialized=!1,this.height=0,this.heightStyled=""),this.dispatch("row-data-changed",this,s,e),this.dispatchExternal("rowUpdated",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),t()}))}getData(e){return e?this.chain("row-data-retrieve",[this,e],null,this.data):this.data}getCell(e){return e=this.table.columnManager.findColumn(e),this.initialized||this.generateCells(),this.cells.find((function(t){return t.column===e}))}getCellIndex(e){return this.cells.findIndex((function(t){return t===e}))}findCell(e){return this.cells.find((t=>t.element===e))}getCells(){return this.initialized||this.generateCells(),this.cells}nextRow(){return this.table.rowManager.nextDisplayRow(this,!0)||!1}prevRow(){return this.table.rowManager.prevDisplayRow(this,!0)||!1}moveToRow(e,t){var i=this.table.rowManager.findRow(e);i?(this.table.rowManager.moveRowActual(this,i,!t),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",e)}delete(){return this.dispatch("row-delete",this),this.deleteActual(),Promise.resolve()}deleteActual(e){this.table.rowManager.getRowIndex(this);this.detatchModules(),this.table.rowManager.deleteRow(this,e),this.deleteCells(),this.initialized=!1,this.heightInitialized=!1,this.element=!1,this.dispatch("row-deleted",this)}detatchModules(){this.dispatch("row-deleting",this)}deleteCells(){var e=this.cells.length;for(let t=0;ts||null===s)&&(s=e)})),null!==s?!1!==o?s.toFixed(o):s:""},min:function(e,t,i){var s=null,o=void 0!==i.precision&&i.precision;return e.forEach((function(e){((e=Number(e)){this.recalcGroup(e)})))}recalcGroup(e){var t,i;e&&e.calcs&&(e.calcs.bottom&&(t=this.rowsToData(e.rows),i=this.generateRowData("bottom",t),e.calcs.bottom.updateData(i),e.calcs.bottom.reinitialize()),e.calcs.top&&(t=this.rowsToData(e.rows),i=this.generateRowData("top",t),e.calcs.top.updateData(i),e.calcs.top.reinitialize()))}generateTopRow(e){return this.generateRow("top",this.rowsToData(e))}generateBottomRow(e){return this.generateRow("bottom",this.rowsToData(e))}rowsToData(e){var t=[];return e.forEach((e=>{if(t.push(e.getData()),this.table.options.dataTree&&this.table.options.dataTreeChildColumnCalcs&&e.modules.dataTree&&e.modules.dataTree.open){var i=this.rowsToData(this.table.modules.dataTree.getFilteredTreeChildren(e));t=t.concat(i)}})),t}generateRow(e,t){var i,s=this.generateRowData(e,t);return this.table.modExists("mutator")&&this.table.modules.mutator.disable(),i=new C(s,this,"calc"),this.table.modExists("mutator")&&this.table.modules.mutator.enable(),i.getElement().classList.add("tabulator-calcs","tabulator-calcs-"+e),i.component=!1,i.getComponent=()=>(i.component||(i.component=new m(i)),i.component),i.generateCells=()=>{var t=[];this.table.columnManager.columnsByIndex.forEach((s=>{this.genColumn.setField(s.getField()),this.genColumn.hozAlign=s.hozAlign,s.definition[e+"CalcFormatter"]&&this.table.modExists("format")?this.genColumn.modules.format={formatter:this.table.modules.format.getFormatter(s.definition[e+"CalcFormatter"]),params:s.definition[e+"CalcFormatterParams"]||{}}:this.genColumn.modules.format={formatter:this.table.modules.format.getFormatter("plaintext"),params:{}},this.genColumn.definition.cssClass=s.definition.cssClass;var o=new g(this.genColumn,i);o.getElement(),o.column=s,o.setWidth(),s.cells.push(o),t.push(o),s.visible||o.hide()})),i.cells=t},i}generateRowData(e,t){var i,s,o={},n="top"==e?this.topCalcs:this.botCalcs,r="top"==e?"topCalc":"botCalc";return n.forEach((function(e){var n=[];e.modules.columnCalcs&&e.modules.columnCalcs[r]&&(t.forEach((function(t){n.push(e.getFieldValue(t))})),s=r+"Params",i="function"==typeof e.modules.columnCalcs[s]?e.modules.columnCalcs[s](n,t):e.modules.columnCalcs[s],e.setFieldValue(o,e.modules.columnCalcs[r](n,t,i)))})),o}hasTopCalcs(){return!!this.topCalcs.length}hasBottomCalcs(){return!!this.botCalcs.length}redraw(){this.topRow&&this.topRow.normalizeHeight(!0),this.botRow&&this.botRow.normalizeHeight(!0)}getResults(){var e={};return this.table.options.groupBy&&this.table.modExists("groupRows")?this.table.modules.groupRows.getGroups(!0).forEach((t=>{e[t.getKey()]=this.getGroupResults(t)})):e={top:this.topRow?this.topRow.getData():{},bottom:this.botRow?this.botRow.getData():{}},e}getGroupResults(e){var t=e._getSelf(),i=e.getSubGroups(),s={};return i.forEach((e=>{s[e.getKey()]=this.getGroupResults(e)})),{top:t.calcs.top?t.calcs.top.getData():{},bottom:t.calcs.bottom?t.calcs.bottom.getData():{},groups:s}}}y.moduleName="columnCalcs",y.calculations=E;class R extends o{constructor(e){super(e),this.indent=10,this.field="",this.collapseEl=null,this.expandEl=null,this.branchEl=null,this.elementField=!1,this.startOpen=function(){},this.displayIndex=0,this.registerTableOption("dataTree",!1),this.registerTableOption("dataTreeFilter",!0),this.registerTableOption("dataTreeSort",!0),this.registerTableOption("dataTreeElementColumn",!1),this.registerTableOption("dataTreeBranchElement",!0),this.registerTableOption("dataTreeChildIndent",9),this.registerTableOption("dataTreeChildField","_children"),this.registerTableOption("dataTreeCollapseElement",!1),this.registerTableOption("dataTreeExpandElement",!1),this.registerTableOption("dataTreeStartExpanded",!1),this.registerTableOption("dataTreeChildColumnCalcs",!1),this.registerTableOption("dataTreeSelectPropagate",!1),this.registerComponentFunction("row","treeCollapse",this.collapseRow.bind(this)),this.registerComponentFunction("row","treeExpand",this.expandRow.bind(this)),this.registerComponentFunction("row","treeToggle",this.toggleRow.bind(this)),this.registerComponentFunction("row","getTreeParent",this.getTreeParent.bind(this)),this.registerComponentFunction("row","getTreeChildren",this.getRowChildren.bind(this)),this.registerComponentFunction("row","addTreeChild",this.addTreeChildRow.bind(this)),this.registerComponentFunction("row","isTreeExpanded",this.isRowExpanded.bind(this))}initialize(){if(this.table.options.dataTree){var e=null,t=this.table.options;switch(this.field=t.dataTreeChildField,this.indent=t.dataTreeChildIndent,t.dataTreeBranchElement&&(!0===t.dataTreeBranchElement?(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch")):"string"==typeof t.dataTreeBranchElement?((e=document.createElement("div")).innerHTML=t.dataTreeBranchElement,this.branchEl=e.firstChild):this.branchEl=t.dataTreeBranchElement),t.dataTreeCollapseElement?"string"==typeof t.dataTreeCollapseElement?((e=document.createElement("div")).innerHTML=t.dataTreeCollapseElement,this.collapseEl=e.firstChild):this.collapseEl=t.dataTreeCollapseElement:(this.collapseEl=document.createElement("div"),this.collapseEl.classList.add("tabulator-data-tree-control"),this.collapseEl.tabIndex=0,this.collapseEl.innerHTML="
"),t.dataTreeExpandElement?"string"==typeof t.dataTreeExpandElement?((e=document.createElement("div")).innerHTML=t.dataTreeExpandElement,this.expandEl=e.firstChild):this.expandEl=t.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.tabIndex=0,this.expandEl.innerHTML="
"),typeof t.dataTreeStartExpanded){case"boolean":this.startOpen=function(e,i){return t.dataTreeStartExpanded};break;case"function":this.startOpen=t.dataTreeStartExpanded;break;default:this.startOpen=function(e,i){return t.dataTreeStartExpanded[i]}}this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("row-deleted",this.rowDelete.bind(this),0),this.subscribe("row-data-changed",this.rowDataChanged.bind(this),10),this.subscribe("cell-value-updated",this.cellValueChanged.bind(this)),this.subscribe("edit-cancelled",this.cellValueChanged.bind(this)),this.subscribe("column-moving-rows",this.columnMoving.bind(this)),this.subscribe("table-built",this.initializeElementField.bind(this)),this.subscribe("table-redrawing",this.tableRedrawing.bind(this)),this.registerDisplayHandler(this.getRows.bind(this),30)}}tableRedrawing(e){e&&this.table.rowManager.getRows().forEach((e=>{this.reinitializeRowChildren(e)}))}initializeElementField(){var e=this.table.columnManager.getFirstVisibleColumn();this.elementField=this.table.options.dataTreeElementColumn||!!e&&e.field}getRowChildren(e){return this.getTreeChildren(e,!0)}columnMoving(){var e=[];return this.table.rowManager.rows.forEach((t=>{e=e.concat(this.getTreeChildren(t,!1,!0))})),e}rowDataChanged(e,t,i){this.redrawNeeded(i)&&(this.initializeRow(e),t&&(this.layoutRow(e),this.refreshData(!0)))}cellValueChanged(e){e.column.getField()===this.elementField&&this.layoutRow(e.row)}initializeRow(e){var t=e.getData()[this.field],i=Array.isArray(t),s=i||!i&&"object"==typeof t&&null!==t;!s&&e.modules.dataTree&&e.modules.dataTree.branchEl&&e.modules.dataTree.branchEl.parentNode.removeChild(e.modules.dataTree.branchEl),!s&&e.modules.dataTree&&e.modules.dataTree.controlEl&&e.modules.dataTree.controlEl.parentNode.removeChild(e.modules.dataTree.controlEl),e.modules.dataTree={index:e.modules.dataTree?e.modules.dataTree.index:0,open:!!s&&(e.modules.dataTree?e.modules.dataTree.open:this.startOpen(e.getComponent(),0)),controlEl:!(!e.modules.dataTree||!s)&&e.modules.dataTree.controlEl,branchEl:!(!e.modules.dataTree||!s)&&e.modules.dataTree.branchEl,parent:!!e.modules.dataTree&&e.modules.dataTree.parent,children:s}}reinitializeRowChildren(e){this.getTreeChildren(e,!1,!0).forEach((function(e){e.reinitialize(!0)}))}layoutRow(e){var t=(this.elementField?e.getCell(this.elementField):e.getCells()[0]).getElement(),i=e.modules.dataTree;i.branchEl&&(i.branchEl.parentNode&&i.branchEl.parentNode.removeChild(i.branchEl),i.branchEl=!1),i.controlEl&&(i.controlEl.parentNode&&i.controlEl.parentNode.removeChild(i.controlEl),i.controlEl=!1),this.generateControlElement(e,t),e.getElement().classList.add("tabulator-tree-level-"+i.index),i.index&&(this.branchEl?(i.branchEl=this.branchEl.cloneNode(!0),t.insertBefore(i.branchEl,t.firstChild),this.table.rtl?i.branchEl.style.marginRight=(i.branchEl.offsetWidth+i.branchEl.style.marginLeft)*(i.index-1)+i.index*this.indent+"px":i.branchEl.style.marginLeft=(i.branchEl.offsetWidth+i.branchEl.style.marginRight)*(i.index-1)+i.index*this.indent+"px"):this.table.rtl?t.style.paddingRight=parseInt(window.getComputedStyle(t,null).getPropertyValue("padding-right"))+i.index*this.indent+"px":t.style.paddingLeft=parseInt(window.getComputedStyle(t,null).getPropertyValue("padding-left"))+i.index*this.indent+"px")}generateControlElement(e,t){var i=e.modules.dataTree,s=(t=t||e.getCells()[0].getElement(),i.controlEl);!1!==i.children&&(i.open?(i.controlEl=this.collapseEl.cloneNode(!0),i.controlEl.addEventListener("click",(t=>{t.stopPropagation(),this.collapseRow(e)}))):(i.controlEl=this.expandEl.cloneNode(!0),i.controlEl.addEventListener("click",(t=>{t.stopPropagation(),this.expandRow(e)}))),i.controlEl.addEventListener("mousedown",(e=>{e.stopPropagation()})),s&&s.parentNode===t?s.parentNode.replaceChild(i.controlEl,s):t.insertBefore(i.controlEl,t.firstChild))}setDisplayIndex(e){this.displayIndex=e}getDisplayIndex(){return this.displayIndex}getRows(e){var t=[];return e.forEach(((e,i)=>{var s;t.push(e),e instanceof C&&(e.create(),(s=e.modules.dataTree.children).index||!1===s.children||this.getChildren(e).forEach((e=>{e.create(),t.push(e)})))})),t}getChildren(e,t){var i=e.modules.dataTree,s=[],o=[];return!1!==i.children&&(i.open||t)&&(Array.isArray(i.children)||(i.children=this.generateChildren(e)),s=this.table.modExists("filter")&&this.table.options.dataTreeFilter?this.table.modules.filter.filter(i.children):i.children,this.table.modExists("sort")&&this.table.options.dataTreeSort&&this.table.modules.sort.sort(s),s.forEach((e=>{o.push(e),this.getChildren(e).forEach((e=>{o.push(e)}))}))),o}generateChildren(e){var t=[],i=e.getData()[this.field];return Array.isArray(i)||(i=[i]),i.forEach((i=>{var s=new C(i||{},this.table.rowManager);s.create(),s.modules.dataTree.index=e.modules.dataTree.index+1,s.modules.dataTree.parent=e,s.modules.dataTree.children&&(s.modules.dataTree.open=this.startOpen(s.getComponent(),s.modules.dataTree.index)),t.push(s)})),t}expandRow(e,t){var i=e.modules.dataTree;!1!==i.children&&(i.open=!0,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowExpanded",e.getComponent(),e.modules.dataTree.index))}collapseRow(e){var t=e.modules.dataTree;!1!==t.children&&(t.open=!1,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowCollapsed",e.getComponent(),e.modules.dataTree.index))}toggleRow(e){var t=e.modules.dataTree;!1!==t.children&&(t.open?this.collapseRow(e):this.expandRow(e))}isRowExpanded(e){return e.modules.dataTree.open}getTreeParent(e){return!!e.modules.dataTree.parent&&e.modules.dataTree.parent.getComponent()}getTreeParentRoot(e){return e.modules.dataTree.parent?this.getTreeParentRoot(e.modules.dataTree.parent):e}getFilteredTreeChildren(e){var t=e.modules.dataTree,i=[];return t.children&&(Array.isArray(t.children)||(t.children=this.generateChildren(e)),(this.table.modExists("filter")&&this.table.options.dataTreeFilter?this.table.modules.filter.filter(t.children):t.children).forEach((e=>{e instanceof C&&i.push(e)}))),i}rowDelete(e){var t,i=e.modules.dataTree.parent;i&&(!1!==(t=this.findChildIndex(e,i))&&i.data[this.field].splice(t,1),i.data[this.field].length||delete i.data[this.field],this.initializeRow(i),this.layoutRow(i)),this.refreshData(!0)}addTreeChildRow(e,t,i,s){var o=!1;"string"==typeof t&&(t=JSON.parse(t)),Array.isArray(e.data[this.field])||(e.data[this.field]=[],e.modules.dataTree.open=this.startOpen(e.getComponent(),e.modules.dataTree.index)),void 0!==s&&!1!==(o=this.findChildIndex(s,e))&&e.data[this.field].splice(i?o:o+1,0,t),!1===o&&(i?e.data[this.field].unshift(t):e.data[this.field].push(t)),this.initializeRow(e),this.layoutRow(e),this.refreshData(!0)}findChildIndex(e,t){var i=!1;return"object"==typeof e?e instanceof C?i=e.data:e instanceof RowComponent?i=e._getSelf().data:"undefined"!=typeof HTMLElement&&e instanceof HTMLElement&&t.modules.dataTree&&(i=t.modules.dataTree.children.find((t=>t instanceof C&&t.element===e)))&&(i=i.data):i=null!=e&&t.data[this.field].find((t=>t.data[this.table.options.index]==e)),i&&(Array.isArray(t.data[this.field])&&(i=t.data[this.field].indexOf(i)),-1==i&&(i=!1)),i}getTreeChildren(e,t,i){var s=e.modules.dataTree,o=[];return s.children&&(Array.isArray(s.children)||(s.children=this.generateChildren(e)),s.children.forEach((e=>{e instanceof C&&(o.push(t?e.getComponent():e),i&&(o=o.concat(this.getTreeChildren(e,t,i))))}))),o}getChildField(){return this.field}redrawNeeded(e){return!!this.field&&void 0!==e[this.field]||!!this.elementField&&void 0!==e[this.elementField]}}R.moduleName="dataTree";var x={csv:function(e,t,i){var s=t&&t.delimiter?t.delimiter:",",o=[],n=[];e.forEach((e=>{var t=[];switch(e.type){case"group":console.warn("Download Warning - CSV downloader cannot process row groups");break;case"calc":console.warn("Download Warning - CSV downloader cannot process column calculations");break;case"header":e.columns.forEach(((e,t)=>{e&&1===e.depth&&(n[t]=void 0===e.value||null===e.value?"":'"'+String(e.value).split('"').join('""')+'"')}));break;case"row":e.columns.forEach((e=>{if(e){switch(typeof e.value){case"object":e.value=JSON.stringify(e.value);break;case"undefined":case"null":e.value=""}t.push('"'+String(e.value).split('"').join('""')+'"')}})),o.push(t.join(s))}})),n.length&&o.unshift(n.join(s)),o=o.join("\n"),t.bom&&(o="\ufeff"+o),i(o,"text/csv")},json:function(e,t,i){var s=[];e.forEach((e=>{var t={};switch(e.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":e.columns.forEach((e=>{e&&(t[e.component.getTitleDownload()||e.component.getField()]=e.value)})),s.push(t)}})),i(s=JSON.stringify(s,null,"\t"),"application/json")},jsonLines:function(e,t,i){const s=[];e.forEach((e=>{const t={};switch(e.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":e.columns.forEach((e=>{e&&(t[e.component.getTitleDownload()||e.component.getField()]=e.value)})),s.push(JSON.stringify(t))}})),i(s.join("\n"),"application/x-ndjson")},pdf:function(e,t,i){var s=[],o=[],n={},r=t.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},a=t.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},l=t.jsPDF||{},h=t&&t.title?t.title:"";function d(e,t){var i=[];return e.columns.forEach((e=>{var s;if(e){switch(typeof e.value){case"object":e.value=JSON.stringify(e.value);break;case"undefined":case"null":e.value=""}s={content:e.value,colSpan:e.width,rowSpan:e.height},t&&(s.styles=t),i.push(s)}})),i}l.orientation||(l.orientation=t.orientation||"landscape"),l.unit||(l.unit="pt"),e.forEach((e=>{switch(e.type){case"header":s.push(d(e));break;case"group":o.push(d(e,r));break;case"calc":o.push(d(e,a));break;case"row":o.push(d(e))}}));var c=new jspdf.jsPDF(l);t&&t.autoTable&&(n="function"==typeof t.autoTable?t.autoTable(c)||{}:t.autoTable),h&&(n.didDrawPage=function(e){c.text(h,40,30)}),n.head=s,n.body=o,c.autoTable(n),t&&t.documentProcessing&&t.documentProcessing(c),i(c.output("arraybuffer"),"application/pdf")},xlsx:function(t,i,s){var o=i.sheetName||"Sheet1",n=XLSX.utils.book_new(),r=new e(this);function a(){var e=[],i=[],s={},o={s:{c:0,r:0},e:{c:t[0]?t[0].columns.reduce(((e,t)=>e+(t&&t.width?t.width:1)),0):0,r:t.length}};return t.forEach(((t,s)=>{var o=[];t.columns.forEach((function(e,t){e?(o.push(e.value instanceof Date||"object"!=typeof e.value?e.value:JSON.stringify(e.value)),(e.width>1||e.height>-1)&&(e.height>1||e.width>1)&&i.push({s:{r:s,c:t},e:{r:s+e.height-1,c:t+e.width-1}})):o.push("")})),e.push(o)})),XLSX.utils.sheet_add_aoa(s,e),s["!ref"]=XLSX.utils.encode_range(o),i.length&&(s["!merges"]=i),s}if(n.SheetNames=[],n.Sheets={},i.sheetOnly)s(a());else{if(i.sheets)for(var l in i.sheets)!0===i.sheets[l]?(n.SheetNames.push(l),n.Sheets[l]=a()):(n.SheetNames.push(l),r.commsSend(i.sheets[l],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},active:this.active,intercept:function(e){n.Sheets[l]=e}}));else n.SheetNames.push(o),n.Sheets[o]=a();i.documentProcessing&&(n=i.documentProcessing(n)),s(function(e){for(var t=new ArrayBuffer(e.length),i=new Uint8Array(t),s=0;s!=e.length;++s)i[s]=255&e.charCodeAt(s);return t}(XLSX.write(n,{bookType:"xlsx",bookSST:!0,type:"binary"})),"application/octet-stream")}},html:function(e,t,i){this.modExists("export",!0)&&i(this.modules.export.genereateHTMLTable(e),"text/html")}};class T extends o{constructor(e){super(e),this.registerTableOption("downloadReady",(function(e,t){return t})),this.registerTableOption("downloadConfig",{}),this.registerTableOption("downloadRowRange","active"),this.registerColumnOption("download"),this.registerColumnOption("titleDownload")}initialize(){this.registerTableFunction("download",this.download.bind(this)),this.registerTableFunction("downloadToTab",this.downloadToTab.bind(this))}downloadToTab(e,t,i,s){this.download(e,t,i,s,!0)}download(e,t,i,s,o){var n=!1;if("function"==typeof e?n=e:T.downloaders[e]?n=T.downloaders[e]:console.warn("Download Error - No such download type found: ",e),n){var r=this.generateExportList(s);n.call(this.table,r,i||{},function(i,s){o?!0===o?this.triggerDownload(i,s,e,t,!0):o(i):this.triggerDownload(i,s,e,t)}.bind(this))}}generateExportList(e){var t=this.table.modules.export.generateExportList(this.table.options.downloadConfig,!1,e||this.table.options.downloadRowRange,"download"),i=this.table.options.groupHeaderDownload;return i&&!Array.isArray(i)&&(i=[i]),t.forEach((e=>{var t;"group"===e.type&&(t=e.columns[0],i&&i[e.indent]&&(t.value=i[e.indent](t.value,e.component._group.getRowCount(),e.component._group.getData(),e.component)))})),t}triggerDownload(e,t,i,s,o){var n=document.createElement("a"),r=new Blob([e],{type:t});s=s||"Tabulator."+("function"==typeof i?"txt":i);(r=this.table.options.downloadReady(e,r))&&(o?window.open(window.URL.createObjectURL(r)):navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(r,s):(n.setAttribute("href",window.URL.createObjectURL(r)),n.setAttribute("download",s),n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n)),this.dispatchExternal("downloadComplete"))}commsReceived(e,t,i){switch(t){case"intercept":this.download(i.type,"",i.options,i.active,i.intercept)}}}function M(e,t){var i=t.mask,s=void 0!==t.maskLetterChar?t.maskLetterChar:"A",o=void 0!==t.maskNumberChar?t.maskNumberChar:"9",n=void 0!==t.maskWildcardChar?t.maskWildcardChar:"*";function r(t){var a=i[t];void 0!==a&&a!==n&&a!==s&&a!==o&&(e.value=e.value+""+a,r(t+1))}e.addEventListener("keydown",(t=>{var r=e.value.length,a=t.key;if(t.keyCode>46){if(r>=i.length)return t.preventDefault(),t.stopPropagation(),!1;switch(i[r]){case s:if(a.toUpperCase()==a.toLowerCase())return t.preventDefault(),t.stopPropagation(),!1;break;case o:if(isNaN(a))return t.preventDefault(),t.stopPropagation(),!1;break;case n:break;default:if(a!==i[r])return t.preventDefault(),t.stopPropagation(),!1}}})),e.addEventListener("keyup",(i=>{i.keyCode>46&&t.maskAutoFill&&r(e.value.length)})),e.placeholder||(e.placeholder=i),t.maskAutoFill&&r(e.value.length)}T.moduleName="download",T.downloaders=x;class L{constructor(e,t,i,s,o,n){this.edit=e,this.table=e.table,this.cell=t,this.params=this._initializeParams(n),this.data=[],this.displayItems=[],this.currentItems=[],this.focusedItem=null,this.input=this._createInputElement(),this.listEl=this._createListElement(),this.initialValues=null,this.isFilter=!t._getSelf,this.filterTimeout=null,this.filtered=!1,this.typing=!1,this.values=[],this.popup=null,this.listIteration=0,this.blurable=!0,this.actions={success:s,cancel:o},this._deprecationCheck(),this._initializeValue(),i(this._onRendered.bind(this))}_deprecationCheck(){this.params.listItemFormatter&&console.warn("The listItemFormatter editor param has been deprecated, please see the latest editor documentation for updated options"),this.params.sortValuesList&&console.warn("The sortValuesList editor param has been deprecated, please see the latest editor documentation for updated options"),this.params.searchFunc&&console.warn("The searchFunc editor param has been deprecated, please see the latest editor documentation for updated options"),this.params.searchingPlaceholder&&console.warn("The searchingPlaceholder editor param has been deprecated, please see the latest editor documentation for updated options")}_initializeValue(){var e=this.cell.getValue();void 0===e&&void 0!==this.params.defaultValue&&(e=this.params.defaultValue),this.initialValues=this.params.multiselect?e:[e],this.isFilter&&(this.input.value=this.initialValues.join(","),this.headerFilterInitialListGen())}_onRendered(){var e=this.cell.getElement();function t(e){e.stopPropagation()}this.input.style.height="100%",this.input.focus({preventScroll:!0}),e.addEventListener("click",t),setTimeout((()=>{e.removeEventListener("click",t)}),1e3)}_createListElement(){var e=document.createElement("div");return e.classList.add("tabulator-edit-list"),e.addEventListener("mousedown",this._preventBlur.bind(this)),e.addEventListener("keydown",this._inputKeyDown.bind(this)),e}_setListWidth(){var e=this.isFilter?this.input:this.cell.getElement();this.listEl.style.minWidth=e.offsetWidth+"px",this.params.maxWidth&&(!0===this.params.maxWidth?this.listEl.style.maxWidth=e.offsetWidth+"px":"number"==typeof this.params.maxWidth?this.listEl.style.maxWidth=this.params.maxWidth+"px":this.listEl.style.maxWidth=this.params.maxWidth)}_createInputElement(){var e=this.params.elementAttributes,t=document.createElement("input");if(t.setAttribute("type",this.params.clearable?"search":"text"),t.style.padding="4px",t.style.width="100%",t.style.boxSizing="border-box",this.params.autocomplete||(t.style.cursor="default",t.style.caretColor="transparent"),e&&"object"==typeof e)for(let i in e)"+"==i.charAt(0)?(i=i.slice(1),t.setAttribute(i,t.getAttribute(i)+e["+"+i])):t.setAttribute(i,e[i]);return this.params.mask&&M(t,this.params),this._bindInputEvents(t),t}_initializeParams(e){var t,i=["values","valuesURL","valuesLookup"];return(e=Object.assign({},e)).verticalNavigation=e.verticalNavigation||"editor",e.placeholderLoading=void 0===e.placeholderLoading?"Searching ...":e.placeholderLoading,e.placeholderEmpty=void 0===e.placeholderEmpty?"No Results Found":e.placeholderEmpty,e.filterDelay=void 0===e.filterDelay?300:e.filterDelay,e.emptyValue=Object.keys(e).includes("emptyValue")?e.emptyValue:"",(t=Object.keys(e).filter((e=>i.includes(e))).length)?t>1&&console.warn("list editor config error - only one of the values, valuesURL, or valuesLookup options can be set on the same editor"):console.warn("list editor config error - either the values, valuesURL, or valuesLookup option must be set"),e.autocomplete?e.multiselect&&(e.multiselect=!1,console.warn("list editor config error - multiselect option is not available when autocomplete is enabled")):(e.freetext&&(e.freetext=!1,console.warn("list editor config error - freetext option is only available when autocomplete is enabled")),e.filterFunc&&(e.filterFunc=!1,console.warn("list editor config error - filterFunc option is only available when autocomplete is enabled")),e.filterRemote&&(e.filterRemote=!1,console.warn("list editor config error - filterRemote option is only available when autocomplete is enabled")),e.mask&&(e.mask=!1,console.warn("list editor config error - mask option is only available when autocomplete is enabled")),e.allowEmpty&&(e.allowEmpty=!1,console.warn("list editor config error - allowEmpty option is only available when autocomplete is enabled")),e.listOnEmpty&&(e.listOnEmpty=!1,console.warn("list editor config error - listOnEmpty option is only available when autocomplete is enabled"))),e.filterRemote&&"function"!=typeof e.valuesLookup&&(e.valuesURL,0)&&(e.filterRemote=!1,console.warn("list editor config error - filterRemote option should only be used when values list is populated from a remote source")),e}_bindInputEvents(e){e.addEventListener("focus",this._inputFocus.bind(this)),e.addEventListener("click",this._inputClick.bind(this)),e.addEventListener("blur",this._inputBlur.bind(this)),e.addEventListener("keydown",this._inputKeyDown.bind(this)),e.addEventListener("search",this._inputSearch.bind(this)),this.params.autocomplete&&e.addEventListener("keyup",this._inputKeyUp.bind(this))}_inputFocus(e){this.rebuildOptionsList()}_filter(){this.params.filterRemote?(clearTimeout(this.filterTimeout),this.filterTimeout=setTimeout((()=>{this.rebuildOptionsList()}),this.params.filterDelay)):this._filterList()}_inputClick(e){e.stopPropagation()}_inputBlur(e){this.blurable&&this.popup&&this.popup.hide()}_inputSearch(){this._clearChoices()}_inputKeyDown(e){switch(e.keyCode){case 38:this._keyUp(e);break;case 40:this._keyDown(e);break;case 37:case 39:this._keySide(e);break;case 13:this._keyEnter();break;case 27:this._keyEsc();break;case 36:case 35:this._keyHomeEnd(e);break;case 9:break;default:this._keySelectLetter(e)}}_inputKeyUp(e){switch(e.keyCode){case 38:case 37:case 39:case 40:case 13:case 27:break;default:this._keyAutoCompLetter(e)}}_preventBlur(){this.blurable=!1,setTimeout((function(){this.blurable=!0}),10)}_keyUp(e){var t=this.displayItems.indexOf(this.focusedItem);("editor"==this.params.verticalNavigation||"hybrid"==this.params.verticalNavigation&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t>0&&this._focusItem(this.displayItems[t-1]))}_keyDown(e){var t=this.displayItems.indexOf(this.focusedItem);("editor"==this.params.verticalNavigation||"hybrid"==this.params.verticalNavigation&&t=38&&e.keyCode<=90&&this._scrollToValue(e.keyCode))}_keyAutoCompLetter(e){this._filter(),this.typing=!0}_scrollToValue(e){clearTimeout(this.filterTimeout);var t=String.fromCharCode(e).toLowerCase();this.filterTerm+=t.toLowerCase();var i=this.displayItems.find((e=>void 0!==e.label&&e.label.toLowerCase().startsWith(this.filterTerm)));i&&this._focusItem(i),this.filterTimeout=setTimeout((()=>{this.filterTerm=""}),800)}_focusItem(e){this.focusedItem&&this.focusedItem.element&&this.focusedItem.element.classList.remove("focused"),this.focusedItem=e,e&&e.element&&(e.element.classList.add("focused"),e.element.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"}))}headerFilterInitialListGen(){this._generateOptions(!0)}rebuildOptionsList(){this._generateOptions().then(this._sortOptions.bind(this)).then(this._buildList.bind(this)).then(this._showList.bind(this)).catch((e=>{Number.isInteger(e)||console.error("List generation error",e)}))}_filterList(){this._buildList(this._filterOptions()),this._showList()}_generateOptions(e){var t=[],i=++this.listIteration;return this.filtered=!1,this.params.values?t=this.params.values:this.params.valuesURL?t=this._ajaxRequest(this.params.valuesURL,this.input.value):"function"==typeof this.params.valuesLookup?t=this.params.valuesLookup(this.cell,this.input.value):this.params.valuesLookup&&(t=this._uniqueColumnValues(this.params.valuesLookupField)),t instanceof Promise?(e||this._addPlaceholder(this.params.placeholderLoading),t.then().then((e=>this.listIteration===i?this._parseList(e):Promise.reject(i)))):Promise.resolve(this._parseList(t))}_addPlaceholder(e){var t=document.createElement("div");"function"==typeof e&&(e=e(cell.getComponent(),this.listEl)),e&&(this._clearList(),e instanceof HTMLElement?t=e:(t.classList.add("tabulator-edit-list-placeholder"),t.innerHTML=e),this.listEl.appendChild(t),this._showList())}_ajaxRequest(e,t){return e=l(e,{},this.params.filterRemote?{term:t}:{}),fetch(e).then((e=>e.ok?e.json().catch((e=>(console.warn("List Ajax Load Error - Invalid JSON returned",e),Promise.reject(e)))):(console.error("List Ajax Load Error - Connection Error: "+e.status,e.statusText),Promise.reject(e)))).catch((e=>(console.error("List Ajax Load Error - Connection Error: ",e),Promise.reject(e))))}_uniqueColumnValues(e){var t,i={},s=this.table.getData(this.params.valuesLookup);return(t=e?this.table.columnManager.getColumnByField(e):this.cell.getColumn()._getSelf())?s.forEach((e=>{var s=t.getFieldValue(e);null!=s&&""!==s&&(i[s]=!0)})):(console.warn("unable to find matching column to create select lookup list:",e),i=[]),Object.keys(i)}_parseList(e){var t=[];return Array.isArray(e)||(e=Object.entries(e).map((([e,t])=>({label:t,value:e})))),e.forEach((e=>{"object"!=typeof e&&(e={label:e,value:e}),this._parseListItem(e,t,0)})),this.data=t,t}_parseListItem(e,t,i){var s={};e.options?s=this._parseListGroup(e,i+1):(s={label:e.label,value:e.value,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1,selected:!1,visible:!0,level:i,original:e},this.initialValues&&this.initialValues.indexOf(e.value)>-1&&this._chooseItem(s,!0)),t.push(s)}_parseListGroup(e,t){var i={label:e.label,group:!0,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1,visible:!0,level:t,options:[],original:e};return e.options.forEach((e=>{this._parseListItem(e,i.options,t)})),i}_sortOptions(e){var t;return this.params.sort&&(t="function"==typeof this.params.sort?this.params.sort:this._defaultSortFunction.bind(this),this._sortGroup(t,e)),e}_sortGroup(e,t){t.sort(((t,i)=>e(t.label,i.label,t.value,i.value,t.original,i.original))),t.forEach((t=>{t.group&&this._sortGroup(e,t.options)}))}_defaultSortFunction(e,t){var i,s,o,n,r,a=0,l=/(\d+)|(\D+)/g,h=/\d/,d=0;if("desc"===this.params.sort&&([e,t]=[t,e]),e||0===e){if(t||0===t){if(isFinite(e)&&isFinite(t))return e-t;if((i=String(e).toLowerCase())===(s=String(t).toLowerCase()))return 0;if(!h.test(i)||!h.test(s))return i>s?1:-1;for(i=i.match(l),s=s.match(l),r=i.length>s.length?s.length:i.length;an?1:-1;return i.length>s.length}d=1}else d=t||0===t?-1:0;return d}_filterOptions(){var e=this.params.filterFunc||this._defaultFilterFunc,t=this.input.value;return t?(this.filtered=!0,this.data.forEach((i=>{this._filterItem(e,t,i)}))):this.filtered=!1,this.data}_filterItem(e,t,i){var s=!1;return i.group?(i.options.forEach((i=>{this._filterItem(e,t,i)&&(s=!0)})),i.visible=s):i.visible=e(t,i.label,i.value,i.original),i.visible}_defaultFilterFunc(e,t,i,s){e=String(e).toLowerCase();return(null!==t||void 0!==t)&&(String(t).toLowerCase().indexOf(e)>-1||String(i).toLowerCase(e).indexOf()>-1)}_clearList(){for(;this.listEl.firstChild;)this.listEl.removeChild(this.listEl.firstChild);this.displayItems=[]}_buildList(e){this._clearList(),e.forEach((e=>{this._buildItem(e)})),this.displayItems.length||this._addPlaceholder(this.params.placeholderEmpty)}_buildItem(e){var t,i=e.element;if(!this.filtered||e.visible){if(!i){if((i=document.createElement("div")).tabIndex=0,(t=this.params.itemFormatter?this.params.itemFormatter(e.label,e.value,e.original,i):e.label)instanceof HTMLElement?i.appendChild(t):i.innerHTML=t,e.group?i.classList.add("tabulator-edit-list-group"):i.classList.add("tabulator-edit-list-item"),i.classList.add("tabulator-edit-list-group-level-"+e.level),e.elementAttributes&&"object"==typeof e.elementAttributes)for(let t in e.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),i.setAttribute(t,this.input.getAttribute(t)+e.elementAttributes["+"+t])):i.setAttribute(t,e.elementAttributes[t]);e.group?i.addEventListener("click",this._groupClick.bind(this,e)):i.addEventListener("click",this._itemClick.bind(this,e)),i.addEventListener("mousedown",this._preventBlur.bind(this)),e.element=i}this._styleItem(e),this.listEl.appendChild(i),e.group?e.options.forEach((e=>{this._buildItem(e)})):this.displayItems.push(e)}}_showList(){var e=this.popup&&this.popup.isVisible();if(this.input.parentNode){if(this.params.autocomplete&&""===this.input.value&&!this.params.listOnEmpty&&this.popup)return void this.popup.hide(!0);this._setListWidth(),this.popup||(this.popup=this.edit.popup(this.listEl)),this.popup.show(this.cell.getElement(),"bottom"),e||this.popup.hideOnBlur(this._resolveValue.bind(this,!0))}}_styleItem(e){e&&e.element&&(e.selected?e.element.classList.add("active"):e.element.classList.remove("active"))}_itemClick(e,t){t.stopPropagation(),this._chooseItem(e)}_groupClick(e,t){t.stopPropagation()}_cancel(){this.popup.hide(!0),this.actions.cancel()}_clearChoices(){this.typing=!0,this.currentItems.forEach((e=>{e.selected=!1,this._styleItem(e)})),this.currentItems=[],this.focusedItem=null}_chooseItem(e,t){var i;this.typing=!1,this.params.multiselect?((i=this.currentItems.indexOf(e))>-1?(this.currentItems.splice(i,1),e.selected=!1):(this.currentItems.push(e),e.selected=!0),this.input.value=this.currentItems.map((e=>e.label)).join(","),this._styleItem(e)):(this.currentItems=[e],e.selected=!0,this.input.value=e.label,this._styleItem(e),t||this._resolveValue()),this._focusItem(e)}_resolveValue(e){var t,i;if(this.popup.hide(!0),this.params.multiselect)t=this.currentItems.map((e=>e.value));else if(e&&this.params.autocomplete&&this.typing){if(!(this.params.freetext||this.params.allowEmpty&&""===this.input.value))return void this.actions.cancel();t=this.input.value}else t=this.currentItems[0]?this.currentItems[0].value:null==(i=this.initialValues[0])||""===i?i:this.params.emptyValue;""===t&&(t=this.params.emptyValue),this.actions.success(t),this.isFilter&&(this.initialValues=t&&!Array.isArray[t]?[t]:t)}}var k={input:function(e,t,i,s,o){var n=e.getValue(),r=document.createElement("input");if(r.setAttribute("type",o.search?"search":"text"),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),r.setAttribute(e,r.getAttribute(e)+o.elementAttributes["+"+e])):r.setAttribute(e,o.elementAttributes[e]);function a(e){null==n&&""!==r.value||r.value!==n?i(r.value)&&(n=r.value):s()}return r.value=void 0!==n?n:"",t((function(){r.focus({preventScroll:!0}),r.style.height="100%",o.selectContents&&r.select()})),r.addEventListener("change",a),r.addEventListener("blur",a),r.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:a();break;case 27:s();break;case 35:case 36:e.stopPropagation()}})),o.mask&&M(r,o),r},textarea:function(e,t,i,s,o){var n=e.getValue(),r=o.verticalNavigation||"hybrid",a=String(null!=n?n:""),l=((a.match(/(?:\r\n|\r|\n)/g)||[]).length,document.createElement("textarea")),h=0;if(l.style.display="block",l.style.padding="2px",l.style.height="100%",l.style.width="100%",l.style.boxSizing="border-box",l.style.whiteSpace="pre-wrap",l.style.resize="none",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),l.setAttribute(e,l.getAttribute(e)+o.elementAttributes["+"+e])):l.setAttribute(e,o.elementAttributes[e]);function d(t){null==n&&""!==l.value||l.value!==n?(i(l.value)&&(n=l.value),setTimeout((function(){e.getRow().normalizeHeight()}),300)):s()}return l.value=a,t((function(){l.focus({preventScroll:!0}),l.style.height="100%",l.scrollHeight,l.style.height=l.scrollHeight+"px",e.getRow().normalizeHeight(),o.selectContents&&l.select()})),l.addEventListener("change",d),l.addEventListener("blur",d),l.addEventListener("keyup",(function(){l.style.height="";var t=l.scrollHeight;l.style.height=t+"px",t!=h&&(h=t,e.getRow().normalizeHeight())})),l.addEventListener("keydown",(function(e){switch(e.keyCode){case 27:s();break;case 38:("editor"==r||"hybrid"==r&&l.selectionStart)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 40:("editor"==r||"hybrid"==r&&l.selectionStart!==l.value.length)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 35:case 36:e.stopPropagation()}})),o.mask&&M(l,o),l},number:function(e,t,i,s,o){var n=e.getValue(),r=o.verticalNavigation||"editor",a=document.createElement("input");if(a.setAttribute("type","number"),void 0!==o.max&&a.setAttribute("max",o.max),void 0!==o.min&&a.setAttribute("min",o.min),void 0!==o.step&&a.setAttribute("step",o.step),a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),a.setAttribute(e,a.getAttribute(e)+o.elementAttributes["+"+e])):a.setAttribute(e,o.elementAttributes[e]);a.value=n;var l=function(e){h()};function h(){var e=a.value;isNaN(e)||""===e||(e=Number(e)),e!==n?i(e)&&(n=e):s()}return t((function(){a.removeEventListener("blur",l),a.focus({preventScroll:!0}),a.style.height="100%",a.addEventListener("blur",l),o.selectContents&&a.select()})),a.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:h();break;case 27:s();break;case 38:case 40:"editor"==r&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 35:case 36:e.stopPropagation()}})),o.mask&&M(a,o),a},range:function(e,t,i,s,o){var n=e.getValue(),r=document.createElement("input");if(r.setAttribute("type","range"),void 0!==o.max&&r.setAttribute("max",o.max),void 0!==o.min&&r.setAttribute("min",o.min),void 0!==o.step&&r.setAttribute("step",o.step),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),r.setAttribute(e,r.getAttribute(e)+o.elementAttributes["+"+e])):r.setAttribute(e,o.elementAttributes[e]);function a(){var e=r.value;isNaN(e)||""===e||(e=Number(e)),e!=n?i(e)&&(n=e):s()}return r.value=n,t((function(){r.focus({preventScroll:!0}),r.style.height="100%"})),r.addEventListener("blur",(function(e){a()})),r.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:a();break;case 27:s()}})),r},select:function(e,t,i,s,o){return console.warn("The select editor has been deprecated, please use the new list editor"),new L(this,e,t,i,s,o).input},list:function(e,t,i,s,o){return new L(this,e,t,i,s,o).input},autocomplete:function(e,t,i,s,o){return console.warn("The autocomplete editor has been deprecated, please use the new list editor with the 'autocomplete' editorParam"),o.autocomplete=!0,new L(this,e,t,i,s,o).input},star:function(e,t,i,s,o){var n=this,r=e.getElement(),a=e.getValue(),l=r.getElementsByTagName("svg").length||5,h=r.getElementsByTagName("svg")[0]?r.getElementsByTagName("svg")[0].getAttribute("width"):14,d=[],c=document.createElement("div"),u=document.createElementNS("http://www.w3.org/2000/svg","svg");function m(e){d.forEach((function(t,i){i'):("ie"==n.table.browser?t.setAttribute("class","tabulator-star-inactive"):t.classList.replace("tabulator-star-active","tabulator-star-inactive"),t.innerHTML='')}))}function p(e){var t=document.createElement("span"),s=u.cloneNode(!0);d.push(s),t.addEventListener("mouseenter",(function(t){t.stopPropagation(),t.stopImmediatePropagation(),m(e)})),t.addEventListener("mousemove",(function(e){e.stopPropagation(),e.stopImmediatePropagation()})),t.addEventListener("click",(function(t){t.stopPropagation(),t.stopImmediatePropagation(),i(e),r.blur()})),t.appendChild(s),c.appendChild(t)}function g(e){a=e,m(e)}if(r.style.whiteSpace="nowrap",r.style.overflow="hidden",r.style.textOverflow="ellipsis",c.style.verticalAlign="middle",c.style.display="inline-block",c.style.padding="4px",u.setAttribute("width",h),u.setAttribute("height",h),u.setAttribute("viewBox","0 0 512 512"),u.setAttribute("xml:space","preserve"),u.style.padding="0 1px",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),c.setAttribute(e,c.getAttribute(e)+o.elementAttributes["+"+e])):c.setAttribute(e,o.elementAttributes[e]);for(var b=1;b<=l;b++)p(b);return m(a=Math.min(parseInt(a),l)),c.addEventListener("mousemove",(function(e){m(0)})),c.addEventListener("click",(function(e){i(0)})),r.addEventListener("blur",(function(e){s()})),r.addEventListener("keydown",(function(e){switch(e.keyCode){case 39:g(a+1);break;case 37:g(a-1);break;case 13:i(a);break;case 27:s()}})),c},progress:function(e,t,i,s,o){var n,r,a=e.getElement(),l=void 0===o.max?a.getElementsByTagName("div")[0]&&a.getElementsByTagName("div")[0].getAttribute("max")||100:o.max,h=void 0===o.min?a.getElementsByTagName("div")[0]&&a.getElementsByTagName("div")[0].getAttribute("min")||0:o.min,d=(l-h)/100,c=e.getValue()||0,u=document.createElement("div"),m=document.createElement("div");function p(){var e=window.getComputedStyle(a,null),t=d*Math.round(m.offsetWidth/((a.clientWidth-parseInt(e.getPropertyValue("padding-left"))-parseInt(e.getPropertyValue("padding-right")))/100))+h;i(t),a.setAttribute("aria-valuenow",t),a.setAttribute("aria-label",c)}if(u.style.position="absolute",u.style.right="0",u.style.top="0",u.style.bottom="0",u.style.width="5px",u.classList.add("tabulator-progress-handle"),m.style.display="inline-block",m.style.position="relative",m.style.height="100%",m.style.backgroundColor="#488CE9",m.style.maxWidth="100%",m.style.minWidth="0%",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),m.setAttribute(e,m.getAttribute(e)+o.elementAttributes["+"+e])):m.setAttribute(e,o.elementAttributes[e]);return a.style.padding="4px 4px",c=Math.min(parseFloat(c),l),c=Math.max(parseFloat(c),h),c=Math.round((c-h)/d),m.style.width=c+"%",a.setAttribute("aria-valuemin",h),a.setAttribute("aria-valuemax",l),m.appendChild(u),u.addEventListener("mousedown",(function(e){n=e.screenX,r=m.offsetWidth})),u.addEventListener("mouseover",(function(){u.style.cursor="ew-resize"})),a.addEventListener("mousemove",(function(e){n&&(m.style.width=r+e.screenX-n+"px")})),a.addEventListener("mouseup",(function(e){n&&(e.stopPropagation(),e.stopImmediatePropagation(),n=!1,r=!1,p())})),a.addEventListener("keydown",(function(e){switch(e.keyCode){case 39:e.preventDefault(),m.style.width=m.clientWidth+a.clientWidth/100+"px";break;case 37:e.preventDefault(),m.style.width=m.clientWidth-a.clientWidth/100+"px";break;case 9:case 13:p();break;case 27:s()}})),a.addEventListener("blur",(function(){s()})),m},tickCross:function(e,t,i,s,o){var n=e.getValue(),r=document.createElement("input"),a=o.tristate,l=void 0===o.indeterminateValue?null:o.indeterminateValue,h=!1,d=Object.keys(o).includes("trueValue"),c=Object.keys(o).includes("falseValue");if(r.setAttribute("type","checkbox"),r.style.marginTop="5px",r.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),r.setAttribute(e,r.getAttribute(e)+o.elementAttributes["+"+e])):r.setAttribute(e,o.elementAttributes[e]);function u(e){var t=r.checked;return t=d&&t?o.trueValue:c&&!t?o.falseValue:t,a?e?h?l:t:r.checked&&!h?(r.checked=!1,r.indeterminate=!0,h=!0,l):(h=!1,t):t}return r.value=n,!a||void 0!==n&&n!==l&&""!==n||(h=!0,r.indeterminate=!0),"firefox"!=this.table.browser&&t((function(){r.focus({preventScroll:!0})})),r.checked=d?n===o.trueValue:!0===n||"true"===n||"True"===n||1===n,t((function(){r.focus()})),r.addEventListener("change",(function(e){i(u())})),r.addEventListener("blur",(function(e){i(u(!0))})),r.addEventListener("keydown",(function(e){13==e.keyCode&&i(u()),27==e.keyCode&&s()})),r}};class D extends o{constructor(e){super(e),this.currentCell=!1,this.mouseClick=!1,this.recursionBlock=!1,this.invalidEdit=!1,this.editedCells=[],this.editors=D.editors,this.registerColumnOption("editable"),this.registerColumnOption("editor"),this.registerColumnOption("editorParams"),this.registerColumnOption("cellEditing"),this.registerColumnOption("cellEdited"),this.registerColumnOption("cellEditCancelled"),this.registerTableFunction("getEditedCells",this.getEditedCells.bind(this)),this.registerTableFunction("clearCellEdited",this.clearCellEdited.bind(this)),this.registerTableFunction("navigatePrev",this.navigatePrev.bind(this)),this.registerTableFunction("navigateNext",this.navigateNext.bind(this)),this.registerTableFunction("navigateLeft",this.navigateLeft.bind(this)),this.registerTableFunction("navigateRight",this.navigateRight.bind(this)),this.registerTableFunction("navigateUp",this.navigateUp.bind(this)),this.registerTableFunction("navigateDown",this.navigateDown.bind(this)),this.registerComponentFunction("cell","isEdited",this.cellisEdited.bind(this)),this.registerComponentFunction("cell","clearEdited",this.clearEdited.bind(this)),this.registerComponentFunction("cell","edit",this.editCell.bind(this)),this.registerComponentFunction("cell","cancelEdit",this.cellCancelEdit.bind(this)),this.registerComponentFunction("cell","navigatePrev",this.navigatePrev.bind(this)),this.registerComponentFunction("cell","navigateNext",this.navigateNext.bind(this)),this.registerComponentFunction("cell","navigateLeft",this.navigateLeft.bind(this)),this.registerComponentFunction("cell","navigateRight",this.navigateRight.bind(this)),this.registerComponentFunction("cell","navigateUp",this.navigateUp.bind(this)),this.registerComponentFunction("cell","navigateDown",this.navigateDown.bind(this))}initialize(){this.subscribe("cell-init",this.bindEditor.bind(this)),this.subscribe("cell-delete",this.clearEdited.bind(this)),this.subscribe("column-layout",this.initializeColumnCheck.bind(this)),this.subscribe("column-delete",this.columnDeleteCheck.bind(this)),this.subscribe("row-deleting",this.rowDeleteCheck.bind(this)),this.subscribe("data-refreshing",this.cancelEdit.bind(this)),this.subscribe("keybinding-nav-prev",this.navigatePrev.bind(this,void 0)),this.subscribe("keybinding-nav-next",this.keybindingNavigateNext.bind(this)),this.subscribe("keybinding-nav-left",this.navigateLeft.bind(this,void 0)),this.subscribe("keybinding-nav-right",this.navigateRight.bind(this,void 0)),this.subscribe("keybinding-nav-up",this.navigateUp.bind(this,void 0)),this.subscribe("keybinding-nav-down",this.navigateDown.bind(this,void 0))}keybindingNavigateNext(e){var t=this.currentCell,i=this.options("tabEndNewRow");t&&(this.navigateNext(t,e)||i&&(t.getElement().firstChild.blur(),(i=!0===i?this.table.addRow({}):"function"==typeof i?this.table.addRow(i(t.row.getComponent())):this.table.addRow(Object.assign({},i))).then((()=>{setTimeout((()=>{t.getComponent().navigateNext()}))}))))}cellisEdited(e){return!!e.modules.edit&&e.modules.edit.edited}cellCancelEdit(e){e===this.currentCell?this.table.modules.edit.cancelEdit():console.warn("Cancel Editor Error - This cell is not currently being edited ")}clearCellEdited(e){e||(e=this.table.modules.edit.getEditedCells()),Array.isArray(e)||(e=[e]),e.forEach((e=>{this.table.modules.edit.clearEdited(e._getSelf())}))}navigatePrev(e=this.currentCell,t){var i,s;if(e){if(t&&t.preventDefault(),i=this.navigateLeft())return!0;if((s=this.table.rowManager.prevDisplayRow(e.row,!0))&&(i=this.findNextEditableCell(s,s.cells.length)))return i.getComponent().edit(),!0}return!1}navigateNext(e=this.currentCell,t){var i,s;if(e){if(t&&t.preventDefault(),i=this.navigateRight())return!0;if((s=this.table.rowManager.nextDisplayRow(e.row,!0))&&(i=this.findNextEditableCell(s,-1)))return i.getComponent().edit(),!0}return!1}navigateLeft(e=this.currentCell,t){var i,s;return!!(e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.findPrevEditableCell(e.row,i)))&&(s.getComponent().edit(),!0)}navigateRight(e=this.currentCell,t){var i,s;return!!(e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.findNextEditableCell(e.row,i)))&&(s.getComponent().edit(),!0)}navigateUp(e=this.currentCell,t){var i,s;return!!(e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.table.rowManager.prevDisplayRow(e.row,!0)))&&(s.cells[i].getComponent().edit(),!0)}navigateDown(e=this.currentCell,t){var i,s;return!!(e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.table.rowManager.nextDisplayRow(e.row,!0)))&&(s.cells[i].getComponent().edit(),!0)}findNextEditableCell(e,i){var s=!1;if(i0)for(var o=i-1;o>=0;o--){let i=e.cells[o],n=!0;if(i.column.modules.edit&&t.elVisible(i.getElement())&&("function"==typeof i.column.modules.edit.check&&(n=i.column.modules.edit.check(i.getComponent())),n)){s=i;break}}return s}initializeColumnCheck(e){void 0!==e.definition.editor&&this.initializeColumn(e)}columnDeleteCheck(e){this.currentCell&&this.currentCell.column===e&&this.cancelEdit()}rowDeleteCheck(e){this.currentCell&&this.currentCell.row===e&&this.cancelEdit()}initializeColumn(e){var t={editor:!1,blocked:!1,check:e.definition.editable,params:e.definition.editorParams||{}};switch(typeof e.definition.editor){case"string":this.editors[e.definition.editor]?t.editor=this.editors[e.definition.editor]:console.warn("Editor Error - No such editor found: ",e.definition.editor);break;case"function":t.editor=e.definition.editor;break;case"boolean":!0===e.definition.editor&&("function"!=typeof e.definition.formatter?this.editors[e.definition.formatter]?t.editor=this.editors[e.definition.formatter]:t.editor=this.editors.input:console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",e.definition.formatter))}t.editor&&(e.modules.edit=t)}getCurrentCell(){return!!this.currentCell&&this.currentCell.getComponent()}clearEditor(e){var t,i=this.currentCell;if(this.invalidEdit=!1,i){for(this.currentCell=!1,t=i.getElement(),this.dispatch("edit-editor-clear",i,e),t.classList.remove("tabulator-editing");t.firstChild;)t.removeChild(t.firstChild);i.row.getElement().classList.remove("tabulator-row-editing")}}cancelEdit(){if(this.currentCell){var e=this.currentCell,t=this.currentCell.getComponent();this.clearEditor(!0),e.setValueActual(e.getValue()),e.cellRendered(),("textarea"==e.column.definition.editor||e.column.definition.variableHeight)&&e.row.normalizeHeight(!0),e.column.definition.cellEditCancelled&&e.column.definition.cellEditCancelled.call(this.table,t),this.dispatch("edit-cancelled",e),this.dispatchExternal("cellEditCancelled",t)}}bindEditor(e){if(e.column.modules.edit){var t=this,i=e.getElement(!0);i.setAttribute("tabindex",0),i.addEventListener("click",(function(e){i.classList.contains("tabulator-editing")||i.focus({preventScroll:!0})})),i.addEventListener("mousedown",(function(e){2===e.button?e.preventDefault():t.mouseClick=!0})),i.addEventListener("focus",(function(i){t.recursionBlock||t.edit(e,i,!1)}))}}focusCellNoEvent(e,t){this.recursionBlock=!0,t&&"ie"===this.table.browser||e.getElement().focus({preventScroll:!0}),this.recursionBlock=!1}editCell(e,t){this.focusCellNoEvent(e),this.edit(e,!1,t)}focusScrollAdjust(e){if("virtual"==this.table.rowManager.getRenderMode()){var t=this.table.rowManager.element.scrollTop,i=this.table.rowManager.element.clientHeight+this.table.rowManager.element.scrollTop,s=e.row.getElement();s.offsetTop;s.offsetTopi&&(this.table.rowManager.element.scrollTop+=s.offsetTop+s.offsetHeight-i);var o=this.table.rowManager.element.scrollLeft,n=this.table.rowManager.element.clientWidth+this.table.rowManager.element.scrollLeft,r=e.getElement();r.offsetLeft;this.table.modExists("frozenColumns")&&(o+=parseInt(this.table.modules.frozenColumns.leftMargin),n-=parseInt(this.table.modules.frozenColumns.rightMargin)),"virtual"===this.table.options.renderHorizontal&&(o-=parseInt(this.table.columnManager.renderer.vDomPadLeft),n-=parseInt(this.table.columnManager.renderer.vDomPadLeft)),r.offsetLeftn&&(this.table.rowManager.element.scrollLeft+=r.offsetLeft+r.offsetWidth-n)}}edit(e,t,i){var s,o,n,r=this,a=!0,l=function(){},h=e.getElement();if(!this.currentCell){if(e.column.modules.edit.blocked)return this.mouseClick=!1,h.blur(),!1;switch(t&&t.stopPropagation(),typeof e.column.modules.edit.check){case"function":a=e.column.modules.edit.check(e.getComponent());break;case"boolean":a=e.column.modules.edit.check}if(a||i){if(r.cancelEdit(),r.currentCell=e,this.focusScrollAdjust(e),o=e.getComponent(),this.mouseClick&&(this.mouseClick=!1,e.column.definition.cellClick&&e.column.definition.cellClick.call(this.table,t,o)),e.column.definition.cellEditing&&e.column.definition.cellEditing.call(this.table,o),this.dispatch("cell-editing",e),this.dispatchExternal("cellEditing",o),n="function"==typeof e.column.modules.edit.params?e.column.modules.edit.params(o):e.column.modules.edit.params,!1===(s=e.column.modules.edit.editor.call(r,o,(function(e){l=e}),(function(t){if(r.currentCell===e){var i=r.chain("edit-success",[e,t],!0,!0);return!0===i||"highlight"===r.table.options.validationMode?(r.clearEditor(),e.modules.edit||(e.modules.edit={}),e.modules.edit.edited=!0,-1==r.editedCells.indexOf(e)&&r.editedCells.push(e),e.setValue(t,!0),!0===i):(r.invalidEdit=!0,r.focusCellNoEvent(e,!0),l(),!1)}}),(function(){r.currentCell===e&&r.cancelEdit()}),n)))return h.blur(),!1;if(!(s instanceof Node))return console.warn("Edit Error - Editor should return an instance of Node, the editor returned:",s),h.blur(),!1;for(h.classList.add("tabulator-editing"),e.row.getElement().classList.add("tabulator-row-editing");h.firstChild;)h.removeChild(h.firstChild);h.appendChild(s),l();for(var d=h.children,c=0;c{e.push(t.getComponent())})),e}clearEdited(e){var t;e.modules.edit&&e.modules.edit.edited&&(e.modules.edit.edited=!1,this.dispatch("edit-edited-clear",e)),(t=this.editedCells.indexOf(e))>-1&&this.editedCells.splice(t,1)}}D.moduleName="edit",D.editors=k;class P{constructor(e,t,i,s){this.type=e,this.columns=t,this.component=i||!1,this.indent=s||0}}class S{constructor(e,t,i,s,o){this.value=e,this.component=t||!1,this.width=i,this.height=s,this.depth=o}}class z extends o{constructor(e){super(e),this.config={},this.cloneTableStyle=!0,this.colVisProp="",this.registerTableOption("htmlOutputConfig",!1),this.registerColumnOption("htmlOutput"),this.registerColumnOption("titleHtmlOutput")}initialize(){this.registerTableFunction("getHtml",this.getHtml.bind(this))}generateExportList(e,t,i,s){this.cloneTableStyle=t,this.config=e||{},this.colVisProp=s;var o=!1!==this.config.columnHeaders?this.headersToExportRows(this.generateColumnGroupHeaders()):[],n=this.bodyToExportRows(this.rowLookup(i));return o.concat(n)}genereateTable(e,t,i,s){var o=this.generateExportList(e,t,i,s);return this.genereateTableElement(o)}rowLookup(e){var t=[];if("function"==typeof e)e.call(this.table).forEach((e=>{(e=this.table.rowManager.findRow(e))&&t.push(e)}));else switch(e){case!0:case"visible":t=this.table.rowManager.getVisibleRows(!1,!0);break;case"all":t=this.table.rowManager.rows;break;case"selected":t=this.table.modules.selectRow.selectedRows;break;case"active":default:t=this.table.options.pagination?this.table.rowManager.getDisplayRows(this.table.rowManager.displayRows.length-2):this.table.rowManager.getDisplayRows()}return Object.assign([],t)}generateColumnGroupHeaders(){var e=[];return(!1!==this.config.columnGroups?this.table.columnManager.columns:this.table.columnManager.columnsByIndex).forEach((t=>{var i=this.processColumnGroup(t);i&&e.push(i)})),e}processColumnGroup(e){var t=e.columns,i=0,s={title:e.definition["title"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))]||e.definition.title,column:e,depth:1};if(t.length){if(s.subGroups=[],s.width=0,t.forEach((e=>{var t=this.processColumnGroup(e);t&&(s.width+=t.width,s.subGroups.push(t),t.depth>i&&(i=t.depth))})),s.depth+=i,!s.width)return!1}else{if(!this.columnVisCheck(e))return!1;s.width=1}return s}columnVisCheck(e){return!1!==e.definition[this.colVisProp]&&(e.visible||!e.visible&&e.definition[this.colVisProp])}headersToExportRows(e){var t=[],i=0,s=[];function o(e,s){var n=i-s;if(void 0===t[s]&&(t[s]=[]),e.height=e.subGroups?1:n-e.depth+1,t[s].push(e),e.height>1)for(let i=1;i1)for(let i=1;ii&&(i=e.depth)})),e.forEach((function(e){o(e,0)})),t.forEach((e=>{var t=[];e.forEach((e=>{if(e){let i=void 0===e.title?"":e.title;t.push(new S(i,e.column.getComponent(),e.width,e.height,e.depth))}else t.push(null)})),s.push(new P("header",t))})),s}bodyToExportRows(e){var t=[],i=[];return this.table.columnManager.columnsByIndex.forEach((e=>{this.columnVisCheck(e)&&t.push(e.getComponent())})),!1!==this.config.columnCalcs&&this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&e.unshift(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&e.push(this.table.modules.columnCalcs.botRow)),(e=e.filter((e=>{switch(e.type){case"group":return!1!==this.config.rowGroups;case"calc":return!1!==this.config.columnCalcs;case"row":return!(this.table.options.dataTree&&!1===this.config.dataTree&&e.modules.dataTree.parent)}return!0}))).forEach(((e,s)=>{var o=e.getData(this.colVisProp),n=[],r=0;switch(e.type){case"group":r=e.level,n.push(new S(e.key,e.getComponent(),t.length,1));break;case"calc":case"row":t.forEach((e=>{n.push(new S(e._column.getFieldValue(o),e,1,1))})),this.table.options.dataTree&&!1!==this.config.dataTree&&(r=e.modules.dataTree.index)}i.push(new P(e.type,n,e.getComponent(),r))})),i}genereateTableElement(e){var t=document.createElement("table"),i=document.createElement("thead"),s=document.createElement("tbody"),o=this.lookupTableStyles(),n=this.table.options["rowFormatter"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],r={};return r.rowFormatter=null!==n?n:this.table.options.rowFormatter,this.table.options.dataTree&&!1!==this.config.dataTree&&this.table.modExists("columnCalcs")&&(r.treeElementField=this.table.modules.dataTree.elementField),r.groupHeader=this.table.options["groupHeader"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],r.groupHeader&&!Array.isArray(r.groupHeader)&&(r.groupHeader=[r.groupHeader]),t.classList.add("tabulator-print-table"),this.mapElementStyles(this.table.columnManager.getHeadersElement(),i,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),e.length>1e3&&console.warn("It may take a long time to render an HTML table with more than 1000 rows"),e.forEach(((e,t)=>{switch(e.type){case"header":i.appendChild(this.genereateHeaderElement(e,r,o));break;case"group":s.appendChild(this.genereateGroupElement(e,r,o));break;case"calc":s.appendChild(this.genereateCalcElement(e,r,o));break;case"row":let n=this.genereateRowElement(e,r,o);this.mapElementStyles(t%2&&o.evenRow?o.evenRow:o.oddRow,n,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),s.appendChild(n)}})),i.innerHTML&&t.appendChild(i),t.appendChild(s),this.mapElementStyles(this.table.element,t,["border-top","border-left","border-right","border-bottom"]),t}lookupTableStyles(){var e={};return this.cloneTableStyle&&window.getComputedStyle&&(e.oddRow=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"),e.evenRow=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),e.calcRow=this.table.element.querySelector(".tabulator-row.tabulator-calcs"),e.firstRow=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),e.firstGroup=this.table.element.getElementsByClassName("tabulator-group")[0],e.firstRow&&(e.styleCells=e.firstRow.getElementsByClassName("tabulator-cell"),e.firstCell=e.styleCells[0],e.lastCell=e.styleCells[e.styleCells.length-1])),e}genereateHeaderElement(e,t,i){var s=document.createElement("tr");return e.columns.forEach((e=>{if(e){var t=document.createElement("th"),i=e.component._column.definition.cssClass?e.component._column.definition.cssClass.split(" "):[];t.colSpan=e.width,t.rowSpan=e.height,t.innerHTML=e.value,this.cloneTableStyle&&(t.style.boxSizing="border-box"),i.forEach((function(e){t.classList.add(e)})),this.mapElementStyles(e.component.getElement(),t,["text-align","border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),this.mapElementStyles(e.component._column.contentElement,t,["padding-top","padding-left","padding-right","padding-bottom"]),e.component._column.visible?this.mapElementStyles(e.component.getElement(),t,["width"]):e.component._column.definition.width&&(t.style.width=e.component._column.definition.width+"px"),e.component._column.parent&&this.mapElementStyles(e.component._column.parent.groupElement,t,["border-top"]),s.appendChild(t)}})),s}genereateGroupElement(e,t,i){var s=document.createElement("tr"),o=document.createElement("td"),n=e.columns[0];return s.classList.add("tabulator-print-table-row"),t.groupHeader&&t.groupHeader[e.indent]?n.value=t.groupHeader[e.indent](n.value,e.component._group.getRowCount(),e.component._group.getData(),e.component):!1===t.groupHeader?n.value=n.value:n.value=e.component._group.generator(n.value,e.component._group.getRowCount(),e.component._group.getData(),e.component),o.colSpan=n.width,o.innerHTML=n.value,s.classList.add("tabulator-print-table-group"),s.classList.add("tabulator-group-level-"+e.indent),n.component.isVisible()&&s.classList.add("tabulator-group-visible"),this.mapElementStyles(i.firstGroup,s,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),this.mapElementStyles(i.firstGroup,o,["padding-top","padding-left","padding-right","padding-bottom"]),s.appendChild(o),s}genereateCalcElement(e,t,i){var s=this.genereateRowElement(e,t,i);return s.classList.add("tabulator-print-table-calcs"),this.mapElementStyles(i.calcRow,s,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),s}genereateRowElement(e,t,s){var o=document.createElement("tr");return o.classList.add("tabulator-print-table-row"),e.columns.forEach((n=>{if(n){var r=document.createElement("td"),a=n.component._column,l=this.table.columnManager.findColumnIndex(a),h=n.value,d={modules:{},getValue:function(){return h},getField:function(){return a.definition.field},getElement:function(){return r},getColumn:function(){return a.getComponent()},getData:function(){return e.component.getData()},getRow:function(){return e.component},getComponent:function(){return d},column:a};if((a.definition.cssClass?a.definition.cssClass.split(" "):[]).forEach((function(e){r.classList.add(e)})),this.table.modExists("format")&&!1!==this.config.formatCells)h=this.table.modules.format.formatExportValue(d,this.colVisProp);else switch(typeof h){case"object":h=JSON.stringify(h);break;case"undefined":case"null":h="";break;default:h=h}h instanceof Node?r.appendChild(h):r.innerHTML=h,(s.styleCells[l]||s.firstCell)&&(this.mapElementStyles(s.styleCells[l]||s.firstCell,r,["padding-top","padding-left","padding-right","padding-bottom","border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","text-align"]),a.definition.align&&(r.style.textAlign=a.definition.align)),this.table.options.dataTree&&!1!==this.config.dataTree&&(t.treeElementField&&t.treeElementField==a.field||!t.treeElementField&&0==i)&&(e.component._row.modules.dataTree.controlEl&&r.insertBefore(e.component._row.modules.dataTree.controlEl.cloneNode(!0),r.firstChild),e.component._row.modules.dataTree.branchEl&&r.insertBefore(e.component._row.modules.dataTree.branchEl.cloneNode(!0),r.firstChild)),o.appendChild(r),d.modules.format&&d.modules.format.renderedCallback&&d.modules.format.renderedCallback(),t.rowFormatter&&!1!==this.config.formatCells&&t.rowFormatter(e.component)}})),o}genereateHTMLTable(e){var t=document.createElement("div");return t.appendChild(this.genereateTableElement(e)),t.innerHTML}getHtml(e,t,i,s){var o=this.generateExportList(i||this.table.options.htmlOutputConfig,t,e,s||"htmlOutput");return this.genereateHTMLTable(o)}mapElementStyles(e,t,i){if(this.cloneTableStyle&&e&&t){var s={"background-color":"backgroundColor",color:"fontColor",width:"width","font-weight":"fontWeight","font-family":"fontFamily","font-size":"fontSize","text-align":"textAlign","border-top":"borderTop","border-left":"borderLeft","border-right":"borderRight","border-bottom":"borderBottom","padding-top":"paddingTop","padding-left":"paddingLeft","padding-right":"paddingRight","padding-bottom":"paddingBottom"};if(window.getComputedStyle){var o=window.getComputedStyle(e);i.forEach((function(e){t.style[s[e]]=o.getPropertyValue(e)}))}}}}z.moduleName="export";var F={"=":function(e,t,i,s){return t==e},"<":function(e,t,i,s){return t":function(e,t,i,s){return t>e},">=":function(e,t,i,s){return t>=e},"!=":function(e,t,i,s){return t!=e},regex:function(e,t,i,s){return"string"==typeof e&&(e=new RegExp(e)),e.test(t)},like:function(e,t,i,s){return null==e?t===e:null!=t&&String(t).toLowerCase().indexOf(e.toLowerCase())>-1},keywords:function(e,t,i,s){var o=e.toLowerCase().split(void 0===s.separator?" ":s.separator),n=String(null==t?"":t).toLowerCase(),r=[];return o.forEach((e=>{n.includes(e)&&r.push(!0)})),s.matchAll?r.length===o.length:!!r.length},starts:function(e,t,i,s){return null==e?t===e:null!=t&&String(t).toLowerCase().startsWith(e.toLowerCase())},ends:function(e,t,i,s){return null==e?t===e:null!=t&&String(t).toLowerCase().endsWith(e.toLowerCase())},in:function(e,t,i,s){return Array.isArray(e)?!e.length||e.indexOf(t)>-1:(console.warn("Filter Error - filter value is not an array:",e),!1)}};class H extends o{constructor(e){super(e),this.filterList=[],this.headerFilters={},this.headerFilterColumns=[],this.prevHeaderFilterChangeCheck="",this.prevHeaderFilterChangeCheck="{}",this.changed=!1,this.tableInitialized=!1,this.registerTableOption("filterMode","local"),this.registerTableOption("initialFilter",!1),this.registerTableOption("initialHeaderFilter",!1),this.registerTableOption("headerFilterLiveFilterDelay",300),this.registerColumnOption("headerFilter"),this.registerColumnOption("headerFilterPlaceholder"),this.registerColumnOption("headerFilterParams"),this.registerColumnOption("headerFilterEmptyCheck"),this.registerColumnOption("headerFilterFunc"),this.registerColumnOption("headerFilterFuncParams"),this.registerColumnOption("headerFilterLiveFilter"),this.registerTableFunction("searchRows",this.searchRows.bind(this)),this.registerTableFunction("searchData",this.searchData.bind(this)),this.registerTableFunction("setFilter",this.userSetFilter.bind(this)),this.registerTableFunction("refreshFilter",this.userRefreshFilter.bind(this)),this.registerTableFunction("addFilter",this.userAddFilter.bind(this)),this.registerTableFunction("getFilters",this.getFilters.bind(this)),this.registerTableFunction("setHeaderFilterFocus",this.userSetHeaderFilterFocus.bind(this)),this.registerTableFunction("getHeaderFilterValue",this.userGetHeaderFilterValue.bind(this)),this.registerTableFunction("setHeaderFilterValue",this.userSetHeaderFilterValue.bind(this)),this.registerTableFunction("getHeaderFilters",this.getHeaderFilters.bind(this)),this.registerTableFunction("removeFilter",this.userRemoveFilter.bind(this)),this.registerTableFunction("clearFilter",this.userClearFilter.bind(this)),this.registerTableFunction("clearHeaderFilter",this.userClearHeaderFilter.bind(this)),this.registerComponentFunction("column","headerFilterFocus",this.setHeaderFilterFocus.bind(this)),this.registerComponentFunction("column","reloadHeaderFilter",this.reloadHeaderFilter.bind(this)),this.registerComponentFunction("column","getHeaderFilterValue",this.getHeaderFilterValue.bind(this)),this.registerComponentFunction("column","setHeaderFilterValue",this.setHeaderFilterValue.bind(this))}initialize(){this.subscribe("column-init",this.initializeColumnHeaderFilter.bind(this)),this.subscribe("column-width-fit-before",this.hideHeaderFilterElements.bind(this)),this.subscribe("column-width-fit-after",this.showHeaderFilterElements.bind(this)),this.subscribe("table-built",this.tableBuilt.bind(this)),"remote"===this.table.options.filterMode&&this.subscribe("data-params",this.remoteFilterParams.bind(this)),this.registerDataHandler(this.filter.bind(this),10)}tableBuilt(){this.table.options.initialFilter&&this.setFilter(this.table.options.initialFilter),this.table.options.initialHeaderFilter&&this.table.options.initialHeaderFilter.forEach((e=>{var t=this.table.columnManager.findColumn(e.field);if(!t)return console.warn("Column Filter Error - No matching column found:",e.field),!1;this.setHeaderFilterValue(t,e.value)})),this.tableInitialized=!0}remoteFilterParams(e,t,i,s){return s.filter=this.getFilters(!0,!0),s}userSetFilter(e,t,i,s){this.setFilter(e,t,i,s),this.refreshFilter()}userRefreshFilter(){this.refreshFilter()}userAddFilter(e,t,i,s){this.addFilter(e,t,i,s),this.refreshFilter()}userSetHeaderFilterFocus(e){var t=this.table.columnManager.findColumn(e);if(!t)return console.warn("Column Filter Focus Error - No matching column found:",e),!1;this.setHeaderFilterFocus(t)}userGetHeaderFilterValue(e){var t=this.table.columnManager.findColumn(e);if(t)return this.getHeaderFilterValue(t);console.warn("Column Filter Error - No matching column found:",e)}userSetHeaderFilterValue(e,t){var i=this.table.columnManager.findColumn(e);if(!i)return console.warn("Column Filter Error - No matching column found:",e),!1;this.setHeaderFilterValue(i,t)}userRemoveFilter(e,t,i){this.removeFilter(e,t,i),this.refreshFilter()}userClearFilter(e){this.clearFilter(e),this.refreshFilter()}userClearHeaderFilter(){this.clearHeaderFilter(),this.refreshFilter()}searchRows(e,t,i){return this.search("rows",e,t,i)}searchData(e,t,i){return this.search("data",e,t,i)}initializeColumnHeaderFilter(e){var t=e.definition;t.headerFilter&&(void 0!==t.headerFilterPlaceholder&&t.field&&this.module("localize").setHeaderFilterColumnPlaceholder(t.field,t.headerFilterPlaceholder),this.initializeColumn(e))}initializeColumn(e,t){var i=this,s=e.getField();e.modules.filter={success:function(t){var o,n="input"==e.modules.filter.tagType&&"text"==e.modules.filter.attrType||"textarea"==e.modules.filter.tagType?"partial":"match",r="",a="";if(void 0===e.modules.filter.prevSuccess||e.modules.filter.prevSuccess!==t){if(e.modules.filter.prevSuccess=t,e.modules.filter.emptyFunc(t))delete i.headerFilters[s];else{switch(e.modules.filter.value=t,typeof e.definition.headerFilterFunc){case"string":H.filters[e.definition.headerFilterFunc]?(r=e.definition.headerFilterFunc,o=function(i){var s=e.definition.headerFilterFuncParams||{},o=e.getFieldValue(i);return s="function"==typeof s?s(t,o,i):s,H.filters[e.definition.headerFilterFunc](t,o,i,s)}):console.warn("Header Filter Error - Matching filter function not found: ",e.definition.headerFilterFunc);break;case"function":r=o=function(i){var s=e.definition.headerFilterFuncParams||{},o=e.getFieldValue(i);return s="function"==typeof s?s(t,o,i):s,e.definition.headerFilterFunc(t,o,i,s)}}if(!o)switch(n){case"partial":o=function(i){var s=e.getFieldValue(i);return null!=s&&String(s).toLowerCase().indexOf(String(t).toLowerCase())>-1},r="like";break;default:o=function(i){return e.getFieldValue(i)==t},r="="}i.headerFilters[s]={value:t,func:o,type:r,params:{}}}e.modules.filter.value=t,a=JSON.stringify(i.headerFilters),i.prevHeaderFilterChangeCheck!==a&&(i.prevHeaderFilterChangeCheck=a,i.trackChanges(),i.refreshFilter())}return!0},attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(e)}generateHeaderFilterElement(e,t,i){var s,o,n,r,a,l,h,d=this,c=e.modules.filter.success,u=e.getField();if(e.modules.filter.value=t,e.modules.filter.headerElement&&e.modules.filter.headerElement.parentNode&&e.contentElement.removeChild(e.modules.filter.headerElement.parentNode),u){switch(e.modules.filter.emptyFunc=e.definition.headerFilterEmptyCheck||function(e){return!e&&"0"!==e&&0!==e},(s=document.createElement("div")).classList.add("tabulator-header-filter"),typeof e.definition.headerFilter){case"string":d.table.modules.edit.editors[e.definition.headerFilter]?(o=d.table.modules.edit.editors[e.definition.headerFilter],"tick"!==e.definition.headerFilter&&"tickCross"!==e.definition.headerFilter||e.definition.headerFilterEmptyCheck||(e.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):console.warn("Filter Error - Cannot build header filter, No such editor found: ",e.definition.editor);break;case"function":o=e.definition.headerFilter;break;case"boolean":e.modules.edit&&e.modules.edit.editor?o=e.modules.edit.editor:e.definition.formatter&&d.table.modules.edit.editors[e.definition.formatter]?(o=d.table.modules.edit.editors[e.definition.formatter],"tick"!==e.definition.formatter&&"tickCross"!==e.definition.formatter||e.definition.headerFilterEmptyCheck||(e.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):o=d.table.modules.edit.editors.input}if(o){if(r={getValue:function(){return void 0!==t?t:""},getField:function(){return e.definition.field},getElement:function(){return s},getColumn:function(){return e.getComponent()},getRow:function(){return{normalizeHeight:function(){}}}},h="function"==typeof(h=e.definition.headerFilterParams||{})?h.call(d.table,r):h,!(n=o.call(this.table.modules.edit,r,(function(){}),c,(function(){}),h)))return void console.warn("Filter Error - Cannot add filter to "+u+" column, editor returned a value of false");if(!(n instanceof Node))return void console.warn("Filter Error - Cannot add filter to "+u+" column, editor should return an instance of Node, the editor returned:",n);u?d.langBind("headerFilters|columns|"+e.definition.field,(function(e){n.setAttribute("placeholder",void 0!==e&&e?e:d.langText("headerFilters|default"))})):d.langBind("headerFilters|default",(function(e){n.setAttribute("placeholder",e)})),n.addEventListener("click",(function(e){e.stopPropagation(),n.focus()})),n.addEventListener("focus",(e=>{var t=this.table.columnManager.element.scrollLeft;t!==this.table.rowManager.element.scrollLeft+parseInt(this.table.columnManager.element.style.marginLeft)&&(this.table.rowManager.scrollHorizontal(t),this.table.columnManager.scrollHorizontal(t))})),a=!1,l=function(e){a&&clearTimeout(a),a=setTimeout((function(){c(n.value)}),d.table.options.headerFilterLiveFilterDelay)},e.modules.filter.headerElement=n,e.modules.filter.attrType=n.hasAttribute("type")?n.getAttribute("type").toLowerCase():"",e.modules.filter.tagType=n.tagName.toLowerCase(),!1!==e.definition.headerFilterLiveFilter&&("autocomplete"!==e.definition.headerFilter&&"tickCross"!==e.definition.headerFilter&&("autocomplete"!==e.definition.editor&&"tickCross"!==e.definition.editor||!0!==e.definition.headerFilter)&&(n.addEventListener("keyup",l),n.addEventListener("search",l),"number"==e.modules.filter.attrType&&n.addEventListener("change",(function(e){c(n.value)})),"text"==e.modules.filter.attrType&&"ie"!==this.table.browser&&n.setAttribute("type","search")),"input"!=e.modules.filter.tagType&&"select"!=e.modules.filter.tagType&&"textarea"!=e.modules.filter.tagType||n.addEventListener("mousedown",(function(e){e.stopPropagation()}))),s.appendChild(n),e.contentElement.appendChild(s),i||d.headerFilterColumns.push(e)}}else console.warn("Filter Error - Cannot add header filter, column has no field set:",e.definition.title)}hideHeaderFilterElements(){this.headerFilterColumns.forEach((function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="none")}))}showHeaderFilterElements(){this.headerFilterColumns.forEach((function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="")}))}setHeaderFilterFocus(e){e.modules.filter&&e.modules.filter.headerElement?e.modules.filter.headerElement.focus():console.warn("Column Filter Focus Error - No header filter set on column:",e.getField())}getHeaderFilterValue(e){if(e.modules.filter&&e.modules.filter.headerElement)return e.modules.filter.value;console.warn("Column Filter Error - No header filter set on column:",e.getField())}setHeaderFilterValue(e,t){e&&(e.modules.filter&&e.modules.filter.headerElement?(this.generateHeaderFilterElement(e,t,!0),e.modules.filter.success(t)):console.warn("Column Filter Error - No header filter set on column:",e.getField()))}reloadHeaderFilter(e){e&&(e.modules.filter&&e.modules.filter.headerElement?this.generateHeaderFilterElement(e,e.modules.filter.value,!0):console.warn("Column Filter Error - No header filter set on column:",e.getField()))}refreshFilter(){this.tableInitialized&&("remote"===this.table.options.filterMode?this.reloadData(null,!1,!1):this.refreshData(!0))}trackChanges(){this.changed=!0,this.dispatch("filter-changed")}hasChanged(){var e=this.changed;return this.changed=!1,e}setFilter(e,t,i,s){this.filterList=[],Array.isArray(e)||(e=[{field:e,type:t,value:i,params:s}]),this.addFilter(e)}addFilter(e,t,i,s){var o=!1;Array.isArray(e)||(e=[{field:e,type:t,value:i,params:s}]),e.forEach((e=>{(e=this.findFilter(e))&&(this.filterList.push(e),o=!0)})),o&&this.trackChanges()}findFilter(e){var t;if(Array.isArray(e))return this.findSubFilters(e);var i=!1;return"function"==typeof e.field?i=function(t){return e.field(t,e.type||{})}:H.filters[e.type]?i=(t=this.table.columnManager.getColumnByField(e.field))?function(i){return H.filters[e.type](e.value,t.getFieldValue(i),i,e.params||{})}:function(t){return H.filters[e.type](e.value,t[e.field],t,e.params||{})}:console.warn("Filter Error - No such filter type found, ignoring: ",e.type),e.func=i,!!e.func&&e}findSubFilters(e){var t=[];return e.forEach((e=>{(e=this.findFilter(e))&&t.push(e)})),!!t.length&&t}getFilters(e,t){var i=[];return e&&(i=this.getHeaderFilters()),t&&i.forEach((function(e){"function"==typeof e.type&&(e.type="function")})),i=i.concat(this.filtersToArray(this.filterList,t))}filtersToArray(e,t){var i=[];return e.forEach((e=>{var s;Array.isArray(e)?i.push(this.filtersToArray(e,t)):(s={field:e.field,type:e.type,value:e.value},t&&"function"==typeof s.type&&(s.type="function"),i.push(s))})),i}getHeaderFilters(){var e=[];for(var t in this.headerFilters)e.push({field:t,type:this.headerFilters[t].type,value:this.headerFilters[t].value});return e}removeFilter(e,t,i){Array.isArray(e)||(e=[{field:e,type:t,value:i}]),e.forEach((e=>{var t=-1;(t="object"==typeof e.field?this.filterList.findIndex((t=>e===t)):this.filterList.findIndex((t=>e.field===t.field&&e.type===t.type&&e.value===t.value)))>-1?this.filterList.splice(t,1):console.warn("Filter Error - No matching filter type found, ignoring: ",e.type)})),this.trackChanges()}clearFilter(e){this.filterList=[],e&&this.clearHeaderFilter(),this.trackChanges()}clearHeaderFilter(){this.headerFilters={},this.prevHeaderFilterChangeCheck="{}",this.headerFilterColumns.forEach((e=>{void 0!==e.modules.filter.value&&delete e.modules.filter.value,e.modules.filter.prevSuccess=void 0,this.reloadHeaderFilter(e)})),this.trackChanges()}search(e,t,i,s){var o=[],n=[];return Array.isArray(t)||(t=[{field:t,type:i,value:s}]),t.forEach((e=>{(e=this.findFilter(e))&&n.push(e)})),this.table.rowManager.rows.forEach((t=>{var i=!0;n.forEach((e=>{this.filterRecurse(e,t.getData())||(i=!1)})),i&&o.push("data"===e?t.getData("data"):t.getComponent())})),o}filter(e,t){var i=[],s=[];return this.subscribedExternal("dataFiltering")&&this.dispatchExternal("dataFiltering",this.getFilters(!0)),"remote"!==this.table.options.filterMode&&(this.filterList.length||Object.keys(this.headerFilters).length)?e.forEach((e=>{this.filterRow(e)&&i.push(e)})):i=e.slice(0),this.subscribedExternal("dataFiltered")&&(i.forEach((e=>{s.push(e.getComponent())})),this.dispatchExternal("dataFiltered",this.getFilters(!0),s)),i}filterRow(e,t){var i=!0,s=e.getData();for(var o in this.filterList.forEach((e=>{this.filterRecurse(e,s)||(i=!1)})),this.headerFilters)this.headerFilters[o].func(s)||(i=!1);return i}filterRecurse(e,t){var i=!1;return Array.isArray(e)?e.forEach((e=>{this.filterRecurse(e,t)&&(i=!0)})):i=e.func(t),i}}H.moduleName="filter",H.filters=F;var _={plaintext:function(e,t,i){return this.emptyToSpace(this.sanitizeHTML(e.getValue()))},html:function(e,t,i){return e.getValue()},textarea:function(e,t,i){return e.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(e.getValue()))},money:function(e,t,i){var s,o,n,r,a=parseFloat(e.getValue()),l="",h=t.decimal||".",d=t.thousand||",",c=t.negativeSign||"-",u=t.symbol||"",m=!!t.symbolAfter,p=void 0!==t.precision?t.precision:2;if(isNaN(a))return this.emptyToSpace(this.sanitizeHTML(e.getValue()));if(a<0&&(a=Math.abs(a),l=c),s=!1!==p?a.toFixed(p):a,o=(s=String(s).split("."))[0],n=s.length>1?h+s[1]:"",!1!==t.thousand)for(r=/(\d+)(\d{3})/;r.test(o);)o=o.replace(r,"$1"+d+"$2");return m?l+o+n+u:l+u+o+n},link:function(e,t,i){var s,o=e.getValue(),n=t.urlPrefix||"",r=t.download,a=o,l=document.createElement("a");if(t.labelField&&(s=e.getData(),a=function e(t,i){var s=i[t.shift()];return t.length&&"object"==typeof s?e(t,s):s}(t.labelField.split(this.table.options.nestedFieldSeparator),s)),t.label)switch(typeof t.label){case"string":a=t.label;break;case"function":a=t.label(e)}if(a){if(t.urlField&&(o=(s=e.getData())[t.urlField]),t.url)switch(typeof t.url){case"string":o=t.url;break;case"function":o=t.url(e)}return l.setAttribute("href",n+o),t.target&&l.setAttribute("target",t.target),t.download&&(r="function"==typeof r?r(e):!0===r?"":r,l.setAttribute("download",r)),l.innerHTML=this.emptyToSpace(this.sanitizeHTML(a)),l}return" "},image:function(e,t,i){var s=document.createElement("img"),o=e.getValue();switch(t.urlPrefix&&(o=t.urlPrefix+e.getValue()),t.urlSuffix&&(o+=t.urlSuffix),s.setAttribute("src",o),typeof t.height){case"number":s.style.height=t.height+"px";break;case"string":s.style.height=t.height}switch(typeof t.width){case"number":s.style.width=t.width+"px";break;case"string":s.style.width=t.width}return s.addEventListener("load",(function(){e.getRow().normalizeHeight()})),s},tickCross:function(e,t,i){var s=e.getValue(),o=e.getElement(),n=t.allowEmpty,r=t.allowTruthy,a=Object.keys(t).includes("trueValue"),l=void 0!==t.tickElement?t.tickElement:'',h=void 0!==t.crossElement?t.crossElement:'';return a&&s===t.trueValue||!a&&(r&&s||!0===s||"true"===s||"True"===s||1===s||"1"===s)?(o.setAttribute("aria-checked",!0),l||""):!n||"null"!==s&&""!==s&&null!=s?(o.setAttribute("aria-checked",!1),h||""):(o.setAttribute("aria-checked","mixed"),"")},datetime:function(e,t,i){var s,o=window.DateTime||luxon.DateTime,n=t.inputFormat||"yyyy-MM-dd HH:mm:ss",r=t.outputFormat||"dd/MM/yyyy HH:mm:ss",a=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",l=e.getValue();if(void 0!==o)return(s=o.isDateTime(l)?l:"iso"===n?o.fromISO(String(l)):o.fromFormat(String(l),n)).isValid?(t.timezone&&(s=s.setZone(t.timezone)),s.toFormat(r)):!0!==a&&l?"function"==typeof a?a(l):a:l;console.error("Format Error - 'datetime' formatter is dependant on luxon.js")},datetimediff:function(e,t,i){var s,o=window.DateTime||luxon.DateTime,n=t.inputFormat||"yyyy-MM-dd HH:mm:ss",r=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",a=void 0!==t.suffix&&t.suffix,l=void 0!==t.unit?t.unit:"days",h=void 0!==t.humanize&&t.humanize,d=void 0!==t.date?t.date:o.now(),c=e.getValue();if(void 0!==o)return(s=o.isDateTime(c)?c:"iso"===n?o.fromISO(String(c)):o.fromFormat(String(c),n)).isValid?h?s.diff(d,l).toHuman()+(a?" "+a:""):parseInt(s.diff(d,l)[l])+(a?" "+a:""):!0===r?c:"function"==typeof r?r(c):r;console.error("Format Error - 'datetimediff' formatter is dependant on luxon.js")},lookup:function(e,t,i){var s=e.getValue();return void 0===t[s]?(console.warn("Missing display value for "+s),s):t[s]},star:function(e,t,i){var s=e.getValue(),o=e.getElement(),n=t&&t.stars?t.stars:5,r=document.createElement("span"),a=document.createElementNS("http://www.w3.org/2000/svg","svg");r.style.verticalAlign="middle",a.setAttribute("width","14"),a.setAttribute("height","14"),a.setAttribute("viewBox","0 0 512 512"),a.setAttribute("xml:space","preserve"),a.style.padding="0 1px",s=s&&!isNaN(s)?parseInt(s):0,s=Math.max(0,Math.min(s,n));for(var l=1;l<=n;l++){var h=a.cloneNode(!0);h.innerHTML=l<=s?'':'',r.appendChild(h)}return o.style.whiteSpace="nowrap",o.style.overflow="hidden",o.style.textOverflow="ellipsis",o.setAttribute("aria-label",s),r},traffic:function(e,t,i){var s,o,n=this.sanitizeHTML(e.getValue())||0,r=document.createElement("span"),a=t&&t.max?t.max:100,l=t&&t.min?t.min:0,h=t&&void 0!==t.color?t.color:["red","orange","green"],d="#666666";if(!isNaN(n)&&void 0!==e.getValue()){switch(r.classList.add("tabulator-traffic-light"),o=parseFloat(n)<=a?parseFloat(n):a,o=parseFloat(o)>=l?parseFloat(o):l,s=(a-l)/100,o=Math.round((o-l)/s),typeof h){case"string":d=h;break;case"function":d=h(n);break;case"object":if(Array.isArray(h)){var c=100/h.length,u=Math.floor(o/c);u=Math.min(u,h.length-1),d=h[u=Math.max(u,0)];break}}return r.style.backgroundColor=d,r}},progress:function(e,t,i){var s,o,n,r,a,l=this.sanitizeHTML(e.getValue())||0,h=e.getElement(),d=t&&t.max?t.max:100,c=t&&t.min?t.min:0,u=t&&t.legendAlign?t.legendAlign:"center";switch(o=parseFloat(l)<=d?parseFloat(l):d,o=parseFloat(o)>=c?parseFloat(o):c,s=(d-c)/100,o=Math.round((o-c)/s),typeof t.color){case"string":n=t.color;break;case"function":n=t.color(l);break;case"object":if(Array.isArray(t.color)){var m=100/t.color.length,g=Math.floor(o/m);g=Math.min(g,t.color.length-1),g=Math.max(g,0),n=t.color[g];break}default:n="#2DC214"}switch(typeof t.legend){case"string":r=t.legend;break;case"function":r=t.legend(l);break;case"boolean":r=l;break;default:r=!1}switch(typeof t.legendColor){case"string":a=t.legendColor;break;case"function":a=t.legendColor(l);break;case"object":if(Array.isArray(t.legendColor)){m=100/t.legendColor.length,g=Math.floor(o/m);g=Math.min(g,t.legendColor.length-1),g=Math.max(g,0),a=t.legendColor[g]}break;default:a="#000"}h.style.minWidth="30px",h.style.position="relative",h.setAttribute("aria-label",o);var b=document.createElement("div");b.style.display="inline-block",b.style.position="absolute",b.style.width=o+"%",b.style.backgroundColor=n,b.style.height="100%",b.setAttribute("data-max",d),b.setAttribute("data-min",c);var f=document.createElement("div");if(f.style.position="relative",f.style.width="100%",f.style.height="100%",r){var v=document.createElement("div");v.style.position="absolute",v.style.top=0,v.style.left=0,v.style.textAlign=u,v.style.width="100%",v.style.color=a,v.innerHTML=r}return i((function(){if(!(e instanceof p)){var t=document.createElement("div");t.style.position="absolute",t.style.top="4px",t.style.bottom="4px",t.style.left="4px",t.style.right="4px",h.appendChild(t),h=t}h.appendChild(f),f.appendChild(b),r&&f.appendChild(v)})),""},color:function(e,t,i){return e.getElement().style.backgroundColor=this.sanitizeHTML(e.getValue()),""},buttonTick:function(e,t,i){return''},buttonCross:function(e,t,i){return''},rownum:function(e,t,i){return this.table.rowManager.activeRows.indexOf(e.getRow()._getSelf())+1||""},handle:function(e,t,i){return e.getElement().classList.add("tabulator-row-handle"),"
"},responsiveCollapse:function(e,t,i){var s=document.createElement("div"),o=e.getRow()._row.modules.responsiveLayout;function n(e){var t=o.element;o.open=e,t&&(o.open?(s.classList.add("open"),t.style.display=""):(s.classList.remove("open"),t.style.display="none"))}return s.classList.add("tabulator-responsive-collapse-toggle"),s.innerHTML="+-",e.getElement().classList.add("tabulator-row-handle"),s.addEventListener("click",(function(e){e.stopImmediatePropagation(),n(!o.open)})),n(o.open),s},rowSelection:function(e,t,i){var s=document.createElement("input"),o=!1;if(s.type="checkbox",s.setAttribute("aria-label","Select Row"),this.table.modExists("selectRow",!0))if(s.addEventListener("click",(e=>{e.stopPropagation()})),"function"==typeof e.getRow){var n=e.getRow();n instanceof w?(s.addEventListener("change",(e=>{"click"===this.table.options.selectableRangeMode&&o?o=!1:n.toggleSelect()})),"click"===this.table.options.selectableRangeMode&&s.addEventListener("click",(e=>{o=!0,this.table.modules.selectRow.handleComplexRowClick(n._row,e)})),s.checked=n.isSelected&&n.isSelected(),this.table.modules.selectRow.registerRowSelectCheckbox(n,s)):s=""}else s.addEventListener("change",(e=>{this.table.modules.selectRow.selectedRows.length?this.table.deselectRow():this.table.selectRow(t.rowRange)})),this.table.modules.selectRow.registerHeaderSelectCheckbox(s);return s}};class O extends o{constructor(e){super(e),this.registerColumnOption("formatter"),this.registerColumnOption("formatterParams"),this.registerColumnOption("formatterPrint"),this.registerColumnOption("formatterPrintParams"),this.registerColumnOption("formatterClipboard"),this.registerColumnOption("formatterClipboardParams"),this.registerColumnOption("formatterHtmlOutput"),this.registerColumnOption("formatterHtmlOutputParams"),this.registerColumnOption("titleFormatter"),this.registerColumnOption("titleFormatterParams")}initialize(){this.subscribe("cell-format",this.formatValue.bind(this)),this.subscribe("cell-rendered",this.cellRendered.bind(this)),this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("column-format",this.formatHeader.bind(this))}initializeColumn(e){e.modules.format=this.lookupFormatter(e,""),void 0!==e.definition.formatterPrint&&(e.modules.format.print=this.lookupFormatter(e,"Print")),void 0!==e.definition.formatterClipboard&&(e.modules.format.clipboard=this.lookupFormatter(e,"Clipboard")),void 0!==e.definition.formatterHtmlOutput&&(e.modules.format.htmlOutput=this.lookupFormatter(e,"HtmlOutput"))}lookupFormatter(e,t){var i={params:e.definition["formatter"+t+"Params"]||{}},s=e.definition["formatter"+t];switch(typeof s){case"string":O.formatters[s]?i.formatter=O.formatters[s]:(console.warn("Formatter Error - No such formatter found: ",s),i.formatter=O.formatters.plaintext);break;case"function":i.formatter=s;break;default:i.formatter=O.formatters.plaintext}return i}cellRendered(e){e.modules.format&&e.modules.format.renderedCallback&&!e.modules.format.rendered&&(e.modules.format.renderedCallback(),e.modules.format.rendered=!0)}formatHeader(e,t,i){var s,o,n,r;return e.definition.titleFormatter?(s=this.getFormatter(e.definition.titleFormatter),n=t=>{e.titleFormatterRendered=t},r={getValue:function(){return t},getElement:function(){return i}},o="function"==typeof(o=e.definition.titleFormatterParams||{})?o():o,s.call(this,r,o,n)):t}formatValue(e){var t=e.getComponent(),i="function"==typeof e.column.modules.format.params?e.column.modules.format.params(t):e.column.modules.format.params;return e.column.modules.format.formatter.call(this,t,i,(function(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t,e.modules.format.rendered=!1}))}formatExportValue(e,t){var i,s=e.column.modules.format[t];if(s){return i="function"==typeof s.params?s.params(component):s.params,s.formatter.call(this,e.getComponent(),i,(function(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t,e.modules.format.rendered=!1}))}return this.formatValue(e)}sanitizeHTML(e){if(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(e).replace(/[&<>"'`=\/]/g,(function(e){return t[e]}))}return e}emptyToSpace(e){return null==e||""===e?" ":e}getFormatter(e){switch(typeof e){case"string":O.formatters[e]?e=O.formatters[e]:(console.warn("Formatter Error - No such formatter found: ",e),e=O.formatters.plaintext);break;case"function":e=e;break;default:e=O.formatters.plaintext}return e}}O.moduleName="format",O.formatters=_;class A extends o{constructor(e){super(e),this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightPadding=0,this.initializationMode="left",this.active=!1,this.blocked=!0,this.registerColumnOption("frozen")}reset(){this.initializationMode="left",this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightMargin=0,this.active=!1,this.table.columnManager.headersElement.style.marginLeft=0,this.table.columnManager.element.style.paddingRight=0}initialize(){this.subscribe("cell-layout",this.layoutCell.bind(this)),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-width",this.layout.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("table-layout",this.layout.bind(this)),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("columns-loading",this.reset.bind(this)),this.subscribe("column-add",this.reinitializeColumns.bind(this)),this.subscribe("column-delete",this.reinitializeColumns.bind(this)),this.subscribe("table-redraw",this.layout.bind(this)),this.subscribe("layout-refreshing",this.blockLayout.bind(this)),this.subscribe("layout-refreshed",this.unblockLayout.bind(this))}blockLayout(){this.blocked=!0}unblockLayout(){this.blocked=!1}layoutCell(e){this.layoutElement(e.element,e.column)}reinitializeColumns(){this.reset(),this.table.columnManager.columnsByIndex.forEach((e=>{this.initializeColumn(e)}))}initializeColumn(e){var t={margin:0,edge:!1};e.isGroup||(this.frozenCheck(e)?(t.position=this.initializationMode,"left"==this.initializationMode?this.leftColumns.push(e):this.rightColumns.unshift(e),this.active=!0,e.modules.frozen=t):this.initializationMode="right")}frozenCheck(e){return e.parent.isGroup&&e.definition.frozen&&console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups"),e.parent.isGroup?this.frozenCheck(e.parent):e.definition.frozen}scrollHorizontal(){this.active&&(this.calcMargins(!0),this.layoutColumnPosition(),this.layoutCalcRows(),this.reinitializeRows())}calcMargins(e){e||(this.leftMargin=this._calcSpace(this.leftColumns,this.leftColumns.length)+"px",this.rightMargin=this._calcSpace(this.rightColumns,this.rightColumns.length)+"px",this.table.rowManager.tableElement.style.marginRight=this.rightMargin),this.rightPadding=this.table.rowManager.element.clientWidth+this.table.columnManager.scrollLeft}layoutCalcRows(){this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&this.table.modules.columnCalcs.topRow&&this.layoutRow(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&this.table.modules.columnCalcs.botRow&&this.layoutRow(this.table.modules.columnCalcs.botRow),this.table.modExists("groupRows")&&this.layoutGroupCalcs(this.table.modules.groupRows.getGroups()))}layoutGroupCalcs(e){e.forEach((e=>{e.calcs.top&&this.layoutRow(e.calcs.top),e.calcs.bottom&&this.layoutRow(e.calcs.bottom),e.groupList&&e.groupList.length&&this.layoutGroupCalcs(e.groupList&&e.groupList)}))}layoutColumnPosition(e){var t=[],i=0,s=0;this.table.columnManager.headersElement.style.marginLeft=this.leftMargin,this.table.columnManager.element.style.paddingRight=this.rightMargin,this.leftColumns.forEach(((s,o)=>{if(s.modules.frozen.marginValue=i+this.table.columnManager.scrollLeft,s.modules.frozen.margin=s.modules.frozen.marginValue+"px",s.visible&&(i+=s.getWidth()),o==this.leftColumns.length-1?s.modules.frozen.edge=!0:s.modules.frozen.edge=!1,s.parent.isGroup){var n=this.getColGroupParentElement(s);t.includes(n)||(this.layoutElement(n,s),t.push(n)),s.modules.frozen.edge&&n.classList.add("tabulator-frozen-"+s.modules.frozen.position)}else this.layoutElement(s.getElement(),s);e&&s.cells.forEach((e=>{this.layoutElement(e.getElement(!0),s)}))})),this.rightColumns.forEach(((t,i)=>{t.visible&&(s+=t.getWidth()),t.modules.frozen.marginValue=this.rightPadding-s,t.modules.frozen.margin=t.modules.frozen.marginValue+"px",i==this.rightColumns.length-1?t.modules.frozen.edge=!0:t.modules.frozen.edge=!1,t.parent.isGroup?this.layoutElement(this.getColGroupParentElement(t),t):this.layoutElement(t.getElement(),t),e&&t.cells.forEach((e=>{this.layoutElement(e.getElement(!0),t)}))}))}getColGroupParentElement(e){return e.parent.isGroup?this.getColGroupParentElement(e.parent):e.getElement()}layout(){this.active&&!this.blocked&&(this.calcMargins(),this.layoutColumnPosition(),this.reinitializeRows(),this.layoutCalcRows())}reinitializeRows(){var e=this.table.rowManager.getVisibleRows();this.table.rowManager.getRows().filter((t=>!e.includes(t))).forEach((e=>{e.deinitialize()})),e.forEach((e=>{"row"===e.type&&this.layoutRow(e)}))}layoutRow(e){e.getElement().style.paddingLeft=this.leftMargin,"fitDataFill"===this.table.options.layout&&this.rightColumns.length&&(this.table.rowManager.getTableElement().style.minWidth="calc(100% - "+this.rightMargin+")"),this.leftColumns.forEach((t=>{var i=e.getCell(t);i&&this.layoutElement(i.getElement(!0),t)})),this.rightColumns.forEach((t=>{var i=e.getCell(t);i&&this.layoutElement(i.getElement(!0),t)}))}layoutElement(e,t){t.modules.frozen&&(e.style.position="absolute",e.style.left=t.modules.frozen.margin,e.classList.add("tabulator-frozen"),t.modules.frozen.edge&&e.classList.add("tabulator-frozen-"+t.modules.frozen.position))}_calcSpace(e,t){var i=0;for(let s=0;s-1}isFrozen(){return!!this.rows.length}visibleRows(e,t){return this.rows.forEach((e=>{t.push(e)})),t}getRows(e){var t=e.slice(0);return this.rows.forEach((function(e){var i=t.indexOf(e);i>-1&&t.splice(i,1)})),t}freezeRow(e){e.modules.frozen?console.warn("Freeze Error - Row is already frozen"):(e.modules.frozen=!0,this.topElement.appendChild(e.getElement()),e.initialize(),e.normalizeHeight(),this.table.rowManager.adjustTableSize(),this.rows.push(e),this.refreshData(!1,"display"),this.styleRows())}unfreezeRow(e){this.rows.indexOf(e);e.modules.frozen?(e.modules.frozen=!1,this.detachRow(e),this.table.rowManager.adjustTableSize(),this.refreshData(!1,"display"),this.rows.length&&this.styleRows()):console.warn("Freeze Error - Row is already unfrozen")}detachRow(e){var t=this.rows.indexOf(e);if(t>-1){var i=e.getElement();i.parentNode&&i.parentNode.removeChild(i),this.rows.splice(t,1)}}styleRows(e){this.rows.forEach(((e,t)=>{this.table.rowManager.styleRow(e,t)}))}}B.moduleName="frozenRows";class I{constructor(e){return this._group=e,this.type="GroupComponent",new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._group.groupManager.table.componentFunctionBinder.handle("row",e._group,t)}})}getKey(){return this._group.key}getField(){return this._group.field}getElement(){return this._group.element}getRows(){return this._group.getRows(!0)}getSubGroups(){return this._group.getSubGroups(!0)}getParentGroup(){return!!this._group.parent&&this._group.parent.getComponent()}isVisible(){return this._group.visible}show(){this._group.show()}hide(){this._group.hide()}toggle(){this._group.toggleVisibility()}_getSelf(){return this._group}getTable(){return this._group.groupManager.table}}class N{constructor(e,t,i,s,o,n,r){this.groupManager=e,this.parent=t,this.key=s,this.level=i,this.field=o,this.hasSubGroups=i{e.modules&&delete e.modules.group})),this.element=!1,this.arrowElement=!1,this.elementContents=!1}createElements(){var e=document.createElement("div");e.classList.add("tabulator-arrow"),this.element=document.createElement("div"),this.element.classList.add("tabulator-row"),this.element.classList.add("tabulator-group"),this.element.classList.add("tabulator-group-level-"+this.level),this.element.setAttribute("role","rowgroup"),this.arrowElement=document.createElement("div"),this.arrowElement.classList.add("tabulator-group-toggle"),this.arrowElement.appendChild(e),!1!==this.groupManager.table.options.movableRows&&this.groupManager.table.modExists("moveRow")&&this.groupManager.table.modules.moveRow.initializeGroupHeader(this)}createValueGroups(){var e=this.level+1;this.groupManager.allowedValues&&this.groupManager.allowedValues[e]&&this.groupManager.allowedValues[e].forEach((t=>{this._createGroup(t,e)}))}addBindings(){this.groupManager.table.options.groupToggleElement&&("arrow"==this.groupManager.table.options.groupToggleElement?this.arrowElement:this.element).addEventListener("click",(e=>{e.stopPropagation(),e.stopImmediatePropagation(),this.toggleVisibility()}))}_createGroup(e,t){var i=t+"_"+e,s=new N(this.groupManager,this,t,e,this.groupManager.groupIDLookups[t].field,this.groupManager.headerGenerator[t]||this.groupManager.headerGenerator[0],!!this.old&&this.old.groups[i]);this.groups[i]=s,this.groupList.push(s)}_addRowToGroup(e){var t=this.level+1;if(this.hasSubGroups){var i=this.groupManager.groupIDLookups[t].func(e.getData()),s=t+"_"+i;this.groupManager.allowedValues&&this.groupManager.allowedValues[t]?this.groups[s]&&this.groups[s].addRow(e):(this.groups[s]||this._createGroup(i,t),this.groups[s].addRow(e))}}_addRow(e){this.rows.push(e),e.modules.group=this}insertRow(e,t,i){var s=this.conformRowData({});e.updateData(s);var o=this.rows.indexOf(t);o>-1?i?this.rows.splice(o+1,0,e):this.rows.splice(o,0,e):i?this.rows.push(e):this.rows.unshift(e),e.modules.group=this,this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this),this.groupManager.updateGroupRows(!0)}scrollHeader(e){this.arrowElement&&(this.arrowElement.style.marginLeft=e,this.groupList.forEach((function(t){t.scrollHeader(e)})))}getRowIndex(e){}conformRowData(e){return this.field?e[this.field]=this.key:console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"),this.parent&&(e=this.parent.conformRowData(e)),e}removeRow(e){var t=this.rows.indexOf(e),i=e.getElement();t>-1&&this.rows.splice(t,1),this.groupManager.table.options.groupValues||this.rows.length?(i.parentNode&&i.parentNode.removeChild(i),this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this)):(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this),this.groupManager.updateGroupRows(!0))}removeGroup(e){var t,i=e.level+"_"+e.key;this.groups[i]&&(delete this.groups[i],(t=this.groupList.indexOf(e))>-1&&this.groupList.splice(t,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))}getHeadersAndRows(e){var t=[];return t.push(this),this._visSet(),this.visible?this.groupList.length?this.groupList.forEach((function(i){t=t.concat(i.getHeadersAndRows(e))})):(!e&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),t.push(this.calcs.top)),t=t.concat(this.rows),!e&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),t.push(this.calcs.bottom))):this.groupList.length||"table"==this.groupManager.table.options.columnCalcs||this.groupManager.table.modExists("columnCalcs")&&(!e&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),t.push(this.calcs.top))),!e&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),t.push(this.calcs.bottom)))),t}getData(e,t){var i=[];return this._visSet(),(!e||e&&this.visible)&&this.rows.forEach((e=>{i.push(e.getData(t||"data"))})),i}getRowCount(){var e=0;return this.groupList.length?this.groupList.forEach((t=>{e+=t.getRowCount()})):e=this.rows.length,e}toggleVisibility(){this.visible?this.hide():this.show()}hide(){this.visible=!1,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination?this.groupManager.updateGroupRows(!0):(this.element.classList.remove("tabulator-group-visible"),this.groupList.length?this.groupList.forEach((e=>{e.getHeadersAndRows().forEach((e=>{e.detachElement()}))})):this.rows.forEach((e=>{var t=e.getElement();t.parentNode.removeChild(t)})),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()),this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!1)}show(){if(this.visible=!0,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination)this.groupManager.updateGroupRows(!0);else{this.element.classList.add("tabulator-group-visible");var e=this.generateElement();this.groupList.length?this.groupList.forEach((t=>{t.getHeadersAndRows().forEach((t=>{var i=t.getElement();e.parentNode.insertBefore(i,e.nextSibling),t.initialize(),e=i}))})):this.rows.forEach((t=>{var i=t.getElement();e.parentNode.insertBefore(i,e.nextSibling),t.initialize(),e=i})),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()}this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!0)}_visSet(){var e=[];"function"==typeof this.visible&&(this.rows.forEach((function(t){e.push(t.getData())})),this.visible=this.visible(this.key,this.getRowCount(),e,this.getComponent()))}getRowGroup(e){var t=!1;return this.groupList.length?this.groupList.forEach((function(i){var s=i.getRowGroup(e);s&&(t=s)})):this.rows.find((function(t){return t===e}))&&(t=this),t}getSubGroups(e){var t=[];return this.groupList.forEach((function(i){t.push(e?i.getComponent():i)})),t}getRows(e){var t=[];return this.rows.forEach((function(i){t.push(e?i.getComponent():i)})),t}generateGroupHeaderContents(){var e=[];for(this.rows.forEach((function(t){e.push(t.getData())})),this.elementContents=this.generator(this.key,this.getRowCount(),e,this.getComponent());this.element.firstChild;)this.element.removeChild(this.element.firstChild);"string"==typeof this.elementContents?this.element.innerHTML=this.elementContents:this.element.appendChild(this.elementContents),this.element.insertBefore(this.arrowElement,this.element.firstChild)}getPath(e=[]){return e.unshift(this.key),this.parent&&this.parent.getPath(e),e}getElement(){return this.elementContents?this.element:this.generateElement()}generateElement(){this.addBindings=!1,this._visSet(),this.visible?this.element.classList.add("tabulator-group-visible"):this.element.classList.remove("tabulator-group-visible");for(var e=0;ei.length&&console.warn("Error creating group headers, groupHeader array is shorter than groupBy array"),this.headerGenerator=[function(){return""}],this.startOpen=[function(){return!1}],this.langBind("groups|item",((e,t)=>{this.headerGenerator[0]=(i,s,o)=>(void 0===i?"":i)+"("+s+" "+(1===s?e:t.groups.items)+")"})),this.groupIDLookups=[],Array.isArray(e)||e)this.table.modExists("columnCalcs")&&"table"!=this.table.options.columnCalcs&&"both"!=this.table.options.columnCalcs&&this.table.modules.columnCalcs.removeCalcs();else if(this.table.modExists("columnCalcs")&&"group"!=this.table.options.columnCalcs)this.table.columnManager.getRealColumns().forEach((e=>{e.definition.topCalc&&this.table.modules.columnCalcs.initializeTopRow(),e.definition.bottomCalc&&this.table.modules.columnCalcs.initializeBottomRow()}));Array.isArray(e)||(e=[e]),e.forEach(((e,t)=>{var i,s;i="function"==typeof e?e:(s=this.table.columnManager.getColumnByField(e))?function(e){return s.getFieldValue(e)}:function(t){return t[e]},this.groupIDLookups.push({field:"function"!=typeof e&&e,func:i,values:!!this.allowedValues&&this.allowedValues[t]})})),t&&(Array.isArray(t)||(t=[t]),t.forEach((e=>{})),this.startOpen=t),i&&(this.headerGenerator=Array.isArray(i)?i:[i])}}rowSample(e,t){var i=this.getGroups(!1)[0];return t.push(i.getRows(!1)[0]),t}virtualRenderFill(){var e=this.table.rowManager.tableElement,t=this.table.rowManager.getVisibleRows();t=t.filter((e=>"group"!==e.type)),e.style.minWidth=t.length?"":this.table.columnManager.getWidth()+"px"}rowAddingIndex(e,t,i){this.assignRowToGroup(e);var s=e.modules.group.rows;return s.length>1&&(!t||t&&-1==s.indexOf(t)?i?s[0]!==e&&(t=s[0],this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)):s[s.length-1]!==e&&(t=s[s.length-1],this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)):this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)),t}trackChanges(){this.dispatch("group-changed")}setGroupBy(e){this.table.options.groupBy=e,this.initialized?this.configureGroupSetup():this.initialize(),this.refreshData(),this.trackChanges()}setGroupValues(e){this.table.options.groupValues=e,this.configureGroupSetup(),this.refreshData(),this.trackChanges()}setGroupStartOpen(e){this.table.options.groupStartOpen=e,this.configureGroupSetup(),this.table.options.groupBy?(this.refreshData(),this.trackChanges()):console.warn("Grouping Update - cant refresh view, no groups have been set")}setGroupHeader(e){this.table.options.groupHeader=e,this.configureGroupSetup(),this.table.options.groupBy?(this.refreshData(),this.trackChanges()):console.warn("Grouping Update - cant refresh view, no groups have been set")}userGetGroups(e){return this.getGroups(!0)}userGetGroupedData(){return this.table.options.groupBy?this.getGroupedData():this.getData()}rowGetGroup(e){return!!e.modules.group&&e.modules.group.getComponent()}rowMoving(e,t,i){!i&&t instanceof N&&(t=this.table.rowManager.prevDisplayRow(e)||t);var s=t instanceof N?t:t.modules.group,o=e instanceof N?e:e.modules.group;s===o?this.table.rowManager.moveRowInArray(s.rows,e,t,i):(o&&o.removeRow(e),s.insertRow(e,t,i))}rowDeleting(e){e.modules.group&&e.modules.group.removeRow(e)}rowsUpdated(e){this.updateGroupRows(!0)}cellUpdated(e){this.reassignRowToGroup(e.row)}setDisplayIndex(e){this.displayIndex=e}getDisplayIndex(){return this.displayIndex}getRows(e){return this.table.options.groupBy&&this.groupIDLookups.length?(this.dispatchExternal("dataGrouping"),this.generateGroups(e),this.subscribedExternal("dataGrouped")&&this.dispatchExternal("dataGrouped",this.getGroups(!0)),this.updateGroupRows()):e.slice(0)}getGroups(e){var t=[];return this.groupList.forEach((function(i){t.push(e?i.getComponent():i)})),t}getChildGroups(e){var t=[];return e||(e=this),e.groupList.forEach((e=>{e.groupList.length?t=t.concat(this.getChildGroups(e)):t.push(e)})),t}wipe(){this.groupList.forEach((function(e){e.wipe()}))}pullGroupListData(e){var t=[];return e.forEach((e=>{var i={level:0,rowCount:0,headerContent:""},s=[];e.hasSubGroups?(s=this.pullGroupListData(e.groupList),i.level=e.level,i.rowCount=s.length-e.groupList.length,i.headerContent=e.generator(e.key,i.rowCount,e.rows,e),t.push(i),t=t.concat(s)):(i.level=e.level,i.headerContent=e.generator(e.key,e.rows.length,e.rows,e),i.rowCount=e.getRows().length,t.push(i),e.getRows().forEach((e=>{t.push(e.getData("data"))})))})),t}getGroupedData(){return this.pullGroupListData(this.groupList)}getRowGroup(e){var t=!1;return this.options("dataTree")&&(e=this.table.modules.dataTree.getTreeParentRoot(e)),this.groupList.forEach((i=>{var s=i.getRowGroup(e);s&&(t=s)})),t}countGroups(){return this.groupList.length}generateGroups(e){var t=this.groups;this.groups={},this.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach((e=>{this.createGroup(e,0,t)})),e.forEach((e=>{this.assignRowToExistingGroup(e,t)}))):e.forEach((e=>{this.assignRowToGroup(e,t)}))}createGroup(e,t,i){var s,o=t+"_"+e;i=i||[],s=new N(this,!1,t,e,this.groupIDLookups[0].field,this.headerGenerator[0],i[o]),this.groups[o]=s,this.groupList.push(s)}assignRowToExistingGroup(e,t){var i="0_"+this.groupIDLookups[0].func(e.getData());this.groups[i]&&this.groups[i].addRow(e)}assignRowToGroup(e,t){var i=this.groupIDLookups[0].func(e.getData()),s=!this.groups["0_"+i];return s&&this.createGroup(i,0,t),this.groups["0_"+i].addRow(e),!s}reassignRowToGroup(e){if("row"===e.type){var t=e.modules.group,i=t.getPath(),s=this.getExpectedPath(e);i.length==s.length&&i.every(((e,t)=>e===s[t]))||(t.removeRow(e),this.assignRowToGroup(e,this.groups),this.refreshData(!0))}}getExpectedPath(e){var t=[],i=e.getData();return this.groupIDLookups.forEach((e=>{t.push(e.func(i))})),t}updateGroupRows(e){var t=[];return this.groupList.forEach((e=>{t=t.concat(e.getHeadersAndRows())})),e&&this.refreshData(!0,this.displayHandler),t}scrollHeaders(e){"virtual"===this.table.options.renderHorizontal&&(e-=this.table.columnManager.renderer.vDomPadLeft),e+="px",this.groupList.forEach((t=>{t.scrollHeader(e)}))}removeGroup(e){var t,i=e.level+"_"+e.key;this.groups[i]&&(delete this.groups[i],(t=this.groupList.indexOf(e))>-1&&this.groupList.splice(t,1))}}V.moduleName="groupRows";class W extends o{constructor(e){super(e),this.history=[],this.index=-1,this.registerTableOption("history",!1)}initialize(){this.table.options.history&&(this.subscribe("cell-value-updated",this.cellUpdated.bind(this)),this.subscribe("cell-delete",this.clearComponentHistory.bind(this)),this.subscribe("row-delete",this.rowDeleted.bind(this)),this.subscribe("rows-wipe",this.clear.bind(this)),this.subscribe("row-added",this.rowAdded.bind(this)),this.subscribe("row-move",this.rowMoved.bind(this))),this.registerTableFunction("undo",this.undo.bind(this)),this.registerTableFunction("redo",this.redo.bind(this)),this.registerTableFunction("getHistoryUndoSize",this.getHistoryUndoSize.bind(this)),this.registerTableFunction("getHistoryRedoSize",this.getHistoryRedoSize.bind(this)),this.registerTableFunction("clearHistory",this.clear.bind(this))}rowMoved(e,t,i){this.action("rowMove",e,{posFrom:this.table.rowManager.getRowPosition(e),posTo:this.table.rowManager.getRowPosition(t),to:t,after:i})}rowAdded(e,t,i,s){this.action("rowAdd",e,{data:t,pos:i,index:s})}rowDeleted(e){var t,i;this.table.options.groupBy?(t=(i=e.getComponent().getGroup().rows).indexOf(e))&&(t=i[t-1]):(t=e.table.rowManager.getRowIndex(e))&&(t=e.table.rowManager.rows[t-1]),this.action("rowDelete",e,{data:e.getData(),pos:!t,index:t})}cellUpdated(e){this.action("cellEdit",e,{oldValue:e.oldValue,newValue:e.value})}clear(){this.history=[],this.index=-1}action(e,t,i){this.history=this.history.slice(0,this.index+1),this.history.push({type:e,component:t,data:i}),this.index++}getHistoryUndoSize(){return this.index+1}getHistoryRedoSize(){return this.history.length-(this.index+1)}clearComponentHistory(e){var t=this.history.findIndex((function(t){return t.component===e}));t>-1&&(this.history.splice(t,1),t<=this.index&&this.index--,this.clearComponentHistory(e))}undo(){if(this.index>-1){let e=this.history[this.index];return W.undoers[e.type].call(this,e),this.index--,this.dispatchExternal("historyUndo",e.type,e.component.getComponent(),e.data),!0}return console.warn("History Undo Error - No more history to undo"),!1}redo(){if(this.history.length-1>this.index){this.index++;let e=this.history[this.index];return W.redoers[e.type].call(this,e),this.dispatchExternal("historyRedo",e.type,e.component.getComponent(),e.data),!0}return console.warn("History Redo Error - No more history to redo"),!1}_rebindRow(e,t){this.history.forEach((function(i){if(i.component instanceof C)i.component===e&&(i.component=t);else if(i.component instanceof g&&i.component.row===e){var s=i.component.column.getField();s&&(i.component=t.getCell(s))}}))}}W.moduleName="history",W.undoers={cellEdit:function(e){e.component.setValueProcessData(e.data.oldValue),e.component.cellRendered()},rowAdd:function(e){e.component.deleteActual()},rowDelete:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t)},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.rows[e.data.posFrom],!e.data.after),this.table.rowManager.redraw()}},W.redoers={cellEdit:function(e){e.component.setValueProcessData(e.data.newValue),e.component.cellRendered()},rowAdd:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t)},rowDelete:function(e){e.component.deleteActual()},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.rows[e.data.posTo],e.data.after),this.table.rowManager.redraw()}};class G extends o{constructor(e){super(e),this.fieldIndex=[],this.hasIndex=!1}initialize(){this.tableElementCheck()}tableElementCheck(){this.table.originalElement&&"TABLE"===this.table.originalElement.tagName&&(this.table.originalElement.childNodes.length?this.parseTable():console.warn("Unable to parse data from empty table tag, Tabulator should be initialized on a div tag unless importing data from a table element."))}parseTable(){var e=this.table.originalElement,t=this.table.options,i=(t.columns,e.getElementsByTagName("th")),s=e.getElementsByTagName("tbody")[0],o=[];this.hasIndex=!1,this.dispatchExternal("htmlImporting"),s=s?s.getElementsByTagName("tr"):[],this._extractOptions(e,t),i.length?this._extractHeaders(i,s):this._generateBlankHeaders(i,s);for(var n=0;n{n[e.toLowerCase()]=e})),s){var a,l=s[r];l&&"object"==typeof l&&l.name&&0===l.name.indexOf("tabulator-")&&(a=l.name.replace("tabulator-",""),void 0!==n[a]&&(t[n[a]]=this._attribValue(l.value)))}}_attribValue(e){return"true"===e||"false"!==e&&e}_findCol(e){return this.table.options.columns.find((t=>t.title===e))||!1}_extractHeaders(e,t){for(var i=0;i(console.error("Import Error:",e||"Unable to import data"),Promise.reject(e))))}lookupImporter(e){var t;return e||(e=this.table.options.importFormat),(t="string"==typeof e?U.importers[e]:e)||console.error("Import Error - Importer not found:",e),t}importFromFile(e,t){var i=this.lookupImporter(e);if(i)return this.pickFile(t).then(this.importData.bind(this,i)).then(this.structureData.bind(this)).then(this.setData.bind(this)).catch((e=>(console.error("Import Error:",e||"Unable to import file"),Promise.reject(e))))}pickFile(e){return new Promise(((t,i)=>{var s=document.createElement("input");s.type="file",s.accept=e,s.addEventListener("change",(e=>{var o=s.files[0],n=new FileReader;switch(this.table.options.importReader){case"buffer":n.readAsArrayBuffer(o);break;case"binary":n.readAsBinaryString(o);break;case"url":n.readAsDataURL(o);break;case"text":default:n.readAsText(o)}n.onload=e=>{t(n.result)},n.onerror=e=>{console.warn("File Load Error - Unable to read file"),i()}})),s.click()}))}importData(e,t){var i=e.call(this.table,t);return i instanceof Promise?i:i?Promise.resolve(i):Promise.reject()}structureData(e){return Array.isArray(e)&&e.length&&Array.isArray(e[0])?this.table.options.autoColumns?this.structureArrayToObject(e):this.structureArrayToColumns(e):e}structureArrayToObject(e){var t=e.shift();return e.map((e=>{var i={};return t.forEach(((t,s)=>{i[t]=e[s]})),i}))}structureArrayToColumns(e){var t=[],i=this.table.getColumns();return i[0]&&e[0][0]&&i[0].getDefinition().title===e[0][0]&&e.shift(),e.forEach((e=>{var s={};e.forEach(((e,t)=>{var o=i[t];o&&(s[o.getField()]=e)})),t.push(s)})),t}setData(e){return this.table.setData(e)}}U.moduleName="import",U.importers=j;class X extends o{constructor(e){super(e),this.eventMap={rowClick:"row-click",rowDblClick:"row-dblclick",rowContext:"row-contextmenu",rowMouseEnter:"row-mouseenter",rowMouseLeave:"row-mouseleave",rowMouseOver:"row-mouseover",rowMouseOut:"row-mouseout",rowMouseMove:"row-mousemove",rowTap:"row",rowDblTap:"row",rowTapHold:"row",cellClick:"cell-click",cellDblClick:"cell-dblclick",cellContext:"cell-contextmenu",cellMouseEnter:"cell-mouseenter",cellMouseLeave:"cell-mouseleave",cellMouseOver:"cell-mouseover",cellMouseOut:"cell-mouseout",cellMouseMove:"cell-mousemove",cellTap:"cell",cellDblTap:"cell",cellTapHold:"cell",headerClick:"column-click",headerDblClick:"column-dblclick",headerContext:"column-contextmenu",headerMouseEnter:"column-mouseenter",headerMouseLeave:"column-mouseleave",headerMouseOver:"column-mouseover",headerMouseOut:"column-mouseout",headerMouseMove:"column-mousemove",headerTap:"column",headerDblTap:"column",headerTapHold:"column",groupClick:"group-click",groupDblClick:"group-dblclick",groupContext:"group-contextmenu",groupMouseEnter:"group-mouseenter",groupMouseLeave:"group-mouseleave",groupMouseOver:"group-mouseover",groupMouseOut:"group-mouseout",groupMouseMove:"group-mousemove",groupTap:"group",groupDblTap:"group",groupTapHold:"group"},this.subscribers={},this.touchSubscribers={},this.columnSubscribers={},this.touchWatchers={row:{tap:null,tapDbl:null,tapHold:null},cell:{tap:null,tapDbl:null,tapHold:null},column:{tap:null,tapDbl:null,tapHold:null},group:{tap:null,tapDbl:null,tapHold:null}},this.registerColumnOption("headerClick"),this.registerColumnOption("headerDblClick"),this.registerColumnOption("headerContext"),this.registerColumnOption("headerMouseEnter"),this.registerColumnOption("headerMouseLeave"),this.registerColumnOption("headerMouseOver"),this.registerColumnOption("headerMouseOut"),this.registerColumnOption("headerMouseMove"),this.registerColumnOption("headerTap"),this.registerColumnOption("headerDblTap"),this.registerColumnOption("headerTapHold"),this.registerColumnOption("cellClick"),this.registerColumnOption("cellDblClick"),this.registerColumnOption("cellContext"),this.registerColumnOption("cellMouseEnter"),this.registerColumnOption("cellMouseLeave"),this.registerColumnOption("cellMouseOver"),this.registerColumnOption("cellMouseOut"),this.registerColumnOption("cellMouseMove"),this.registerColumnOption("cellTap"),this.registerColumnOption("cellDblTap"),this.registerColumnOption("cellTapHold")}initialize(){this.initializeExternalEvents(),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("cell-dblclick",this.cellContentsSelectionFixer.bind(this))}cellContentsSelectionFixer(e,t){if(!this.table.modExists("edit")||this.table.modules.edit.currentCell!==this){e.preventDefault();try{if(document.selection)(i=document.body.createTextRange()).moveToElementText(this.element),i.select();else if(window.getSelection){var i;(i=document.createRange()).selectNode(this.element),window.getSelection().removeAllRanges(),window.getSelection().addRange(i)}}catch(e){}}}initializeExternalEvents(){for(let e in this.eventMap)this.subscriptionChangeExternal(e,this.subscriptionChanged.bind(this,e))}subscriptionChanged(e,t){t?this.subscribers[e]||(this.eventMap[e].includes("-")?(this.subscribers[e]=this.handle.bind(this,e),this.subscribe(this.eventMap[e],this.subscribers[e])):this.subscribeTouchEvents(e)):this.eventMap[e].includes("-")?!this.subscribers[e]||this.columnSubscribers[e]||this.subscribedExternal(e)||(this.unsubscribe(this.eventMap[e],this.subscribers[e]),delete this.subscribers[e]):this.unsubscribeTouchEvents(e)}subscribeTouchEvents(e){var t=this.eventMap[e];this.touchSubscribers[t+"-touchstart"]||(this.touchSubscribers[t+"-touchstart"]=this.handleTouch.bind(this,t,"start"),this.touchSubscribers[t+"-touchend"]=this.handleTouch.bind(this,t,"end"),this.subscribe(t+"-touchstart",this.touchSubscribers[t+"-touchstart"]),this.subscribe(t+"-touchend",this.touchSubscribers[t+"-touchend"])),this.subscribers[e]=!0}unsubscribeTouchEvents(e){var t=!0,i=this.eventMap[e];if(this.subscribers[e]&&!this.subscribedExternal(e)){delete this.subscribers[e];for(let e in this.eventMap)this.eventMap[e]===i&&this.subscribers[e]&&(t=!1);t&&(this.unsubscribe(i+"-touchstart",this.touchSubscribers[i+"-touchstart"]),this.unsubscribe(i+"-touchend",this.touchSubscribers[i+"-touchend"]),delete this.touchSubscribers[i+"-touchstart"],delete this.touchSubscribers[i+"-touchend"])}}initializeColumn(e){var t=e.definition;for(let i in this.eventMap)t[i]&&(this.subscriptionChanged(i,!0),this.columnSubscribers[i]||(this.columnSubscribers[i]=[]),this.columnSubscribers[i].push(e))}handle(e,t,i){this.dispatchEvent(e,t,i)}handleTouch(e,t,i,s){var o=this.touchWatchers[e];switch("column"===e&&(e="header"),t){case"start":o.tap=!0,clearTimeout(o.tapHold),o.tapHold=setTimeout((()=>{clearTimeout(o.tapHold),o.tapHold=null,o.tap=null,clearTimeout(o.tapDbl),o.tapDbl=null,this.dispatchEvent(e+"TapHold",i,s)}),1e3);break;case"end":o.tap&&(o.tap=null,this.dispatchEvent(e+"Tap",i,s)),o.tapDbl?(clearTimeout(o.tapDbl),o.tapDbl=null,this.dispatchEvent(e+"DblTap",i,s)):o.tapDbl=setTimeout((()=>{clearTimeout(o.tapDbl),o.tapDbl=null}),300),clearTimeout(o.tapHold),o.tapHold=null}}dispatchEvent(e,t,i){var s,o=i.getComponent();this.columnSubscribers[e]&&(i instanceof g?s=i.column.definition[e]:i instanceof v&&(s=i.definition[e]),s&&s(t,o)),this.dispatchExternal(e,t,o)}}X.moduleName="interaction";class q extends o{constructor(e){super(e),this.watchKeys=null,this.pressedKeys=null,this.keyupBinding=!1,this.keydownBinding=!1,this.registerTableOption("keybindings",{}),this.registerTableOption("tabEndNewRow",!1)}initialize(){var e=this.table.options.keybindings,t={};this.watchKeys={},this.pressedKeys=[],!1!==e&&(Object.assign(t,q.bindings),Object.assign(t,e),this.mapBindings(t),this.bindEvents()),this.subscribe("table-destroy",this.clearBindings.bind(this))}mapBindings(e){for(let t in e)q.actions[t]?e[t]&&("object"!=typeof e[t]&&(e[t]=[e[t]]),e[t].forEach((e=>{(Array.isArray(e)?e:[e]).forEach((e=>{this.mapBinding(t,e)}))}))):console.warn("Key Binding Error - no such action:",t)}mapBinding(e,t){var i={action:q.actions[e],keys:[],ctrl:!1,shift:!1,meta:!1};t.toString().toLowerCase().split(" ").join("").split("+").forEach((e=>{switch(e){case"ctrl":i.ctrl=!0;break;case"shift":i.shift=!0;break;case"meta":i.meta=!0;break;default:e=isNaN(e)?e.toUpperCase().charCodeAt(0):parseInt(e),i.keys.push(e),this.watchKeys[e]||(this.watchKeys[e]=[]),this.watchKeys[e].push(i)}}))}bindEvents(){var e=this;this.keyupBinding=function(t){var i=t.keyCode,s=e.watchKeys[i];s&&(e.pressedKeys.push(i),s.forEach((function(i){e.checkBinding(t,i)})))},this.keydownBinding=function(t){var i=t.keyCode;if(e.watchKeys[i]){var s=e.pressedKeys.indexOf(i);s>-1&&e.pressedKeys.splice(s,1)}},this.table.element.addEventListener("keydown",this.keyupBinding),this.table.element.addEventListener("keyup",this.keydownBinding)}clearBindings(){this.keyupBinding&&this.table.element.removeEventListener("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.removeEventListener("keyup",this.keydownBinding)}checkBinding(e,t){var i=!0;return e.ctrlKey==t.ctrl&&e.shiftKey==t.shift&&e.metaKey==t.meta&&(t.keys.forEach((e=>{-1==this.pressedKeys.indexOf(e)&&(i=!1)})),i&&t.action.call(this,e),!0)}}q.moduleName="keybindings",q.bindings={navPrev:"shift + 9",navNext:9,navUp:38,navDown:40,scrollPageUp:33,scrollPageDown:34,scrollToStart:36,scrollToEnd:35,undo:["ctrl + 90","meta + 90"],redo:["ctrl + 89","meta + 89"],copyToClipboard:["ctrl + 67","meta + 89"]},q.actions={keyBlock:function(e){e.stopPropagation(),e.preventDefault()},scrollPageUp:function(e){var t=this.table.rowManager,i=t.scrollTop-t.element.clientHeight;t.element.scrollHeight;e.preventDefault(),t.displayRowsCount&&(i>=0?t.element.scrollTop=i:t.scrollToRow(t.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(e){var t=this.table.rowManager,i=t.scrollTop+t.element.clientHeight,s=t.element.scrollHeight;e.preventDefault(),t.displayRowsCount&&(i<=s?t.element.scrollTop=i:t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1])),this.table.element.focus()},scrollToStart:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[0]),this.table.element.focus()},scrollToEnd:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1]),this.table.element.focus()},navPrev:function(e){this.dispatch("keybinding-nav-prev",e)},navNext:function(e){this.dispatch("keybinding-nav-next",e)},navLeft:function(e){this.dispatch("keybinding-nav-left",e)},navRight:function(e){this.dispatch("keybinding-nav-right",e)},navUp:function(e){this.dispatch("keybinding-nav-up",e)},navDown:function(e){this.dispatch("keybinding-nav-down",e)},undo:function(e){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(e.preventDefault(),this.table.modules.history.undo()))},redo:function(e){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(e.preventDefault(),this.table.modules.history.redo()))},copyToClipboard:function(e){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}};class K extends o{constructor(e){super(e),this.menuContainer=null,this.nestedMenuBlock=!1,this.currentComponent=null,this.rootPopup=null,this.columnSubscribers={},this.registerTableOption("menuContainer",void 0),this.registerTableOption("rowContextMenu",!1),this.registerTableOption("rowClickMenu",!1),this.registerTableOption("groupContextMenu",!1),this.registerTableOption("groupClickMenu",!1),this.registerColumnOption("headerContextMenu"),this.registerColumnOption("headerClickMenu"),this.registerColumnOption("headerMenu"),this.registerColumnOption("headerMenuIcon"),this.registerColumnOption("contextMenu"),this.registerColumnOption("clickMenu")}initialize(){this.deprecationCheck(),this.initializeRowWatchers(),this.initializeGroupWatchers(),this.subscribe("column-init",this.initializeColumn.bind(this))}deprecationCheck(){void 0!==this.table.options.menuContainer&&(console.warn("Use of the menuContainer option is now deprecated. Please use the popupContainer option instead"),this.table.options.popupContainer=this.table.options.menuContainer)}initializeRowWatchers(){this.table.options.rowContextMenu&&(this.subscribe("row-contextmenu",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu)),this.table.on("rowTapHold",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu))),this.table.options.rowClickMenu&&this.subscribe("row-click",this.loadMenuEvent.bind(this,this.table.options.rowClickMenu))}initializeGroupWatchers(){this.table.options.groupContextMenu&&(this.subscribe("group-contextmenu",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu)),this.table.on("groupTapHold",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu))),this.table.options.groupClickMenu&&this.subscribe("group-click",this.loadMenuEvent.bind(this,this.table.options.groupClickMenu))}initializeColumn(e){var t=e.definition;t.headerContextMenu&&!this.columnSubscribers.headerContextMenu&&(this.columnSubscribers.headerContextMenu=this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"),this.subscribe("column-contextmenu",this.columnSubscribers.headerContextMenu),this.table.on("headerTapHold",this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"))),t.headerClickMenu&&!this.columnSubscribers.headerClickMenu&&(this.columnSubscribers.headerClickMenu=this.loadMenuTableColumnEvent.bind(this,"headerClickMenu"),this.subscribe("column-click",this.columnSubscribers.headerClickMenu)),t.headerMenu&&this.initializeColumnHeaderMenu(e),t.contextMenu&&!this.columnSubscribers.contextMenu&&(this.columnSubscribers.contextMenu=this.loadMenuTableCellEvent.bind(this,"contextMenu"),this.subscribe("cell-contextmenu",this.columnSubscribers.contextMenu),this.table.on("cellTapHold",this.loadMenuTableCellEvent.bind(this,"contextMenu"))),t.clickMenu&&!this.columnSubscribers.clickMenu&&(this.columnSubscribers.clickMenu=this.loadMenuTableCellEvent.bind(this,"clickMenu"),this.subscribe("cell-click",this.columnSubscribers.clickMenu))}initializeColumnHeaderMenu(e){var t,i=e.definition.headerMenuIcon;(t=document.createElement("span")).classList.add("tabulator-header-popup-button"),i?("function"==typeof i&&(i=i(e.getComponent())),i instanceof HTMLElement?t.appendChild(i):t.innerHTML=i):t.innerHTML="⋮",t.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault(),this.loadMenuEvent(e.definition.headerMenu,t,e)})),e.titleElement.insertBefore(t,e.titleElement.firstChild)}loadMenuTableCellEvent(e,t,i){i._cell&&(i=i._cell),i.column.definition[e]&&this.loadMenuEvent(i.column.definition[e],t,i)}loadMenuTableColumnEvent(e,t,i){i._column&&(i=i._column),i.definition[e]&&this.loadMenuEvent(i.definition[e],t,i)}loadMenuEvent(e,t,i){i._group?i=i._group:i._row&&(i=i._row),e="function"==typeof e?e.call(this.table,t,i.getComponent()):e,this.loadMenu(t,i,e)}loadMenu(e,t,i,s,o){var n,r=!(e instanceof MouseEvent),a=document.createElement("div");if(a.classList.add("tabulator-menu"),r||e.preventDefault(),i&&i.length){if(s)n=o.child(a);else{if(this.nestedMenuBlock){if(this.rootPopup)return}else this.nestedMenuBlock=setTimeout((()=>{this.nestedMenuBlock=!1}),100);this.rootPopup&&this.rootPopup.hide(),this.rootPopup=n=this.popup(a)}i.forEach((e=>{var i=document.createElement("div"),s=e.label,o=e.disabled;e.separator?i.classList.add("tabulator-menu-separator"):(i.classList.add("tabulator-menu-item"),"function"==typeof s&&(s=s.call(this.table,t.getComponent())),s instanceof Node?i.appendChild(s):i.innerHTML=s,"function"==typeof o&&(o=o.call(this.table,t.getComponent())),o?(i.classList.add("tabulator-menu-item-disabled"),i.addEventListener("click",(e=>{e.stopPropagation()}))):e.menu&&e.menu.length?i.addEventListener("click",(s=>{s.stopPropagation(),this.loadMenu(s,t,e.menu,i,n)})):e.action&&i.addEventListener("click",(i=>{e.action(i,t.getComponent())})),e.menu&&e.menu.length&&i.classList.add("tabulator-menu-item-submenu")),a.appendChild(i)})),a.addEventListener("click",(e=>{this.rootPopup.hide()})),n.show(s||e),n===this.rootPopup&&(this.rootPopup.hideOnBlur((()=>{this.rootPopup=null,this.currentComponent&&(this.dispatchExternal("menuClosed",this.currentComponent.getComponent()),this.currentComponent=null)})),this.currentComponent=t,this.dispatchExternal("menuOpened",t.getComponent()))}}}K.moduleName="menu";class J extends o{constructor(e){super(e),this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=250,this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.startX=0,this.autoScrollMargin=40,this.autoScrollStep=5,this.autoScrollTimeout=!1,this.touchMove=!1,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this),this.registerTableOption("movableColumns",!1)}createPlaceholderElement(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.classList.add("tabulator-col-placeholder"),e}initialize(){this.table.options.movableColumns&&this.subscribe("column-init",this.initializeColumn.bind(this))}initializeColumn(e){var i,s=this,o={};e.modules.frozen||e.isGroup||(i=e.getElement(),o.mousemove=function(o){e.parent===s.moving.parent&&((s.touchMove?o.touches[0].pageX:o.pageX)-t.elOffset(i).left+s.table.columnManager.element.scrollLeft>e.getWidth()/2?s.toCol===e&&s.toColAfter||(i.parentNode.insertBefore(s.placeholderElement,i.nextSibling),s.moveColumn(e,!0)):(s.toCol!==e||s.toColAfter)&&(i.parentNode.insertBefore(s.placeholderElement,i),s.moveColumn(e,!1)))}.bind(s),i.addEventListener("mousedown",(function(t){s.touchMove=!1,1===t.which&&(s.checkTimeout=setTimeout((function(){s.startMove(t,e)}),s.checkPeriod))})),i.addEventListener("mouseup",(function(e){1===e.which&&s.checkTimeout&&clearTimeout(s.checkTimeout)})),s.bindTouchEvents(e)),e.modules.moveColumn=o}bindTouchEvents(e){var t,i,s,o,n,r,a=e.getElement(),l=!1;a.addEventListener("touchstart",(a=>{this.checkTimeout=setTimeout((()=>{this.touchMove=!0,t=e.nextColumn(),s=t?t.getWidth()/2:0,i=e.prevColumn(),o=i?i.getWidth()/2:0,n=0,r=0,l=!1,this.startMove(a,e)}),this.checkPeriod)}),{passive:!0}),a.addEventListener("touchmove",(a=>{var h,d;this.moving&&(this.moveHover(a),l||(l=a.touches[0].pageX),(h=a.touches[0].pageX-l)>0?t&&h-n>s&&(d=t)!==e&&(l=a.touches[0].pageX,d.getElement().parentNode.insertBefore(this.placeholderElement,d.getElement().nextSibling),this.moveColumn(d,!0)):i&&-h-r>o&&(d=i)!==e&&(l=a.touches[0].pageX,d.getElement().parentNode.insertBefore(this.placeholderElement,d.getElement()),this.moveColumn(d,!1)),d&&(t=d.nextColumn(),n=s,s=t?t.getWidth()/2:0,i=d.prevColumn(),r=o,o=i?i.getWidth()/2:0))}),{passive:!0}),a.addEventListener("touchend",(e=>{this.checkTimeout&&clearTimeout(this.checkTimeout),this.moving&&this.endMove(e)}))}startMove(e,i){var s=i.getElement(),o=this.table.columnManager.getElement(),n=this.table.columnManager.getHeadersElement();this.moving=i,this.startX=(this.touchMove?e.touches[0].pageX:e.pageX)-t.elOffset(s).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=i.getWidth()+"px",this.placeholderElement.style.height=i.getHeight()+"px",s.parentNode.insertBefore(this.placeholderElement,s),s.parentNode.removeChild(s),this.hoverElement=s.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.table.columnManager.getElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.bottom=o.clientHeight-n.offsetHeight+"px",this.touchMove||(this._bindMouseMove(),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove)),this.moveHover(e)}_bindMouseMove(){this.table.columnManager.columnsByIndex.forEach((function(e){e.modules.moveColumn.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveColumn.mousemove)}))}_unbindMouseMove(){this.table.columnManager.columnsByIndex.forEach((function(e){e.modules.moveColumn.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveColumn.mousemove)}))}moveColumn(e,t){var i=this.moving.getCells();this.toCol=e,this.toColAfter=t,t?e.getCells().forEach((function(e,t){var s=e.getElement(!0);s.parentNode&&i[t]&&s.parentNode.insertBefore(i[t].getElement(),s.nextSibling)})):e.getCells().forEach((function(e,t){var s=e.getElement(!0);s.parentNode&&i[t]&&s.parentNode.insertBefore(i[t].getElement(),s)}))}endMove(e){(1===e.which||this.touchMove)&&(this._unbindMouseMove(),this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toCol&&this.table.columnManager.moveColumnActual(this.moving,this.toCol,this.toColAfter),this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.touchMove||(document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove)))}moveHover(e){var i,s=this.table.columnManager.getElement(),o=s.scrollLeft,n=(this.touchMove?e.touches[0].pageX:e.pageX)-t.elOffset(s).left+o;this.hoverElement.style.left=n-this.startX+"px",n-o{i=Math.max(0,o-5),this.table.rowManager.getElement().scrollLeft=i,this.autoScrollTimeout=!1}),1))),o+s.clientWidth-n{i=Math.min(s.clientWidth,o+5),this.table.rowManager.getElement().scrollLeft=i,this.autoScrollTimeout=!1}),1)))}}J.moduleName="moveColumn";class Y extends o{constructor(e){super(e),this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=150,this.moving=!1,this.toRow=!1,this.toRowAfter=!1,this.hasHandle=!1,this.startY=0,this.startX=0,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this),this.tableRowDropEvent=!1,this.touchMove=!1,this.connection=!1,this.connectionSelectorsTables=!1,this.connectionSelectorsElements=!1,this.connectionElements=[],this.connections=[],this.connectedTable=!1,this.connectedRow=!1,this.registerTableOption("movableRows",!1),this.registerTableOption("movableRowsConnectedTables",!1),this.registerTableOption("movableRowsConnectedElements",!1),this.registerTableOption("movableRowsSender",!1),this.registerTableOption("movableRowsReceiver","insert"),this.registerColumnOption("rowHandle")}createPlaceholderElement(){var e=document.createElement("div");return e.classList.add("tabulator-row"),e.classList.add("tabulator-row-placeholder"),e}initialize(){this.table.options.movableRows&&(this.connectionSelectorsTables=this.table.options.movableRowsConnectedTables,this.connectionSelectorsElements=this.table.options.movableRowsConnectedElements,this.connection=this.connectionSelectorsTables||this.connectionSelectorsElements,this.subscribe("cell-init",this.initializeCell.bind(this)),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("row-init",this.initializeRow.bind(this)))}initializeGroupHeader(e){var i=this,s={};s.mouseup=function(e){i.tableRowDrop(e,row)}.bind(i),s.mousemove=function(s){var o;s.pageY-t.elOffset(e.element).top+i.table.rowManager.element.scrollTop>e.getHeight()/2?i.toRow===e&&i.toRowAfter||((o=e.getElement()).parentNode.insertBefore(i.placeholderElement,o.nextSibling),i.moveRow(e,!0)):(i.toRow!==e||i.toRowAfter)&&(o=e.getElement()).previousSibling&&(o.parentNode.insertBefore(i.placeholderElement,o),i.moveRow(e,!1))}.bind(i),e.modules.moveRow=s}initializeRow(e){var i,s=this,o={};o.mouseup=function(t){s.tableRowDrop(t,e)}.bind(s),o.mousemove=function(i){var o=e.getElement();i.pageY-t.elOffset(o).top+s.table.rowManager.element.scrollTop>e.getHeight()/2?s.toRow===e&&s.toRowAfter||(o.parentNode.insertBefore(s.placeholderElement,o.nextSibling),s.moveRow(e,!0)):(s.toRow!==e||s.toRowAfter)&&(o.parentNode.insertBefore(s.placeholderElement,o),s.moveRow(e,!1))}.bind(s),this.hasHandle||((i=e.getElement()).addEventListener("mousedown",(function(t){1===t.which&&(s.checkTimeout=setTimeout((function(){s.startMove(t,e)}),s.checkPeriod))})),i.addEventListener("mouseup",(function(e){1===e.which&&s.checkTimeout&&clearTimeout(s.checkTimeout)})),this.bindTouchEvents(e,e.getElement())),e.modules.moveRow=o}initializeColumn(e){e.definition.rowHandle&&!1!==this.table.options.movableRows&&(this.hasHandle=!0)}initializeCell(e){if(e.column.definition.rowHandle&&!1!==this.table.options.movableRows){var t=this,i=e.getElement(!0);i.addEventListener("mousedown",(function(i){1===i.which&&(t.checkTimeout=setTimeout((function(){t.startMove(i,e.row)}),t.checkPeriod))})),i.addEventListener("mouseup",(function(e){1===e.which&&t.checkTimeout&&clearTimeout(t.checkTimeout)})),this.bindTouchEvents(e.row,i)}}bindTouchEvents(e,t){var i,s,o,n,r,a,l=!1;t.addEventListener("touchstart",(t=>{this.checkTimeout=setTimeout((()=>{this.touchMove=!0,i=e.nextRow(),o=i?i.getHeight()/2:0,s=e.prevRow(),n=s?s.getHeight()/2:0,r=0,a=0,l=!1,this.startMove(t,e)}),this.checkPeriod)}),{passive:!0}),this.moving,this.toRow,this.toRowAfter,t.addEventListener("touchmove",(t=>{var h,d;this.moving&&(t.preventDefault(),this.moveHover(t),l||(l=t.touches[0].pageY),(h=t.touches[0].pageY-l)>0?i&&h-r>o&&(d=i)!==e&&(l=t.touches[0].pageY,d.getElement().parentNode.insertBefore(this.placeholderElement,d.getElement().nextSibling),this.moveRow(d,!0)):s&&-h-a>n&&(d=s)!==e&&(l=t.touches[0].pageY,d.getElement().parentNode.insertBefore(this.placeholderElement,d.getElement()),this.moveRow(d,!1)),d&&(i=d.nextRow(),r=o,o=i?i.getHeight()/2:0,s=d.prevRow(),a=n,n=s?s.getHeight()/2:0))})),t.addEventListener("touchend",(e=>{this.checkTimeout&&clearTimeout(this.checkTimeout),this.moving&&(this.endMove(e),this.touchMove=!1)}))}_bindMouseMove(){this.table.rowManager.getDisplayRows().forEach((e=>{("row"===e.type||"group"===e.type)&&e.modules.moveRow&&e.modules.moveRow.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveRow.mousemove)}))}_unbindMouseMove(){this.table.rowManager.getDisplayRows().forEach((e=>{("row"===e.type||"group"===e.type)&&e.modules.moveRow&&e.modules.moveRow.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveRow.mousemove)}))}startMove(e,t){var i=t.getElement();this.setStartPosition(e,t),this.moving=t,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",this.connection?(this.table.element.classList.add("tabulator-movingrow-sending"),this.connectToTables(t)):(i.parentNode.insertBefore(this.placeholderElement,i),i.parentNode.removeChild(i)),this.hoverElement=i.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.connection?(document.body.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this.hoverElement.style.width=this.table.element.clientWidth+"px",this.hoverElement.style.whiteSpace="nowrap",this.hoverElement.style.overflow="hidden",this.hoverElement.style.pointerEvents="none"):(this.table.rowManager.getTableElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this._bindMouseMove()),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove),this.dispatchExternal("rowMoving",t.getComponent()),this.moveHover(e)}setStartPosition(e,t){var i,s,o=this.touchMove?e.touches[0].pageX:e.pageX,n=this.touchMove?e.touches[0].pageY:e.pageY;i=t.getElement(),this.connection?(s=i.getBoundingClientRect(),this.startX=s.left-o+window.pageXOffset,this.startY=s.top-n+window.pageYOffset):this.startY=n-i.getBoundingClientRect().top}endMove(e){e&&1!==e.which&&!this.touchMove||(this._unbindMouseMove(),this.connection||(this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement)),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toRow?this.table.rowManager.moveRow(this.moving,this.toRow,this.toRowAfter):this.dispatchExternal("rowMoveCancelled",this.moving.getComponent()),this.moving=!1,this.toRow=!1,this.toRowAfter=!1,document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove),this.connection&&(this.table.element.classList.remove("tabulator-movingrow-sending"),this.disconnectFromTables()))}moveRow(e,t){this.toRow=e,this.toRowAfter=t}moveHover(e){this.connection?this.moveHoverConnections.call(this,e):this.moveHoverTable.call(this,e)}moveHoverTable(e){var t=this.table.rowManager.getElement(),i=t.scrollTop,s=(this.touchMove?e.touches[0].pageY:e.pageY)-t.getBoundingClientRect().top+i;this.hoverElement.style.top=s-this.startY+"px"}moveHoverConnections(e){this.hoverElement.style.left=this.startX+(this.touchMove?e.touches[0].pageX:e.pageX)+"px",this.hoverElement.style.top=this.startY+(this.touchMove?e.touches[0].pageY:e.pageY)+"px"}elementRowDrop(e,t,i){this.dispatchExternal("movableRowsElementDrop",e,t,!!i&&i.getComponent())}connectToTables(e){var t;this.connectionSelectorsTables&&(t=this.commsConnections(this.connectionSelectorsTables),this.dispatchExternal("movableRowsSendingStart",t),this.commsSend(this.connectionSelectorsTables,"moveRow","connect",{row:e})),this.connectionSelectorsElements&&(this.connectionElements=[],Array.isArray(this.connectionSelectorsElements)||(this.connectionSelectorsElements=[this.connectionSelectorsElements]),this.connectionSelectorsElements.forEach((e=>{"string"==typeof e?this.connectionElements=this.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(e))):this.connectionElements.push(e)})),this.connectionElements.forEach((e=>{var t=t=>{this.elementRowDrop(t,e,this.moving)};e.addEventListener("mouseup",t),e.tabulatorElementDropEvent=t,e.classList.add("tabulator-movingrow-receiving")})))}disconnectFromTables(){var e;this.connectionSelectorsTables&&(e=this.commsConnections(this.connectionSelectorsTables),this.dispatchExternal("movableRowsSendingStop",e),this.commsSend(this.connectionSelectorsTables,"moveRow","disconnect")),this.connectionElements.forEach((e=>{e.classList.remove("tabulator-movingrow-receiving"),e.removeEventListener("mouseup",e.tabulatorElementDropEvent),delete e.tabulatorElementDropEvent}))}connect(e,t){return this.connectedTable?(console.warn("Move Row Error - Table cannot accept connection, already connected to table:",this.connectedTable),!1):(this.connectedTable=e,this.connectedRow=t,this.table.element.classList.add("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach((e=>{"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().addEventListener("mouseup",e.modules.moveRow.mouseup)})),this.tableRowDropEvent=this.tableRowDrop.bind(this),this.table.element.addEventListener("mouseup",this.tableRowDropEvent),this.dispatchExternal("movableRowsReceivingStart",t,e),!0)}disconnect(e){e===this.connectedTable?(this.connectedTable=!1,this.connectedRow=!1,this.table.element.classList.remove("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach((e=>{"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().removeEventListener("mouseup",e.modules.moveRow.mouseup)})),this.table.element.removeEventListener("mouseup",this.tableRowDropEvent),this.dispatchExternal("movableRowsReceivingStop",e)):console.warn("Move Row Error - trying to disconnect from non connected table")}dropComplete(e,t,i){var s=!1;if(i){switch(typeof this.table.options.movableRowsSender){case"string":s=this.senders[this.table.options.movableRowsSender];break;case"function":s=this.table.options.movableRowsSender}s?s.call(this,this.moving.getComponent(),t?t.getComponent():void 0,e):this.table.options.movableRowsSender&&console.warn("Mover Row Error - no matching sender found:",this.table.options.movableRowsSender),this.dispatchExternal("movableRowsSent",this.moving.getComponent(),t?t.getComponent():void 0,e)}else this.dispatchExternal("movableRowsSentFailed",this.moving.getComponent(),t?t.getComponent():void 0,e);this.endMove()}tableRowDrop(e,t){var i=!1,s=!1;switch(e.stopImmediatePropagation(),typeof this.table.options.movableRowsReceiver){case"string":i=this.receivers[this.table.options.movableRowsReceiver];break;case"function":i=this.table.options.movableRowsReceiver}i?s=i.call(this,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):console.warn("Mover Row Error - no matching receiver found:",this.table.options.movableRowsReceiver),s?this.dispatchExternal("movableRowsReceived",this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):this.dispatchExternal("movableRowsReceivedFailed",this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable),this.commsSend(this.connectedTable,"moveRow","dropcomplete",{row:t,success:s})}commsReceived(e,t,i){switch(t){case"connect":return this.connect(e,i.row);case"disconnect":return this.disconnect(e);case"dropcomplete":return this.dropComplete(e,i.row,i.success)}}}Y.prototype.receivers={insert:function(e,t,i){return this.table.addRow(e.getData(),void 0,t),!0},add:function(e,t,i){return this.table.addRow(e.getData()),!0},update:function(e,t,i){return!!t&&(t.update(e.getData()),!0)},replace:function(e,t,i){return!!t&&(this.table.addRow(e.getData(),void 0,t),t.delete(),!0)}},Y.prototype.senders={delete:function(e,t,i){e.delete()}},Y.moduleName="moveRow";class $ extends o{constructor(e){super(e),this.allowedTypes=["","data","edit","clipboard"],this.enabled=!0,this.registerColumnOption("mutator"),this.registerColumnOption("mutatorParams"),this.registerColumnOption("mutatorData"),this.registerColumnOption("mutatorDataParams"),this.registerColumnOption("mutatorEdit"),this.registerColumnOption("mutatorEditParams"),this.registerColumnOption("mutatorClipboard"),this.registerColumnOption("mutatorClipboardParams"),this.registerColumnOption("mutateLink")}initialize(){this.subscribe("cell-value-changing",this.transformCell.bind(this)),this.subscribe("cell-value-changed",this.mutateLink.bind(this)),this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-init-before",this.rowDataChanged.bind(this)),this.subscribe("row-data-changing",this.rowDataChanged.bind(this))}rowDataChanged(e,t,i){return this.transformRow(t,"data",i)}initializeColumn(e){var t=!1,i={};this.allowedTypes.forEach((s=>{var o,n="mutator"+(s.charAt(0).toUpperCase()+s.slice(1));e.definition[n]&&(o=this.lookupMutator(e.definition[n]))&&(t=!0,i[n]={mutator:o,params:e.definition[n+"Params"]||{}})})),t&&(e.modules.mutate=i)}lookupMutator(e){var t=!1;switch(typeof e){case"string":$.mutators[e]?t=$.mutators[e]:console.warn("Mutator Error - No such mutator found, ignoring: ",e);break;case"function":t=e}return t}transformRow(e,t,i){var s,o="mutator"+(t.charAt(0).toUpperCase()+t.slice(1));return this.enabled&&this.table.columnManager.traverse((n=>{var r,a,l;n.modules.mutate&&(r=n.modules.mutate[o]||n.modules.mutate.mutator||!1)&&(s=n.getFieldValue(void 0!==i?i:e),"data"!=t&&void 0===s||(l=n.getComponent(),a="function"==typeof r.params?r.params(s,e,t,l):r.params,n.setFieldValue(e,r.mutator(s,e,t,a,l))))})),e}transformCell(e,t){if(e.column.modules.mutate){var i=e.column.modules.mutate.mutatorEdit||e.column.modules.mutate.mutator||!1,s={};if(i)return s=Object.assign(s,e.row.getData()),e.column.setFieldValue(s,t),i.mutator(t,s,"edit",i.params,e.getComponent())}return t}mutateLink(e){var t=e.column.definition.mutateLink;t&&(Array.isArray(t)||(t=[t]),t.forEach((t=>{var i=e.row.getCell(t);i&&i.setValue(i.getValue(),!0,!0)})))}enable(){this.enabled=!0}disable(){this.enabled=!1}}$.moduleName="mutator",$.mutators={};var Z={rows:function(e,t,i,s,o){var n=document.createElement("span"),r=document.createElement("span"),a=document.createElement("span"),l=document.createElement("span"),h=document.createElement("span"),d=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",(e=>{r.innerHTML=e})),this.table.modules.localize.langBind("pagination|counter|of",(e=>{l.innerHTML=e})),this.table.modules.localize.langBind("pagination|counter|rows",(e=>{d.innerHTML=e})),s?(a.innerHTML=" "+t+"-"+Math.min(t+e-1,s)+" ",h.innerHTML=" "+s+" ",n.appendChild(r),n.appendChild(a),n.appendChild(l),n.appendChild(h),n.appendChild(d)):(a.innerHTML=" 0 ",n.appendChild(r),n.appendChild(a),n.appendChild(d)),n},pages:function(e,t,i,s,o){var n=document.createElement("span"),r=document.createElement("span"),a=document.createElement("span"),l=document.createElement("span"),h=document.createElement("span"),d=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",(e=>{r.innerHTML=e})),a.innerHTML=" "+i+" ",this.table.modules.localize.langBind("pagination|counter|of",(e=>{l.innerHTML=e})),h.innerHTML=" "+o+" ",this.table.modules.localize.langBind("pagination|counter|pages",(e=>{d.innerHTML=e})),n.appendChild(r),n.appendChild(a),n.appendChild(l),n.appendChild(h),n.appendChild(d),n}};class Q extends o{constructor(e){super(e),this.mode="local",this.progressiveLoad=!1,this.element=null,this.pageCounterElement=null,this.pageCounter=null,this.size=0,this.page=1,this.count=5,this.max=1,this.remoteRowCountEstimate=null,this.displayIndex=0,this.initialLoad=!0,this.dataChanging=!1,this.pageSizes=[],this.registerTableOption("pagination",!1),this.registerTableOption("paginationMode","local"),this.registerTableOption("paginationSize",!1),this.registerTableOption("paginationInitialPage",1),this.registerTableOption("paginationCounter",!1),this.registerTableOption("paginationCounterElement",!1),this.registerTableOption("paginationButtonCount",5),this.registerTableOption("paginationSizeSelector",!1),this.registerTableOption("paginationElement",!1),this.registerTableOption("paginationAddRow","page"),this.registerTableOption("progressiveLoad",!1),this.registerTableOption("progressiveLoadDelay",0),this.registerTableOption("progressiveLoadScrollMargin",0),this.registerTableFunction("setMaxPage",this.setMaxPage.bind(this)),this.registerTableFunction("setPage",this.setPage.bind(this)),this.registerTableFunction("setPageToRow",this.userSetPageToRow.bind(this)),this.registerTableFunction("setPageSize",this.userSetPageSize.bind(this)),this.registerTableFunction("getPageSize",this.getPageSize.bind(this)),this.registerTableFunction("previousPage",this.previousPage.bind(this)),this.registerTableFunction("nextPage",this.nextPage.bind(this)),this.registerTableFunction("getPage",this.getPage.bind(this)),this.registerTableFunction("getPageMax",this.getPageMax.bind(this)),this.registerComponentFunction("row","pageTo",this.setPageToRow.bind(this))}initialize(){this.table.options.pagination?(this.subscribe("row-deleted",this.rowsUpdated.bind(this)),this.subscribe("row-added",this.rowsUpdated.bind(this)),this.subscribe("data-processed",this.initialLoadComplete.bind(this)),this.subscribe("table-built",this.calculatePageSizes.bind(this)),this.subscribe("footer-redraw",this.footerRedraw.bind(this)),"page"==this.table.options.paginationAddRow&&this.subscribe("row-adding-position",this.rowAddingPosition.bind(this)),"remote"===this.table.options.paginationMode&&(this.subscribe("data-params",this.remotePageParams.bind(this)),this.subscribe("data-loaded",this._parseRemoteData.bind(this))),this.table.options.progressiveLoad&&console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time"),this.registerDisplayHandler(this.restOnRenderBefore.bind(this),40),this.registerDisplayHandler(this.getRows.bind(this),50),this.createElements(),this.initializePageCounter(),this.initializePaginator()):this.table.options.progressiveLoad&&(this.subscribe("data-params",this.remotePageParams.bind(this)),this.subscribe("data-loaded",this._parseRemoteData.bind(this)),this.subscribe("table-built",this.calculatePageSizes.bind(this)),this.subscribe("data-processed",this.initialLoadComplete.bind(this)),this.initializeProgressive(this.table.options.progressiveLoad),"scroll"===this.table.options.progressiveLoad&&this.subscribe("scroll-vertical",this.scrollVertical.bind(this)))}rowAddingPosition(e,t){var i,s=this.table.rowManager,o=s.getDisplayRows();return t?o.length?i=o[0]:s.activeRows.length&&(i=s.activeRows[s.activeRows.length-1],t=!1):o.length&&(i=o[o.length-1],t=!(o.length{}))}restOnRenderBefore(e,t){return t||"local"===this.mode&&this.reset(),e}rowsUpdated(){this.refreshData(!0,"all")}createElements(){var e;this.element=document.createElement("span"),this.element.classList.add("tabulator-paginator"),this.pagesElement=document.createElement("span"),this.pagesElement.classList.add("tabulator-pages"),(e=document.createElement("button")).classList.add("tabulator-page"),e.setAttribute("type","button"),e.setAttribute("role","button"),e.setAttribute("aria-label",""),e.setAttribute("title",""),this.firstBut=e.cloneNode(!0),this.firstBut.setAttribute("data-page","first"),this.prevBut=e.cloneNode(!0),this.prevBut.setAttribute("data-page","prev"),this.nextBut=e.cloneNode(!0),this.nextBut.setAttribute("data-page","next"),this.lastBut=e.cloneNode(!0),this.lastBut.setAttribute("data-page","last"),this.table.options.paginationSizeSelector&&(this.pageSizeSelect=document.createElement("select"),this.pageSizeSelect.classList.add("tabulator-page-size"))}generatePageSizeSelectList(){var e=[];if(this.pageSizeSelect){if(Array.isArray(this.table.options.paginationSizeSelector))e=this.table.options.paginationSizeSelector,this.pageSizes=e,-1==this.pageSizes.indexOf(this.size)&&e.unshift(this.size);else if(-1==this.pageSizes.indexOf(this.size)){e=[];for(let t=1;t<5;t++)e.push(this.size*t);this.pageSizes=e}else e=this.pageSizes;for(;this.pageSizeSelect.firstChild;)this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);e.forEach((e=>{var t=document.createElement("option");t.value=e,!0===e?this.langBind("pagination|all",(function(e){t.innerHTML=e})):t.innerHTML=e,this.pageSizeSelect.appendChild(t)})),this.pageSizeSelect.value=this.size}}initializePageCounter(){var e=this.table.options.paginationCounter,t=null;e&&((t="function"==typeof e?e:Q.pageCounters[e])?(this.pageCounter=t,this.pageCounterElement=document.createElement("span"),this.pageCounterElement.classList.add("tabulator-page-counter")):console.warn("Pagination Error - No such page counter found: ",e))}initializePaginator(e){var t,i;e||(this.langBind("pagination|first",(e=>{this.firstBut.innerHTML=e})),this.langBind("pagination|first_title",(e=>{this.firstBut.setAttribute("aria-label",e),this.firstBut.setAttribute("title",e)})),this.langBind("pagination|prev",(e=>{this.prevBut.innerHTML=e})),this.langBind("pagination|prev_title",(e=>{this.prevBut.setAttribute("aria-label",e),this.prevBut.setAttribute("title",e)})),this.langBind("pagination|next",(e=>{this.nextBut.innerHTML=e})),this.langBind("pagination|next_title",(e=>{this.nextBut.setAttribute("aria-label",e),this.nextBut.setAttribute("title",e)})),this.langBind("pagination|last",(e=>{this.lastBut.innerHTML=e})),this.langBind("pagination|last_title",(e=>{this.lastBut.setAttribute("aria-label",e),this.lastBut.setAttribute("title",e)})),this.firstBut.addEventListener("click",(()=>{this.setPage(1)})),this.prevBut.addEventListener("click",(()=>{this.previousPage()})),this.nextBut.addEventListener("click",(()=>{this.nextPage()})),this.lastBut.addEventListener("click",(()=>{this.setPage(this.max)})),this.table.options.paginationElement&&(this.element=this.table.options.paginationElement),this.pageSizeSelect&&(t=document.createElement("label"),this.langBind("pagination|page_size",(e=>{this.pageSizeSelect.setAttribute("aria-label",e),this.pageSizeSelect.setAttribute("title",e),t.innerHTML=e})),this.element.appendChild(t),this.element.appendChild(this.pageSizeSelect),this.pageSizeSelect.addEventListener("change",(e=>{this.setPageSize("true"==this.pageSizeSelect.value||this.pageSizeSelect.value),this.setPage(1)}))),this.element.appendChild(this.firstBut),this.element.appendChild(this.prevBut),this.element.appendChild(this.pagesElement),this.element.appendChild(this.nextBut),this.element.appendChild(this.lastBut),this.table.options.paginationElement||e||(this.table.options.paginationCounter&&(this.table.options.paginationCounterElement?this.table.options.paginationCounterElement instanceof HTMLElement?this.table.options.paginationCounterElement.appendChild(this.pageCounterElement):"string"==typeof this.table.options.paginationCounterElement&&((i=document.querySelector(this.table.options.paginationCounterElement))?i.appendChild(this.pageCounterElement):console.warn("Pagination Error - Unable to find element matching paginationCounterElement selector:",this.table.options.paginationCounterElement)):this.footerAppend(this.pageCounterElement)),this.footerAppend(this.element)),this.page=this.table.options.paginationInitialPage,this.count=this.table.options.paginationButtonCount),this.mode=this.table.options.paginationMode}initializeProgressive(e){this.initializePaginator(!0),this.mode="progressive_"+e,this.progressiveLoad=!0}trackChanges(){this.dispatch("page-changed")}setDisplayIndex(e){this.displayIndex=e}getDisplayIndex(){return this.displayIndex}setMaxRows(e){this.max=e?!0===this.size?1:Math.ceil(e/this.size):1,this.page>this.max&&(this.page=this.max)}reset(e){this.initialLoad||("local"==this.mode||e)&&(this.page=1)}setMaxPage(e){e=parseInt(e),this.max=e||1,this.page>this.max&&(this.page=this.max,this.trigger())}setPage(e){switch(e){case"first":return this.setPage(1);case"prev":return this.previousPage();case"next":return this.nextPage();case"last":return this.setPage(this.max)}return(e=parseInt(e))>0&&e<=this.max||"local"!==this.mode?(this.page=e,this.trackChanges(),this.trigger()):(console.warn("Pagination Error - Requested page is out of range of 1 - "+this.max+":",e),Promise.reject())}setPageToRow(e){var t=this.table.rowManager.getDisplayRows(this.displayIndex-1).indexOf(e);if(t>-1){var i=!0===this.size?1:Math.ceil((t+1)/this.size);return this.setPage(i)}return console.warn("Pagination Error - Requested row is not visible"),Promise.reject()}setPageSize(e){!0!==e&&(e=parseInt(e)),e>0&&(this.size=e,this.dispatchExternal("pageSizeChanged",e)),this.pageSizeSelect&&this.generatePageSizeSelectList(),this.trackChanges()}_setPageCounter(e,t,i){var s;if(this.pageCounter)switch("remote"===this.mode&&(t=this.size,i=(this.page-1)*this.size+1,e=this.remoteRowCountEstimate),typeof(s=this.pageCounter.call(this,t,i,this.page,e,this.max))){case"object":if(s instanceof Node){for(;this.pageCounterElement.firstChild;)this.pageCounterElement.removeChild(this.pageCounterElement.firstChild);this.pageCounterElement.appendChild(s)}else this.pageCounterElement.innerHTML="",null!=s&&console.warn("Page Counter Error - Page Counter has returned a type of object, the only valid page counter object return is an instance of Node, the page counter returned:",s);break;case"undefined":case"null":this.pageCounterElement.innerHTML="";break;default:this.pageCounterElement.innerHTML=s}}_setPageButtons(){let e=Math.floor((this.count-1)/2),t=Math.ceil((this.count-1)/2),i=this.max-this.page+e+10&&e<=this.max&&this.pagesElement.appendChild(this._generatePageButton(e));this.footerRedraw()}_generatePageButton(e){var t=document.createElement("button");return t.classList.add("tabulator-page"),e==this.page&&t.classList.add("active"),t.setAttribute("type","button"),t.setAttribute("role","button"),this.langBind("pagination|page_title",(i=>{t.setAttribute("aria-label",i+" "+e),t.setAttribute("title",i+" "+e)})),t.setAttribute("data-page",e),t.textContent=e,t.addEventListener("click",(t=>{this.setPage(e)})),t}previousPage(){return this.page>1?(this.page--,this.trackChanges(),this.trigger()):(console.warn("Pagination Error - Previous page would be less than page 1:",0),Promise.reject())}nextPage(){return this.page"row"===e.type));if("local"==this.mode){t=[],this.setMaxRows(e.length),!0===this.size?(i=0,s=e.length):s=(i=this.size*(this.page-1))+parseInt(this.size),this._setPageButtons();for(let r=i;r{this.dataChanging=!1}));case"progressive_load":case"progressive_scroll":return this.reloadData(null,!0);default:return console.warn("Pagination Error - no such pagination mode:",this.mode),Promise.reject()}}_parseRemoteData(e){var t;if(void 0===e.last_page&&console.warn("Remote Pagination Error - Server response missing '"+(this.options("dataReceiveParams").last_page||"last_page")+"' property"),e.data){if(this.max=parseInt(e.last_page)||1,this.remoteRowCountEstimate=void 0!==e.last_row?e.last_row:e.last_page*this.size-(this.page==e.last_page?this.size-e.data.length:0),this.progressiveLoad){switch(this.mode){case"progressive_load":1==this.page?this.table.rowManager.setData(e.data,!1,1==this.page):this.table.rowManager.addRows(e.data),this.page{this.nextPage()}),this.table.options.progressiveLoadDelay);break;case"progressive_scroll":e=1===this.page?e.data:this.table.rowManager.getData().concat(e.data),this.table.rowManager.setData(e,1!==this.page,1==this.page),t=this.table.options.progressiveLoadScrollMargin||2*this.table.rowManager.element.clientHeight,this.table.rowManager.element.scrollHeight<=this.table.rowManager.element.clientHeight+t&&this.page{this.nextPage()}))}return!1}this.dispatchExternal("pageLoaded",this.getPage())}else console.warn("Remote Pagination Error - Server response missing '"+(this.options("dataReceiveParams").data||"data")+"' property");return e.data}footerRedraw(){var e=this.table.footerManager.containerElement;Math.ceil(e.clientWidth)-e.scrollWidth<0?this.pagesElement.style.display="none":(this.pagesElement.style.display="",Math.ceil(e.clientWidth)-e.scrollWidth<0&&(this.pagesElement.style.display="none"))}}Q.moduleName="page",Q.pageCounters=Z;var ee={local:function(e,t){var i=localStorage.getItem(e+"-"+t);return!!i&&JSON.parse(i)},cookie:function(e,t){var i,s,o=document.cookie,n=e+"-"+t,r=o.indexOf(n+"=");return r>-1&&((i=(o=o.slice(r)).indexOf(";"))>-1&&(o=o.slice(0,i)),s=o.replace(n+"=","")),!!s&&JSON.parse(s)}},te={local:function(e,t,i){localStorage.setItem(e+"-"+t,JSON.stringify(i))},cookie:function(e,t,i){var s=new Date;s.setDate(s.getDate()+1e4),document.cookie=e+"-"+t+"="+JSON.stringify(i)+"; expires="+s.toUTCString()}};class ie extends o{constructor(e){super(e),this.mode="",this.id="",this.defWatcherBlock=!1,this.config={},this.readFunc=!1,this.writeFunc=!1,this.registerTableOption("persistence",!1),this.registerTableOption("persistenceID",""),this.registerTableOption("persistenceMode",!0),this.registerTableOption("persistenceReaderFunc",!1),this.registerTableOption("persistenceWriterFunc",!1)}localStorageTest(){var e="_tabulator_test";try{return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}}initialize(){if(this.table.options.persistence){var e,t=this.table.options.persistenceMode,i=this.table.options.persistenceID;this.mode=!0!==t?t:this.localStorageTest()?"local":"cookie",this.table.options.persistenceReaderFunc?"function"==typeof this.table.options.persistenceReaderFunc?this.readFunc=this.table.options.persistenceReaderFunc:ie.readers[this.table.options.persistenceReaderFunc]?this.readFunc=ie.readers[this.table.options.persistenceReaderFunc]:console.warn("Persistence Read Error - invalid reader set",this.table.options.persistenceReaderFunc):ie.readers[this.mode]?this.readFunc=ie.readers[this.mode]:console.warn("Persistence Read Error - invalid reader set",this.mode),this.table.options.persistenceWriterFunc?"function"==typeof this.table.options.persistenceWriterFunc?this.writeFunc=this.table.options.persistenceWriterFunc:ie.writers[this.table.options.persistenceWriterFunc]?this.writeFunc=ie.writers[this.table.options.persistenceWriterFunc]:console.warn("Persistence Write Error - invalid reader set",this.table.options.persistenceWriterFunc):ie.writers[this.mode]?this.writeFunc=ie.writers[this.mode]:console.warn("Persistence Write Error - invalid writer set",this.mode),this.id="tabulator-"+(i||this.table.element.getAttribute("id")||""),this.config={sort:!0===this.table.options.persistence||this.table.options.persistence.sort,filter:!0===this.table.options.persistence||this.table.options.persistence.filter,group:!0===this.table.options.persistence||this.table.options.persistence.group,page:!0===this.table.options.persistence||this.table.options.persistence.page,columns:!0===this.table.options.persistence?["title","width","visible"]:this.table.options.persistence.columns},this.config.page&&(e=this.retreiveData("page"))&&(void 0===e.paginationSize||!0!==this.config.page&&!this.config.page.size||(this.table.options.paginationSize=e.paginationSize),void 0===e.paginationInitialPage||!0!==this.config.page&&!this.config.page.page||(this.table.options.paginationInitialPage=e.paginationInitialPage)),this.config.group&&(e=this.retreiveData("group"))&&(void 0===e.groupBy||!0!==this.config.group&&!this.config.group.groupBy||(this.table.options.groupBy=e.groupBy),void 0===e.groupStartOpen||!0!==this.config.group&&!this.config.group.groupStartOpen||(this.table.options.groupStartOpen=e.groupStartOpen),void 0===e.groupHeader||!0!==this.config.group&&!this.config.group.groupHeader||(this.table.options.groupHeader=e.groupHeader)),this.config.columns&&(this.table.options.columns=this.load("columns",this.table.options.columns),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-show",this.save.bind(this,"columns")),this.subscribe("column-hide",this.save.bind(this,"columns")),this.subscribe("column-moved",this.save.bind(this,"columns"))),this.subscribe("table-built",this.tableBuilt.bind(this),0),this.subscribe("table-redraw",this.tableRedraw.bind(this)),this.subscribe("filter-changed",this.eventSave.bind(this,"filter")),this.subscribe("sort-changed",this.eventSave.bind(this,"sort")),this.subscribe("group-changed",this.eventSave.bind(this,"group")),this.subscribe("page-changed",this.eventSave.bind(this,"page")),this.subscribe("column-resized",this.eventSave.bind(this,"columns")),this.subscribe("layout-refreshed",this.eventSave.bind(this,"columns"))}this.registerTableFunction("getColumnLayout",this.getColumnLayout.bind(this)),this.registerTableFunction("setColumnLayout",this.setColumnLayout.bind(this))}eventSave(e){this.config[e]&&this.save(e)}tableBuilt(){var e,t;this.table.options;this.config.sort&&!1==!(e=this.load("sort"))&&(this.table.options.initialSort=e),this.config.filter&&!1==!(t=this.load("filter"))&&(this.table.options.initialFilter=t)}tableRedraw(e){e&&this.config.columns&&this.save("columns")}getColumnLayout(){return this.parseColumns(this.table.columnManager.getColumns())}setColumnLayout(e){return this.table.columnManager.setColumns(this.mergeDefinition(this.table.options.columns,e)),!0}initializeColumn(e){var t;this.config.columns&&(this.defWatcherBlock=!0,t=e.getDefinition(),(!0===this.config.columns?Object.keys(t):this.config.columns).forEach((e=>{var i=Object.getOwnPropertyDescriptor(t,e),s=t[e];i&&Object.defineProperty(t,e,{set:function(e){s=e,this.defWatcherBlock||this.save("columns"),i.set&&i.set(e)},get:function(){return i.get&&i.get(),s}})})),this.defWatcherBlock=!1)}load(e,t){var i=this.retreiveData(e);return t&&(i=i?this.mergeDefinition(t,i):t),i}retreiveData(e){return!!this.readFunc&&this.readFunc(this.id,e)}mergeDefinition(e,t){var i=[];return(t=t||[]).forEach(((t,s)=>{var o,n=this._findColumn(e,t);n&&(!0===this.config.columns||null==this.config.columns?(o=Object.keys(n)).push("width"):o=this.config.columns,o.forEach((e=>{"columns"!==e&&void 0!==t[e]&&(n[e]=t[e])})),n.columns&&(n.columns=this.mergeDefinition(n.columns,t.columns)),i.push(n))})),e.forEach(((e,s)=>{this._findColumn(t,e)||(i.length>s?i.splice(s,0,e):i.push(e))})),i}_findColumn(e,t){var i=t.columns?"group":t.field?"field":"object";return e.find((function(e){switch(i){case"group":return e.title===t.title&&e.columns.length===t.columns.length;case"field":return e.field===t.field;case"object":return e===t}}))}save(e){var t={};switch(e){case"columns":t=this.parseColumns(this.table.columnManager.getColumns());break;case"filter":t=this.table.modules.filter.getFilters();break;case"sort":t=this.validateSorters(this.table.modules.sort.getSort());break;case"group":t=this.getGroupConfig();break;case"page":t=this.getPageConfig()}this.writeFunc&&this.writeFunc(this.id,e,t)}validateSorters(e){return e.forEach((function(e){e.column=e.field,delete e.field})),e}getGroupConfig(){var e={};return this.config.group&&((!0===this.config.group||this.config.group.groupBy)&&(e.groupBy=this.table.options.groupBy),(!0===this.config.group||this.config.group.groupStartOpen)&&(e.groupStartOpen=this.table.options.groupStartOpen),(!0===this.config.group||this.config.group.groupHeader)&&(e.groupHeader=this.table.options.groupHeader)),e}getPageConfig(){var e={};return this.config.page&&((!0===this.config.page||this.config.page.size)&&(e.paginationSize=this.table.modules.page.getPageSize()),(!0===this.config.page||this.config.page.page)&&(e.paginationInitialPage=this.table.modules.page.getPage())),e}parseColumns(e){var t=[],i=["headerContextMenu","headerMenu","contextMenu","clickMenu"];return e.forEach((e=>{var s,o={},n=e.getDefinition();e.isGroup?(o.title=n.title,o.columns=this.parseColumns(e.getColumns())):(o.field=e.getField(),!0===this.config.columns||null==this.config.columns?((s=Object.keys(n)).push("width"),s.push("visible")):s=this.config.columns,s.forEach((t=>{switch(t){case"width":o.width=e.getWidth();break;case"visible":o.visible=e.visible;break;default:"function"!=typeof n[t]&&-1===i.indexOf(t)&&(o[t]=n[t])}}))),t.push(o)})),t}}ie.moduleName="persistence",ie.moduleInitOrder=-10,ie.readers=ee,ie.writers=te;class se extends o{constructor(e){super(e),this.columnSubscribers={},this.registerTableOption("rowContextPopup",!1),this.registerTableOption("rowClickPopup",!1),this.registerTableOption("groupContextPopup",!1),this.registerTableOption("groupClickPopup",!1),this.registerColumnOption("headerContextPopup"),this.registerColumnOption("headerClickPopup"),this.registerColumnOption("headerPopup"),this.registerColumnOption("headerPopupIcon"),this.registerColumnOption("contextPopup"),this.registerColumnOption("clickPopup")}initialize(){this.initializeRowWatchers(),this.initializeGroupWatchers(),this.subscribe("column-init",this.initializeColumn.bind(this))}initializeRowWatchers(){this.table.options.rowContextPopup&&(this.subscribe("row-contextmenu",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup)),this.table.on("rowTapHold",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup))),this.table.options.rowClickPopup&&this.subscribe("row-click",this.loadPopupEvent.bind(this,this.table.options.rowClickPopup))}initializeGroupWatchers(){this.table.options.groupContextPopup&&(this.subscribe("group-contextmenu",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup)),this.table.on("groupTapHold",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup))),this.table.options.groupClickPopup&&this.subscribe("group-click",this.loadPopupEvent.bind(this,this.table.options.groupClickPopup))}initializeColumn(e){var t=e.definition;t.headerContextPopup&&!this.columnSubscribers.headerContextPopup&&(this.columnSubscribers.headerContextPopup=this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"),this.subscribe("column-contextmenu",this.columnSubscribers.headerContextPopup),this.table.on("headerTapHold",this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"))),t.headerClickPopup&&!this.columnSubscribers.headerClickPopup&&(this.columnSubscribers.headerClickPopup=this.loadPopupTableColumnEvent.bind(this,"headerClickPopup"),this.subscribe("column-click",this.columnSubscribers.headerClickPopup)),t.headerPopup&&this.initializeColumnHeaderPopup(e),t.contextPopup&&!this.columnSubscribers.contextPopup&&(this.columnSubscribers.contextPopup=this.loadPopupTableCellEvent.bind(this,"contextPopup"),this.subscribe("cell-contextmenu",this.columnSubscribers.contextPopup),this.table.on("cellTapHold",this.loadPopupTableCellEvent.bind(this,"contextPopup"))),t.clickPopup&&!this.columnSubscribers.clickPopup&&(this.columnSubscribers.clickPopup=this.loadPopupTableCellEvent.bind(this,"clickPopup"),this.subscribe("cell-click",this.columnSubscribers.clickPopup))}initializeColumnHeaderPopup(e){var t,i=e.definition.headerPopupIcon;(t=document.createElement("span")).classList.add("tabulator-header-popup-button"),i?("function"==typeof i&&(i=i(e.getComponent())),i instanceof HTMLElement?t.appendChild(i):t.innerHTML=i):t.innerHTML="⋮",t.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault(),this.loadPopupEvent(e.definition.headerPopup,t,e)})),e.titleElement.insertBefore(t,e.titleElement.firstChild)}loadPopupTableCellEvent(e,t,i){i._cell&&(i=i._cell),i.column.definition[e]&&this.loadPopupEvent(i.column.definition[e],t,i)}loadPopupTableColumnEvent(e,t,i){i._column&&(i=i._column),i.definition[e]&&this.loadPopupEvent(i.definition[e],t,i)}loadPopupEvent(e,t,i){var s;i._group?i=i._group:i._row&&(i=i._row),e="function"==typeof e?e.call(this.table,t,i.getComponent(),(function(e){s=e})):e,this.loadPopup(t,i,e,s)}loadPopup(e,t,i,s){var o,n,r=!(e instanceof MouseEvent);i instanceof HTMLElement?o=i:(o=document.createElement("div")).innerHTML=i,o.classList.add("tabulator-popup"),o.addEventListener("click",(e=>{e.stopPropagation()})),r||e.preventDefault(),n=this.popup(o),"function"==typeof s&&n.renderCallback(s),n.show(e).hideOnBlur((()=>{this.dispatchExternal("popupClosed",t.getComponent())})),this.dispatchExternal("popupOpened",t.getComponent())}}se.moduleName="popup";class oe extends o{constructor(e){super(e),this.element=!1,this.manualBlock=!1,this.registerTableOption("printAsHtml",!1),this.registerTableOption("printFormatter",!1),this.registerTableOption("printHeader",!1),this.registerTableOption("printFooter",!1),this.registerTableOption("printStyled",!0),this.registerTableOption("printRowRange","visible"),this.registerTableOption("printConfig",{}),this.registerColumnOption("print"),this.registerColumnOption("titlePrint")}initialize(){this.table.options.printAsHtml&&(window.addEventListener("beforeprint",this.replaceTable.bind(this)),window.addEventListener("afterprint",this.cleanup.bind(this))),this.registerTableFunction("print",this.printFullscreen.bind(this))}replaceTable(){this.manualBlock||(this.element=document.createElement("div"),this.element.classList.add("tabulator-print-table"),this.element.appendChild(this.table.modules.export.genereateTable(this.table.options.printConfig,this.table.options.printStyled,this.table.options.printRowRange,"print")),this.table.element.style.display="none",this.table.element.parentNode.insertBefore(this.element,this.table.element))}cleanup(){document.body.classList.remove("tabulator-print-fullscreen-hide"),this.element&&this.element.parentNode&&(this.element.parentNode.removeChild(this.element),this.table.element.style.display="")}printFullscreen(e,t,i){var s,o,n=window.scrollX,r=window.scrollY,a=document.createElement("div"),l=document.createElement("div"),h=this.table.modules.export.genereateTable(void 0!==i?i:this.table.options.printConfig,void 0!==t?t:this.table.options.printStyled,e||this.table.options.printRowRange,"print");this.manualBlock=!0,this.element=document.createElement("div"),this.element.classList.add("tabulator-print-fullscreen"),this.table.options.printHeader&&(a.classList.add("tabulator-print-header"),"string"==typeof(s="function"==typeof this.table.options.printHeader?this.table.options.printHeader.call(this.table):this.table.options.printHeader)?a.innerHTML=s:a.appendChild(s),this.element.appendChild(a)),this.element.appendChild(h),this.table.options.printFooter&&(l.classList.add("tabulator-print-footer"),"string"==typeof(o="function"==typeof this.table.options.printFooter?this.table.options.printFooter.call(this.table):this.table.options.printFooter)?l.innerHTML=o:l.appendChild(o),this.element.appendChild(l)),document.body.classList.add("tabulator-print-fullscreen-hide"),document.body.appendChild(this.element),this.table.options.printFormatter&&this.table.options.printFormatter(this.element,h),window.print(),this.cleanup(),window.scrollTo(n,r),this.manualBlock=!1}}oe.moduleName="print";class ne extends o{constructor(e){super(e),this.data=!1,this.blocked=!1,this.origFuncs={},this.currentVersion=0,this.registerTableOption("reactiveData",!1)}initialize(){this.table.options.reactiveData&&(this.subscribe("cell-value-save-before",this.block.bind(this)),this.subscribe("cell-value-save-after",this.unblock.bind(this)),this.subscribe("row-data-save-before",this.block.bind(this)),this.subscribe("row-data-save-after",this.unblock.bind(this)),this.subscribe("row-data-init-after",this.watchRow.bind(this)),this.subscribe("data-processing",this.watchData.bind(this)),this.subscribe("table-destroy",this.unwatchData.bind(this)))}watchData(e){var t,i=this;this.currentVersion++,t=this.currentVersion,this.unwatchData(),this.data=e,this.origFuncs.push=e.push,Object.defineProperty(this.data,"push",{enumerable:!1,configurable:!0,value:function(){var s=Array.from(arguments);return i.blocked||t!==i.currentVersion||s.forEach((e=>{i.table.rowManager.addRowActual(e,!1)})),i.origFuncs.push.apply(e,arguments)}}),this.origFuncs.unshift=e.unshift,Object.defineProperty(this.data,"unshift",{enumerable:!1,configurable:!0,value:function(){var s=Array.from(arguments);return i.blocked||t!==i.currentVersion||s.forEach((e=>{i.table.rowManager.addRowActual(e,!0)})),i.origFuncs.unshift.apply(e,arguments)}}),this.origFuncs.shift=e.shift,Object.defineProperty(this.data,"shift",{enumerable:!1,configurable:!0,value:function(){var s;return i.blocked||t!==i.currentVersion||i.data.length&&(s=i.table.rowManager.getRowFromDataObject(i.data[0]))&&s.deleteActual(),i.origFuncs.shift.call(e)}}),this.origFuncs.pop=e.pop,Object.defineProperty(this.data,"pop",{enumerable:!1,configurable:!0,value:function(){var s;return i.blocked||t!==i.currentVersion||i.data.length&&(s=i.table.rowManager.getRowFromDataObject(i.data[i.data.length-1]))&&s.deleteActual(),i.origFuncs.pop.call(e)}}),this.origFuncs.splice=e.splice,Object.defineProperty(this.data,"splice",{enumerable:!1,configurable:!0,value:function(){var s,o=Array.from(arguments),n=o[0]<0?e.length+o[0]:o[0],r=o[1],a=!!o[2]&&o.slice(2);if(!i.blocked&&t===i.currentVersion){if(a&&((s=!!e[n]&&i.table.rowManager.getRowFromDataObject(e[n]))?a.forEach((e=>{i.table.rowManager.addRowActual(e,!0,s,!0)})):(a=a.slice().reverse()).forEach((e=>{i.table.rowManager.addRowActual(e,!0,!1,!0)}))),0!==r){var l=e.slice(n,void 0===o[1]?o[1]:n+r);l.forEach(((e,t)=>{var s=i.table.rowManager.getRowFromDataObject(e);s&&s.deleteActual(t!==l.length-1)}))}(a||0!==r)&&i.table.rowManager.reRenderInPosition()}return i.origFuncs.splice.apply(e,arguments)}})}unwatchData(){if(!1!==this.data)for(var e in this.origFuncs)Object.defineProperty(this.data,e,{enumerable:!0,configurable:!0,writable:!0,value:this.origFuncs.key})}watchRow(e){var t=e.getData();for(var i in this.blocked=!0,t)this.watchKey(e,t,i);this.table.options.dataTree&&this.watchTreeChildren(e),this.blocked=!1}watchTreeChildren(e){var t=e.getData()[this.table.options.dataTreeChildField],i={};function s(){this.table.modules.dataTree.initializeRow(e),this.table.modules.dataTree.layoutRow(e),this.table.rowManager.refreshActiveData("tree",!1,!0)}t&&(i.push=t.push,Object.defineProperty(t,"push",{enumerable:!1,configurable:!0,value:()=>{var e=i.push.apply(t,arguments);return s(),e}}),i.unshift=t.unshift,Object.defineProperty(t,"unshift",{enumerable:!1,configurable:!0,value:()=>{var e=i.unshift.apply(t,arguments);return s(),e}}),i.shift=t.shift,Object.defineProperty(t,"shift",{enumerable:!1,configurable:!0,value:()=>{var e=i.shift.call(t);return s(),e}}),i.pop=t.pop,Object.defineProperty(t,"pop",{enumerable:!1,configurable:!0,value:()=>{var e=i.pop.call(t);return s(),e}}),i.splice=t.splice,Object.defineProperty(t,"splice",{enumerable:!1,configurable:!0,value:()=>{var e=i.splice.apply(t,arguments);return s(),e}}))}watchKey(e,t,i){var s=Object.getOwnPropertyDescriptor(t,i),o=t[i],n=this.currentVersion;Object.defineProperty(t,i,{set:t=>{if(o=t,!this.blocked&&n===this.currentVersion){var r={};r[i]=t,e.updateData(r)}s.set&&s.set(t)},get:()=>(s.get&&s.get(),o)})}unwatchRow(e){var t=e.getData();for(var i in t)Object.defineProperty(t,i,{value:t[i]})}block(){this.blocked=!0}unblock(){this.blocked=!1}}ne.moduleName="reactiveData";class re extends o{constructor(e){super(e),this.startColumn=!1,this.startX=!1,this.startWidth=!1,this.latestX=!1,this.handle=null,this.initialNextColumn=null,this.nextColumn=null,this.initialized=!1,this.registerColumnOption("resizable",!0),this.registerTableOption("resizableColumnFit",!1)}initialize(){this.subscribe("column-rendered",this.layoutColumnHeader.bind(this))}initializeEventWatchers(){this.initialized||(this.subscribe("cell-rendered",this.layoutCellHandles.bind(this)),this.subscribe("cell-delete",this.deInitializeComponent.bind(this)),this.subscribe("cell-height",this.resizeHandle.bind(this)),this.subscribe("column-moved",this.columnLayoutUpdated.bind(this)),this.subscribe("column-hide",this.deInitializeColumn.bind(this)),this.subscribe("column-show",this.columnLayoutUpdated.bind(this)),this.subscribe("column-width",this.columnWidthUpdated.bind(this)),this.subscribe("column-delete",this.deInitializeComponent.bind(this)),this.subscribe("column-height",this.resizeHandle.bind(this)),this.initialized=!0)}layoutCellHandles(e){"row"===e.row.type&&(this.deInitializeComponent(e),this.initializeColumn("cell",e,e.column,e.element))}layoutColumnHeader(e){e.definition.resizable&&(this.initializeEventWatchers(),this.deInitializeComponent(e),this.initializeColumn("header",e,e,e.element))}columnLayoutUpdated(e){var t=e.prevColumn();this.reinitializeColumn(e),t&&this.reinitializeColumn(t)}columnWidthUpdated(e){e.modules.frozen&&(this.table.modules.frozenColumns.leftColumns.includes(e)?this.table.modules.frozenColumns.leftColumns.forEach((e=>{this.reinitializeColumn(e)})):this.table.modules.frozenColumns.rightColumns.includes(e)&&this.table.modules.frozenColumns.rightColumns.forEach((e=>{this.reinitializeColumn(e)})))}reinitializeColumn(e){var t=!!e.modules.frozen&&e.modules.frozen.marginValue+e.getWidth()+"px";e.cells.forEach((e=>{e.modules.resize&&e.modules.resize.handleEl&&(t&&(e.modules.resize.handleEl.style.left=t),e.element.after(e.modules.resize.handleEl))})),e.modules.resize&&e.modules.resize.handleEl&&(t&&(e.modules.resize.handleEl.style.left=t),e.element.after(e.modules.resize.handleEl))}initializeColumn(e,t,i,s){var o=this,n=i.definition.resizable,r={},a=i.getLastColumn();if("header"===e&&(r={variableHeight:"textarea"==i.definition.formatter||i.definition.variableHeight}),(!0===n||n==e)&&this._checkResizability(a)){var l=document.createElement("span");l.className="tabulator-col-resize-handle",l.addEventListener("click",(function(e){e.stopPropagation()}));var h=function(e){o.startColumn=i,o.initialNextColumn=o.nextColumn=a.nextColumn(),o._mouseDown(e,a,l)};l.addEventListener("mousedown",h),l.addEventListener("touchstart",h,{passive:!0}),l.addEventListener("dblclick",(e=>{var t=a.getWidth();e.stopPropagation(),a.reinitializeWidth(!0),t!==a.getWidth()&&(o.dispatch("column-resized",a),o.table.externalEvents.dispatch("columnResized",a.getComponent()))})),i.modules.frozen&&(l.style.position="absolute",l.style.left=i.modules.frozen.marginValue+i.getWidth()+"px"),r.handleEl=l,s.parentNode&&s.after(l)}t.modules.resize=r}deInitializeColumn(e){this.deInitializeComponent(e),e.cells.forEach((e=>{this.deInitializeComponent(e)}))}deInitializeComponent(e){var t;e.modules.resize&&(t=e.modules.resize.handleEl)&&t.parentElement&&t.parentElement.removeChild(t)}resizeHandle(e,t){e.modules.resize&&e.modules.resize.handleEl&&(e.modules.resize.handleEl.style.height=t)}_checkResizability(e){return e.definition.resizable}_mouseDown(e,t,i){var s=this;function o(e){var i,o,n=void 0===e.screenX?e.touches[0].screenX:e.screenX,r=n-s.startX,a=n-s.latestX;if(s.latestX=n,s.table.rtl&&(r=-r,a=-a),i=t.width==t.minWidth||t.width==t.maxWidth,t.setWidth(s.startWidth+r),o=t.width==t.minWidth||t.width==t.maxWidth,a<0&&(s.nextColumn=s.initialNextColumn),s.table.options.resizableColumnFit&&s.nextColumn&&(!i||!o)){let e=s.nextColumn.getWidth();a>0&&e<=s.nextColumn.minWidth&&(s.nextColumn=s.nextColumn.nextColumn()),s.nextColumn&&s.nextColumn.setWidth(s.nextColumn.getWidth()-a)}s.table.columnManager.renderer.rerenderColumns(!0),!s.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights()}function n(e){s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!1),s.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights(),document.body.removeEventListener("mouseup",n),document.body.removeEventListener("mousemove",o),i.removeEventListener("touchmove",o),i.removeEventListener("touchend",n),s.table.element.classList.remove("tabulator-block-select"),s.startWidth!==t.getWidth()&&(s.dispatch("column-resized",t),s.table.externalEvents.dispatch("columnResized",t.getComponent()))}s.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!0),s.startX=void 0===e.screenX?e.touches[0].screenX:e.screenX,s.latestX=s.startX,s.startWidth=t.getWidth(),document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",n),i.addEventListener("touchmove",o,{passive:!0}),i.addEventListener("touchend",n)}}re.moduleName="resizeColumns";class ae extends o{constructor(e){super(e),this.startColumn=!1,this.startY=!1,this.startHeight=!1,this.handle=null,this.prevHandle=null,this.registerTableOption("resizableRows",!1)}initialize(){this.table.options.resizableRows&&this.subscribe("row-layout-after",this.initializeRow.bind(this))}initializeRow(e){var t=this,i=e.getElement(),s=document.createElement("div");s.className="tabulator-row-resize-handle";var o=document.createElement("div");o.className="tabulator-row-resize-handle prev",s.addEventListener("click",(function(e){e.stopPropagation()}));var n=function(i){t.startRow=e,t._mouseDown(i,e,s)};s.addEventListener("mousedown",n),s.addEventListener("touchstart",n,{passive:!0}),o.addEventListener("click",(function(e){e.stopPropagation()}));var r=function(i){var s=t.table.rowManager.prevDisplayRow(e);s&&(t.startRow=s,t._mouseDown(i,s,o))};o.addEventListener("mousedown",r),o.addEventListener("touchstart",r,{passive:!0}),i.appendChild(s),i.appendChild(o)}_mouseDown(e,t,i){var s=this;function o(e){t.setHeight(s.startHeight+((void 0===e.screenY?e.touches[0].screenY:e.screenY)-s.startY))}function n(e){document.body.removeEventListener("mouseup",o),document.body.removeEventListener("mousemove",o),i.removeEventListener("touchmove",o),i.removeEventListener("touchend",n),s.table.element.classList.remove("tabulator-block-select"),s.dispatchExternal("rowResized",t.getComponent())}s.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),s.startY=void 0===e.screenY?e.touches[0].screenY:e.screenY,s.startHeight=t.getHeight(),document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",n),i.addEventListener("touchmove",o,{passive:!0}),i.addEventListener("touchend",n)}}ae.moduleName="resizeRows";class le extends o{constructor(e){super(e),this.binding=!1,this.observer=!1,this.containerObserver=!1,this.tableHeight=0,this.tableWidth=0,this.containerHeight=0,this.containerWidth=0,this.autoResize=!1,this.registerTableOption("autoResize",!0)}initialize(){if(this.table.options.autoResize){var e,t=this.table;this.tableHeight=t.element.clientHeight,this.tableWidth=t.element.clientWidth,t.element.parentNode&&(this.containerHeight=t.element.parentNode.clientHeight,this.containerWidth=t.element.parentNode.clientWidth),"undefined"!=typeof ResizeObserver&&"virtual"===t.rowManager.getRenderMode()?(this.autoResize=!0,this.observer=new ResizeObserver((e=>{if(!t.browserMobile||t.browserMobile&&!t.modules.edit.currentCell){var i=Math.floor(e[0].contentRect.height),s=Math.floor(e[0].contentRect.width);this.tableHeight==i&&this.tableWidth==s||(this.tableHeight=i,this.tableWidth=s,t.element.parentNode&&(this.containerHeight=t.element.parentNode.clientHeight,this.containerWidth=t.element.parentNode.clientWidth),this.table.columnManager.renderer.rerenderColumns(!0),t.redraw())}})),this.observer.observe(t.element),e=window.getComputedStyle(t.element),this.table.element.parentNode&&!this.table.rowManager.fixedHeight&&(e.getPropertyValue("max-height")||e.getPropertyValue("min-height"))&&(this.containerObserver=new ResizeObserver((e=>{if(!t.browserMobile||t.browserMobile&&!t.modules.edit.currentCell){var i=Math.floor(e[0].contentRect.height),s=Math.floor(e[0].contentRect.width);this.containerHeight==i&&this.containerWidth==s||(this.containerHeight=i,this.containerWidth=s,this.tableHeight=t.element.clientHeight,this.tableWidth=t.element.clientWidth),t.columnManager.renderer.rerenderColumns(!0),t.redraw()}})),this.containerObserver.observe(this.table.element.parentNode)),this.subscribe("table-resize",this.tableResized.bind(this))):(this.binding=function(){(!t.browserMobile||t.browserMobile&&!t.modules.edit.currentCell)&&(t.columnManager.renderer.rerenderColumns(!0),t.redraw())},window.addEventListener("resize",this.binding)),this.subscribe("table-destroy",this.clearBindings.bind(this))}}tableResized(){this.table.rowManager.redraw()}clearBindings(){this.binding&&window.removeEventListener("resize",this.binding),this.observer&&this.observer.unobserve(this.table.element),this.containerObserver&&this.containerObserver.unobserve(this.table.element.parentNode)}}le.moduleName="resizeTable";class he extends o{constructor(e){super(e),this.columns=[],this.hiddenColumns=[],this.mode="",this.index=0,this.collapseFormatter=[],this.collapseStartOpen=!0,this.collapseHandleColumn=!1,this.registerTableOption("responsiveLayout",!1),this.registerTableOption("responsiveLayoutCollapseStartOpen",!0),this.registerTableOption("responsiveLayoutCollapseUseFormatters",!0),this.registerTableOption("responsiveLayoutCollapseFormatter",!1),this.registerColumnOption("responsive")}initialize(){this.table.options.responsiveLayout&&(this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("column-show",this.updateColumnVisibility.bind(this)),this.subscribe("column-hide",this.updateColumnVisibility.bind(this)),this.subscribe("columns-loaded",this.initializeResponsivity.bind(this)),this.subscribe("column-moved",this.initializeResponsivity.bind(this)),this.subscribe("column-add",this.initializeResponsivity.bind(this)),this.subscribe("column-delete",this.initializeResponsivity.bind(this)),this.subscribe("table-redrawing",this.tableRedraw.bind(this)),"collapse"===this.table.options.responsiveLayout&&(this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout",this.layoutRow.bind(this))))}tableRedraw(e){-1===["fitColumns","fitDataStretch"].indexOf(this.layoutMode())&&(e||this.update())}initializeResponsivity(){var e=[];this.mode=this.table.options.responsiveLayout,this.collapseFormatter=this.table.options.responsiveLayoutCollapseFormatter||this.formatCollapsedData,this.collapseStartOpen=this.table.options.responsiveLayoutCollapseStartOpen,this.hiddenColumns=[],this.table.columnManager.columnsByIndex.forEach(((t,i)=>{t.modules.responsive&&t.modules.responsive.order&&t.modules.responsive.visible&&(t.modules.responsive.index=i,e.push(t),t.visible||"collapse"!==this.mode||this.hiddenColumns.push(t))})),e=(e=e.reverse()).sort(((e,t)=>t.modules.responsive.order-e.modules.responsive.order||t.modules.responsive.index-e.modules.responsive.index)),this.columns=e,"collapse"===this.mode&&this.generateCollapsedContent();for(let e of this.table.columnManager.columnsByIndex)if("responsiveCollapse"==e.definition.formatter){this.collapseHandleColumn=e;break}this.collapseHandleColumn&&(this.hiddenColumns.length?this.collapseHandleColumn.show():this.collapseHandleColumn.hide())}initializeColumn(e){var t=e.getDefinition();e.modules.responsive={order:void 0===t.responsive?1:t.responsive,visible:!1!==t.visible}}initializeRow(e){var t;"calc"!==e.type&&((t=document.createElement("div")).classList.add("tabulator-responsive-collapse"),e.modules.responsiveLayout={element:t,open:this.collapseStartOpen},this.collapseStartOpen||(t.style.display="none"))}layoutRow(e){var t=e.getElement();e.modules.responsiveLayout&&(t.appendChild(e.modules.responsiveLayout.element),this.generateCollapsedRowContent(e))}updateColumnVisibility(e,t){!t&&e.modules.responsive&&(e.modules.responsive.visible=e.visible,this.initializeResponsivity())}hideColumn(e){var t=this.hiddenColumns.length;e.hide(!1,!0),"collapse"===this.mode&&(this.hiddenColumns.unshift(e),this.generateCollapsedContent(),this.collapseHandleColumn&&!t&&this.collapseHandleColumn.show())}showColumn(e){var t;e.show(!1,!0),e.setWidth(e.getWidth()),"collapse"===this.mode&&((t=this.hiddenColumns.indexOf(e))>-1&&this.hiddenColumns.splice(t,1),this.generateCollapsedContent(),this.collapseHandleColumn&&!this.hiddenColumns.length&&this.collapseHandleColumn.hide())}update(){for(var e=this,t=!0;t;){let i="fitColumns"==e.table.modules.layout.getMode()?e.table.columnManager.getFlexBaseWidth():e.table.columnManager.getWidth(),s=(e.table.options.headerVisible?e.table.columnManager.element.clientWidth:e.table.element.clientWidth)-i;if(s<0){let i=e.columns[e.index];i?(e.hideColumn(i),e.index++):t=!1}else{let i=e.columns[e.index-1];i&&s>0&&s>=i.getWidth()?(e.showColumn(i),e.index--):t=!1}e.table.rowManager.activeRowsCount||e.table.rowManager.renderEmptyScroll()}}generateCollapsedContent(){var e=this;this.table.rowManager.getDisplayRows().forEach((function(t){e.generateCollapsedRowContent(t)}))}generateCollapsedRowContent(e){var t,i;if(e.modules.responsiveLayout){for(t=e.modules.responsiveLayout.element;t.firstChild;)t.removeChild(t.firstChild);(i=this.collapseFormatter(this.generateCollapsedRowData(e)))&&t.appendChild(i)}}generateCollapsedRowData(e){var t,i=this,s=e.getData(),o=[];return this.hiddenColumns.forEach((function(n){var r=n.getFieldValue(s);if(n.definition.title&&n.field)if(n.modules.format&&i.table.options.responsiveLayoutCollapseUseFormatters){t={value:!1,data:{},getValue:function(){return r},getData:function(){return s},getElement:function(){return document.createElement("div")},getRow:function(){return e.getComponent()},getColumn:function(){return n.getComponent()}},o.push({field:n.field,title:n.definition.title,value:n.modules.format.formatter.call(i.table.modules.format,t,n.modules.format.params,(function(e){e()}))})}else o.push({field:n.field,title:n.definition.title,value:r})})),o}formatCollapsedData(e){var t=document.createElement("table");return e.forEach((function(e){var i,s=document.createElement("tr"),o=document.createElement("td"),n=document.createElement("td"),r=document.createElement("strong");o.appendChild(r),this.langBind("columns|"+e.field,(function(t){r.innerHTML=t||e.title})),e.value instanceof Node?((i=document.createElement("div")).appendChild(e.value),n.appendChild(i)):n.innerHTML=e.value,s.appendChild(o),s.appendChild(n),t.appendChild(s)}),this),Object.keys(e).length?t:""}}he.moduleName="responsiveLayout";class de extends o{constructor(e){super(e),this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],this.headerCheckboxElement=null,this.registerTableOption("selectable","highlight"),this.registerTableOption("selectableRangeMode","drag"),this.registerTableOption("selectableRollingSelection",!0),this.registerTableOption("selectablePersistence",!0),this.registerTableOption("selectableCheck",(function(e,t){return!0})),this.registerTableFunction("selectRow",this.selectRows.bind(this)),this.registerTableFunction("deselectRow",this.deselectRows.bind(this)),this.registerTableFunction("toggleSelectRow",this.toggleRow.bind(this)),this.registerTableFunction("getSelectedRows",this.getSelectedRows.bind(this)),this.registerTableFunction("getSelectedData",this.getSelectedData.bind(this)),this.registerComponentFunction("row","select",this.selectRows.bind(this)),this.registerComponentFunction("row","deselect",this.deselectRows.bind(this)),this.registerComponentFunction("row","toggleSelect",this.toggleRow.bind(this)),this.registerComponentFunction("row","isSelected",this.isRowSelected.bind(this))}initialize(){!1!==this.table.options.selectable&&(this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-deleting",this.rowDeleted.bind(this)),this.subscribe("rows-wipe",this.clearSelectionData.bind(this)),this.subscribe("rows-retrieve",this.rowRetrieve.bind(this)),this.table.options.selectable&&!this.table.options.selectablePersistence&&this.subscribe("data-refreshing",this.deselectRows.bind(this)))}rowRetrieve(e,t){return"selected"===e?this.selectedRows:t}rowDeleted(e){this._deselectRow(e,!0)}clearSelectionData(e){this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],!0!==e&&this._rowSelectionChanged()}initializeRow(e){var t=this,i=e.getElement(),s=function(){setTimeout((function(){t.selecting=!1}),50),document.body.removeEventListener("mouseup",s)};e.modules.select={selected:!1},t.table.options.selectableCheck.call(this.table,e.getComponent())?(i.classList.add("tabulator-selectable"),i.classList.remove("tabulator-unselectable"),t.table.options.selectable&&"highlight"!=t.table.options.selectable&&("click"===t.table.options.selectableRangeMode?i.addEventListener("click",this.handleComplexRowClick.bind(this,e)):(i.addEventListener("click",(function(i){t.table.modExists("edit")&&t.table.modules.edit.getCurrentCell()||t.table._clearSelection(),t.selecting||t.toggleRow(e)})),i.addEventListener("mousedown",(function(i){if(i.shiftKey)return t.table._clearSelection(),t.selecting=!0,t.selectPrev=[],document.body.addEventListener("mouseup",s),document.body.addEventListener("keyup",s),t.toggleRow(e),!1})),i.addEventListener("mouseenter",(function(i){t.selecting&&(t.table._clearSelection(),t.toggleRow(e),t.selectPrev[1]==e&&t.toggleRow(t.selectPrev[0]))})),i.addEventListener("mouseout",(function(i){t.selecting&&(t.table._clearSelection(),t.selectPrev.unshift(e))}))))):(i.classList.add("tabulator-unselectable"),i.classList.remove("tabulator-selectable"))}handleComplexRowClick(e,t){if(t.shiftKey){this.table._clearSelection(),this.lastClickedRow=this.lastClickedRow||e;var i=this.table.rowManager.getDisplayRowIndex(this.lastClickedRow),s=this.table.rowManager.getDisplayRowIndex(e),o=i<=s?i:s,n=i>=s?i:s,r=this.table.rowManager.getDisplayRows().slice(0).splice(o,n-o+1);t.ctrlKey||t.metaKey?(r.forEach((t=>{t!==this.lastClickedRow&&(!0===this.table.options.selectable||this.isRowSelected(e)||this.selectedRows.lengththis.table.options.selectable&&(r=r.slice(0,this.table.options.selectable)),this.selectRows(r)),this.table._clearSelection()}else t.ctrlKey||t.metaKey?(this.toggleRow(e),this.lastClickedRow=e):(this.deselectRows(void 0,!0),this.selectRows(e),this.lastClickedRow=e)}toggleRow(e){this.table.options.selectableCheck.call(this.table,e.getComponent())&&(e.modules.select&&e.modules.select.selected?this._deselectRow(e):this._selectRow(e))}selectRows(e){var t;switch(typeof e){case"undefined":this.table.rowManager.rows.forEach((e=>{this._selectRow(e,!0,!0)})),this._rowSelectionChanged();break;case"string":(t=this.table.rowManager.findRow(e))?this._selectRow(t,!0,!0):this.table.rowManager.getRows(e).forEach((e=>{this._selectRow(e,!0,!0)})),this._rowSelectionChanged();break;default:Array.isArray(e)?(e.forEach((e=>{this._selectRow(e,!0,!0)})),this._rowSelectionChanged()):this._selectRow(e,!1,!0)}}_selectRow(e,t,i){if(!isNaN(this.table.options.selectable)&&!0!==this.table.options.selectable&&!i&&this.selectedRows.length>=this.table.options.selectable){if(!this.table.options.selectableRollingSelection)return!1;this._deselectRow(this.selectedRows[0])}var s=this.table.rowManager.findRow(e);s?-1==this.selectedRows.indexOf(s)&&(s.getElement().classList.add("tabulator-selected"),s.modules.select||(s.modules.select={}),s.modules.select.selected=!0,s.modules.select.checkboxEl&&(s.modules.select.checkboxEl.checked=!0),this.selectedRows.push(s),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(s,!0),this.dispatchExternal("rowSelected",s.getComponent()),this._rowSelectionChanged(t)):t||console.warn("Selection Error - No such row found, ignoring selection:"+e)}isRowSelected(e){return-1!==this.selectedRows.indexOf(e)}deselectRows(e,t){var i,s=this;if(void 0===e){i=s.selectedRows.length;for(let e=0;e-1&&(o.getElement().classList.remove("tabulator-selected"),o.modules.select||(o.modules.select={}),o.modules.select.selected=!1,o.modules.select.checkboxEl&&(o.modules.select.checkboxEl.checked=!1),s.selectedRows.splice(i,1),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(o,!1),this.dispatchExternal("rowDeselected",o.getComponent()),s._rowSelectionChanged(t)):t||console.warn("Deselection Error - No such row found, ignoring selection:"+e)}getSelectedData(){var e=[];return this.selectedRows.forEach((function(t){e.push(t.getData())})),e}getSelectedRows(){var e=[];return this.selectedRows.forEach((function(t){e.push(t.getComponent())})),e}_rowSelectionChanged(e){this.headerCheckboxElement&&(0===this.selectedRows.length?(this.headerCheckboxElement.checked=!1,this.headerCheckboxElement.indeterminate=!1):this.table.rowManager.rows.length===this.selectedRows.length?(this.headerCheckboxElement.checked=!0,this.headerCheckboxElement.indeterminate=!1):(this.headerCheckboxElement.indeterminate=!0,this.headerCheckboxElement.checked=!1)),e||this.dispatchExternal("rowSelectionChanged",this.getSelectedData(),this.getSelectedRows())}registerRowSelectCheckbox(e,t){e._row.modules.select||(e._row.modules.select={}),e._row.modules.select.checkboxEl=t}registerHeaderSelectCheckbox(e){this.headerCheckboxElement=e}childRowSelection(e,t){var i=this.table.modules.dataTree.getChildren(e,!0);if(t)for(let e of i)this._selectRow(e,!0);else for(let e of i)this._deselectRow(e,!0)}}function ce(e,t,i,s,o,n,r){var a=window.DateTime||luxon.DateTime,l=r.format||"dd/MM/yyyy HH:mm:ss",h=r.alignEmptyValues,d=0;if(void 0!==a){if(e=a.isDateTime(e)?e:"iso"===l?a.fromISO(String(e)):a.fromFormat(String(e),l),t=a.isDateTime(t)?t:"iso"===l?a.fromISO(String(t)):a.fromFormat(String(t),l),e.isValid){if(t.isValid)return e-t;d=1}else d=t.isValid?-1:0;return("top"===h&&"desc"===n||"bottom"===h&&"asc"===n)&&(d*=-1),d}console.error("Sort Error - 'datetime' sorter is dependant on luxon.js")}de.moduleName="selectRow";var ue={number:function(e,t,i,s,o,n,r){var a=r.alignEmptyValues,l=r.decimalSeparator,h=r.thousandSeparator,d=0;if(e=String(e),t=String(t),h&&(e=e.split(h).join(""),t=t.split(h).join("")),l&&(e=e.split(l).join("."),t=t.split(l).join(".")),e=parseFloat(e),t=parseFloat(t),isNaN(e))d=isNaN(t)?0:-1;else{if(!isNaN(t))return e-t;d=1}return("top"===a&&"desc"===n||"bottom"===a&&"asc"===n)&&(d*=-1),d},string:function(e,t,i,s,o,n,r){var a,l=r.alignEmptyValues,h=0;if(e){if(t){switch(typeof r.locale){case"boolean":r.locale&&(a=this.langLocale());break;case"string":a=r.locale}return String(e).toLowerCase().localeCompare(String(t).toLowerCase(),a)}h=1}else h=t?-1:0;return("top"===l&&"desc"===n||"bottom"===l&&"asc"===n)&&(h*=-1),h},date:function(e,t,i,s,o,n,r){return r.format||(r.format="dd/MM/yyyy"),ce.call(this,e,t,i,s,o,n,r)},time:function(e,t,i,s,o,n,r){return r.format||(r.format="HH:mm"),ce.call(this,e,t,i,s,o,n,r)},datetime:ce,boolean:function(e,t,i,s,o,n,r){return(!0===e||"true"===e||"True"===e||1===e?1:0)-(!0===t||"true"===t||"True"===t||1===t?1:0)},array:function(e,t,i,s,o,n,r){var a=r.type||"length",l=r.alignEmptyValues,h=0;function d(e){switch(a){case"length":return e.length;case"sum":return e.reduce((function(e,t){return e+t}));case"max":return Math.max.apply(null,e);case"min":return Math.min.apply(null,e);case"avg":return e.reduce((function(e,t){return e+t}))/e.length}}if(Array.isArray(e)){if(Array.isArray(t))return(e?d(e):0)-(t?d(t):0);l=1}else l=Array.isArray(t)?-1:0;return("top"===l&&"desc"===n||"bottom"===l&&"asc"===n)&&(h*=-1),h},exists:function(e,t,i,s,o,n,r){return(void 0===e?0:1)-(void 0===t?0:1)},alphanum:function(e,t,i,s,o,n,r){var a,l,h,d,c,u=0,m=/(\d+)|(\D+)/g,p=/\d/,g=r.alignEmptyValues,b=0;if(e||0===e){if(t||0===t){if(isFinite(e)&&isFinite(t))return e-t;if((a=String(e).toLowerCase())===(l=String(t).toLowerCase()))return 0;if(!p.test(a)||!p.test(l))return a>l?1:-1;for(a=a.match(m),l=l.match(m),c=a.length>l.length?l.length:a.length;ud?1:-1;return a.length>l.length}b=1}else b=t||0===t?-1:0;return("top"===g&&"desc"===n||"bottom"===g&&"asc"===n)&&(b*=-1),b}};class me extends o{constructor(e){super(e),this.sortList=[],this.changed=!1,this.registerTableOption("sortMode","local"),this.registerTableOption("initialSort",!1),this.registerTableOption("columnHeaderSortMulti",!0),this.registerTableOption("sortOrderReverse",!1),this.registerTableOption("headerSortElement","
"),this.registerColumnOption("sorter"),this.registerColumnOption("sorterParams"),this.registerColumnOption("headerSort",!0),this.registerColumnOption("headerSortStartingDir"),this.registerColumnOption("headerSortTristate")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("table-built",this.tableBuilt.bind(this)),this.registerDataHandler(this.sort.bind(this),20),this.registerTableFunction("setSort",this.userSetSort.bind(this)),this.registerTableFunction("getSorters",this.getSort.bind(this)),this.registerTableFunction("clearSort",this.clearSort.bind(this)),"remote"===this.table.options.sortMode&&this.subscribe("data-params",this.remoteSortParams.bind(this))}tableBuilt(){this.table.options.initialSort&&this.setSort(this.table.options.initialSort)}remoteSortParams(e,t,i,s){var o=this.getSort();return o.forEach((e=>{delete e.column})),s.sort=o,s}userSetSort(e,t){this.setSort(e,t),this.refreshSort()}clearSort(){this.clear(),this.refreshSort()}initializeColumn(e){var t,i,s=!1;switch(typeof e.definition.sorter){case"string":me.sorters[e.definition.sorter]?s=me.sorters[e.definition.sorter]:console.warn("Sort Error - No such sorter found: ",e.definition.sorter);break;case"function":s=e.definition.sorter}e.modules.sort={sorter:s,dir:"none",params:e.definition.sorterParams||{},startingDir:e.definition.headerSortStartingDir||"asc",tristate:e.definition.headerSortTristate},!1!==e.definition.headerSort&&((t=e.getElement()).classList.add("tabulator-sortable"),(i=document.createElement("div")).classList.add("tabulator-col-sorter"),"object"==typeof this.table.options.headerSortElement?i.appendChild(this.table.options.headerSortElement):i.innerHTML=this.table.options.headerSortElement,e.titleHolderElement.appendChild(i),e.modules.sort.element=i,t.addEventListener("click",(t=>{var i="",s=[],o=!1;if(e.modules.sort){if(e.modules.sort.tristate)i="none"==e.modules.sort.dir?e.modules.sort.startingDir:e.modules.sort.dir==e.modules.sort.startingDir?"asc"==e.modules.sort.dir?"desc":"asc":"none";else switch(e.modules.sort.dir){case"asc":i="desc";break;case"desc":i="asc";break;default:i=e.modules.sort.startingDir}this.table.options.columnHeaderSortMulti&&(t.shiftKey||t.ctrlKey)?((o=(s=this.getSort()).findIndex((t=>t.field===e.getField())))>-1?(s[o].dir=i,o!=s.length-1&&(o=s.splice(o,1)[0],"none"!=i&&s.push(o))):"none"!=i&&s.push({column:e,dir:i}),this.setSort(s)):"none"==i?this.clear():this.setSort(e,i),this.refreshSort()}})))}refreshSort(){"remote"===this.table.options.sortMode?this.reloadData(null,!1,!1):this.refreshData(!0)}hasChanged(){var e=this.changed;return this.changed=!1,e}getSort(){var e=[];return this.sortList.forEach((function(t){t.column&&e.push({column:t.column.getComponent(),field:t.column.getField(),dir:t.dir})})),e}setSort(e,t){var i=this,s=[];Array.isArray(e)||(e=[{column:e,dir:t}]),e.forEach((function(e){var t;(t=i.table.columnManager.findColumn(e.column))?(e.column=t,s.push(e),i.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",e.column)})),i.sortList=s,this.dispatch("sort-changed")}clear(){this.setSort([])}findSorter(e){var t,i=this.table.rowManager.activeRows[0],s="string";if(i&&(i=i.getData(),e.getField()))switch(typeof(t=e.getFieldValue(i))){case"undefined":s="string";break;case"boolean":s="boolean";break;default:isNaN(t)||""===t?t.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(s="alphanum"):s="number"}return me.sorters[s]}sort(e){var t=this,i=this.table.options.sortOrderReverse?t.sortList.slice().reverse():t.sortList,s=[],o=[];return this.subscribedExternal("dataSorting")&&this.dispatchExternal("dataSorting",t.getSort()),t.clearColumnHeaders(),"remote"!==this.table.options.sortMode?(i.forEach((function(e,i){var o=e.column.modules.sort;e.column&&o&&(o.sorter||(o.sorter=t.findSorter(e.column)),e.params="function"==typeof o.params?o.params(e.column.getComponent(),e.dir):o.params,s.push(e)),t.setColumnHeader(e.column,e.dir)})),s.length&&t._sortItems(e,s)):i.forEach((function(e,i){t.setColumnHeader(e.column,e.dir)})),this.subscribedExternal("dataSorted")&&(e.forEach((e=>{o.push(e.getComponent())})),this.dispatchExternal("dataSorted",t.getSort(),o)),e}clearColumnHeaders(){this.table.columnManager.getRealColumns().forEach((function(e){e.modules.sort&&(e.modules.sort.dir="none",e.getElement().setAttribute("aria-sort","none"))}))}setColumnHeader(e,t){e.modules.sort.dir=t,e.getElement().setAttribute("aria-sort",t)}_sortItems(e,t){var i=t.length-1;e.sort(((e,s)=>{for(var o,n=i;n>=0;n--){let i=t[n];if(0!==(o=this._sortRow(e,s,i.column,i.dir,i.params)))break}return o}))}_sortRow(e,t,i,s,o){var n,r,a="asc"==s?e:t,l="asc"==s?t:e;return e=void 0!==(e=i.getFieldValue(a.getData()))?e:"",t=void 0!==(t=i.getFieldValue(l.getData()))?t:"",n=a.getComponent(),r=l.getComponent(),i.modules.sort.sorter.call(this,e,t,n,r,i.getComponent(),s,o)}}me.moduleName="sort",me.sorters=ue;class pe extends o{constructor(e){super(e),this.tooltipSubscriber=null,this.headerSubscriber=null,this.timeout=null,this.popupInstance=null,this.registerTableOption("tooltipGenerationMode",void 0),this.registerTableOption("tooltipDelay",300),this.registerColumnOption("tooltip"),this.registerColumnOption("headerTooltip")}initialize(){this.deprecationCheck(),this.subscribe("column-init",this.initializeColumn.bind(this))}deprecationCheck(){void 0!==this.table.options.tooltipGenerationMode&&console.warn("Use of the tooltipGenerationMode option is now deprecated. This option is no longer needed as tooltips are always generated on hover now")}initializeColumn(e){e.definition.headerTooltip&&!this.headerSubscriber&&(this.headerSubscriber=!0,this.subscribe("column-mousemove",this.mousemoveCheck.bind(this,"headerTooltip")),this.subscribe("column-mouseout",this.mouseoutCheck.bind(this,"headerTooltip"))),e.definition.tooltip&&!this.tooltipSubscriber&&(this.tooltipSubscriber=!0,this.subscribe("cell-mousemove",this.mousemoveCheck.bind(this,"tooltip")),this.subscribe("cell-mouseout",this.mouseoutCheck.bind(this,"tooltip")))}mousemoveCheck(e,t,i){var s="tooltip"===e?i.column.definition.tooltip:i.definition.headerTooltip;s&&(this.clearPopup(),this.timeout=setTimeout(this.loadTooltip.bind(this,t,i,s),this.table.options.tooltipDelay))}mouseoutCheck(e,t,i){this.popupInstance||this.clearPopup()}clearPopup(e,t,i){clearTimeout(this.timeout),this.timeout=null,this.popupInstance&&this.popupInstance.hide()}loadTooltip(e,t,i){var s,o,n;"function"==typeof i&&(i=i(e,t.getComponent(),(function(e){o=e}))),i instanceof HTMLElement?s=i:(s=document.createElement("div"),!0===i&&(t instanceof g?i=t.value:t.definition.field?this.langBind("columns|"+t.definition.field,(e=>{s.innerHTML=i=e||t.definition.title})):i=t.definition.title),s.innerHTML=i),(i||0===i||"0"===i||!1===i)&&(s.classList.add("tabulator-tooltip"),s.addEventListener("mousemove",(e=>e.preventDefault())),this.popupInstance=this.popup(s),"function"==typeof o&&this.popupInstance.renderCallback(o),n=this.popupInstance.containerEventCoords(e),this.popupInstance.show(n.x+15,n.y+15).hideOnBlur((()=>{this.dispatchExternal("TooltipClosed",t.getComponent()),this.popupInstance=null})),this.dispatchExternal("TooltipOpened",t.getComponent()))}}pe.moduleName="tooltip";var ge={integer:function(e,t,i){return""===t||null==t||"number"==typeof(t=Number(t))&&isFinite(t)&&Math.floor(t)===t},float:function(e,t,i){return""===t||null==t||"number"==typeof(t=Number(t))&&isFinite(t)&&t%1!=0},numeric:function(e,t,i){return""===t||null==t||!isNaN(t)},string:function(e,t,i){return""===t||null==t||isNaN(t)},max:function(e,t,i){return""===t||null==t||parseFloat(t)<=i},min:function(e,t,i){return""===t||null==t||parseFloat(t)>=i},starts:function(e,t,i){return""===t||null==t||String(t).toLowerCase().startsWith(String(i).toLowerCase())},ends:function(e,t,i){return""===t||null==t||String(t).toLowerCase().endsWith(String(i).toLowerCase())},minLength:function(e,t,i){return""===t||null==t||String(t).length>=i},maxLength:function(e,t,i){return""===t||null==t||String(t).length<=i},in:function(e,t,i){return""===t||null==t||("string"==typeof i&&(i=i.split("|")),""===t||i.indexOf(t)>-1)},regex:function(e,t,i){return""===t||null==t||new RegExp(i).test(t)},unique:function(e,t,i){if(""===t||null==t)return!0;var s=!0,o=e.getData(),n=e.getColumn()._getSelf();return this.table.rowManager.rows.forEach((function(e){var i=e.getData();i!==o&&t==n.getFieldValue(i)&&(s=!1)})),s},required:function(e,t,i){return""!==t&&null!=t}};class be extends o{constructor(e){super(e),this.invalidCells=[],this.registerTableOption("validationMode","blocking"),this.registerColumnOption("validator"),this.registerTableFunction("getInvalidCells",this.getInvalidCells.bind(this)),this.registerTableFunction("clearCellValidation",this.userClearCellValidation.bind(this)),this.registerTableFunction("validate",this.userValidate.bind(this)),this.registerComponentFunction("cell","isValid",this.cellIsValid.bind(this)),this.registerComponentFunction("cell","clearValidation",this.clearValidation.bind(this)),this.registerComponentFunction("cell","validate",this.cellValidate.bind(this)),this.registerComponentFunction("column","validate",this.columnValidate.bind(this)),this.registerComponentFunction("row","validate",this.rowValidate.bind(this))}initialize(){this.subscribe("cell-delete",this.clearValidation.bind(this)),this.subscribe("column-layout",this.initializeColumnCheck.bind(this)),this.subscribe("edit-success",this.editValidate.bind(this)),this.subscribe("edit-editor-clear",this.editorClear.bind(this)),this.subscribe("edit-edited-clear",this.editedClear.bind(this))}editValidate(e,t,i){var s="manual"===this.table.options.validationMode||this.validate(e.column.modules.validate,e,t);return!0!==s&&setTimeout((()=>{e.getElement().classList.add("tabulator-validation-fail"),this.dispatchExternal("validationFailed",e.getComponent(),t,s)})),s}editorClear(e,t){t&&e.column.modules.validate&&this.cellValidate(e),e.getElement().classList.remove("tabulator-validation-fail")}editedClear(e){e.modules.validate&&(e.modules.validate.invalid=!1)}cellIsValid(e){return e.modules.validate&&e.modules.validate.invalid||!0}cellValidate(e){return this.validate(e.column.modules.validate,e,e.getValue())}columnValidate(e){var t=[];return e.cells.forEach((e=>{!0!==this.cellValidate(e)&&t.push(e.getComponent())})),!t.length||t}rowValidate(e){var t=[];return e.cells.forEach((e=>{!0!==this.cellValidate(e)&&t.push(e.getComponent())})),!t.length||t}userClearCellValidation(e){e||(e=this.getInvalidCells()),Array.isArray(e)||(e=[e]),e.forEach((e=>{this.clearValidation(e._getSelf())}))}userValidate(e){var t=[];return this.table.rowManager.rows.forEach((e=>{var i=(e=e.getComponent()).validate();!0!==i&&(t=t.concat(i))})),!t.length||t}initializeColumnCheck(e){void 0!==e.definition.validator&&this.initializeColumn(e)}initializeColumn(e){var t,i=this,s=[];e.definition.validator&&(Array.isArray(e.definition.validator)?e.definition.validator.forEach((e=>{(t=i._extractValidator(e))&&s.push(t)})):(t=this._extractValidator(e.definition.validator))&&s.push(t),e.modules.validate=!!s.length&&s)}_extractValidator(e){var t,i,s;switch(typeof e){case"string":return(s=e.indexOf(":"))>-1?(t=e.substring(0,s),i=e.substring(s+1)):t=e,this._buildValidator(t,i);case"function":return this._buildValidator(e);case"object":return this._buildValidator(e.type,e.parameters)}}_buildValidator(e,t){var i="function"==typeof e?e:be.validators[e];return i?{type:"function"==typeof e?"function":e,func:i,params:t}:(console.warn("Validator Setup Error - No matching validator found:",e),!1)}validate(e,t,i){var s=this,o=[],n=this.invalidCells.indexOf(t);return e&&e.forEach((e=>{e.func.call(s,t.getComponent(),i,e.params)||o.push({type:e.type,parameters:e.params})})),t.modules.validate||(t.modules.validate={}),o.length?(t.modules.validate.invalid=o,"manual"!==this.table.options.validationMode&&t.getElement().classList.add("tabulator-validation-fail"),-1==n&&this.invalidCells.push(t)):(t.modules.validate.invalid=!1,t.getElement().classList.remove("tabulator-validation-fail"),n>-1&&this.invalidCells.splice(n,1)),!o.length||o}getInvalidCells(){var e=[];return this.invalidCells.forEach((t=>{e.push(t.getComponent())})),e}clearValidation(e){var t;e.modules.validate&&e.modules.validate.invalid&&(e.getElement().classList.remove("tabulator-validation-fail"),e.modules.validate.invalid=!1,(t=this.invalidCells.indexOf(e))>-1&&this.invalidCells.splice(t,1))}}be.moduleName="validate",be.validators=ge;var fe=Object.freeze({__proto__:null,AccessorModule:n,AjaxModule:c,ClipboardModule:u,ColumnCalcsModule:y,DataTreeModule:R,DownloadModule:T,EditModule:D,ExportModule:z,FilterModule:H,FormatModule:O,FrozenColumnsModule:A,FrozenRowsModule:B,GroupRowsModule:V,HistoryModule:W,HtmlTableImportModule:G,ImportModule:U,InteractionModule:X,KeybindingsModule:q,MenuModule:K,MoveColumnsModule:J,MoveRowsModule:Y,MutatorModule:$,PageModule:Q,PersistenceModule:ie,PopupModule:se,PrintModule:oe,ReactiveDataModule:ne,ResizeColumnsModule:re,ResizeRowsModule:ae,ResizeTableModule:le,ResponsiveLayoutModule:he,SelectRowModule:de,SortModule:me,TooltipModule:pe,ValidateModule:be});class ve{constructor(e,t,i={}){this.table=e,this.msgType=t,this.registeredDefaults=Object.assign({},i)}register(e,t){this.registeredDefaults[e]=t}generate(e,t={}){var i=Object.assign({},this.registeredDefaults);if(Object.assign(i,e),!1!==t.debugInvalidOptions||this.table.options.debugInvalidOptions)for(var s in t)i.hasOwnProperty(s)||console.warn("Invalid "+this.msgType+" option:",s);for(var s in i)s in t?i[s]=t[s]:Array.isArray(i[s])?i[s]=Object.assign([],i[s]):"object"==typeof i[s]&&null!==i[s]?i[s]=Object.assign({},i[s]):void 0===i[s]&&delete i[s];return i}}class we extends e{constructor(e){super(e),this.elementVertical=e.rowManager.element,this.elementHorizontal=e.columnManager.element,this.tableElement=e.rowManager.tableElement,this.verticalFillMode="fit"}initialize(){}clearRows(){}clearColumns(){}reinitializeColumnWidths(e){}renderRows(){}renderColumns(){}rerenderRows(e){e&&e()}rerenderColumns(e,t){}renderRowCells(e){}rerenderRowCells(e,t){}scrollColumns(e,t){}scrollRows(e,t){}resize(){}scrollToRow(e){}scrollToRowNearestTop(e){}visibleRows(e){return[]}rows(){return this.table.rowManager.getDisplayRows()}styleRow(e,t){var i=e.getElement();t%2?(i.classList.add("tabulator-row-even"),i.classList.remove("tabulator-row-odd")):(i.classList.add("tabulator-row-odd"),i.classList.remove("tabulator-row-even"))}clear(){this.clearRows(),this.clearColumns()}render(){this.renderRows(),this.renderColumns()}rerender(e){this.rerenderRows(),this.rerenderColumns()}scrollToRowPosition(e,i,s){var o=this.rows().indexOf(e),n=e.getElement(),r=0;return new Promise(((a,l)=>{if(o>-1){if(void 0===s&&(s=this.table.options.scrollToRowIfVisible),!s&&t.elVisible(n)&&(r=t.elOffset(n).top-t.elOffset(this.elementVertical).top)>0&&r{e.element.appendChild(t.getElement()),t.cellRendered()}))}reinitializeColumnWidths(e){e.forEach((function(e){e.reinitializeWidth()}))}}class Ee extends we{constructor(e){super(e),this.leftCol=0,this.rightCol=0,this.scrollLeft=0,this.vDomScrollPosLeft=0,this.vDomScrollPosRight=0,this.vDomPadLeft=0,this.vDomPadRight=0,this.fitDataColAvg=0,this.windowBuffer=200,this.visibleRows=null,this.initialized=!1,this.isFitData=!1,this.columns=[]}initialize(){this.compatibilityCheck(),this.layoutCheck(),this.vertScrollListen()}compatibilityCheck(){var e=this.options("columns"),t=!0;return"fitDataTable"==this.options("layout")&&(console.warn("Horizontal Virtual DOM is not compatible with fitDataTable layout mode"),t=!1),this.options("responsiveLayout")&&(console.warn("Horizontal Virtual DOM is not compatible with responsive columns"),t=!1),this.options("rtl")&&(console.warn("Horizontal Virtual DOM is not currently compatible with RTL text direction"),t=!1),e&&e.find((e=>e.frozen))&&(console.warn("Horizontal Virtual DOM is not compatible with frozen columns"),t=!1),t}layoutCheck(){this.isFitData=this.options("layout").startsWith("fitData")}vertScrollListen(){this.subscribe("scroll-vertical",this.clearVisRowCache.bind(this)),this.subscribe("data-refreshed",this.clearVisRowCache.bind(this))}clearVisRowCache(){this.visibleRows=null}renderColumns(e,t){this.dataChange()}scrollColumns(e,t){this.scrollLeft!=e&&(this.scrollLeft=e,this.scroll(e-(this.vDomScrollPosLeft+this.windowBuffer)))}calcWindowBuffer(){var e=this.elementVertical.clientWidth;this.table.columnManager.columnsByIndex.forEach((t=>{if(t.visible){var i=t.getWidth();i>e&&(e=i)}})),this.windowBuffer=2*e}rerenderColumns(e,t){var i={cols:this.columns,leftCol:this.leftCol,rightCol:this.rightCol},s=0;e&&!this.initialized||(this.clear(),this.calcWindowBuffer(),this.scrollLeft=this.elementVertical.scrollLeft,this.vDomScrollPosLeft=this.scrollLeft-this.windowBuffer,this.vDomScrollPosRight=this.scrollLeft+this.elementVertical.clientWidth+this.windowBuffer,this.table.columnManager.columnsByIndex.forEach((e=>{var t={};if(e.visible){var i=e.getWidth();t.leftPos=s,t.rightPos=s+i,t.width=i,this.isFitData&&(t.fitDataCheck=!e.modules.vdomHoz||e.modules.vdomHoz.fitDataCheck),s+i>this.vDomScrollPosLeft&&s{e.element.appendChild(t.getElement()),t.cellRendered()}))}rerenderRowCells(e,t){this.reinitializeRow(e,t)}reinitializeColumnWidths(e){for(let e=this.leftCol;e<=this.rightCol;e++)this.columns[e].reinitializeWidth()}deinitialize(){this.initialized=!1}clear(){this.columns=[],this.leftCol=-1,this.rightCol=0,this.vDomScrollPosLeft=0,this.vDomScrollPosRight=0,this.vDomPadLeft=0,this.vDomPadRight=0}dataChange(){var e,t,i=!1,s=0;if(this.isFitData){if(this.table.columnManager.columnsByIndex.forEach((e=>{!e.definition.width&&e.visible&&(i=!0)})),i&&i&&this.table.rowManager.getDisplayRows().length&&(this.vDomScrollPosRight=this.scrollLeft+this.elementVertical.clientWidth+this.windowBuffer,t=this.chain("rows-sample",[1],[],(()=>this.table.rowManager.getDisplayRows()))[0])){e=t.getElement(),t.generateCells(),this.tableElement.appendChild(e);for(s=0;s{e!==this.columns[i]&&(t=!1)})),!t)}reinitializeRows(){this.getVisibleRows().forEach((e=>{this.reinitializeRow(e,!0)}))}getVisibleRows(){return this.visibleRows||(this.visibleRows=this.table.rowManager.getVisibleRows()),this.visibleRows}scroll(e){this.vDomScrollPosLeft+=e,this.vDomScrollPosRight+=e,Math.abs(e)>this.windowBuffer/2?this.rerenderColumns():e>0?(this.addColRight(),this.removeColLeft()):(this.addColLeft(),this.removeColRight())}colPositionAdjust(e,t,i){for(let s=e;s{if("group"!==e.type){var i=e.getCell(t);e.getElement().appendChild(i.getElement()),i.cellRendered()}})),this.fitDataColActualWidthCheck(t),this.rightCol++,this.rightCol>=this.columns.length-1?this.vDomPadRight=0:this.vDomPadRight-=t.getWidth()}e&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}addColLeft(){for(var e=!1;;){let t=this.columns[this.leftCol-1];if(!t)break;if(!(t.modules.vdomHoz.rightPos>=this.vDomScrollPosLeft))break;{e=!0,this.getVisibleRows().forEach((e=>{if("group"!==e.type){var i=e.getCell(t);e.getElement().prepend(i.getElement()),i.cellRendered()}})),this.leftCol--,this.leftCol<=0?this.vDomPadLeft=0:this.vDomPadLeft-=t.getWidth();let i=this.fitDataColActualWidthCheck(t);i&&(this.scrollLeft=this.elementVertical.scrollLeft=this.elementVertical.scrollLeft+i,this.vDomPadRight-=i)}}e&&(this.tableElement.style.paddingLeft=this.vDomPadLeft+"px")}removeColRight(){for(var e=!1;;){let t=this.columns[this.rightCol];if(!t)break;if(!(t.modules.vdomHoz.leftPos>this.vDomScrollPosRight))break;e=!0,this.getVisibleRows().forEach((e=>{if("group"!==e.type){var i=e.getCell(t);try{e.getElement().removeChild(i.getElement())}catch(e){console.warn("Could not removeColRight",e.message)}}})),this.vDomPadRight+=t.getWidth(),this.rightCol--}e&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}removeColLeft(){for(var e=!1;;){let t=this.columns[this.leftCol];if(!t)break;if(!(t.modules.vdomHoz.rightPos{if("group"!==e.type){var i=e.getCell(t);try{e.getElement().removeChild(i.getElement())}catch(e){console.warn("Could not removeColLeft",e.message)}}})),this.vDomPadLeft+=t.getWidth(),this.leftCol++}e&&(this.tableElement.style.paddingLeft=this.vDomPadLeft+"px")}fitDataColActualWidthCheck(e){var t,i;return e.modules.vdomHoz.fitDataCheck&&(e.reinitializeWidth(),(i=(t=e.getWidth())-e.modules.vdomHoz.width)&&(e.modules.vdomHoz.rightPos+=i,e.modules.vdomHoz.width=t,this.colPositionAdjust(this.columns.indexOf(e)+1,this.columns.length,i)),e.modules.vdomHoz.fitDataCheck=!1),i}initializeRow(e){if("group"!==e.type){e.modules.vdomHoz={leftCol:this.leftCol,rightCol:this.rightCol};for(let t=this.leftCol;t<=this.rightCol;t++){let i=this.columns[t];if(i&&i.visible){let t=e.getCell(i);e.getElement().appendChild(t.getElement()),t.cellRendered()}}}}reinitializeRow(e,t){if("group"!==e.type&&(t||!e.modules.vdomHoz||e.modules.vdomHoz.leftCol!==this.leftCol||e.modules.vdomHoz.rightCol!==this.rightCol)){for(var i=e.getElement();i.firstChild;)i.removeChild(i.firstChild);this.initializeRow(e)}}}class ye extends e{constructor(e){super(e),this.blockHozScrollEvent=!1,this.headersElement=null,this.element=null,this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.scrollLeft=0,this.optionsList=new ve(this.table,"column definition",f),this.renderer=null}initialize(){this.initializeRenderer(),this.headersElement=this.createHeadersElement(),this.element=this.createHeaderElement(),this.element.insertBefore(this.headersElement,this.element.firstChild),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this))}initializeRenderer(){var e,t={virtual:Ee,basic:Ce};(e="string"==typeof this.table.options.renderHorizontal?t[this.table.options.renderHorizontal]:this.table.options.renderHorizontal)?(this.renderer=new e(this.table,this.element,this.tableElement),this.renderer.initialize()):console.error("Unable to find matching renderer:",table.options.renderHorizontal)}createHeadersElement(){var e=document.createElement("div");return e.classList.add("tabulator-headers"),e.setAttribute("role","row"),e}createHeaderElement(){var e=document.createElement("div");return e.classList.add("tabulator-header"),e.setAttribute("role","rowgroup"),this.table.options.headerVisible||e.classList.add("tabulator-header-hidden"),e}getElement(){return this.element}getHeadersElement(){return this.headersElement}scrollHorizontal(e){var t=0,i=this.element.scrollWidth-this.table.element.clientWidth;this.element.scrollLeft=e,e>i?(t=e-i,this.element.style.marginLeft=-t+"px"):this.element.style.marginLeft=0,this.scrollLeft=e,this.renderer.scrollColumns(e)}generateColumnsFromRowData(e){var t,i,s=[],o=this.table.options.autoColumnsDefinitions;if(e&&e.length){for(var n in t=e[0]){let e={field:n,title:n},o=t[n];switch(typeof o){case"undefined":i="string";break;case"boolean":i="boolean";break;case"object":i=Array.isArray(o)?"array":"string";break;default:i=isNaN(o)||""===o?o.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?"alphanum":"string":"number"}e.sorter=i,s.push(e)}if(o)switch(typeof o){case"function":this.table.options.columns=o.call(this.table,s);break;case"object":Array.isArray(o)?s.forEach((e=>{var t=o.find((t=>t.field===e.field));t&&Object.assign(e,t)})):s.forEach((e=>{o[e.field]&&Object.assign(e,o[e.field])})),this.table.options.columns=s}else this.table.options.columns=s;this.setColumns(this.table.options.columns)}}setColumns(e,t){for(;this.headersElement.firstChild;)this.headersElement.removeChild(this.headersElement.firstChild);this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.dispatch("columns-loading"),e.forEach(((e,t)=>{this._addColumn(e)})),this._reIndexColumns(),this.dispatch("columns-loaded"),this.renderer.rerenderColumns(!1,!0),this.redraw(!0)}_addColumn(e,t,i){var s=new v(e,this),o=s.getElement(),n=i?this.findColumnIndex(i):i;if(i&&n>-1){var r=i.getTopColumn(),a=this.columns.indexOf(r),l=r.getElement();t?(this.columns.splice(a,0,s),l.parentNode.insertBefore(o,l)):(this.columns.splice(a+1,0,s),l.parentNode.insertBefore(o,l.nextSibling))}else t?(this.columns.unshift(s),this.headersElement.insertBefore(s.getElement(),this.headersElement.firstChild)):(this.columns.push(s),this.headersElement.appendChild(s.getElement()));return s.columnRendered(),s}registerColumnField(e){e.definition.field&&(this.columnsByField[e.definition.field]=e)}registerColumnPosition(e){this.columnsByIndex.push(e)}_reIndexColumns(){this.columnsByIndex=[],this.columns.forEach((function(e){e.reRegisterPosition()}))}verticalAlignHeaders(){var e=0;this.columns.forEach((t=>{var i;t.clearVerticalAlign(),(i=t.getHeight())>e&&(e=i)})),this.columns.forEach((t=>{t.verticalAlign(this.table.options.columnHeaderVertAlign,e)})),this.table.rowManager.adjustTableSize()}findColumn(e){if("object"!=typeof e)return this.columnsByField[e]||!1;if(e instanceof v)return e;if(e instanceof b)return e._getSelf()||!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement){return this.columns.find((t=>t.element===e))||!1}return!1}getColumnByField(e){return this.columnsByField[e]}getColumnsByFieldRoot(e){var t=[];return Object.keys(this.columnsByField).forEach((i=>{i.split(".")[0]===e&&t.push(this.columnsByField[i])})),t}getColumnByIndex(e){return this.columnsByIndex[e]}getFirstVisibleColumn(e){return(e=this.columnsByIndex.findIndex((e=>e.visible)))>-1&&this.columnsByIndex[e]}getColumns(){return this.columns}findColumnIndex(e){return this.columnsByIndex.findIndex((t=>e===t))}getRealColumns(){return this.columnsByIndex}traverse(e){this.columnsByIndex.forEach(((t,i)=>{e(t,i)}))}getDefinitions(e){var t=[];return this.columnsByIndex.forEach((i=>{(!e||e&&i.visible)&&t.push(i.getDefinition())})),t}getDefinitionTree(){var e=[];return this.columns.forEach((t=>{e.push(t.getDefinition(!0))})),e}getComponents(e){var t=[];return(e?this.columns:this.columnsByIndex).forEach((e=>{t.push(e.getComponent())})),t}getWidth(){var e=0;return this.columnsByIndex.forEach((t=>{t.visible&&(e+=t.getWidth())})),e}moveColumn(e,t,i){this.moveColumnActual(e,t,i),t.element.parentNode.insertBefore(e.element,t.element),i&&t.element.parentNode.insertBefore(t.element,e.element),this.verticalAlignHeaders(),this.table.rowManager.reinitialize()}moveColumnActual(e,t,i){e.parent.isGroup?this._moveColumnInArray(e.parent.columns,e,t,i):this._moveColumnInArray(this.columns,e,t,i),this._moveColumnInArray(this.columnsByIndex,e,t,i,!0),this.renderer.rerenderColumns(!0),this.dispatch("column-moved",e,t,i),this.subscribedExternal("columnMoved")&&this.dispatchExternal("columnMoved",e.getComponent(),this.table.columnManager.getComponents())}_moveColumnInArray(e,t,i,s,o){var n,r=e.indexOf(t);r>-1&&(e.splice(r,1),(n=e.indexOf(i))>-1?s&&(n+=1):n=r,e.splice(n,0,t),o&&(this.chain("column-moving-rows",[t,i,s],null,[])||[]).concat(this.table.rowManager.rows).forEach((function(e){if(e.cells.length){var t=e.cells.splice(r,1)[0];e.cells.splice(n,0,t)}})))}scrollToColumn(e,t,i){var s=0,o=0,n=0,r=e.getElement();return new Promise(((a,l)=>{if(void 0===t&&(t=this.table.options.scrollToColumnPosition),void 0===i&&(i=this.table.options.scrollToColumnIfVisible),e.visible){switch(t){case"middle":case"center":n=-this.element.clientWidth/2;break;case"right":n=r.clientWidth-this.headersElement.clientWidth}if(!i&&(o=r.offsetLeft)>0&&o+r.offsetWidth{t.push(i.generateCell(e))})),t}getFlexBaseWidth(){var e=this.table.element.clientWidth,t=0;return this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight&&(e-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),this.columnsByIndex.forEach((function(i){var s,o,n;i.visible&&(s=i.definition.width||0,o=parseInt(i.minWidth),n="string"==typeof s?s.indexOf("%")>-1?e/100*parseInt(s):parseInt(s):s,t+=n>o?n:o)})),t}addColumn(e,t,i){return new Promise(((s,o)=>{var n=this._addColumn(e,t,i);this._reIndexColumns(),this.dispatch("column-add",e,t,i),"fitColumns"!=this.layoutMode()&&n.reinitializeWidth(),this.redraw(!0),this.table.rowManager.reinitialize(),this.renderer.rerenderColumns(),s(n)}))}deregisterColumn(e){var t,i=e.getField();i&&delete this.columnsByField[i],(t=this.columnsByIndex.indexOf(e))>-1&&this.columnsByIndex.splice(t,1),(t=this.columns.indexOf(e))>-1&&this.columns.splice(t,1),this.verticalAlignHeaders(),this.redraw()}redraw(e){t.elVisible(this.element)&&this.verticalAlignHeaders(),e&&(this.table.rowManager.resetScroll(),this.table.rowManager.reinitialize()),this.confirm("table-redrawing",e)||this.layoutRefresh(),this.dispatch("table-redraw",e),this.table.footerManager.redraw()}}class Re extends we{constructor(e){super(e),this.verticalFillMode="fill",this.scrollTop=0,this.scrollLeft=0,this.scrollTop=0,this.scrollLeft=0}clearRows(){for(var e=this.tableElement;e.firstChild;)e.removeChild(e.firstChild);e.scrollTop=0,e.scrollLeft=0,e.style.minWidth="",e.style.minHeight="",e.style.display="",e.style.visibility=""}renderRows(){var e=this.tableElement,t=!0;this.rows().forEach(((i,s)=>{this.styleRow(i,s),e.appendChild(i.getElement()),i.initialize(!0),"group"!==i.type&&(t=!1)})),e.style.minWidth=t?this.table.columnManager.getWidth()+"px":""}rerenderRows(e){this.clearRows(),this.renderRows(),e&&e()}scrollToRowNearestTop(e){var i=t.elOffset(e.getElement()).top;return!(Math.abs(this.elementVertical.scrollTop-i)>Math.abs(this.elementVertical.scrollTop+this.elementVertical.clientHeight-i))}scrollToRow(e){var i=e.getElement();this.elementVertical.scrollTop=t.elOffset(i).top-t.elOffset(this.elementVertical).top+this.elementVertical.scrollTop}visibleRows(e){return this.rows()}}class xe extends we{constructor(e){super(e),this.verticalFillMode="fill",this.scrollTop=0,this.scrollLeft=0,this.vDomRowHeight=20,this.vDomTop=0,this.vDomBottom=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomMaxRenderChain=90,this.vDomWindowBuffer=0,this.vDomWindowMinTotalRows=20,this.vDomWindowMinMarginRows=5,this.vDomTopNewRows=[],this.vDomBottomNewRows=[]}clearRows(){for(var e=this.tableElement;e.firstChild;)e.removeChild(e.firstChild);e.style.paddingTop="",e.style.paddingBottom="",e.style.minHeight="",e.style.display="",e.style.visibility="",this.elementVertical.scrollTop=0,this.elementVertical.scrollLeft=0,this.scrollTop=0,this.scrollLeft=0,this.vDomTop=0,this.vDomBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0}renderRows(){this._virtualRenderFill()}rerenderRows(e){for(var t=this.elementVertical.scrollTop,i=!1,s=!1,o=this.table.rowManager.scrollLeft,n=this.rows(),r=this.vDomTop;r<=this.vDomBottom;r++)if(n[r]){var a=t-n[r].getElement().offsetTop;if(!(!1===s||Math.abs(a){e.deinitializeHeight()})),e&&e(),this._virtualRenderFill(!1===i?this.rows.length-1:i,!0,s||0),this.scrollColumns(o)}scrollColumns(e){this.table.rowManager.scrollHorizontal(e)}scrollRows(e,t){var i=e-this.vDomScrollPosTop,s=e-this.vDomScrollPosBottom,o=2*this.vDomWindowBuffer,n=this.rows();if(this.scrollTop=e,-i>o||s>o){var r=this.table.rowManager.scrollLeft;this._virtualRenderFill(Math.floor(this.elementVertical.scrollTop/this.elementVertical.scrollHeight*n.length)),this.scrollColumns(r)}else t?(i<0&&this._addTopRow(n,-i),s<0&&(this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer?this._removeBottomRow(n,-s):this.vDomScrollPosBottom=this.scrollTop)):(s>=0&&this._addBottomRow(n,s),i>=0&&(this.scrollTop>this.vDomWindowBuffer?this._removeTopRow(n,i):this.vDomScrollPosTop=this.scrollTop))}resize(){this.vDomWindowBuffer=this.table.options.renderVerticalBuffer||this.elementVertical.clientHeight}scrollToRowNearestTop(e){var t=this.rows().indexOf(e);return!(Math.abs(this.vDomTop-t)>Math.abs(this.vDomBottom-t))}scrollToRow(e){var t=this.rows().indexOf(e);t>-1&&this._virtualRenderFill(t,!0)}visibleRows(e){var t=this.elementVertical.scrollTop,i=this.elementVertical.clientHeight+t,s=!1,o=0,n=0,r=this.rows();if(e)o=this.vDomTop,n=this.vDomBottom;else for(var a=this.vDomTop;a<=this.vDomBottom;a++)if(r[a])if(s){if(!(i-r[a].getElement().offsetTop>=0))break;n=a}else if(t-r[a].getElement().offsetTop>=0)o=a;else{if(s=!0,!(i-r[a].getElement().offsetTop>=0))break;n=a}return r.slice(o,n+1)}_virtualRenderFill(e,i,s){var o=this.tableElement,n=this.elementVertical,r=0,a=0,l=0,h=0,d=0,c=this.rows(),u=c.length,m=this.elementVertical.clientHeight;if(s=s||0,e=e||0){for(;o.firstChild;)o.removeChild(o.firstChild);(l=(u-e+1)*this.vDomRowHeight)this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*p),this.vDomBottom++,d++}e?(this.vDomTopPad=i?this.vDomRowHeight*this.vDomTop+s:this.scrollTop-h,this.vDomBottomPad=this.vDomBottom==u-1?0:Math.max(this.vDomScrollHeight-this.vDomTopPad-a-h,0)):(this.vDomTopPad=0,this.vDomRowHeight=Math.floor((a+h)/d),this.vDomBottomPad=this.vDomRowHeight*(u-this.vDomBottom-1),this.vDomScrollHeight=h+a+this.vDomBottomPad-m),o.style.paddingTop=this.vDomTopPad+"px",o.style.paddingBottom=this.vDomBottomPad+"px",i&&(this.scrollTop=this.vDomTopPad+h+s-(this.elementVertical.scrollWidth>this.elementVertical.clientWidth?this.elementVertical.offsetHeight-m:0)),this.scrollTop=Math.min(this.scrollTop,this.elementVertical.scrollHeight-m),this.elementVertical.scrollWidth>this.elementVertical.offsetWidth&&i&&(this.scrollTop+=this.elementVertical.offsetHeight-m),this.vDomScrollPosTop=this.scrollTop,this.vDomScrollPosBottom=this.scrollTop,n.scrollTop=this.scrollTop,this.dispatch("render-virtual-fill")}}_addTopRow(e,t){for(var i=this.tableElement,s=[],o=0,n=this.vDomTop-1,r=0;this.vDomTop;){let a,l,h=e[n];if(!(h&&r=a))break;this.styleRow(h,n),i.insertBefore(h.getElement(),i.firstChild),h.initialized&&h.heightInitialized||s.push(h),h.initialize(),l||(a=h.getElement().offsetHeight,a>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*a)),t-=a,o+=a,this.vDomTop--,n--,r++}for(let e of s)e.clearCellHeight();this._quickNormalizeRowHeight(s),o&&(this.vDomTopPad-=o,this.vDomTopPad<0&&(this.vDomTopPad=n*this.vDomRowHeight),n<1&&(this.vDomTopPad=0),i.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop-=o)}_removeTopRow(e,t){for(var i=[],s=0,o=0;;){let n,r=e[this.vDomTop];if(!(r&&o=n))break;this.vDomTop++,t-=n,s+=n,i.push(r),o++}for(let e of i){let t=e.getElement();t.parentNode&&t.parentNode.removeChild(t)}s&&(this.vDomTopPad+=s,this.tableElement.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop+=this.vDomTop?s:s+this.vDomWindowBuffer)}_addBottomRow(e,t){for(var i=this.tableElement,s=[],o=0,n=this.vDomBottom+1,r=0;;){let a,l,h=e[n];if(!(h&&r=a))break;this.styleRow(h,n),i.appendChild(h.getElement()),h.initialized&&h.heightInitialized||s.push(h),h.initialize(),l||(a=h.getElement().offsetHeight,a>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*a)),t-=a,o+=a,this.vDomBottom++,n++,r++}for(let e of s)e.clearCellHeight();this._quickNormalizeRowHeight(s),o&&(this.vDomBottomPad-=o,(this.vDomBottomPad<0||n==e.length-1)&&(this.vDomBottomPad=0),i.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom+=o)}_removeBottomRow(e,t){for(var i=[],s=0,o=0;;){let n,r=e[this.vDomBottom];if(!(r&&o=n))break;this.vDomBottom--,t-=n,s+=n,i.push(r),o++}for(let e of i){let t=e.getElement();t.parentNode&&t.parentNode.removeChild(t)}s&&(this.vDomBottomPad+=s,this.vDomBottomPad<0&&(this.vDomBottomPad=0),this.tableElement.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom-=s)}_quickNormalizeRowHeight(e){for(let t of e)t.calcHeight();for(let t of e)t.setCellHeight()}}class Te extends e{constructor(e){super(e),this.element=this.createHolderElement(),this.tableElement=this.createTableElement(),this.heightFixer=this.createTableElement(),this.placeholder=null,this.placeholderContents=null,this.firstRender=!1,this.renderMode="virtual",this.fixedHeight=!1,this.rows=[],this.activeRowsPipeline=[],this.activeRows=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.scrollTop=0,this.scrollLeft=0,this.rowNumColumn=!1,this.redrawBlock=!1,this.redrawBlockRestoreConfig=!1,this.redrawBlockRenderInPosition=!1,this.dataPipeline=[],this.displayPipeline=[],this.renderer=null}createHolderElement(){var e=document.createElement("div");return e.classList.add("tabulator-tableholder"),e.setAttribute("tabindex",0),e.setAttribute("role","rowgroup"),e}createTableElement(){var e=document.createElement("div");return e.classList.add("tabulator-table"),e.setAttribute("role","rowgroup"),e}initializePlaceholder(){if("string"==typeof this.table.options.placeholder){let e=document.createElement("div");e.classList.add("tabulator-placeholder");let t=document.createElement("div");t.classList.add("tabulator-placeholder-contents"),t.innerHTML=this.table.options.placeholder,e.appendChild(t),this.placeholderContents=t,this.placeholder=e}}getElement(){return this.element}getTableElement(){return this.tableElement}getRowPosition(e,t){return t?this.activeRows.indexOf(e):this.rows.indexOf(e)}initialize(){this.initializePlaceholder(),this.initializeRenderer(),this.element.appendChild(this.tableElement),this.firstRender=!0,this.element.addEventListener("scroll",(()=>{var e=this.element.scrollLeft,t=this.scrollLeft>e,i=this.element.scrollTop,s=this.scrollTop>i;this.scrollLeft!=e&&(this.scrollLeft=e,this.dispatch("scroll-horizontal",e,t),this.dispatchExternal("scrollHorizontal",e,t),this._positionPlaceholder()),this.scrollTop!=i&&(this.scrollTop=i,this.renderer.scrollRows(i,s),this.dispatch("scroll-vertical",i,s),this.dispatchExternal("scrollVertical",i,s))}))}findRow(e){if("object"!=typeof e){if(null==e)return!1;return this.rows.find((t=>t.data[this.table.options.index]==e))||!1}if(e instanceof C)return e;if(e instanceof w)return e._getSelf()||!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement){return this.rows.find((t=>t.getElement()===e))||!1}return!1}getRowFromDataObject(e){return this.rows.find((t=>t.data===e))||!1}getRowFromPosition(e,t){return t?this.activeRows[e]:this.rows[e]}scrollToRow(e,t,i){return this.renderer.scrollToRowPosition(e,t,i)}setData(e,t,i){return new Promise(((s,o)=>{t&&this.getDisplayRows().length?this.table.options.pagination?this._setDataActual(e,!0):this.reRenderInPosition((()=>{this._setDataActual(e)})):(this.table.options.autoColumns&&i&&this.table.initialized&&this.table.columnManager.generateColumnsFromRowData(e),this.resetScroll(),this._setDataActual(e)),s()}))}_setDataActual(e,t){this.dispatchExternal("dataProcessing",e),this._wipeElements(),Array.isArray(e)?(this.dispatch("data-processing",e),e.forEach(((e,t)=>{if(e&&"object"==typeof e){var i=new C(e,this);this.rows.push(i)}else console.warn("Data Loading Warning - Invalid row data detected and ignored, expecting object but received:",e)})),this.refreshActiveData(!1,!1,t),this.dispatch("data-processed",e),this.dispatchExternal("dataProcessed",e)):console.error("Data Loading Error - Unable to process data due to invalid data type \nExpecting: array \nReceived: ",typeof e,"\nData: ",e)}_wipeElements(){this.dispatch("rows-wipe"),this.rows.forEach((e=>{e.wipe()})),this.rows=[],this.activeRows=[],this.activeRowsPipeline=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.adjustTableSize()}deleteRow(e,t){var i=this.rows.indexOf(e),s=this.activeRows.indexOf(e);s>-1&&this.activeRows.splice(s,1),i>-1&&this.rows.splice(i,1),this.setActiveRows(this.activeRows),this.displayRowIterator((t=>{var i=t.indexOf(e);i>-1&&t.splice(i,1)})),t||this.reRenderInPosition(),this.regenerateRowNumbers(),this.dispatchExternal("rowDeleted",e.getComponent()),this.displayRowsCount||this._showPlaceholder(),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.getData())}addRow(e,t,i,s){return this.addRowActual(e,t,i,s)}addRows(e,t,i){var s=[];return new Promise(((o,n)=>{t=this.findAddRowPos(t),Array.isArray(e)||(e=[e]),e.length,(void 0===i&&t||void 0!==i&&!t)&&e.reverse(),e.forEach(((o,n)=>{var r=this.addRow(o,t,i,!0);s.push(r),this.dispatch("row-added",r,e,t,i)})),this.refreshActiveData(!1,!1,!0),this.regenerateRowNumbers(),s.length&&this._clearPlaceholder(),o(s)}))}findAddRowPos(e){return void 0===e&&(e=this.table.options.addRowPos),"pos"===e&&(e=!0),"bottom"===e&&(e=!1),e}addRowActual(e,t,i,s){var o,n,r=e instanceof C?e:new C(e||{},this),a=this.findAddRowPos(t),l=-1;return i||(n=this.chain("row-adding-position",[r,a],null,{index:i,top:a}),i=n.index,a=n.top),void 0!==i&&(i=this.findRow(i)),(i=this.chain("row-adding-index",[r,i,a],null,i))&&(l=this.rows.indexOf(i)),i&&l>-1?(o=this.activeRows.indexOf(i),this.displayRowIterator((function(e){var t=e.indexOf(i);t>-1&&e.splice(a?t:t+1,0,r)})),o>-1&&this.activeRows.splice(a?o:o+1,0,r),this.rows.splice(a?l:l+1,0,r)):a?(this.displayRowIterator((function(e){e.unshift(r)})),this.activeRows.unshift(r),this.rows.unshift(r)):(this.displayRowIterator((function(e){e.push(r)})),this.activeRows.push(r),this.rows.push(r)),this.setActiveRows(this.activeRows),this.dispatchExternal("rowAdded",r.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),s||this.reRenderInPosition(),r}moveRow(e,t,i){this.dispatch("row-move",e,t,i),this.moveRowActual(e,t,i),this.regenerateRowNumbers(),this.dispatch("row-moved",e,t,i),this.dispatchExternal("rowMoved",e.getComponent())}moveRowActual(e,t,i){this.moveRowInArray(this.rows,e,t,i),this.moveRowInArray(this.activeRows,e,t,i),this.displayRowIterator((s=>{this.moveRowInArray(s,e,t,i)})),this.dispatch("row-moving",e,t,i)}moveRowInArray(e,t,i,s){var o,n,r;if(t!==i&&((o=e.indexOf(t))>-1&&(e.splice(o,1),(n=e.indexOf(i))>-1?s?e.splice(n+1,0,t):e.splice(n,0,t):e.splice(o,0,t)),e===this.getDisplayRows())){r=n>o?n:o+1;for(let t=o-1&&t}nextDisplayRow(e,t){var i=this.getDisplayRowIndex(e),s=!1;return!1!==i&&i-1)&&i}getData(e,t){var i=[];return this.getRows(e).forEach((function(e){"row"==e.type&&i.push(e.getData(t||"data"))})),i}getComponents(e){var t=[];return this.getRows(e).forEach((function(e){t.push(e.getComponent())})),t}getDataCount(e){return this.getRows(e).length}scrollHorizontal(e){this.scrollLeft=e,this.element.scrollLeft=e,this.dispatch("scroll-horizontal",e)}registerDataPipelineHandler(e,t){void 0!==t?(this.dataPipeline.push({handler:e,priority:t}),this.dataPipeline.sort(((e,t)=>e.priority-t.priority))):console.error("Data pipeline handlers must have a priority in order to be registered")}registerDisplayPipelineHandler(e,t){void 0!==t?(this.displayPipeline.push({handler:e,priority:t}),this.displayPipeline.sort(((e,t)=>e.priority-t.priority))):console.error("Display pipeline handlers must have a priority in order to be registered")}refreshActiveData(e,i,s){var o=this.table,n="",r=0,a=["all","dataPipeline","display","displayPipeline","end"];if("function"==typeof e)if((r=this.dataPipeline.findIndex((t=>t.handler===e)))>-1)n="dataPipeline",i&&(r==this.dataPipeline.length-1?n="display":r++);else{if(!((r=this.displayPipeline.findIndex((t=>t.handler===e)))>-1))return void console.error("Unable to refresh data, invalid handler provided",e);n="displayPipeline",i&&(r==this.displayPipeline.length-1?n="end":r++)}else n=e||"all",r=0;this.redrawBlock?(!this.redrawBlockRestoreConfig||this.redrawBlockRestoreConfig&&(this.redrawBlockRestoreConfig.stage===n&&r{var t=e.getCell(this.rowNumColumn);t&&t._generateContents()}))}setActiveRows(e){this.activeRows=e,this.activeRowsCount=this.activeRows.length}resetDisplayRows(){this.displayRows=[],this.displayRows.push(this.activeRows.slice(0)),this.displayRowsCount=this.displayRows[0].length}getNextDisplayIndex(){return this.displayRows.length}setDisplayRows(e,t){var i=!0;return t&&void 0!==this.displayRows[t]?(this.displayRows[t]=e,i=!0):(this.displayRows.push(e),i=t=this.displayRows.length-1),t==this.displayRows.length-1&&(this.displayRowsCount=this.displayRows[this.displayRows.length-1].length),i}getDisplayRows(e){return void 0===e?this.displayRows.length?this.displayRows[this.displayRows.length-1]:[]:this.displayRows[e]||[]}getVisibleRows(e,t){var i=Object.assign([],this.renderer.visibleRows(!t));return e&&(i=this.chain("rows-visible",[t],i,i)),i}displayRowIterator(e){this.activeRowsPipeline.forEach(e),this.displayRows.forEach(e),this.displayRowsCount=this.displayRows[this.displayRows.length-1].length}getRows(e){var t;switch(e){case"active":t=this.activeRows;break;case"display":t=this.table.rowManager.getDisplayRows();break;case"visible":t=this.getVisibleRows(!1,!0);break;default:t=this.chain("rows-retrieve",e,null,this.rows)||this.rows}return t}reRenderInPosition(e){this.redrawBlock?e?e():this.redrawBlockRenderInPosition=!0:(this.dispatchExternal("renderStarted"),this.renderer.rerenderRows(e),this.dispatchExternal("renderComplete"))}initializeRenderer(){var e,t={virtual:xe,basic:Re};(e="string"==typeof this.table.options.renderVertical?t[this.table.options.renderVertical]:this.table.options.renderVertical)?(this.renderer=new e(this.table,this.element,this.tableElement),this.renderer.initialize(),this.table.element.clientHeight||this.table.options.height?this.fixedHeight=!0:this.fixedHeight=!1):console.error("Unable to find matching renderer:",table.options.renderVertical)}getRenderMode(){return this.renderMode}renderTable(){this.dispatchExternal("renderStarted"),this.element.scrollTop=0,this._clearTable(),this.displayRowsCount?(this.renderer.renderRows(),this.firstRender&&(this.firstRender=!1,this.layoutRefresh())):this.renderEmptyScroll(),this.fixedHeight||this.adjustTableSize(),this.dispatch("table-layout"),this.displayRowsCount||this._showPlaceholder(),this.dispatchExternal("renderComplete")}renderEmptyScroll(){this.placeholder?this.tableElement.style.display="none":this.tableElement.style.minWidth=this.table.columnManager.getWidth()+"px"}_clearTable(){this.tableElement;this._clearPlaceholder(),this.scrollTop=0,this.scrollLeft=0,this.renderer.clearRows()}_showPlaceholder(){this.placeholder&&(this.placeholder.setAttribute("tabulator-render-mode",this.renderMode),this.getElement().appendChild(this.placeholder),this._positionPlaceholder())}_clearPlaceholder(){this.placeholder&&this.placeholder.parentNode&&this.placeholder.parentNode.removeChild(this.placeholder)}_positionPlaceholder(){this.placeholder&&this.placeholder.parentNode&&(this.placeholder.style.width=this.table.columnManager.getWidth()+"px",this.placeholderContents.style.width=this.table.rowManager.element.clientWidth+"px",this.placeholderContents.style.marginLeft=this.scrollLeft+"px")}styleRow(e,t){var i=e.getElement();t%2?(i.classList.add("tabulator-row-even"),i.classList.remove("tabulator-row-odd")):(i.classList.add("tabulator-row-odd"),i.classList.remove("tabulator-row-even"))}normalizeHeight(){this.activeRows.forEach((function(e){e.normalizeHeight()}))}adjustTableSize(){var e=this.element.clientHeight;if("fill"===this.renderer.verticalFillMode){let t=Math.floor(this.table.columnManager.getElement().getBoundingClientRect().height+(this.table.footerManager&&this.table.footerManager.active&&!this.table.footerManager.external?this.table.footerManager.getElement().getBoundingClientRect().height:0));this.fixedHeight?(this.element.style.minHeight="calc(100% - "+t+"px)",this.element.style.height="calc(100% - "+t+"px)",this.element.style.maxHeight="calc(100% - "+t+"px)"):(this.element.style.height="",this.element.style.height=this.table.element.clientHeight-t+"px",this.element.scrollTop=this.scrollTop),this.renderer.resize(),this.fixedHeight||e==this.element.clientHeight||(this.subscribed("table-resize")?this.dispatch("table-resize"):this.redraw())}this._positionPlaceholder()}reinitialize(){this.rows.forEach((function(e){e.reinitialize(!0)}))}blockRedraw(){this.redrawBlock=!0,this.redrawBlockRestoreConfig=!1}restoreRedraw(){this.redrawBlock=!1,this.redrawBlockRestoreConfig?(this.refreshActiveData(this.redrawBlockRestoreConfig.handler,this.redrawBlockRestoreConfig.skipStage,this.redrawBlockRestoreConfig.renderInPosition),this.redrawBlockRestoreConfig=!1):this.redrawBlockRenderInPosition&&this.reRenderInPosition(),this.redrawBlockRenderInPosition=!1}redraw(e){var t=this.scrollLeft;this.adjustTableSize(),this.table.tableWidth=this.table.element.clientWidth,e?this.renderTable():(this.reRenderInPosition(),this.scrollHorizontal(t))}resetScroll(){if(this.element.scrollLeft=0,this.element.scrollTop=0,"ie"===this.table.browser){var e=document.createEvent("Event");e.initEvent("scroll",!1,!0),this.element.dispatchEvent(e)}else this.element.dispatchEvent(new Event("scroll"))}}class Me extends e{constructor(e){super(e),this.active=!1,this.element=this.createElement(),this.containerElement=this.createContainerElement(),this.external=!1}initialize(){this.initializeElement()}createElement(){var e=document.createElement("div");return e.classList.add("tabulator-footer"),e}createContainerElement(){var e=document.createElement("div");return e.classList.add("tabulator-footer-contents"),this.element.appendChild(e),e}initializeElement(){if(this.table.options.footerElement)switch(typeof this.table.options.footerElement){case"string":"<"===this.table.options.footerElement[0]?this.containerElement.innerHTML=this.table.options.footerElement:(this.external=!0,this.containerElement=document.querySelector(this.table.options.footerElement));break;default:this.element=this.table.options.footerElement}}getElement(){return this.element}append(e){this.activate(),this.containerElement.appendChild(e),this.table.rowManager.adjustTableSize()}prepend(e){this.activate(),this.element.insertBefore(e,this.element.firstChild),this.table.rowManager.adjustTableSize()}remove(e){e.parentNode.removeChild(e),this.deactivate()}deactivate(e){this.element.firstChild&&!e||(this.external||this.element.parentNode.removeChild(this.element),this.active=!1)}activate(){this.active||(this.active=!0,this.external||(this.table.element.appendChild(this.getElement()),this.table.element.style.display=""))}redraw(){this.dispatch("footer-redraw")}}class Le extends e{constructor(e){super(e),this.el=null,this.abortClasses=["tabulator-headers","tabulator-table"],this.previousTargets={},this.listeners=["click","dblclick","contextmenu","mouseenter","mouseleave","mouseover","mouseout","mousemove","touchstart","touchend"],this.componentMap={"tabulator-cell":"cell","tabulator-row":"row","tabulator-group":"group","tabulator-col":"column"},this.pseudoTrackers={row:{subscriber:null,target:null},cell:{subscriber:null,target:null},group:{subscriber:null,target:null},column:{subscriber:null,target:null}},this.pseudoTracking=!1}initialize(){this.el=this.table.element,this.buildListenerMap(),this.bindSubscriptionWatchers()}buildListenerMap(){var e={};this.listeners.forEach((t=>{e[t]={handler:null,components:[]}})),this.listeners=e}bindPseudoEvents(){Object.keys(this.pseudoTrackers).forEach((e=>{this.pseudoTrackers[e].subscriber=this.pseudoMouseEnter.bind(this,e),this.subscribe(e+"-mouseover",this.pseudoTrackers[e].subscriber)})),this.pseudoTracking=!0}pseudoMouseEnter(e,t,i){this.pseudoTrackers[e].target!==i&&(this.pseudoTrackers[e].target&&this.dispatch(e+"-mouseleave",t,this.pseudoTrackers[e].target),this.pseudoMouseLeave(e,t),this.pseudoTrackers[e].target=i,this.dispatch(e+"-mouseenter",t,i))}pseudoMouseLeave(e,t){var i=Object.keys(this.pseudoTrackers),s={row:["cell"],cell:["row"]};(i=i.filter((t=>{var i=s[e];return t!==e&&(!i||i&&!i.includes(t))}))).forEach((e=>{var i=this.pseudoTrackers[e].target;this.pseudoTrackers[e].target&&(this.dispatch(e+"-mouseleave",t,i),this.pseudoTrackers[e].target=null)}))}bindSubscriptionWatchers(){var e=Object.keys(this.listeners),t=Object.values(this.componentMap);for(let i of t)for(let t of e){let e=i+"-"+t;this.subscriptionChange(e,this.subscriptionChanged.bind(this,i,t))}this.subscribe("table-destroy",this.clearWatchers.bind(this))}subscriptionChanged(e,t,i){var s=this.listeners[t].components,o=s.indexOf(e),n=!1;i?-1===o&&(s.push(e),n=!0):this.subscribed(e+"-"+t)||o>-1&&(s.splice(o,1),n=!0),"mouseenter"!==t&&"mouseleave"!==t||this.pseudoTracking||this.bindPseudoEvents(),n&&this.updateEventListeners()}updateEventListeners(){for(let e in this.listeners){let t=this.listeners[e];t.components.length?t.handler||(t.handler=this.track.bind(this,e),this.el.addEventListener(e,t.handler)):t.handler&&(this.el.removeEventListener(e,t.handler),t.handler=null)}}track(e,t){var i=t.composedPath&&t.composedPath()||t.path,s=this.findTargets(i);s=this.bindComponents(e,s),this.triggerEvents(e,t,s),!this.pseudoTracking||"mouseover"!=e&&"mouseleave"!=e||Object.keys(s).length||this.pseudoMouseLeave("none",t)}findTargets(e){var t={};let i=Object.keys(this.componentMap);for(let s of e){let e=s.classList?[...s.classList]:[];if(e.filter((e=>this.abortClasses.includes(e))).length)break;let o=e.filter((e=>i.includes(e)));for(let e of o)t[this.componentMap[e]]=s}return t.group&&t.group===t.row&&delete t.row,t}bindComponents(e,t){var i=Object.keys(t).reverse(),s=this.listeners[e],o={};for(let e of i){let i,n=t[e],r=this.previousTargets[e];if(r&&r.target===n)i=r.component;else switch(e){case"row":case"group":if(s.components.includes("row")||s.components.includes("cell")||s.components.includes("group")){i=this.table.rowManager.getVisibleRows(!0).find((e=>e.getElement()===n)),t.row&&t.row.parentNode&&t.row.parentNode.closest(".tabulator-row")&&(t[e]=!1)}break;case"column":s.components.includes("column")&&(i=this.table.columnManager.findColumn(n));break;case"cell":s.components.includes("cell")&&(t.row instanceof C?i=t.row.findCell(n):t.row&&console.warn("Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?"))}i&&(t[e]=i,o[e]={target:n,component:i})}return this.previousTargets=o,t}triggerEvents(e,t,i){var s=this.listeners[e];for(let o in i)i[o]&&s.components.includes(o)&&this.dispatch(o+"-"+e,t,i[o])}clearWatchers(){for(let e in this.listeners){let t=this.listeners[e];t.handler&&(this.el.removeEventListener(e,t.handler),t.handler=null)}}}class ke{constructor(e){this.table=e,this.bindings={}}bind(e,t,i){this.bindings[e]||(this.bindings[e]={}),this.bindings[e][t]?console.warn("Unable to bind component handler, a matching function name is already bound",e,t,i):this.bindings[e][t]=i}handle(e,t,i){if(this.bindings[e]&&this.bindings[e][i]&&"function"==typeof this.bindings[e][i].bind)return this.bindings[e][i].bind(null,t);"then"===i||"string"!=typeof i||i.startsWith("_")||console.error("The "+e+" component does not have a "+i+" function, have you checked that you have the correct Tabulator module installed?")}}class De extends e{constructor(e){super(e),this.requestOrder=0,this.loading=!1}initialize(){}load(e,t,i,s,o,n){var r=++this.requestOrder;return this.dispatchExternal("dataLoading",e),!e||0!=e.indexOf("{")&&0!=e.indexOf("[")||(e=JSON.parse(e)),this.confirm("data-loading",[e,t,i,o])?(this.loading=!0,o||this.alertLoader(),t=this.chain("data-params",[e,i,o],t||{},t||{}),t=this.mapParams(t,this.table.options.dataSendParams),this.chain("data-load",[e,t,i,o],!1,Promise.resolve([])).then((e=>{Array.isArray(e)||"object"!=typeof e||(e=this.mapParams(e,this.objectInvert(this.table.options.dataReceiveParams)));var t=this.chain("data-loaded",e,null,e);r==this.requestOrder?(this.clearAlert(),!1!==t&&(this.dispatchExternal("dataLoaded",t),this.table.rowManager.setData(t,s,void 0===n?!s:n))):console.warn("Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made")})).catch((e=>{console.error("Data Load Error: ",e),this.dispatchExternal("dataLoadError",e),o||this.alertError(),setTimeout((()=>{this.clearAlert()}),this.table.options.dataLoaderErrorTimeout)})).finally((()=>{this.loading=!1}))):(this.dispatchExternal("dataLoaded",e),e||(e=[]),this.table.rowManager.setData(e,s,void 0===n?!s:n),Promise.resolve())}mapParams(e,t){var i={};for(let s in e)i[t.hasOwnProperty(s)?t[s]:s]=e[s];return i}objectInvert(e){var t={};for(let i in e)t[e[i]]=i;return t}blockActiveLoad(){this.requestOrder++}alertLoader(){("function"==typeof this.table.options.dataLoader?this.table.options.dataLoader():this.table.options.dataLoader)&&this.table.alertManager.alert(this.table.options.dataLoaderLoading||this.langText("data|loading"))}alertError(){this.table.alertManager.alert(this.table.options.dataLoaderError||this.langText("data|error"),"error")}clearAlert(){this.table.alertManager.clear()}}class Pe{constructor(e,t,i){this.table=e,this.events={},this.optionsList=t||{},this.subscriptionNotifiers={},this.dispatch=i?this._debugDispatch.bind(this):this._dispatch.bind(this),this.debug=i}subscriptionChange(e,t){this.subscriptionNotifiers[e]||(this.subscriptionNotifiers[e]=[]),this.subscriptionNotifiers[e].push(t),this.subscribed(e)&&this._notifiySubscriptionChange(e,!0)}subscribe(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t),this._notifiySubscriptionChange(e,!0)}unsubscribe(e,t){var i;if(this.events[e]){if(t){if(!((i=this.events[e].findIndex((e=>e===t)))>-1))return void console.warn("Cannot remove event, no matching event found:",e,t);this.events[e].splice(i,1)}else delete this.events[e];this._notifiySubscriptionChange(e,!1)}else console.warn("Cannot remove event, no events set on:",e)}subscribed(e){return this.events[e]&&this.events[e].length}_notifiySubscriptionChange(e,t){var i=this.subscriptionNotifiers[e];i&&i.forEach((e=>{e(t)}))}_dispatch(){var e,t=Array.from(arguments),i=t.shift();return this.events[i]&&this.events[i].forEach(((i,s)=>{let o=i.apply(this.table,t);s||(e=o)})),e}_debugDispatch(){var e=Array.from(arguments),t=e[0];return e[0]="ExternalEvent:"+e[0],(!0===this.debug||this.debug.includes(t))&&console.log(...e),this._dispatch(...arguments)}}class Se{constructor(e){this.events={},this.subscriptionNotifiers={},this.dispatch=e?this._debugDispatch.bind(this):this._dispatch.bind(this),this.chain=e?this._debugChain.bind(this):this._chain.bind(this),this.confirm=e?this._debugConfirm.bind(this):this._confirm.bind(this),this.debug=e}subscriptionChange(e,t){this.subscriptionNotifiers[e]||(this.subscriptionNotifiers[e]=[]),this.subscriptionNotifiers[e].push(t),this.subscribed(e)&&this._notifiySubscriptionChange(e,!0)}subscribe(e,t,i=1e4){this.events[e]||(this.events[e]=[]),this.events[e].push({callback:t,priority:i}),this.events[e].sort(((e,t)=>e.priority-t.priority)),this._notifiySubscriptionChange(e,!0)}unsubscribe(e,t){var i;if(this.events[e]){if(t){if(!((i=this.events[e].findIndex((e=>e.callback===t)))>-1))return void console.warn("Cannot remove event, no matching event found:",e,t);this.events[e].splice(i,1)}this._notifiySubscriptionChange(e,!1)}else console.warn("Cannot remove event, no events set on:",e)}subscribed(e){return this.events[e]&&this.events[e].length}_chain(e,t,i,s){var o=i;return Array.isArray(t)||(t=[t]),this.subscribed(e)?(this.events[e].forEach(((e,i)=>{o=e.callback.apply(this,t.concat([o]))})),o):"function"==typeof s?s():s}_confirm(e,t){var i=!1;return Array.isArray(t)||(t=[t]),this.subscribed(e)&&this.events[e].forEach(((e,s)=>{e.callback.apply(this,t)&&(i=!0)})),i}_notifiySubscriptionChange(e,t){var i=this.subscriptionNotifiers[e];i&&i.forEach((e=>{e(t)}))}_dispatch(){var e=Array.from(arguments),t=e.shift();this.events[t]&&this.events[t].forEach((t=>{t.callback.apply(this,e)}))}_debugDispatch(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(!0===this.debug||this.debug.includes(t))&&console.log(...e),this._dispatch(...arguments)}_debugChain(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(!0===this.debug||this.debug.includes(t))&&console.log(...e),this._chain(...arguments)}_debugConfirm(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(!0===this.debug||this.debug.includes(t))&&console.log(...e),this._confirm(...arguments)}}class ze{static register(e){ze.tables.push(e)}static deregister(e){var t=ze.tables.indexOf(e);t>-1&&ze.tables.splice(t,1)}static lookupTable(e,t){var i,s,o=[];if("string"==typeof e){if((i=document.querySelectorAll(e)).length)for(var n=0;n{e.widthFixed||e.reinitializeWidth(),(this.table.options.responsiveLayout?e.modules.responsive.visible:e.visible)&&(o=e),e.visible&&(t+=e.getWidth())})),o?(s=i-t+o.getWidth(),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&(o.setWidth(0),this.table.modules.responsiveLayout.update()),s>0?o.setWidth(s):o.reinitializeWidth()):this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitColumns:function(e){var t,i,s=this.table.element.clientWidth,o=0,n=0,r=0,a=[],l=[],h=0,d=0;function c(e){return"string"==typeof e?e.indexOf("%")>-1?s/100*parseInt(e):parseInt(e):e}function u(e,t,i,s){var o=[],n=0,a=0,l=0,h=r,d=0,m=0,p=[];function g(e){return i*(e.column.definition.widthGrow||1)}function b(e){return c(e.width)-i*(e.column.definition.widthShrink||0)}return e.forEach((function(e,n){var r=s?b(e):g(e);e.column.minWidth>=r?o.push(e):e.column.maxWidth&&e.column.maxWidththis.table.rowManager.element.clientHeight&&(s-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),e.forEach((function(e){var t,i,s;e.visible&&(t=e.definition.width,i=parseInt(e.minWidth),t?(s=c(t),o+=s>i?s:i,e.definition.widthShrink&&(l.push({column:e,width:s>i?s:i}),h+=e.definition.widthShrink)):(a.push({column:e,width:0}),r+=e.definition.widthGrow||1))})),n=s-o,t=Math.floor(n/r),d=u(a,n,t,!1),a.length&&d>0&&(a[a.length-1].width+=+d),a.forEach((function(e){n-=e.width})),(i=Math.abs(d)+n)>0&&h&&(d=u(l,i,Math.floor(i/h),!0)),l.length&&(l[l.length-1].width-=d),a.forEach((function(e){e.column.setWidth(e.width)})),l.forEach((function(e){e.column.setWidth(e.width)}))}};class _e extends o{constructor(e){super(e,"layout"),this.mode=null,this.registerTableOption("layout","fitData"),this.registerTableOption("layoutColumnsOnNewData",!1),this.registerColumnOption("widthGrow"),this.registerColumnOption("widthShrink")}initialize(){var e=this.table.options.layout;_e.modes[e]?this.mode=e:(console.warn("Layout Error - invalid mode set, defaulting to 'fitData' : "+e),this.mode="fitData"),this.table.element.setAttribute("tabulator-layout",this.mode)}getMode(){return this.mode}layout(){this.dispatch("layout-refreshing"),_e.modes[this.mode].call(this,this.table.columnManager.columnsByIndex),this.dispatch("layout-refreshed")}}_e.moduleName="layout",_e.modes=He;class Oe extends o{constructor(e){super(e),this.locale="default",this.lang=!1,this.bindings={},this.langList={},this.registerTableOption("locale",!1),this.registerTableOption("langs",{})}initialize(){this.langList=t.deepClone(Oe.langs),!1!==this.table.options.columnDefaults.headerFilterPlaceholder&&this.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder);for(let e in this.table.options.langs)this.installLang(e,this.table.options.langs[e]);this.setLocale(this.table.options.locale),this.registerTableFunction("setLocale",this.setLocale.bind(this)),this.registerTableFunction("getLocale",this.getLocale.bind(this)),this.registerTableFunction("getLang",this.getLang.bind(this))}setHeaderFilterPlaceholder(e){this.langList.default.headerFilters.default=e}setHeaderFilterColumnPlaceholder(e,t){this.langList.default.headerFilters.columns[e]=t,this.lang&&!this.lang.headerFilters.columns[e]&&(this.lang.headerFilters.columns[e]=t)}installLang(e,t){this.langList[e]?this._setLangProp(this.langList[e],t):this.langList[e]=t}_setLangProp(e,t){for(let i in t)e[i]&&"object"==typeof e[i]?this._setLangProp(e[i],t[i]):e[i]=t[i]}setLocale(e){if(!0===(e=e||"default")&&navigator.language&&(e=navigator.language.toLowerCase()),e&&!this.langList[e]){let t=e.split("-")[0];this.langList[t]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",e,t),e=t):(console.warn("Localization Error - Matching locale not found, using default: ",e),e="default")}this.locale=e,this.lang=t.deepClone(this.langList.default||{}),"default"!=e&&function e(t,i){for(var s in t)"object"==typeof t[s]?(i[s]||(i[s]={}),e(t[s],i[s])):i[s]=t[s]}(this.langList[e],this.lang),this.dispatchExternal("localized",this.locale,this.lang),this._executeBindings()}getLocale(e){return this.locale}getLang(e){return e?this.langList[e]:this.lang}getText(e,t){var i=(e=t?e+"|"+t:e).split("|");return this._getLangElement(i,this.locale)||""}_getLangElement(e,t){var i=this.lang;return e.forEach((function(e){var t;i&&(t=i[e],i=void 0!==t&&t)})),i}bind(e,t){this.bindings[e]||(this.bindings[e]=[]),this.bindings[e].push(t),t(this.getText(e),this.lang)}_executeBindings(){for(let e in this.bindings)this.bindings[e].forEach((t=>{t(this.getText(e),this.lang)}))}}Oe.moduleName="localize",Oe.langs={default:{groups:{item:"item",items:"items"},columns:{},data:{loading:"Loading",error:"Error"},pagination:{page_size:"Page Size",page_title:"Show Page",first:"First",first_title:"First Page",last:"Last",last_title:"Last Page",prev:"Prev",prev_title:"Prev Page",next:"Next",next_title:"Next Page",all:"All",counter:{showing:"Showing",of:"of",rows:"rows",pages:"pages"}},headerFilters:{default:"filter column...",columns:{}}}};class Ae extends o{constructor(e){super(e)}initialize(){this.registerTableFunction("tableComms",this.receive.bind(this))}getConnections(e){var t=[];return ze.lookupTable(e).forEach((e=>{this.table!==e&&t.push(e)})),t}send(e,t,i,s){var o=this.getConnections(e);o.forEach((e=>{e.tableComms(this.table.element,t,i,s)})),!o.length&&e&&console.warn("Table Connection Error - No tables matching selector found",e)}receive(e,t,i,s){if(this.table.modExists(t))return this.table.modules[t].commsReceived(e,i,s);console.warn("Inter-table Comms Error - no such module:",t)}}Ae.moduleName="comms";var Be=Object.freeze({__proto__:null,LayoutModule:_e,LocalizeModule:Oe,CommsModule:Ae});class Ie{constructor(e,t){this.bindStaticFuctionality(e),this.bindModules(e,Be,!0),t&&this.bindModules(e,t)}bindStaticFuctionality(e){e.moduleBindings={},e.extendModule=function(t,i,s){if(e.moduleBindings[t]){var o=e.moduleBindings[t][i];if(o)if("object"==typeof s)for(let e in s)o[e]=s[e];else console.warn("Module Error - Invalid value type, it must be an object");else console.warn("Module Error - property does not exist:",i)}else console.warn("Module Error - module does not exist:",t)},e.registerModule=function(t){Array.isArray(t)||(t=[t]),t.forEach((t=>{e.registerModuleBinding(t)}))},e.registerModuleBinding=function(t){e.moduleBindings[t.moduleName]=t},e.findTable=function(e){var t=ze.lookupTable(e,!0);return!(Array.isArray(t)&&!t.length)&&t},e.prototype.bindModules=function(){var t=[],i=[],s=[];for(var o in this.modules={},e.moduleBindings){let n=e.moduleBindings[o],r=new n(this);this.modules[o]=r,n.prototype.moduleCore?this.modulesCore.push(r):n.moduleInitOrder?n.moduleInitOrder<0?t.push(r):i.push(r):s.push(r)}t.sort(((e,t)=>e.moduleInitOrder>t.moduleInitOrder?1:-1)),i.sort(((e,t)=>e.moduleInitOrder>t.moduleInitOrder?1:-1)),this.modulesRegular=t.concat(s.concat(i))}}bindModules(e,t,i){var s=Object.values(t);i&&s.forEach((e=>{e.prototype.moduleCore=!0})),e.registerModule(s)}}class Ne extends e{constructor(e){super(e),this.element=this._createAlertElement(),this.msgElement=this._createMsgElement(),this.type=null,this.element.appendChild(this.msgElement)}_createAlertElement(){var e=document.createElement("div");return e.classList.add("tabulator-alert"),e}_createMsgElement(){var e=document.createElement("div");return e.classList.add("tabulator-alert-msg"),e.setAttribute("role","alert"),e}_typeClass(){return"tabulator-alert-state-"+this.type}alert(e,t="msg"){if(e){for(this.clear(),this.type=t;this.msgElement.firstChild;)this.msgElement.removeChild(this.msgElement.firstChild);this.msgElement.classList.add(this._typeClass()),"function"==typeof e&&(e=e()),e instanceof HTMLElement?this.msgElement.appendChild(e):this.msgElement.innerHTML=e,this.table.element.appendChild(this.element)}}clear(){this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.msgElement.classList.remove(this._typeClass())}}class Ve{constructor(e,t){this.options={},this.columnManager=null,this.rowManager=null,this.footerManager=null,this.alertManager=null,this.vdomHoz=null,this.externalEvents=null,this.eventBus=null,this.interactionMonitor=!1,this.browser="",this.browserSlow=!1,this.browserMobile=!1,this.rtl=!1,this.originalElement=null,this.componentFunctionBinder=new ke(this),this.dataLoader=!1,this.modules={},this.modulesCore=[],this.modulesRegular=[],this.optionsList=new ve(this,"table constructor"),this.initialized=!1,this.initializeElement(e)&&(this.initializeCoreSystems(t),setTimeout((()=>{this._create()}))),ze.register(this)}initializeElement(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement?(this.element=e,!0):"string"==typeof e?(this.element=document.querySelector(e),!!this.element||(console.error("Tabulator Creation Error - no element found matching selector: ",e),!1)):(console.error("Tabulator Creation Error - Invalid element provided:",e),!1)}initializeCoreSystems(e){this.columnManager=new ye(this),this.rowManager=new Te(this),this.footerManager=new Me(this),this.dataLoader=new De(this),this.alertManager=new Ne(this),this.bindModules(),this.options=this.optionsList.generate(Ve.defaultOptions,e),this._clearObjectPointers(),this._mapDeprecatedFunctionality(),this.externalEvents=new Pe(this,this.options,this.options.debugEventsExternal),this.eventBus=new Se(this.options.debugEventsInternal),this.interactionMonitor=new Le(this),this.dataLoader.initialize(),this.footerManager.initialize()}_mapDeprecatedFunctionality(){}_clearSelection(){this.element.classList.add("tabulator-block-select"),window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty(),this.element.classList.remove("tabulator-block-select")}_create(){this.externalEvents.dispatch("tableBuilding"),this.eventBus.dispatch("table-building"),this._rtlCheck(),this._buildElement(),this._initializeTable(),this._loadInitialData(),this.initialized=!0,this.externalEvents.dispatch("tableBuilt")}_rtlCheck(){var e=window.getComputedStyle(this.element);switch(this.options.textDirection){case"auto":if("rtl"!==e.direction)break;case"rtl":this.element.classList.add("tabulator-rtl"),this.rtl=!0;break;case"ltr":this.element.classList.add("tabulator-ltr");default:this.rtl=!1}}_clearObjectPointers(){this.options.columns=this.options.columns.slice(0),Array.isArray(this.options.data)&&!this.options.reactiveData&&(this.options.data=this.options.data.slice(0))}_buildElement(){var e,t=this.element,i=this.options;if("TABLE"===t.tagName){this.originalElement=this.element,e=document.createElement("div");var s=t.attributes;for(var o in s)"object"==typeof s[o]&&e.setAttribute(s[o].name,s[o].value);t.parentNode.replaceChild(e,t),this.element=t=e}for(t.classList.add("tabulator"),t.setAttribute("role","grid");t.firstChild;)t.removeChild(t.firstChild);i.height&&(i.height=isNaN(i.height)?i.height:i.height+"px",t.style.height=i.height),!1!==i.minHeight&&(i.minHeight=isNaN(i.minHeight)?i.minHeight:i.minHeight+"px",t.style.minHeight=i.minHeight),!1!==i.maxHeight&&(i.maxHeight=isNaN(i.maxHeight)?i.maxHeight:i.maxHeight+"px",t.style.maxHeight=i.maxHeight)}_initializeTable(){var e=this.element,t=this.options;this.interactionMonitor.initialize(),this.columnManager.initialize(),this.rowManager.initialize(),this._detectBrowser(),this.modulesCore.forEach((e=>{e.initialize()})),e.appendChild(this.columnManager.getElement()),e.appendChild(this.rowManager.getElement()),t.footerElement&&this.footerManager.activate(),t.autoColumns&&t.data&&this.columnManager.generateColumnsFromRowData(this.options.data),this.modulesRegular.forEach((e=>{e.initialize()})),this.columnManager.setColumns(t.columns),this.eventBus.dispatch("table-built")}_loadInitialData(){this.dataLoader.load(this.options.data)}destroy(){var e=this.element;for(ze.deregister(this),this.eventBus.dispatch("table-destroy"),this.rowManager.rows.forEach((function(e){e.wipe()})),this.rowManager.rows=[],this.rowManager.activeRows=[],this.rowManager.displayRows=[];e.firstChild;)e.removeChild(e.firstChild);e.classList.remove("tabulator")}_detectBrowser(){var e=navigator.userAgent||navigator.vendor||window.opera;e.indexOf("Trident")>-1?(this.browser="ie",this.browserSlow=!0):e.indexOf("Edge")>-1?(this.browser="edge",this.browserSlow=!0):e.indexOf("Firefox")>-1?(this.browser="firefox",this.browserSlow=!1):(this.browser="other",this.browserSlow=!1),this.browserMobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.slice(0,4))}initGuard(e,t){var i,s;return this.options.debugInitialization&&!this.initialized&&(e||(e=" "==(s="Error"==(i=(new Error).stack.split("\n"))[0]?i[2]:i[1])[0]?s.trim().split(" ")[1].split(".")[1]:s.trim().split("@")[0]),console.warn("Table Not Initialized - Calling the "+e+" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function."+(t?" "+t:""))),this.initialized}blockRedraw(){return this.initGuard(),this.rowManager.blockRedraw()}restoreRedraw(){return this.initGuard(),this.rowManager.restoreRedraw()}setData(e,t,i){return this.initGuard(!1,"To set initial data please use the 'data' property in the table constructor."),this.dataLoader.load(e,t,i,!1)}clearData(){this.initGuard(),this.dataLoader.blockActiveLoad(),this.rowManager.clearData()}getData(e){return this.rowManager.getData(e)}getDataCount(e){return this.rowManager.getDataCount(e)}replaceData(e,t,i){return this.initGuard(),this.dataLoader.load(e,t,i,!0,!0)}updateData(e){var t=0;return this.initGuard(),new Promise(((i,s)=>{this.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e?e.forEach((e=>{var s=this.rowManager.findRow(e[this.options.index]);s&&(t++,s.updateData(e).then((()=>{--t||i()})))})):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))}))}addData(e,t,i){return this.initGuard(),new Promise(((s,o)=>{this.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e?this.rowManager.addRows(e,t,i).then((e=>{var t=[];e.forEach((function(e){t.push(e.getComponent())})),s(t)})):(console.warn("Update Error - No data provided"),o("Update Error - No data provided"))}))}updateOrAddData(e){var t=[],i=0;return this.initGuard(),new Promise(((s,o)=>{this.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e?e.forEach((e=>{var o=this.rowManager.findRow(e[this.options.index]);i++,o?o.updateData(e).then((()=>{i--,t.push(o.getComponent()),i||s(t)})):this.rowManager.addRows(e).then((e=>{i--,t.push(e[0].getComponent()),i||s(t)}))})):(console.warn("Update Error - No data provided"),o("Update Error - No data provided"))}))}getRow(e){var t=this.rowManager.findRow(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}getRowFromPosition(e,t){var i=this.rowManager.getRowFromPosition(e,t);return i?i.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}deleteRow(e){var t=[];this.initGuard(),Array.isArray(e)||(e=[e]);for(let i of e){let e=this.rowManager.findRow(i,!0);if(!e)return console.error("Delete Error - No matching row found:",i),Promise.reject("Delete Error - No matching row found");t.push(e)}return t.sort(((e,t)=>this.rowManager.rows.indexOf(e)>this.rowManager.rows.indexOf(t)?1:-1)),t.forEach((e=>{e.delete()})),this.rowManager.reRenderInPosition(),Promise.resolve()}addRow(e,t,i){return this.initGuard(),"string"==typeof e&&(e=JSON.parse(e)),this.rowManager.addRows(e,t,i).then((e=>e[0].getComponent()))}updateOrAddRow(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),"string"==typeof t&&(t=JSON.parse(t)),i?i.updateData(t).then((()=>i.getComponent())):this.rowManager.addRows(t).then((e=>e[0].getComponent()))}updateRow(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),"string"==typeof t&&(t=JSON.parse(t)),i?i.updateData(t).then((()=>Promise.resolve(i.getComponent()))):(console.warn("Update Error - No matching row found:",e),Promise.reject("Update Error - No matching row found"))}scrollToRow(e,t,i){var s=this.rowManager.findRow(e);return s?this.rowManager.scrollToRow(s,t,i):(console.warn("Scroll Error - No matching row found:",e),Promise.reject("Scroll Error - No matching row found"))}moveRow(e,t,i){var s=this.rowManager.findRow(e);this.initGuard(),s?s.moveToRow(t,i):console.warn("Move Error - No matching row found:",e)}getRows(e){return this.rowManager.getComponents(e)}getRowPosition(e,t){var i=this.rowManager.findRow(e);return i?this.rowManager.getRowPosition(i,t):(console.warn("Position Error - No matching row found:",e),!1)}setColumns(e){this.initGuard(!1,"To set initial columns please use the 'columns' property in the table constructor"),this.columnManager.setColumns(e)}getColumns(e){return this.columnManager.getComponents(e)}getColumn(e){var t=this.columnManager.findColumn(e);return t?t.getComponent():(console.warn("Find Error - No matching column found:",e),!1)}getColumnDefinitions(){return this.columnManager.getDefinitionTree()}showColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Show Error - No matching column found:",e),!1;t.show()}hideColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Hide Error - No matching column found:",e),!1;t.hide()}toggleColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Visibility Toggle Error - No matching column found:",e),!1;t.visible?t.hide():t.show()}addColumn(e,t,i){var s=this.columnManager.findColumn(i);return this.initGuard(),this.columnManager.addColumn(e,t,s).then((e=>e.getComponent()))}deleteColumn(e){var t=this.columnManager.findColumn(e);return this.initGuard(),t?t.delete():(console.warn("Column Delete Error - No matching column found:",e),Promise.reject())}updateColumnDefinition(e,t){var i=this.columnManager.findColumn(e);return this.initGuard(),i?i.updateDefinition(t):(console.warn("Column Update Error - No matching column found:",e),Promise.reject())}moveColumn(e,t,i){var s=this.columnManager.findColumn(e),o=this.columnManager.findColumn(t);this.initGuard(),s?o?this.columnManager.moveColumn(s,o,i):console.warn("Move Error - No matching column found:",o):console.warn("Move Error - No matching column found:",e)}scrollToColumn(e,t,i){return new Promise(((s,o)=>{var n=this.columnManager.findColumn(e);return n?this.columnManager.scrollToColumn(n,t,i):(console.warn("Scroll Error - No matching column found:",e),Promise.reject("Scroll Error - No matching column found"))}))}redraw(e){this.initGuard(),this.columnManager.redraw(e),this.rowManager.redraw(e)}setHeight(e){this.options.height=isNaN(e)?e:e+"px",this.element.style.height=this.options.height,this.rowManager.initializeRenderer(),this.rowManager.redraw()}on(e,t){this.externalEvents.subscribe(e,t)}off(e,t){this.externalEvents.unsubscribe(e,t)}dispatchEvent(){Array.from(arguments).shift();this.externalEvents.dispatch(...arguments)}alert(e,t){this.initGuard(),this.alertManager.alert(e,t)}clearAlert(){this.initGuard(),this.alertManager.clear()}modExists(e,t){return!!this.modules[e]||(t&&console.error("Tabulator Module Not Installed: "+e),!1)}module(e){var t=this.modules[e];return t||console.error("Tabulator module not installed: "+e),t}}Ve.defaultOptions={debugEventsExternal:!1,debugEventsInternal:!1,debugInvalidOptions:!0,debugInitialization:!0,height:!1,minHeight:!1,maxHeight:!1,columnHeaderVertAlign:"top",popupContainer:!1,columns:[],columnDefaults:{},data:!1,autoColumns:!1,autoColumnsDefinitions:!1,nestedFieldSeparator:".",footerElement:!1,index:"id",textDirection:"auto",addRowPos:"bottom",headerVisible:!0,renderVertical:"virtual",renderHorizontal:"basic",renderVerticalBuffer:0,scrollToRowPosition:"top",scrollToRowIfVisible:!0,scrollToColumnPosition:"left",scrollToColumnIfVisible:!0,rowFormatter:!1,rowFormatterPrint:null,rowFormatterClipboard:null,rowFormatterHtmlOutput:null,rowHeight:null,placeholder:!1,dataLoader:!0,dataLoaderLoading:!1,dataLoaderError:!1,dataLoaderErrorTimeout:3e3,dataSendParams:{},dataReceiveParams:{}},new Ie(Ve);class We extends Ve{}new Ie(We,fe);class Ge{constructor(e){this.type=e,this.element=this._createElement()}_createElement(){var e=document.createElement("div");return e.classList.add("tabulator-row"),e}getElement(){return this.element}getComponent(){return!1}getData(){return{}}getHeight(){return this.element.outerHeight}initialize(){}reinitialize(){}normalizeHeight(){}generateCells(){}reinitializeHeight(){}calcHeight(){}setCellHeight(){}clearCellHeight(){}}export{n as AccessorModule,c as AjaxModule,m as CalcComponent,p as CellComponent,u as ClipboardModule,y as ColumnCalcsModule,b as ColumnComponent,R as DataTreeModule,T as DownloadModule,D as EditModule,z as ExportModule,H as FilterModule,O as FormatModule,A as FrozenColumnsModule,B as FrozenRowsModule,I as GroupComponent,V as GroupRowsModule,W as HistoryModule,G as HtmlTableImportModule,U as ImportModule,X as InteractionModule,q as KeybindingsModule,K as MenuModule,o as Module,J as MoveColumnsModule,Y as MoveRowsModule,$ as MutatorModule,Q as PageModule,ie as PersistenceModule,se as PopupModule,oe as PrintModule,Ge as PseudoRow,ne as ReactiveDataModule,we as Renderer,re as ResizeColumnsModule,ae as ResizeRowsModule,le as ResizeTableModule,he as ResponsiveLayoutModule,w as RowComponent,de as SelectRowModule,me as SortModule,Ve as Tabulator,We as TabulatorFull,pe as TooltipModule,be as ValidateModule}; +/* Tabulator v5.2.5 (c) Oliver Folkerd 2022 */ +class e{constructor(e){this.table=e}reloadData(e,t,i){return this.table.dataLoader.load(e,void 0,void 0,void 0,t,i)}langText(){return this.table.modules.localize.getText(...arguments)}langBind(){return this.table.modules.localize.bind(...arguments)}langLocale(){return this.table.modules.localize.getLocale(...arguments)}commsConnections(){return this.table.modules.comms.getConnections(...arguments)}commsSend(){return this.table.modules.comms.send(...arguments)}layoutMode(){return this.table.modules.layout.getMode()}layoutRefresh(){return this.table.modules.layout.layout()}subscribe(){return this.table.eventBus.subscribe(...arguments)}unsubscribe(){return this.table.eventBus.unsubscribe(...arguments)}subscribed(e){return this.table.eventBus.subscribed(e)}subscriptionChange(){return this.table.eventBus.subscriptionChange(...arguments)}dispatch(){return this.table.eventBus.dispatch(...arguments)}chain(){return this.table.eventBus.chain(...arguments)}confirm(){return this.table.eventBus.confirm(...arguments)}dispatchExternal(){return this.table.externalEvents.dispatch(...arguments)}subscribedExternal(e){return this.table.externalEvents.subscribed(e)}subscriptionChangeExternal(){return this.table.externalEvents.subscriptionChange(...arguments)}options(e){return this.table.options[e]}setOption(e,t){return void 0!==t&&(this.table.options[e]=t),this.table.options[e]}module(e){return this.table.module(e)}}class t{static elVisible(e){return!(e.offsetWidth<=0&&e.offsetHeight<=0)}static elOffset(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}}static deepClone(e,t,i=[]){var s={}.__proto__,o=[].__proto__;for(var n in t||(t=Object.assign(Array.isArray(e)?[]:{},e)),e){let r,a,l=e[n];null==l||"object"!=typeof l||l.__proto__!==s&&l.__proto__!==o||(r=i.findIndex((e=>e.subject===l)),r>-1?t[n]=i[r].copy:(a=Object.assign(Array.isArray(l)?[]:{},l),i.unshift({subject:l,copy:a}),t[n]=this.deepClone(l,a,i)))}return t}}class s extends e{constructor(e,t,i){super(e),this.element=t,this.container=this._lookupContainer(),this.parent=i,this.reversedX=!1,this.childPopup=null,this.blurable=!1,this.blurCallback=null,this.renderedCallback=null,this.visible=!1,this.element.classList.add("tabulator-popup-container"),this.blurEvent=this.hide.bind(this,!1),this.escEvent=this._escapeCheck.bind(this),this.destroyBinding=this.hide.bind(this,!0)}_lookupContainer(){var e=this.table.options.popupContainer;return"string"==typeof e?(e=document.querySelector(e))||console.warn("Menu Error - no container element found matching selector:",this.table.options.popupContainer,"(defaulting to document body)"):!0===e&&(e=this.table.element),e&&!this._checkContainerIsParent(e)&&(e=!1,console.warn("Menu Error - container element does not contain this table:",this.table.options.popupContainer,"(defaulting to document body)")),e||(e=document.body),e}_checkContainerIsParent(e,t=this.table.element){return e===t||!!t.parentNode&&this._checkContainerIsParent(e,t.parentNode)}renderCallback(e){this.renderedCallback=e}containerEventCoords(e){var i=!(e instanceof MouseEvent),s=i?e.touches[0].pageX:e.pageX,o=i?e.touches[0].pageY:e.pageY;if(this.container!==document.body){let e=t.elOffset(this.container);s-=e.left,o-=e.top}return{x:s,y:o}}elementPositionCoords(e,i="right"){var s,o,n,r=t.elOffset(e);switch(this.container!==document.body&&(s=t.elOffset(this.container),r.left-=s.left,r.top-=s.top),i){case"right":o=r.left+e.offsetWidth,n=r.top-1;break;case"bottom":o=r.left,n=r.top+e.offsetHeight}return{x:o,y:n,offset:r}}show(e,t){var i,s,o,n,r;return e instanceof HTMLElement?(o=e,n=(r=this.elementPositionCoords(e,t)).offset,i=r.x,s=r.y):"number"==typeof e?(n={top:0,left:0},i=e,s=t):(i=(r=this.containerEventCoords(e)).x,s=r.y,this.reversedX=!1),this.element.style.top=s+"px",this.element.style.left=i+"px",this.container.appendChild(this.element),"function"==typeof this.renderedCallback&&this.renderedCallback(),this._fitToScreen(i,s,o,n,t),this.visible=!0,this.subscribe("table-destroy",this.destroyBinding),this}_fitToScreen(e,t,i,s,o){var n=this.container===document.body?document.documentElement.scrollTop:this.container.scrollTop;if((e+this.element.offsetWidth>=this.container.offsetWidth||this.reversedX)&&(this.element.style.left="",this.element.style.right=i?this.container.offsetWidth-s.left+"px":this.container.offsetWidth-e+"px",this.reversedX=!0),t+this.element.offsetHeight>Math.max(this.container.offsetHeight,n?this.container.scrollHeight:0))if(i)switch(o){case"bottom":this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight-i.offsetHeight-1+"px";break;default:this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+i.offsetHeight+1+"px"}else this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+"px"}isVisible(){return this.visible}hideOnBlur(e){return this.blurable=!0,this.visible&&(setTimeout((()=>{this.table.rowManager.element.addEventListener("scroll",this.blurEvent),this.subscribe("cell-editing",this.blurEvent),document.body.addEventListener("click",this.blurEvent),document.body.addEventListener("contextmenu",this.blurEvent),window.addEventListener("resize",this.blurEvent),document.body.addEventListener("keydown",this.escEvent)}),100),this.blurCallback=e),this}_escapeCheck(e){27==e.keyCode&&this.hide()}hide(e=!1){return this.visible&&(this.blurable&&(document.body.removeEventListener("keydown",this.escEvent),document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),window.removeEventListener("resize",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent),this.unsubscribe("cell-editing",this.blurEvent)),this.childPopup&&this.childPopup.hide(),this.parent&&(this.parent.childPopup=null),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.visible=!1,this.blurCallback&&!e&&this.blurCallback(),this.unsubscribe("table-destroy",this.destroyBinding)),this}child(e){return this.childPopup&&this.childPopup.hide(),this.childPopup=new s(this.table,e,this),this.childPopup}}class o extends e{constructor(e,t){super(e),this._handler=null}initialize(){}registerTableOption(e,t){this.table.optionsList.register(e,t)}registerColumnOption(e,t){this.table.columnManager.optionsList.register(e,t)}registerTableFunction(e,t){void 0===this.table[e]?this.table[e]=(...i)=>(this.table.initGuard(e),t(...i)):console.warn("Unable to bind table function, name already in use",e)}registerComponentFunction(e,t,i){return this.table.componentFunctionBinder.bind(e,t,i)}registerDataHandler(e,t){this.table.rowManager.registerDataPipelineHandler(e,t),this._handler=e}registerDisplayHandler(e,t){this.table.rowManager.registerDisplayPipelineHandler(e,t),this._handler=e}refreshData(e,t){t||(t=this._handler),t&&this.table.rowManager.refreshActiveData(t,!1,e)}footerAppend(e){return this.table.footerManager.append(e)}footerPrepend(e){return this.table.footerManager.prepend(e)}footerRemove(e){return this.table.footerManager.remove(e)}popup(e,t){return new s(this.table,e,t)}alert(e,t){return this.table.alertManager.alert(e,t)}clearAlert(){return this.table.alertManager.clear()}}class n extends o{constructor(e){super(e),this.allowedTypes=["","data","download","clipboard","print","htmlOutput"],this.registerColumnOption("accessor"),this.registerColumnOption("accessorParams"),this.registerColumnOption("accessorData"),this.registerColumnOption("accessorDataParams"),this.registerColumnOption("accessorDownload"),this.registerColumnOption("accessorDownloadParams"),this.registerColumnOption("accessorClipboard"),this.registerColumnOption("accessorClipboardParams"),this.registerColumnOption("accessorPrint"),this.registerColumnOption("accessorPrintParams"),this.registerColumnOption("accessorHtmlOutput"),this.registerColumnOption("accessorHtmlOutputParams")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-retrieve",this.transformRow.bind(this))}initializeColumn(e){var t=!1,i={};this.allowedTypes.forEach((s=>{var o,n="accessor"+(s.charAt(0).toUpperCase()+s.slice(1));e.definition[n]&&(o=this.lookupAccessor(e.definition[n]))&&(t=!0,i[n]={accessor:o,params:e.definition[n+"Params"]||{}})})),t&&(e.modules.accessor=i)}lookupAccessor(e){var t=!1;switch(typeof e){case"string":n.accessors[e]?t=n.accessors[e]:console.warn("Accessor Error - No such accessor found, ignoring: ",e);break;case"function":t=e}return t}transformRow(e,i){var s="accessor"+(i.charAt(0).toUpperCase()+i.slice(1)),o=e.getComponent(),n=t.deepClone(e.data||{});return this.table.columnManager.traverse((function(e){var t,r,a,l;e.modules.accessor&&(r=e.modules.accessor[s]||e.modules.accessor.accessor||!1)&&"undefined"!=(t=e.getFieldValue(n))&&(l=e.getComponent(),a="function"==typeof r.params?r.params(t,n,i,l,o):r.params,e.setFieldValue(n,r.accessor(t,n,i,a,l,o)))})),n}}n.moduleName="accessor",n.accessors={};function r(e,t){var i=[];if(t=t||"",Array.isArray(e))e.forEach(((e,s)=>{i=i.concat(r(e,t?t+"["+s+"]":s))}));else if("object"==typeof e)for(var s in e)i=i.concat(r(e[s],t?t+"["+s+"]":s));else i.push({key:t,value:e});return i}function a(e){var t=r(e),i=[];return t.forEach((function(e){i.push(encodeURIComponent(e.key)+"="+encodeURIComponent(e.value))})),i.join("&")}function l(e,t,i){return e&&i&&Object.keys(i).length&&(t.method&&"get"!=t.method.toLowerCase()||(t.method="get",e+=(e.includes("?")?"&":"?")+a(i))),e}function h(e,t){var i=[];if(t=t||"",Array.isArray(e))e.forEach(((e,s)=>{i=i.concat(h(e,t?t+"["+s+"]":s))}));else if("object"==typeof e)for(var s in e)i=i.concat(h(e[s],t?t+"["+s+"]":s));else i.push({key:t,value:e});return i}var d={json:{headers:{"Content-Type":"application/json"},body:function(e,t,i){return JSON.stringify(i)}},form:{headers:{},body:function(e,t,i){var s=h(i),o=new FormData;return s.forEach((function(e){o.append(e.key,e.value)})),o}}};class c extends o{constructor(e){super(e),this.config={},this.url="",this.urlGenerator=!1,this.params=!1,this.loaderPromise=!1,this.registerTableOption("ajaxURL",!1),this.registerTableOption("ajaxURLGenerator",!1),this.registerTableOption("ajaxParams",{}),this.registerTableOption("ajaxConfig","get"),this.registerTableOption("ajaxContentType","form"),this.registerTableOption("ajaxRequestFunc",!1),this.registerTableOption("ajaxRequesting",(function(){})),this.registerTableOption("ajaxResponse",!1),this.contentTypeFormatters=c.contentTypeFormatters}initialize(){this.loaderPromise=this.table.options.ajaxRequestFunc||c.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||c.defaultURLGenerator,this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.setDefaultConfig(this.table.options.ajaxConfig),this.registerTableFunction("getAjaxUrl",this.getUrl.bind(this)),this.subscribe("data-loading",this.requestDataCheck.bind(this)),this.subscribe("data-params",this.requestParams.bind(this)),this.subscribe("data-load",this.requestData.bind(this))}requestParams(e,t,i,s){var o=this.table.options.ajaxParams;return o&&("function"==typeof o&&(o=o.call(this.table)),s=Object.assign(s,o)),s}requestDataCheck(e,t,i,s){return!((e||!this.url)&&"string"!=typeof e)}requestData(e,t,i,s,o){var n;return!o&&this.requestDataCheck(e)?(e&&this.setUrl(e),n=this.generateConfig(i),this.sendRequest(this.url,t,n)):o}setDefaultConfig(e={}){this.config=Object.assign({},c.defaultConfig),"string"==typeof e?this.config.method=e:Object.assign(this.config,e)}generateConfig(e={}){var t=Object.assign({},this.config);return"string"==typeof e?t.method=e:Object.assign(t,e),t}setUrl(e){this.url=e}getUrl(){return this.url}sendRequest(e,t,i){return!1!==this.table.options.ajaxRequesting.call(this.table,e,t)?this.loaderPromise(e,i,t).then((i=>(this.table.options.ajaxResponse&&(i=this.table.options.ajaxResponse.call(this.table,e,t,i)),i))):Promise.reject()}}c.moduleName="ajax",c.defaultConfig={method:"GET"},c.defaultURLGenerator=l,c.defaultLoaderPromise=function(e,t,i){var s;return new Promise(((o,n)=>{if(e=this.urlGenerator.call(this.table,e,t,i),"GET"!=t.method.toUpperCase())if(s="object"==typeof this.table.options.ajaxContentType?this.table.options.ajaxContentType:this.contentTypeFormatters[this.table.options.ajaxContentType]){for(var r in s.headers)t.headers||(t.headers={}),void 0===t.headers[r]&&(t.headers[r]=s.headers[r]);t.body=s.body.call(this,e,t,i)}else console.warn("Ajax Error - Invalid ajaxContentType value:",this.table.options.ajaxContentType);e?(void 0===t.headers&&(t.headers={}),void 0===t.headers.Accept&&(t.headers.Accept="application/json"),void 0===t.headers["X-Requested-With"]&&(t.headers["X-Requested-With"]="XMLHttpRequest"),void 0===t.mode&&(t.mode="cors"),"cors"==t.mode?(void 0===t.headers.Origin&&(t.headers.Origin=window.location.origin),void 0===t.credentials&&(t.credentials="same-origin")):void 0===t.credentials&&(t.credentials="include"),fetch(e,t).then((e=>{e.ok?e.json().then((e=>{o(e)})).catch((e=>{n(e),console.warn("Ajax Load Error - Invalid JSON returned",e)})):(console.error("Ajax Load Error - Connection Error: "+e.status,e.statusText),n(e))})).catch((e=>{console.error("Ajax Load Error - Connection Error: ",e),n(e)}))):(console.warn("Ajax Load Error - No URL Set"),o([]))}))},c.contentTypeFormatters=d;class u extends o{constructor(e){super(e),this.mode=!0,this.pasteParser=function(){},this.pasteAction=function(){},this.customSelection=!1,this.rowRange=!1,this.blocked=!0,this.registerTableOption("clipboard",!1),this.registerTableOption("clipboardCopyStyled",!0),this.registerTableOption("clipboardCopyConfig",!1),this.registerTableOption("clipboardCopyFormatter",!1),this.registerTableOption("clipboardCopyRowRange","active"),this.registerTableOption("clipboardPasteParser","table"),this.registerTableOption("clipboardPasteAction","insert"),this.registerColumnOption("clipboard"),this.registerColumnOption("titleClipboard")}initialize(){this.mode=this.table.options.clipboard,this.rowRange=this.table.options.clipboardCopyRowRange,!0!==this.mode&&"copy"!==this.mode||this.table.element.addEventListener("copy",(e=>{var t,i;if(!this.blocked){if(e.preventDefault(),this.customSelection)t=this.customSelection,this.table.options.clipboardCopyFormatter&&(t=this.table.options.clipboardCopyFormatter("plain",t));else{var s=this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig,this.table.options.clipboardCopyStyled,this.rowRange,"clipboard");t=(i=this.table.modules.export.genereateHTMLTable(s))?this.generatePlainContent(s):"",this.table.options.clipboardCopyFormatter&&(t=this.table.options.clipboardCopyFormatter("plain",t),i=this.table.options.clipboardCopyFormatter("html",i))}window.clipboardData&&window.clipboardData.setData?window.clipboardData.setData("Text",t):e.clipboardData&&e.clipboardData.setData?(e.clipboardData.setData("text/plain",t),i&&e.clipboardData.setData("text/html",i)):e.originalEvent&&e.originalEvent.clipboardData.setData&&(e.originalEvent.clipboardData.setData("text/plain",t),i&&e.originalEvent.clipboardData.setData("text/html",i)),this.dispatchExternal("clipboardCopied",t,i),this.reset()}})),!0!==this.mode&&"paste"!==this.mode||this.table.element.addEventListener("paste",(e=>{this.paste(e)})),this.setPasteParser(this.table.options.clipboardPasteParser),this.setPasteAction(this.table.options.clipboardPasteAction),this.registerTableFunction("copyToClipboard",this.copy.bind(this))}reset(){this.blocked=!0,this.customSelection=!1}generatePlainContent(e){var t=[];return e.forEach((e=>{var i=[];e.columns.forEach((t=>{var s="";if(t)if("group"===e.type&&(t.value=t.component.getKey()),null===t.value)s="";else switch(typeof t.value){case"object":s=JSON.stringify(t.value);break;case"undefined":s="";break;default:s=t.value}i.push(s)})),t.push(i.join("\t"))})),t.join("\n")}copy(e,t){var i,s;this.blocked=!1,this.customSelection=!1,!0!==this.mode&&"copy"!==this.mode||(this.rowRange=e||this.table.options.clipboardCopyRowRange,void 0!==window.getSelection&&void 0!==document.createRange?((e=document.createRange()).selectNodeContents(this.table.element),(i=window.getSelection()).toString()&&t&&(this.customSelection=i.toString()),i.removeAllRanges(),i.addRange(e)):void 0!==document.selection&&void 0!==document.body.createTextRange&&((s=document.body.createTextRange()).moveToElementText(this.table.element),s.select()),document.execCommand("copy"),i&&i.removeAllRanges())}setPasteAction(e){switch(typeof e){case"string":this.pasteAction=u.pasteActions[e],this.pasteAction||console.warn("Clipboard Error - No such paste action found:",e);break;case"function":this.pasteAction=e}}setPasteParser(e){switch(typeof e){case"string":this.pasteParser=u.pasteParsers[e],this.pasteParser||console.warn("Clipboard Error - No such paste parser found:",e);break;case"function":this.pasteParser=e}}paste(e){var t,i,s;this.checkPaseOrigin(e)&&(t=this.getPasteData(e),(i=this.pasteParser.call(this,t))?(e.preventDefault(),this.table.modExists("mutator")&&(i=this.mutateData(i)),s=this.pasteAction.call(this,i),this.dispatchExternal("clipboardPasted",t,i,s)):this.dispatchExternal("clipboardPasteError",t))}mutateData(e){var t=[];return Array.isArray(e)?e.forEach((e=>{t.push(this.table.modules.mutator.transformRow(e,"clipboard"))})):t=e,t}checkPaseOrigin(e){var t=!0;return("DIV"!=e.target.tagName||this.table.modules.edit.currentCell)&&(t=!1),t}getPasteData(e){var t;return window.clipboardData&&window.clipboardData.getData?t=window.clipboardData.getData("Text"):e.clipboardData&&e.clipboardData.getData?t=e.clipboardData.getData("text/plain"):e.originalEvent&&e.originalEvent.clipboardData.getData&&(t=e.originalEvent.clipboardData.getData("text/plain")),t}}u.moduleName="clipboard",u.pasteActions={replace:function(e){return this.table.setData(e)},update:function(e){return this.table.updateOrAddData(e)},insert:function(e){return this.table.addData(e)}},u.pasteParsers={table:function(e){var t=[],i=!0,s=this.table.columnManager.columns,o=[],n=[];return(e=e.split("\n")).forEach((function(e){t.push(e.split("\t"))})),!(!t.length||1===t.length&&t[0].length<2)&&(t[0].forEach((function(e){var t=s.find((function(t){return e&&t.definition.title&&e.trim()&&t.definition.title.trim()===e.trim()}));t?o.push(t):i=!1})),i||(i=!0,o=[],t[0].forEach((function(e){var t=s.find((function(t){return e&&t.field&&e.trim()&&t.field.trim()===e.trim()}));t?o.push(t):i=!1})),i||(o=this.table.columnManager.columnsByIndex)),i&&t.shift(),t.forEach((function(e){var t={};e.forEach((function(e,i){o[i]&&(t[o[i].field]=e)})),n.push(t)})),n)}};class m{constructor(e){return this._row=e,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._row.table.componentFunctionBinder.handle("row",e._row,t)}})}getData(e){return this._row.getData(e)}getElement(){return this._row.getElement()}getTable(){return this._row.table}getCells(){var e=[];return this._row.getCells().forEach((function(t){e.push(t.getComponent())})),e}getCell(e){var t=this._row.getCell(e);return!!t&&t.getComponent()}_getSelf(){return this._row}}class p{constructor(e){return this._cell=e,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._cell.table.componentFunctionBinder.handle("cell",e._cell,t)}})}getValue(){return this._cell.getValue()}getOldValue(){return this._cell.getOldValue()}getInitialValue(){return this._cell.initialValue}getElement(){return this._cell.getElement()}getRow(){return this._cell.row.getComponent()}getData(){return this._cell.row.getData()}getField(){return this._cell.column.getField()}getColumn(){return this._cell.column.getComponent()}setValue(e,t){void 0===t&&(t=!0),this._cell.setValue(e,t)}restoreOldValue(){this._cell.setValueActual(this._cell.getOldValue())}restoreInitialValue(){this._cell.setValueActual(this._cell.initialValue)}checkHeight(){this._cell.checkHeight()}getTable(){return this._cell.table}_getSelf(){return this._cell}}class g extends e{constructor(e,t){super(e.table),this.table=e.table,this.column=e,this.row=t,this.element=null,this.value=null,this.initialValue,this.oldValue=null,this.modules={},this.height=null,this.width=null,this.minWidth=null,this.component=null,this.loaded=!1,this.build()}build(){this.generateElement(),this.setWidth(),this._configureCell(),this.setValueActual(this.column.getFieldValue(this.row.data)),this.initialValue=this.value}generateElement(){this.element=document.createElement("div"),this.element.className="tabulator-cell",this.element.setAttribute("role","gridcell"),this.element=this.element}_configureCell(){var e=this.element,t=this.column.getField();(e.style.textAlign=this.column.hozAlign,this.column.vertAlign&&(e.style.display="inline-flex",e.style.alignItems={top:"flex-start",bottom:"flex-end",middle:"center"}[this.column.vertAlign]||"",this.column.hozAlign&&(e.style.justifyContent={left:"flex-start",right:"flex-end",center:"center"}[this.column.hozAlign]||"")),t&&e.setAttribute("tabulator-field",t),this.column.definition.cssClass)&&this.column.definition.cssClass.split(" ").forEach((t=>{e.classList.add(t)}));this.dispatch("cell-init",this),this.column.visible||this.hide()}_generateContents(){var e;switch(typeof(e=this.chain("cell-format",this,null,(()=>this.element.innerHTML=this.value)))){case"object":if(e instanceof Node){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.appendChild(e)}else this.element.innerHTML="",null!=e&&console.warn("Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",e);break;case"undefined":this.element.innerHTML="";break;default:this.element.innerHTML=e}}cellRendered(){this.dispatch("cell-rendered",this)}getElement(e){return this.loaded||(this.loaded=!0,e||this.layoutElement()),this.element}getValue(){return this.value}getOldValue(){return this.oldValue}setValue(e,t,i){this.setValueProcessData(e,t,i)&&(this.dispatch("cell-value-updated",this),this.cellRendered(),this.column.definition.cellEdited&&this.column.definition.cellEdited.call(this.table,this.getComponent()),this.dispatchExternal("cellEdited",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()))}setValueProcessData(e,t,i){var s=!1;return(this.value!==e||i)&&(s=!0,t&&(e=this.chain("cell-value-changing",[this,e],null,e))),this.setValueActual(e),s&&this.dispatch("cell-value-changed",this),s}setValueActual(e){this.oldValue=this.value,this.value=e,this.dispatch("cell-value-save-before",this),this.column.setFieldValue(this.row.data,e),this.dispatch("cell-value-save-after",this),this.loaded&&this.layoutElement()}layoutElement(){this._generateContents(),this.dispatch("cell-layout",this)}setWidth(){this.width=this.column.width,this.element.style.width=this.column.widthStyled}clearWidth(){this.width="",this.element.style.width=""}getWidth(){return this.width||this.element.offsetWidth}setMinWidth(){this.minWidth=this.column.minWidth,this.element.style.minWidth=this.column.minWidthStyled}setMaxWidth(){this.maxWidth=this.column.maxWidth,this.element.style.maxWidth=this.column.maxWidthStyled}checkHeight(){this.row.reinitializeHeight()}clearHeight(){this.element.style.height="",this.height=null,this.dispatch("cell-height",this,"")}setHeight(){this.height=this.row.height,this.element.style.height=this.row.heightStyled,this.dispatch("cell-height",this,this.row.heightStyled)}getHeight(){return this.height||this.element.offsetHeight}show(){this.element.style.display=this.column.vertAlign?"inline-flex":""}hide(){this.element.style.display="none"}delete(){this.dispatch("cell-delete",this),!this.table.rowManager.redrawBlock&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=!1,this.column.deleteCell(this),this.row.deleteCell(this),this.calcs={}}getIndex(){return this.row.getCellIndex(this)}getComponent(){return this.component||(this.component=new p(this)),this.component}}class b{constructor(e){return this._column=e,this.type="ColumnComponent",new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._column.table.componentFunctionBinder.handle("column",e._column,t)}})}getElement(){return this._column.getElement()}getDefinition(){return this._column.getDefinition()}getField(){return this._column.getField()}getTitleDownload(){return this._column.getTitleDownload()}getCells(){var e=[];return this._column.cells.forEach((function(t){e.push(t.getComponent())})),e}isVisible(){return this._column.visible}show(){this._column.isGroup?this._column.columns.forEach((function(e){e.show()})):this._column.show()}hide(){this._column.isGroup?this._column.columns.forEach((function(e){e.hide()})):this._column.hide()}toggle(){this._column.visible?this.hide():this.show()}delete(){return this._column.delete()}getSubColumns(){var e=[];return this._column.columns.length&&this._column.columns.forEach((function(t){e.push(t.getComponent())})),e}getParentColumn(){return this._column.parent instanceof v&&this._column.parent.getComponent()}_getSelf(){return this._column}scrollTo(){return this._column.table.columnManager.scrollToColumn(this._column)}getTable(){return this._column.table}move(e,t){var i=this._column.table.columnManager.findColumn(e);i?this._column.table.columnManager.moveColumn(this._column,i,t):console.warn("Move Error - No matching column found:",i)}getNextColumn(){var e=this._column.nextColumn();return!!e&&e.getComponent()}getPrevColumn(){var e=this._column.prevColumn();return!!e&&e.getComponent()}updateDefinition(e){return this._column.updateDefinition(e)}getWidth(){return this._column.getWidth()}setWidth(e){var t;return t=!0===e?this._column.reinitializeWidth(!0):this._column.setWidth(e),this._column.table.columnManager.renderer.rerenderColumns(!0),t}}var f={title:void 0,field:void 0,columns:void 0,visible:void 0,hozAlign:void 0,vertAlign:void 0,width:void 0,minWidth:40,maxWidth:void 0,maxInitialWidth:void 0,cssClass:void 0,variableHeight:void 0,headerVertical:void 0,headerHozAlign:void 0,editableTitle:void 0};class v extends e{constructor(e,t){super(t.table),this.definition=e,this.parent=t,this.type="column",this.columns=[],this.cells=[],this.element=this.createElement(),this.contentElement=!1,this.titleHolderElement=!1,this.titleElement=!1,this.groupElement=this.createGroupElement(),this.isGroup=!1,this.hozAlign="",this.vertAlign="",this.field="",this.fieldStructure="",this.getFieldValue="",this.setFieldValue="",this.titleDownload=null,this.titleFormatterRendered=!1,this.mapDefinitions(),this.setField(this.definition.field),this.modules={},this.width=null,this.widthStyled="",this.maxWidth=null,this.maxWidthStyled="",this.maxInitialWidth=null,this.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,this.component=null,this.definition.columns?(this.isGroup=!0,this.definition.columns.forEach(((e,t)=>{var i=new v(e,this);this.attachColumn(i)})),this.checkColumnVisibility()):t.registerColumnField(this),this._initialize(),this.bindModuleColumns()}createElement(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.setAttribute("role","columnheader"),e.setAttribute("aria-sort","none"),e}createGroupElement(){var e=document.createElement("div");return e.classList.add("tabulator-col-group-cols"),e}mapDefinitions(){var e=this.table.options.columnDefaults;if(e)for(let t in e)void 0===this.definition[t]&&(this.definition[t]=e[t]);this.definition=this.table.columnManager.optionsList.generate(v.defaultOptionList,this.definition)}checkDefinition(){Object.keys(this.definition).forEach((e=>{-1===v.defaultOptionList.indexOf(e)&&console.warn("Invalid column definition option in '"+(this.field||this.definition.title)+"' column:",e)}))}setField(e){this.field=e,this.fieldStructure=e?this.table.options.nestedFieldSeparator?e.split(this.table.options.nestedFieldSeparator):[e]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData}registerColumnPosition(e){this.parent.registerColumnPosition(e)}registerColumnField(e){this.parent.registerColumnField(e)}reRegisterPosition(){this.isGroup?this.columns.forEach((function(e){e.reRegisterPosition()})):this.registerColumnPosition(this)}_mapDepricatedFunctionality(){}_initialize(){for(var e=this.definition;this.element.firstChild;)this.element.removeChild(this.element.firstChild);e.headerVertical&&(this.element.classList.add("tabulator-col-vertical"),"flip"===e.headerVertical&&this.element.classList.add("tabulator-col-vertical-flip")),this.contentElement=this._buildColumnHeaderContent(),this.element.appendChild(this.contentElement),this.isGroup?this._buildGroupHeader():this._buildColumnHeader(),this.dispatch("column-init",this)}_buildColumnHeader(){var e=this.definition;this.table;(this.dispatch("column-layout",this),void 0!==e.visible&&(e.visible?this.show(!0):this.hide(!0)),e.cssClass)&&e.cssClass.split(" ").forEach((e=>{this.element.classList.add(e)}));e.field&&this.element.setAttribute("tabulator-field",e.field),this.setMinWidth(parseInt(e.minWidth)),e.maxInitialWidth&&(this.maxInitialWidth=parseInt(e.maxInitialWidth)),e.maxWidth&&this.setMaxWidth(parseInt(e.maxWidth)),this.reinitializeWidth(),this.hozAlign=this.definition.hozAlign,this.vertAlign=this.definition.vertAlign,this.titleElement.style.textAlign=this.definition.headerHozAlign}_buildColumnHeaderContent(){this.definition,this.table;var e=document.createElement("div");return e.classList.add("tabulator-col-content"),this.titleHolderElement=document.createElement("div"),this.titleHolderElement.classList.add("tabulator-col-title-holder"),e.appendChild(this.titleHolderElement),this.titleElement=this._buildColumnHeaderTitle(),this.titleHolderElement.appendChild(this.titleElement),e}_buildColumnHeaderTitle(){var e=this.definition,t=document.createElement("div");if(t.classList.add("tabulator-col-title"),e.editableTitle){var i=document.createElement("input");i.classList.add("tabulator-title-editor"),i.addEventListener("click",(e=>{e.stopPropagation(),i.focus()})),i.addEventListener("change",(()=>{e.title=i.value,this.dispatchExternal("columnTitleChanged",this.getComponent())})),t.appendChild(i),e.field?this.langBind("columns|"+e.field,(t=>{i.value=t||e.title||" "})):i.value=e.title||" "}else e.field?this.langBind("columns|"+e.field,(i=>{this._formatColumnHeaderTitle(t,i||e.title||" ")})):this._formatColumnHeaderTitle(t,e.title||" ");return t}_formatColumnHeaderTitle(e,t){var i=this.chain("column-format",[this,t,e],null,(()=>t));switch(typeof i){case"object":i instanceof Node?e.appendChild(i):(e.innerHTML="",console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",i));break;case"undefined":e.innerHTML="";break;default:e.innerHTML=i}}_buildGroupHeader(){(this.element.classList.add("tabulator-col-group"),this.element.setAttribute("role","columngroup"),this.element.setAttribute("aria-title",this.definition.title),this.definition.cssClass)&&this.definition.cssClass.split(" ").forEach((e=>{this.element.classList.add(e)}));this.titleElement.style.textAlign=this.definition.headerHozAlign,this.element.appendChild(this.groupElement)}_getFlatData(e){return e[this.field]}_getNestedData(e){var t,i=e,s=this.fieldStructure,o=s.length;for(let e=0;e-1&&this.columns.splice(t,1),this.columns.length||this.delete()}setWidth(e){this.widthFixed=!0,this.setWidthActual(e)}setWidthActual(e){isNaN(e)&&(e=Math.floor(this.table.element.clientWidth/100*parseInt(e))),e=Math.max(this.minWidth,e),this.maxWidth&&(e=Math.min(this.maxWidth,e)),this.width=e,this.widthStyled=e?e+"px":"",this.element.style.width=this.widthStyled,this.isGroup||this.cells.forEach((function(e){e.setWidth()})),this.parent.isGroup&&this.parent.matchChildWidths(),this.dispatch("column-width",this)}checkCellHeights(){var e=[];this.cells.forEach((function(t){t.row.heightInitialized&&(null!==t.row.getElement().offsetParent?(e.push(t.row),t.row.clearCellHeight()):t.row.heightInitialized=!1)})),e.forEach((function(e){e.calcHeight()})),e.forEach((function(e){e.setCellHeight()}))}getWidth(){var e=0;return this.isGroup?this.columns.forEach((function(t){t.visible&&(e+=t.getWidth())})):e=this.width,e}getHeight(){return Math.ceil(this.element.getBoundingClientRect().height)}setMinWidth(e){this.minWidth=e,this.minWidthStyled=e?e+"px":"",this.element.style.minWidth=this.minWidthStyled,this.cells.forEach((function(e){e.setMinWidth()}))}setMaxWidth(e){this.maxWidth=e,this.maxWidthStyled=e?e+"px":"",this.element.style.maxWidth=this.maxWidthStyled,this.cells.forEach((function(e){e.setMaxWidth()}))}delete(){return new Promise(((e,t)=>{this.isGroup&&this.columns.forEach((function(e){e.delete()})),this.dispatch("column-delete",this);var i=this.cells.length;for(let e=0;e-1&&this._nextVisibleColumn(e+1)}_nextVisibleColumn(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._nextVisibleColumn(e+1)}prevColumn(){var e=this.table.columnManager.findColumnIndex(this);return e>-1&&this._prevVisibleColumn(e-1)}_prevVisibleColumn(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._prevVisibleColumn(e-1)}reinitializeWidth(e){this.widthFixed=!1,void 0===this.definition.width||e||this.setWidth(this.definition.width),this.dispatch("column-width-fit-before",this),this.fitToData(e),this.dispatch("column-width-fit-after",this)}fitToData(e){if(!this.isGroup){this.widthFixed||(this.element.style.width="",this.cells.forEach((e=>{e.clearWidth()})));var t=this.element.offsetWidth;if((!this.width||!this.widthFixed)&&(this.cells.forEach((e=>{var i=e.getWidth();i>t&&(t=i)})),t)){var i=t+1;this.maxInitialWidth&&!e&&(i=Math.min(i,this.maxInitialWidth)),this.setWidthActual(i)}}}updateDefinition(e){var t;return this.isGroup||this.parent.isGroup?(console.error("Column Update Error - The updateDefinition function is only available on ungrouped columns"),Promise.reject("Column Update Error - The updateDefinition function is only available on columns, not column groups")):(t=Object.assign({},this.getDefinition()),t=Object.assign(t,e),this.table.columnManager.addColumn(t,!1,this).then((e=>(t.field==this.field&&(this.field=!1),this.delete().then((()=>e.getComponent()))))))}deleteCell(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}getComponent(){return this.component||(this.component=new b(this)),this.component}}v.defaultOptionList=f;class w{constructor(e){return this._row=e,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._row.table.componentFunctionBinder.handle("row",e._row,t)}})}getData(e){return this._row.getData(e)}getElement(){return this._row.getElement()}getCells(){var e=[];return this._row.getCells().forEach((function(t){e.push(t.getComponent())})),e}getCell(e){var t=this._row.getCell(e);return!!t&&t.getComponent()}getIndex(){return this._row.getData("data")[this._row.table.options.index]}getPosition(e){return this._row.table.rowManager.getRowPosition(this._row,e)}delete(){return this._row.delete()}scrollTo(){return this._row.table.rowManager.scrollToRow(this._row)}move(e,t){this._row.moveToRow(e,t)}update(e){return this._row.updateData(e)}normalizeHeight(){this._row.normalizeHeight(!0)}_getSelf(){return this._row}reformat(){return this._row.reinitialize()}getTable(){return this._row.table}getNextRow(){var e=this._row.nextRow();return e?e.getComponent():e}getPrevRow(){var e=this._row.prevRow();return e?e.getComponent():e}}class C extends e{constructor(e,t,i="row"){super(t.table),this.parent=t,this.data={},this.type=i,this.element=!1,this.modules={},this.cells=[],this.height=0,this.heightStyled="",this.manualHeight=!1,this.outerHeight=0,this.initialized=!1,this.heightInitialized=!1,this.component=null,this.created=!1,this.setData(e)}create(){this.created||(this.created=!0,this.generateElement())}createElement(){var e=document.createElement("div");e.classList.add("tabulator-row"),e.setAttribute("role","row"),this.element=e}getElement(){return this.create(),this.element}detachElement(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}generateElement(){this.createElement(),this.dispatch("row-init",this)}generateCells(){this.cells=this.table.columnManager.generateCells(this)}initialize(e){if(this.create(),!this.initialized||e){for(this.deleteCells();this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.dispatch("row-layout-before",this),this.generateCells(),this.initialized=!0,this.table.columnManager.renderer.renderRowCells(this),e&&this.normalizeHeight(),this.dispatch("row-layout",this),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent()),this.dispatch("row-layout-after",this)}else this.table.columnManager.renderer.rerenderRowCells(this)}reinitializeHeight(){this.heightInitialized=!1,this.element&&null!==this.element.offsetParent&&this.normalizeHeight(!0)}deinitialize(){this.initialized=!1}deinitializeHeight(){this.heightInitialized=!1}reinitialize(e){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),this.element&&null!==this.element.offsetParent&&this.initialize(!0),this.dispatch("row-relayout",this)}calcHeight(e){var t,i=0;this.table.options.rowHeight?this.height=this.table.options.rowHeight:(t=this.table.options.resizableRows?this.element.clientHeight:0,this.cells.forEach((function(e){var t=e.getHeight();t>i&&(i=t)})),this.height=e?Math.max(i,t):this.manualHeight?this.height:Math.max(i,t)),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight}setCellHeight(){this.cells.forEach((function(e){e.setHeight()})),this.heightInitialized=!0}clearCellHeight(){this.cells.forEach((function(e){e.clearHeight()}))}normalizeHeight(e){e&&!this.table.options.rowHeight&&this.clearCellHeight(),this.calcHeight(e),this.setCellHeight()}setHeight(e,t){(this.height!=e||t)&&(this.manualHeight=!0,this.height=e,this.heightStyled=e?e+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight)}getHeight(){return this.outerHeight}getWidth(){return this.element.offsetWidth}deleteCell(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}setData(e){this.data=this.chain("row-data-init-before",[this,e],void 0,e),this.dispatch("row-data-init-after",this)}updateData(e){var i,s=this.element&&t.elVisible(this.element),o={};return new Promise(((t,n)=>{for(var r in"string"==typeof e&&(e=JSON.parse(e)),this.dispatch("row-data-save-before",this),this.subscribed("row-data-changing")&&(o=Object.assign(o,this.data),o=Object.assign(o,e)),i=this.chain("row-data-changing",[this,o,e],null,e))this.data[r]=i[r];for(var r in this.dispatch("row-data-save-after",this),e){this.table.columnManager.getColumnsByFieldRoot(r).forEach((e=>{let t=this.getCell(e.getField());if(t){let o=e.getFieldValue(i);t.getValue()!=o&&(t.setValueProcessData(o),s&&t.cellRendered())}}))}s?(this.normalizeHeight(!0),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent())):(this.initialized=!1,this.height=0,this.heightStyled=""),this.dispatch("row-data-changed",this,s,e),this.dispatchExternal("rowUpdated",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),t()}))}getData(e){return e?this.chain("row-data-retrieve",[this,e],null,this.data):this.data}getCell(e){return e=this.table.columnManager.findColumn(e),this.initialized||this.generateCells(),this.cells.find((function(t){return t.column===e}))}getCellIndex(e){return this.cells.findIndex((function(t){return t===e}))}findCell(e){return this.cells.find((t=>t.element===e))}getCells(){return this.initialized||this.generateCells(),this.cells}nextRow(){return this.table.rowManager.nextDisplayRow(this,!0)||!1}prevRow(){return this.table.rowManager.prevDisplayRow(this,!0)||!1}moveToRow(e,t){var i=this.table.rowManager.findRow(e);i?(this.table.rowManager.moveRowActual(this,i,!t),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",e)}delete(){return this.dispatch("row-delete",this),this.deleteActual(),Promise.resolve()}deleteActual(e){this.table.rowManager.getRowIndex(this);this.detatchModules(),this.table.rowManager.deleteRow(this,e),this.deleteCells(),this.initialized=!1,this.heightInitialized=!1,this.element=!1,this.dispatch("row-deleted",this)}detatchModules(){this.dispatch("row-deleting",this)}deleteCells(){var e=this.cells.length;for(let t=0;ts||null===s)&&(s=e)})),null!==s?!1!==o?s.toFixed(o):s:""},min:function(e,t,i){var s=null,o=void 0!==i.precision&&i.precision;return e.forEach((function(e){((e=Number(e)){this.recalcGroup(e)})))}recalcGroup(e){var t,i;e&&e.calcs&&(e.calcs.bottom&&(t=this.rowsToData(e.rows),i=this.generateRowData("bottom",t),e.calcs.bottom.updateData(i),e.calcs.bottom.reinitialize()),e.calcs.top&&(t=this.rowsToData(e.rows),i=this.generateRowData("top",t),e.calcs.top.updateData(i),e.calcs.top.reinitialize()))}generateTopRow(e){return this.generateRow("top",this.rowsToData(e))}generateBottomRow(e){return this.generateRow("bottom",this.rowsToData(e))}rowsToData(e){var t=[];return e.forEach((e=>{if(t.push(e.getData()),this.table.options.dataTree&&this.table.options.dataTreeChildColumnCalcs&&e.modules.dataTree&&e.modules.dataTree.open){var i=this.rowsToData(this.table.modules.dataTree.getFilteredTreeChildren(e));t=t.concat(i)}})),t}generateRow(e,t){var i,s=this.generateRowData(e,t);return this.table.modExists("mutator")&&this.table.modules.mutator.disable(),i=new C(s,this,"calc"),this.table.modExists("mutator")&&this.table.modules.mutator.enable(),i.getElement().classList.add("tabulator-calcs","tabulator-calcs-"+e),i.component=!1,i.getComponent=()=>(i.component||(i.component=new m(i)),i.component),i.generateCells=()=>{var t=[];this.table.columnManager.columnsByIndex.forEach((s=>{this.genColumn.setField(s.getField()),this.genColumn.hozAlign=s.hozAlign,s.definition[e+"CalcFormatter"]&&this.table.modExists("format")?this.genColumn.modules.format={formatter:this.table.modules.format.getFormatter(s.definition[e+"CalcFormatter"]),params:s.definition[e+"CalcFormatterParams"]||{}}:this.genColumn.modules.format={formatter:this.table.modules.format.getFormatter("plaintext"),params:{}},this.genColumn.definition.cssClass=s.definition.cssClass;var o=new g(this.genColumn,i);o.getElement(),o.column=s,o.setWidth(),s.cells.push(o),t.push(o),s.visible||o.hide()})),i.cells=t},i}generateRowData(e,t){var i,s,o={},n="top"==e?this.topCalcs:this.botCalcs,r="top"==e?"topCalc":"botCalc";return n.forEach((function(e){var n=[];e.modules.columnCalcs&&e.modules.columnCalcs[r]&&(t.forEach((function(t){n.push(e.getFieldValue(t))})),s=r+"Params",i="function"==typeof e.modules.columnCalcs[s]?e.modules.columnCalcs[s](n,t):e.modules.columnCalcs[s],e.setFieldValue(o,e.modules.columnCalcs[r](n,t,i)))})),o}hasTopCalcs(){return!!this.topCalcs.length}hasBottomCalcs(){return!!this.botCalcs.length}redraw(){this.topRow&&this.topRow.normalizeHeight(!0),this.botRow&&this.botRow.normalizeHeight(!0)}getResults(){var e={};return this.table.options.groupBy&&this.table.modExists("groupRows")?this.table.modules.groupRows.getGroups(!0).forEach((t=>{e[t.getKey()]=this.getGroupResults(t)})):e={top:this.topRow?this.topRow.getData():{},bottom:this.botRow?this.botRow.getData():{}},e}getGroupResults(e){var t=e._getSelf(),i=e.getSubGroups(),s={};return i.forEach((e=>{s[e.getKey()]=this.getGroupResults(e)})),{top:t.calcs.top?t.calcs.top.getData():{},bottom:t.calcs.bottom?t.calcs.bottom.getData():{},groups:s}}}y.moduleName="columnCalcs",y.calculations=E;class R extends o{constructor(e){super(e),this.indent=10,this.field="",this.collapseEl=null,this.expandEl=null,this.branchEl=null,this.elementField=!1,this.startOpen=function(){},this.displayIndex=0,this.registerTableOption("dataTree",!1),this.registerTableOption("dataTreeFilter",!0),this.registerTableOption("dataTreeSort",!0),this.registerTableOption("dataTreeElementColumn",!1),this.registerTableOption("dataTreeBranchElement",!0),this.registerTableOption("dataTreeChildIndent",9),this.registerTableOption("dataTreeChildField","_children"),this.registerTableOption("dataTreeCollapseElement",!1),this.registerTableOption("dataTreeExpandElement",!1),this.registerTableOption("dataTreeStartExpanded",!1),this.registerTableOption("dataTreeChildColumnCalcs",!1),this.registerTableOption("dataTreeSelectPropagate",!1),this.registerComponentFunction("row","treeCollapse",this.collapseRow.bind(this)),this.registerComponentFunction("row","treeExpand",this.expandRow.bind(this)),this.registerComponentFunction("row","treeToggle",this.toggleRow.bind(this)),this.registerComponentFunction("row","getTreeParent",this.getTreeParent.bind(this)),this.registerComponentFunction("row","getTreeChildren",this.getRowChildren.bind(this)),this.registerComponentFunction("row","addTreeChild",this.addTreeChildRow.bind(this)),this.registerComponentFunction("row","isTreeExpanded",this.isRowExpanded.bind(this))}initialize(){if(this.table.options.dataTree){var e=null,t=this.table.options;switch(this.field=t.dataTreeChildField,this.indent=t.dataTreeChildIndent,t.dataTreeBranchElement&&(!0===t.dataTreeBranchElement?(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch")):"string"==typeof t.dataTreeBranchElement?((e=document.createElement("div")).innerHTML=t.dataTreeBranchElement,this.branchEl=e.firstChild):this.branchEl=t.dataTreeBranchElement),t.dataTreeCollapseElement?"string"==typeof t.dataTreeCollapseElement?((e=document.createElement("div")).innerHTML=t.dataTreeCollapseElement,this.collapseEl=e.firstChild):this.collapseEl=t.dataTreeCollapseElement:(this.collapseEl=document.createElement("div"),this.collapseEl.classList.add("tabulator-data-tree-control"),this.collapseEl.tabIndex=0,this.collapseEl.innerHTML="
"),t.dataTreeExpandElement?"string"==typeof t.dataTreeExpandElement?((e=document.createElement("div")).innerHTML=t.dataTreeExpandElement,this.expandEl=e.firstChild):this.expandEl=t.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.tabIndex=0,this.expandEl.innerHTML="
"),typeof t.dataTreeStartExpanded){case"boolean":this.startOpen=function(e,i){return t.dataTreeStartExpanded};break;case"function":this.startOpen=t.dataTreeStartExpanded;break;default:this.startOpen=function(e,i){return t.dataTreeStartExpanded[i]}}this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("row-deleted",this.rowDelete.bind(this),0),this.subscribe("row-data-changed",this.rowDataChanged.bind(this),10),this.subscribe("cell-value-updated",this.cellValueChanged.bind(this)),this.subscribe("edit-cancelled",this.cellValueChanged.bind(this)),this.subscribe("column-moving-rows",this.columnMoving.bind(this)),this.subscribe("table-built",this.initializeElementField.bind(this)),this.subscribe("table-redrawing",this.tableRedrawing.bind(this)),this.registerDisplayHandler(this.getRows.bind(this),30)}}tableRedrawing(e){e&&this.table.rowManager.getRows().forEach((e=>{this.reinitializeRowChildren(e)}))}initializeElementField(){var e=this.table.columnManager.getFirstVisibleColumn();this.elementField=this.table.options.dataTreeElementColumn||!!e&&e.field}getRowChildren(e){return this.getTreeChildren(e,!0)}columnMoving(){var e=[];return this.table.rowManager.rows.forEach((t=>{e=e.concat(this.getTreeChildren(t,!1,!0))})),e}rowDataChanged(e,t,i){this.redrawNeeded(i)&&(this.initializeRow(e),t&&(this.layoutRow(e),this.refreshData(!0)))}cellValueChanged(e){e.column.getField()===this.elementField&&this.layoutRow(e.row)}initializeRow(e){var t=e.getData()[this.field],i=Array.isArray(t),s=i||!i&&"object"==typeof t&&null!==t;!s&&e.modules.dataTree&&e.modules.dataTree.branchEl&&e.modules.dataTree.branchEl.parentNode.removeChild(e.modules.dataTree.branchEl),!s&&e.modules.dataTree&&e.modules.dataTree.controlEl&&e.modules.dataTree.controlEl.parentNode.removeChild(e.modules.dataTree.controlEl),e.modules.dataTree={index:e.modules.dataTree?e.modules.dataTree.index:0,open:!!s&&(e.modules.dataTree?e.modules.dataTree.open:this.startOpen(e.getComponent(),0)),controlEl:!(!e.modules.dataTree||!s)&&e.modules.dataTree.controlEl,branchEl:!(!e.modules.dataTree||!s)&&e.modules.dataTree.branchEl,parent:!!e.modules.dataTree&&e.modules.dataTree.parent,children:s}}reinitializeRowChildren(e){this.getTreeChildren(e,!1,!0).forEach((function(e){e.reinitialize(!0)}))}layoutRow(e){var t=(this.elementField?e.getCell(this.elementField):e.getCells()[0]).getElement(),i=e.modules.dataTree;i.branchEl&&(i.branchEl.parentNode&&i.branchEl.parentNode.removeChild(i.branchEl),i.branchEl=!1),i.controlEl&&(i.controlEl.parentNode&&i.controlEl.parentNode.removeChild(i.controlEl),i.controlEl=!1),this.generateControlElement(e,t),e.getElement().classList.add("tabulator-tree-level-"+i.index),i.index&&(this.branchEl?(i.branchEl=this.branchEl.cloneNode(!0),t.insertBefore(i.branchEl,t.firstChild),this.table.rtl?i.branchEl.style.marginRight=(i.branchEl.offsetWidth+i.branchEl.style.marginLeft)*(i.index-1)+i.index*this.indent+"px":i.branchEl.style.marginLeft=(i.branchEl.offsetWidth+i.branchEl.style.marginRight)*(i.index-1)+i.index*this.indent+"px"):this.table.rtl?t.style.paddingRight=parseInt(window.getComputedStyle(t,null).getPropertyValue("padding-right"))+i.index*this.indent+"px":t.style.paddingLeft=parseInt(window.getComputedStyle(t,null).getPropertyValue("padding-left"))+i.index*this.indent+"px")}generateControlElement(e,t){var i=e.modules.dataTree,s=(t=t||e.getCells()[0].getElement(),i.controlEl);!1!==i.children&&(i.open?(i.controlEl=this.collapseEl.cloneNode(!0),i.controlEl.addEventListener("click",(t=>{t.stopPropagation(),this.collapseRow(e)}))):(i.controlEl=this.expandEl.cloneNode(!0),i.controlEl.addEventListener("click",(t=>{t.stopPropagation(),this.expandRow(e)}))),i.controlEl.addEventListener("mousedown",(e=>{e.stopPropagation()})),s&&s.parentNode===t?s.parentNode.replaceChild(i.controlEl,s):t.insertBefore(i.controlEl,t.firstChild))}setDisplayIndex(e){this.displayIndex=e}getDisplayIndex(){return this.displayIndex}getRows(e){var t=[];return e.forEach(((e,i)=>{var s;t.push(e),e instanceof C&&(e.create(),(s=e.modules.dataTree.children).index||!1===s.children||this.getChildren(e).forEach((e=>{e.create(),t.push(e)})))})),t}getChildren(e,t){var i=e.modules.dataTree,s=[],o=[];return!1!==i.children&&(i.open||t)&&(Array.isArray(i.children)||(i.children=this.generateChildren(e)),s=this.table.modExists("filter")&&this.table.options.dataTreeFilter?this.table.modules.filter.filter(i.children):i.children,this.table.modExists("sort")&&this.table.options.dataTreeSort&&this.table.modules.sort.sort(s),s.forEach((e=>{o.push(e),this.getChildren(e).forEach((e=>{o.push(e)}))}))),o}generateChildren(e){var t=[],i=e.getData()[this.field];return Array.isArray(i)||(i=[i]),i.forEach((i=>{var s=new C(i||{},this.table.rowManager);s.create(),s.modules.dataTree.index=e.modules.dataTree.index+1,s.modules.dataTree.parent=e,s.modules.dataTree.children&&(s.modules.dataTree.open=this.startOpen(s.getComponent(),s.modules.dataTree.index)),t.push(s)})),t}expandRow(e,t){var i=e.modules.dataTree;!1!==i.children&&(i.open=!0,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowExpanded",e.getComponent(),e.modules.dataTree.index))}collapseRow(e){var t=e.modules.dataTree;!1!==t.children&&(t.open=!1,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowCollapsed",e.getComponent(),e.modules.dataTree.index))}toggleRow(e){var t=e.modules.dataTree;!1!==t.children&&(t.open?this.collapseRow(e):this.expandRow(e))}isRowExpanded(e){return e.modules.dataTree.open}getTreeParent(e){return!!e.modules.dataTree.parent&&e.modules.dataTree.parent.getComponent()}getTreeParentRoot(e){return e.modules.dataTree.parent?this.getTreeParentRoot(e.modules.dataTree.parent):e}getFilteredTreeChildren(e){var t=e.modules.dataTree,i=[];return t.children&&(Array.isArray(t.children)||(t.children=this.generateChildren(e)),(this.table.modExists("filter")&&this.table.options.dataTreeFilter?this.table.modules.filter.filter(t.children):t.children).forEach((e=>{e instanceof C&&i.push(e)}))),i}rowDelete(e){var t,i=e.modules.dataTree.parent;i&&(!1!==(t=this.findChildIndex(e,i))&&i.data[this.field].splice(t,1),i.data[this.field].length||delete i.data[this.field],this.initializeRow(i),this.layoutRow(i)),this.refreshData(!0)}addTreeChildRow(e,t,i,s){var o=!1;"string"==typeof t&&(t=JSON.parse(t)),Array.isArray(e.data[this.field])||(e.data[this.field]=[],e.modules.dataTree.open=this.startOpen(e.getComponent(),e.modules.dataTree.index)),void 0!==s&&!1!==(o=this.findChildIndex(s,e))&&e.data[this.field].splice(i?o:o+1,0,t),!1===o&&(i?e.data[this.field].unshift(t):e.data[this.field].push(t)),this.initializeRow(e),this.layoutRow(e),this.refreshData(!0)}findChildIndex(e,t){var i=!1;return"object"==typeof e?e instanceof C?i=e.data:e instanceof RowComponent?i=e._getSelf().data:"undefined"!=typeof HTMLElement&&e instanceof HTMLElement&&t.modules.dataTree&&(i=t.modules.dataTree.children.find((t=>t instanceof C&&t.element===e)))&&(i=i.data):i=null!=e&&t.data[this.field].find((t=>t.data[this.table.options.index]==e)),i&&(Array.isArray(t.data[this.field])&&(i=t.data[this.field].indexOf(i)),-1==i&&(i=!1)),i}getTreeChildren(e,t,i){var s=e.modules.dataTree,o=[];return s.children&&(Array.isArray(s.children)||(s.children=this.generateChildren(e)),s.children.forEach((e=>{e instanceof C&&(o.push(t?e.getComponent():e),i&&(o=o.concat(this.getTreeChildren(e,t,i))))}))),o}getChildField(){return this.field}redrawNeeded(e){return!!this.field&&void 0!==e[this.field]||!!this.elementField&&void 0!==e[this.elementField]}}R.moduleName="dataTree";var x={csv:function(e,t,i){var s=t&&t.delimiter?t.delimiter:",",o=[],n=[];e.forEach((e=>{var t=[];switch(e.type){case"group":console.warn("Download Warning - CSV downloader cannot process row groups");break;case"calc":console.warn("Download Warning - CSV downloader cannot process column calculations");break;case"header":e.columns.forEach(((e,t)=>{e&&1===e.depth&&(n[t]=void 0===e.value||null===e.value?"":'"'+String(e.value).split('"').join('""')+'"')}));break;case"row":e.columns.forEach((e=>{if(e){switch(typeof e.value){case"object":e.value=null!==e.value?JSON.stringify(e.value):"";break;case"undefined":e.value=""}t.push('"'+String(e.value).split('"').join('""')+'"')}})),o.push(t.join(s))}})),n.length&&o.unshift(n.join(s)),o=o.join("\n"),t.bom&&(o="\ufeff"+o),i(o,"text/csv")},json:function(e,t,i){var s=[];e.forEach((e=>{var t={};switch(e.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":e.columns.forEach((e=>{e&&(t[e.component.getTitleDownload()||e.component.getField()]=e.value)})),s.push(t)}})),i(s=JSON.stringify(s,null,"\t"),"application/json")},jsonLines:function(e,t,i){const s=[];e.forEach((e=>{const t={};switch(e.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":e.columns.forEach((e=>{e&&(t[e.component.getTitleDownload()||e.component.getField()]=e.value)})),s.push(JSON.stringify(t))}})),i(s.join("\n"),"application/x-ndjson")},pdf:function(e,t,i){var s=[],o=[],n={},r=t.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},a=t.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},l=t.jsPDF||{},h=t&&t.title?t.title:"";function d(e,t){var i=[];return e.columns.forEach((e=>{var s;if(e){switch(typeof e.value){case"object":e.value=null!==e.value?JSON.stringify(e.value):"";break;case"undefined":e.value=""}s={content:e.value,colSpan:e.width,rowSpan:e.height},t&&(s.styles=t),i.push(s)}})),i}l.orientation||(l.orientation=t.orientation||"landscape"),l.unit||(l.unit="pt"),e.forEach((e=>{switch(e.type){case"header":s.push(d(e));break;case"group":o.push(d(e,r));break;case"calc":o.push(d(e,a));break;case"row":o.push(d(e))}}));var c=new jspdf.jsPDF(l);t&&t.autoTable&&(n="function"==typeof t.autoTable?t.autoTable(c)||{}:t.autoTable),h&&(n.didDrawPage=function(e){c.text(h,40,30)}),n.head=s,n.body=o,c.autoTable(n),t&&t.documentProcessing&&t.documentProcessing(c),i(c.output("arraybuffer"),"application/pdf")},xlsx:function(t,i,s){var o=i.sheetName||"Sheet1",n=XLSX.utils.book_new(),r=new e(this);function a(){var e=[],i=[],s={},o={s:{c:0,r:0},e:{c:t[0]?t[0].columns.reduce(((e,t)=>e+(t&&t.width?t.width:1)),0):0,r:t.length}};return t.forEach(((t,s)=>{var o=[];t.columns.forEach((function(e,t){e?(o.push(e.value instanceof Date||"object"!=typeof e.value?e.value:JSON.stringify(e.value)),(e.width>1||e.height>-1)&&(e.height>1||e.width>1)&&i.push({s:{r:s,c:t},e:{r:s+e.height-1,c:t+e.width-1}})):o.push("")})),e.push(o)})),XLSX.utils.sheet_add_aoa(s,e),s["!ref"]=XLSX.utils.encode_range(o),i.length&&(s["!merges"]=i),s}if(n.SheetNames=[],n.Sheets={},i.sheetOnly)s(a());else{if(i.sheets)for(var l in i.sheets)!0===i.sheets[l]?(n.SheetNames.push(l),n.Sheets[l]=a()):(n.SheetNames.push(l),r.commsSend(i.sheets[l],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},active:this.active,intercept:function(e){n.Sheets[l]=e}}));else n.SheetNames.push(o),n.Sheets[o]=a();i.documentProcessing&&(n=i.documentProcessing(n)),s(function(e){for(var t=new ArrayBuffer(e.length),i=new Uint8Array(t),s=0;s!=e.length;++s)i[s]=255&e.charCodeAt(s);return t}(XLSX.write(n,{bookType:"xlsx",bookSST:!0,type:"binary"})),"application/octet-stream")}},html:function(e,t,i){this.modExists("export",!0)&&i(this.modules.export.genereateHTMLTable(e),"text/html")}};class T extends o{constructor(e){super(e),this.registerTableOption("downloadReady",(function(e,t){return t})),this.registerTableOption("downloadConfig",{}),this.registerTableOption("downloadRowRange","active"),this.registerColumnOption("download"),this.registerColumnOption("titleDownload")}initialize(){this.registerTableFunction("download",this.download.bind(this)),this.registerTableFunction("downloadToTab",this.downloadToTab.bind(this))}downloadToTab(e,t,i,s){this.download(e,t,i,s,!0)}download(e,t,i,s,o){var n=!1;if("function"==typeof e?n=e:T.downloaders[e]?n=T.downloaders[e]:console.warn("Download Error - No such download type found: ",e),n){var r=this.generateExportList(s);n.call(this.table,r,i||{},function(i,s){o?!0===o?this.triggerDownload(i,s,e,t,!0):o(i):this.triggerDownload(i,s,e,t)}.bind(this))}}generateExportList(e){var t=this.table.modules.export.generateExportList(this.table.options.downloadConfig,!1,e||this.table.options.downloadRowRange,"download"),i=this.table.options.groupHeaderDownload;return i&&!Array.isArray(i)&&(i=[i]),t.forEach((e=>{var t;"group"===e.type&&(t=e.columns[0],i&&i[e.indent]&&(t.value=i[e.indent](t.value,e.component._group.getRowCount(),e.component._group.getData(),e.component)))})),t}triggerDownload(e,t,i,s,o){var n=document.createElement("a"),r=new Blob([e],{type:t});s=s||"Tabulator."+("function"==typeof i?"txt":i);(r=this.table.options.downloadReady(e,r))&&(o?window.open(window.URL.createObjectURL(r)):navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(r,s):(n.setAttribute("href",window.URL.createObjectURL(r)),n.setAttribute("download",s),n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n)),this.dispatchExternal("downloadComplete"))}commsReceived(e,t,i){switch(t){case"intercept":this.download(i.type,"",i.options,i.active,i.intercept)}}}function M(e,t){var i=t.mask,s=void 0!==t.maskLetterChar?t.maskLetterChar:"A",o=void 0!==t.maskNumberChar?t.maskNumberChar:"9",n=void 0!==t.maskWildcardChar?t.maskWildcardChar:"*";function r(t){var a=i[t];void 0!==a&&a!==n&&a!==s&&a!==o&&(e.value=e.value+""+a,r(t+1))}e.addEventListener("keydown",(t=>{var r=e.value.length,a=t.key;if(t.keyCode>46){if(r>=i.length)return t.preventDefault(),t.stopPropagation(),!1;switch(i[r]){case s:if(a.toUpperCase()==a.toLowerCase())return t.preventDefault(),t.stopPropagation(),!1;break;case o:if(isNaN(a))return t.preventDefault(),t.stopPropagation(),!1;break;case n:break;default:if(a!==i[r])return t.preventDefault(),t.stopPropagation(),!1}}})),e.addEventListener("keyup",(i=>{i.keyCode>46&&t.maskAutoFill&&r(e.value.length)})),e.placeholder||(e.placeholder=i),t.maskAutoFill&&r(e.value.length)}T.moduleName="download",T.downloaders=x;class L{constructor(e,t,i,s,o,n){this.edit=e,this.table=e.table,this.cell=t,this.params=this._initializeParams(n),this.data=[],this.displayItems=[],this.currentItems=[],this.focusedItem=null,this.input=this._createInputElement(),this.listEl=this._createListElement(),this.initialValues=null,this.isFilter=!t._getSelf,this.filterTimeout=null,this.filtered=!1,this.typing=!1,this.values=[],this.popup=null,this.listIteration=0,this.blurable=!0,this.actions={success:s,cancel:o},this._deprecationCheck(),this._initializeValue(),i(this._onRendered.bind(this))}_deprecationCheck(){this.params.listItemFormatter&&console.warn("The listItemFormatter editor param has been deprecated, please see the latest editor documentation for updated options"),this.params.sortValuesList&&console.warn("The sortValuesList editor param has been deprecated, please see the latest editor documentation for updated options"),this.params.searchFunc&&console.warn("The searchFunc editor param has been deprecated, please see the latest editor documentation for updated options"),this.params.searchingPlaceholder&&console.warn("The searchingPlaceholder editor param has been deprecated, please see the latest editor documentation for updated options")}_initializeValue(){var e=this.cell.getValue();void 0===e&&void 0!==this.params.defaultValue&&(e=this.params.defaultValue),this.initialValues=this.params.multiselect?e:[e],this.isFilter&&(this.input.value=this.initialValues?this.initialValues.join(","):"",this.headerFilterInitialListGen())}_onRendered(){var e=this.cell.getElement();function t(e){e.stopPropagation()}this.input.style.height="100%",this.input.focus({preventScroll:!0}),e.addEventListener("click",t),setTimeout((()=>{e.removeEventListener("click",t)}),1e3)}_createListElement(){var e=document.createElement("div");return e.classList.add("tabulator-edit-list"),e.addEventListener("mousedown",this._preventBlur.bind(this)),e.addEventListener("keydown",this._inputKeyDown.bind(this)),e}_setListWidth(){var e=this.isFilter?this.input:this.cell.getElement();this.listEl.style.minWidth=e.offsetWidth+"px",this.params.maxWidth&&(!0===this.params.maxWidth?this.listEl.style.maxWidth=e.offsetWidth+"px":"number"==typeof this.params.maxWidth?this.listEl.style.maxWidth=this.params.maxWidth+"px":this.listEl.style.maxWidth=this.params.maxWidth)}_createInputElement(){var e=this.params.elementAttributes,t=document.createElement("input");if(t.setAttribute("type",this.params.clearable?"search":"text"),t.style.padding="4px",t.style.width="100%",t.style.boxSizing="border-box",this.params.autocomplete||(t.style.cursor="default",t.style.caretColor="transparent"),e&&"object"==typeof e)for(let i in e)"+"==i.charAt(0)?(i=i.slice(1),t.setAttribute(i,t.getAttribute(i)+e["+"+i])):t.setAttribute(i,e[i]);return this.params.mask&&M(t,this.params),this._bindInputEvents(t),t}_initializeParams(e){var t,i=["values","valuesURL","valuesLookup"];return(e=Object.assign({},e)).verticalNavigation=e.verticalNavigation||"editor",e.placeholderLoading=void 0===e.placeholderLoading?"Searching ...":e.placeholderLoading,e.placeholderEmpty=void 0===e.placeholderEmpty?"No Results Found":e.placeholderEmpty,e.filterDelay=void 0===e.filterDelay?300:e.filterDelay,e.emptyValue=Object.keys(e).includes("emptyValue")?e.emptyValue:"",(t=Object.keys(e).filter((e=>i.includes(e))).length)?t>1&&console.warn("list editor config error - only one of the values, valuesURL, or valuesLookup options can be set on the same editor"):console.warn("list editor config error - either the values, valuesURL, or valuesLookup option must be set"),e.autocomplete?e.multiselect&&(e.multiselect=!1,console.warn("list editor config error - multiselect option is not available when autocomplete is enabled")):(e.freetext&&(e.freetext=!1,console.warn("list editor config error - freetext option is only available when autocomplete is enabled")),e.filterFunc&&(e.filterFunc=!1,console.warn("list editor config error - filterFunc option is only available when autocomplete is enabled")),e.filterRemote&&(e.filterRemote=!1,console.warn("list editor config error - filterRemote option is only available when autocomplete is enabled")),e.mask&&(e.mask=!1,console.warn("list editor config error - mask option is only available when autocomplete is enabled")),e.allowEmpty&&(e.allowEmpty=!1,console.warn("list editor config error - allowEmpty option is only available when autocomplete is enabled")),e.listOnEmpty&&(e.listOnEmpty=!1,console.warn("list editor config error - listOnEmpty option is only available when autocomplete is enabled"))),e.filterRemote&&"function"!=typeof e.valuesLookup&&(e.valuesURL,0)&&(e.filterRemote=!1,console.warn("list editor config error - filterRemote option should only be used when values list is populated from a remote source")),e}_bindInputEvents(e){e.addEventListener("focus",this._inputFocus.bind(this)),e.addEventListener("click",this._inputClick.bind(this)),e.addEventListener("blur",this._inputBlur.bind(this)),e.addEventListener("keydown",this._inputKeyDown.bind(this)),e.addEventListener("search",this._inputSearch.bind(this)),this.params.autocomplete&&e.addEventListener("keyup",this._inputKeyUp.bind(this))}_inputFocus(e){this.rebuildOptionsList()}_filter(){this.params.filterRemote?(clearTimeout(this.filterTimeout),this.filterTimeout=setTimeout((()=>{this.rebuildOptionsList()}),this.params.filterDelay)):this._filterList()}_inputClick(e){e.stopPropagation()}_inputBlur(e){this.blurable&&this.popup&&this.popup.hide()}_inputSearch(){this._clearChoices()}_inputKeyDown(e){switch(e.keyCode){case 38:this._keyUp(e);break;case 40:this._keyDown(e);break;case 37:case 39:this._keySide(e);break;case 13:this._keyEnter();break;case 27:this._keyEsc();break;case 36:case 35:this._keyHomeEnd(e);break;case 9:break;default:this._keySelectLetter(e)}}_inputKeyUp(e){switch(e.keyCode){case 38:case 37:case 39:case 40:case 13:case 27:break;default:this._keyAutoCompLetter(e)}}_preventBlur(){this.blurable=!1,setTimeout((function(){this.blurable=!0}),10)}_keyUp(e){var t=this.displayItems.indexOf(this.focusedItem);("editor"==this.params.verticalNavigation||"hybrid"==this.params.verticalNavigation&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t>0&&this._focusItem(this.displayItems[t-1]))}_keyDown(e){var t=this.displayItems.indexOf(this.focusedItem);("editor"==this.params.verticalNavigation||"hybrid"==this.params.verticalNavigation&&t=38&&e.keyCode<=90&&this._scrollToValue(e.keyCode))}_keyAutoCompLetter(e){this._filter(),this.typing=!0}_scrollToValue(e){clearTimeout(this.filterTimeout);var t=String.fromCharCode(e).toLowerCase();this.filterTerm+=t.toLowerCase();var i=this.displayItems.find((e=>void 0!==e.label&&e.label.toLowerCase().startsWith(this.filterTerm)));i&&this._focusItem(i),this.filterTimeout=setTimeout((()=>{this.filterTerm=""}),800)}_focusItem(e){this.focusedItem&&this.focusedItem.element&&this.focusedItem.element.classList.remove("focused"),this.focusedItem=e,e&&e.element&&(e.element.classList.add("focused"),e.element.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"}))}headerFilterInitialListGen(){this._generateOptions(!0)}rebuildOptionsList(){this._generateOptions().then(this._sortOptions.bind(this)).then(this._buildList.bind(this)).then(this._showList.bind(this)).catch((e=>{Number.isInteger(e)||console.error("List generation error",e)}))}_filterList(){this._buildList(this._filterOptions()),this._showList()}_generateOptions(e){var t=[],i=++this.listIteration;return this.filtered=!1,this.params.values?t=this.params.values:this.params.valuesURL?t=this._ajaxRequest(this.params.valuesURL,this.input.value):"function"==typeof this.params.valuesLookup?t=this.params.valuesLookup(this.cell,this.input.value):this.params.valuesLookup&&(t=this._uniqueColumnValues(this.params.valuesLookupField)),t instanceof Promise?(e||this._addPlaceholder(this.params.placeholderLoading),t.then().then((e=>this.listIteration===i?this._parseList(e):Promise.reject(i)))):Promise.resolve(this._parseList(t))}_addPlaceholder(e){var t=document.createElement("div");"function"==typeof e&&(e=e(cell.getComponent(),this.listEl)),e&&(this._clearList(),e instanceof HTMLElement?t=e:(t.classList.add("tabulator-edit-list-placeholder"),t.innerHTML=e),this.listEl.appendChild(t),this._showList())}_ajaxRequest(e,t){return e=l(e,{},this.params.filterRemote?{term:t}:{}),fetch(e).then((e=>e.ok?e.json().catch((e=>(console.warn("List Ajax Load Error - Invalid JSON returned",e),Promise.reject(e)))):(console.error("List Ajax Load Error - Connection Error: "+e.status,e.statusText),Promise.reject(e)))).catch((e=>(console.error("List Ajax Load Error - Connection Error: ",e),Promise.reject(e))))}_uniqueColumnValues(e){var t,i={},s=this.table.getData(this.params.valuesLookup);return(t=e?this.table.columnManager.getColumnByField(e):this.cell.getColumn()._getSelf())?s.forEach((e=>{var s=t.getFieldValue(e);null!=s&&""!==s&&(i[s]=!0)})):(console.warn("unable to find matching column to create select lookup list:",e),i=[]),Object.keys(i)}_parseList(e){var t=[];return Array.isArray(e)||(e=Object.entries(e).map((([e,t])=>({label:t,value:e})))),e.forEach((e=>{"object"!=typeof e&&(e={label:e,value:e}),this._parseListItem(e,t,0)})),this.data=t,t}_parseListItem(e,t,i){var s={};e.options?s=this._parseListGroup(e,i+1):(s={label:e.label,value:e.value,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1,selected:!1,visible:!0,level:i,original:e},this.initialValues&&this.initialValues.indexOf(e.value)>-1&&this._chooseItem(s,!0)),t.push(s)}_parseListGroup(e,t){var i={label:e.label,group:!0,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1,visible:!0,level:t,options:[],original:e};return e.options.forEach((e=>{this._parseListItem(e,i.options,t)})),i}_sortOptions(e){var t;return this.params.sort&&(t="function"==typeof this.params.sort?this.params.sort:this._defaultSortFunction.bind(this),this._sortGroup(t,e)),e}_sortGroup(e,t){t.sort(((t,i)=>e(t.label,i.label,t.value,i.value,t.original,i.original))),t.forEach((t=>{t.group&&this._sortGroup(e,t.options)}))}_defaultSortFunction(e,t){var i,s,o,n,r,a=0,l=/(\d+)|(\D+)/g,h=/\d/,d=0;if("desc"===this.params.sort&&([e,t]=[t,e]),e||0===e){if(t||0===t){if(isFinite(e)&&isFinite(t))return e-t;if((i=String(e).toLowerCase())===(s=String(t).toLowerCase()))return 0;if(!h.test(i)||!h.test(s))return i>s?1:-1;for(i=i.match(l),s=s.match(l),r=i.length>s.length?s.length:i.length;an?1:-1;return i.length>s.length}d=1}else d=t||0===t?-1:0;return d}_filterOptions(){var e=this.params.filterFunc||this._defaultFilterFunc,t=this.input.value;return t?(this.filtered=!0,this.data.forEach((i=>{this._filterItem(e,t,i)}))):this.filtered=!1,this.data}_filterItem(e,t,i){var s=!1;return i.group?(i.options.forEach((i=>{this._filterItem(e,t,i)&&(s=!0)})),i.visible=s):i.visible=e(t,i.label,i.value,i.original),i.visible}_defaultFilterFunc(e,t,i,s){e=String(e).toLowerCase();return(null!==t||void 0!==t)&&(String(t).toLowerCase().indexOf(e)>-1||String(i).toLowerCase(e).indexOf()>-1)}_clearList(){for(;this.listEl.firstChild;)this.listEl.removeChild(this.listEl.firstChild);this.displayItems=[]}_buildList(e){this._clearList(),e.forEach((e=>{this._buildItem(e)})),this.displayItems.length||this._addPlaceholder(this.params.placeholderEmpty)}_buildItem(e){var t,i=e.element;if(!this.filtered||e.visible){if(!i){if((i=document.createElement("div")).tabIndex=0,(t=this.params.itemFormatter?this.params.itemFormatter(e.label,e.value,e.original,i):e.label)instanceof HTMLElement?i.appendChild(t):i.innerHTML=t,e.group?i.classList.add("tabulator-edit-list-group"):i.classList.add("tabulator-edit-list-item"),i.classList.add("tabulator-edit-list-group-level-"+e.level),e.elementAttributes&&"object"==typeof e.elementAttributes)for(let t in e.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),i.setAttribute(t,this.input.getAttribute(t)+e.elementAttributes["+"+t])):i.setAttribute(t,e.elementAttributes[t]);e.group?i.addEventListener("click",this._groupClick.bind(this,e)):i.addEventListener("click",this._itemClick.bind(this,e)),i.addEventListener("mousedown",this._preventBlur.bind(this)),e.element=i}this._styleItem(e),this.listEl.appendChild(i),e.group?e.options.forEach((e=>{this._buildItem(e)})):this.displayItems.push(e)}}_showList(){var e=this.popup&&this.popup.isVisible();if(this.input.parentNode){if(this.params.autocomplete&&""===this.input.value&&!this.params.listOnEmpty&&this.popup)return void this.popup.hide(!0);this._setListWidth(),this.popup||(this.popup=this.edit.popup(this.listEl)),this.popup.show(this.cell.getElement(),"bottom"),e||this.popup.hideOnBlur(this._resolveValue.bind(this,!0))}}_styleItem(e){e&&e.element&&(e.selected?e.element.classList.add("active"):e.element.classList.remove("active"))}_itemClick(e,t){t.stopPropagation(),this._chooseItem(e)}_groupClick(e,t){t.stopPropagation()}_cancel(){this.popup.hide(!0),this.actions.cancel()}_clearChoices(){this.typing=!0,this.currentItems.forEach((e=>{e.selected=!1,this._styleItem(e)})),this.currentItems=[],this.focusedItem=null}_chooseItem(e,t){var i;this.typing=!1,this.params.multiselect?((i=this.currentItems.indexOf(e))>-1?(this.currentItems.splice(i,1),e.selected=!1):(this.currentItems.push(e),e.selected=!0),this.input.value=this.currentItems.map((e=>e.label)).join(","),this._styleItem(e)):(this.currentItems=[e],e.selected=!0,this.input.value=e.label,this._styleItem(e),t||this._resolveValue()),this._focusItem(e)}_resolveValue(e){var t,i;if(this.popup.hide(!0),this.params.multiselect)t=this.currentItems.map((e=>e.value));else if(e&&this.params.autocomplete&&this.typing){if(!(this.params.freetext||this.params.allowEmpty&&""===this.input.value))return void this.actions.cancel();t=this.input.value}else t=this.currentItems[0]?this.currentItems[0].value:null==(i=this.initialValues[0])||""===i?i:this.params.emptyValue;""===t&&(t=this.params.emptyValue),this.actions.success(t),this.isFilter&&(this.initialValues=t&&!Array.isArray[t]?[t]:t)}}var k={input:function(e,t,i,s,o){var n=e.getValue(),r=document.createElement("input");if(r.setAttribute("type",o.search?"search":"text"),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),r.setAttribute(e,r.getAttribute(e)+o.elementAttributes["+"+e])):r.setAttribute(e,o.elementAttributes[e]);function a(e){null==n&&""!==r.value||r.value!==n?i(r.value)&&(n=r.value):s()}return r.value=void 0!==n?n:"",t((function(){r.focus({preventScroll:!0}),r.style.height="100%",o.selectContents&&r.select()})),r.addEventListener("change",a),r.addEventListener("blur",a),r.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:a();break;case 27:s();break;case 35:case 36:e.stopPropagation()}})),o.mask&&M(r,o),r},textarea:function(e,t,i,s,o){var n=e.getValue(),r=o.verticalNavigation||"hybrid",a=String(null!=n?n:""),l=((a.match(/(?:\r\n|\r|\n)/g)||[]).length,document.createElement("textarea")),h=0;if(l.style.display="block",l.style.padding="2px",l.style.height="100%",l.style.width="100%",l.style.boxSizing="border-box",l.style.whiteSpace="pre-wrap",l.style.resize="none",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),l.setAttribute(e,l.getAttribute(e)+o.elementAttributes["+"+e])):l.setAttribute(e,o.elementAttributes[e]);function d(t){null==n&&""!==l.value||l.value!==n?(i(l.value)&&(n=l.value),setTimeout((function(){e.getRow().normalizeHeight()}),300)):s()}return l.value=a,t((function(){l.focus({preventScroll:!0}),l.style.height="100%",l.scrollHeight,l.style.height=l.scrollHeight+"px",e.getRow().normalizeHeight(),o.selectContents&&l.select()})),l.addEventListener("change",d),l.addEventListener("blur",d),l.addEventListener("keyup",(function(){l.style.height="";var t=l.scrollHeight;l.style.height=t+"px",t!=h&&(h=t,e.getRow().normalizeHeight())})),l.addEventListener("keydown",(function(e){switch(e.keyCode){case 27:s();break;case 38:("editor"==r||"hybrid"==r&&l.selectionStart)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 40:("editor"==r||"hybrid"==r&&l.selectionStart!==l.value.length)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 35:case 36:e.stopPropagation()}})),o.mask&&M(l,o),l},number:function(e,t,i,s,o){var n=e.getValue(),r=o.verticalNavigation||"editor",a=document.createElement("input");if(a.setAttribute("type","number"),void 0!==o.max&&a.setAttribute("max",o.max),void 0!==o.min&&a.setAttribute("min",o.min),void 0!==o.step&&a.setAttribute("step",o.step),a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),a.setAttribute(e,a.getAttribute(e)+o.elementAttributes["+"+e])):a.setAttribute(e,o.elementAttributes[e]);a.value=n;var l=function(e){h()};function h(){var e=a.value;isNaN(e)||""===e||(e=Number(e)),e!==n?i(e)&&(n=e):s()}return t((function(){a.removeEventListener("blur",l),a.focus({preventScroll:!0}),a.style.height="100%",a.addEventListener("blur",l),o.selectContents&&a.select()})),a.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:h();break;case 27:s();break;case 38:case 40:"editor"==r&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 35:case 36:e.stopPropagation()}})),o.mask&&M(a,o),a},range:function(e,t,i,s,o){var n=e.getValue(),r=document.createElement("input");if(r.setAttribute("type","range"),void 0!==o.max&&r.setAttribute("max",o.max),void 0!==o.min&&r.setAttribute("min",o.min),void 0!==o.step&&r.setAttribute("step",o.step),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),r.setAttribute(e,r.getAttribute(e)+o.elementAttributes["+"+e])):r.setAttribute(e,o.elementAttributes[e]);function a(){var e=r.value;isNaN(e)||""===e||(e=Number(e)),e!=n?i(e)&&(n=e):s()}return r.value=n,t((function(){r.focus({preventScroll:!0}),r.style.height="100%"})),r.addEventListener("blur",(function(e){a()})),r.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:a();break;case 27:s()}})),r},select:function(e,t,i,s,o){return console.warn("The select editor has been deprecated, please use the new list editor"),new L(this,e,t,i,s,o).input},list:function(e,t,i,s,o){return new L(this,e,t,i,s,o).input},autocomplete:function(e,t,i,s,o){return console.warn("The autocomplete editor has been deprecated, please use the new list editor with the 'autocomplete' editorParam"),o.autocomplete=!0,new L(this,e,t,i,s,o).input},star:function(e,t,i,s,o){var n=this,r=e.getElement(),a=e.getValue(),l=r.getElementsByTagName("svg").length||5,h=r.getElementsByTagName("svg")[0]?r.getElementsByTagName("svg")[0].getAttribute("width"):14,d=[],c=document.createElement("div"),u=document.createElementNS("http://www.w3.org/2000/svg","svg");function m(e){d.forEach((function(t,i){i'):("ie"==n.table.browser?t.setAttribute("class","tabulator-star-inactive"):t.classList.replace("tabulator-star-active","tabulator-star-inactive"),t.innerHTML='')}))}function p(e){var t=document.createElement("span"),s=u.cloneNode(!0);d.push(s),t.addEventListener("mouseenter",(function(t){t.stopPropagation(),t.stopImmediatePropagation(),m(e)})),t.addEventListener("mousemove",(function(e){e.stopPropagation(),e.stopImmediatePropagation()})),t.addEventListener("click",(function(t){t.stopPropagation(),t.stopImmediatePropagation(),i(e),r.blur()})),t.appendChild(s),c.appendChild(t)}function g(e){a=e,m(e)}if(r.style.whiteSpace="nowrap",r.style.overflow="hidden",r.style.textOverflow="ellipsis",c.style.verticalAlign="middle",c.style.display="inline-block",c.style.padding="4px",u.setAttribute("width",h),u.setAttribute("height",h),u.setAttribute("viewBox","0 0 512 512"),u.setAttribute("xml:space","preserve"),u.style.padding="0 1px",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),c.setAttribute(e,c.getAttribute(e)+o.elementAttributes["+"+e])):c.setAttribute(e,o.elementAttributes[e]);for(var b=1;b<=l;b++)p(b);return m(a=Math.min(parseInt(a),l)),c.addEventListener("mousemove",(function(e){m(0)})),c.addEventListener("click",(function(e){i(0)})),r.addEventListener("blur",(function(e){s()})),r.addEventListener("keydown",(function(e){switch(e.keyCode){case 39:g(a+1);break;case 37:g(a-1);break;case 13:i(a);break;case 27:s()}})),c},progress:function(e,t,i,s,o){var n,r,a=e.getElement(),l=void 0===o.max?a.getElementsByTagName("div")[0]&&a.getElementsByTagName("div")[0].getAttribute("max")||100:o.max,h=void 0===o.min?a.getElementsByTagName("div")[0]&&a.getElementsByTagName("div")[0].getAttribute("min")||0:o.min,d=(l-h)/100,c=e.getValue()||0,u=document.createElement("div"),m=document.createElement("div");function p(){var e=window.getComputedStyle(a,null),t=d*Math.round(m.offsetWidth/((a.clientWidth-parseInt(e.getPropertyValue("padding-left"))-parseInt(e.getPropertyValue("padding-right")))/100))+h;i(t),a.setAttribute("aria-valuenow",t),a.setAttribute("aria-label",c)}if(u.style.position="absolute",u.style.right="0",u.style.top="0",u.style.bottom="0",u.style.width="5px",u.classList.add("tabulator-progress-handle"),m.style.display="inline-block",m.style.position="relative",m.style.height="100%",m.style.backgroundColor="#488CE9",m.style.maxWidth="100%",m.style.minWidth="0%",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),m.setAttribute(e,m.getAttribute(e)+o.elementAttributes["+"+e])):m.setAttribute(e,o.elementAttributes[e]);return a.style.padding="4px 4px",c=Math.min(parseFloat(c),l),c=Math.max(parseFloat(c),h),c=Math.round((c-h)/d),m.style.width=c+"%",a.setAttribute("aria-valuemin",h),a.setAttribute("aria-valuemax",l),m.appendChild(u),u.addEventListener("mousedown",(function(e){n=e.screenX,r=m.offsetWidth})),u.addEventListener("mouseover",(function(){u.style.cursor="ew-resize"})),a.addEventListener("mousemove",(function(e){n&&(m.style.width=r+e.screenX-n+"px")})),a.addEventListener("mouseup",(function(e){n&&(e.stopPropagation(),e.stopImmediatePropagation(),n=!1,r=!1,p())})),a.addEventListener("keydown",(function(e){switch(e.keyCode){case 39:e.preventDefault(),m.style.width=m.clientWidth+a.clientWidth/100+"px";break;case 37:e.preventDefault(),m.style.width=m.clientWidth-a.clientWidth/100+"px";break;case 9:case 13:p();break;case 27:s()}})),a.addEventListener("blur",(function(){s()})),m},tickCross:function(e,t,i,s,o){var n=e.getValue(),r=document.createElement("input"),a=o.tristate,l=void 0===o.indeterminateValue?null:o.indeterminateValue,h=!1,d=Object.keys(o).includes("trueValue"),c=Object.keys(o).includes("falseValue");if(r.setAttribute("type","checkbox"),r.style.marginTop="5px",r.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),r.setAttribute(e,r.getAttribute(e)+o.elementAttributes["+"+e])):r.setAttribute(e,o.elementAttributes[e]);function u(e){var t=r.checked;return t=d&&t?o.trueValue:c&&!t?o.falseValue:t,a?e?h?l:t:r.checked&&!h?(r.checked=!1,r.indeterminate=!0,h=!0,l):(h=!1,t):t}return r.value=n,!a||void 0!==n&&n!==l&&""!==n||(h=!0,r.indeterminate=!0),"firefox"!=this.table.browser&&t((function(){r.focus({preventScroll:!0})})),r.checked=d?n===o.trueValue:!0===n||"true"===n||"True"===n||1===n,t((function(){r.focus()})),r.addEventListener("change",(function(e){i(u())})),r.addEventListener("blur",(function(e){i(u(!0))})),r.addEventListener("keydown",(function(e){13==e.keyCode&&i(u()),27==e.keyCode&&s()})),r}};class D extends o{constructor(e){super(e),this.currentCell=!1,this.mouseClick=!1,this.recursionBlock=!1,this.invalidEdit=!1,this.editedCells=[],this.editors=D.editors,this.registerColumnOption("editable"),this.registerColumnOption("editor"),this.registerColumnOption("editorParams"),this.registerColumnOption("cellEditing"),this.registerColumnOption("cellEdited"),this.registerColumnOption("cellEditCancelled"),this.registerTableFunction("getEditedCells",this.getEditedCells.bind(this)),this.registerTableFunction("clearCellEdited",this.clearCellEdited.bind(this)),this.registerTableFunction("navigatePrev",this.navigatePrev.bind(this)),this.registerTableFunction("navigateNext",this.navigateNext.bind(this)),this.registerTableFunction("navigateLeft",this.navigateLeft.bind(this)),this.registerTableFunction("navigateRight",this.navigateRight.bind(this)),this.registerTableFunction("navigateUp",this.navigateUp.bind(this)),this.registerTableFunction("navigateDown",this.navigateDown.bind(this)),this.registerComponentFunction("cell","isEdited",this.cellisEdited.bind(this)),this.registerComponentFunction("cell","clearEdited",this.clearEdited.bind(this)),this.registerComponentFunction("cell","edit",this.editCell.bind(this)),this.registerComponentFunction("cell","cancelEdit",this.cellCancelEdit.bind(this)),this.registerComponentFunction("cell","navigatePrev",this.navigatePrev.bind(this)),this.registerComponentFunction("cell","navigateNext",this.navigateNext.bind(this)),this.registerComponentFunction("cell","navigateLeft",this.navigateLeft.bind(this)),this.registerComponentFunction("cell","navigateRight",this.navigateRight.bind(this)),this.registerComponentFunction("cell","navigateUp",this.navigateUp.bind(this)),this.registerComponentFunction("cell","navigateDown",this.navigateDown.bind(this))}initialize(){this.subscribe("cell-init",this.bindEditor.bind(this)),this.subscribe("cell-delete",this.clearEdited.bind(this)),this.subscribe("column-layout",this.initializeColumnCheck.bind(this)),this.subscribe("column-delete",this.columnDeleteCheck.bind(this)),this.subscribe("row-deleting",this.rowDeleteCheck.bind(this)),this.subscribe("data-refreshing",this.cancelEdit.bind(this)),this.subscribe("keybinding-nav-prev",this.navigatePrev.bind(this,void 0)),this.subscribe("keybinding-nav-next",this.keybindingNavigateNext.bind(this)),this.subscribe("keybinding-nav-left",this.navigateLeft.bind(this,void 0)),this.subscribe("keybinding-nav-right",this.navigateRight.bind(this,void 0)),this.subscribe("keybinding-nav-up",this.navigateUp.bind(this,void 0)),this.subscribe("keybinding-nav-down",this.navigateDown.bind(this,void 0))}keybindingNavigateNext(e){var t=this.currentCell,i=this.options("tabEndNewRow");t&&(this.navigateNext(t,e)||i&&(t.getElement().firstChild.blur(),(i=!0===i?this.table.addRow({}):"function"==typeof i?this.table.addRow(i(t.row.getComponent())):this.table.addRow(Object.assign({},i))).then((()=>{setTimeout((()=>{t.getComponent().navigateNext()}))}))))}cellisEdited(e){return!!e.modules.edit&&e.modules.edit.edited}cellCancelEdit(e){e===this.currentCell?this.table.modules.edit.cancelEdit():console.warn("Cancel Editor Error - This cell is not currently being edited ")}clearCellEdited(e){e||(e=this.table.modules.edit.getEditedCells()),Array.isArray(e)||(e=[e]),e.forEach((e=>{this.table.modules.edit.clearEdited(e._getSelf())}))}navigatePrev(e=this.currentCell,t){var i,s;if(e){if(t&&t.preventDefault(),i=this.navigateLeft())return!0;if((s=this.table.rowManager.prevDisplayRow(e.row,!0))&&(i=this.findNextEditableCell(s,s.cells.length)))return i.getComponent().edit(),!0}return!1}navigateNext(e=this.currentCell,t){var i,s;if(e){if(t&&t.preventDefault(),i=this.navigateRight())return!0;if((s=this.table.rowManager.nextDisplayRow(e.row,!0))&&(i=this.findNextEditableCell(s,-1)))return i.getComponent().edit(),!0}return!1}navigateLeft(e=this.currentCell,t){var i,s;return!!(e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.findPrevEditableCell(e.row,i)))&&(s.getComponent().edit(),!0)}navigateRight(e=this.currentCell,t){var i,s;return!!(e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.findNextEditableCell(e.row,i)))&&(s.getComponent().edit(),!0)}navigateUp(e=this.currentCell,t){var i,s;return!!(e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.table.rowManager.prevDisplayRow(e.row,!0)))&&(s.cells[i].getComponent().edit(),!0)}navigateDown(e=this.currentCell,t){var i,s;return!!(e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.table.rowManager.nextDisplayRow(e.row,!0)))&&(s.cells[i].getComponent().edit(),!0)}findNextEditableCell(e,i){var s=!1;if(i0)for(var o=i-1;o>=0;o--){let i=e.cells[o],n=!0;if(i.column.modules.edit&&t.elVisible(i.getElement())&&("function"==typeof i.column.modules.edit.check&&(n=i.column.modules.edit.check(i.getComponent())),n)){s=i;break}}return s}initializeColumnCheck(e){void 0!==e.definition.editor&&this.initializeColumn(e)}columnDeleteCheck(e){this.currentCell&&this.currentCell.column===e&&this.cancelEdit()}rowDeleteCheck(e){this.currentCell&&this.currentCell.row===e&&this.cancelEdit()}initializeColumn(e){var t={editor:!1,blocked:!1,check:e.definition.editable,params:e.definition.editorParams||{}};switch(typeof e.definition.editor){case"string":this.editors[e.definition.editor]?t.editor=this.editors[e.definition.editor]:console.warn("Editor Error - No such editor found: ",e.definition.editor);break;case"function":t.editor=e.definition.editor;break;case"boolean":!0===e.definition.editor&&("function"!=typeof e.definition.formatter?this.editors[e.definition.formatter]?t.editor=this.editors[e.definition.formatter]:t.editor=this.editors.input:console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",e.definition.formatter))}t.editor&&(e.modules.edit=t)}getCurrentCell(){return!!this.currentCell&&this.currentCell.getComponent()}clearEditor(e){var t,i=this.currentCell;if(this.invalidEdit=!1,i){for(this.currentCell=!1,t=i.getElement(),this.dispatch("edit-editor-clear",i,e),t.classList.remove("tabulator-editing");t.firstChild;)t.removeChild(t.firstChild);i.row.getElement().classList.remove("tabulator-row-editing")}}cancelEdit(){if(this.currentCell){var e=this.currentCell,t=this.currentCell.getComponent();this.clearEditor(!0),e.setValueActual(e.getValue()),e.cellRendered(),("textarea"==e.column.definition.editor||e.column.definition.variableHeight)&&e.row.normalizeHeight(!0),e.column.definition.cellEditCancelled&&e.column.definition.cellEditCancelled.call(this.table,t),this.dispatch("edit-cancelled",e),this.dispatchExternal("cellEditCancelled",t)}}bindEditor(e){if(e.column.modules.edit){var t=this,i=e.getElement(!0);i.setAttribute("tabindex",0),i.addEventListener("click",(function(e){i.classList.contains("tabulator-editing")||i.focus({preventScroll:!0})})),i.addEventListener("mousedown",(function(e){2===e.button?e.preventDefault():t.mouseClick=!0})),i.addEventListener("focus",(function(i){t.recursionBlock||t.edit(e,i,!1)}))}}focusCellNoEvent(e,t){this.recursionBlock=!0,t&&"ie"===this.table.browser||e.getElement().focus({preventScroll:!0}),this.recursionBlock=!1}editCell(e,t){this.focusCellNoEvent(e),this.edit(e,!1,t)}focusScrollAdjust(e){if("virtual"==this.table.rowManager.getRenderMode()){var t=this.table.rowManager.element.scrollTop,i=this.table.rowManager.element.clientHeight+this.table.rowManager.element.scrollTop,s=e.row.getElement();s.offsetTop;s.offsetTopi&&(this.table.rowManager.element.scrollTop+=s.offsetTop+s.offsetHeight-i);var o=this.table.rowManager.element.scrollLeft,n=this.table.rowManager.element.clientWidth+this.table.rowManager.element.scrollLeft,r=e.getElement();r.offsetLeft;this.table.modExists("frozenColumns")&&(o+=parseInt(this.table.modules.frozenColumns.leftMargin),n-=parseInt(this.table.modules.frozenColumns.rightMargin)),"virtual"===this.table.options.renderHorizontal&&(o-=parseInt(this.table.columnManager.renderer.vDomPadLeft),n-=parseInt(this.table.columnManager.renderer.vDomPadLeft)),r.offsetLeftn&&(this.table.rowManager.element.scrollLeft+=r.offsetLeft+r.offsetWidth-n)}}edit(e,t,i){var s,o,n,r=this,a=!0,l=function(){},h=e.getElement();if(!this.currentCell){if(e.column.modules.edit.blocked)return this.mouseClick=!1,h.blur(),!1;switch(t&&t.stopPropagation(),typeof e.column.modules.edit.check){case"function":a=e.column.modules.edit.check(e.getComponent());break;case"boolean":a=e.column.modules.edit.check}if(a||i){if(r.cancelEdit(),r.currentCell=e,this.focusScrollAdjust(e),o=e.getComponent(),this.mouseClick&&(this.mouseClick=!1,e.column.definition.cellClick&&e.column.definition.cellClick.call(this.table,t,o)),e.column.definition.cellEditing&&e.column.definition.cellEditing.call(this.table,o),this.dispatch("cell-editing",e),this.dispatchExternal("cellEditing",o),n="function"==typeof e.column.modules.edit.params?e.column.modules.edit.params(o):e.column.modules.edit.params,!1===(s=e.column.modules.edit.editor.call(r,o,(function(e){l=e}),(function(t){if(r.currentCell===e){var i=r.chain("edit-success",[e,t],!0,!0);return!0===i||"highlight"===r.table.options.validationMode?(r.clearEditor(),e.modules.edit||(e.modules.edit={}),e.modules.edit.edited=!0,-1==r.editedCells.indexOf(e)&&r.editedCells.push(e),e.setValue(t,!0),!0===i):(r.invalidEdit=!0,r.focusCellNoEvent(e,!0),l(),!1)}}),(function(){r.currentCell===e&&r.cancelEdit()}),n)))return h.blur(),!1;if(!(s instanceof Node))return console.warn("Edit Error - Editor should return an instance of Node, the editor returned:",s),h.blur(),!1;for(h.classList.add("tabulator-editing"),e.row.getElement().classList.add("tabulator-row-editing");h.firstChild;)h.removeChild(h.firstChild);h.appendChild(s),l();for(var d=h.children,c=0;c{e.push(t.getComponent())})),e}clearEdited(e){var t;e.modules.edit&&e.modules.edit.edited&&(e.modules.edit.edited=!1,this.dispatch("edit-edited-clear",e)),(t=this.editedCells.indexOf(e))>-1&&this.editedCells.splice(t,1)}}D.moduleName="edit",D.editors=k;class P{constructor(e,t,i,s){this.type=e,this.columns=t,this.component=i||!1,this.indent=s||0}}class S{constructor(e,t,i,s,o){this.value=e,this.component=t||!1,this.width=i,this.height=s,this.depth=o}}class z extends o{constructor(e){super(e),this.config={},this.cloneTableStyle=!0,this.colVisProp="",this.registerTableOption("htmlOutputConfig",!1),this.registerColumnOption("htmlOutput"),this.registerColumnOption("titleHtmlOutput")}initialize(){this.registerTableFunction("getHtml",this.getHtml.bind(this))}generateExportList(e,t,i,s){this.cloneTableStyle=t,this.config=e||{},this.colVisProp=s;var o=!1!==this.config.columnHeaders?this.headersToExportRows(this.generateColumnGroupHeaders()):[],n=this.bodyToExportRows(this.rowLookup(i));return o.concat(n)}genereateTable(e,t,i,s){var o=this.generateExportList(e,t,i,s);return this.genereateTableElement(o)}rowLookup(e){var t=[];if("function"==typeof e)e.call(this.table).forEach((e=>{(e=this.table.rowManager.findRow(e))&&t.push(e)}));else switch(e){case!0:case"visible":t=this.table.rowManager.getVisibleRows(!1,!0);break;case"all":t=this.table.rowManager.rows;break;case"selected":t=this.table.modules.selectRow.selectedRows;break;case"active":default:t=this.table.options.pagination?this.table.rowManager.getDisplayRows(this.table.rowManager.displayRows.length-2):this.table.rowManager.getDisplayRows()}return Object.assign([],t)}generateColumnGroupHeaders(){var e=[];return(!1!==this.config.columnGroups?this.table.columnManager.columns:this.table.columnManager.columnsByIndex).forEach((t=>{var i=this.processColumnGroup(t);i&&e.push(i)})),e}processColumnGroup(e){var t=e.columns,i=0,s={title:e.definition["title"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))]||e.definition.title,column:e,depth:1};if(t.length){if(s.subGroups=[],s.width=0,t.forEach((e=>{var t=this.processColumnGroup(e);t&&(s.width+=t.width,s.subGroups.push(t),t.depth>i&&(i=t.depth))})),s.depth+=i,!s.width)return!1}else{if(!this.columnVisCheck(e))return!1;s.width=1}return s}columnVisCheck(e){return!1!==e.definition[this.colVisProp]&&(e.visible||!e.visible&&e.definition[this.colVisProp])}headersToExportRows(e){var t=[],i=0,s=[];function o(e,s){var n=i-s;if(void 0===t[s]&&(t[s]=[]),e.height=e.subGroups?1:n-e.depth+1,t[s].push(e),e.height>1)for(let i=1;i1)for(let i=1;ii&&(i=e.depth)})),e.forEach((function(e){o(e,0)})),t.forEach((e=>{var t=[];e.forEach((e=>{if(e){let i=void 0===e.title?"":e.title;t.push(new S(i,e.column.getComponent(),e.width,e.height,e.depth))}else t.push(null)})),s.push(new P("header",t))})),s}bodyToExportRows(e){var t=[],i=[];return this.table.columnManager.columnsByIndex.forEach((e=>{this.columnVisCheck(e)&&t.push(e.getComponent())})),!1!==this.config.columnCalcs&&this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&e.unshift(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&e.push(this.table.modules.columnCalcs.botRow)),(e=e.filter((e=>{switch(e.type){case"group":return!1!==this.config.rowGroups;case"calc":return!1!==this.config.columnCalcs;case"row":return!(this.table.options.dataTree&&!1===this.config.dataTree&&e.modules.dataTree.parent)}return!0}))).forEach(((e,s)=>{var o=e.getData(this.colVisProp),n=[],r=0;switch(e.type){case"group":r=e.level,n.push(new S(e.key,e.getComponent(),t.length,1));break;case"calc":case"row":t.forEach((e=>{n.push(new S(e._column.getFieldValue(o),e,1,1))})),this.table.options.dataTree&&!1!==this.config.dataTree&&(r=e.modules.dataTree.index)}i.push(new P(e.type,n,e.getComponent(),r))})),i}genereateTableElement(e){var t=document.createElement("table"),i=document.createElement("thead"),s=document.createElement("tbody"),o=this.lookupTableStyles(),n=this.table.options["rowFormatter"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],r={};return r.rowFormatter=null!==n?n:this.table.options.rowFormatter,this.table.options.dataTree&&!1!==this.config.dataTree&&this.table.modExists("columnCalcs")&&(r.treeElementField=this.table.modules.dataTree.elementField),r.groupHeader=this.table.options["groupHeader"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],r.groupHeader&&!Array.isArray(r.groupHeader)&&(r.groupHeader=[r.groupHeader]),t.classList.add("tabulator-print-table"),this.mapElementStyles(this.table.columnManager.getHeadersElement(),i,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),e.length>1e3&&console.warn("It may take a long time to render an HTML table with more than 1000 rows"),e.forEach(((e,t)=>{switch(e.type){case"header":i.appendChild(this.genereateHeaderElement(e,r,o));break;case"group":s.appendChild(this.genereateGroupElement(e,r,o));break;case"calc":s.appendChild(this.genereateCalcElement(e,r,o));break;case"row":let n=this.genereateRowElement(e,r,o);this.mapElementStyles(t%2&&o.evenRow?o.evenRow:o.oddRow,n,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),s.appendChild(n)}})),i.innerHTML&&t.appendChild(i),t.appendChild(s),this.mapElementStyles(this.table.element,t,["border-top","border-left","border-right","border-bottom"]),t}lookupTableStyles(){var e={};return this.cloneTableStyle&&window.getComputedStyle&&(e.oddRow=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"),e.evenRow=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),e.calcRow=this.table.element.querySelector(".tabulator-row.tabulator-calcs"),e.firstRow=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),e.firstGroup=this.table.element.getElementsByClassName("tabulator-group")[0],e.firstRow&&(e.styleCells=e.firstRow.getElementsByClassName("tabulator-cell"),e.firstCell=e.styleCells[0],e.lastCell=e.styleCells[e.styleCells.length-1])),e}genereateHeaderElement(e,t,i){var s=document.createElement("tr");return e.columns.forEach((e=>{if(e){var t=document.createElement("th"),i=e.component._column.definition.cssClass?e.component._column.definition.cssClass.split(" "):[];t.colSpan=e.width,t.rowSpan=e.height,t.innerHTML=e.value,this.cloneTableStyle&&(t.style.boxSizing="border-box"),i.forEach((function(e){t.classList.add(e)})),this.mapElementStyles(e.component.getElement(),t,["text-align","border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),this.mapElementStyles(e.component._column.contentElement,t,["padding-top","padding-left","padding-right","padding-bottom"]),e.component._column.visible?this.mapElementStyles(e.component.getElement(),t,["width"]):e.component._column.definition.width&&(t.style.width=e.component._column.definition.width+"px"),e.component._column.parent&&this.mapElementStyles(e.component._column.parent.groupElement,t,["border-top"]),s.appendChild(t)}})),s}genereateGroupElement(e,t,i){var s=document.createElement("tr"),o=document.createElement("td"),n=e.columns[0];return s.classList.add("tabulator-print-table-row"),t.groupHeader&&t.groupHeader[e.indent]?n.value=t.groupHeader[e.indent](n.value,e.component._group.getRowCount(),e.component._group.getData(),e.component):!1===t.groupHeader?n.value=n.value:n.value=e.component._group.generator(n.value,e.component._group.getRowCount(),e.component._group.getData(),e.component),o.colSpan=n.width,o.innerHTML=n.value,s.classList.add("tabulator-print-table-group"),s.classList.add("tabulator-group-level-"+e.indent),n.component.isVisible()&&s.classList.add("tabulator-group-visible"),this.mapElementStyles(i.firstGroup,s,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),this.mapElementStyles(i.firstGroup,o,["padding-top","padding-left","padding-right","padding-bottom"]),s.appendChild(o),s}genereateCalcElement(e,t,i){var s=this.genereateRowElement(e,t,i);return s.classList.add("tabulator-print-table-calcs"),this.mapElementStyles(i.calcRow,s,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),s}genereateRowElement(e,t,s){var o=document.createElement("tr");return o.classList.add("tabulator-print-table-row"),e.columns.forEach((n=>{if(n){var r=document.createElement("td"),a=n.component._column,l=this.table.columnManager.findColumnIndex(a),h=n.value,d={modules:{},getValue:function(){return h},getField:function(){return a.definition.field},getElement:function(){return r},getColumn:function(){return a.getComponent()},getData:function(){return e.component.getData()},getRow:function(){return e.component},getComponent:function(){return d},column:a};if((a.definition.cssClass?a.definition.cssClass.split(" "):[]).forEach((function(e){r.classList.add(e)})),this.table.modExists("format")&&!1!==this.config.formatCells)h=this.table.modules.format.formatExportValue(d,this.colVisProp);else switch(typeof h){case"object":h=null!==h?JSON.stringify(h):"";break;case"undefined":h="";break;default:h=h}h instanceof Node?r.appendChild(h):r.innerHTML=h,(s.styleCells[l]||s.firstCell)&&(this.mapElementStyles(s.styleCells[l]||s.firstCell,r,["padding-top","padding-left","padding-right","padding-bottom","border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","text-align"]),a.definition.align&&(r.style.textAlign=a.definition.align)),this.table.options.dataTree&&!1!==this.config.dataTree&&(t.treeElementField&&t.treeElementField==a.field||!t.treeElementField&&0==i)&&(e.component._row.modules.dataTree.controlEl&&r.insertBefore(e.component._row.modules.dataTree.controlEl.cloneNode(!0),r.firstChild),e.component._row.modules.dataTree.branchEl&&r.insertBefore(e.component._row.modules.dataTree.branchEl.cloneNode(!0),r.firstChild)),o.appendChild(r),d.modules.format&&d.modules.format.renderedCallback&&d.modules.format.renderedCallback(),t.rowFormatter&&!1!==this.config.formatCells&&t.rowFormatter(e.component)}})),o}genereateHTMLTable(e){var t=document.createElement("div");return t.appendChild(this.genereateTableElement(e)),t.innerHTML}getHtml(e,t,i,s){var o=this.generateExportList(i||this.table.options.htmlOutputConfig,t,e,s||"htmlOutput");return this.genereateHTMLTable(o)}mapElementStyles(e,t,i){if(this.cloneTableStyle&&e&&t){var s={"background-color":"backgroundColor",color:"fontColor",width:"width","font-weight":"fontWeight","font-family":"fontFamily","font-size":"fontSize","text-align":"textAlign","border-top":"borderTop","border-left":"borderLeft","border-right":"borderRight","border-bottom":"borderBottom","padding-top":"paddingTop","padding-left":"paddingLeft","padding-right":"paddingRight","padding-bottom":"paddingBottom"};if(window.getComputedStyle){var o=window.getComputedStyle(e);i.forEach((function(e){t.style[s[e]]=o.getPropertyValue(e)}))}}}}z.moduleName="export";var F={"=":function(e,t,i,s){return t==e},"<":function(e,t,i,s){return t":function(e,t,i,s){return t>e},">=":function(e,t,i,s){return t>=e},"!=":function(e,t,i,s){return t!=e},regex:function(e,t,i,s){return"string"==typeof e&&(e=new RegExp(e)),e.test(t)},like:function(e,t,i,s){return null==e?t===e:null!=t&&String(t).toLowerCase().indexOf(e.toLowerCase())>-1},keywords:function(e,t,i,s){var o=e.toLowerCase().split(void 0===s.separator?" ":s.separator),n=String(null==t?"":t).toLowerCase(),r=[];return o.forEach((e=>{n.includes(e)&&r.push(!0)})),s.matchAll?r.length===o.length:!!r.length},starts:function(e,t,i,s){return null==e?t===e:null!=t&&String(t).toLowerCase().startsWith(e.toLowerCase())},ends:function(e,t,i,s){return null==e?t===e:null!=t&&String(t).toLowerCase().endsWith(e.toLowerCase())},in:function(e,t,i,s){return Array.isArray(e)?!e.length||e.indexOf(t)>-1:(console.warn("Filter Error - filter value is not an array:",e),!1)}};class H extends o{constructor(e){super(e),this.filterList=[],this.headerFilters={},this.headerFilterColumns=[],this.prevHeaderFilterChangeCheck="",this.prevHeaderFilterChangeCheck="{}",this.changed=!1,this.tableInitialized=!1,this.registerTableOption("filterMode","local"),this.registerTableOption("initialFilter",!1),this.registerTableOption("initialHeaderFilter",!1),this.registerTableOption("headerFilterLiveFilterDelay",300),this.registerColumnOption("headerFilter"),this.registerColumnOption("headerFilterPlaceholder"),this.registerColumnOption("headerFilterParams"),this.registerColumnOption("headerFilterEmptyCheck"),this.registerColumnOption("headerFilterFunc"),this.registerColumnOption("headerFilterFuncParams"),this.registerColumnOption("headerFilterLiveFilter"),this.registerTableFunction("searchRows",this.searchRows.bind(this)),this.registerTableFunction("searchData",this.searchData.bind(this)),this.registerTableFunction("setFilter",this.userSetFilter.bind(this)),this.registerTableFunction("refreshFilter",this.userRefreshFilter.bind(this)),this.registerTableFunction("addFilter",this.userAddFilter.bind(this)),this.registerTableFunction("getFilters",this.getFilters.bind(this)),this.registerTableFunction("setHeaderFilterFocus",this.userSetHeaderFilterFocus.bind(this)),this.registerTableFunction("getHeaderFilterValue",this.userGetHeaderFilterValue.bind(this)),this.registerTableFunction("setHeaderFilterValue",this.userSetHeaderFilterValue.bind(this)),this.registerTableFunction("getHeaderFilters",this.getHeaderFilters.bind(this)),this.registerTableFunction("removeFilter",this.userRemoveFilter.bind(this)),this.registerTableFunction("clearFilter",this.userClearFilter.bind(this)),this.registerTableFunction("clearHeaderFilter",this.userClearHeaderFilter.bind(this)),this.registerComponentFunction("column","headerFilterFocus",this.setHeaderFilterFocus.bind(this)),this.registerComponentFunction("column","reloadHeaderFilter",this.reloadHeaderFilter.bind(this)),this.registerComponentFunction("column","getHeaderFilterValue",this.getHeaderFilterValue.bind(this)),this.registerComponentFunction("column","setHeaderFilterValue",this.setHeaderFilterValue.bind(this))}initialize(){this.subscribe("column-init",this.initializeColumnHeaderFilter.bind(this)),this.subscribe("column-width-fit-before",this.hideHeaderFilterElements.bind(this)),this.subscribe("column-width-fit-after",this.showHeaderFilterElements.bind(this)),this.subscribe("table-built",this.tableBuilt.bind(this)),"remote"===this.table.options.filterMode&&this.subscribe("data-params",this.remoteFilterParams.bind(this)),this.registerDataHandler(this.filter.bind(this),10)}tableBuilt(){this.table.options.initialFilter&&this.setFilter(this.table.options.initialFilter),this.table.options.initialHeaderFilter&&this.table.options.initialHeaderFilter.forEach((e=>{var t=this.table.columnManager.findColumn(e.field);if(!t)return console.warn("Column Filter Error - No matching column found:",e.field),!1;this.setHeaderFilterValue(t,e.value)})),this.tableInitialized=!0}remoteFilterParams(e,t,i,s){return s.filter=this.getFilters(!0,!0),s}userSetFilter(e,t,i,s){this.setFilter(e,t,i,s),this.refreshFilter()}userRefreshFilter(){this.refreshFilter()}userAddFilter(e,t,i,s){this.addFilter(e,t,i,s),this.refreshFilter()}userSetHeaderFilterFocus(e){var t=this.table.columnManager.findColumn(e);if(!t)return console.warn("Column Filter Focus Error - No matching column found:",e),!1;this.setHeaderFilterFocus(t)}userGetHeaderFilterValue(e){var t=this.table.columnManager.findColumn(e);if(t)return this.getHeaderFilterValue(t);console.warn("Column Filter Error - No matching column found:",e)}userSetHeaderFilterValue(e,t){var i=this.table.columnManager.findColumn(e);if(!i)return console.warn("Column Filter Error - No matching column found:",e),!1;this.setHeaderFilterValue(i,t)}userRemoveFilter(e,t,i){this.removeFilter(e,t,i),this.refreshFilter()}userClearFilter(e){this.clearFilter(e),this.refreshFilter()}userClearHeaderFilter(){this.clearHeaderFilter(),this.refreshFilter()}searchRows(e,t,i){return this.search("rows",e,t,i)}searchData(e,t,i){return this.search("data",e,t,i)}initializeColumnHeaderFilter(e){var t=e.definition;t.headerFilter&&(void 0!==t.headerFilterPlaceholder&&t.field&&this.module("localize").setHeaderFilterColumnPlaceholder(t.field,t.headerFilterPlaceholder),this.initializeColumn(e))}initializeColumn(e,t){var i=this,s=e.getField();e.modules.filter={success:function(t){var o,n="input"==e.modules.filter.tagType&&"text"==e.modules.filter.attrType||"textarea"==e.modules.filter.tagType?"partial":"match",r="",a="";if(void 0===e.modules.filter.prevSuccess||e.modules.filter.prevSuccess!==t){if(e.modules.filter.prevSuccess=t,e.modules.filter.emptyFunc(t))delete i.headerFilters[s];else{switch(e.modules.filter.value=t,typeof e.definition.headerFilterFunc){case"string":H.filters[e.definition.headerFilterFunc]?(r=e.definition.headerFilterFunc,o=function(i){var s=e.definition.headerFilterFuncParams||{},o=e.getFieldValue(i);return s="function"==typeof s?s(t,o,i):s,H.filters[e.definition.headerFilterFunc](t,o,i,s)}):console.warn("Header Filter Error - Matching filter function not found: ",e.definition.headerFilterFunc);break;case"function":r=o=function(i){var s=e.definition.headerFilterFuncParams||{},o=e.getFieldValue(i);return s="function"==typeof s?s(t,o,i):s,e.definition.headerFilterFunc(t,o,i,s)}}if(!o)switch(n){case"partial":o=function(i){var s=e.getFieldValue(i);return null!=s&&String(s).toLowerCase().indexOf(String(t).toLowerCase())>-1},r="like";break;default:o=function(i){return e.getFieldValue(i)==t},r="="}i.headerFilters[s]={value:t,func:o,type:r,params:{}}}e.modules.filter.value=t,a=JSON.stringify(i.headerFilters),i.prevHeaderFilterChangeCheck!==a&&(i.prevHeaderFilterChangeCheck=a,i.trackChanges(),i.refreshFilter())}return!0},attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(e)}generateHeaderFilterElement(e,t,i){var s,o,n,r,a,l,h,d=this,c=e.modules.filter.success,u=e.getField();if(e.modules.filter.value=t,e.modules.filter.headerElement&&e.modules.filter.headerElement.parentNode&&e.contentElement.removeChild(e.modules.filter.headerElement.parentNode),u){switch(e.modules.filter.emptyFunc=e.definition.headerFilterEmptyCheck||function(e){return!e&&"0"!==e&&0!==e},(s=document.createElement("div")).classList.add("tabulator-header-filter"),typeof e.definition.headerFilter){case"string":d.table.modules.edit.editors[e.definition.headerFilter]?(o=d.table.modules.edit.editors[e.definition.headerFilter],"tick"!==e.definition.headerFilter&&"tickCross"!==e.definition.headerFilter||e.definition.headerFilterEmptyCheck||(e.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):console.warn("Filter Error - Cannot build header filter, No such editor found: ",e.definition.editor);break;case"function":o=e.definition.headerFilter;break;case"boolean":e.modules.edit&&e.modules.edit.editor?o=e.modules.edit.editor:e.definition.formatter&&d.table.modules.edit.editors[e.definition.formatter]?(o=d.table.modules.edit.editors[e.definition.formatter],"tick"!==e.definition.formatter&&"tickCross"!==e.definition.formatter||e.definition.headerFilterEmptyCheck||(e.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):o=d.table.modules.edit.editors.input}if(o){if(r={getValue:function(){return void 0!==t?t:""},getField:function(){return e.definition.field},getElement:function(){return s},getColumn:function(){return e.getComponent()},getRow:function(){return{normalizeHeight:function(){}}}},h="function"==typeof(h=e.definition.headerFilterParams||{})?h.call(d.table,r):h,!(n=o.call(this.table.modules.edit,r,(function(){}),c,(function(){}),h)))return void console.warn("Filter Error - Cannot add filter to "+u+" column, editor returned a value of false");if(!(n instanceof Node))return void console.warn("Filter Error - Cannot add filter to "+u+" column, editor should return an instance of Node, the editor returned:",n);u?d.langBind("headerFilters|columns|"+e.definition.field,(function(e){n.setAttribute("placeholder",void 0!==e&&e?e:d.langText("headerFilters|default"))})):d.langBind("headerFilters|default",(function(e){n.setAttribute("placeholder",e)})),n.addEventListener("click",(function(e){e.stopPropagation(),n.focus()})),n.addEventListener("focus",(e=>{var t=this.table.columnManager.element.scrollLeft;t!==this.table.rowManager.element.scrollLeft+parseInt(this.table.columnManager.element.style.marginLeft)&&(this.table.rowManager.scrollHorizontal(t),this.table.columnManager.scrollHorizontal(t))})),a=!1,l=function(e){a&&clearTimeout(a),a=setTimeout((function(){c(n.value)}),d.table.options.headerFilterLiveFilterDelay)},e.modules.filter.headerElement=n,e.modules.filter.attrType=n.hasAttribute("type")?n.getAttribute("type").toLowerCase():"",e.modules.filter.tagType=n.tagName.toLowerCase(),!1!==e.definition.headerFilterLiveFilter&&("autocomplete"!==e.definition.headerFilter&&"tickCross"!==e.definition.headerFilter&&("autocomplete"!==e.definition.editor&&"tickCross"!==e.definition.editor||!0!==e.definition.headerFilter)&&(n.addEventListener("keyup",l),n.addEventListener("search",l),"number"==e.modules.filter.attrType&&n.addEventListener("change",(function(e){c(n.value)})),"text"==e.modules.filter.attrType&&"ie"!==this.table.browser&&n.setAttribute("type","search")),"input"!=e.modules.filter.tagType&&"select"!=e.modules.filter.tagType&&"textarea"!=e.modules.filter.tagType||n.addEventListener("mousedown",(function(e){e.stopPropagation()}))),s.appendChild(n),e.contentElement.appendChild(s),i||d.headerFilterColumns.push(e)}}else console.warn("Filter Error - Cannot add header filter, column has no field set:",e.definition.title)}hideHeaderFilterElements(){this.headerFilterColumns.forEach((function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="none")}))}showHeaderFilterElements(){this.headerFilterColumns.forEach((function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="")}))}setHeaderFilterFocus(e){e.modules.filter&&e.modules.filter.headerElement?e.modules.filter.headerElement.focus():console.warn("Column Filter Focus Error - No header filter set on column:",e.getField())}getHeaderFilterValue(e){if(e.modules.filter&&e.modules.filter.headerElement)return e.modules.filter.value;console.warn("Column Filter Error - No header filter set on column:",e.getField())}setHeaderFilterValue(e,t){e&&(e.modules.filter&&e.modules.filter.headerElement?(this.generateHeaderFilterElement(e,t,!0),e.modules.filter.success(t)):console.warn("Column Filter Error - No header filter set on column:",e.getField()))}reloadHeaderFilter(e){e&&(e.modules.filter&&e.modules.filter.headerElement?this.generateHeaderFilterElement(e,e.modules.filter.value,!0):console.warn("Column Filter Error - No header filter set on column:",e.getField()))}refreshFilter(){this.tableInitialized&&("remote"===this.table.options.filterMode?this.reloadData(null,!1,!1):this.refreshData(!0))}trackChanges(){this.changed=!0,this.dispatch("filter-changed")}hasChanged(){var e=this.changed;return this.changed=!1,e}setFilter(e,t,i,s){this.filterList=[],Array.isArray(e)||(e=[{field:e,type:t,value:i,params:s}]),this.addFilter(e)}addFilter(e,t,i,s){var o=!1;Array.isArray(e)||(e=[{field:e,type:t,value:i,params:s}]),e.forEach((e=>{(e=this.findFilter(e))&&(this.filterList.push(e),o=!0)})),o&&this.trackChanges()}findFilter(e){var t;if(Array.isArray(e))return this.findSubFilters(e);var i=!1;return"function"==typeof e.field?i=function(t){return e.field(t,e.type||{})}:H.filters[e.type]?i=(t=this.table.columnManager.getColumnByField(e.field))?function(i){return H.filters[e.type](e.value,t.getFieldValue(i),i,e.params||{})}:function(t){return H.filters[e.type](e.value,t[e.field],t,e.params||{})}:console.warn("Filter Error - No such filter type found, ignoring: ",e.type),e.func=i,!!e.func&&e}findSubFilters(e){var t=[];return e.forEach((e=>{(e=this.findFilter(e))&&t.push(e)})),!!t.length&&t}getFilters(e,t){var i=[];return e&&(i=this.getHeaderFilters()),t&&i.forEach((function(e){"function"==typeof e.type&&(e.type="function")})),i=i.concat(this.filtersToArray(this.filterList,t))}filtersToArray(e,t){var i=[];return e.forEach((e=>{var s;Array.isArray(e)?i.push(this.filtersToArray(e,t)):(s={field:e.field,type:e.type,value:e.value},t&&"function"==typeof s.type&&(s.type="function"),i.push(s))})),i}getHeaderFilters(){var e=[];for(var t in this.headerFilters)e.push({field:t,type:this.headerFilters[t].type,value:this.headerFilters[t].value});return e}removeFilter(e,t,i){Array.isArray(e)||(e=[{field:e,type:t,value:i}]),e.forEach((e=>{var t=-1;(t="object"==typeof e.field?this.filterList.findIndex((t=>e===t)):this.filterList.findIndex((t=>e.field===t.field&&e.type===t.type&&e.value===t.value)))>-1?this.filterList.splice(t,1):console.warn("Filter Error - No matching filter type found, ignoring: ",e.type)})),this.trackChanges()}clearFilter(e){this.filterList=[],e&&this.clearHeaderFilter(),this.trackChanges()}clearHeaderFilter(){this.headerFilters={},this.prevHeaderFilterChangeCheck="{}",this.headerFilterColumns.forEach((e=>{void 0!==e.modules.filter.value&&delete e.modules.filter.value,e.modules.filter.prevSuccess=void 0,this.reloadHeaderFilter(e)})),this.trackChanges()}search(e,t,i,s){var o=[],n=[];return Array.isArray(t)||(t=[{field:t,type:i,value:s}]),t.forEach((e=>{(e=this.findFilter(e))&&n.push(e)})),this.table.rowManager.rows.forEach((t=>{var i=!0;n.forEach((e=>{this.filterRecurse(e,t.getData())||(i=!1)})),i&&o.push("data"===e?t.getData("data"):t.getComponent())})),o}filter(e,t){var i=[],s=[];return this.subscribedExternal("dataFiltering")&&this.dispatchExternal("dataFiltering",this.getFilters(!0)),"remote"!==this.table.options.filterMode&&(this.filterList.length||Object.keys(this.headerFilters).length)?e.forEach((e=>{this.filterRow(e)&&i.push(e)})):i=e.slice(0),this.subscribedExternal("dataFiltered")&&(i.forEach((e=>{s.push(e.getComponent())})),this.dispatchExternal("dataFiltered",this.getFilters(!0),s)),i}filterRow(e,t){var i=!0,s=e.getData();for(var o in this.filterList.forEach((e=>{this.filterRecurse(e,s)||(i=!1)})),this.headerFilters)this.headerFilters[o].func(s)||(i=!1);return i}filterRecurse(e,t){var i=!1;return Array.isArray(e)?e.forEach((e=>{this.filterRecurse(e,t)&&(i=!0)})):i=e.func(t),i}}H.moduleName="filter",H.filters=F;var _={plaintext:function(e,t,i){return this.emptyToSpace(this.sanitizeHTML(e.getValue()))},html:function(e,t,i){return e.getValue()},textarea:function(e,t,i){return e.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(e.getValue()))},money:function(e,t,i){var s,o,n,r,a=parseFloat(e.getValue()),l="",h=t.decimal||".",d=t.thousand||",",c=t.negativeSign||"-",u=t.symbol||"",m=!!t.symbolAfter,p=void 0!==t.precision?t.precision:2;if(isNaN(a))return this.emptyToSpace(this.sanitizeHTML(e.getValue()));if(a<0&&(a=Math.abs(a),l=c),s=!1!==p?a.toFixed(p):a,o=(s=String(s).split("."))[0],n=s.length>1?h+s[1]:"",!1!==t.thousand)for(r=/(\d+)(\d{3})/;r.test(o);)o=o.replace(r,"$1"+d+"$2");return m?l+o+n+u:l+u+o+n},link:function(e,t,i){var s,o=e.getValue(),n=t.urlPrefix||"",r=t.download,a=o,l=document.createElement("a");if(t.labelField&&(s=e.getData(),a=function e(t,i){var s=i[t.shift()];return t.length&&"object"==typeof s?e(t,s):s}(t.labelField.split(this.table.options.nestedFieldSeparator),s)),t.label)switch(typeof t.label){case"string":a=t.label;break;case"function":a=t.label(e)}if(a){if(t.urlField&&(o=(s=e.getData())[t.urlField]),t.url)switch(typeof t.url){case"string":o=t.url;break;case"function":o=t.url(e)}return l.setAttribute("href",n+o),t.target&&l.setAttribute("target",t.target),t.download&&(r="function"==typeof r?r(e):!0===r?"":r,l.setAttribute("download",r)),l.innerHTML=this.emptyToSpace(this.sanitizeHTML(a)),l}return" "},image:function(e,t,i){var s=document.createElement("img"),o=e.getValue();switch(t.urlPrefix&&(o=t.urlPrefix+e.getValue()),t.urlSuffix&&(o+=t.urlSuffix),s.setAttribute("src",o),typeof t.height){case"number":s.style.height=t.height+"px";break;case"string":s.style.height=t.height}switch(typeof t.width){case"number":s.style.width=t.width+"px";break;case"string":s.style.width=t.width}return s.addEventListener("load",(function(){e.getRow().normalizeHeight()})),s},tickCross:function(e,t,i){var s=e.getValue(),o=e.getElement(),n=t.allowEmpty,r=t.allowTruthy,a=Object.keys(t).includes("trueValue"),l=void 0!==t.tickElement?t.tickElement:'',h=void 0!==t.crossElement?t.crossElement:'';return a&&s===t.trueValue||!a&&(r&&s||!0===s||"true"===s||"True"===s||1===s||"1"===s)?(o.setAttribute("aria-checked",!0),l||""):!n||"null"!==s&&""!==s&&null!=s?(o.setAttribute("aria-checked",!1),h||""):(o.setAttribute("aria-checked","mixed"),"")},datetime:function(e,t,i){var s,o=window.DateTime||luxon.DateTime,n=t.inputFormat||"yyyy-MM-dd HH:mm:ss",r=t.outputFormat||"dd/MM/yyyy HH:mm:ss",a=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",l=e.getValue();if(void 0!==o)return(s=o.isDateTime(l)?l:"iso"===n?o.fromISO(String(l)):o.fromFormat(String(l),n)).isValid?(t.timezone&&(s=s.setZone(t.timezone)),s.toFormat(r)):!0!==a&&l?"function"==typeof a?a(l):a:l;console.error("Format Error - 'datetime' formatter is dependant on luxon.js")},datetimediff:function(e,t,i){var s,o=window.DateTime||luxon.DateTime,n=t.inputFormat||"yyyy-MM-dd HH:mm:ss",r=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",a=void 0!==t.suffix&&t.suffix,l=void 0!==t.unit?t.unit:"days",h=void 0!==t.humanize&&t.humanize,d=void 0!==t.date?t.date:o.now(),c=e.getValue();if(void 0!==o)return(s=o.isDateTime(c)?c:"iso"===n?o.fromISO(String(c)):o.fromFormat(String(c),n)).isValid?h?s.diff(d,l).toHuman()+(a?" "+a:""):parseInt(s.diff(d,l)[l])+(a?" "+a:""):!0===r?c:"function"==typeof r?r(c):r;console.error("Format Error - 'datetimediff' formatter is dependant on luxon.js")},lookup:function(e,t,i){var s=e.getValue();return void 0===t[s]?(console.warn("Missing display value for "+s),s):t[s]},star:function(e,t,i){var s=e.getValue(),o=e.getElement(),n=t&&t.stars?t.stars:5,r=document.createElement("span"),a=document.createElementNS("http://www.w3.org/2000/svg","svg");r.style.verticalAlign="middle",a.setAttribute("width","14"),a.setAttribute("height","14"),a.setAttribute("viewBox","0 0 512 512"),a.setAttribute("xml:space","preserve"),a.style.padding="0 1px",s=s&&!isNaN(s)?parseInt(s):0,s=Math.max(0,Math.min(s,n));for(var l=1;l<=n;l++){var h=a.cloneNode(!0);h.innerHTML=l<=s?'':'',r.appendChild(h)}return o.style.whiteSpace="nowrap",o.style.overflow="hidden",o.style.textOverflow="ellipsis",o.setAttribute("aria-label",s),r},traffic:function(e,t,i){var s,o,n=this.sanitizeHTML(e.getValue())||0,r=document.createElement("span"),a=t&&t.max?t.max:100,l=t&&t.min?t.min:0,h=t&&void 0!==t.color?t.color:["red","orange","green"],d="#666666";if(!isNaN(n)&&void 0!==e.getValue()){switch(r.classList.add("tabulator-traffic-light"),o=parseFloat(n)<=a?parseFloat(n):a,o=parseFloat(o)>=l?parseFloat(o):l,s=(a-l)/100,o=Math.round((o-l)/s),typeof h){case"string":d=h;break;case"function":d=h(n);break;case"object":if(Array.isArray(h)){var c=100/h.length,u=Math.floor(o/c);u=Math.min(u,h.length-1),d=h[u=Math.max(u,0)];break}}return r.style.backgroundColor=d,r}},progress:function(e,t,i){var s,o,n,r,a,l=this.sanitizeHTML(e.getValue())||0,h=e.getElement(),d=t&&t.max?t.max:100,c=t&&t.min?t.min:0,u=t&&t.legendAlign?t.legendAlign:"center";switch(o=parseFloat(l)<=d?parseFloat(l):d,o=parseFloat(o)>=c?parseFloat(o):c,s=(d-c)/100,o=Math.round((o-c)/s),typeof t.color){case"string":n=t.color;break;case"function":n=t.color(l);break;case"object":if(Array.isArray(t.color)){var m=100/t.color.length,g=Math.floor(o/m);g=Math.min(g,t.color.length-1),g=Math.max(g,0),n=t.color[g];break}default:n="#2DC214"}switch(typeof t.legend){case"string":r=t.legend;break;case"function":r=t.legend(l);break;case"boolean":r=l;break;default:r=!1}switch(typeof t.legendColor){case"string":a=t.legendColor;break;case"function":a=t.legendColor(l);break;case"object":if(Array.isArray(t.legendColor)){m=100/t.legendColor.length,g=Math.floor(o/m);g=Math.min(g,t.legendColor.length-1),g=Math.max(g,0),a=t.legendColor[g]}break;default:a="#000"}h.style.minWidth="30px",h.style.position="relative",h.setAttribute("aria-label",o);var b=document.createElement("div");b.style.display="inline-block",b.style.position="absolute",b.style.width=o+"%",b.style.backgroundColor=n,b.style.height="100%",b.setAttribute("data-max",d),b.setAttribute("data-min",c);var f=document.createElement("div");if(f.style.position="relative",f.style.width="100%",f.style.height="100%",r){var v=document.createElement("div");v.style.position="absolute",v.style.top=0,v.style.left=0,v.style.textAlign=u,v.style.width="100%",v.style.color=a,v.innerHTML=r}return i((function(){if(!(e instanceof p)){var t=document.createElement("div");t.style.position="absolute",t.style.top="4px",t.style.bottom="4px",t.style.left="4px",t.style.right="4px",h.appendChild(t),h=t}h.appendChild(f),f.appendChild(b),r&&f.appendChild(v)})),""},color:function(e,t,i){return e.getElement().style.backgroundColor=this.sanitizeHTML(e.getValue()),""},buttonTick:function(e,t,i){return''},buttonCross:function(e,t,i){return''},rownum:function(e,t,i){return this.table.rowManager.activeRows.indexOf(e.getRow()._getSelf())+1||""},handle:function(e,t,i){return e.getElement().classList.add("tabulator-row-handle"),"
"},responsiveCollapse:function(e,t,i){var s=document.createElement("div"),o=e.getRow()._row.modules.responsiveLayout;function n(e){var t=o.element;o.open=e,t&&(o.open?(s.classList.add("open"),t.style.display=""):(s.classList.remove("open"),t.style.display="none"))}return s.classList.add("tabulator-responsive-collapse-toggle"),s.innerHTML="+-",e.getElement().classList.add("tabulator-row-handle"),s.addEventListener("click",(function(e){e.stopImmediatePropagation(),n(!o.open)})),n(o.open),s},rowSelection:function(e,t,i){var s=document.createElement("input"),o=!1;if(s.type="checkbox",s.setAttribute("aria-label","Select Row"),this.table.modExists("selectRow",!0))if(s.addEventListener("click",(e=>{e.stopPropagation()})),"function"==typeof e.getRow){var n=e.getRow();n instanceof w?(s.addEventListener("change",(e=>{"click"===this.table.options.selectableRangeMode&&o?o=!1:n.toggleSelect()})),"click"===this.table.options.selectableRangeMode&&s.addEventListener("click",(e=>{o=!0,this.table.modules.selectRow.handleComplexRowClick(n._row,e)})),s.checked=n.isSelected&&n.isSelected(),this.table.modules.selectRow.registerRowSelectCheckbox(n,s)):s=""}else s.addEventListener("change",(e=>{this.table.modules.selectRow.selectedRows.length?this.table.deselectRow():this.table.selectRow(t.rowRange)})),this.table.modules.selectRow.registerHeaderSelectCheckbox(s);return s}};class O extends o{constructor(e){super(e),this.registerColumnOption("formatter"),this.registerColumnOption("formatterParams"),this.registerColumnOption("formatterPrint"),this.registerColumnOption("formatterPrintParams"),this.registerColumnOption("formatterClipboard"),this.registerColumnOption("formatterClipboardParams"),this.registerColumnOption("formatterHtmlOutput"),this.registerColumnOption("formatterHtmlOutputParams"),this.registerColumnOption("titleFormatter"),this.registerColumnOption("titleFormatterParams")}initialize(){this.subscribe("cell-format",this.formatValue.bind(this)),this.subscribe("cell-rendered",this.cellRendered.bind(this)),this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("column-format",this.formatHeader.bind(this))}initializeColumn(e){e.modules.format=this.lookupFormatter(e,""),void 0!==e.definition.formatterPrint&&(e.modules.format.print=this.lookupFormatter(e,"Print")),void 0!==e.definition.formatterClipboard&&(e.modules.format.clipboard=this.lookupFormatter(e,"Clipboard")),void 0!==e.definition.formatterHtmlOutput&&(e.modules.format.htmlOutput=this.lookupFormatter(e,"HtmlOutput"))}lookupFormatter(e,t){var i={params:e.definition["formatter"+t+"Params"]||{}},s=e.definition["formatter"+t];switch(typeof s){case"string":O.formatters[s]?i.formatter=O.formatters[s]:(console.warn("Formatter Error - No such formatter found: ",s),i.formatter=O.formatters.plaintext);break;case"function":i.formatter=s;break;default:i.formatter=O.formatters.plaintext}return i}cellRendered(e){e.modules.format&&e.modules.format.renderedCallback&&!e.modules.format.rendered&&(e.modules.format.renderedCallback(),e.modules.format.rendered=!0)}formatHeader(e,t,i){var s,o,n,r;return e.definition.titleFormatter?(s=this.getFormatter(e.definition.titleFormatter),n=t=>{e.titleFormatterRendered=t},r={getValue:function(){return t},getElement:function(){return i}},o="function"==typeof(o=e.definition.titleFormatterParams||{})?o():o,s.call(this,r,o,n)):t}formatValue(e){var t=e.getComponent(),i="function"==typeof e.column.modules.format.params?e.column.modules.format.params(t):e.column.modules.format.params;return e.column.modules.format.formatter.call(this,t,i,(function(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t,e.modules.format.rendered=!1}))}formatExportValue(e,t){var i,s=e.column.modules.format[t];if(s){return i="function"==typeof s.params?s.params(component):s.params,s.formatter.call(this,e.getComponent(),i,(function(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t,e.modules.format.rendered=!1}))}return this.formatValue(e)}sanitizeHTML(e){if(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(e).replace(/[&<>"'`=\/]/g,(function(e){return t[e]}))}return e}emptyToSpace(e){return null==e||""===e?" ":e}getFormatter(e){switch(typeof e){case"string":O.formatters[e]?e=O.formatters[e]:(console.warn("Formatter Error - No such formatter found: ",e),e=O.formatters.plaintext);break;case"function":e=e;break;default:e=O.formatters.plaintext}return e}}O.moduleName="format",O.formatters=_;class A extends o{constructor(e){super(e),this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightPadding=0,this.initializationMode="left",this.active=!1,this.blocked=!0,this.registerColumnOption("frozen")}reset(){this.initializationMode="left",this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightMargin=0,this.active=!1,this.table.columnManager.headersElement.style.marginLeft=0,this.table.columnManager.element.style.paddingRight=0}initialize(){this.subscribe("cell-layout",this.layoutCell.bind(this)),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-width",this.layout.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("table-layout",this.layout.bind(this)),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("columns-loading",this.reset.bind(this)),this.subscribe("column-add",this.reinitializeColumns.bind(this)),this.subscribe("column-delete",this.reinitializeColumns.bind(this)),this.subscribe("table-redraw",this.layout.bind(this)),this.subscribe("layout-refreshing",this.blockLayout.bind(this)),this.subscribe("layout-refreshed",this.unblockLayout.bind(this))}blockLayout(){this.blocked=!0}unblockLayout(){this.blocked=!1}layoutCell(e){this.layoutElement(e.element,e.column)}reinitializeColumns(){this.reset(),this.table.columnManager.columnsByIndex.forEach((e=>{this.initializeColumn(e)}))}initializeColumn(e){var t={margin:0,edge:!1};e.isGroup||(this.frozenCheck(e)?(t.position=this.initializationMode,"left"==this.initializationMode?this.leftColumns.push(e):this.rightColumns.unshift(e),this.active=!0,e.modules.frozen=t):this.initializationMode="right")}frozenCheck(e){return e.parent.isGroup&&e.definition.frozen&&console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups"),e.parent.isGroup?this.frozenCheck(e.parent):e.definition.frozen}scrollHorizontal(){this.active&&(this.calcMargins(!0),this.layoutColumnPosition(),this.layoutCalcRows(),this.reinitializeRows())}calcMargins(e){e||(this.leftMargin=this._calcSpace(this.leftColumns,this.leftColumns.length)+"px",this.rightMargin=this._calcSpace(this.rightColumns,this.rightColumns.length)+"px",this.table.rowManager.tableElement.style.marginRight=this.rightMargin),this.rightPadding=this.table.rowManager.element.clientWidth+this.table.columnManager.scrollLeft}layoutCalcRows(){this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&this.table.modules.columnCalcs.topRow&&this.layoutRow(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&this.table.modules.columnCalcs.botRow&&this.layoutRow(this.table.modules.columnCalcs.botRow),this.table.modExists("groupRows")&&this.layoutGroupCalcs(this.table.modules.groupRows.getGroups()))}layoutGroupCalcs(e){e.forEach((e=>{e.calcs.top&&this.layoutRow(e.calcs.top),e.calcs.bottom&&this.layoutRow(e.calcs.bottom),e.groupList&&e.groupList.length&&this.layoutGroupCalcs(e.groupList&&e.groupList)}))}layoutColumnPosition(e){var t=[],i=0,s=0;this.table.columnManager.headersElement.style.marginLeft=this.leftMargin,this.table.columnManager.element.style.paddingRight=this.rightMargin,this.leftColumns.forEach(((s,o)=>{if(s.modules.frozen.marginValue=i+this.table.columnManager.scrollLeft,s.modules.frozen.margin=s.modules.frozen.marginValue+"px",s.visible&&(i+=s.getWidth()),o==this.leftColumns.length-1?s.modules.frozen.edge=!0:s.modules.frozen.edge=!1,s.parent.isGroup){var n=this.getColGroupParentElement(s);t.includes(n)||(this.layoutElement(n,s),t.push(n)),s.modules.frozen.edge&&n.classList.add("tabulator-frozen-"+s.modules.frozen.position)}else this.layoutElement(s.getElement(),s);e&&s.cells.forEach((e=>{this.layoutElement(e.getElement(!0),s)}))})),this.rightColumns.forEach(((t,i)=>{t.visible&&(s+=t.getWidth()),t.modules.frozen.marginValue=this.rightPadding-s,t.modules.frozen.margin=t.modules.frozen.marginValue+"px",i==this.rightColumns.length-1?t.modules.frozen.edge=!0:t.modules.frozen.edge=!1,t.parent.isGroup?this.layoutElement(this.getColGroupParentElement(t),t):this.layoutElement(t.getElement(),t),e&&t.cells.forEach((e=>{this.layoutElement(e.getElement(!0),t)}))}))}getColGroupParentElement(e){return e.parent.isGroup?this.getColGroupParentElement(e.parent):e.getElement()}layout(){this.active&&!this.blocked&&(this.calcMargins(),this.layoutColumnPosition(),this.reinitializeRows(),this.layoutCalcRows())}reinitializeRows(){var e=this.table.rowManager.getVisibleRows();this.table.rowManager.getRows().filter((t=>!e.includes(t))).forEach((e=>{e.deinitialize()})),e.forEach((e=>{"row"===e.type&&this.layoutRow(e)}))}layoutRow(e){e.getElement().style.paddingLeft=this.leftMargin,"fitDataFill"===this.table.options.layout&&this.rightColumns.length&&(this.table.rowManager.getTableElement().style.minWidth="calc(100% - "+this.rightMargin+")"),this.leftColumns.forEach((t=>{var i=e.getCell(t);i&&this.layoutElement(i.getElement(!0),t)})),this.rightColumns.forEach((t=>{var i=e.getCell(t);i&&this.layoutElement(i.getElement(!0),t)}))}layoutElement(e,t){t.modules.frozen&&(e.style.position="absolute",e.style.left=t.modules.frozen.margin,e.classList.add("tabulator-frozen"),t.modules.frozen.edge&&e.classList.add("tabulator-frozen-"+t.modules.frozen.position))}_calcSpace(e,t){var i=0;for(let s=0;s-1}isFrozen(){return!!this.rows.length}visibleRows(e,t){return this.rows.forEach((e=>{t.push(e)})),t}getRows(e){var t=e.slice(0);return this.rows.forEach((function(e){var i=t.indexOf(e);i>-1&&t.splice(i,1)})),t}freezeRow(e){e.modules.frozen?console.warn("Freeze Error - Row is already frozen"):(e.modules.frozen=!0,this.topElement.appendChild(e.getElement()),e.initialize(),e.normalizeHeight(),this.table.rowManager.adjustTableSize(),this.rows.push(e),this.refreshData(!1,"display"),this.styleRows())}unfreezeRow(e){this.rows.indexOf(e);e.modules.frozen?(e.modules.frozen=!1,this.detachRow(e),this.table.rowManager.adjustTableSize(),this.refreshData(!1,"display"),this.rows.length&&this.styleRows()):console.warn("Freeze Error - Row is already unfrozen")}detachRow(e){var t=this.rows.indexOf(e);if(t>-1){var i=e.getElement();i.parentNode&&i.parentNode.removeChild(i),this.rows.splice(t,1)}}styleRows(e){this.rows.forEach(((e,t)=>{this.table.rowManager.styleRow(e,t)}))}}B.moduleName="frozenRows";class I{constructor(e){return this._group=e,this.type="GroupComponent",new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._group.groupManager.table.componentFunctionBinder.handle("row",e._group,t)}})}getKey(){return this._group.key}getField(){return this._group.field}getElement(){return this._group.element}getRows(){return this._group.getRows(!0)}getSubGroups(){return this._group.getSubGroups(!0)}getParentGroup(){return!!this._group.parent&&this._group.parent.getComponent()}isVisible(){return this._group.visible}show(){this._group.show()}hide(){this._group.hide()}toggle(){this._group.toggleVisibility()}_getSelf(){return this._group}getTable(){return this._group.groupManager.table}}class N{constructor(e,t,i,s,o,n,r){this.groupManager=e,this.parent=t,this.key=s,this.level=i,this.field=o,this.hasSubGroups=i{e.modules&&delete e.modules.group})),this.element=!1,this.arrowElement=!1,this.elementContents=!1}createElements(){var e=document.createElement("div");e.classList.add("tabulator-arrow"),this.element=document.createElement("div"),this.element.classList.add("tabulator-row"),this.element.classList.add("tabulator-group"),this.element.classList.add("tabulator-group-level-"+this.level),this.element.setAttribute("role","rowgroup"),this.arrowElement=document.createElement("div"),this.arrowElement.classList.add("tabulator-group-toggle"),this.arrowElement.appendChild(e),!1!==this.groupManager.table.options.movableRows&&this.groupManager.table.modExists("moveRow")&&this.groupManager.table.modules.moveRow.initializeGroupHeader(this)}createValueGroups(){var e=this.level+1;this.groupManager.allowedValues&&this.groupManager.allowedValues[e]&&this.groupManager.allowedValues[e].forEach((t=>{this._createGroup(t,e)}))}addBindings(){this.groupManager.table.options.groupToggleElement&&("arrow"==this.groupManager.table.options.groupToggleElement?this.arrowElement:this.element).addEventListener("click",(e=>{e.stopPropagation(),e.stopImmediatePropagation(),this.toggleVisibility()}))}_createGroup(e,t){var i=t+"_"+e,s=new N(this.groupManager,this,t,e,this.groupManager.groupIDLookups[t].field,this.groupManager.headerGenerator[t]||this.groupManager.headerGenerator[0],!!this.old&&this.old.groups[i]);this.groups[i]=s,this.groupList.push(s)}_addRowToGroup(e){var t=this.level+1;if(this.hasSubGroups){var i=this.groupManager.groupIDLookups[t].func(e.getData()),s=t+"_"+i;this.groupManager.allowedValues&&this.groupManager.allowedValues[t]?this.groups[s]&&this.groups[s].addRow(e):(this.groups[s]||this._createGroup(i,t),this.groups[s].addRow(e))}}_addRow(e){this.rows.push(e),e.modules.group=this}insertRow(e,t,i){var s=this.conformRowData({});e.updateData(s);var o=this.rows.indexOf(t);o>-1?i?this.rows.splice(o+1,0,e):this.rows.splice(o,0,e):i?this.rows.push(e):this.rows.unshift(e),e.modules.group=this,this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this),this.groupManager.updateGroupRows(!0)}scrollHeader(e){this.arrowElement&&(this.arrowElement.style.marginLeft=e,this.groupList.forEach((function(t){t.scrollHeader(e)})))}getRowIndex(e){}conformRowData(e){return this.field?e[this.field]=this.key:console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"),this.parent&&(e=this.parent.conformRowData(e)),e}removeRow(e){var t=this.rows.indexOf(e),i=e.getElement();t>-1&&this.rows.splice(t,1),this.groupManager.table.options.groupValues||this.rows.length?(i.parentNode&&i.parentNode.removeChild(i),this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this)):(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this),this.groupManager.updateGroupRows(!0))}removeGroup(e){var t,i=e.level+"_"+e.key;this.groups[i]&&(delete this.groups[i],(t=this.groupList.indexOf(e))>-1&&this.groupList.splice(t,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))}getHeadersAndRows(e){var t=[];return t.push(this),this._visSet(),this.visible?this.groupList.length?this.groupList.forEach((function(i){t=t.concat(i.getHeadersAndRows(e))})):(!e&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),t.push(this.calcs.top)),t=t.concat(this.rows),!e&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),t.push(this.calcs.bottom))):this.groupList.length||"table"==this.groupManager.table.options.columnCalcs||this.groupManager.table.modExists("columnCalcs")&&(!e&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),t.push(this.calcs.top))),!e&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),t.push(this.calcs.bottom)))),t}getData(e,t){var i=[];return this._visSet(),(!e||e&&this.visible)&&this.rows.forEach((e=>{i.push(e.getData(t||"data"))})),i}getRowCount(){var e=0;return this.groupList.length?this.groupList.forEach((t=>{e+=t.getRowCount()})):e=this.rows.length,e}toggleVisibility(){this.visible?this.hide():this.show()}hide(){this.visible=!1,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination?this.groupManager.updateGroupRows(!0):(this.element.classList.remove("tabulator-group-visible"),this.groupList.length?this.groupList.forEach((e=>{e.getHeadersAndRows().forEach((e=>{e.detachElement()}))})):this.rows.forEach((e=>{var t=e.getElement();t.parentNode.removeChild(t)})),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()),this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!1)}show(){if(this.visible=!0,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination)this.groupManager.updateGroupRows(!0);else{this.element.classList.add("tabulator-group-visible");var e=this.generateElement();this.groupList.length?this.groupList.forEach((t=>{t.getHeadersAndRows().forEach((t=>{var i=t.getElement();e.parentNode.insertBefore(i,e.nextSibling),t.initialize(),e=i}))})):this.rows.forEach((t=>{var i=t.getElement();e.parentNode.insertBefore(i,e.nextSibling),t.initialize(),e=i})),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()}this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!0)}_visSet(){var e=[];"function"==typeof this.visible&&(this.rows.forEach((function(t){e.push(t.getData())})),this.visible=this.visible(this.key,this.getRowCount(),e,this.getComponent()))}getRowGroup(e){var t=!1;return this.groupList.length?this.groupList.forEach((function(i){var s=i.getRowGroup(e);s&&(t=s)})):this.rows.find((function(t){return t===e}))&&(t=this),t}getSubGroups(e){var t=[];return this.groupList.forEach((function(i){t.push(e?i.getComponent():i)})),t}getRows(e){var t=[];return this.rows.forEach((function(i){t.push(e?i.getComponent():i)})),t}generateGroupHeaderContents(){var e=[];for(this.rows.forEach((function(t){e.push(t.getData())})),this.elementContents=this.generator(this.key,this.getRowCount(),e,this.getComponent());this.element.firstChild;)this.element.removeChild(this.element.firstChild);"string"==typeof this.elementContents?this.element.innerHTML=this.elementContents:this.element.appendChild(this.elementContents),this.element.insertBefore(this.arrowElement,this.element.firstChild)}getPath(e=[]){return e.unshift(this.key),this.parent&&this.parent.getPath(e),e}getElement(){return this.elementContents?this.element:this.generateElement()}generateElement(){this.addBindings=!1,this._visSet(),this.visible?this.element.classList.add("tabulator-group-visible"):this.element.classList.remove("tabulator-group-visible");for(var e=0;ei.length&&console.warn("Error creating group headers, groupHeader array is shorter than groupBy array"),this.headerGenerator=[function(){return""}],this.startOpen=[function(){return!1}],this.langBind("groups|item",((e,t)=>{this.headerGenerator[0]=(i,s,o)=>(void 0===i?"":i)+"("+s+" "+(1===s?e:t.groups.items)+")"})),this.groupIDLookups=[],Array.isArray(e)||e)this.table.modExists("columnCalcs")&&"table"!=this.table.options.columnCalcs&&"both"!=this.table.options.columnCalcs&&this.table.modules.columnCalcs.removeCalcs();else if(this.table.modExists("columnCalcs")&&"group"!=this.table.options.columnCalcs)this.table.columnManager.getRealColumns().forEach((e=>{e.definition.topCalc&&this.table.modules.columnCalcs.initializeTopRow(),e.definition.bottomCalc&&this.table.modules.columnCalcs.initializeBottomRow()}));Array.isArray(e)||(e=[e]),e.forEach(((e,t)=>{var i,s;i="function"==typeof e?e:(s=this.table.columnManager.getColumnByField(e))?function(e){return s.getFieldValue(e)}:function(t){return t[e]},this.groupIDLookups.push({field:"function"!=typeof e&&e,func:i,values:!!this.allowedValues&&this.allowedValues[t]})})),t&&(Array.isArray(t)||(t=[t]),t.forEach((e=>{})),this.startOpen=t),i&&(this.headerGenerator=Array.isArray(i)?i:[i])}}rowSample(e,t){var i=this.getGroups(!1)[0];return t.push(i.getRows(!1)[0]),t}virtualRenderFill(){var e=this.table.rowManager.tableElement,t=this.table.rowManager.getVisibleRows();t=t.filter((e=>"group"!==e.type)),e.style.minWidth=t.length?"":this.table.columnManager.getWidth()+"px"}rowAddingIndex(e,t,i){this.assignRowToGroup(e);var s=e.modules.group.rows;return s.length>1&&(!t||t&&-1==s.indexOf(t)?i?s[0]!==e&&(t=s[0],this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)):s[s.length-1]!==e&&(t=s[s.length-1],this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)):this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)),t}trackChanges(){this.dispatch("group-changed")}setGroupBy(e){this.table.options.groupBy=e,this.initialized?this.configureGroupSetup():this.initialize(),this.refreshData(),this.trackChanges()}setGroupValues(e){this.table.options.groupValues=e,this.configureGroupSetup(),this.refreshData(),this.trackChanges()}setGroupStartOpen(e){this.table.options.groupStartOpen=e,this.configureGroupSetup(),this.table.options.groupBy?(this.refreshData(),this.trackChanges()):console.warn("Grouping Update - cant refresh view, no groups have been set")}setGroupHeader(e){this.table.options.groupHeader=e,this.configureGroupSetup(),this.table.options.groupBy?(this.refreshData(),this.trackChanges()):console.warn("Grouping Update - cant refresh view, no groups have been set")}userGetGroups(e){return this.getGroups(!0)}userGetGroupedData(){return this.table.options.groupBy?this.getGroupedData():this.getData()}rowGetGroup(e){return!!e.modules.group&&e.modules.group.getComponent()}rowMoving(e,t,i){!i&&t instanceof N&&(t=this.table.rowManager.prevDisplayRow(e)||t);var s=t instanceof N?t:t.modules.group,o=e instanceof N?e:e.modules.group;s===o?this.table.rowManager.moveRowInArray(s.rows,e,t,i):(o&&o.removeRow(e),s.insertRow(e,t,i))}rowDeleting(e){e.modules.group&&e.modules.group.removeRow(e)}rowsUpdated(e){this.updateGroupRows(!0)}cellUpdated(e){this.reassignRowToGroup(e.row)}setDisplayIndex(e){this.displayIndex=e}getDisplayIndex(){return this.displayIndex}getRows(e){return this.table.options.groupBy&&this.groupIDLookups.length?(this.dispatchExternal("dataGrouping"),this.generateGroups(e),this.subscribedExternal("dataGrouped")&&this.dispatchExternal("dataGrouped",this.getGroups(!0)),this.updateGroupRows()):e.slice(0)}getGroups(e){var t=[];return this.groupList.forEach((function(i){t.push(e?i.getComponent():i)})),t}getChildGroups(e){var t=[];return e||(e=this),e.groupList.forEach((e=>{e.groupList.length?t=t.concat(this.getChildGroups(e)):t.push(e)})),t}wipe(){this.groupList.forEach((function(e){e.wipe()}))}pullGroupListData(e){var t=[];return e.forEach((e=>{var i={level:0,rowCount:0,headerContent:""},s=[];e.hasSubGroups?(s=this.pullGroupListData(e.groupList),i.level=e.level,i.rowCount=s.length-e.groupList.length,i.headerContent=e.generator(e.key,i.rowCount,e.rows,e),t.push(i),t=t.concat(s)):(i.level=e.level,i.headerContent=e.generator(e.key,e.rows.length,e.rows,e),i.rowCount=e.getRows().length,t.push(i),e.getRows().forEach((e=>{t.push(e.getData("data"))})))})),t}getGroupedData(){return this.pullGroupListData(this.groupList)}getRowGroup(e){var t=!1;return this.options("dataTree")&&(e=this.table.modules.dataTree.getTreeParentRoot(e)),this.groupList.forEach((i=>{var s=i.getRowGroup(e);s&&(t=s)})),t}countGroups(){return this.groupList.length}generateGroups(e){var t=this.groups;this.groups={},this.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach((e=>{this.createGroup(e,0,t)})),e.forEach((e=>{this.assignRowToExistingGroup(e,t)}))):e.forEach((e=>{this.assignRowToGroup(e,t)}))}createGroup(e,t,i){var s,o=t+"_"+e;i=i||[],s=new N(this,!1,t,e,this.groupIDLookups[0].field,this.headerGenerator[0],i[o]),this.groups[o]=s,this.groupList.push(s)}assignRowToExistingGroup(e,t){var i="0_"+this.groupIDLookups[0].func(e.getData());this.groups[i]&&this.groups[i].addRow(e)}assignRowToGroup(e,t){var i=this.groupIDLookups[0].func(e.getData()),s=!this.groups["0_"+i];return s&&this.createGroup(i,0,t),this.groups["0_"+i].addRow(e),!s}reassignRowToGroup(e){if("row"===e.type){var t=e.modules.group,i=t.getPath(),s=this.getExpectedPath(e);i.length==s.length&&i.every(((e,t)=>e===s[t]))||(t.removeRow(e),this.assignRowToGroup(e,this.groups),this.refreshData(!0))}}getExpectedPath(e){var t=[],i=e.getData();return this.groupIDLookups.forEach((e=>{t.push(e.func(i))})),t}updateGroupRows(e){var t=[];return this.groupList.forEach((e=>{t=t.concat(e.getHeadersAndRows())})),e&&this.refreshData(!0,this.displayHandler),t}scrollHeaders(e){"virtual"===this.table.options.renderHorizontal&&(e-=this.table.columnManager.renderer.vDomPadLeft),e+="px",this.groupList.forEach((t=>{t.scrollHeader(e)}))}removeGroup(e){var t,i=e.level+"_"+e.key;this.groups[i]&&(delete this.groups[i],(t=this.groupList.indexOf(e))>-1&&this.groupList.splice(t,1))}}V.moduleName="groupRows";class W extends o{constructor(e){super(e),this.history=[],this.index=-1,this.registerTableOption("history",!1)}initialize(){this.table.options.history&&(this.subscribe("cell-value-updated",this.cellUpdated.bind(this)),this.subscribe("cell-delete",this.clearComponentHistory.bind(this)),this.subscribe("row-delete",this.rowDeleted.bind(this)),this.subscribe("rows-wipe",this.clear.bind(this)),this.subscribe("row-added",this.rowAdded.bind(this)),this.subscribe("row-move",this.rowMoved.bind(this))),this.registerTableFunction("undo",this.undo.bind(this)),this.registerTableFunction("redo",this.redo.bind(this)),this.registerTableFunction("getHistoryUndoSize",this.getHistoryUndoSize.bind(this)),this.registerTableFunction("getHistoryRedoSize",this.getHistoryRedoSize.bind(this)),this.registerTableFunction("clearHistory",this.clear.bind(this))}rowMoved(e,t,i){this.action("rowMove",e,{posFrom:this.table.rowManager.getRowPosition(e),posTo:this.table.rowManager.getRowPosition(t),to:t,after:i})}rowAdded(e,t,i,s){this.action("rowAdd",e,{data:t,pos:i,index:s})}rowDeleted(e){var t,i;this.table.options.groupBy?(t=(i=e.getComponent().getGroup().rows).indexOf(e))&&(t=i[t-1]):(t=e.table.rowManager.getRowIndex(e))&&(t=e.table.rowManager.rows[t-1]),this.action("rowDelete",e,{data:e.getData(),pos:!t,index:t})}cellUpdated(e){this.action("cellEdit",e,{oldValue:e.oldValue,newValue:e.value})}clear(){this.history=[],this.index=-1}action(e,t,i){this.history=this.history.slice(0,this.index+1),this.history.push({type:e,component:t,data:i}),this.index++}getHistoryUndoSize(){return this.index+1}getHistoryRedoSize(){return this.history.length-(this.index+1)}clearComponentHistory(e){var t=this.history.findIndex((function(t){return t.component===e}));t>-1&&(this.history.splice(t,1),t<=this.index&&this.index--,this.clearComponentHistory(e))}undo(){if(this.index>-1){let e=this.history[this.index];return W.undoers[e.type].call(this,e),this.index--,this.dispatchExternal("historyUndo",e.type,e.component.getComponent(),e.data),!0}return console.warn("History Undo Error - No more history to undo"),!1}redo(){if(this.history.length-1>this.index){this.index++;let e=this.history[this.index];return W.redoers[e.type].call(this,e),this.dispatchExternal("historyRedo",e.type,e.component.getComponent(),e.data),!0}return console.warn("History Redo Error - No more history to redo"),!1}_rebindRow(e,t){this.history.forEach((function(i){if(i.component instanceof C)i.component===e&&(i.component=t);else if(i.component instanceof g&&i.component.row===e){var s=i.component.column.getField();s&&(i.component=t.getCell(s))}}))}}W.moduleName="history",W.undoers={cellEdit:function(e){e.component.setValueProcessData(e.data.oldValue),e.component.cellRendered()},rowAdd:function(e){e.component.deleteActual()},rowDelete:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t)},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.rows[e.data.posFrom],!e.data.after),this.table.rowManager.redraw()}},W.redoers={cellEdit:function(e){e.component.setValueProcessData(e.data.newValue),e.component.cellRendered()},rowAdd:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t)},rowDelete:function(e){e.component.deleteActual()},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.rows[e.data.posTo],e.data.after),this.table.rowManager.redraw()}};class G extends o{constructor(e){super(e),this.fieldIndex=[],this.hasIndex=!1}initialize(){this.tableElementCheck()}tableElementCheck(){this.table.originalElement&&"TABLE"===this.table.originalElement.tagName&&(this.table.originalElement.childNodes.length?this.parseTable():console.warn("Unable to parse data from empty table tag, Tabulator should be initialized on a div tag unless importing data from a table element."))}parseTable(){var e=this.table.originalElement,t=this.table.options,i=(t.columns,e.getElementsByTagName("th")),s=e.getElementsByTagName("tbody")[0],o=[];this.hasIndex=!1,this.dispatchExternal("htmlImporting"),s=s?s.getElementsByTagName("tr"):[],this._extractOptions(e,t),i.length?this._extractHeaders(i,s):this._generateBlankHeaders(i,s);for(var n=0;n{n[e.toLowerCase()]=e})),s){var a,l=s[r];l&&"object"==typeof l&&l.name&&0===l.name.indexOf("tabulator-")&&(a=l.name.replace("tabulator-",""),void 0!==n[a]&&(t[n[a]]=this._attribValue(l.value)))}}_attribValue(e){return"true"===e||"false"!==e&&e}_findCol(e){return this.table.options.columns.find((t=>t.title===e))||!1}_extractHeaders(e,t){for(var i=0;i(console.error("Import Error:",e||"Unable to import data"),Promise.reject(e))))}lookupImporter(e){var t;return e||(e=this.table.options.importFormat),(t="string"==typeof e?U.importers[e]:e)||console.error("Import Error - Importer not found:",e),t}importFromFile(e,t){var i=this.lookupImporter(e);if(i)return this.pickFile(t).then(this.importData.bind(this,i)).then(this.structureData.bind(this)).then(this.setData.bind(this)).catch((e=>(console.error("Import Error:",e||"Unable to import file"),Promise.reject(e))))}pickFile(e){return new Promise(((t,i)=>{var s=document.createElement("input");s.type="file",s.accept=e,s.addEventListener("change",(e=>{var o=s.files[0],n=new FileReader;switch(this.table.options.importReader){case"buffer":n.readAsArrayBuffer(o);break;case"binary":n.readAsBinaryString(o);break;case"url":n.readAsDataURL(o);break;case"text":default:n.readAsText(o)}n.onload=e=>{t(n.result)},n.onerror=e=>{console.warn("File Load Error - Unable to read file"),i()}})),s.click()}))}importData(e,t){var i=e.call(this.table,t);return i instanceof Promise?i:i?Promise.resolve(i):Promise.reject()}structureData(e){return Array.isArray(e)&&e.length&&Array.isArray(e[0])?this.table.options.autoColumns?this.structureArrayToObject(e):this.structureArrayToColumns(e):e}structureArrayToObject(e){var t=e.shift();return e.map((e=>{var i={};return t.forEach(((t,s)=>{i[t]=e[s]})),i}))}structureArrayToColumns(e){var t=[],i=this.table.getColumns();return i[0]&&e[0][0]&&i[0].getDefinition().title===e[0][0]&&e.shift(),e.forEach((e=>{var s={};e.forEach(((e,t)=>{var o=i[t];o&&(s[o.getField()]=e)})),t.push(s)})),t}setData(e){return this.table.setData(e)}}U.moduleName="import",U.importers=j;class X extends o{constructor(e){super(e),this.eventMap={rowClick:"row-click",rowDblClick:"row-dblclick",rowContext:"row-contextmenu",rowMouseEnter:"row-mouseenter",rowMouseLeave:"row-mouseleave",rowMouseOver:"row-mouseover",rowMouseOut:"row-mouseout",rowMouseMove:"row-mousemove",rowTap:"row",rowDblTap:"row",rowTapHold:"row",cellClick:"cell-click",cellDblClick:"cell-dblclick",cellContext:"cell-contextmenu",cellMouseEnter:"cell-mouseenter",cellMouseLeave:"cell-mouseleave",cellMouseOver:"cell-mouseover",cellMouseOut:"cell-mouseout",cellMouseMove:"cell-mousemove",cellTap:"cell",cellDblTap:"cell",cellTapHold:"cell",headerClick:"column-click",headerDblClick:"column-dblclick",headerContext:"column-contextmenu",headerMouseEnter:"column-mouseenter",headerMouseLeave:"column-mouseleave",headerMouseOver:"column-mouseover",headerMouseOut:"column-mouseout",headerMouseMove:"column-mousemove",headerTap:"column",headerDblTap:"column",headerTapHold:"column",groupClick:"group-click",groupDblClick:"group-dblclick",groupContext:"group-contextmenu",groupMouseEnter:"group-mouseenter",groupMouseLeave:"group-mouseleave",groupMouseOver:"group-mouseover",groupMouseOut:"group-mouseout",groupMouseMove:"group-mousemove",groupTap:"group",groupDblTap:"group",groupTapHold:"group"},this.subscribers={},this.touchSubscribers={},this.columnSubscribers={},this.touchWatchers={row:{tap:null,tapDbl:null,tapHold:null},cell:{tap:null,tapDbl:null,tapHold:null},column:{tap:null,tapDbl:null,tapHold:null},group:{tap:null,tapDbl:null,tapHold:null}},this.registerColumnOption("headerClick"),this.registerColumnOption("headerDblClick"),this.registerColumnOption("headerContext"),this.registerColumnOption("headerMouseEnter"),this.registerColumnOption("headerMouseLeave"),this.registerColumnOption("headerMouseOver"),this.registerColumnOption("headerMouseOut"),this.registerColumnOption("headerMouseMove"),this.registerColumnOption("headerTap"),this.registerColumnOption("headerDblTap"),this.registerColumnOption("headerTapHold"),this.registerColumnOption("cellClick"),this.registerColumnOption("cellDblClick"),this.registerColumnOption("cellContext"),this.registerColumnOption("cellMouseEnter"),this.registerColumnOption("cellMouseLeave"),this.registerColumnOption("cellMouseOver"),this.registerColumnOption("cellMouseOut"),this.registerColumnOption("cellMouseMove"),this.registerColumnOption("cellTap"),this.registerColumnOption("cellDblTap"),this.registerColumnOption("cellTapHold")}initialize(){this.initializeExternalEvents(),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("cell-dblclick",this.cellContentsSelectionFixer.bind(this))}cellContentsSelectionFixer(e,t){if(!this.table.modExists("edit")||this.table.modules.edit.currentCell!==this){e.preventDefault();try{if(document.selection)(i=document.body.createTextRange()).moveToElementText(this.element),i.select();else if(window.getSelection){var i;(i=document.createRange()).selectNode(this.element),window.getSelection().removeAllRanges(),window.getSelection().addRange(i)}}catch(e){}}}initializeExternalEvents(){for(let e in this.eventMap)this.subscriptionChangeExternal(e,this.subscriptionChanged.bind(this,e))}subscriptionChanged(e,t){t?this.subscribers[e]||(this.eventMap[e].includes("-")?(this.subscribers[e]=this.handle.bind(this,e),this.subscribe(this.eventMap[e],this.subscribers[e])):this.subscribeTouchEvents(e)):this.eventMap[e].includes("-")?!this.subscribers[e]||this.columnSubscribers[e]||this.subscribedExternal(e)||(this.unsubscribe(this.eventMap[e],this.subscribers[e]),delete this.subscribers[e]):this.unsubscribeTouchEvents(e)}subscribeTouchEvents(e){var t=this.eventMap[e];this.touchSubscribers[t+"-touchstart"]||(this.touchSubscribers[t+"-touchstart"]=this.handleTouch.bind(this,t,"start"),this.touchSubscribers[t+"-touchend"]=this.handleTouch.bind(this,t,"end"),this.subscribe(t+"-touchstart",this.touchSubscribers[t+"-touchstart"]),this.subscribe(t+"-touchend",this.touchSubscribers[t+"-touchend"])),this.subscribers[e]=!0}unsubscribeTouchEvents(e){var t=!0,i=this.eventMap[e];if(this.subscribers[e]&&!this.subscribedExternal(e)){delete this.subscribers[e];for(let e in this.eventMap)this.eventMap[e]===i&&this.subscribers[e]&&(t=!1);t&&(this.unsubscribe(i+"-touchstart",this.touchSubscribers[i+"-touchstart"]),this.unsubscribe(i+"-touchend",this.touchSubscribers[i+"-touchend"]),delete this.touchSubscribers[i+"-touchstart"],delete this.touchSubscribers[i+"-touchend"])}}initializeColumn(e){var t=e.definition;for(let i in this.eventMap)t[i]&&(this.subscriptionChanged(i,!0),this.columnSubscribers[i]||(this.columnSubscribers[i]=[]),this.columnSubscribers[i].push(e))}handle(e,t,i){this.dispatchEvent(e,t,i)}handleTouch(e,t,i,s){var o=this.touchWatchers[e];switch("column"===e&&(e="header"),t){case"start":o.tap=!0,clearTimeout(o.tapHold),o.tapHold=setTimeout((()=>{clearTimeout(o.tapHold),o.tapHold=null,o.tap=null,clearTimeout(o.tapDbl),o.tapDbl=null,this.dispatchEvent(e+"TapHold",i,s)}),1e3);break;case"end":o.tap&&(o.tap=null,this.dispatchEvent(e+"Tap",i,s)),o.tapDbl?(clearTimeout(o.tapDbl),o.tapDbl=null,this.dispatchEvent(e+"DblTap",i,s)):o.tapDbl=setTimeout((()=>{clearTimeout(o.tapDbl),o.tapDbl=null}),300),clearTimeout(o.tapHold),o.tapHold=null}}dispatchEvent(e,t,i){var s,o=i.getComponent();this.columnSubscribers[e]&&(i instanceof g?s=i.column.definition[e]:i instanceof v&&(s=i.definition[e]),s&&s(t,o)),this.dispatchExternal(e,t,o)}}X.moduleName="interaction";class q extends o{constructor(e){super(e),this.watchKeys=null,this.pressedKeys=null,this.keyupBinding=!1,this.keydownBinding=!1,this.registerTableOption("keybindings",{}),this.registerTableOption("tabEndNewRow",!1)}initialize(){var e=this.table.options.keybindings,t={};this.watchKeys={},this.pressedKeys=[],!1!==e&&(Object.assign(t,q.bindings),Object.assign(t,e),this.mapBindings(t),this.bindEvents()),this.subscribe("table-destroy",this.clearBindings.bind(this))}mapBindings(e){for(let t in e)q.actions[t]?e[t]&&("object"!=typeof e[t]&&(e[t]=[e[t]]),e[t].forEach((e=>{(Array.isArray(e)?e:[e]).forEach((e=>{this.mapBinding(t,e)}))}))):console.warn("Key Binding Error - no such action:",t)}mapBinding(e,t){var i={action:q.actions[e],keys:[],ctrl:!1,shift:!1,meta:!1};t.toString().toLowerCase().split(" ").join("").split("+").forEach((e=>{switch(e){case"ctrl":i.ctrl=!0;break;case"shift":i.shift=!0;break;case"meta":i.meta=!0;break;default:e=isNaN(e)?e.toUpperCase().charCodeAt(0):parseInt(e),i.keys.push(e),this.watchKeys[e]||(this.watchKeys[e]=[]),this.watchKeys[e].push(i)}}))}bindEvents(){var e=this;this.keyupBinding=function(t){var i=t.keyCode,s=e.watchKeys[i];s&&(e.pressedKeys.push(i),s.forEach((function(i){e.checkBinding(t,i)})))},this.keydownBinding=function(t){var i=t.keyCode;if(e.watchKeys[i]){var s=e.pressedKeys.indexOf(i);s>-1&&e.pressedKeys.splice(s,1)}},this.table.element.addEventListener("keydown",this.keyupBinding),this.table.element.addEventListener("keyup",this.keydownBinding)}clearBindings(){this.keyupBinding&&this.table.element.removeEventListener("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.removeEventListener("keyup",this.keydownBinding)}checkBinding(e,t){var i=!0;return e.ctrlKey==t.ctrl&&e.shiftKey==t.shift&&e.metaKey==t.meta&&(t.keys.forEach((e=>{-1==this.pressedKeys.indexOf(e)&&(i=!1)})),i&&t.action.call(this,e),!0)}}q.moduleName="keybindings",q.bindings={navPrev:"shift + 9",navNext:9,navUp:38,navDown:40,scrollPageUp:33,scrollPageDown:34,scrollToStart:36,scrollToEnd:35,undo:["ctrl + 90","meta + 90"],redo:["ctrl + 89","meta + 89"],copyToClipboard:["ctrl + 67","meta + 89"]},q.actions={keyBlock:function(e){e.stopPropagation(),e.preventDefault()},scrollPageUp:function(e){var t=this.table.rowManager,i=t.scrollTop-t.element.clientHeight;t.element.scrollHeight;e.preventDefault(),t.displayRowsCount&&(i>=0?t.element.scrollTop=i:t.scrollToRow(t.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(e){var t=this.table.rowManager,i=t.scrollTop+t.element.clientHeight,s=t.element.scrollHeight;e.preventDefault(),t.displayRowsCount&&(i<=s?t.element.scrollTop=i:t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1])),this.table.element.focus()},scrollToStart:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[0]),this.table.element.focus()},scrollToEnd:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1]),this.table.element.focus()},navPrev:function(e){this.dispatch("keybinding-nav-prev",e)},navNext:function(e){this.dispatch("keybinding-nav-next",e)},navLeft:function(e){this.dispatch("keybinding-nav-left",e)},navRight:function(e){this.dispatch("keybinding-nav-right",e)},navUp:function(e){this.dispatch("keybinding-nav-up",e)},navDown:function(e){this.dispatch("keybinding-nav-down",e)},undo:function(e){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(e.preventDefault(),this.table.modules.history.undo()))},redo:function(e){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(e.preventDefault(),this.table.modules.history.redo()))},copyToClipboard:function(e){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}};class K extends o{constructor(e){super(e),this.menuContainer=null,this.nestedMenuBlock=!1,this.currentComponent=null,this.rootPopup=null,this.columnSubscribers={},this.registerTableOption("menuContainer",void 0),this.registerTableOption("rowContextMenu",!1),this.registerTableOption("rowClickMenu",!1),this.registerTableOption("groupContextMenu",!1),this.registerTableOption("groupClickMenu",!1),this.registerColumnOption("headerContextMenu"),this.registerColumnOption("headerClickMenu"),this.registerColumnOption("headerMenu"),this.registerColumnOption("headerMenuIcon"),this.registerColumnOption("contextMenu"),this.registerColumnOption("clickMenu")}initialize(){this.deprecationCheck(),this.initializeRowWatchers(),this.initializeGroupWatchers(),this.subscribe("column-init",this.initializeColumn.bind(this))}deprecationCheck(){void 0!==this.table.options.menuContainer&&(console.warn("Use of the menuContainer option is now deprecated. Please use the popupContainer option instead"),this.table.options.popupContainer=this.table.options.menuContainer)}initializeRowWatchers(){this.table.options.rowContextMenu&&(this.subscribe("row-contextmenu",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu)),this.table.on("rowTapHold",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu))),this.table.options.rowClickMenu&&this.subscribe("row-click",this.loadMenuEvent.bind(this,this.table.options.rowClickMenu))}initializeGroupWatchers(){this.table.options.groupContextMenu&&(this.subscribe("group-contextmenu",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu)),this.table.on("groupTapHold",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu))),this.table.options.groupClickMenu&&this.subscribe("group-click",this.loadMenuEvent.bind(this,this.table.options.groupClickMenu))}initializeColumn(e){var t=e.definition;t.headerContextMenu&&!this.columnSubscribers.headerContextMenu&&(this.columnSubscribers.headerContextMenu=this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"),this.subscribe("column-contextmenu",this.columnSubscribers.headerContextMenu),this.table.on("headerTapHold",this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"))),t.headerClickMenu&&!this.columnSubscribers.headerClickMenu&&(this.columnSubscribers.headerClickMenu=this.loadMenuTableColumnEvent.bind(this,"headerClickMenu"),this.subscribe("column-click",this.columnSubscribers.headerClickMenu)),t.headerMenu&&this.initializeColumnHeaderMenu(e),t.contextMenu&&!this.columnSubscribers.contextMenu&&(this.columnSubscribers.contextMenu=this.loadMenuTableCellEvent.bind(this,"contextMenu"),this.subscribe("cell-contextmenu",this.columnSubscribers.contextMenu),this.table.on("cellTapHold",this.loadMenuTableCellEvent.bind(this,"contextMenu"))),t.clickMenu&&!this.columnSubscribers.clickMenu&&(this.columnSubscribers.clickMenu=this.loadMenuTableCellEvent.bind(this,"clickMenu"),this.subscribe("cell-click",this.columnSubscribers.clickMenu))}initializeColumnHeaderMenu(e){var t,i=e.definition.headerMenuIcon;(t=document.createElement("span")).classList.add("tabulator-header-popup-button"),i?("function"==typeof i&&(i=i(e.getComponent())),i instanceof HTMLElement?t.appendChild(i):t.innerHTML=i):t.innerHTML="⋮",t.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault(),this.loadMenuEvent(e.definition.headerMenu,t,e)})),e.titleElement.insertBefore(t,e.titleElement.firstChild)}loadMenuTableCellEvent(e,t,i){i._cell&&(i=i._cell),i.column.definition[e]&&this.loadMenuEvent(i.column.definition[e],t,i)}loadMenuTableColumnEvent(e,t,i){i._column&&(i=i._column),i.definition[e]&&this.loadMenuEvent(i.definition[e],t,i)}loadMenuEvent(e,t,i){i._group?i=i._group:i._row&&(i=i._row),e="function"==typeof e?e.call(this.table,t,i.getComponent()):e,this.loadMenu(t,i,e)}loadMenu(e,t,i,s,o){var n,r=!(e instanceof MouseEvent),a=document.createElement("div");if(a.classList.add("tabulator-menu"),r||e.preventDefault(),i&&i.length){if(s)n=o.child(a);else{if(this.nestedMenuBlock){if(this.rootPopup)return}else this.nestedMenuBlock=setTimeout((()=>{this.nestedMenuBlock=!1}),100);this.rootPopup&&this.rootPopup.hide(),this.rootPopup=n=this.popup(a)}i.forEach((e=>{var i=document.createElement("div"),s=e.label,o=e.disabled;e.separator?i.classList.add("tabulator-menu-separator"):(i.classList.add("tabulator-menu-item"),"function"==typeof s&&(s=s.call(this.table,t.getComponent())),s instanceof Node?i.appendChild(s):i.innerHTML=s,"function"==typeof o&&(o=o.call(this.table,t.getComponent())),o?(i.classList.add("tabulator-menu-item-disabled"),i.addEventListener("click",(e=>{e.stopPropagation()}))):e.menu&&e.menu.length?i.addEventListener("click",(s=>{s.stopPropagation(),this.loadMenu(s,t,e.menu,i,n)})):e.action&&i.addEventListener("click",(i=>{e.action(i,t.getComponent())})),e.menu&&e.menu.length&&i.classList.add("tabulator-menu-item-submenu")),a.appendChild(i)})),a.addEventListener("click",(e=>{this.rootPopup.hide()})),n.show(s||e),n===this.rootPopup&&(this.rootPopup.hideOnBlur((()=>{this.rootPopup=null,this.currentComponent&&(this.dispatchExternal("menuClosed",this.currentComponent.getComponent()),this.currentComponent=null)})),this.currentComponent=t,this.dispatchExternal("menuOpened",t.getComponent()))}}}K.moduleName="menu";class J extends o{constructor(e){super(e),this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=250,this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.startX=0,this.autoScrollMargin=40,this.autoScrollStep=5,this.autoScrollTimeout=!1,this.touchMove=!1,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this),this.registerTableOption("movableColumns",!1)}createPlaceholderElement(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.classList.add("tabulator-col-placeholder"),e}initialize(){this.table.options.movableColumns&&this.subscribe("column-init",this.initializeColumn.bind(this))}initializeColumn(e){var i,s=this,o={};e.modules.frozen||e.isGroup||(i=e.getElement(),o.mousemove=function(o){e.parent===s.moving.parent&&((s.touchMove?o.touches[0].pageX:o.pageX)-t.elOffset(i).left+s.table.columnManager.element.scrollLeft>e.getWidth()/2?s.toCol===e&&s.toColAfter||(i.parentNode.insertBefore(s.placeholderElement,i.nextSibling),s.moveColumn(e,!0)):(s.toCol!==e||s.toColAfter)&&(i.parentNode.insertBefore(s.placeholderElement,i),s.moveColumn(e,!1)))}.bind(s),i.addEventListener("mousedown",(function(t){s.touchMove=!1,1===t.which&&(s.checkTimeout=setTimeout((function(){s.startMove(t,e)}),s.checkPeriod))})),i.addEventListener("mouseup",(function(e){1===e.which&&s.checkTimeout&&clearTimeout(s.checkTimeout)})),s.bindTouchEvents(e)),e.modules.moveColumn=o}bindTouchEvents(e){var t,i,s,o,n,r,a=e.getElement(),l=!1;a.addEventListener("touchstart",(a=>{this.checkTimeout=setTimeout((()=>{this.touchMove=!0,t=e.nextColumn(),s=t?t.getWidth()/2:0,i=e.prevColumn(),o=i?i.getWidth()/2:0,n=0,r=0,l=!1,this.startMove(a,e)}),this.checkPeriod)}),{passive:!0}),a.addEventListener("touchmove",(a=>{var h,d;this.moving&&(this.moveHover(a),l||(l=a.touches[0].pageX),(h=a.touches[0].pageX-l)>0?t&&h-n>s&&(d=t)!==e&&(l=a.touches[0].pageX,d.getElement().parentNode.insertBefore(this.placeholderElement,d.getElement().nextSibling),this.moveColumn(d,!0)):i&&-h-r>o&&(d=i)!==e&&(l=a.touches[0].pageX,d.getElement().parentNode.insertBefore(this.placeholderElement,d.getElement()),this.moveColumn(d,!1)),d&&(t=d.nextColumn(),n=s,s=t?t.getWidth()/2:0,i=d.prevColumn(),r=o,o=i?i.getWidth()/2:0))}),{passive:!0}),a.addEventListener("touchend",(e=>{this.checkTimeout&&clearTimeout(this.checkTimeout),this.moving&&this.endMove(e)}))}startMove(e,i){var s=i.getElement(),o=this.table.columnManager.getElement(),n=this.table.columnManager.getHeadersElement();this.moving=i,this.startX=(this.touchMove?e.touches[0].pageX:e.pageX)-t.elOffset(s).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=i.getWidth()+"px",this.placeholderElement.style.height=i.getHeight()+"px",s.parentNode.insertBefore(this.placeholderElement,s),s.parentNode.removeChild(s),this.hoverElement=s.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.table.columnManager.getElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.bottom=o.clientHeight-n.offsetHeight+"px",this.touchMove||(this._bindMouseMove(),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove)),this.moveHover(e)}_bindMouseMove(){this.table.columnManager.columnsByIndex.forEach((function(e){e.modules.moveColumn.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveColumn.mousemove)}))}_unbindMouseMove(){this.table.columnManager.columnsByIndex.forEach((function(e){e.modules.moveColumn.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveColumn.mousemove)}))}moveColumn(e,t){var i=this.moving.getCells();this.toCol=e,this.toColAfter=t,t?e.getCells().forEach((function(e,t){var s=e.getElement(!0);s.parentNode&&i[t]&&s.parentNode.insertBefore(i[t].getElement(),s.nextSibling)})):e.getCells().forEach((function(e,t){var s=e.getElement(!0);s.parentNode&&i[t]&&s.parentNode.insertBefore(i[t].getElement(),s)}))}endMove(e){(1===e.which||this.touchMove)&&(this._unbindMouseMove(),this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toCol&&this.table.columnManager.moveColumnActual(this.moving,this.toCol,this.toColAfter),this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.touchMove||(document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove)))}moveHover(e){var i,s=this.table.columnManager.getElement(),o=s.scrollLeft,n=(this.touchMove?e.touches[0].pageX:e.pageX)-t.elOffset(s).left+o;this.hoverElement.style.left=n-this.startX+"px",n-o{i=Math.max(0,o-5),this.table.rowManager.getElement().scrollLeft=i,this.autoScrollTimeout=!1}),1))),o+s.clientWidth-n{i=Math.min(s.clientWidth,o+5),this.table.rowManager.getElement().scrollLeft=i,this.autoScrollTimeout=!1}),1)))}}J.moduleName="moveColumn";class Y extends o{constructor(e){super(e),this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=150,this.moving=!1,this.toRow=!1,this.toRowAfter=!1,this.hasHandle=!1,this.startY=0,this.startX=0,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this),this.tableRowDropEvent=!1,this.touchMove=!1,this.connection=!1,this.connectionSelectorsTables=!1,this.connectionSelectorsElements=!1,this.connectionElements=[],this.connections=[],this.connectedTable=!1,this.connectedRow=!1,this.registerTableOption("movableRows",!1),this.registerTableOption("movableRowsConnectedTables",!1),this.registerTableOption("movableRowsConnectedElements",!1),this.registerTableOption("movableRowsSender",!1),this.registerTableOption("movableRowsReceiver","insert"),this.registerColumnOption("rowHandle")}createPlaceholderElement(){var e=document.createElement("div");return e.classList.add("tabulator-row"),e.classList.add("tabulator-row-placeholder"),e}initialize(){this.table.options.movableRows&&(this.connectionSelectorsTables=this.table.options.movableRowsConnectedTables,this.connectionSelectorsElements=this.table.options.movableRowsConnectedElements,this.connection=this.connectionSelectorsTables||this.connectionSelectorsElements,this.subscribe("cell-init",this.initializeCell.bind(this)),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("row-init",this.initializeRow.bind(this)))}initializeGroupHeader(e){var i=this,s={};s.mouseup=function(e){i.tableRowDrop(e,row)}.bind(i),s.mousemove=function(s){var o;s.pageY-t.elOffset(e.element).top+i.table.rowManager.element.scrollTop>e.getHeight()/2?i.toRow===e&&i.toRowAfter||((o=e.getElement()).parentNode.insertBefore(i.placeholderElement,o.nextSibling),i.moveRow(e,!0)):(i.toRow!==e||i.toRowAfter)&&(o=e.getElement()).previousSibling&&(o.parentNode.insertBefore(i.placeholderElement,o),i.moveRow(e,!1))}.bind(i),e.modules.moveRow=s}initializeRow(e){var i,s=this,o={};o.mouseup=function(t){s.tableRowDrop(t,e)}.bind(s),o.mousemove=function(i){var o=e.getElement();i.pageY-t.elOffset(o).top+s.table.rowManager.element.scrollTop>e.getHeight()/2?s.toRow===e&&s.toRowAfter||(o.parentNode.insertBefore(s.placeholderElement,o.nextSibling),s.moveRow(e,!0)):(s.toRow!==e||s.toRowAfter)&&(o.parentNode.insertBefore(s.placeholderElement,o),s.moveRow(e,!1))}.bind(s),this.hasHandle||((i=e.getElement()).addEventListener("mousedown",(function(t){1===t.which&&(s.checkTimeout=setTimeout((function(){s.startMove(t,e)}),s.checkPeriod))})),i.addEventListener("mouseup",(function(e){1===e.which&&s.checkTimeout&&clearTimeout(s.checkTimeout)})),this.bindTouchEvents(e,e.getElement())),e.modules.moveRow=o}initializeColumn(e){e.definition.rowHandle&&!1!==this.table.options.movableRows&&(this.hasHandle=!0)}initializeCell(e){if(e.column.definition.rowHandle&&!1!==this.table.options.movableRows){var t=this,i=e.getElement(!0);i.addEventListener("mousedown",(function(i){1===i.which&&(t.checkTimeout=setTimeout((function(){t.startMove(i,e.row)}),t.checkPeriod))})),i.addEventListener("mouseup",(function(e){1===e.which&&t.checkTimeout&&clearTimeout(t.checkTimeout)})),this.bindTouchEvents(e.row,i)}}bindTouchEvents(e,t){var i,s,o,n,r,a,l=!1;t.addEventListener("touchstart",(t=>{this.checkTimeout=setTimeout((()=>{this.touchMove=!0,i=e.nextRow(),o=i?i.getHeight()/2:0,s=e.prevRow(),n=s?s.getHeight()/2:0,r=0,a=0,l=!1,this.startMove(t,e)}),this.checkPeriod)}),{passive:!0}),this.moving,this.toRow,this.toRowAfter,t.addEventListener("touchmove",(t=>{var h,d;this.moving&&(t.preventDefault(),this.moveHover(t),l||(l=t.touches[0].pageY),(h=t.touches[0].pageY-l)>0?i&&h-r>o&&(d=i)!==e&&(l=t.touches[0].pageY,d.getElement().parentNode.insertBefore(this.placeholderElement,d.getElement().nextSibling),this.moveRow(d,!0)):s&&-h-a>n&&(d=s)!==e&&(l=t.touches[0].pageY,d.getElement().parentNode.insertBefore(this.placeholderElement,d.getElement()),this.moveRow(d,!1)),d&&(i=d.nextRow(),r=o,o=i?i.getHeight()/2:0,s=d.prevRow(),a=n,n=s?s.getHeight()/2:0))})),t.addEventListener("touchend",(e=>{this.checkTimeout&&clearTimeout(this.checkTimeout),this.moving&&(this.endMove(e),this.touchMove=!1)}))}_bindMouseMove(){this.table.rowManager.getDisplayRows().forEach((e=>{("row"===e.type||"group"===e.type)&&e.modules.moveRow&&e.modules.moveRow.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveRow.mousemove)}))}_unbindMouseMove(){this.table.rowManager.getDisplayRows().forEach((e=>{("row"===e.type||"group"===e.type)&&e.modules.moveRow&&e.modules.moveRow.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveRow.mousemove)}))}startMove(e,t){var i=t.getElement();this.setStartPosition(e,t),this.moving=t,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",this.connection?(this.table.element.classList.add("tabulator-movingrow-sending"),this.connectToTables(t)):(i.parentNode.insertBefore(this.placeholderElement,i),i.parentNode.removeChild(i)),this.hoverElement=i.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.connection?(document.body.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this.hoverElement.style.width=this.table.element.clientWidth+"px",this.hoverElement.style.whiteSpace="nowrap",this.hoverElement.style.overflow="hidden",this.hoverElement.style.pointerEvents="none"):(this.table.rowManager.getTableElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this._bindMouseMove()),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove),this.dispatchExternal("rowMoving",t.getComponent()),this.moveHover(e)}setStartPosition(e,t){var i,s,o=this.touchMove?e.touches[0].pageX:e.pageX,n=this.touchMove?e.touches[0].pageY:e.pageY;i=t.getElement(),this.connection?(s=i.getBoundingClientRect(),this.startX=s.left-o+window.pageXOffset,this.startY=s.top-n+window.pageYOffset):this.startY=n-i.getBoundingClientRect().top}endMove(e){e&&1!==e.which&&!this.touchMove||(this._unbindMouseMove(),this.connection||(this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement)),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toRow?this.table.rowManager.moveRow(this.moving,this.toRow,this.toRowAfter):this.dispatchExternal("rowMoveCancelled",this.moving.getComponent()),this.moving=!1,this.toRow=!1,this.toRowAfter=!1,document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove),this.connection&&(this.table.element.classList.remove("tabulator-movingrow-sending"),this.disconnectFromTables()))}moveRow(e,t){this.toRow=e,this.toRowAfter=t}moveHover(e){this.connection?this.moveHoverConnections.call(this,e):this.moveHoverTable.call(this,e)}moveHoverTable(e){var t=this.table.rowManager.getElement(),i=t.scrollTop,s=(this.touchMove?e.touches[0].pageY:e.pageY)-t.getBoundingClientRect().top+i;this.hoverElement.style.top=s-this.startY+"px"}moveHoverConnections(e){this.hoverElement.style.left=this.startX+(this.touchMove?e.touches[0].pageX:e.pageX)+"px",this.hoverElement.style.top=this.startY+(this.touchMove?e.touches[0].pageY:e.pageY)+"px"}elementRowDrop(e,t,i){this.dispatchExternal("movableRowsElementDrop",e,t,!!i&&i.getComponent())}connectToTables(e){var t;this.connectionSelectorsTables&&(t=this.commsConnections(this.connectionSelectorsTables),this.dispatchExternal("movableRowsSendingStart",t),this.commsSend(this.connectionSelectorsTables,"moveRow","connect",{row:e})),this.connectionSelectorsElements&&(this.connectionElements=[],Array.isArray(this.connectionSelectorsElements)||(this.connectionSelectorsElements=[this.connectionSelectorsElements]),this.connectionSelectorsElements.forEach((e=>{"string"==typeof e?this.connectionElements=this.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(e))):this.connectionElements.push(e)})),this.connectionElements.forEach((e=>{var t=t=>{this.elementRowDrop(t,e,this.moving)};e.addEventListener("mouseup",t),e.tabulatorElementDropEvent=t,e.classList.add("tabulator-movingrow-receiving")})))}disconnectFromTables(){var e;this.connectionSelectorsTables&&(e=this.commsConnections(this.connectionSelectorsTables),this.dispatchExternal("movableRowsSendingStop",e),this.commsSend(this.connectionSelectorsTables,"moveRow","disconnect")),this.connectionElements.forEach((e=>{e.classList.remove("tabulator-movingrow-receiving"),e.removeEventListener("mouseup",e.tabulatorElementDropEvent),delete e.tabulatorElementDropEvent}))}connect(e,t){return this.connectedTable?(console.warn("Move Row Error - Table cannot accept connection, already connected to table:",this.connectedTable),!1):(this.connectedTable=e,this.connectedRow=t,this.table.element.classList.add("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach((e=>{"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().addEventListener("mouseup",e.modules.moveRow.mouseup)})),this.tableRowDropEvent=this.tableRowDrop.bind(this),this.table.element.addEventListener("mouseup",this.tableRowDropEvent),this.dispatchExternal("movableRowsReceivingStart",t,e),!0)}disconnect(e){e===this.connectedTable?(this.connectedTable=!1,this.connectedRow=!1,this.table.element.classList.remove("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach((e=>{"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().removeEventListener("mouseup",e.modules.moveRow.mouseup)})),this.table.element.removeEventListener("mouseup",this.tableRowDropEvent),this.dispatchExternal("movableRowsReceivingStop",e)):console.warn("Move Row Error - trying to disconnect from non connected table")}dropComplete(e,t,i){var s=!1;if(i){switch(typeof this.table.options.movableRowsSender){case"string":s=this.senders[this.table.options.movableRowsSender];break;case"function":s=this.table.options.movableRowsSender}s?s.call(this,this.moving.getComponent(),t?t.getComponent():void 0,e):this.table.options.movableRowsSender&&console.warn("Mover Row Error - no matching sender found:",this.table.options.movableRowsSender),this.dispatchExternal("movableRowsSent",this.moving.getComponent(),t?t.getComponent():void 0,e)}else this.dispatchExternal("movableRowsSentFailed",this.moving.getComponent(),t?t.getComponent():void 0,e);this.endMove()}tableRowDrop(e,t){var i=!1,s=!1;switch(e.stopImmediatePropagation(),typeof this.table.options.movableRowsReceiver){case"string":i=this.receivers[this.table.options.movableRowsReceiver];break;case"function":i=this.table.options.movableRowsReceiver}i?s=i.call(this,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):console.warn("Mover Row Error - no matching receiver found:",this.table.options.movableRowsReceiver),s?this.dispatchExternal("movableRowsReceived",this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):this.dispatchExternal("movableRowsReceivedFailed",this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable),this.commsSend(this.connectedTable,"moveRow","dropcomplete",{row:t,success:s})}commsReceived(e,t,i){switch(t){case"connect":return this.connect(e,i.row);case"disconnect":return this.disconnect(e);case"dropcomplete":return this.dropComplete(e,i.row,i.success)}}}Y.prototype.receivers={insert:function(e,t,i){return this.table.addRow(e.getData(),void 0,t),!0},add:function(e,t,i){return this.table.addRow(e.getData()),!0},update:function(e,t,i){return!!t&&(t.update(e.getData()),!0)},replace:function(e,t,i){return!!t&&(this.table.addRow(e.getData(),void 0,t),t.delete(),!0)}},Y.prototype.senders={delete:function(e,t,i){e.delete()}},Y.moduleName="moveRow";class $ extends o{constructor(e){super(e),this.allowedTypes=["","data","edit","clipboard"],this.enabled=!0,this.registerColumnOption("mutator"),this.registerColumnOption("mutatorParams"),this.registerColumnOption("mutatorData"),this.registerColumnOption("mutatorDataParams"),this.registerColumnOption("mutatorEdit"),this.registerColumnOption("mutatorEditParams"),this.registerColumnOption("mutatorClipboard"),this.registerColumnOption("mutatorClipboardParams"),this.registerColumnOption("mutateLink")}initialize(){this.subscribe("cell-value-changing",this.transformCell.bind(this)),this.subscribe("cell-value-changed",this.mutateLink.bind(this)),this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-init-before",this.rowDataChanged.bind(this)),this.subscribe("row-data-changing",this.rowDataChanged.bind(this))}rowDataChanged(e,t,i){return this.transformRow(t,"data",i)}initializeColumn(e){var t=!1,i={};this.allowedTypes.forEach((s=>{var o,n="mutator"+(s.charAt(0).toUpperCase()+s.slice(1));e.definition[n]&&(o=this.lookupMutator(e.definition[n]))&&(t=!0,i[n]={mutator:o,params:e.definition[n+"Params"]||{}})})),t&&(e.modules.mutate=i)}lookupMutator(e){var t=!1;switch(typeof e){case"string":$.mutators[e]?t=$.mutators[e]:console.warn("Mutator Error - No such mutator found, ignoring: ",e);break;case"function":t=e}return t}transformRow(e,t,i){var s,o="mutator"+(t.charAt(0).toUpperCase()+t.slice(1));return this.enabled&&this.table.columnManager.traverse((n=>{var r,a,l;n.modules.mutate&&(r=n.modules.mutate[o]||n.modules.mutate.mutator||!1)&&(s=n.getFieldValue(void 0!==i?i:e),"data"!=t&&void 0===s||(l=n.getComponent(),a="function"==typeof r.params?r.params(s,e,t,l):r.params,n.setFieldValue(e,r.mutator(s,e,t,a,l))))})),e}transformCell(e,t){if(e.column.modules.mutate){var i=e.column.modules.mutate.mutatorEdit||e.column.modules.mutate.mutator||!1,s={};if(i)return s=Object.assign(s,e.row.getData()),e.column.setFieldValue(s,t),i.mutator(t,s,"edit",i.params,e.getComponent())}return t}mutateLink(e){var t=e.column.definition.mutateLink;t&&(Array.isArray(t)||(t=[t]),t.forEach((t=>{var i=e.row.getCell(t);i&&i.setValue(i.getValue(),!0,!0)})))}enable(){this.enabled=!0}disable(){this.enabled=!1}}$.moduleName="mutator",$.mutators={};var Z={rows:function(e,t,i,s,o){var n=document.createElement("span"),r=document.createElement("span"),a=document.createElement("span"),l=document.createElement("span"),h=document.createElement("span"),d=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",(e=>{r.innerHTML=e})),this.table.modules.localize.langBind("pagination|counter|of",(e=>{l.innerHTML=e})),this.table.modules.localize.langBind("pagination|counter|rows",(e=>{d.innerHTML=e})),s?(a.innerHTML=" "+t+"-"+Math.min(t+e-1,s)+" ",h.innerHTML=" "+s+" ",n.appendChild(r),n.appendChild(a),n.appendChild(l),n.appendChild(h),n.appendChild(d)):(a.innerHTML=" 0 ",n.appendChild(r),n.appendChild(a),n.appendChild(d)),n},pages:function(e,t,i,s,o){var n=document.createElement("span"),r=document.createElement("span"),a=document.createElement("span"),l=document.createElement("span"),h=document.createElement("span"),d=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",(e=>{r.innerHTML=e})),a.innerHTML=" "+i+" ",this.table.modules.localize.langBind("pagination|counter|of",(e=>{l.innerHTML=e})),h.innerHTML=" "+o+" ",this.table.modules.localize.langBind("pagination|counter|pages",(e=>{d.innerHTML=e})),n.appendChild(r),n.appendChild(a),n.appendChild(l),n.appendChild(h),n.appendChild(d),n}};class Q extends o{constructor(e){super(e),this.mode="local",this.progressiveLoad=!1,this.element=null,this.pageCounterElement=null,this.pageCounter=null,this.size=0,this.page=1,this.count=5,this.max=1,this.remoteRowCountEstimate=null,this.displayIndex=0,this.initialLoad=!0,this.dataChanging=!1,this.pageSizes=[],this.registerTableOption("pagination",!1),this.registerTableOption("paginationMode","local"),this.registerTableOption("paginationSize",!1),this.registerTableOption("paginationInitialPage",1),this.registerTableOption("paginationCounter",!1),this.registerTableOption("paginationCounterElement",!1),this.registerTableOption("paginationButtonCount",5),this.registerTableOption("paginationSizeSelector",!1),this.registerTableOption("paginationElement",!1),this.registerTableOption("paginationAddRow","page"),this.registerTableOption("progressiveLoad",!1),this.registerTableOption("progressiveLoadDelay",0),this.registerTableOption("progressiveLoadScrollMargin",0),this.registerTableFunction("setMaxPage",this.setMaxPage.bind(this)),this.registerTableFunction("setPage",this.setPage.bind(this)),this.registerTableFunction("setPageToRow",this.userSetPageToRow.bind(this)),this.registerTableFunction("setPageSize",this.userSetPageSize.bind(this)),this.registerTableFunction("getPageSize",this.getPageSize.bind(this)),this.registerTableFunction("previousPage",this.previousPage.bind(this)),this.registerTableFunction("nextPage",this.nextPage.bind(this)),this.registerTableFunction("getPage",this.getPage.bind(this)),this.registerTableFunction("getPageMax",this.getPageMax.bind(this)),this.registerComponentFunction("row","pageTo",this.setPageToRow.bind(this))}initialize(){this.table.options.pagination?(this.subscribe("row-deleted",this.rowsUpdated.bind(this)),this.subscribe("row-added",this.rowsUpdated.bind(this)),this.subscribe("data-processed",this.initialLoadComplete.bind(this)),this.subscribe("table-built",this.calculatePageSizes.bind(this)),this.subscribe("footer-redraw",this.footerRedraw.bind(this)),"page"==this.table.options.paginationAddRow&&this.subscribe("row-adding-position",this.rowAddingPosition.bind(this)),"remote"===this.table.options.paginationMode&&(this.subscribe("data-params",this.remotePageParams.bind(this)),this.subscribe("data-loaded",this._parseRemoteData.bind(this))),this.table.options.progressiveLoad&&console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time"),this.registerDisplayHandler(this.restOnRenderBefore.bind(this),40),this.registerDisplayHandler(this.getRows.bind(this),50),this.createElements(),this.initializePageCounter(),this.initializePaginator()):this.table.options.progressiveLoad&&(this.subscribe("data-params",this.remotePageParams.bind(this)),this.subscribe("data-loaded",this._parseRemoteData.bind(this)),this.subscribe("table-built",this.calculatePageSizes.bind(this)),this.subscribe("data-processed",this.initialLoadComplete.bind(this)),this.initializeProgressive(this.table.options.progressiveLoad),"scroll"===this.table.options.progressiveLoad&&this.subscribe("scroll-vertical",this.scrollVertical.bind(this)))}rowAddingPosition(e,t){var i,s=this.table.rowManager,o=s.getDisplayRows();return t?o.length?i=o[0]:s.activeRows.length&&(i=s.activeRows[s.activeRows.length-1],t=!1):o.length&&(i=o[o.length-1],t=!(o.length{}))}restOnRenderBefore(e,t){return t||"local"===this.mode&&this.reset(),e}rowsUpdated(){this.refreshData(!0,"all")}createElements(){var e;this.element=document.createElement("span"),this.element.classList.add("tabulator-paginator"),this.pagesElement=document.createElement("span"),this.pagesElement.classList.add("tabulator-pages"),(e=document.createElement("button")).classList.add("tabulator-page"),e.setAttribute("type","button"),e.setAttribute("role","button"),e.setAttribute("aria-label",""),e.setAttribute("title",""),this.firstBut=e.cloneNode(!0),this.firstBut.setAttribute("data-page","first"),this.prevBut=e.cloneNode(!0),this.prevBut.setAttribute("data-page","prev"),this.nextBut=e.cloneNode(!0),this.nextBut.setAttribute("data-page","next"),this.lastBut=e.cloneNode(!0),this.lastBut.setAttribute("data-page","last"),this.table.options.paginationSizeSelector&&(this.pageSizeSelect=document.createElement("select"),this.pageSizeSelect.classList.add("tabulator-page-size"))}generatePageSizeSelectList(){var e=[];if(this.pageSizeSelect){if(Array.isArray(this.table.options.paginationSizeSelector))e=this.table.options.paginationSizeSelector,this.pageSizes=e,-1==this.pageSizes.indexOf(this.size)&&e.unshift(this.size);else if(-1==this.pageSizes.indexOf(this.size)){e=[];for(let t=1;t<5;t++)e.push(this.size*t);this.pageSizes=e}else e=this.pageSizes;for(;this.pageSizeSelect.firstChild;)this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);e.forEach((e=>{var t=document.createElement("option");t.value=e,!0===e?this.langBind("pagination|all",(function(e){t.innerHTML=e})):t.innerHTML=e,this.pageSizeSelect.appendChild(t)})),this.pageSizeSelect.value=this.size}}initializePageCounter(){var e=this.table.options.paginationCounter,t=null;e&&((t="function"==typeof e?e:Q.pageCounters[e])?(this.pageCounter=t,this.pageCounterElement=document.createElement("span"),this.pageCounterElement.classList.add("tabulator-page-counter")):console.warn("Pagination Error - No such page counter found: ",e))}initializePaginator(e){var t,i;e||(this.langBind("pagination|first",(e=>{this.firstBut.innerHTML=e})),this.langBind("pagination|first_title",(e=>{this.firstBut.setAttribute("aria-label",e),this.firstBut.setAttribute("title",e)})),this.langBind("pagination|prev",(e=>{this.prevBut.innerHTML=e})),this.langBind("pagination|prev_title",(e=>{this.prevBut.setAttribute("aria-label",e),this.prevBut.setAttribute("title",e)})),this.langBind("pagination|next",(e=>{this.nextBut.innerHTML=e})),this.langBind("pagination|next_title",(e=>{this.nextBut.setAttribute("aria-label",e),this.nextBut.setAttribute("title",e)})),this.langBind("pagination|last",(e=>{this.lastBut.innerHTML=e})),this.langBind("pagination|last_title",(e=>{this.lastBut.setAttribute("aria-label",e),this.lastBut.setAttribute("title",e)})),this.firstBut.addEventListener("click",(()=>{this.setPage(1)})),this.prevBut.addEventListener("click",(()=>{this.previousPage()})),this.nextBut.addEventListener("click",(()=>{this.nextPage()})),this.lastBut.addEventListener("click",(()=>{this.setPage(this.max)})),this.table.options.paginationElement&&(this.element=this.table.options.paginationElement),this.pageSizeSelect&&(t=document.createElement("label"),this.langBind("pagination|page_size",(e=>{this.pageSizeSelect.setAttribute("aria-label",e),this.pageSizeSelect.setAttribute("title",e),t.innerHTML=e})),this.element.appendChild(t),this.element.appendChild(this.pageSizeSelect),this.pageSizeSelect.addEventListener("change",(e=>{this.setPageSize("true"==this.pageSizeSelect.value||this.pageSizeSelect.value),this.setPage(1)}))),this.element.appendChild(this.firstBut),this.element.appendChild(this.prevBut),this.element.appendChild(this.pagesElement),this.element.appendChild(this.nextBut),this.element.appendChild(this.lastBut),this.table.options.paginationElement||e||(this.table.options.paginationCounter&&(this.table.options.paginationCounterElement?this.table.options.paginationCounterElement instanceof HTMLElement?this.table.options.paginationCounterElement.appendChild(this.pageCounterElement):"string"==typeof this.table.options.paginationCounterElement&&((i=document.querySelector(this.table.options.paginationCounterElement))?i.appendChild(this.pageCounterElement):console.warn("Pagination Error - Unable to find element matching paginationCounterElement selector:",this.table.options.paginationCounterElement)):this.footerAppend(this.pageCounterElement)),this.footerAppend(this.element)),this.page=this.table.options.paginationInitialPage,this.count=this.table.options.paginationButtonCount),this.mode=this.table.options.paginationMode}initializeProgressive(e){this.initializePaginator(!0),this.mode="progressive_"+e,this.progressiveLoad=!0}trackChanges(){this.dispatch("page-changed")}setDisplayIndex(e){this.displayIndex=e}getDisplayIndex(){return this.displayIndex}setMaxRows(e){this.max=e?!0===this.size?1:Math.ceil(e/this.size):1,this.page>this.max&&(this.page=this.max)}reset(e){this.initialLoad||("local"==this.mode||e)&&(this.page=1)}setMaxPage(e){e=parseInt(e),this.max=e||1,this.page>this.max&&(this.page=this.max,this.trigger())}setPage(e){switch(e){case"first":return this.setPage(1);case"prev":return this.previousPage();case"next":return this.nextPage();case"last":return this.setPage(this.max)}return(e=parseInt(e))>0&&e<=this.max||"local"!==this.mode?(this.page=e,this.trackChanges(),this.trigger()):(console.warn("Pagination Error - Requested page is out of range of 1 - "+this.max+":",e),Promise.reject())}setPageToRow(e){var t=this.table.rowManager.getDisplayRows(this.displayIndex-1).indexOf(e);if(t>-1){var i=!0===this.size?1:Math.ceil((t+1)/this.size);return this.setPage(i)}return console.warn("Pagination Error - Requested row is not visible"),Promise.reject()}setPageSize(e){!0!==e&&(e=parseInt(e)),e>0&&(this.size=e,this.dispatchExternal("pageSizeChanged",e)),this.pageSizeSelect&&this.generatePageSizeSelectList(),this.trackChanges()}_setPageCounter(e,t,i){var s;if(this.pageCounter)switch("remote"===this.mode&&(t=this.size,i=(this.page-1)*this.size+1,e=this.remoteRowCountEstimate),typeof(s=this.pageCounter.call(this,t,i,this.page,e,this.max))){case"object":if(s instanceof Node){for(;this.pageCounterElement.firstChild;)this.pageCounterElement.removeChild(this.pageCounterElement.firstChild);this.pageCounterElement.appendChild(s)}else this.pageCounterElement.innerHTML="",null!=s&&console.warn("Page Counter Error - Page Counter has returned a type of object, the only valid page counter object return is an instance of Node, the page counter returned:",s);break;case"undefined":this.pageCounterElement.innerHTML="";break;default:this.pageCounterElement.innerHTML=s}}_setPageButtons(){let e=Math.floor((this.count-1)/2),t=Math.ceil((this.count-1)/2),i=this.max-this.page+e+10&&e<=this.max&&this.pagesElement.appendChild(this._generatePageButton(e));this.footerRedraw()}_generatePageButton(e){var t=document.createElement("button");return t.classList.add("tabulator-page"),e==this.page&&t.classList.add("active"),t.setAttribute("type","button"),t.setAttribute("role","button"),this.langBind("pagination|page_title",(i=>{t.setAttribute("aria-label",i+" "+e),t.setAttribute("title",i+" "+e)})),t.setAttribute("data-page",e),t.textContent=e,t.addEventListener("click",(t=>{this.setPage(e)})),t}previousPage(){return this.page>1?(this.page--,this.trackChanges(),this.trigger()):(console.warn("Pagination Error - Previous page would be less than page 1:",0),Promise.reject())}nextPage(){return this.page"row"===e.type));if("local"==this.mode){t=[],this.setMaxRows(e.length),!0===this.size?(i=0,s=e.length):s=(i=this.size*(this.page-1))+parseInt(this.size),this._setPageButtons();for(let r=i;r{this.dataChanging=!1}));case"progressive_load":case"progressive_scroll":return this.reloadData(null,!0);default:return console.warn("Pagination Error - no such pagination mode:",this.mode),Promise.reject()}}_parseRemoteData(e){var t;if(void 0===e.last_page&&console.warn("Remote Pagination Error - Server response missing '"+(this.options("dataReceiveParams").last_page||"last_page")+"' property"),e.data){if(this.max=parseInt(e.last_page)||1,this.remoteRowCountEstimate=void 0!==e.last_row?e.last_row:e.last_page*this.size-(this.page==e.last_page?this.size-e.data.length:0),this.progressiveLoad){switch(this.mode){case"progressive_load":1==this.page?this.table.rowManager.setData(e.data,!1,1==this.page):this.table.rowManager.addRows(e.data),this.page{this.nextPage()}),this.table.options.progressiveLoadDelay);break;case"progressive_scroll":e=1===this.page?e.data:this.table.rowManager.getData().concat(e.data),this.table.rowManager.setData(e,1!==this.page,1==this.page),t=this.table.options.progressiveLoadScrollMargin||2*this.table.rowManager.element.clientHeight,this.table.rowManager.element.scrollHeight<=this.table.rowManager.element.clientHeight+t&&this.page{this.nextPage()}))}return!1}this.dispatchExternal("pageLoaded",this.getPage())}else console.warn("Remote Pagination Error - Server response missing '"+(this.options("dataReceiveParams").data||"data")+"' property");return e.data}footerRedraw(){var e=this.table.footerManager.containerElement;Math.ceil(e.clientWidth)-e.scrollWidth<0?this.pagesElement.style.display="none":(this.pagesElement.style.display="",Math.ceil(e.clientWidth)-e.scrollWidth<0&&(this.pagesElement.style.display="none"))}}Q.moduleName="page",Q.pageCounters=Z;var ee={local:function(e,t){var i=localStorage.getItem(e+"-"+t);return!!i&&JSON.parse(i)},cookie:function(e,t){var i,s,o=document.cookie,n=e+"-"+t,r=o.indexOf(n+"=");return r>-1&&((i=(o=o.slice(r)).indexOf(";"))>-1&&(o=o.slice(0,i)),s=o.replace(n+"=","")),!!s&&JSON.parse(s)}},te={local:function(e,t,i){localStorage.setItem(e+"-"+t,JSON.stringify(i))},cookie:function(e,t,i){var s=new Date;s.setDate(s.getDate()+1e4),document.cookie=e+"-"+t+"="+JSON.stringify(i)+"; expires="+s.toUTCString()}};class ie extends o{constructor(e){super(e),this.mode="",this.id="",this.defWatcherBlock=!1,this.config={},this.readFunc=!1,this.writeFunc=!1,this.registerTableOption("persistence",!1),this.registerTableOption("persistenceID",""),this.registerTableOption("persistenceMode",!0),this.registerTableOption("persistenceReaderFunc",!1),this.registerTableOption("persistenceWriterFunc",!1)}localStorageTest(){var e="_tabulator_test";try{return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}}initialize(){if(this.table.options.persistence){var e,t=this.table.options.persistenceMode,i=this.table.options.persistenceID;this.mode=!0!==t?t:this.localStorageTest()?"local":"cookie",this.table.options.persistenceReaderFunc?"function"==typeof this.table.options.persistenceReaderFunc?this.readFunc=this.table.options.persistenceReaderFunc:ie.readers[this.table.options.persistenceReaderFunc]?this.readFunc=ie.readers[this.table.options.persistenceReaderFunc]:console.warn("Persistence Read Error - invalid reader set",this.table.options.persistenceReaderFunc):ie.readers[this.mode]?this.readFunc=ie.readers[this.mode]:console.warn("Persistence Read Error - invalid reader set",this.mode),this.table.options.persistenceWriterFunc?"function"==typeof this.table.options.persistenceWriterFunc?this.writeFunc=this.table.options.persistenceWriterFunc:ie.writers[this.table.options.persistenceWriterFunc]?this.writeFunc=ie.writers[this.table.options.persistenceWriterFunc]:console.warn("Persistence Write Error - invalid reader set",this.table.options.persistenceWriterFunc):ie.writers[this.mode]?this.writeFunc=ie.writers[this.mode]:console.warn("Persistence Write Error - invalid writer set",this.mode),this.id="tabulator-"+(i||this.table.element.getAttribute("id")||""),this.config={sort:!0===this.table.options.persistence||this.table.options.persistence.sort,filter:!0===this.table.options.persistence||this.table.options.persistence.filter,group:!0===this.table.options.persistence||this.table.options.persistence.group,page:!0===this.table.options.persistence||this.table.options.persistence.page,columns:!0===this.table.options.persistence?["title","width","visible"]:this.table.options.persistence.columns},this.config.page&&(e=this.retreiveData("page"))&&(void 0===e.paginationSize||!0!==this.config.page&&!this.config.page.size||(this.table.options.paginationSize=e.paginationSize),void 0===e.paginationInitialPage||!0!==this.config.page&&!this.config.page.page||(this.table.options.paginationInitialPage=e.paginationInitialPage)),this.config.group&&(e=this.retreiveData("group"))&&(void 0===e.groupBy||!0!==this.config.group&&!this.config.group.groupBy||(this.table.options.groupBy=e.groupBy),void 0===e.groupStartOpen||!0!==this.config.group&&!this.config.group.groupStartOpen||(this.table.options.groupStartOpen=e.groupStartOpen),void 0===e.groupHeader||!0!==this.config.group&&!this.config.group.groupHeader||(this.table.options.groupHeader=e.groupHeader)),this.config.columns&&(this.table.options.columns=this.load("columns",this.table.options.columns),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-show",this.save.bind(this,"columns")),this.subscribe("column-hide",this.save.bind(this,"columns")),this.subscribe("column-moved",this.save.bind(this,"columns"))),this.subscribe("table-built",this.tableBuilt.bind(this),0),this.subscribe("table-redraw",this.tableRedraw.bind(this)),this.subscribe("filter-changed",this.eventSave.bind(this,"filter")),this.subscribe("sort-changed",this.eventSave.bind(this,"sort")),this.subscribe("group-changed",this.eventSave.bind(this,"group")),this.subscribe("page-changed",this.eventSave.bind(this,"page")),this.subscribe("column-resized",this.eventSave.bind(this,"columns")),this.subscribe("layout-refreshed",this.eventSave.bind(this,"columns"))}this.registerTableFunction("getColumnLayout",this.getColumnLayout.bind(this)),this.registerTableFunction("setColumnLayout",this.setColumnLayout.bind(this))}eventSave(e){this.config[e]&&this.save(e)}tableBuilt(){var e,t;this.table.options;this.config.sort&&!1==!(e=this.load("sort"))&&(this.table.options.initialSort=e),this.config.filter&&!1==!(t=this.load("filter"))&&(this.table.options.initialFilter=t)}tableRedraw(e){e&&this.config.columns&&this.save("columns")}getColumnLayout(){return this.parseColumns(this.table.columnManager.getColumns())}setColumnLayout(e){return this.table.columnManager.setColumns(this.mergeDefinition(this.table.options.columns,e)),!0}initializeColumn(e){var t;this.config.columns&&(this.defWatcherBlock=!0,t=e.getDefinition(),(!0===this.config.columns?Object.keys(t):this.config.columns).forEach((e=>{var i=Object.getOwnPropertyDescriptor(t,e),s=t[e];i&&Object.defineProperty(t,e,{set:function(e){s=e,this.defWatcherBlock||this.save("columns"),i.set&&i.set(e)},get:function(){return i.get&&i.get(),s}})})),this.defWatcherBlock=!1)}load(e,t){var i=this.retreiveData(e);return t&&(i=i?this.mergeDefinition(t,i):t),i}retreiveData(e){return!!this.readFunc&&this.readFunc(this.id,e)}mergeDefinition(e,t){var i=[];return(t=t||[]).forEach(((t,s)=>{var o,n=this._findColumn(e,t);n&&(!0===this.config.columns||null==this.config.columns?(o=Object.keys(n)).push("width"):o=this.config.columns,o.forEach((e=>{"columns"!==e&&void 0!==t[e]&&(n[e]=t[e])})),n.columns&&(n.columns=this.mergeDefinition(n.columns,t.columns)),i.push(n))})),e.forEach(((e,s)=>{this._findColumn(t,e)||(i.length>s?i.splice(s,0,e):i.push(e))})),i}_findColumn(e,t){var i=t.columns?"group":t.field?"field":"object";return e.find((function(e){switch(i){case"group":return e.title===t.title&&e.columns.length===t.columns.length;case"field":return e.field===t.field;case"object":return e===t}}))}save(e){var t={};switch(e){case"columns":t=this.parseColumns(this.table.columnManager.getColumns());break;case"filter":t=this.table.modules.filter.getFilters();break;case"sort":t=this.validateSorters(this.table.modules.sort.getSort());break;case"group":t=this.getGroupConfig();break;case"page":t=this.getPageConfig()}this.writeFunc&&this.writeFunc(this.id,e,t)}validateSorters(e){return e.forEach((function(e){e.column=e.field,delete e.field})),e}getGroupConfig(){var e={};return this.config.group&&((!0===this.config.group||this.config.group.groupBy)&&(e.groupBy=this.table.options.groupBy),(!0===this.config.group||this.config.group.groupStartOpen)&&(e.groupStartOpen=this.table.options.groupStartOpen),(!0===this.config.group||this.config.group.groupHeader)&&(e.groupHeader=this.table.options.groupHeader)),e}getPageConfig(){var e={};return this.config.page&&((!0===this.config.page||this.config.page.size)&&(e.paginationSize=this.table.modules.page.getPageSize()),(!0===this.config.page||this.config.page.page)&&(e.paginationInitialPage=this.table.modules.page.getPage())),e}parseColumns(e){var t=[],i=["headerContextMenu","headerMenu","contextMenu","clickMenu"];return e.forEach((e=>{var s,o={},n=e.getDefinition();e.isGroup?(o.title=n.title,o.columns=this.parseColumns(e.getColumns())):(o.field=e.getField(),!0===this.config.columns||null==this.config.columns?((s=Object.keys(n)).push("width"),s.push("visible")):s=this.config.columns,s.forEach((t=>{switch(t){case"width":o.width=e.getWidth();break;case"visible":o.visible=e.visible;break;default:"function"!=typeof n[t]&&-1===i.indexOf(t)&&(o[t]=n[t])}}))),t.push(o)})),t}}ie.moduleName="persistence",ie.moduleInitOrder=-10,ie.readers=ee,ie.writers=te;class se extends o{constructor(e){super(e),this.columnSubscribers={},this.registerTableOption("rowContextPopup",!1),this.registerTableOption("rowClickPopup",!1),this.registerTableOption("groupContextPopup",!1),this.registerTableOption("groupClickPopup",!1),this.registerColumnOption("headerContextPopup"),this.registerColumnOption("headerClickPopup"),this.registerColumnOption("headerPopup"),this.registerColumnOption("headerPopupIcon"),this.registerColumnOption("contextPopup"),this.registerColumnOption("clickPopup")}initialize(){this.initializeRowWatchers(),this.initializeGroupWatchers(),this.subscribe("column-init",this.initializeColumn.bind(this))}initializeRowWatchers(){this.table.options.rowContextPopup&&(this.subscribe("row-contextmenu",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup)),this.table.on("rowTapHold",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup))),this.table.options.rowClickPopup&&this.subscribe("row-click",this.loadPopupEvent.bind(this,this.table.options.rowClickPopup))}initializeGroupWatchers(){this.table.options.groupContextPopup&&(this.subscribe("group-contextmenu",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup)),this.table.on("groupTapHold",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup))),this.table.options.groupClickPopup&&this.subscribe("group-click",this.loadPopupEvent.bind(this,this.table.options.groupClickPopup))}initializeColumn(e){var t=e.definition;t.headerContextPopup&&!this.columnSubscribers.headerContextPopup&&(this.columnSubscribers.headerContextPopup=this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"),this.subscribe("column-contextmenu",this.columnSubscribers.headerContextPopup),this.table.on("headerTapHold",this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"))),t.headerClickPopup&&!this.columnSubscribers.headerClickPopup&&(this.columnSubscribers.headerClickPopup=this.loadPopupTableColumnEvent.bind(this,"headerClickPopup"),this.subscribe("column-click",this.columnSubscribers.headerClickPopup)),t.headerPopup&&this.initializeColumnHeaderPopup(e),t.contextPopup&&!this.columnSubscribers.contextPopup&&(this.columnSubscribers.contextPopup=this.loadPopupTableCellEvent.bind(this,"contextPopup"),this.subscribe("cell-contextmenu",this.columnSubscribers.contextPopup),this.table.on("cellTapHold",this.loadPopupTableCellEvent.bind(this,"contextPopup"))),t.clickPopup&&!this.columnSubscribers.clickPopup&&(this.columnSubscribers.clickPopup=this.loadPopupTableCellEvent.bind(this,"clickPopup"),this.subscribe("cell-click",this.columnSubscribers.clickPopup))}initializeColumnHeaderPopup(e){var t,i=e.definition.headerPopupIcon;(t=document.createElement("span")).classList.add("tabulator-header-popup-button"),i?("function"==typeof i&&(i=i(e.getComponent())),i instanceof HTMLElement?t.appendChild(i):t.innerHTML=i):t.innerHTML="⋮",t.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault(),this.loadPopupEvent(e.definition.headerPopup,t,e)})),e.titleElement.insertBefore(t,e.titleElement.firstChild)}loadPopupTableCellEvent(e,t,i){i._cell&&(i=i._cell),i.column.definition[e]&&this.loadPopupEvent(i.column.definition[e],t,i)}loadPopupTableColumnEvent(e,t,i){i._column&&(i=i._column),i.definition[e]&&this.loadPopupEvent(i.definition[e],t,i)}loadPopupEvent(e,t,i){var s;i._group?i=i._group:i._row&&(i=i._row),e="function"==typeof e?e.call(this.table,t,i.getComponent(),(function(e){s=e})):e,this.loadPopup(t,i,e,s)}loadPopup(e,t,i,s){var o,n,r=!(e instanceof MouseEvent);i instanceof HTMLElement?o=i:(o=document.createElement("div")).innerHTML=i,o.classList.add("tabulator-popup"),o.addEventListener("click",(e=>{e.stopPropagation()})),r||e.preventDefault(),n=this.popup(o),"function"==typeof s&&n.renderCallback(s),n.show(e).hideOnBlur((()=>{this.dispatchExternal("popupClosed",t.getComponent())})),this.dispatchExternal("popupOpened",t.getComponent())}}se.moduleName="popup";class oe extends o{constructor(e){super(e),this.element=!1,this.manualBlock=!1,this.registerTableOption("printAsHtml",!1),this.registerTableOption("printFormatter",!1),this.registerTableOption("printHeader",!1),this.registerTableOption("printFooter",!1),this.registerTableOption("printStyled",!0),this.registerTableOption("printRowRange","visible"),this.registerTableOption("printConfig",{}),this.registerColumnOption("print"),this.registerColumnOption("titlePrint")}initialize(){this.table.options.printAsHtml&&(window.addEventListener("beforeprint",this.replaceTable.bind(this)),window.addEventListener("afterprint",this.cleanup.bind(this))),this.registerTableFunction("print",this.printFullscreen.bind(this))}replaceTable(){this.manualBlock||(this.element=document.createElement("div"),this.element.classList.add("tabulator-print-table"),this.element.appendChild(this.table.modules.export.genereateTable(this.table.options.printConfig,this.table.options.printStyled,this.table.options.printRowRange,"print")),this.table.element.style.display="none",this.table.element.parentNode.insertBefore(this.element,this.table.element))}cleanup(){document.body.classList.remove("tabulator-print-fullscreen-hide"),this.element&&this.element.parentNode&&(this.element.parentNode.removeChild(this.element),this.table.element.style.display="")}printFullscreen(e,t,i){var s,o,n=window.scrollX,r=window.scrollY,a=document.createElement("div"),l=document.createElement("div"),h=this.table.modules.export.genereateTable(void 0!==i?i:this.table.options.printConfig,void 0!==t?t:this.table.options.printStyled,e||this.table.options.printRowRange,"print");this.manualBlock=!0,this.element=document.createElement("div"),this.element.classList.add("tabulator-print-fullscreen"),this.table.options.printHeader&&(a.classList.add("tabulator-print-header"),"string"==typeof(s="function"==typeof this.table.options.printHeader?this.table.options.printHeader.call(this.table):this.table.options.printHeader)?a.innerHTML=s:a.appendChild(s),this.element.appendChild(a)),this.element.appendChild(h),this.table.options.printFooter&&(l.classList.add("tabulator-print-footer"),"string"==typeof(o="function"==typeof this.table.options.printFooter?this.table.options.printFooter.call(this.table):this.table.options.printFooter)?l.innerHTML=o:l.appendChild(o),this.element.appendChild(l)),document.body.classList.add("tabulator-print-fullscreen-hide"),document.body.appendChild(this.element),this.table.options.printFormatter&&this.table.options.printFormatter(this.element,h),window.print(),this.cleanup(),window.scrollTo(n,r),this.manualBlock=!1}}oe.moduleName="print";class ne extends o{constructor(e){super(e),this.data=!1,this.blocked=!1,this.origFuncs={},this.currentVersion=0,this.registerTableOption("reactiveData",!1)}initialize(){this.table.options.reactiveData&&(this.subscribe("cell-value-save-before",this.block.bind(this)),this.subscribe("cell-value-save-after",this.unblock.bind(this)),this.subscribe("row-data-save-before",this.block.bind(this)),this.subscribe("row-data-save-after",this.unblock.bind(this)),this.subscribe("row-data-init-after",this.watchRow.bind(this)),this.subscribe("data-processing",this.watchData.bind(this)),this.subscribe("table-destroy",this.unwatchData.bind(this)))}watchData(e){var t,i=this;this.currentVersion++,t=this.currentVersion,this.unwatchData(),this.data=e,this.origFuncs.push=e.push,Object.defineProperty(this.data,"push",{enumerable:!1,configurable:!0,value:function(){var s=Array.from(arguments);return i.blocked||t!==i.currentVersion||s.forEach((e=>{i.table.rowManager.addRowActual(e,!1)})),i.origFuncs.push.apply(e,arguments)}}),this.origFuncs.unshift=e.unshift,Object.defineProperty(this.data,"unshift",{enumerable:!1,configurable:!0,value:function(){var s=Array.from(arguments);return i.blocked||t!==i.currentVersion||s.forEach((e=>{i.table.rowManager.addRowActual(e,!0)})),i.origFuncs.unshift.apply(e,arguments)}}),this.origFuncs.shift=e.shift,Object.defineProperty(this.data,"shift",{enumerable:!1,configurable:!0,value:function(){var s;return i.blocked||t!==i.currentVersion||i.data.length&&(s=i.table.rowManager.getRowFromDataObject(i.data[0]))&&s.deleteActual(),i.origFuncs.shift.call(e)}}),this.origFuncs.pop=e.pop,Object.defineProperty(this.data,"pop",{enumerable:!1,configurable:!0,value:function(){var s;return i.blocked||t!==i.currentVersion||i.data.length&&(s=i.table.rowManager.getRowFromDataObject(i.data[i.data.length-1]))&&s.deleteActual(),i.origFuncs.pop.call(e)}}),this.origFuncs.splice=e.splice,Object.defineProperty(this.data,"splice",{enumerable:!1,configurable:!0,value:function(){var s,o=Array.from(arguments),n=o[0]<0?e.length+o[0]:o[0],r=o[1],a=!!o[2]&&o.slice(2);if(!i.blocked&&t===i.currentVersion){if(a&&((s=!!e[n]&&i.table.rowManager.getRowFromDataObject(e[n]))?a.forEach((e=>{i.table.rowManager.addRowActual(e,!0,s,!0)})):(a=a.slice().reverse()).forEach((e=>{i.table.rowManager.addRowActual(e,!0,!1,!0)}))),0!==r){var l=e.slice(n,void 0===o[1]?o[1]:n+r);l.forEach(((e,t)=>{var s=i.table.rowManager.getRowFromDataObject(e);s&&s.deleteActual(t!==l.length-1)}))}(a||0!==r)&&i.table.rowManager.reRenderInPosition()}return i.origFuncs.splice.apply(e,arguments)}})}unwatchData(){if(!1!==this.data)for(var e in this.origFuncs)Object.defineProperty(this.data,e,{enumerable:!0,configurable:!0,writable:!0,value:this.origFuncs.key})}watchRow(e){var t=e.getData();for(var i in this.blocked=!0,t)this.watchKey(e,t,i);this.table.options.dataTree&&this.watchTreeChildren(e),this.blocked=!1}watchTreeChildren(e){var t=e.getData()[this.table.options.dataTreeChildField],i={};function s(){this.table.modules.dataTree.initializeRow(e),this.table.modules.dataTree.layoutRow(e),this.table.rowManager.refreshActiveData("tree",!1,!0)}t&&(i.push=t.push,Object.defineProperty(t,"push",{enumerable:!1,configurable:!0,value:()=>{var e=i.push.apply(t,arguments);return s(),e}}),i.unshift=t.unshift,Object.defineProperty(t,"unshift",{enumerable:!1,configurable:!0,value:()=>{var e=i.unshift.apply(t,arguments);return s(),e}}),i.shift=t.shift,Object.defineProperty(t,"shift",{enumerable:!1,configurable:!0,value:()=>{var e=i.shift.call(t);return s(),e}}),i.pop=t.pop,Object.defineProperty(t,"pop",{enumerable:!1,configurable:!0,value:()=>{var e=i.pop.call(t);return s(),e}}),i.splice=t.splice,Object.defineProperty(t,"splice",{enumerable:!1,configurable:!0,value:()=>{var e=i.splice.apply(t,arguments);return s(),e}}))}watchKey(e,t,i){var s=Object.getOwnPropertyDescriptor(t,i),o=t[i],n=this.currentVersion;Object.defineProperty(t,i,{set:t=>{if(o=t,!this.blocked&&n===this.currentVersion){var r={};r[i]=t,e.updateData(r)}s.set&&s.set(t)},get:()=>(s.get&&s.get(),o)})}unwatchRow(e){var t=e.getData();for(var i in t)Object.defineProperty(t,i,{value:t[i]})}block(){this.blocked=!0}unblock(){this.blocked=!1}}ne.moduleName="reactiveData";class re extends o{constructor(e){super(e),this.startColumn=!1,this.startX=!1,this.startWidth=!1,this.latestX=!1,this.handle=null,this.initialNextColumn=null,this.nextColumn=null,this.initialized=!1,this.registerColumnOption("resizable",!0),this.registerTableOption("resizableColumnFit",!1)}initialize(){this.subscribe("column-rendered",this.layoutColumnHeader.bind(this))}initializeEventWatchers(){this.initialized||(this.subscribe("cell-rendered",this.layoutCellHandles.bind(this)),this.subscribe("cell-delete",this.deInitializeComponent.bind(this)),this.subscribe("cell-height",this.resizeHandle.bind(this)),this.subscribe("column-moved",this.columnLayoutUpdated.bind(this)),this.subscribe("column-hide",this.deInitializeColumn.bind(this)),this.subscribe("column-show",this.columnLayoutUpdated.bind(this)),this.subscribe("column-width",this.columnWidthUpdated.bind(this)),this.subscribe("column-delete",this.deInitializeComponent.bind(this)),this.subscribe("column-height",this.resizeHandle.bind(this)),this.initialized=!0)}layoutCellHandles(e){"row"===e.row.type&&(this.deInitializeComponent(e),this.initializeColumn("cell",e,e.column,e.element))}layoutColumnHeader(e){e.definition.resizable&&(this.initializeEventWatchers(),this.deInitializeComponent(e),this.initializeColumn("header",e,e,e.element))}columnLayoutUpdated(e){var t=e.prevColumn();this.reinitializeColumn(e),t&&this.reinitializeColumn(t)}columnWidthUpdated(e){e.modules.frozen&&(this.table.modules.frozenColumns.leftColumns.includes(e)?this.table.modules.frozenColumns.leftColumns.forEach((e=>{this.reinitializeColumn(e)})):this.table.modules.frozenColumns.rightColumns.includes(e)&&this.table.modules.frozenColumns.rightColumns.forEach((e=>{this.reinitializeColumn(e)})))}reinitializeColumn(e){var t=!!e.modules.frozen&&e.modules.frozen.marginValue+e.getWidth()+"px";e.cells.forEach((e=>{e.modules.resize&&e.modules.resize.handleEl&&(t&&(e.modules.resize.handleEl.style.left=t),e.element.after(e.modules.resize.handleEl))})),e.modules.resize&&e.modules.resize.handleEl&&(t&&(e.modules.resize.handleEl.style.left=t),e.element.after(e.modules.resize.handleEl))}initializeColumn(e,t,i,s){var o=this,n=i.definition.resizable,r={},a=i.getLastColumn();if("header"===e&&(r={variableHeight:"textarea"==i.definition.formatter||i.definition.variableHeight}),(!0===n||n==e)&&this._checkResizability(a)){var l=document.createElement("span");l.className="tabulator-col-resize-handle",l.addEventListener("click",(function(e){e.stopPropagation()}));var h=function(e){o.startColumn=i,o.initialNextColumn=o.nextColumn=a.nextColumn(),o._mouseDown(e,a,l)};l.addEventListener("mousedown",h),l.addEventListener("touchstart",h,{passive:!0}),l.addEventListener("dblclick",(e=>{var t=a.getWidth();e.stopPropagation(),a.reinitializeWidth(!0),t!==a.getWidth()&&(o.dispatch("column-resized",a),o.table.externalEvents.dispatch("columnResized",a.getComponent()))})),i.modules.frozen&&(l.style.position="absolute",l.style.left=i.modules.frozen.marginValue+i.getWidth()+"px"),r.handleEl=l,s.parentNode&&i.visible&&s.after(l)}t.modules.resize=r}deInitializeColumn(e){this.deInitializeComponent(e),e.cells.forEach((e=>{this.deInitializeComponent(e)}))}deInitializeComponent(e){var t;e.modules.resize&&(t=e.modules.resize.handleEl)&&t.parentElement&&t.parentElement.removeChild(t)}resizeHandle(e,t){e.modules.resize&&e.modules.resize.handleEl&&(e.modules.resize.handleEl.style.height=t)}_checkResizability(e){return e.definition.resizable}_mouseDown(e,t,i){var s=this;function o(e){var i,o,n=void 0===e.screenX?e.touches[0].screenX:e.screenX,r=n-s.startX,a=n-s.latestX;if(s.latestX=n,s.table.rtl&&(r=-r,a=-a),i=t.width==t.minWidth||t.width==t.maxWidth,t.setWidth(s.startWidth+r),o=t.width==t.minWidth||t.width==t.maxWidth,a<0&&(s.nextColumn=s.initialNextColumn),s.table.options.resizableColumnFit&&s.nextColumn&&(!i||!o)){let e=s.nextColumn.getWidth();a>0&&e<=s.nextColumn.minWidth&&(s.nextColumn=s.nextColumn.nextColumn()),s.nextColumn&&s.nextColumn.setWidth(s.nextColumn.getWidth()-a)}s.table.columnManager.renderer.rerenderColumns(!0),!s.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights()}function n(e){s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!1),s.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights(),document.body.removeEventListener("mouseup",n),document.body.removeEventListener("mousemove",o),i.removeEventListener("touchmove",o),i.removeEventListener("touchend",n),s.table.element.classList.remove("tabulator-block-select"),s.startWidth!==t.getWidth()&&(s.dispatch("column-resized",t),s.table.externalEvents.dispatch("columnResized",t.getComponent()))}s.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!0),s.startX=void 0===e.screenX?e.touches[0].screenX:e.screenX,s.latestX=s.startX,s.startWidth=t.getWidth(),document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",n),i.addEventListener("touchmove",o,{passive:!0}),i.addEventListener("touchend",n)}}re.moduleName="resizeColumns";class ae extends o{constructor(e){super(e),this.startColumn=!1,this.startY=!1,this.startHeight=!1,this.handle=null,this.prevHandle=null,this.registerTableOption("resizableRows",!1)}initialize(){this.table.options.resizableRows&&this.subscribe("row-layout-after",this.initializeRow.bind(this))}initializeRow(e){var t=this,i=e.getElement(),s=document.createElement("div");s.className="tabulator-row-resize-handle";var o=document.createElement("div");o.className="tabulator-row-resize-handle prev",s.addEventListener("click",(function(e){e.stopPropagation()}));var n=function(i){t.startRow=e,t._mouseDown(i,e,s)};s.addEventListener("mousedown",n),s.addEventListener("touchstart",n,{passive:!0}),o.addEventListener("click",(function(e){e.stopPropagation()}));var r=function(i){var s=t.table.rowManager.prevDisplayRow(e);s&&(t.startRow=s,t._mouseDown(i,s,o))};o.addEventListener("mousedown",r),o.addEventListener("touchstart",r,{passive:!0}),i.appendChild(s),i.appendChild(o)}_mouseDown(e,t,i){var s=this;function o(e){t.setHeight(s.startHeight+((void 0===e.screenY?e.touches[0].screenY:e.screenY)-s.startY))}function n(e){document.body.removeEventListener("mouseup",o),document.body.removeEventListener("mousemove",o),i.removeEventListener("touchmove",o),i.removeEventListener("touchend",n),s.table.element.classList.remove("tabulator-block-select"),s.dispatchExternal("rowResized",t.getComponent())}s.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),s.startY=void 0===e.screenY?e.touches[0].screenY:e.screenY,s.startHeight=t.getHeight(),document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",n),i.addEventListener("touchmove",o,{passive:!0}),i.addEventListener("touchend",n)}}ae.moduleName="resizeRows";class le extends o{constructor(e){super(e),this.binding=!1,this.observer=!1,this.containerObserver=!1,this.tableHeight=0,this.tableWidth=0,this.containerHeight=0,this.containerWidth=0,this.autoResize=!1,this.registerTableOption("autoResize",!0)}initialize(){if(this.table.options.autoResize){var e,t=this.table;this.tableHeight=t.element.clientHeight,this.tableWidth=t.element.clientWidth,t.element.parentNode&&(this.containerHeight=t.element.parentNode.clientHeight,this.containerWidth=t.element.parentNode.clientWidth),"undefined"!=typeof ResizeObserver&&"virtual"===t.rowManager.getRenderMode()?(this.autoResize=!0,this.observer=new ResizeObserver((e=>{if(!t.browserMobile||t.browserMobile&&!t.modules.edit.currentCell){var i=Math.floor(e[0].contentRect.height),s=Math.floor(e[0].contentRect.width);this.tableHeight==i&&this.tableWidth==s||(this.tableHeight=i,this.tableWidth=s,t.element.parentNode&&(this.containerHeight=t.element.parentNode.clientHeight,this.containerWidth=t.element.parentNode.clientWidth),this.table.columnManager.renderer.rerenderColumns(!0),t.redraw())}})),this.observer.observe(t.element),e=window.getComputedStyle(t.element),this.table.element.parentNode&&!this.table.rowManager.fixedHeight&&(e.getPropertyValue("max-height")||e.getPropertyValue("min-height"))&&(this.containerObserver=new ResizeObserver((e=>{if(!t.browserMobile||t.browserMobile&&!t.modules.edit.currentCell){var i=Math.floor(e[0].contentRect.height),s=Math.floor(e[0].contentRect.width);this.containerHeight==i&&this.containerWidth==s||(this.containerHeight=i,this.containerWidth=s,this.tableHeight=t.element.clientHeight,this.tableWidth=t.element.clientWidth),t.columnManager.renderer.rerenderColumns(!0),t.redraw()}})),this.containerObserver.observe(this.table.element.parentNode)),this.subscribe("table-resize",this.tableResized.bind(this))):(this.binding=function(){(!t.browserMobile||t.browserMobile&&!t.modules.edit.currentCell)&&(t.columnManager.renderer.rerenderColumns(!0),t.redraw())},window.addEventListener("resize",this.binding)),this.subscribe("table-destroy",this.clearBindings.bind(this))}}tableResized(){this.table.rowManager.redraw()}clearBindings(){this.binding&&window.removeEventListener("resize",this.binding),this.observer&&this.observer.unobserve(this.table.element),this.containerObserver&&this.containerObserver.unobserve(this.table.element.parentNode)}}le.moduleName="resizeTable";class he extends o{constructor(e){super(e),this.columns=[],this.hiddenColumns=[],this.mode="",this.index=0,this.collapseFormatter=[],this.collapseStartOpen=!0,this.collapseHandleColumn=!1,this.registerTableOption("responsiveLayout",!1),this.registerTableOption("responsiveLayoutCollapseStartOpen",!0),this.registerTableOption("responsiveLayoutCollapseUseFormatters",!0),this.registerTableOption("responsiveLayoutCollapseFormatter",!1),this.registerColumnOption("responsive")}initialize(){this.table.options.responsiveLayout&&(this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("column-show",this.updateColumnVisibility.bind(this)),this.subscribe("column-hide",this.updateColumnVisibility.bind(this)),this.subscribe("columns-loaded",this.initializeResponsivity.bind(this)),this.subscribe("column-moved",this.initializeResponsivity.bind(this)),this.subscribe("column-add",this.initializeResponsivity.bind(this)),this.subscribe("column-delete",this.initializeResponsivity.bind(this)),this.subscribe("table-redrawing",this.tableRedraw.bind(this)),"collapse"===this.table.options.responsiveLayout&&(this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout",this.layoutRow.bind(this))))}tableRedraw(e){-1===["fitColumns","fitDataStretch"].indexOf(this.layoutMode())&&(e||this.update())}initializeResponsivity(){var e=[];this.mode=this.table.options.responsiveLayout,this.collapseFormatter=this.table.options.responsiveLayoutCollapseFormatter||this.formatCollapsedData,this.collapseStartOpen=this.table.options.responsiveLayoutCollapseStartOpen,this.hiddenColumns=[],this.table.columnManager.columnsByIndex.forEach(((t,i)=>{t.modules.responsive&&t.modules.responsive.order&&t.modules.responsive.visible&&(t.modules.responsive.index=i,e.push(t),t.visible||"collapse"!==this.mode||this.hiddenColumns.push(t))})),e=(e=e.reverse()).sort(((e,t)=>t.modules.responsive.order-e.modules.responsive.order||t.modules.responsive.index-e.modules.responsive.index)),this.columns=e,"collapse"===this.mode&&this.generateCollapsedContent();for(let e of this.table.columnManager.columnsByIndex)if("responsiveCollapse"==e.definition.formatter){this.collapseHandleColumn=e;break}this.collapseHandleColumn&&(this.hiddenColumns.length?this.collapseHandleColumn.show():this.collapseHandleColumn.hide())}initializeColumn(e){var t=e.getDefinition();e.modules.responsive={order:void 0===t.responsive?1:t.responsive,visible:!1!==t.visible}}initializeRow(e){var t;"calc"!==e.type&&((t=document.createElement("div")).classList.add("tabulator-responsive-collapse"),e.modules.responsiveLayout={element:t,open:this.collapseStartOpen},this.collapseStartOpen||(t.style.display="none"))}layoutRow(e){var t=e.getElement();e.modules.responsiveLayout&&(t.appendChild(e.modules.responsiveLayout.element),this.generateCollapsedRowContent(e))}updateColumnVisibility(e,t){!t&&e.modules.responsive&&(e.modules.responsive.visible=e.visible,this.initializeResponsivity())}hideColumn(e){var t=this.hiddenColumns.length;e.hide(!1,!0),"collapse"===this.mode&&(this.hiddenColumns.unshift(e),this.generateCollapsedContent(),this.collapseHandleColumn&&!t&&this.collapseHandleColumn.show())}showColumn(e){var t;e.show(!1,!0),e.setWidth(e.getWidth()),"collapse"===this.mode&&((t=this.hiddenColumns.indexOf(e))>-1&&this.hiddenColumns.splice(t,1),this.generateCollapsedContent(),this.collapseHandleColumn&&!this.hiddenColumns.length&&this.collapseHandleColumn.hide())}update(){for(var e=this,t=!0;t;){let i="fitColumns"==e.table.modules.layout.getMode()?e.table.columnManager.getFlexBaseWidth():e.table.columnManager.getWidth(),s=(e.table.options.headerVisible?e.table.columnManager.element.clientWidth:e.table.element.clientWidth)-i;if(s<0){let i=e.columns[e.index];i?(e.hideColumn(i),e.index++):t=!1}else{let i=e.columns[e.index-1];i&&s>0&&s>=i.getWidth()?(e.showColumn(i),e.index--):t=!1}e.table.rowManager.activeRowsCount||e.table.rowManager.renderEmptyScroll()}}generateCollapsedContent(){var e=this;this.table.rowManager.getDisplayRows().forEach((function(t){e.generateCollapsedRowContent(t)}))}generateCollapsedRowContent(e){var t,i;if(e.modules.responsiveLayout){for(t=e.modules.responsiveLayout.element;t.firstChild;)t.removeChild(t.firstChild);(i=this.collapseFormatter(this.generateCollapsedRowData(e)))&&t.appendChild(i)}}generateCollapsedRowData(e){var t,i=this,s=e.getData(),o=[];return this.hiddenColumns.forEach((function(n){var r=n.getFieldValue(s);if(n.definition.title&&n.field)if(n.modules.format&&i.table.options.responsiveLayoutCollapseUseFormatters){t={value:!1,data:{},getValue:function(){return r},getData:function(){return s},getElement:function(){return document.createElement("div")},getRow:function(){return e.getComponent()},getColumn:function(){return n.getComponent()}},o.push({field:n.field,title:n.definition.title,value:n.modules.format.formatter.call(i.table.modules.format,t,n.modules.format.params,(function(e){e()}))})}else o.push({field:n.field,title:n.definition.title,value:r})})),o}formatCollapsedData(e){var t=document.createElement("table");return e.forEach((function(e){var i,s=document.createElement("tr"),o=document.createElement("td"),n=document.createElement("td"),r=document.createElement("strong");o.appendChild(r),this.langBind("columns|"+e.field,(function(t){r.innerHTML=t||e.title})),e.value instanceof Node?((i=document.createElement("div")).appendChild(e.value),n.appendChild(i)):n.innerHTML=e.value,s.appendChild(o),s.appendChild(n),t.appendChild(s)}),this),Object.keys(e).length?t:""}}he.moduleName="responsiveLayout";class de extends o{constructor(e){super(e),this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],this.headerCheckboxElement=null,this.registerTableOption("selectable","highlight"),this.registerTableOption("selectableRangeMode","drag"),this.registerTableOption("selectableRollingSelection",!0),this.registerTableOption("selectablePersistence",!0),this.registerTableOption("selectableCheck",(function(e,t){return!0})),this.registerTableFunction("selectRow",this.selectRows.bind(this)),this.registerTableFunction("deselectRow",this.deselectRows.bind(this)),this.registerTableFunction("toggleSelectRow",this.toggleRow.bind(this)),this.registerTableFunction("getSelectedRows",this.getSelectedRows.bind(this)),this.registerTableFunction("getSelectedData",this.getSelectedData.bind(this)),this.registerComponentFunction("row","select",this.selectRows.bind(this)),this.registerComponentFunction("row","deselect",this.deselectRows.bind(this)),this.registerComponentFunction("row","toggleSelect",this.toggleRow.bind(this)),this.registerComponentFunction("row","isSelected",this.isRowSelected.bind(this))}initialize(){!1!==this.table.options.selectable&&(this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-deleting",this.rowDeleted.bind(this)),this.subscribe("rows-wipe",this.clearSelectionData.bind(this)),this.subscribe("rows-retrieve",this.rowRetrieve.bind(this)),this.table.options.selectable&&!this.table.options.selectablePersistence&&this.subscribe("data-refreshing",this.deselectRows.bind(this)))}rowRetrieve(e,t){return"selected"===e?this.selectedRows:t}rowDeleted(e){this._deselectRow(e,!0)}clearSelectionData(e){this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],!0!==e&&this._rowSelectionChanged()}initializeRow(e){var t=this,i=e.getElement(),s=function(){setTimeout((function(){t.selecting=!1}),50),document.body.removeEventListener("mouseup",s)};e.modules.select={selected:!1},t.table.options.selectableCheck.call(this.table,e.getComponent())?(i.classList.add("tabulator-selectable"),i.classList.remove("tabulator-unselectable"),t.table.options.selectable&&"highlight"!=t.table.options.selectable&&("click"===t.table.options.selectableRangeMode?i.addEventListener("click",this.handleComplexRowClick.bind(this,e)):(i.addEventListener("click",(function(i){t.table.modExists("edit")&&t.table.modules.edit.getCurrentCell()||t.table._clearSelection(),t.selecting||t.toggleRow(e)})),i.addEventListener("mousedown",(function(i){if(i.shiftKey)return t.table._clearSelection(),t.selecting=!0,t.selectPrev=[],document.body.addEventListener("mouseup",s),document.body.addEventListener("keyup",s),t.toggleRow(e),!1})),i.addEventListener("mouseenter",(function(i){t.selecting&&(t.table._clearSelection(),t.toggleRow(e),t.selectPrev[1]==e&&t.toggleRow(t.selectPrev[0]))})),i.addEventListener("mouseout",(function(i){t.selecting&&(t.table._clearSelection(),t.selectPrev.unshift(e))}))))):(i.classList.add("tabulator-unselectable"),i.classList.remove("tabulator-selectable"))}handleComplexRowClick(e,t){if(t.shiftKey){this.table._clearSelection(),this.lastClickedRow=this.lastClickedRow||e;var i=this.table.rowManager.getDisplayRowIndex(this.lastClickedRow),s=this.table.rowManager.getDisplayRowIndex(e),o=i<=s?i:s,n=i>=s?i:s,r=this.table.rowManager.getDisplayRows().slice(0).splice(o,n-o+1);t.ctrlKey||t.metaKey?(r.forEach((t=>{t!==this.lastClickedRow&&(!0===this.table.options.selectable||this.isRowSelected(e)||this.selectedRows.lengththis.table.options.selectable&&(r=r.slice(0,this.table.options.selectable)),this.selectRows(r)),this.table._clearSelection()}else t.ctrlKey||t.metaKey?(this.toggleRow(e),this.lastClickedRow=e):(this.deselectRows(void 0,!0),this.selectRows(e),this.lastClickedRow=e)}toggleRow(e){this.table.options.selectableCheck.call(this.table,e.getComponent())&&(e.modules.select&&e.modules.select.selected?this._deselectRow(e):this._selectRow(e))}selectRows(e){var t;switch(typeof e){case"undefined":this.table.rowManager.rows.forEach((e=>{this._selectRow(e,!0,!0)})),this._rowSelectionChanged();break;case"string":(t=this.table.rowManager.findRow(e))?this._selectRow(t,!0,!0):this.table.rowManager.getRows(e).forEach((e=>{this._selectRow(e,!0,!0)})),this._rowSelectionChanged();break;default:Array.isArray(e)?(e.forEach((e=>{this._selectRow(e,!0,!0)})),this._rowSelectionChanged()):this._selectRow(e,!1,!0)}}_selectRow(e,t,i){if(!isNaN(this.table.options.selectable)&&!0!==this.table.options.selectable&&!i&&this.selectedRows.length>=this.table.options.selectable){if(!this.table.options.selectableRollingSelection)return!1;this._deselectRow(this.selectedRows[0])}var s=this.table.rowManager.findRow(e);s?-1==this.selectedRows.indexOf(s)&&(s.getElement().classList.add("tabulator-selected"),s.modules.select||(s.modules.select={}),s.modules.select.selected=!0,s.modules.select.checkboxEl&&(s.modules.select.checkboxEl.checked=!0),this.selectedRows.push(s),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(s,!0),this.dispatchExternal("rowSelected",s.getComponent()),this._rowSelectionChanged(t)):t||console.warn("Selection Error - No such row found, ignoring selection:"+e)}isRowSelected(e){return-1!==this.selectedRows.indexOf(e)}deselectRows(e,t){var i,s=this;if(void 0===e){i=s.selectedRows.length;for(let e=0;e-1&&(o.getElement().classList.remove("tabulator-selected"),o.modules.select||(o.modules.select={}),o.modules.select.selected=!1,o.modules.select.checkboxEl&&(o.modules.select.checkboxEl.checked=!1),s.selectedRows.splice(i,1),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(o,!1),this.dispatchExternal("rowDeselected",o.getComponent()),s._rowSelectionChanged(t)):t||console.warn("Deselection Error - No such row found, ignoring selection:"+e)}getSelectedData(){var e=[];return this.selectedRows.forEach((function(t){e.push(t.getData())})),e}getSelectedRows(){var e=[];return this.selectedRows.forEach((function(t){e.push(t.getComponent())})),e}_rowSelectionChanged(e){this.headerCheckboxElement&&(0===this.selectedRows.length?(this.headerCheckboxElement.checked=!1,this.headerCheckboxElement.indeterminate=!1):this.table.rowManager.rows.length===this.selectedRows.length?(this.headerCheckboxElement.checked=!0,this.headerCheckboxElement.indeterminate=!1):(this.headerCheckboxElement.indeterminate=!0,this.headerCheckboxElement.checked=!1)),e||this.dispatchExternal("rowSelectionChanged",this.getSelectedData(),this.getSelectedRows())}registerRowSelectCheckbox(e,t){e._row.modules.select||(e._row.modules.select={}),e._row.modules.select.checkboxEl=t}registerHeaderSelectCheckbox(e){this.headerCheckboxElement=e}childRowSelection(e,t){var i=this.table.modules.dataTree.getChildren(e,!0);if(t)for(let e of i)this._selectRow(e,!0);else for(let e of i)this._deselectRow(e,!0)}}function ce(e,t,i,s,o,n,r){var a=window.DateTime||luxon.DateTime,l=r.format||"dd/MM/yyyy HH:mm:ss",h=r.alignEmptyValues,d=0;if(void 0!==a){if(e=a.isDateTime(e)?e:"iso"===l?a.fromISO(String(e)):a.fromFormat(String(e),l),t=a.isDateTime(t)?t:"iso"===l?a.fromISO(String(t)):a.fromFormat(String(t),l),e.isValid){if(t.isValid)return e-t;d=1}else d=t.isValid?-1:0;return("top"===h&&"desc"===n||"bottom"===h&&"asc"===n)&&(d*=-1),d}console.error("Sort Error - 'datetime' sorter is dependant on luxon.js")}de.moduleName="selectRow";var ue={number:function(e,t,i,s,o,n,r){var a=r.alignEmptyValues,l=r.decimalSeparator,h=r.thousandSeparator,d=0;if(e=String(e),t=String(t),h&&(e=e.split(h).join(""),t=t.split(h).join("")),l&&(e=e.split(l).join("."),t=t.split(l).join(".")),e=parseFloat(e),t=parseFloat(t),isNaN(e))d=isNaN(t)?0:-1;else{if(!isNaN(t))return e-t;d=1}return("top"===a&&"desc"===n||"bottom"===a&&"asc"===n)&&(d*=-1),d},string:function(e,t,i,s,o,n,r){var a,l=r.alignEmptyValues,h=0;if(e){if(t){switch(typeof r.locale){case"boolean":r.locale&&(a=this.langLocale());break;case"string":a=r.locale}return String(e).toLowerCase().localeCompare(String(t).toLowerCase(),a)}h=1}else h=t?-1:0;return("top"===l&&"desc"===n||"bottom"===l&&"asc"===n)&&(h*=-1),h},date:function(e,t,i,s,o,n,r){return r.format||(r.format="dd/MM/yyyy"),ce.call(this,e,t,i,s,o,n,r)},time:function(e,t,i,s,o,n,r){return r.format||(r.format="HH:mm"),ce.call(this,e,t,i,s,o,n,r)},datetime:ce,boolean:function(e,t,i,s,o,n,r){return(!0===e||"true"===e||"True"===e||1===e?1:0)-(!0===t||"true"===t||"True"===t||1===t?1:0)},array:function(e,t,i,s,o,n,r){var a=r.type||"length",l=r.alignEmptyValues,h=0;function d(e){switch(a){case"length":return e.length;case"sum":return e.reduce((function(e,t){return e+t}));case"max":return Math.max.apply(null,e);case"min":return Math.min.apply(null,e);case"avg":return e.reduce((function(e,t){return e+t}))/e.length}}if(Array.isArray(e)){if(Array.isArray(t))return(e?d(e):0)-(t?d(t):0);l=1}else l=Array.isArray(t)?-1:0;return("top"===l&&"desc"===n||"bottom"===l&&"asc"===n)&&(h*=-1),h},exists:function(e,t,i,s,o,n,r){return(void 0===e?0:1)-(void 0===t?0:1)},alphanum:function(e,t,i,s,o,n,r){var a,l,h,d,c,u=0,m=/(\d+)|(\D+)/g,p=/\d/,g=r.alignEmptyValues,b=0;if(e||0===e){if(t||0===t){if(isFinite(e)&&isFinite(t))return e-t;if((a=String(e).toLowerCase())===(l=String(t).toLowerCase()))return 0;if(!p.test(a)||!p.test(l))return a>l?1:-1;for(a=a.match(m),l=l.match(m),c=a.length>l.length?l.length:a.length;ud?1:-1;return a.length>l.length}b=1}else b=t||0===t?-1:0;return("top"===g&&"desc"===n||"bottom"===g&&"asc"===n)&&(b*=-1),b}};class me extends o{constructor(e){super(e),this.sortList=[],this.changed=!1,this.registerTableOption("sortMode","local"),this.registerTableOption("initialSort",!1),this.registerTableOption("columnHeaderSortMulti",!0),this.registerTableOption("sortOrderReverse",!1),this.registerTableOption("headerSortElement","
"),this.registerColumnOption("sorter"),this.registerColumnOption("sorterParams"),this.registerColumnOption("headerSort",!0),this.registerColumnOption("headerSortStartingDir"),this.registerColumnOption("headerSortTristate")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("table-built",this.tableBuilt.bind(this)),this.registerDataHandler(this.sort.bind(this),20),this.registerTableFunction("setSort",this.userSetSort.bind(this)),this.registerTableFunction("getSorters",this.getSort.bind(this)),this.registerTableFunction("clearSort",this.clearSort.bind(this)),"remote"===this.table.options.sortMode&&this.subscribe("data-params",this.remoteSortParams.bind(this))}tableBuilt(){this.table.options.initialSort&&this.setSort(this.table.options.initialSort)}remoteSortParams(e,t,i,s){var o=this.getSort();return o.forEach((e=>{delete e.column})),s.sort=o,s}userSetSort(e,t){this.setSort(e,t),this.refreshSort()}clearSort(){this.clear(),this.refreshSort()}initializeColumn(e){var t,i,s=!1;switch(typeof e.definition.sorter){case"string":me.sorters[e.definition.sorter]?s=me.sorters[e.definition.sorter]:console.warn("Sort Error - No such sorter found: ",e.definition.sorter);break;case"function":s=e.definition.sorter}e.modules.sort={sorter:s,dir:"none",params:e.definition.sorterParams||{},startingDir:e.definition.headerSortStartingDir||"asc",tristate:e.definition.headerSortTristate},!1!==e.definition.headerSort&&((t=e.getElement()).classList.add("tabulator-sortable"),(i=document.createElement("div")).classList.add("tabulator-col-sorter"),"object"==typeof this.table.options.headerSortElement?i.appendChild(this.table.options.headerSortElement):i.innerHTML=this.table.options.headerSortElement,e.titleHolderElement.appendChild(i),e.modules.sort.element=i,t.addEventListener("click",(t=>{var i="",s=[],o=!1;if(e.modules.sort){if(e.modules.sort.tristate)i="none"==e.modules.sort.dir?e.modules.sort.startingDir:e.modules.sort.dir==e.modules.sort.startingDir?"asc"==e.modules.sort.dir?"desc":"asc":"none";else switch(e.modules.sort.dir){case"asc":i="desc";break;case"desc":i="asc";break;default:i=e.modules.sort.startingDir}this.table.options.columnHeaderSortMulti&&(t.shiftKey||t.ctrlKey)?((o=(s=this.getSort()).findIndex((t=>t.field===e.getField())))>-1?(s[o].dir=i,o!=s.length-1&&(o=s.splice(o,1)[0],"none"!=i&&s.push(o))):"none"!=i&&s.push({column:e,dir:i}),this.setSort(s)):"none"==i?this.clear():this.setSort(e,i),this.refreshSort()}})))}refreshSort(){"remote"===this.table.options.sortMode?this.reloadData(null,!1,!1):this.refreshData(!0)}hasChanged(){var e=this.changed;return this.changed=!1,e}getSort(){var e=[];return this.sortList.forEach((function(t){t.column&&e.push({column:t.column.getComponent(),field:t.column.getField(),dir:t.dir})})),e}setSort(e,t){var i=this,s=[];Array.isArray(e)||(e=[{column:e,dir:t}]),e.forEach((function(e){var t;(t=i.table.columnManager.findColumn(e.column))?(e.column=t,s.push(e),i.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",e.column)})),i.sortList=s,this.dispatch("sort-changed")}clear(){this.setSort([])}findSorter(e){var t,i=this.table.rowManager.activeRows[0],s="string";if(i&&(i=i.getData(),e.getField()))switch(typeof(t=e.getFieldValue(i))){case"undefined":s="string";break;case"boolean":s="boolean";break;default:isNaN(t)||""===t?t.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(s="alphanum"):s="number"}return me.sorters[s]}sort(e){var t=this,i=this.table.options.sortOrderReverse?t.sortList.slice().reverse():t.sortList,s=[],o=[];return this.subscribedExternal("dataSorting")&&this.dispatchExternal("dataSorting",t.getSort()),t.clearColumnHeaders(),"remote"!==this.table.options.sortMode?(i.forEach((function(e,i){var o=e.column.modules.sort;e.column&&o&&(o.sorter||(o.sorter=t.findSorter(e.column)),e.params="function"==typeof o.params?o.params(e.column.getComponent(),e.dir):o.params,s.push(e)),t.setColumnHeader(e.column,e.dir)})),s.length&&t._sortItems(e,s)):i.forEach((function(e,i){t.setColumnHeader(e.column,e.dir)})),this.subscribedExternal("dataSorted")&&(e.forEach((e=>{o.push(e.getComponent())})),this.dispatchExternal("dataSorted",t.getSort(),o)),e}clearColumnHeaders(){this.table.columnManager.getRealColumns().forEach((function(e){e.modules.sort&&(e.modules.sort.dir="none",e.getElement().setAttribute("aria-sort","none"))}))}setColumnHeader(e,t){e.modules.sort.dir=t,e.getElement().setAttribute("aria-sort","asc"===t?"ascending":"descending")}_sortItems(e,t){var i=t.length-1;e.sort(((e,s)=>{for(var o,n=i;n>=0;n--){let i=t[n];if(0!==(o=this._sortRow(e,s,i.column,i.dir,i.params)))break}return o}))}_sortRow(e,t,i,s,o){var n,r,a="asc"==s?e:t,l="asc"==s?t:e;return e=void 0!==(e=i.getFieldValue(a.getData()))?e:"",t=void 0!==(t=i.getFieldValue(l.getData()))?t:"",n=a.getComponent(),r=l.getComponent(),i.modules.sort.sorter.call(this,e,t,n,r,i.getComponent(),s,o)}}me.moduleName="sort",me.sorters=ue;class pe extends o{constructor(e){super(e),this.tooltipSubscriber=null,this.headerSubscriber=null,this.timeout=null,this.popupInstance=null,this.registerTableOption("tooltipGenerationMode",void 0),this.registerTableOption("tooltipDelay",300),this.registerColumnOption("tooltip"),this.registerColumnOption("headerTooltip")}initialize(){this.deprecationCheck(),this.subscribe("column-init",this.initializeColumn.bind(this))}deprecationCheck(){void 0!==this.table.options.tooltipGenerationMode&&console.warn("Use of the tooltipGenerationMode option is now deprecated. This option is no longer needed as tooltips are always generated on hover now")}initializeColumn(e){e.definition.headerTooltip&&!this.headerSubscriber&&(this.headerSubscriber=!0,this.subscribe("column-mousemove",this.mousemoveCheck.bind(this,"headerTooltip")),this.subscribe("column-mouseout",this.mouseoutCheck.bind(this,"headerTooltip"))),e.definition.tooltip&&!this.tooltipSubscriber&&(this.tooltipSubscriber=!0,this.subscribe("cell-mousemove",this.mousemoveCheck.bind(this,"tooltip")),this.subscribe("cell-mouseout",this.mouseoutCheck.bind(this,"tooltip")))}mousemoveCheck(e,t,i){var s="tooltip"===e?i.column.definition.tooltip:i.definition.headerTooltip;s&&(this.clearPopup(),this.timeout=setTimeout(this.loadTooltip.bind(this,t,i,s),this.table.options.tooltipDelay))}mouseoutCheck(e,t,i){this.popupInstance||this.clearPopup()}clearPopup(e,t,i){clearTimeout(this.timeout),this.timeout=null,this.popupInstance&&this.popupInstance.hide()}loadTooltip(e,t,i){var s,o,n;"function"==typeof i&&(i=i(e,t.getComponent(),(function(e){o=e}))),i instanceof HTMLElement?s=i:(s=document.createElement("div"),!0===i&&(t instanceof g?i=t.value:t.definition.field?this.langBind("columns|"+t.definition.field,(e=>{s.innerHTML=i=e||t.definition.title})):i=t.definition.title),s.innerHTML=i),(i||0===i||"0"===i||!1===i)&&(s.classList.add("tabulator-tooltip"),s.addEventListener("mousemove",(e=>e.preventDefault())),this.popupInstance=this.popup(s),"function"==typeof o&&this.popupInstance.renderCallback(o),n=this.popupInstance.containerEventCoords(e),this.popupInstance.show(n.x+15,n.y+15).hideOnBlur((()=>{this.dispatchExternal("TooltipClosed",t.getComponent()),this.popupInstance=null})),this.dispatchExternal("TooltipOpened",t.getComponent()))}}pe.moduleName="tooltip";var ge={integer:function(e,t,i){return""===t||null==t||"number"==typeof(t=Number(t))&&isFinite(t)&&Math.floor(t)===t},float:function(e,t,i){return""===t||null==t||"number"==typeof(t=Number(t))&&isFinite(t)&&t%1!=0},numeric:function(e,t,i){return""===t||null==t||!isNaN(t)},string:function(e,t,i){return""===t||null==t||isNaN(t)},max:function(e,t,i){return""===t||null==t||parseFloat(t)<=i},min:function(e,t,i){return""===t||null==t||parseFloat(t)>=i},starts:function(e,t,i){return""===t||null==t||String(t).toLowerCase().startsWith(String(i).toLowerCase())},ends:function(e,t,i){return""===t||null==t||String(t).toLowerCase().endsWith(String(i).toLowerCase())},minLength:function(e,t,i){return""===t||null==t||String(t).length>=i},maxLength:function(e,t,i){return""===t||null==t||String(t).length<=i},in:function(e,t,i){return""===t||null==t||("string"==typeof i&&(i=i.split("|")),""===t||i.indexOf(t)>-1)},regex:function(e,t,i){return""===t||null==t||new RegExp(i).test(t)},unique:function(e,t,i){if(""===t||null==t)return!0;var s=!0,o=e.getData(),n=e.getColumn()._getSelf();return this.table.rowManager.rows.forEach((function(e){var i=e.getData();i!==o&&t==n.getFieldValue(i)&&(s=!1)})),s},required:function(e,t,i){return""!==t&&null!=t}};class be extends o{constructor(e){super(e),this.invalidCells=[],this.registerTableOption("validationMode","blocking"),this.registerColumnOption("validator"),this.registerTableFunction("getInvalidCells",this.getInvalidCells.bind(this)),this.registerTableFunction("clearCellValidation",this.userClearCellValidation.bind(this)),this.registerTableFunction("validate",this.userValidate.bind(this)),this.registerComponentFunction("cell","isValid",this.cellIsValid.bind(this)),this.registerComponentFunction("cell","clearValidation",this.clearValidation.bind(this)),this.registerComponentFunction("cell","validate",this.cellValidate.bind(this)),this.registerComponentFunction("column","validate",this.columnValidate.bind(this)),this.registerComponentFunction("row","validate",this.rowValidate.bind(this))}initialize(){this.subscribe("cell-delete",this.clearValidation.bind(this)),this.subscribe("column-layout",this.initializeColumnCheck.bind(this)),this.subscribe("edit-success",this.editValidate.bind(this)),this.subscribe("edit-editor-clear",this.editorClear.bind(this)),this.subscribe("edit-edited-clear",this.editedClear.bind(this))}editValidate(e,t,i){var s="manual"===this.table.options.validationMode||this.validate(e.column.modules.validate,e,t);return!0!==s&&setTimeout((()=>{e.getElement().classList.add("tabulator-validation-fail"),this.dispatchExternal("validationFailed",e.getComponent(),t,s)})),s}editorClear(e,t){t&&e.column.modules.validate&&this.cellValidate(e),e.getElement().classList.remove("tabulator-validation-fail")}editedClear(e){e.modules.validate&&(e.modules.validate.invalid=!1)}cellIsValid(e){return e.modules.validate&&e.modules.validate.invalid||!0}cellValidate(e){return this.validate(e.column.modules.validate,e,e.getValue())}columnValidate(e){var t=[];return e.cells.forEach((e=>{!0!==this.cellValidate(e)&&t.push(e.getComponent())})),!t.length||t}rowValidate(e){var t=[];return e.cells.forEach((e=>{!0!==this.cellValidate(e)&&t.push(e.getComponent())})),!t.length||t}userClearCellValidation(e){e||(e=this.getInvalidCells()),Array.isArray(e)||(e=[e]),e.forEach((e=>{this.clearValidation(e._getSelf())}))}userValidate(e){var t=[];return this.table.rowManager.rows.forEach((e=>{var i=(e=e.getComponent()).validate();!0!==i&&(t=t.concat(i))})),!t.length||t}initializeColumnCheck(e){void 0!==e.definition.validator&&this.initializeColumn(e)}initializeColumn(e){var t,i=this,s=[];e.definition.validator&&(Array.isArray(e.definition.validator)?e.definition.validator.forEach((e=>{(t=i._extractValidator(e))&&s.push(t)})):(t=this._extractValidator(e.definition.validator))&&s.push(t),e.modules.validate=!!s.length&&s)}_extractValidator(e){var t,i,s;switch(typeof e){case"string":return(s=e.indexOf(":"))>-1?(t=e.substring(0,s),i=e.substring(s+1)):t=e,this._buildValidator(t,i);case"function":return this._buildValidator(e);case"object":return this._buildValidator(e.type,e.parameters)}}_buildValidator(e,t){var i="function"==typeof e?e:be.validators[e];return i?{type:"function"==typeof e?"function":e,func:i,params:t}:(console.warn("Validator Setup Error - No matching validator found:",e),!1)}validate(e,t,i){var s=this,o=[],n=this.invalidCells.indexOf(t);return e&&e.forEach((e=>{e.func.call(s,t.getComponent(),i,e.params)||o.push({type:e.type,parameters:e.params})})),t.modules.validate||(t.modules.validate={}),o.length?(t.modules.validate.invalid=o,"manual"!==this.table.options.validationMode&&t.getElement().classList.add("tabulator-validation-fail"),-1==n&&this.invalidCells.push(t)):(t.modules.validate.invalid=!1,t.getElement().classList.remove("tabulator-validation-fail"),n>-1&&this.invalidCells.splice(n,1)),!o.length||o}getInvalidCells(){var e=[];return this.invalidCells.forEach((t=>{e.push(t.getComponent())})),e}clearValidation(e){var t;e.modules.validate&&e.modules.validate.invalid&&(e.getElement().classList.remove("tabulator-validation-fail"),e.modules.validate.invalid=!1,(t=this.invalidCells.indexOf(e))>-1&&this.invalidCells.splice(t,1))}}be.moduleName="validate",be.validators=ge;var fe=Object.freeze({__proto__:null,AccessorModule:n,AjaxModule:c,ClipboardModule:u,ColumnCalcsModule:y,DataTreeModule:R,DownloadModule:T,EditModule:D,ExportModule:z,FilterModule:H,FormatModule:O,FrozenColumnsModule:A,FrozenRowsModule:B,GroupRowsModule:V,HistoryModule:W,HtmlTableImportModule:G,ImportModule:U,InteractionModule:X,KeybindingsModule:q,MenuModule:K,MoveColumnsModule:J,MoveRowsModule:Y,MutatorModule:$,PageModule:Q,PersistenceModule:ie,PopupModule:se,PrintModule:oe,ReactiveDataModule:ne,ResizeColumnsModule:re,ResizeRowsModule:ae,ResizeTableModule:le,ResponsiveLayoutModule:he,SelectRowModule:de,SortModule:me,TooltipModule:pe,ValidateModule:be});class ve{constructor(e,t,i={}){this.table=e,this.msgType=t,this.registeredDefaults=Object.assign({},i)}register(e,t){this.registeredDefaults[e]=t}generate(e,t={}){var i=Object.assign({},this.registeredDefaults);if(Object.assign(i,e),!1!==t.debugInvalidOptions||this.table.options.debugInvalidOptions)for(var s in t)i.hasOwnProperty(s)||console.warn("Invalid "+this.msgType+" option:",s);for(var s in i)s in t?i[s]=t[s]:Array.isArray(i[s])?i[s]=Object.assign([],i[s]):"object"==typeof i[s]&&null!==i[s]?i[s]=Object.assign({},i[s]):void 0===i[s]&&delete i[s];return i}}class we extends e{constructor(e){super(e),this.elementVertical=e.rowManager.element,this.elementHorizontal=e.columnManager.element,this.tableElement=e.rowManager.tableElement,this.verticalFillMode="fit"}initialize(){}clearRows(){}clearColumns(){}reinitializeColumnWidths(e){}renderRows(){}renderColumns(){}rerenderRows(e){e&&e()}rerenderColumns(e,t){}renderRowCells(e){}rerenderRowCells(e,t){}scrollColumns(e,t){}scrollRows(e,t){}resize(){}scrollToRow(e){}scrollToRowNearestTop(e){}visibleRows(e){return[]}rows(){return this.table.rowManager.getDisplayRows()}styleRow(e,t){var i=e.getElement();t%2?(i.classList.add("tabulator-row-even"),i.classList.remove("tabulator-row-odd")):(i.classList.add("tabulator-row-odd"),i.classList.remove("tabulator-row-even"))}clear(){this.clearRows(),this.clearColumns()}render(){this.renderRows(),this.renderColumns()}rerender(e){this.rerenderRows(),this.rerenderColumns()}scrollToRowPosition(e,i,s){var o=this.rows().indexOf(e),n=e.getElement(),r=0;return new Promise(((a,l)=>{if(o>-1){if(void 0===s&&(s=this.table.options.scrollToRowIfVisible),!s&&t.elVisible(n)&&(r=t.elOffset(n).top-t.elOffset(this.elementVertical).top)>0&&r{e.element.appendChild(t.getElement()),t.cellRendered()}))}reinitializeColumnWidths(e){e.forEach((function(e){e.reinitializeWidth()}))}}class Ee extends we{constructor(e){super(e),this.leftCol=0,this.rightCol=0,this.scrollLeft=0,this.vDomScrollPosLeft=0,this.vDomScrollPosRight=0,this.vDomPadLeft=0,this.vDomPadRight=0,this.fitDataColAvg=0,this.windowBuffer=200,this.visibleRows=null,this.initialized=!1,this.isFitData=!1,this.columns=[]}initialize(){this.compatibilityCheck(),this.layoutCheck(),this.vertScrollListen()}compatibilityCheck(){var e=this.options("columns"),t=!0;return"fitDataTable"==this.options("layout")&&(console.warn("Horizontal Virtual DOM is not compatible with fitDataTable layout mode"),t=!1),this.options("responsiveLayout")&&(console.warn("Horizontal Virtual DOM is not compatible with responsive columns"),t=!1),this.options("rtl")&&(console.warn("Horizontal Virtual DOM is not currently compatible with RTL text direction"),t=!1),e&&e.find((e=>e.frozen))&&(console.warn("Horizontal Virtual DOM is not compatible with frozen columns"),t=!1),t}layoutCheck(){this.isFitData=this.options("layout").startsWith("fitData")}vertScrollListen(){this.subscribe("scroll-vertical",this.clearVisRowCache.bind(this)),this.subscribe("data-refreshed",this.clearVisRowCache.bind(this))}clearVisRowCache(){this.visibleRows=null}renderColumns(e,t){this.dataChange()}scrollColumns(e,t){this.scrollLeft!=e&&(this.scrollLeft=e,this.scroll(e-(this.vDomScrollPosLeft+this.windowBuffer)))}calcWindowBuffer(){var e=this.elementVertical.clientWidth;this.table.columnManager.columnsByIndex.forEach((t=>{if(t.visible){var i=t.getWidth();i>e&&(e=i)}})),this.windowBuffer=2*e}rerenderColumns(e,t){var i={cols:this.columns,leftCol:this.leftCol,rightCol:this.rightCol},s=0;e&&!this.initialized||(this.clear(),this.calcWindowBuffer(),this.scrollLeft=this.elementVertical.scrollLeft,this.vDomScrollPosLeft=this.scrollLeft-this.windowBuffer,this.vDomScrollPosRight=this.scrollLeft+this.elementVertical.clientWidth+this.windowBuffer,this.table.columnManager.columnsByIndex.forEach((e=>{var t={};if(e.visible){var i=e.getWidth();t.leftPos=s,t.rightPos=s+i,t.width=i,this.isFitData&&(t.fitDataCheck=!e.modules.vdomHoz||e.modules.vdomHoz.fitDataCheck),s+i>this.vDomScrollPosLeft&&s{e.element.appendChild(t.getElement()),t.cellRendered()}))}rerenderRowCells(e,t){this.reinitializeRow(e,t)}reinitializeColumnWidths(e){for(let e=this.leftCol;e<=this.rightCol;e++)this.columns[e].reinitializeWidth()}deinitialize(){this.initialized=!1}clear(){this.columns=[],this.leftCol=-1,this.rightCol=0,this.vDomScrollPosLeft=0,this.vDomScrollPosRight=0,this.vDomPadLeft=0,this.vDomPadRight=0}dataChange(){var e,t,i=!1,s=0;if(this.isFitData){if(this.table.columnManager.columnsByIndex.forEach((e=>{!e.definition.width&&e.visible&&(i=!0)})),i&&i&&this.table.rowManager.getDisplayRows().length&&(this.vDomScrollPosRight=this.scrollLeft+this.elementVertical.clientWidth+this.windowBuffer,t=this.chain("rows-sample",[1],[],(()=>this.table.rowManager.getDisplayRows()))[0])){e=t.getElement(),t.generateCells(),this.tableElement.appendChild(e);for(s=0;s{e!==this.columns[i]&&(t=!1)})),!t)}reinitializeRows(){this.getVisibleRows().forEach((e=>{this.reinitializeRow(e,!0)}))}getVisibleRows(){return this.visibleRows||(this.visibleRows=this.table.rowManager.getVisibleRows()),this.visibleRows}scroll(e){this.vDomScrollPosLeft+=e,this.vDomScrollPosRight+=e,Math.abs(e)>this.windowBuffer/2?this.rerenderColumns():e>0?(this.addColRight(),this.removeColLeft()):(this.addColLeft(),this.removeColRight())}colPositionAdjust(e,t,i){for(let s=e;s{if("group"!==e.type){var i=e.getCell(t);e.getElement().appendChild(i.getElement()),i.cellRendered()}})),this.fitDataColActualWidthCheck(t),this.rightCol++,this.rightCol>=this.columns.length-1?this.vDomPadRight=0:this.vDomPadRight-=t.getWidth()}e&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}addColLeft(){for(var e=!1;;){let t=this.columns[this.leftCol-1];if(!t)break;if(!(t.modules.vdomHoz.rightPos>=this.vDomScrollPosLeft))break;{e=!0,this.getVisibleRows().forEach((e=>{if("group"!==e.type){var i=e.getCell(t);e.getElement().prepend(i.getElement()),i.cellRendered()}})),this.leftCol--,this.leftCol<=0?this.vDomPadLeft=0:this.vDomPadLeft-=t.getWidth();let i=this.fitDataColActualWidthCheck(t);i&&(this.scrollLeft=this.elementVertical.scrollLeft=this.elementVertical.scrollLeft+i,this.vDomPadRight-=i)}}e&&(this.tableElement.style.paddingLeft=this.vDomPadLeft+"px")}removeColRight(){for(var e=!1;;){let t=this.columns[this.rightCol];if(!t)break;if(!(t.modules.vdomHoz.leftPos>this.vDomScrollPosRight))break;e=!0,this.getVisibleRows().forEach((e=>{if("group"!==e.type){var i=e.getCell(t);try{e.getElement().removeChild(i.getElement())}catch(e){console.warn("Could not removeColRight",e.message)}}})),this.vDomPadRight+=t.getWidth(),this.rightCol--}e&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}removeColLeft(){for(var e=!1;;){let t=this.columns[this.leftCol];if(!t)break;if(!(t.modules.vdomHoz.rightPos{if("group"!==e.type){var i=e.getCell(t);try{e.getElement().removeChild(i.getElement())}catch(e){console.warn("Could not removeColLeft",e.message)}}})),this.vDomPadLeft+=t.getWidth(),this.leftCol++}e&&(this.tableElement.style.paddingLeft=this.vDomPadLeft+"px")}fitDataColActualWidthCheck(e){var t,i;return e.modules.vdomHoz.fitDataCheck&&(e.reinitializeWidth(),(i=(t=e.getWidth())-e.modules.vdomHoz.width)&&(e.modules.vdomHoz.rightPos+=i,e.modules.vdomHoz.width=t,this.colPositionAdjust(this.columns.indexOf(e)+1,this.columns.length,i)),e.modules.vdomHoz.fitDataCheck=!1),i}initializeRow(e){if("group"!==e.type){e.modules.vdomHoz={leftCol:this.leftCol,rightCol:this.rightCol};for(let t=this.leftCol;t<=this.rightCol;t++){let i=this.columns[t];if(i&&i.visible){let t=e.getCell(i);e.getElement().appendChild(t.getElement()),t.cellRendered()}}}}reinitializeRow(e,t){if("group"!==e.type&&(t||!e.modules.vdomHoz||e.modules.vdomHoz.leftCol!==this.leftCol||e.modules.vdomHoz.rightCol!==this.rightCol)){for(var i=e.getElement();i.firstChild;)i.removeChild(i.firstChild);this.initializeRow(e)}}}class ye extends e{constructor(e){super(e),this.blockHozScrollEvent=!1,this.headersElement=null,this.element=null,this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.scrollLeft=0,this.optionsList=new ve(this.table,"column definition",f),this.renderer=null}initialize(){this.initializeRenderer(),this.headersElement=this.createHeadersElement(),this.element=this.createHeaderElement(),this.element.insertBefore(this.headersElement,this.element.firstChild),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this))}initializeRenderer(){var e,t={virtual:Ee,basic:Ce};(e="string"==typeof this.table.options.renderHorizontal?t[this.table.options.renderHorizontal]:this.table.options.renderHorizontal)?(this.renderer=new e(this.table,this.element,this.tableElement),this.renderer.initialize()):console.error("Unable to find matching renderer:",table.options.renderHorizontal)}createHeadersElement(){var e=document.createElement("div");return e.classList.add("tabulator-headers"),e.setAttribute("role","row"),e}createHeaderElement(){var e=document.createElement("div");return e.classList.add("tabulator-header"),e.setAttribute("role","rowgroup"),this.table.options.headerVisible||e.classList.add("tabulator-header-hidden"),e}getElement(){return this.element}getHeadersElement(){return this.headersElement}scrollHorizontal(e){var t=0,i=this.element.scrollWidth-this.table.element.clientWidth;this.element.scrollLeft=e,e>i?(t=e-i,this.element.style.marginLeft=-t+"px"):this.element.style.marginLeft=0,this.scrollLeft=e,this.renderer.scrollColumns(e)}generateColumnsFromRowData(e){var t,i,s=[],o=this.table.options.autoColumnsDefinitions;if(e&&e.length){for(var n in t=e[0]){let e={field:n,title:n},o=t[n];switch(typeof o){case"undefined":i="string";break;case"boolean":i="boolean";break;case"object":i=Array.isArray(o)?"array":"string";break;default:i=isNaN(o)||""===o?o.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?"alphanum":"string":"number"}e.sorter=i,s.push(e)}if(o)switch(typeof o){case"function":this.table.options.columns=o.call(this.table,s);break;case"object":Array.isArray(o)?s.forEach((e=>{var t=o.find((t=>t.field===e.field));t&&Object.assign(e,t)})):s.forEach((e=>{o[e.field]&&Object.assign(e,o[e.field])})),this.table.options.columns=s}else this.table.options.columns=s;this.setColumns(this.table.options.columns)}}setColumns(e,t){for(;this.headersElement.firstChild;)this.headersElement.removeChild(this.headersElement.firstChild);this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.dispatch("columns-loading"),e.forEach(((e,t)=>{this._addColumn(e)})),this._reIndexColumns(),this.dispatch("columns-loaded"),this.renderer.rerenderColumns(!1,!0),this.redraw(!0)}_addColumn(e,t,i){var s=new v(e,this),o=s.getElement(),n=i?this.findColumnIndex(i):i;if(i&&n>-1){var r=i.getTopColumn(),a=this.columns.indexOf(r),l=r.getElement();t?(this.columns.splice(a,0,s),l.parentNode.insertBefore(o,l)):(this.columns.splice(a+1,0,s),l.parentNode.insertBefore(o,l.nextSibling))}else t?(this.columns.unshift(s),this.headersElement.insertBefore(s.getElement(),this.headersElement.firstChild)):(this.columns.push(s),this.headersElement.appendChild(s.getElement()));return s.columnRendered(),s}registerColumnField(e){e.definition.field&&(this.columnsByField[e.definition.field]=e)}registerColumnPosition(e){this.columnsByIndex.push(e)}_reIndexColumns(){this.columnsByIndex=[],this.columns.forEach((function(e){e.reRegisterPosition()}))}verticalAlignHeaders(){var e=0;this.columns.forEach((t=>{var i;t.clearVerticalAlign(),(i=t.getHeight())>e&&(e=i)})),this.columns.forEach((t=>{t.verticalAlign(this.table.options.columnHeaderVertAlign,e)})),this.table.rowManager.adjustTableSize()}findColumn(e){if("object"!=typeof e)return this.columnsByField[e]||!1;if(e instanceof v)return e;if(e instanceof b)return e._getSelf()||!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement){return this.columns.find((t=>t.element===e))||!1}return!1}getColumnByField(e){return this.columnsByField[e]}getColumnsByFieldRoot(e){var t=[];return Object.keys(this.columnsByField).forEach((i=>{i.split(".")[0]===e&&t.push(this.columnsByField[i])})),t}getColumnByIndex(e){return this.columnsByIndex[e]}getFirstVisibleColumn(e){return(e=this.columnsByIndex.findIndex((e=>e.visible)))>-1&&this.columnsByIndex[e]}getColumns(){return this.columns}findColumnIndex(e){return this.columnsByIndex.findIndex((t=>e===t))}getRealColumns(){return this.columnsByIndex}traverse(e){this.columnsByIndex.forEach(((t,i)=>{e(t,i)}))}getDefinitions(e){var t=[];return this.columnsByIndex.forEach((i=>{(!e||e&&i.visible)&&t.push(i.getDefinition())})),t}getDefinitionTree(){var e=[];return this.columns.forEach((t=>{e.push(t.getDefinition(!0))})),e}getComponents(e){var t=[];return(e?this.columns:this.columnsByIndex).forEach((e=>{t.push(e.getComponent())})),t}getWidth(){var e=0;return this.columnsByIndex.forEach((t=>{t.visible&&(e+=t.getWidth())})),e}moveColumn(e,t,i){this.moveColumnActual(e,t,i),t.element.parentNode.insertBefore(e.element,t.element),i&&t.element.parentNode.insertBefore(t.element,e.element),this.verticalAlignHeaders(),this.table.rowManager.reinitialize()}moveColumnActual(e,t,i){e.parent.isGroup?this._moveColumnInArray(e.parent.columns,e,t,i):this._moveColumnInArray(this.columns,e,t,i),this._moveColumnInArray(this.columnsByIndex,e,t,i,!0),this.renderer.rerenderColumns(!0),this.dispatch("column-moved",e,t,i),this.subscribedExternal("columnMoved")&&this.dispatchExternal("columnMoved",e.getComponent(),this.table.columnManager.getComponents())}_moveColumnInArray(e,t,i,s,o){var n,r=e.indexOf(t);r>-1&&(e.splice(r,1),(n=e.indexOf(i))>-1?s&&(n+=1):n=r,e.splice(n,0,t),o&&(this.chain("column-moving-rows",[t,i,s],null,[])||[]).concat(this.table.rowManager.rows).forEach((function(e){if(e.cells.length){var t=e.cells.splice(r,1)[0];e.cells.splice(n,0,t)}})))}scrollToColumn(e,t,i){var s=0,o=0,n=0,r=e.getElement();return new Promise(((a,l)=>{if(void 0===t&&(t=this.table.options.scrollToColumnPosition),void 0===i&&(i=this.table.options.scrollToColumnIfVisible),e.visible){switch(t){case"middle":case"center":n=-this.element.clientWidth/2;break;case"right":n=r.clientWidth-this.headersElement.clientWidth}if(!i&&(o=r.offsetLeft)>0&&o+r.offsetWidth{t.push(i.generateCell(e))})),t}getFlexBaseWidth(){var e=this.table.element.clientWidth,t=0;return this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight&&(e-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),this.columnsByIndex.forEach((function(i){var s,o,n;i.visible&&(s=i.definition.width||0,o=parseInt(i.minWidth),n="string"==typeof s?s.indexOf("%")>-1?e/100*parseInt(s):parseInt(s):s,t+=n>o?n:o)})),t}addColumn(e,t,i){return new Promise(((s,o)=>{var n=this._addColumn(e,t,i);this._reIndexColumns(),this.dispatch("column-add",e,t,i),"fitColumns"!=this.layoutMode()&&n.reinitializeWidth(),this.redraw(!0),this.table.rowManager.reinitialize(),this.renderer.rerenderColumns(),s(n)}))}deregisterColumn(e){var t,i=e.getField();i&&delete this.columnsByField[i],(t=this.columnsByIndex.indexOf(e))>-1&&this.columnsByIndex.splice(t,1),(t=this.columns.indexOf(e))>-1&&this.columns.splice(t,1),this.verticalAlignHeaders(),this.redraw()}redraw(e){t.elVisible(this.element)&&this.verticalAlignHeaders(),e&&(this.table.rowManager.resetScroll(),this.table.rowManager.reinitialize()),this.confirm("table-redrawing",e)||this.layoutRefresh(),this.dispatch("table-redraw",e),this.table.footerManager.redraw()}}class Re extends we{constructor(e){super(e),this.verticalFillMode="fill",this.scrollTop=0,this.scrollLeft=0,this.scrollTop=0,this.scrollLeft=0}clearRows(){for(var e=this.tableElement;e.firstChild;)e.removeChild(e.firstChild);e.scrollTop=0,e.scrollLeft=0,e.style.minWidth="",e.style.minHeight="",e.style.display="",e.style.visibility=""}renderRows(){var e=this.tableElement,t=!0;this.rows().forEach(((i,s)=>{this.styleRow(i,s),e.appendChild(i.getElement()),i.initialize(!0),"group"!==i.type&&(t=!1)})),e.style.minWidth=t?this.table.columnManager.getWidth()+"px":""}rerenderRows(e){this.clearRows(),this.renderRows(),e&&e()}scrollToRowNearestTop(e){var i=t.elOffset(e.getElement()).top;return!(Math.abs(this.elementVertical.scrollTop-i)>Math.abs(this.elementVertical.scrollTop+this.elementVertical.clientHeight-i))}scrollToRow(e){var i=e.getElement();this.elementVertical.scrollTop=t.elOffset(i).top-t.elOffset(this.elementVertical).top+this.elementVertical.scrollTop}visibleRows(e){return this.rows()}}class xe extends we{constructor(e){super(e),this.verticalFillMode="fill",this.scrollTop=0,this.scrollLeft=0,this.vDomRowHeight=20,this.vDomTop=0,this.vDomBottom=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomMaxRenderChain=90,this.vDomWindowBuffer=0,this.vDomWindowMinTotalRows=20,this.vDomWindowMinMarginRows=5,this.vDomTopNewRows=[],this.vDomBottomNewRows=[]}clearRows(){for(var e=this.tableElement;e.firstChild;)e.removeChild(e.firstChild);e.style.paddingTop="",e.style.paddingBottom="",e.style.minHeight="",e.style.display="",e.style.visibility="",this.elementVertical.scrollTop=0,this.elementVertical.scrollLeft=0,this.scrollTop=0,this.scrollLeft=0,this.vDomTop=0,this.vDomBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0}renderRows(){this._virtualRenderFill()}rerenderRows(e){for(var t=this.elementVertical.scrollTop,i=!1,s=!1,o=this.table.rowManager.scrollLeft,n=this.rows(),r=this.vDomTop;r<=this.vDomBottom;r++)if(n[r]){var a=t-n[r].getElement().offsetTop;if(!(!1===s||Math.abs(a){e.deinitializeHeight()})),e&&e(),this._virtualRenderFill(!1===i?this.rows.length-1:i,!0,s||0),this.scrollColumns(o)}scrollColumns(e){this.table.rowManager.scrollHorizontal(e)}scrollRows(e,t){var i=e-this.vDomScrollPosTop,s=e-this.vDomScrollPosBottom,o=2*this.vDomWindowBuffer,n=this.rows();if(this.scrollTop=e,-i>o||s>o){var r=this.table.rowManager.scrollLeft;this._virtualRenderFill(Math.floor(this.elementVertical.scrollTop/this.elementVertical.scrollHeight*n.length)),this.scrollColumns(r)}else t?(i<0&&this._addTopRow(n,-i),s<0&&(this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer?this._removeBottomRow(n,-s):this.vDomScrollPosBottom=this.scrollTop)):(s>=0&&this._addBottomRow(n,s),i>=0&&(this.scrollTop>this.vDomWindowBuffer?this._removeTopRow(n,i):this.vDomScrollPosTop=this.scrollTop))}resize(){this.vDomWindowBuffer=this.table.options.renderVerticalBuffer||this.elementVertical.clientHeight}scrollToRowNearestTop(e){var t=this.rows().indexOf(e);return!(Math.abs(this.vDomTop-t)>Math.abs(this.vDomBottom-t))}scrollToRow(e){var t=this.rows().indexOf(e);t>-1&&this._virtualRenderFill(t,!0)}visibleRows(e){var t=this.elementVertical.scrollTop,i=this.elementVertical.clientHeight+t,s=!1,o=0,n=0,r=this.rows();if(e)o=this.vDomTop,n=this.vDomBottom;else for(var a=this.vDomTop;a<=this.vDomBottom;a++)if(r[a])if(s){if(!(i-r[a].getElement().offsetTop>=0))break;n=a}else if(t-r[a].getElement().offsetTop>=0)o=a;else{if(s=!0,!(i-r[a].getElement().offsetTop>=0))break;n=a}return r.slice(o,n+1)}_virtualRenderFill(e,i,s){var o=this.tableElement,n=this.elementVertical,r=0,a=0,l=0,h=0,d=0,c=this.rows(),u=c.length,m=this.elementVertical.clientHeight;if(s=s||0,e=e||0){for(;o.firstChild;)o.removeChild(o.firstChild);(l=(u-e+1)*this.vDomRowHeight)this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*p),this.vDomBottom++,d++}e?(this.vDomTopPad=i?this.vDomRowHeight*this.vDomTop+s:this.scrollTop-h,this.vDomBottomPad=this.vDomBottom==u-1?0:Math.max(this.vDomScrollHeight-this.vDomTopPad-a-h,0)):(this.vDomTopPad=0,this.vDomRowHeight=Math.floor((a+h)/d),this.vDomBottomPad=this.vDomRowHeight*(u-this.vDomBottom-1),this.vDomScrollHeight=h+a+this.vDomBottomPad-m),o.style.paddingTop=this.vDomTopPad+"px",o.style.paddingBottom=this.vDomBottomPad+"px",i&&(this.scrollTop=this.vDomTopPad+h+s-(this.elementVertical.scrollWidth>this.elementVertical.clientWidth?this.elementVertical.offsetHeight-m:0)),this.scrollTop=Math.min(this.scrollTop,this.elementVertical.scrollHeight-m),this.elementVertical.scrollWidth>this.elementVertical.offsetWidth&&i&&(this.scrollTop+=this.elementVertical.offsetHeight-m),this.vDomScrollPosTop=this.scrollTop,this.vDomScrollPosBottom=this.scrollTop,n.scrollTop=this.scrollTop,this.dispatch("render-virtual-fill")}}_addTopRow(e,t){for(var i=this.tableElement,s=[],o=0,n=this.vDomTop-1,r=0;this.vDomTop;){let a,l,h=e[n];if(!(h&&r=a))break;this.styleRow(h,n),i.insertBefore(h.getElement(),i.firstChild),h.initialized&&h.heightInitialized||s.push(h),h.initialize(),l||(a=h.getElement().offsetHeight,a>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*a)),t-=a,o+=a,this.vDomTop--,n--,r++}for(let e of s)e.clearCellHeight();this._quickNormalizeRowHeight(s),o&&(this.vDomTopPad-=o,this.vDomTopPad<0&&(this.vDomTopPad=n*this.vDomRowHeight),n<1&&(this.vDomTopPad=0),i.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop-=o)}_removeTopRow(e,t){for(var i=[],s=0,o=0;;){let n,r=e[this.vDomTop];if(!(r&&o=n))break;this.vDomTop++,t-=n,s+=n,i.push(r),o++}for(let e of i){let t=e.getElement();t.parentNode&&t.parentNode.removeChild(t)}s&&(this.vDomTopPad+=s,this.tableElement.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop+=this.vDomTop?s:s+this.vDomWindowBuffer)}_addBottomRow(e,t){for(var i=this.tableElement,s=[],o=0,n=this.vDomBottom+1,r=0;;){let a,l,h=e[n];if(!(h&&r=a))break;this.styleRow(h,n),i.appendChild(h.getElement()),h.initialized&&h.heightInitialized||s.push(h),h.initialize(),l||(a=h.getElement().offsetHeight,a>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*a)),t-=a,o+=a,this.vDomBottom++,n++,r++}for(let e of s)e.clearCellHeight();this._quickNormalizeRowHeight(s),o&&(this.vDomBottomPad-=o,(this.vDomBottomPad<0||n==e.length-1)&&(this.vDomBottomPad=0),i.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom+=o)}_removeBottomRow(e,t){for(var i=[],s=0,o=0;;){let n,r=e[this.vDomBottom];if(!(r&&o=n))break;this.vDomBottom--,t-=n,s+=n,i.push(r),o++}for(let e of i){let t=e.getElement();t.parentNode&&t.parentNode.removeChild(t)}s&&(this.vDomBottomPad+=s,this.vDomBottomPad<0&&(this.vDomBottomPad=0),this.tableElement.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom-=s)}_quickNormalizeRowHeight(e){for(let t of e)t.calcHeight();for(let t of e)t.setCellHeight()}}class Te extends e{constructor(e){super(e),this.element=this.createHolderElement(),this.tableElement=this.createTableElement(),this.heightFixer=this.createTableElement(),this.placeholder=null,this.placeholderContents=null,this.firstRender=!1,this.renderMode="virtual",this.fixedHeight=!1,this.rows=[],this.activeRowsPipeline=[],this.activeRows=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.scrollTop=0,this.scrollLeft=0,this.rowNumColumn=!1,this.redrawBlock=!1,this.redrawBlockRestoreConfig=!1,this.redrawBlockRenderInPosition=!1,this.dataPipeline=[],this.displayPipeline=[],this.renderer=null}createHolderElement(){var e=document.createElement("div");return e.classList.add("tabulator-tableholder"),e.setAttribute("tabindex",0),e}createTableElement(){var e=document.createElement("div");return e.classList.add("tabulator-table"),e.setAttribute("role","rowgroup"),e}initializePlaceholder(){if("string"==typeof this.table.options.placeholder){let e=document.createElement("div");e.classList.add("tabulator-placeholder");let t=document.createElement("div");t.classList.add("tabulator-placeholder-contents"),t.innerHTML=this.table.options.placeholder,e.appendChild(t),this.placeholderContents=t,this.placeholder=e}}getElement(){return this.element}getTableElement(){return this.tableElement}getRowPosition(e,t){return t?this.activeRows.indexOf(e):this.rows.indexOf(e)}initialize(){this.initializePlaceholder(),this.initializeRenderer(),this.element.appendChild(this.tableElement),this.firstRender=!0,this.element.addEventListener("scroll",(()=>{var e=this.element.scrollLeft,t=this.scrollLeft>e,i=this.element.scrollTop,s=this.scrollTop>i;this.scrollLeft!=e&&(this.scrollLeft=e,this.dispatch("scroll-horizontal",e,t),this.dispatchExternal("scrollHorizontal",e,t),this._positionPlaceholder()),this.scrollTop!=i&&(this.scrollTop=i,this.renderer.scrollRows(i,s),this.dispatch("scroll-vertical",i,s),this.dispatchExternal("scrollVertical",i,s))}))}findRow(e){if("object"!=typeof e){if(null==e)return!1;return this.rows.find((t=>t.data[this.table.options.index]==e))||!1}if(e instanceof C)return e;if(e instanceof w)return e._getSelf()||!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement){return this.rows.find((t=>t.getElement()===e))||!1}return!1}getRowFromDataObject(e){return this.rows.find((t=>t.data===e))||!1}getRowFromPosition(e,t){return t?this.activeRows[e]:this.rows[e]}scrollToRow(e,t,i){return this.renderer.scrollToRowPosition(e,t,i)}setData(e,t,i){return new Promise(((s,o)=>{t&&this.getDisplayRows().length?this.table.options.pagination?this._setDataActual(e,!0):this.reRenderInPosition((()=>{this._setDataActual(e)})):(this.table.options.autoColumns&&i&&this.table.initialized&&this.table.columnManager.generateColumnsFromRowData(e),this.resetScroll(),this._setDataActual(e)),s()}))}_setDataActual(e,t){this.dispatchExternal("dataProcessing",e),this._wipeElements(),Array.isArray(e)?(this.dispatch("data-processing",e),e.forEach(((e,t)=>{if(e&&"object"==typeof e){var i=new C(e,this);this.rows.push(i)}else console.warn("Data Loading Warning - Invalid row data detected and ignored, expecting object but received:",e)})),this.refreshActiveData(!1,!1,t),this.dispatch("data-processed",e),this.dispatchExternal("dataProcessed",e)):console.error("Data Loading Error - Unable to process data due to invalid data type \nExpecting: array \nReceived: ",typeof e,"\nData: ",e)}_wipeElements(){this.dispatch("rows-wipe"),this.rows.forEach((e=>{e.wipe()})),this.rows=[],this.activeRows=[],this.activeRowsPipeline=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.adjustTableSize()}deleteRow(e,t){var i=this.rows.indexOf(e),s=this.activeRows.indexOf(e);s>-1&&this.activeRows.splice(s,1),i>-1&&this.rows.splice(i,1),this.setActiveRows(this.activeRows),this.displayRowIterator((t=>{var i=t.indexOf(e);i>-1&&t.splice(i,1)})),t||this.reRenderInPosition(),this.regenerateRowNumbers(),this.dispatchExternal("rowDeleted",e.getComponent()),this.displayRowsCount||this._showPlaceholder(),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.getData())}addRow(e,t,i,s){return this.addRowActual(e,t,i,s)}addRows(e,t,i){var s=[];return new Promise(((o,n)=>{t=this.findAddRowPos(t),Array.isArray(e)||(e=[e]),e.length,(void 0===i&&t||void 0!==i&&!t)&&e.reverse(),e.forEach(((o,n)=>{var r=this.addRow(o,t,i,!0);s.push(r),this.dispatch("row-added",r,e,t,i)})),this.refreshActiveData(!1,!1,!0),this.regenerateRowNumbers(),s.length&&this._clearPlaceholder(),o(s)}))}findAddRowPos(e){return void 0===e&&(e=this.table.options.addRowPos),"pos"===e&&(e=!0),"bottom"===e&&(e=!1),e}addRowActual(e,t,i,s){var o,n,r=e instanceof C?e:new C(e||{},this),a=this.findAddRowPos(t),l=-1;return i||(n=this.chain("row-adding-position",[r,a],null,{index:i,top:a}),i=n.index,a=n.top),void 0!==i&&(i=this.findRow(i)),(i=this.chain("row-adding-index",[r,i,a],null,i))&&(l=this.rows.indexOf(i)),i&&l>-1?(o=this.activeRows.indexOf(i),this.displayRowIterator((function(e){var t=e.indexOf(i);t>-1&&e.splice(a?t:t+1,0,r)})),o>-1&&this.activeRows.splice(a?o:o+1,0,r),this.rows.splice(a?l:l+1,0,r)):a?(this.displayRowIterator((function(e){e.unshift(r)})),this.activeRows.unshift(r),this.rows.unshift(r)):(this.displayRowIterator((function(e){e.push(r)})),this.activeRows.push(r),this.rows.push(r)),this.setActiveRows(this.activeRows),this.dispatchExternal("rowAdded",r.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),s||this.reRenderInPosition(),r}moveRow(e,t,i){this.dispatch("row-move",e,t,i),this.moveRowActual(e,t,i),this.regenerateRowNumbers(),this.dispatch("row-moved",e,t,i),this.dispatchExternal("rowMoved",e.getComponent())}moveRowActual(e,t,i){this.moveRowInArray(this.rows,e,t,i),this.moveRowInArray(this.activeRows,e,t,i),this.displayRowIterator((s=>{this.moveRowInArray(s,e,t,i)})),this.dispatch("row-moving",e,t,i)}moveRowInArray(e,t,i,s){var o,n,r;if(t!==i&&((o=e.indexOf(t))>-1&&(e.splice(o,1),(n=e.indexOf(i))>-1?s?e.splice(n+1,0,t):e.splice(n,0,t):e.splice(o,0,t)),e===this.getDisplayRows())){r=n>o?n:o+1;for(let t=o-1&&t}nextDisplayRow(e,t){var i=this.getDisplayRowIndex(e),s=!1;return!1!==i&&i-1)&&i}getData(e,t){var i=[];return this.getRows(e).forEach((function(e){"row"==e.type&&i.push(e.getData(t||"data"))})),i}getComponents(e){var t=[];return this.getRows(e).forEach((function(e){t.push(e.getComponent())})),t}getDataCount(e){return this.getRows(e).length}scrollHorizontal(e){this.scrollLeft=e,this.element.scrollLeft=e,this.dispatch("scroll-horizontal",e)}registerDataPipelineHandler(e,t){void 0!==t?(this.dataPipeline.push({handler:e,priority:t}),this.dataPipeline.sort(((e,t)=>e.priority-t.priority))):console.error("Data pipeline handlers must have a priority in order to be registered")}registerDisplayPipelineHandler(e,t){void 0!==t?(this.displayPipeline.push({handler:e,priority:t}),this.displayPipeline.sort(((e,t)=>e.priority-t.priority))):console.error("Display pipeline handlers must have a priority in order to be registered")}refreshActiveData(e,i,s){var o=this.table,n="",r=0,a=["all","dataPipeline","display","displayPipeline","end"];if("function"==typeof e)if((r=this.dataPipeline.findIndex((t=>t.handler===e)))>-1)n="dataPipeline",i&&(r==this.dataPipeline.length-1?n="display":r++);else{if(!((r=this.displayPipeline.findIndex((t=>t.handler===e)))>-1))return void console.error("Unable to refresh data, invalid handler provided",e);n="displayPipeline",i&&(r==this.displayPipeline.length-1?n="end":r++)}else n=e||"all",r=0;this.redrawBlock?(!this.redrawBlockRestoreConfig||this.redrawBlockRestoreConfig&&(this.redrawBlockRestoreConfig.stage===n&&r{var t=e.getCell(this.rowNumColumn);t&&t._generateContents()}))}setActiveRows(e){this.activeRows=e,this.activeRowsCount=this.activeRows.length}resetDisplayRows(){this.displayRows=[],this.displayRows.push(this.activeRows.slice(0)),this.displayRowsCount=this.displayRows[0].length}getNextDisplayIndex(){return this.displayRows.length}setDisplayRows(e,t){var i=!0;return t&&void 0!==this.displayRows[t]?(this.displayRows[t]=e,i=!0):(this.displayRows.push(e),i=t=this.displayRows.length-1),t==this.displayRows.length-1&&(this.displayRowsCount=this.displayRows[this.displayRows.length-1].length),i}getDisplayRows(e){return void 0===e?this.displayRows.length?this.displayRows[this.displayRows.length-1]:[]:this.displayRows[e]||[]}getVisibleRows(e,t){var i=Object.assign([],this.renderer.visibleRows(!t));return e&&(i=this.chain("rows-visible",[t],i,i)),i}displayRowIterator(e){this.activeRowsPipeline.forEach(e),this.displayRows.forEach(e),this.displayRowsCount=this.displayRows[this.displayRows.length-1].length}getRows(e){var t;switch(e){case"active":t=this.activeRows;break;case"display":t=this.table.rowManager.getDisplayRows();break;case"visible":t=this.getVisibleRows(!1,!0);break;default:t=this.chain("rows-retrieve",e,null,this.rows)||this.rows}return t}reRenderInPosition(e){this.redrawBlock?e?e():this.redrawBlockRenderInPosition=!0:(this.dispatchExternal("renderStarted"),this.renderer.rerenderRows(e),this.dispatchExternal("renderComplete"))}initializeRenderer(){var e,t={virtual:xe,basic:Re};(e="string"==typeof this.table.options.renderVertical?t[this.table.options.renderVertical]:this.table.options.renderVertical)?(this.renderer=new e(this.table,this.element,this.tableElement),this.renderer.initialize(),this.table.element.clientHeight||this.table.options.height?this.fixedHeight=!0:this.fixedHeight=!1):console.error("Unable to find matching renderer:",table.options.renderVertical)}getRenderMode(){return this.renderMode}renderTable(){this.dispatchExternal("renderStarted"),this.element.scrollTop=0,this._clearTable(),this.displayRowsCount?(this.renderer.renderRows(),this.firstRender&&(this.firstRender=!1,this.layoutRefresh())):this.renderEmptyScroll(),this.fixedHeight||this.adjustTableSize(),this.dispatch("table-layout"),this.displayRowsCount||this._showPlaceholder(),this.dispatchExternal("renderComplete")}renderEmptyScroll(){this.placeholder?this.tableElement.style.display="none":this.tableElement.style.minWidth=this.table.columnManager.getWidth()+"px"}_clearTable(){this.tableElement;this._clearPlaceholder(),this.scrollTop=0,this.scrollLeft=0,this.renderer.clearRows()}_showPlaceholder(){this.placeholder&&(this.placeholder.setAttribute("tabulator-render-mode",this.renderMode),this.getElement().appendChild(this.placeholder),this._positionPlaceholder())}_clearPlaceholder(){this.placeholder&&this.placeholder.parentNode&&this.placeholder.parentNode.removeChild(this.placeholder)}_positionPlaceholder(){this.placeholder&&this.placeholder.parentNode&&(this.placeholder.style.width=this.table.columnManager.getWidth()+"px",this.placeholderContents.style.width=this.table.rowManager.element.clientWidth+"px",this.placeholderContents.style.marginLeft=this.scrollLeft+"px")}styleRow(e,t){var i=e.getElement();t%2?(i.classList.add("tabulator-row-even"),i.classList.remove("tabulator-row-odd")):(i.classList.add("tabulator-row-odd"),i.classList.remove("tabulator-row-even"))}normalizeHeight(){this.activeRows.forEach((function(e){e.normalizeHeight()}))}adjustTableSize(){var e=this.element.clientHeight;if("fill"===this.renderer.verticalFillMode){let t=Math.floor(this.table.columnManager.getElement().getBoundingClientRect().height+(this.table.footerManager&&this.table.footerManager.active&&!this.table.footerManager.external?this.table.footerManager.getElement().getBoundingClientRect().height:0));this.fixedHeight?(this.element.style.minHeight="calc(100% - "+t+"px)",this.element.style.height="calc(100% - "+t+"px)",this.element.style.maxHeight="calc(100% - "+t+"px)"):(this.element.style.height="",this.element.style.height=this.table.element.clientHeight-t+"px",this.element.scrollTop=this.scrollTop),this.renderer.resize(),this.fixedHeight||e==this.element.clientHeight||(this.subscribed("table-resize")?this.dispatch("table-resize"):this.redraw())}this._positionPlaceholder()}reinitialize(){this.rows.forEach((function(e){e.reinitialize(!0)}))}blockRedraw(){this.redrawBlock=!0,this.redrawBlockRestoreConfig=!1}restoreRedraw(){this.redrawBlock=!1,this.redrawBlockRestoreConfig?(this.refreshActiveData(this.redrawBlockRestoreConfig.handler,this.redrawBlockRestoreConfig.skipStage,this.redrawBlockRestoreConfig.renderInPosition),this.redrawBlockRestoreConfig=!1):this.redrawBlockRenderInPosition&&this.reRenderInPosition(),this.redrawBlockRenderInPosition=!1}redraw(e){var t=this.scrollLeft;this.adjustTableSize(),this.table.tableWidth=this.table.element.clientWidth,e?this.renderTable():(this.reRenderInPosition(),this.scrollHorizontal(t))}resetScroll(){if(this.element.scrollLeft=0,this.element.scrollTop=0,"ie"===this.table.browser){var e=document.createEvent("Event");e.initEvent("scroll",!1,!0),this.element.dispatchEvent(e)}else this.element.dispatchEvent(new Event("scroll"))}}class Me extends e{constructor(e){super(e),this.active=!1,this.element=this.createElement(),this.containerElement=this.createContainerElement(),this.external=!1}initialize(){this.initializeElement()}createElement(){var e=document.createElement("div");return e.classList.add("tabulator-footer"),e}createContainerElement(){var e=document.createElement("div");return e.classList.add("tabulator-footer-contents"),this.element.appendChild(e),e}initializeElement(){if(this.table.options.footerElement)switch(typeof this.table.options.footerElement){case"string":"<"===this.table.options.footerElement[0]?this.containerElement.innerHTML=this.table.options.footerElement:(this.external=!0,this.containerElement=document.querySelector(this.table.options.footerElement));break;default:this.element=this.table.options.footerElement}}getElement(){return this.element}append(e){this.activate(),this.containerElement.appendChild(e),this.table.rowManager.adjustTableSize()}prepend(e){this.activate(),this.element.insertBefore(e,this.element.firstChild),this.table.rowManager.adjustTableSize()}remove(e){e.parentNode.removeChild(e),this.deactivate()}deactivate(e){this.element.firstChild&&!e||(this.external||this.element.parentNode.removeChild(this.element),this.active=!1)}activate(){this.active||(this.active=!0,this.external||(this.table.element.appendChild(this.getElement()),this.table.element.style.display=""))}redraw(){this.dispatch("footer-redraw")}}class Le extends e{constructor(e){super(e),this.el=null,this.abortClasses=["tabulator-headers","tabulator-table"],this.previousTargets={},this.listeners=["click","dblclick","contextmenu","mouseenter","mouseleave","mouseover","mouseout","mousemove","touchstart","touchend"],this.componentMap={"tabulator-cell":"cell","tabulator-row":"row","tabulator-group":"group","tabulator-col":"column"},this.pseudoTrackers={row:{subscriber:null,target:null},cell:{subscriber:null,target:null},group:{subscriber:null,target:null},column:{subscriber:null,target:null}},this.pseudoTracking=!1}initialize(){this.el=this.table.element,this.buildListenerMap(),this.bindSubscriptionWatchers()}buildListenerMap(){var e={};this.listeners.forEach((t=>{e[t]={handler:null,components:[]}})),this.listeners=e}bindPseudoEvents(){Object.keys(this.pseudoTrackers).forEach((e=>{this.pseudoTrackers[e].subscriber=this.pseudoMouseEnter.bind(this,e),this.subscribe(e+"-mouseover",this.pseudoTrackers[e].subscriber)})),this.pseudoTracking=!0}pseudoMouseEnter(e,t,i){this.pseudoTrackers[e].target!==i&&(this.pseudoTrackers[e].target&&this.dispatch(e+"-mouseleave",t,this.pseudoTrackers[e].target),this.pseudoMouseLeave(e,t),this.pseudoTrackers[e].target=i,this.dispatch(e+"-mouseenter",t,i))}pseudoMouseLeave(e,t){var i=Object.keys(this.pseudoTrackers),s={row:["cell"],cell:["row"]};(i=i.filter((t=>{var i=s[e];return t!==e&&(!i||i&&!i.includes(t))}))).forEach((e=>{var i=this.pseudoTrackers[e].target;this.pseudoTrackers[e].target&&(this.dispatch(e+"-mouseleave",t,i),this.pseudoTrackers[e].target=null)}))}bindSubscriptionWatchers(){var e=Object.keys(this.listeners),t=Object.values(this.componentMap);for(let i of t)for(let t of e){let e=i+"-"+t;this.subscriptionChange(e,this.subscriptionChanged.bind(this,i,t))}this.subscribe("table-destroy",this.clearWatchers.bind(this))}subscriptionChanged(e,t,i){var s=this.listeners[t].components,o=s.indexOf(e),n=!1;i?-1===o&&(s.push(e),n=!0):this.subscribed(e+"-"+t)||o>-1&&(s.splice(o,1),n=!0),"mouseenter"!==t&&"mouseleave"!==t||this.pseudoTracking||this.bindPseudoEvents(),n&&this.updateEventListeners()}updateEventListeners(){for(let e in this.listeners){let t=this.listeners[e];t.components.length?t.handler||(t.handler=this.track.bind(this,e),this.el.addEventListener(e,t.handler)):t.handler&&(this.el.removeEventListener(e,t.handler),t.handler=null)}}track(e,t){var i=t.composedPath&&t.composedPath()||t.path,s=this.findTargets(i);s=this.bindComponents(e,s),this.triggerEvents(e,t,s),!this.pseudoTracking||"mouseover"!=e&&"mouseleave"!=e||Object.keys(s).length||this.pseudoMouseLeave("none",t)}findTargets(e){var t={};let i=Object.keys(this.componentMap);for(let s of e){let e=s.classList?[...s.classList]:[];if(e.filter((e=>this.abortClasses.includes(e))).length)break;let o=e.filter((e=>i.includes(e)));for(let e of o)t[this.componentMap[e]]=s}return t.group&&t.group===t.row&&delete t.row,t}bindComponents(e,t){var i=Object.keys(t).reverse(),s=this.listeners[e],o={};for(let e of i){let i,n=t[e],r=this.previousTargets[e];if(r&&r.target===n)i=r.component;else switch(e){case"row":case"group":if(s.components.includes("row")||s.components.includes("cell")||s.components.includes("group")){i=this.table.rowManager.getVisibleRows(!0).find((e=>e.getElement()===n)),t.row&&t.row.parentNode&&t.row.parentNode.closest(".tabulator-row")&&(t[e]=!1)}break;case"column":s.components.includes("column")&&(i=this.table.columnManager.findColumn(n));break;case"cell":s.components.includes("cell")&&(t.row instanceof C?i=t.row.findCell(n):t.row&&console.warn("Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?"))}i&&(t[e]=i,o[e]={target:n,component:i})}return this.previousTargets=o,t}triggerEvents(e,t,i){var s=this.listeners[e];for(let o in i)i[o]&&s.components.includes(o)&&this.dispatch(o+"-"+e,t,i[o])}clearWatchers(){for(let e in this.listeners){let t=this.listeners[e];t.handler&&(this.el.removeEventListener(e,t.handler),t.handler=null)}}}class ke{constructor(e){this.table=e,this.bindings={}}bind(e,t,i){this.bindings[e]||(this.bindings[e]={}),this.bindings[e][t]?console.warn("Unable to bind component handler, a matching function name is already bound",e,t,i):this.bindings[e][t]=i}handle(e,t,i){if(this.bindings[e]&&this.bindings[e][i]&&"function"==typeof this.bindings[e][i].bind)return this.bindings[e][i].bind(null,t);"then"===i||"string"!=typeof i||i.startsWith("_")||console.error("The "+e+" component does not have a "+i+" function, have you checked that you have the correct Tabulator module installed?")}}class De extends e{constructor(e){super(e),this.requestOrder=0,this.loading=!1}initialize(){}load(e,t,i,s,o,n){var r=++this.requestOrder;return this.dispatchExternal("dataLoading",e),!e||0!=e.indexOf("{")&&0!=e.indexOf("[")||(e=JSON.parse(e)),this.confirm("data-loading",[e,t,i,o])?(this.loading=!0,o||this.alertLoader(),t=this.chain("data-params",[e,i,o],t||{},t||{}),t=this.mapParams(t,this.table.options.dataSendParams),this.chain("data-load",[e,t,i,o],!1,Promise.resolve([])).then((e=>{Array.isArray(e)||"object"!=typeof e||(e=this.mapParams(e,this.objectInvert(this.table.options.dataReceiveParams)));var t=this.chain("data-loaded",e,null,e);r==this.requestOrder?(this.clearAlert(),!1!==t&&(this.dispatchExternal("dataLoaded",t),this.table.rowManager.setData(t,s,void 0===n?!s:n))):console.warn("Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made")})).catch((e=>{console.error("Data Load Error: ",e),this.dispatchExternal("dataLoadError",e),o||this.alertError(),setTimeout((()=>{this.clearAlert()}),this.table.options.dataLoaderErrorTimeout)})).finally((()=>{this.loading=!1}))):(this.dispatchExternal("dataLoaded",e),e||(e=[]),this.table.rowManager.setData(e,s,void 0===n?!s:n),Promise.resolve())}mapParams(e,t){var i={};for(let s in e)i[t.hasOwnProperty(s)?t[s]:s]=e[s];return i}objectInvert(e){var t={};for(let i in e)t[e[i]]=i;return t}blockActiveLoad(){this.requestOrder++}alertLoader(){("function"==typeof this.table.options.dataLoader?this.table.options.dataLoader():this.table.options.dataLoader)&&this.table.alertManager.alert(this.table.options.dataLoaderLoading||this.langText("data|loading"))}alertError(){this.table.alertManager.alert(this.table.options.dataLoaderError||this.langText("data|error"),"error")}clearAlert(){this.table.alertManager.clear()}}class Pe{constructor(e,t,i){this.table=e,this.events={},this.optionsList=t||{},this.subscriptionNotifiers={},this.dispatch=i?this._debugDispatch.bind(this):this._dispatch.bind(this),this.debug=i}subscriptionChange(e,t){this.subscriptionNotifiers[e]||(this.subscriptionNotifiers[e]=[]),this.subscriptionNotifiers[e].push(t),this.subscribed(e)&&this._notifiySubscriptionChange(e,!0)}subscribe(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t),this._notifiySubscriptionChange(e,!0)}unsubscribe(e,t){var i;if(this.events[e]){if(t){if(!((i=this.events[e].findIndex((e=>e===t)))>-1))return void console.warn("Cannot remove event, no matching event found:",e,t);this.events[e].splice(i,1)}else delete this.events[e];this._notifiySubscriptionChange(e,!1)}else console.warn("Cannot remove event, no events set on:",e)}subscribed(e){return this.events[e]&&this.events[e].length}_notifiySubscriptionChange(e,t){var i=this.subscriptionNotifiers[e];i&&i.forEach((e=>{e(t)}))}_dispatch(){var e,t=Array.from(arguments),i=t.shift();return this.events[i]&&this.events[i].forEach(((i,s)=>{let o=i.apply(this.table,t);s||(e=o)})),e}_debugDispatch(){var e=Array.from(arguments),t=e[0];return e[0]="ExternalEvent:"+e[0],(!0===this.debug||this.debug.includes(t))&&console.log(...e),this._dispatch(...arguments)}}class Se{constructor(e){this.events={},this.subscriptionNotifiers={},this.dispatch=e?this._debugDispatch.bind(this):this._dispatch.bind(this),this.chain=e?this._debugChain.bind(this):this._chain.bind(this),this.confirm=e?this._debugConfirm.bind(this):this._confirm.bind(this),this.debug=e}subscriptionChange(e,t){this.subscriptionNotifiers[e]||(this.subscriptionNotifiers[e]=[]),this.subscriptionNotifiers[e].push(t),this.subscribed(e)&&this._notifiySubscriptionChange(e,!0)}subscribe(e,t,i=1e4){this.events[e]||(this.events[e]=[]),this.events[e].push({callback:t,priority:i}),this.events[e].sort(((e,t)=>e.priority-t.priority)),this._notifiySubscriptionChange(e,!0)}unsubscribe(e,t){var i;if(this.events[e]){if(t){if(!((i=this.events[e].findIndex((e=>e.callback===t)))>-1))return void console.warn("Cannot remove event, no matching event found:",e,t);this.events[e].splice(i,1)}this._notifiySubscriptionChange(e,!1)}else console.warn("Cannot remove event, no events set on:",e)}subscribed(e){return this.events[e]&&this.events[e].length}_chain(e,t,i,s){var o=i;return Array.isArray(t)||(t=[t]),this.subscribed(e)?(this.events[e].forEach(((e,i)=>{o=e.callback.apply(this,t.concat([o]))})),o):"function"==typeof s?s():s}_confirm(e,t){var i=!1;return Array.isArray(t)||(t=[t]),this.subscribed(e)&&this.events[e].forEach(((e,s)=>{e.callback.apply(this,t)&&(i=!0)})),i}_notifiySubscriptionChange(e,t){var i=this.subscriptionNotifiers[e];i&&i.forEach((e=>{e(t)}))}_dispatch(){var e=Array.from(arguments),t=e.shift();this.events[t]&&this.events[t].forEach((t=>{t.callback.apply(this,e)}))}_debugDispatch(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(!0===this.debug||this.debug.includes(t))&&console.log(...e),this._dispatch(...arguments)}_debugChain(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(!0===this.debug||this.debug.includes(t))&&console.log(...e),this._chain(...arguments)}_debugConfirm(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(!0===this.debug||this.debug.includes(t))&&console.log(...e),this._confirm(...arguments)}}class ze{static register(e){ze.tables.push(e)}static deregister(e){var t=ze.tables.indexOf(e);t>-1&&ze.tables.splice(t,1)}static lookupTable(e,t){var i,s,o=[];if("string"==typeof e){if((i=document.querySelectorAll(e)).length)for(var n=0;n{e.widthFixed||e.reinitializeWidth(),(this.table.options.responsiveLayout?e.modules.responsive.visible:e.visible)&&(o=e),e.visible&&(t+=e.getWidth())})),o?(s=i-t+o.getWidth(),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&(o.setWidth(0),this.table.modules.responsiveLayout.update()),s>0?o.setWidth(s):o.reinitializeWidth()):this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitColumns:function(e){var t,i,s=this.table.element.clientWidth,o=0,n=0,r=0,a=[],l=[],h=0,d=0;function c(e){return"string"==typeof e?e.indexOf("%")>-1?s/100*parseInt(e):parseInt(e):e}function u(e,t,i,s){var o=[],n=0,a=0,l=0,h=r,d=0,m=0,p=[];function g(e){return i*(e.column.definition.widthGrow||1)}function b(e){return c(e.width)-i*(e.column.definition.widthShrink||0)}return e.forEach((function(e,n){var r=s?b(e):g(e);e.column.minWidth>=r?o.push(e):e.column.maxWidth&&e.column.maxWidththis.table.rowManager.element.clientHeight&&(s-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),e.forEach((function(e){var t,i,s;e.visible&&(t=e.definition.width,i=parseInt(e.minWidth),t?(s=c(t),o+=s>i?s:i,e.definition.widthShrink&&(l.push({column:e,width:s>i?s:i}),h+=e.definition.widthShrink)):(a.push({column:e,width:0}),r+=e.definition.widthGrow||1))})),n=s-o,t=Math.floor(n/r),d=u(a,n,t,!1),a.length&&d>0&&(a[a.length-1].width+=+d),a.forEach((function(e){n-=e.width})),(i=Math.abs(d)+n)>0&&h&&(d=u(l,i,Math.floor(i/h),!0)),l.length&&(l[l.length-1].width-=d),a.forEach((function(e){e.column.setWidth(e.width)})),l.forEach((function(e){e.column.setWidth(e.width)}))}};class _e extends o{constructor(e){super(e,"layout"),this.mode=null,this.registerTableOption("layout","fitData"),this.registerTableOption("layoutColumnsOnNewData",!1),this.registerColumnOption("widthGrow"),this.registerColumnOption("widthShrink")}initialize(){var e=this.table.options.layout;_e.modes[e]?this.mode=e:(console.warn("Layout Error - invalid mode set, defaulting to 'fitData' : "+e),this.mode="fitData"),this.table.element.setAttribute("tabulator-layout",this.mode)}getMode(){return this.mode}layout(){this.dispatch("layout-refreshing"),_e.modes[this.mode].call(this,this.table.columnManager.columnsByIndex),this.dispatch("layout-refreshed")}}_e.moduleName="layout",_e.modes=He;class Oe extends o{constructor(e){super(e),this.locale="default",this.lang=!1,this.bindings={},this.langList={},this.registerTableOption("locale",!1),this.registerTableOption("langs",{})}initialize(){this.langList=t.deepClone(Oe.langs),!1!==this.table.options.columnDefaults.headerFilterPlaceholder&&this.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder);for(let e in this.table.options.langs)this.installLang(e,this.table.options.langs[e]);this.setLocale(this.table.options.locale),this.registerTableFunction("setLocale",this.setLocale.bind(this)),this.registerTableFunction("getLocale",this.getLocale.bind(this)),this.registerTableFunction("getLang",this.getLang.bind(this))}setHeaderFilterPlaceholder(e){this.langList.default.headerFilters.default=e}setHeaderFilterColumnPlaceholder(e,t){this.langList.default.headerFilters.columns[e]=t,this.lang&&!this.lang.headerFilters.columns[e]&&(this.lang.headerFilters.columns[e]=t)}installLang(e,t){this.langList[e]?this._setLangProp(this.langList[e],t):this.langList[e]=t}_setLangProp(e,t){for(let i in t)e[i]&&"object"==typeof e[i]?this._setLangProp(e[i],t[i]):e[i]=t[i]}setLocale(e){if(!0===(e=e||"default")&&navigator.language&&(e=navigator.language.toLowerCase()),e&&!this.langList[e]){let t=e.split("-")[0];this.langList[t]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",e,t),e=t):(console.warn("Localization Error - Matching locale not found, using default: ",e),e="default")}this.locale=e,this.lang=t.deepClone(this.langList.default||{}),"default"!=e&&function e(t,i){for(var s in t)"object"==typeof t[s]?(i[s]||(i[s]={}),e(t[s],i[s])):i[s]=t[s]}(this.langList[e],this.lang),this.dispatchExternal("localized",this.locale,this.lang),this._executeBindings()}getLocale(e){return this.locale}getLang(e){return e?this.langList[e]:this.lang}getText(e,t){var i=(e=t?e+"|"+t:e).split("|");return this._getLangElement(i,this.locale)||""}_getLangElement(e,t){var i=this.lang;return e.forEach((function(e){var t;i&&(t=i[e],i=void 0!==t&&t)})),i}bind(e,t){this.bindings[e]||(this.bindings[e]=[]),this.bindings[e].push(t),t(this.getText(e),this.lang)}_executeBindings(){for(let e in this.bindings)this.bindings[e].forEach((t=>{t(this.getText(e),this.lang)}))}}Oe.moduleName="localize",Oe.langs={default:{groups:{item:"item",items:"items"},columns:{},data:{loading:"Loading",error:"Error"},pagination:{page_size:"Page Size",page_title:"Show Page",first:"First",first_title:"First Page",last:"Last",last_title:"Last Page",prev:"Prev",prev_title:"Prev Page",next:"Next",next_title:"Next Page",all:"All",counter:{showing:"Showing",of:"of",rows:"rows",pages:"pages"}},headerFilters:{default:"filter column...",columns:{}}}};class Ae extends o{constructor(e){super(e)}initialize(){this.registerTableFunction("tableComms",this.receive.bind(this))}getConnections(e){var t=[];return ze.lookupTable(e).forEach((e=>{this.table!==e&&t.push(e)})),t}send(e,t,i,s){var o=this.getConnections(e);o.forEach((e=>{e.tableComms(this.table.element,t,i,s)})),!o.length&&e&&console.warn("Table Connection Error - No tables matching selector found",e)}receive(e,t,i,s){if(this.table.modExists(t))return this.table.modules[t].commsReceived(e,i,s);console.warn("Inter-table Comms Error - no such module:",t)}}Ae.moduleName="comms";var Be=Object.freeze({__proto__:null,LayoutModule:_e,LocalizeModule:Oe,CommsModule:Ae});class Ie{constructor(e,t){this.bindStaticFuctionality(e),this.bindModules(e,Be,!0),t&&this.bindModules(e,t)}bindStaticFuctionality(e){e.moduleBindings={},e.extendModule=function(t,i,s){if(e.moduleBindings[t]){var o=e.moduleBindings[t][i];if(o)if("object"==typeof s)for(let e in s)o[e]=s[e];else console.warn("Module Error - Invalid value type, it must be an object");else console.warn("Module Error - property does not exist:",i)}else console.warn("Module Error - module does not exist:",t)},e.registerModule=function(t){Array.isArray(t)||(t=[t]),t.forEach((t=>{e.registerModuleBinding(t)}))},e.registerModuleBinding=function(t){e.moduleBindings[t.moduleName]=t},e.findTable=function(e){var t=ze.lookupTable(e,!0);return!(Array.isArray(t)&&!t.length)&&t},e.prototype.bindModules=function(){var t=[],i=[],s=[];for(var o in this.modules={},e.moduleBindings){let n=e.moduleBindings[o],r=new n(this);this.modules[o]=r,n.prototype.moduleCore?this.modulesCore.push(r):n.moduleInitOrder?n.moduleInitOrder<0?t.push(r):i.push(r):s.push(r)}t.sort(((e,t)=>e.moduleInitOrder>t.moduleInitOrder?1:-1)),i.sort(((e,t)=>e.moduleInitOrder>t.moduleInitOrder?1:-1)),this.modulesRegular=t.concat(s.concat(i))}}bindModules(e,t,i){var s=Object.values(t);i&&s.forEach((e=>{e.prototype.moduleCore=!0})),e.registerModule(s)}}class Ne extends e{constructor(e){super(e),this.element=this._createAlertElement(),this.msgElement=this._createMsgElement(),this.type=null,this.element.appendChild(this.msgElement)}_createAlertElement(){var e=document.createElement("div");return e.classList.add("tabulator-alert"),e}_createMsgElement(){var e=document.createElement("div");return e.classList.add("tabulator-alert-msg"),e.setAttribute("role","alert"),e}_typeClass(){return"tabulator-alert-state-"+this.type}alert(e,t="msg"){if(e){for(this.clear(),this.type=t;this.msgElement.firstChild;)this.msgElement.removeChild(this.msgElement.firstChild);this.msgElement.classList.add(this._typeClass()),"function"==typeof e&&(e=e()),e instanceof HTMLElement?this.msgElement.appendChild(e):this.msgElement.innerHTML=e,this.table.element.appendChild(this.element)}}clear(){this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.msgElement.classList.remove(this._typeClass())}}class Ve{constructor(e,t){this.options={},this.columnManager=null,this.rowManager=null,this.footerManager=null,this.alertManager=null,this.vdomHoz=null,this.externalEvents=null,this.eventBus=null,this.interactionMonitor=!1,this.browser="",this.browserSlow=!1,this.browserMobile=!1,this.rtl=!1,this.originalElement=null,this.componentFunctionBinder=new ke(this),this.dataLoader=!1,this.modules={},this.modulesCore=[],this.modulesRegular=[],this.optionsList=new ve(this,"table constructor"),this.initialized=!1,this.initializeElement(e)&&(this.initializeCoreSystems(t),setTimeout((()=>{this._create()}))),ze.register(this)}initializeElement(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement?(this.element=e,!0):"string"==typeof e?(this.element=document.querySelector(e),!!this.element||(console.error("Tabulator Creation Error - no element found matching selector: ",e),!1)):(console.error("Tabulator Creation Error - Invalid element provided:",e),!1)}initializeCoreSystems(e){this.columnManager=new ye(this),this.rowManager=new Te(this),this.footerManager=new Me(this),this.dataLoader=new De(this),this.alertManager=new Ne(this),this.bindModules(),this.options=this.optionsList.generate(Ve.defaultOptions,e),this._clearObjectPointers(),this._mapDeprecatedFunctionality(),this.externalEvents=new Pe(this,this.options,this.options.debugEventsExternal),this.eventBus=new Se(this.options.debugEventsInternal),this.interactionMonitor=new Le(this),this.dataLoader.initialize(),this.footerManager.initialize()}_mapDeprecatedFunctionality(){}_clearSelection(){this.element.classList.add("tabulator-block-select"),window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty(),this.element.classList.remove("tabulator-block-select")}_create(){this.externalEvents.dispatch("tableBuilding"),this.eventBus.dispatch("table-building"),this._rtlCheck(),this._buildElement(),this._initializeTable(),this._loadInitialData(),this.initialized=!0,this.externalEvents.dispatch("tableBuilt")}_rtlCheck(){var e=window.getComputedStyle(this.element);switch(this.options.textDirection){case"auto":if("rtl"!==e.direction)break;case"rtl":this.element.classList.add("tabulator-rtl"),this.rtl=!0;break;case"ltr":this.element.classList.add("tabulator-ltr");default:this.rtl=!1}}_clearObjectPointers(){this.options.columns=this.options.columns.slice(0),Array.isArray(this.options.data)&&!this.options.reactiveData&&(this.options.data=this.options.data.slice(0))}_buildElement(){var e,t=this.element,i=this.options;if("TABLE"===t.tagName){this.originalElement=this.element,e=document.createElement("div");var s=t.attributes;for(var o in s)"object"==typeof s[o]&&e.setAttribute(s[o].name,s[o].value);t.parentNode.replaceChild(e,t),this.element=t=e}for(t.classList.add("tabulator"),t.setAttribute("role","grid");t.firstChild;)t.removeChild(t.firstChild);i.height&&(i.height=isNaN(i.height)?i.height:i.height+"px",t.style.height=i.height),!1!==i.minHeight&&(i.minHeight=isNaN(i.minHeight)?i.minHeight:i.minHeight+"px",t.style.minHeight=i.minHeight),!1!==i.maxHeight&&(i.maxHeight=isNaN(i.maxHeight)?i.maxHeight:i.maxHeight+"px",t.style.maxHeight=i.maxHeight)}_initializeTable(){var e=this.element,t=this.options;this.interactionMonitor.initialize(),this.columnManager.initialize(),this.rowManager.initialize(),this._detectBrowser(),this.modulesCore.forEach((e=>{e.initialize()})),e.appendChild(this.columnManager.getElement()),e.appendChild(this.rowManager.getElement()),t.footerElement&&this.footerManager.activate(),t.autoColumns&&t.data&&this.columnManager.generateColumnsFromRowData(this.options.data),this.modulesRegular.forEach((e=>{e.initialize()})),this.columnManager.setColumns(t.columns),this.eventBus.dispatch("table-built")}_loadInitialData(){this.dataLoader.load(this.options.data)}destroy(){var e=this.element;for(ze.deregister(this),this.eventBus.dispatch("table-destroy"),this.rowManager.rows.forEach((function(e){e.wipe()})),this.rowManager.rows=[],this.rowManager.activeRows=[],this.rowManager.displayRows=[];e.firstChild;)e.removeChild(e.firstChild);e.classList.remove("tabulator")}_detectBrowser(){var e=navigator.userAgent||navigator.vendor||window.opera;e.indexOf("Trident")>-1?(this.browser="ie",this.browserSlow=!0):e.indexOf("Edge")>-1?(this.browser="edge",this.browserSlow=!0):e.indexOf("Firefox")>-1?(this.browser="firefox",this.browserSlow=!1):(this.browser="other",this.browserSlow=!1),this.browserMobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.slice(0,4))}initGuard(e,t){var i,s;return this.options.debugInitialization&&!this.initialized&&(e||(e=" "==(s="Error"==(i=(new Error).stack.split("\n"))[0]?i[2]:i[1])[0]?s.trim().split(" ")[1].split(".")[1]:s.trim().split("@")[0]),console.warn("Table Not Initialized - Calling the "+e+" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function."+(t?" "+t:""))),this.initialized}blockRedraw(){return this.initGuard(),this.rowManager.blockRedraw()}restoreRedraw(){return this.initGuard(),this.rowManager.restoreRedraw()}setData(e,t,i){return this.initGuard(!1,"To set initial data please use the 'data' property in the table constructor."),this.dataLoader.load(e,t,i,!1)}clearData(){this.initGuard(),this.dataLoader.blockActiveLoad(),this.rowManager.clearData()}getData(e){return this.rowManager.getData(e)}getDataCount(e){return this.rowManager.getDataCount(e)}replaceData(e,t,i){return this.initGuard(),this.dataLoader.load(e,t,i,!0,!0)}updateData(e){var t=0;return this.initGuard(),new Promise(((i,s)=>{this.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e?e.forEach((e=>{var s=this.rowManager.findRow(e[this.options.index]);s&&(t++,s.updateData(e).then((()=>{--t||i()})))})):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))}))}addData(e,t,i){return this.initGuard(),new Promise(((s,o)=>{this.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e?this.rowManager.addRows(e,t,i).then((e=>{var t=[];e.forEach((function(e){t.push(e.getComponent())})),s(t)})):(console.warn("Update Error - No data provided"),o("Update Error - No data provided"))}))}updateOrAddData(e){var t=[],i=0;return this.initGuard(),new Promise(((s,o)=>{this.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e?e.forEach((e=>{var o=this.rowManager.findRow(e[this.options.index]);i++,o?o.updateData(e).then((()=>{i--,t.push(o.getComponent()),i||s(t)})):this.rowManager.addRows(e).then((e=>{i--,t.push(e[0].getComponent()),i||s(t)}))})):(console.warn("Update Error - No data provided"),o("Update Error - No data provided"))}))}getRow(e){var t=this.rowManager.findRow(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}getRowFromPosition(e,t){var i=this.rowManager.getRowFromPosition(e,t);return i?i.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}deleteRow(e){var t=[];this.initGuard(),Array.isArray(e)||(e=[e]);for(let i of e){let e=this.rowManager.findRow(i,!0);if(!e)return console.error("Delete Error - No matching row found:",i),Promise.reject("Delete Error - No matching row found");t.push(e)}return t.sort(((e,t)=>this.rowManager.rows.indexOf(e)>this.rowManager.rows.indexOf(t)?1:-1)),t.forEach((e=>{e.delete()})),this.rowManager.reRenderInPosition(),Promise.resolve()}addRow(e,t,i){return this.initGuard(),"string"==typeof e&&(e=JSON.parse(e)),this.rowManager.addRows(e,t,i).then((e=>e[0].getComponent()))}updateOrAddRow(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),"string"==typeof t&&(t=JSON.parse(t)),i?i.updateData(t).then((()=>i.getComponent())):this.rowManager.addRows(t).then((e=>e[0].getComponent()))}updateRow(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),"string"==typeof t&&(t=JSON.parse(t)),i?i.updateData(t).then((()=>Promise.resolve(i.getComponent()))):(console.warn("Update Error - No matching row found:",e),Promise.reject("Update Error - No matching row found"))}scrollToRow(e,t,i){var s=this.rowManager.findRow(e);return s?this.rowManager.scrollToRow(s,t,i):(console.warn("Scroll Error - No matching row found:",e),Promise.reject("Scroll Error - No matching row found"))}moveRow(e,t,i){var s=this.rowManager.findRow(e);this.initGuard(),s?s.moveToRow(t,i):console.warn("Move Error - No matching row found:",e)}getRows(e){return this.rowManager.getComponents(e)}getRowPosition(e,t){var i=this.rowManager.findRow(e);return i?this.rowManager.getRowPosition(i,t):(console.warn("Position Error - No matching row found:",e),!1)}setColumns(e){this.initGuard(!1,"To set initial columns please use the 'columns' property in the table constructor"),this.columnManager.setColumns(e)}getColumns(e){return this.columnManager.getComponents(e)}getColumn(e){var t=this.columnManager.findColumn(e);return t?t.getComponent():(console.warn("Find Error - No matching column found:",e),!1)}getColumnDefinitions(){return this.columnManager.getDefinitionTree()}showColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Show Error - No matching column found:",e),!1;t.show()}hideColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Hide Error - No matching column found:",e),!1;t.hide()}toggleColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Visibility Toggle Error - No matching column found:",e),!1;t.visible?t.hide():t.show()}addColumn(e,t,i){var s=this.columnManager.findColumn(i);return this.initGuard(),this.columnManager.addColumn(e,t,s).then((e=>e.getComponent()))}deleteColumn(e){var t=this.columnManager.findColumn(e);return this.initGuard(),t?t.delete():(console.warn("Column Delete Error - No matching column found:",e),Promise.reject())}updateColumnDefinition(e,t){var i=this.columnManager.findColumn(e);return this.initGuard(),i?i.updateDefinition(t):(console.warn("Column Update Error - No matching column found:",e),Promise.reject())}moveColumn(e,t,i){var s=this.columnManager.findColumn(e),o=this.columnManager.findColumn(t);this.initGuard(),s?o?this.columnManager.moveColumn(s,o,i):console.warn("Move Error - No matching column found:",o):console.warn("Move Error - No matching column found:",e)}scrollToColumn(e,t,i){return new Promise(((s,o)=>{var n=this.columnManager.findColumn(e);return n?this.columnManager.scrollToColumn(n,t,i):(console.warn("Scroll Error - No matching column found:",e),Promise.reject("Scroll Error - No matching column found"))}))}redraw(e){this.initGuard(),this.columnManager.redraw(e),this.rowManager.redraw(e)}setHeight(e){this.options.height=isNaN(e)?e:e+"px",this.element.style.height=this.options.height,this.rowManager.initializeRenderer(),this.rowManager.redraw()}on(e,t){this.externalEvents.subscribe(e,t)}off(e,t){this.externalEvents.unsubscribe(e,t)}dispatchEvent(){Array.from(arguments).shift();this.externalEvents.dispatch(...arguments)}alert(e,t){this.initGuard(),this.alertManager.alert(e,t)}clearAlert(){this.initGuard(),this.alertManager.clear()}modExists(e,t){return!!this.modules[e]||(t&&console.error("Tabulator Module Not Installed: "+e),!1)}module(e){var t=this.modules[e];return t||console.error("Tabulator module not installed: "+e),t}}Ve.defaultOptions={debugEventsExternal:!1,debugEventsInternal:!1,debugInvalidOptions:!0,debugInitialization:!0,height:!1,minHeight:!1,maxHeight:!1,columnHeaderVertAlign:"top",popupContainer:!1,columns:[],columnDefaults:{},data:!1,autoColumns:!1,autoColumnsDefinitions:!1,nestedFieldSeparator:".",footerElement:!1,index:"id",textDirection:"auto",addRowPos:"bottom",headerVisible:!0,renderVertical:"virtual",renderHorizontal:"basic",renderVerticalBuffer:0,scrollToRowPosition:"top",scrollToRowIfVisible:!0,scrollToColumnPosition:"left",scrollToColumnIfVisible:!0,rowFormatter:!1,rowFormatterPrint:null,rowFormatterClipboard:null,rowFormatterHtmlOutput:null,rowHeight:null,placeholder:!1,dataLoader:!0,dataLoaderLoading:!1,dataLoaderError:!1,dataLoaderErrorTimeout:3e3,dataSendParams:{},dataReceiveParams:{}},new Ie(Ve);class We extends Ve{}new Ie(We,fe);class Ge{constructor(e){this.type=e,this.element=this._createElement()}_createElement(){var e=document.createElement("div");return e.classList.add("tabulator-row"),e}getElement(){return this.element}getComponent(){return!1}getData(){return{}}getHeight(){return this.element.outerHeight}initialize(){}reinitialize(){}normalizeHeight(){}generateCells(){}reinitializeHeight(){}calcHeight(){}setCellHeight(){}clearCellHeight(){}}export{n as AccessorModule,c as AjaxModule,m as CalcComponent,p as CellComponent,u as ClipboardModule,y as ColumnCalcsModule,b as ColumnComponent,R as DataTreeModule,T as DownloadModule,D as EditModule,z as ExportModule,H as FilterModule,O as FormatModule,A as FrozenColumnsModule,B as FrozenRowsModule,I as GroupComponent,V as GroupRowsModule,W as HistoryModule,G as HtmlTableImportModule,U as ImportModule,X as InteractionModule,q as KeybindingsModule,K as MenuModule,o as Module,J as MoveColumnsModule,Y as MoveRowsModule,$ as MutatorModule,Q as PageModule,ie as PersistenceModule,se as PopupModule,oe as PrintModule,Ge as PseudoRow,ne as ReactiveDataModule,we as Renderer,re as ResizeColumnsModule,ae as ResizeRowsModule,le as ResizeTableModule,he as ResponsiveLayoutModule,w as RowComponent,de as SelectRowModule,me as SortModule,Ve as Tabulator,We as TabulatorFull,pe as TooltipModule,be as ValidateModule}; //# sourceMappingURL=tabulator_esm.min.js.map diff --git a/dist/js/tabulator_esm.min.js.map b/dist/js/tabulator_esm.min.js.map index e441132bb..2e4d8b09e 100644 --- a/dist/js/tabulator_esm.min.js.map +++ b/dist/js/tabulator_esm.min.js.map @@ -1 +1 @@ -{"version":3,"file":"tabulator_esm.min.js","sources":["../../src/js/core/CoreFeature.js","../../src/js/core/tools/Helpers.js","../../src/js/core/tools/Popup.js","../../src/js/core/Module.js","../../src/js/modules/Accessor/Accessor.js","../../src/js/modules/Accessor/defaults/accessors.js","../../src/js/modules/Ajax/defaults/urlGenerator.js","../../src/js/modules/Ajax/defaults/contentTypeFormatters.js","../../src/js/modules/Ajax/Ajax.js","../../src/js/modules/Ajax/defaults/config.js","../../src/js/modules/Ajax/defaults/loaderPromise.js","../../src/js/modules/Clipboard/Clipboard.js","../../src/js/modules/Clipboard/defaults/pasteActions.js","../../src/js/modules/Clipboard/defaults/pasteParsers.js","../../src/js/modules/ColumnCalcs/CalcComponent.js","../../src/js/core/cell/CellComponent.js","../../src/js/core/cell/Cell.js","../../src/js/core/column/ColumnComponent.js","../../src/js/core/column/defaults/options.js","../../src/js/core/column/Column.js","../../src/js/core/row/RowComponent.js","../../src/js/core/row/Row.js","../../src/js/modules/ColumnCalcs/defaults/calculations.js","../../src/js/modules/ColumnCalcs/ColumnCalcs.js","../../src/js/modules/DataTree/DataTree.js","../../src/js/modules/Download/defaults/downloaders.js","../../src/js/modules/Download/defaults/downloaders/csv.js","../../src/js/modules/Download/defaults/downloaders/json.js","../../src/js/modules/Download/defaults/downloaders/jsonLines.js","../../src/js/modules/Download/defaults/downloaders/pdf.js","../../src/js/modules/Download/defaults/downloaders/xlsx.js","../../src/js/modules/Download/defaults/downloaders/html.js","../../src/js/modules/Download/Download.js","../../src/js/modules/Edit/inputMask.js","../../src/js/modules/Edit/List.js","../../src/js/modules/Edit/defaults/editors.js","../../src/js/modules/Edit/defaults/editors/input.js","../../src/js/modules/Edit/defaults/editors/textarea.js","../../src/js/modules/Edit/defaults/editors/number.js","../../src/js/modules/Edit/defaults/editors/range.js","../../src/js/modules/Edit/defaults/editors/select.js","../../src/js/modules/Edit/defaults/editors/list.js","../../src/js/modules/Edit/defaults/editors/autocomplete.js","../../src/js/modules/Edit/defaults/editors/star.js","../../src/js/modules/Edit/defaults/editors/progress.js","../../src/js/modules/Edit/defaults/editors/tickCross.js","../../src/js/modules/Edit/Edit.js","../../src/js/modules/Export/ExportRow.js","../../src/js/modules/Export/ExportColumn.js","../../src/js/modules/Export/Export.js","../../src/js/modules/Filter/defaults/filters.js","../../src/js/modules/Filter/Filter.js","../../src/js/modules/Format/defaults/formatters/plaintext.js","../../src/js/modules/Format/defaults/formatters.js","../../src/js/modules/Format/defaults/formatters/html.js","../../src/js/modules/Format/defaults/formatters/textarea.js","../../src/js/modules/Format/defaults/formatters/money.js","../../src/js/modules/Format/defaults/formatters/link.js","../../src/js/modules/Format/defaults/formatters/image.js","../../src/js/modules/Format/defaults/formatters/tickCross.js","../../src/js/modules/Format/defaults/formatters/datetime.js","../../src/js/modules/Format/defaults/formatters/datetimediff.js","../../src/js/modules/Format/defaults/formatters/lookup.js","../../src/js/modules/Format/defaults/formatters/star.js","../../src/js/modules/Format/defaults/formatters/traffic.js","../../src/js/modules/Format/defaults/formatters/progress.js","../../src/js/modules/Format/defaults/formatters/color.js","../../src/js/modules/Format/defaults/formatters/handle.js","../../src/js/modules/Format/defaults/formatters/responsiveCollapse.js","../../src/js/modules/Format/defaults/formatters/rowSelection.js","../../src/js/modules/Format/Format.js","../../src/js/modules/FrozenColumns/FrozenColumns.js","../../src/js/modules/FrozenRows/FrozenRows.js","../../src/js/modules/GroupRows/GroupComponent.js","../../src/js/modules/GroupRows/Group.js","../../src/js/modules/GroupRows/GroupRows.js","../../src/js/modules/History/defaults/undoers.js","../../src/js/modules/History/History.js","../../src/js/modules/HtmlTableImport/HtmlTableImport.js","../../src/js/modules/History/defaults/redoers.js","../../src/js/modules/Import/defaults/importers/csv.js","../../src/js/modules/Import/Import.js","../../src/js/modules/Import/defaults/importers/json.js","../../src/js/modules/Interaction/Interaction.js","../../src/js/modules/Keybindings/defaults/bindings.js","../../src/js/modules/Keybindings/Keybindings.js","../../src/js/modules/Menu/Menu.js","../../src/js/modules/Keybindings/defaults/actions.js","../../src/js/modules/MoveColumns/MoveColumns.js","../../src/js/modules/MoveRows/MoveRows.js","../../src/js/modules/Mutator/defaults/mutators.js","../../src/js/modules/Mutator/Mutator.js","../../src/js/modules/Page/defaults/pageCounters/rows.js","../../src/js/modules/Page/Page.js","../../src/js/modules/Page/defaults/pageCounters/pages.js","../../src/js/modules/Page/defaults/pageCounters.js","../../src/js/modules/Persistence/defaults/readers.js","../../src/js/modules/Persistence/defaults/writers.js","../../src/js/modules/Persistence/Persistence.js","../../src/js/modules/Popup/Popup.js","../../src/js/modules/Print/Print.js","../../src/js/modules/ReactiveData/ReactiveData.js","../../src/js/modules/ResizeColumns/ResizeColumns.js","../../src/js/modules/ResizeRows/ResizeRows.js","../../src/js/modules/ResizeTable/ResizeTable.js","../../src/js/modules/ResponsiveLayout/ResponsiveLayout.js","../../src/js/modules/SelectRow/SelectRow.js","../../src/js/modules/Sort/defaults/sorters/datetime.js","../../src/js/modules/Sort/defaults/sorters/date.js","../../src/js/modules/Sort/defaults/sorters/number.js","../../src/js/modules/Sort/defaults/sorters.js","../../src/js/modules/Sort/defaults/sorters/string.js","../../src/js/modules/Sort/defaults/sorters/time.js","../../src/js/modules/Sort/defaults/sorters/boolean.js","../../src/js/modules/Sort/Sort.js","../../src/js/modules/Sort/defaults/sorters/array.js","../../src/js/modules/Sort/defaults/sorters/exists.js","../../src/js/modules/Sort/defaults/sorters/alphanum.js","../../src/js/modules/Tooltip/Tooltip.js","../../src/js/modules/Validate/defaults/validators.js","../../src/js/modules/Validate/Validate.js","../../src/js/core/defaults/options.js","../../src/js/core/tools/OptionsList.js","../../src/js/core/rendering/Renderer.js","../../src/js/core/rendering/renderers/BasicHorizontal.js","../../src/js/core/rendering/renderers/VirtualDomHorizontal.js","../../src/js/core/ColumnManager.js","../../src/js/core/rendering/renderers/BasicVertical.js","../../src/js/core/rendering/renderers/VirtualDomVertical.js","../../src/js/core/RowManager.js","../../src/js/core/FooterManager.js","../../src/js/core/tools/InteractionMonitor.js","../../src/js/core/tools/ComponentFunctionBinder.js","../../src/js/core/tools/DataLoader.js","../../src/js/core/tools/ExternalEventBus.js","../../src/js/core/tools/InternalEventBus.js","../../src/js/core/tools/TableRegistry.js","../../src/js/modules/Layout/defaults/modes/fitData.js","../../src/js/modules/Layout/defaults/modes/fitDataStretch.js","../../src/js/modules/Layout/defaults/modes/fitDataGeneral.js","../../src/js/modules/Layout/Layout.js","../../src/js/modules/Layout/defaults/modes/fitColumns.js","../../src/js/modules/Layout/defaults/modes.js","../../src/js/modules/Localize/defaults/langs.js","../../src/js/modules/Localize/Localize.js","../../src/js/modules/Comms/Comms.js","../../src/js/core/tools/ModuleBinder.js","../../src/js/core/tools/Alert.js","../../src/js/core/Tabulator.js","../../src/js/core/row/PseudoRow.js"],"sourcesContent":["export default class CoreFeature{\r\n\r\n\tconstructor(table){\r\n\t\tthis.table = table;\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t/////////////// DataLoad /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\treloadData(data, silent, columnsChanged){\r\n\t\treturn this.table.dataLoader.load(data, undefined, undefined, undefined, silent, columnsChanged);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t///////////// Localization ///////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tlangText(){\r\n\t\treturn this.table.modules.localize.getText(...arguments);\r\n\t}\r\n\r\n\tlangBind(){\r\n\t\treturn this.table.modules.localize.bind(...arguments);\r\n\t}\r\n\r\n\tlangLocale(){\r\n\t\treturn this.table.modules.localize.getLocale(...arguments);\r\n\t}\r\n\r\n\r\n\t//////////////////////////////////////////\r\n\t////////// Inter Table Comms /////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tcommsConnections(){\r\n\t\treturn this.table.modules.comms.getConnections(...arguments);\r\n\t}\r\n\r\n\tcommsSend(){\r\n\t\treturn this.table.modules.comms.send(...arguments);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t//////////////// Layout /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tlayoutMode(){\r\n\t\treturn this.table.modules.layout.getMode();\r\n\t}\r\n\r\n\tlayoutRefresh(){\r\n\t\treturn this.table.modules.layout.layout();\r\n\t}\r\n\r\n\r\n\t//////////////////////////////////////////\r\n\t/////////////// Event Bus ////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tsubscribe(){\r\n\t\treturn this.table.eventBus.subscribe(...arguments);\r\n\t}\r\n\r\n\tunsubscribe(){\r\n\t\treturn this.table.eventBus.unsubscribe(...arguments);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.table.eventBus.subscribed(key);\r\n\t}\r\n\r\n\tsubscriptionChange(){\r\n\t\treturn this.table.eventBus.subscriptionChange(...arguments);\r\n\t}\r\n\r\n\tdispatch(){\r\n\t\treturn this.table.eventBus.dispatch(...arguments);\r\n\t}\r\n\r\n\tchain(){\r\n\t\treturn this.table.eventBus.chain(...arguments);\r\n\t}\r\n\r\n\tconfirm(){\r\n\t\treturn this.table.eventBus.confirm(...arguments);\r\n\t}\r\n\r\n\tdispatchExternal(){\r\n\t\treturn this.table.externalEvents.dispatch(...arguments);\r\n\t}\r\n\r\n\tsubscribedExternal(key){\r\n\t\treturn this.table.externalEvents.subscribed(key);\r\n\t}\r\n\r\n\tsubscriptionChangeExternal(){\r\n\t\treturn this.table.externalEvents.subscriptionChange(...arguments);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t//////////////// Options /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\toptions(key){\r\n\t\treturn this.table.options[key];\r\n\t}\r\n\r\n\tsetOption(key, value){\r\n\t\tif(typeof value !== \"undefined\"){\r\n\t\t\tthis.table.options[key] = value;\r\n\t\t}\r\n\r\n\t\treturn this.table.options[key];\r\n\t}\r\n\r\n\r\n\t//////////////////////////////////////////\r\n\t//////////////// Modules /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tmodule(key){\r\n\t\treturn this.table.module(key);\r\n\t}\r\n}","export default class Helpers{\r\n\r\n\tstatic elVisible(el){\r\n\t\treturn !(el.offsetWidth <= 0 && el.offsetHeight <= 0);\r\n\t}\r\n\r\n\tstatic elOffset(el){\r\n\t\tvar box = el.getBoundingClientRect();\r\n\r\n\t\treturn {\r\n\t\t\ttop: box.top + window.pageYOffset - document.documentElement.clientTop,\r\n\t\t\tleft: box.left + window.pageXOffset - document.documentElement.clientLeft\r\n\t\t};\r\n\t}\r\n\r\n\tstatic deepClone(obj, clone, list = []){\r\n\t\tvar objectProto = {}.__proto__,\r\n\t\tarrayProto = [].__proto__;\r\n\r\n\t\tif (!clone){\r\n\t\t\tclone = Object.assign(Array.isArray(obj) ? [] : {}, obj);\r\n\t\t}\r\n\r\n\t\tfor(var i in obj) {\r\n\t\t\tlet subject = obj[i],\r\n\t\t\tmatch, copy;\r\n\r\n\t\t\tif(subject != null && typeof subject === \"object\" && (subject.__proto__ === objectProto || subject.__proto__ === arrayProto)){\r\n\t\t\t\tmatch = list.findIndex((item) => {\r\n\t\t\t\t\treturn item.subject === subject;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(match > -1){\r\n\t\t\t\t\tclone[i] = list[match].copy;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcopy = Object.assign(Array.isArray(subject) ? [] : {}, subject);\r\n\r\n\t\t\t\t\tlist.unshift({subject, copy});\r\n\r\n\t\t\t\t\tclone[i] = this.deepClone(subject, copy, list);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn clone;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from './Helpers.js';\r\n\r\nexport default class Popup extends CoreFeature{\r\n constructor(table, element, parent){\r\n super(table);\r\n \r\n this.element = element;\r\n this.container = this._lookupContainer();\r\n \r\n this.parent = parent;\r\n \r\n this.reversedX = false;\r\n this.childPopup = null;\r\n this.blurable = false;\r\n this.blurCallback = null;\r\n this.renderedCallback = null;\r\n \r\n this.visible = false;\r\n \r\n this.element.classList.add(\"tabulator-popup-container\");\r\n \r\n this.blurEvent = this.hide.bind(this, false);\r\n this.escEvent = this._escapeCheck.bind(this);\r\n }\r\n \r\n _lookupContainer(){\r\n var container = this.table.options.popupContainer;\r\n \r\n if(typeof container === \"string\"){\r\n container = document.querySelector(container);\r\n \r\n if(!container){\r\n console.warn(\"Menu Error - no container element found matching selector:\", this.table.options.popupContainer , \"(defaulting to document body)\");\r\n }\r\n }else if (container === true){\r\n container = this.table.element;\r\n }\r\n \r\n if(container && !this._checkContainerIsParent(container)){\r\n container = false;\r\n console.warn(\"Menu Error - container element does not contain this table:\", this.table.options.popupContainer , \"(defaulting to document body)\");\r\n }\r\n \r\n if(!container){\r\n container = document.body;\r\n }\r\n \r\n return container;\r\n }\r\n \r\n _checkContainerIsParent(container, element = this.table.element){\r\n if(container === element){\r\n return true;\r\n }else{\r\n return element.parentNode ? this._checkContainerIsParent(container, element.parentNode) : false;\r\n }\r\n }\r\n \r\n renderCallback(callback){\r\n this.renderedCallback = callback;\r\n }\r\n \r\n containerEventCoords(e){\r\n var touch = !(e instanceof MouseEvent);\r\n \r\n var x = touch ? e.touches[0].pageX : e.pageX;\r\n var y = touch ? e.touches[0].pageY : e.pageY;\r\n \r\n if(this.container !== document.body){\r\n let parentOffset = Helpers.elOffset(this.container);\r\n \r\n x -= parentOffset.left;\r\n y -= parentOffset.top;\r\n }\r\n \r\n return {x, y};\r\n }\r\n \r\n elementPositionCoords(element, position = \"right\"){\r\n var offset = Helpers.elOffset(element),\r\n containerOffset, x, y;\r\n \r\n if(this.container !== document.body){\r\n containerOffset = Helpers.elOffset(this.container);\r\n \r\n offset.left -= containerOffset.left;\r\n offset.top -= containerOffset.top;\r\n }\r\n \r\n switch(position){\r\n case \"right\":\r\n x = offset.left + element.offsetWidth;\r\n y = offset.top - 1;\r\n break;\r\n \r\n case \"bottom\":\r\n x = offset.left;\r\n y = offset.top + element.offsetHeight;\r\n break;\r\n }\r\n \r\n return {x, y, offset};\r\n }\r\n \r\n show(origin, position){\r\n var x, y, parentEl, parentOffset, containerOffset, coords;\r\n \r\n if(origin instanceof HTMLElement){\r\n parentEl = origin;\r\n coords = this.elementPositionCoords(origin, position);\r\n \r\n parentOffset = coords.offset;\r\n x = coords.x;\r\n y = coords.y;\r\n \r\n }else if(typeof origin === \"number\"){\r\n parentOffset = {top:0, left:0};\r\n x = origin;\r\n y = position;\r\n }else{\r\n coords = this.containerEventCoords(origin);\r\n \r\n x = coords.x;\r\n y = coords.y;\r\n \r\n this.reversedX = false;\r\n }\r\n \r\n this.element.style.top = y + \"px\";\r\n this.element.style.left = x + \"px\";\r\n \r\n this.container.appendChild(this.element);\r\n \r\n if(typeof this.renderedCallback === \"function\"){\r\n this.renderedCallback();\r\n }\r\n \r\n this._fitToScreen(x, y, parentEl, parentOffset, position);\r\n \r\n this.visible = true;\r\n \r\n return this;\r\n }\r\n \r\n _fitToScreen(x, y, parentEl, parentOffset, position){\r\n var scrollTop = this.container === document.body ? document.documentElement.scrollTop : this.container.scrollTop;\r\n\r\n //move menu to start on right edge if it is too close to the edge of the screen\r\n if((x + this.element.offsetWidth) >= this.container.offsetWidth || this.reversedX){\r\n this.element.style.left = \"\";\r\n \r\n if(parentEl){\r\n this.element.style.right = (this.container.offsetWidth - parentOffset.left) + \"px\";\r\n }else{\r\n this.element.style.right = (this.container.offsetWidth - x) + \"px\";\r\n }\r\n \r\n this.reversedX = true;\r\n }\r\n\r\n //move menu to start on bottom edge if it is too close to the edge of the screen\r\n if((y + this.element.offsetHeight) > Math.max(this.container.offsetHeight, scrollTop ? this.container.scrollHeight : 0)) {\r\n if(parentEl){\r\n switch(position){\r\n case \"bottom\":\r\n this.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight - parentEl.offsetHeight - 1) + \"px\";\r\n break;\r\n\r\n default:\r\n this.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight + parentEl.offsetHeight + 1) + \"px\";\r\n }\r\n \r\n }else{\r\n this.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight) + \"px\";\r\n }\r\n }\r\n }\r\n \r\n isVisible(){\r\n return this.visible;\r\n }\r\n \r\n hideOnBlur(callback){\r\n this.blurable = true;\r\n \r\n if(this.visible){\r\n setTimeout(() => {\r\n this.table.rowManager.element.addEventListener(\"scroll\", this.blurEvent);\r\n this.subscribe(\"cell-editing\", this.blurEvent);\r\n document.body.addEventListener(\"click\", this.blurEvent);\r\n document.body.addEventListener(\"contextmenu\", this.blurEvent);\r\n window.addEventListener(\"resize\", this.blurEvent);\r\n document.body.addEventListener(\"keydown\", this.escEvent);\r\n }, 100);\r\n \r\n this.blurCallback = callback;\r\n }\r\n \r\n return this;\r\n }\r\n \r\n _escapeCheck(e){\r\n if(e.keyCode == 27){\r\n this.hide();\r\n }\r\n }\r\n \r\n hide(silent = false){\r\n if(this.visible){\r\n if(this.blurable){\r\n document.body.removeEventListener(\"keydown\", this.escEvent);\r\n document.body.removeEventListener(\"click\", this.blurEvent);\r\n document.body.removeEventListener(\"contextmenu\", this.blurEvent);\r\n window.removeEventListener(\"resize\", this.blurEvent);\r\n this.table.rowManager.element.removeEventListener(\"scroll\", this.blurEvent);\r\n this.unsubscribe(\"cell-editing\", this.blurEvent);\r\n }\r\n \r\n if(this.childPopup){\r\n this.childPopup.hide();\r\n }\r\n \r\n if(this.parent){\r\n this.parent.childPopup = null;\r\n }\r\n \r\n if(this.element.parentNode){\r\n this.element.parentNode.removeChild(this.element);\r\n }\r\n\r\n this.visible = false;\r\n\r\n if(this.blurCallback && !silent){\r\n this.blurCallback();\r\n }\r\n }\r\n \r\n return this;\r\n }\r\n \r\n child(element){\r\n if(this.childPopup){\r\n this.childPopup.hide();\r\n }\r\n \r\n this.childPopup = new Popup(this.table, element, this);\r\n \r\n return this.childPopup;\r\n }\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Popup from './tools/Popup.js';\r\n\r\nclass Module extends CoreFeature{\r\n\r\n\tconstructor(table, name){\r\n\t\tsuper(table);\r\n\r\n\t\tthis._handler = null;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\t// setup module when table is initialized, to be overriden in module\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t////// Options Registration ///////\r\n\t///////////////////////////////////\r\n\r\n\tregisterTableOption(key, value){\r\n\t\tthis.table.optionsList.register(key, value);\r\n\t}\r\n\r\n\tregisterColumnOption(key, value){\r\n\t\tthis.table.columnManager.optionsList.register(key, value);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t/// Public Function Registration ///\r\n\t///////////////////////////////////\r\n\r\n\tregisterTableFunction(name, func){\r\n\t\tif(typeof this.table[name] === \"undefined\"){\r\n\t\t\tthis.table[name] = (...args) => {\r\n\t\t\t\tthis.table.initGuard(name);\r\n\r\n\t\t\t\treturn func(...args);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Unable to bind table function, name already in use\", name)\r\n\t\t}\r\n\t}\r\n\r\n\tregisterComponentFunction(component, func, handler){\r\n\t\treturn this.table.componentFunctionBinder.bind(component, func, handler);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t////////// Data Pipeline //////////\r\n\t///////////////////////////////////\r\n\r\n\tregisterDataHandler(handler, priority){\r\n\t\tthis.table.rowManager.registerDataPipelineHandler(handler, priority)\r\n\t\tthis._handler = handler;\r\n\t}\r\n\r\n\tregisterDisplayHandler(handler, priority){\r\n\t\tthis.table.rowManager.registerDisplayPipelineHandler(handler, priority)\r\n\t\tthis._handler = handler;\r\n\t}\r\n\r\n\trefreshData(renderInPosition, handler){\r\n\t\tif(!handler){\r\n\t\t\thandler = this._handler;\r\n\t\t}\r\n\r\n\t\tif(handler){\r\n\t\t\tthis.table.rowManager.refreshActiveData(handler, false, renderInPosition);\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t//////// Footer Management ////////\r\n\t///////////////////////////////////\r\n\r\n\tfooterAppend(element){\r\n\t\treturn this.table.footerManager.append(element)\r\n\t}\r\n\r\n\tfooterPrepend(element){\r\n\t\treturn this.table.footerManager.prepend(element)\r\n\t}\r\n\r\n\tfooterRemove(element){\r\n\t\treturn this.table.footerManager.remove(element)\r\n\t} \r\n\r\n\t///////////////////////////////////\r\n\t//////// Popups Management ////////\r\n\t///////////////////////////////////\r\n\t\r\n\tpopup(menuEl, menuContainer){\r\n\t\treturn new Popup(this.table, menuEl, menuContainer);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t//////// Alert Management ////////\r\n\t///////////////////////////////////\r\n\r\n\talert(content, type){\r\n\t\treturn this.table.alertManager.alert(content, type);\r\n\t}\r\n\r\n\tclearAlert(){\r\n\t\treturn this.table.alertManager.clear();\r\n\t}\r\n\t\r\n}\r\n\r\nexport default Module;","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defautlAccessors from './defaults/accessors.js';\r\n\r\nclass Accessor extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.allowedTypes = [\"\", \"data\", \"download\", \"clipboard\", \"print\", \"htmlOutput\"] //list of accessor types\r\n\r\n\t\tthis.registerColumnOption(\"accessor\");\r\n\t\tthis.registerColumnOption(\"accessorParams\");\r\n\t\tthis.registerColumnOption(\"accessorData\");\r\n\t\tthis.registerColumnOption(\"accessorDataParams\");\r\n\t\tthis.registerColumnOption(\"accessorDownload\");\r\n\t\tthis.registerColumnOption(\"accessorDownloadParams\");\r\n\t\tthis.registerColumnOption(\"accessorClipboard\");\r\n\t\tthis.registerColumnOption(\"accessorClipboardParams\");\r\n\t\tthis.registerColumnOption(\"accessorPrint\");\r\n\t\tthis.registerColumnOption(\"accessorPrintParams\");\r\n\t\tthis.registerColumnOption(\"accessorHtmlOutput\");\r\n\t\tthis.registerColumnOption(\"accessorHtmlOutputParams\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"row-data-retrieve\", this.transformRow.bind(this));\r\n\t}\r\n\r\n\t//initialize column accessor\r\n\tinitializeColumn(column){\r\n\t\tvar match = false,\r\n\t\tconfig = {};\r\n\r\n\t\tthis.allowedTypes.forEach((type) => {\r\n\t\t\tvar key = \"accessor\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\t\taccessor;\r\n\r\n\t\t\tif(column.definition[key]){\r\n\t\t\t\taccessor = this.lookupAccessor(column.definition[key]);\r\n\r\n\t\t\t\tif(accessor){\r\n\t\t\t\t\tmatch = true;\r\n\r\n\t\t\t\t\tconfig[key] = {\r\n\t\t\t\t\t\taccessor:accessor,\r\n\t\t\t\t\t\tparams: column.definition[key + \"Params\"] || {},\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(match){\r\n\t\t\tcolumn.modules.accessor = config;\r\n\t\t}\r\n\t}\r\n\r\n\tlookupAccessor(value){\r\n\t\tvar accessor = false;\r\n\r\n\t\t//set column accessor\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(Accessor.accessors[value]){\r\n\t\t\t\taccessor = Accessor.accessors[value]\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Accessor Error - No such accessor found, ignoring: \", value);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\taccessor = value;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn accessor;\r\n\t}\r\n\r\n\t//apply accessor to row\r\n\ttransformRow(row, type){\r\n\t\tvar key = \"accessor\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\trowComponent = row.getComponent();\r\n\r\n\t\t//clone data object with deep copy to isolate internal data from returned result\r\n\t\tvar data = Helpers.deepClone(row.data || {});\r\n\r\n\t\tthis.table.columnManager.traverse(function(column){\r\n\t\t\tvar value, accessor, params, colCompnent;\r\n\r\n\t\t\tif(column.modules.accessor){\r\n\r\n\t\t\t\taccessor = column.modules.accessor[key] || column.modules.accessor.accessor || false;\r\n\r\n\t\t\t\tif(accessor){\r\n\t\t\t\t\tvalue = column.getFieldValue(data);\r\n\r\n\t\t\t\t\tif(value != \"undefined\"){\r\n\t\t\t\t\t\tcolCompnent = column.getComponent();\r\n\t\t\t\t\t\tparams = typeof accessor.params === \"function\" ? accessor.params(value, data, type, colCompnent, rowComponent) : accessor.params;\r\n\t\t\t\t\t\tcolumn.setFieldValue(data, accessor.accessor(value, data, type, params, colCompnent, rowComponent));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n}\r\n\r\n//load defaults\r\nAccessor.moduleName = \"accessor\";\r\nAccessor.accessors = defautlAccessors;\r\n\r\nexport default Accessor;","export default {}","function generateParamsList(data, prefix){\r\n\tvar output = [];\r\n\r\n\tprefix = prefix || \"\";\r\n\r\n\tif(Array.isArray(data)){\r\n\t\tdata.forEach((item, i) => {\r\n\t\t\toutput = output.concat(generateParamsList(item, prefix ? prefix + \"[\" + i + \"]\" : i));\r\n\t\t});\r\n\t}else if (typeof data === \"object\"){\r\n\t\tfor (var key in data){\r\n\t\t\toutput = output.concat(generateParamsList(data[key], prefix ? prefix + \"[\" + key + \"]\" : key));\r\n\t\t}\r\n\t}else{\r\n\t\toutput.push({key:prefix, value:data});\r\n\t}\r\n\r\n\treturn output;\r\n}\r\n\r\nfunction serializeParams(params){\r\n\tvar output = generateParamsList(params),\r\n\tencoded = [];\r\n\r\n\toutput.forEach(function(item){\r\n\t\tencoded.push(encodeURIComponent(item.key) + \"=\" + encodeURIComponent(item.value));\r\n\t});\r\n\r\n\treturn encoded.join(\"&\");\r\n}\r\n\r\nexport default function(url, config, params){\r\n\tif(url){\r\n\t\tif(params && Object.keys(params).length){\r\n\t\t\tif(!config.method || config.method.toLowerCase() == \"get\"){\r\n\t\t\t\tconfig.method = \"get\";\r\n\r\n\t\t\t\turl += (url.includes(\"?\") ? \"&\" : \"?\") + serializeParams(params);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn url;\r\n};","function generateParamsList(data, prefix){\r\n\tvar output = [];\r\n\r\n\tprefix = prefix || \"\";\r\n\r\n\tif(Array.isArray(data)){\r\n\t\tdata.forEach((item, i) => {\r\n\t\t\toutput = output.concat(generateParamsList(item, prefix ? prefix + \"[\" + i + \"]\" : i));\r\n\t\t});\r\n\t}else if (typeof data === \"object\"){\r\n\t\tfor (var key in data){\r\n\t\t\toutput = output.concat(generateParamsList(data[key], prefix ? prefix + \"[\" + key + \"]\" : key));\r\n\t\t}\r\n\t}else{\r\n\t\toutput.push({key:prefix, value:data});\r\n\t}\r\n\r\n\treturn output;\r\n}\r\n\r\nexport default {\r\n\t\"json\":{\r\n\t\theaders:{\r\n\t\t\t'Content-Type': 'application/json',\r\n\t\t},\r\n\t\tbody:function(url, config, params){\r\n\t\t\treturn JSON.stringify(params);\r\n\t\t},\r\n\t},\r\n\t\"form\":{\r\n\t\theaders:{\r\n\t\t},\r\n\t\tbody:function(url, config, params){\r\n\r\n\t\t\tvar output = generateParamsList(params),\r\n\t\t\tform = new FormData();\r\n\r\n\t\t\toutput.forEach(function(item){\r\n\t\t\t\tform.append(item.key, item.value);\r\n\t\t\t});\r\n\r\n\t\t\treturn form;\r\n\t\t},\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultConfig from './defaults/config.js';\r\nimport defaultURLGenerator from './defaults/urlGenerator.js';\r\nimport defaultLoaderPromise from './defaults/loaderPromise.js';\r\nimport defaultContentTypeFormatters from './defaults/contentTypeFormatters.js';\r\n\r\nclass Ajax extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.config = {}; //hold config object for ajax request\r\n\t\tthis.url = \"\"; //request URL\r\n\t\tthis.urlGenerator = false;\r\n\t\tthis.params = false; //request parameters\r\n\t\t\r\n\t\tthis.loaderPromise = false;\r\n\t\t\r\n\t\tthis.registerTableOption(\"ajaxURL\", false); //url for ajax loading\r\n\t\tthis.registerTableOption(\"ajaxURLGenerator\", false);\r\n\t\tthis.registerTableOption(\"ajaxParams\", {}); //params for ajax loading\r\n\t\tthis.registerTableOption(\"ajaxConfig\", \"get\"); //ajax request type\r\n\t\tthis.registerTableOption(\"ajaxContentType\", \"form\"); //ajax request type\r\n\t\tthis.registerTableOption(\"ajaxRequestFunc\", false); //promise function\r\n\t\t\r\n\t\tthis.registerTableOption(\"ajaxRequesting\", function(){});\r\n\t\tthis.registerTableOption(\"ajaxResponse\", false);\r\n\t\t\r\n\t\tthis.contentTypeFormatters = Ajax.contentTypeFormatters;\r\n\t}\r\n\t\r\n\t//initialize setup options\r\n\tinitialize(){\r\n\t\tthis.loaderPromise = this.table.options.ajaxRequestFunc || Ajax.defaultLoaderPromise;\r\n\t\tthis.urlGenerator = this.table.options.ajaxURLGenerator || Ajax.defaultURLGenerator;\r\n\t\t\r\n\t\tif(this.table.options.ajaxURL){\r\n\t\t\tthis.setUrl(this.table.options.ajaxURL);\r\n\t\t}\r\n\r\n\r\n\t\tthis.setDefaultConfig(this.table.options.ajaxConfig);\r\n\t\t\r\n\t\tthis.registerTableFunction(\"getAjaxUrl\", this.getUrl.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"data-loading\", this.requestDataCheck.bind(this));\r\n\t\tthis.subscribe(\"data-params\", this.requestParams.bind(this));\r\n\t\tthis.subscribe(\"data-load\", this.requestData.bind(this));\r\n\t}\r\n\t\r\n\trequestParams(data, config, silent, params){\r\n\t\tvar ajaxParams = this.table.options.ajaxParams;\r\n\t\t\r\n\t\tif(ajaxParams){\r\n\t\t\tif(typeof ajaxParams === \"function\"){\r\n\t\t\t\tajaxParams = ajaxParams.call(this.table);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tparams = Object.assign(params, ajaxParams);\r\n\t\t}\t\t\r\n\t\t\r\n\t\treturn params;\r\n\t}\r\n\t\r\n\trequestDataCheck(data, params, config, silent){\r\n\t\treturn !!((!data && this.url) || typeof data === \"string\");\r\n\t}\r\n\t\r\n\trequestData(url, params, config, silent, previousData){\r\n\t\tvar ajaxConfig;\r\n\t\t\r\n\t\tif(!previousData && this.requestDataCheck(url)){\r\n\t\t\tif(url){\r\n\t\t\t\tthis.setUrl(url);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tajaxConfig = this.generateConfig(config);\r\n\t\t\t\r\n\t\t\treturn this.sendRequest(this.url, params, ajaxConfig);\r\n\t\t}else{\r\n\t\t\treturn previousData;\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetDefaultConfig(config = {}){\r\n\t\tthis.config = Object.assign({}, Ajax.defaultConfig);\r\n\r\n\t\tif(typeof config == \"string\"){\r\n\t\t\tthis.config.method = config;\r\n\t\t}else{\r\n\t\t\tObject.assign(this.config, config);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//load config object\r\n\tgenerateConfig(config = {}){\r\n\t\tvar ajaxConfig = Object.assign({}, this.config)\r\n\t\t\r\n\t\tif(typeof config == \"string\"){\r\n\t\t\tajaxConfig.method = config;\r\n\t\t}else{\r\n\t\t\tObject.assign(ajaxConfig, config);\r\n\t\t}\r\n\t\t\r\n\t\treturn ajaxConfig;\r\n\t}\r\n\t\r\n\t//set request url\r\n\tsetUrl(url){\r\n\t\tthis.url = url;\r\n\t}\r\n\t\r\n\t//get request url\r\n\tgetUrl(){\r\n\t\treturn this.url;\r\n\t}\r\n\t\r\n\t//send ajax request\r\n\tsendRequest(url, params, config){\r\n\t\tif(this.table.options.ajaxRequesting.call(this.table, url, params) !== false){\r\n\t\t\treturn this.loaderPromise(url, config, params)\r\n\t\t\t.then((data)=>{\r\n\t\t\t\tif(this.table.options.ajaxResponse){\r\n\t\t\t\t\tdata = this.table.options.ajaxResponse.call(this.table, url, params, data);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn data;\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n}\r\n\r\nAjax.moduleName = \"ajax\";\r\n\r\n//load defaults\r\nAjax.defaultConfig = defaultConfig;\r\nAjax.defaultURLGenerator = defaultURLGenerator;\r\nAjax.defaultLoaderPromise = defaultLoaderPromise;\r\nAjax.contentTypeFormatters = defaultContentTypeFormatters;\r\n\r\nexport default Ajax;","export default {\r\n\tmethod: \"GET\",\r\n};","export default function(url, config, params){\r\n\tvar contentType;\r\n\r\n\treturn new Promise((resolve, reject) => {\r\n\t\t//set url\r\n\t\turl = this.urlGenerator.call(this.table, url, config, params);\r\n\r\n\t\t//set body content if not GET request\r\n\t\tif(config.method.toUpperCase() != \"GET\"){\r\n\t\t\tcontentType = typeof this.table.options.ajaxContentType === \"object\" ? this.table.options.ajaxContentType : this.contentTypeFormatters[this.table.options.ajaxContentType];\r\n\t\t\tif(contentType){\r\n\r\n\t\t\t\tfor(var key in contentType.headers){\r\n\t\t\t\t\tif(!config.headers){\r\n\t\t\t\t\t\tconfig.headers = {};\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(typeof config.headers[key] === \"undefined\"){\r\n\t\t\t\t\t\tconfig.headers[key] = contentType.headers[key];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconfig.body = contentType.body.call(this, url, config, params);\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Ajax Error - Invalid ajaxContentType value:\", this.table.options.ajaxContentType);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(url){\r\n\t\t\t//configure headers\r\n\t\t\tif(typeof config.headers === \"undefined\"){\r\n\t\t\t\tconfig.headers = {};\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.headers.Accept === \"undefined\"){\r\n\t\t\t\tconfig.headers.Accept = \"application/json\";\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.headers[\"X-Requested-With\"] === \"undefined\"){\r\n\t\t\t\tconfig.headers[\"X-Requested-With\"] = \"XMLHttpRequest\";\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.mode === \"undefined\"){\r\n\t\t\t\tconfig.mode = \"cors\";\r\n\t\t\t}\r\n\r\n\t\t\tif(config.mode == \"cors\"){\r\n\t\t\t\tif(typeof config.headers[\"Origin\"] === \"undefined\"){\r\n\t\t\t\t\tconfig.headers[\"Origin\"] = window.location.origin;\r\n\t\t\t\t}\r\n \r\n\t\t\t\tif(typeof config.credentials === \"undefined\"){\r\n\t\t\t\t\tconfig.credentials = 'same-origin';\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(typeof config.credentials === \"undefined\"){\r\n\t\t\t\t\tconfig.credentials = 'include';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//send request\r\n\t\t\tfetch(url, config)\r\n\t\t\t.then((response)=>{\r\n\t\t\t\tif(response.ok) {\r\n\t\t\t\t\tresponse.json()\r\n\t\t\t\t\t.then((data)=>{\r\n\t\t\t\t\t\tresolve(data);\r\n\t\t\t\t\t}).catch((error)=>{\r\n\t\t\t\t\t\treject(error);\r\n\t\t\t\t\t\tconsole.warn(\"Ajax Load Error - Invalid JSON returned\", error);\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.error(\"Ajax Load Error - Connection Error: \" + response.status, response.statusText);\r\n\t\t\t\t\treject(response);\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.catch((error)=>{\r\n\t\t\t\tconsole.error(\"Ajax Load Error - Connection Error: \", error);\r\n\t\t\t\treject(error);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Ajax Load Error - No URL Set\");\r\n\t\t\tresolve([]);\r\n\t\t}\r\n\t});\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultPasteActions from './defaults/pasteActions.js';\r\nimport defaultPasteParsers from './defaults/pasteParsers.js';\r\n\r\nclass Clipboard extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.mode = true;\r\n\t\tthis.pasteParser = function(){};\r\n\t\tthis.pasteAction = function(){};\r\n\t\tthis.customSelection = false;\r\n\t\tthis.rowRange = false;\r\n\t\tthis.blocked = true; //block copy actions not originating from this command\r\n\r\n\t\tthis.registerTableOption(\"clipboard\", false); //enable clipboard\r\n\t\tthis.registerTableOption(\"clipboardCopyStyled\", true); //formatted table data\r\n\t\tthis.registerTableOption(\"clipboardCopyConfig\", false); //clipboard config\r\n\t\tthis.registerTableOption(\"clipboardCopyFormatter\", false); //DEPRICATED - REMOVE in 5.0\r\n\t\tthis.registerTableOption(\"clipboardCopyRowRange\", \"active\"); //restrict clipboard to visible rows only\r\n\t\tthis.registerTableOption(\"clipboardPasteParser\", \"table\"); //convert pasted clipboard data to rows\r\n\t\tthis.registerTableOption(\"clipboardPasteAction\", \"insert\"); //how to insert pasted data into the table\r\n\r\n\t\tthis.registerColumnOption(\"clipboard\");\r\n\t\tthis.registerColumnOption(\"titleClipboard\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.mode = this.table.options.clipboard;\r\n\r\n\t\tthis.rowRange = this.table.options.clipboardCopyRowRange;\r\n\r\n\t\tif(this.mode === true || this.mode === \"copy\"){\r\n\t\t\tthis.table.element.addEventListener(\"copy\", (e) => {\r\n\t\t\t\tvar plain, html, list;\r\n\r\n\t\t\t\tif(!this.blocked){\r\n\t\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\t\tif(this.customSelection){\r\n\t\t\t\t\t\tplain = this.customSelection;\r\n\r\n\t\t\t\t\t\tif(this.table.options.clipboardCopyFormatter){\r\n\t\t\t\t\t\t\tplain = this.table.options.clipboardCopyFormatter(\"plain\", plain);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\r\n\t\t\t\t\t\tvar list = this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig, this.table.options.clipboardCopyStyled, this.rowRange, \"clipboard\");\r\n\r\n\t\t\t\t\t\thtml = this.table.modules.export.genereateHTMLTable(list);\r\n\t\t\t\t\t\tplain = html ? this.generatePlainContent(list) : \"\";\r\n\r\n\t\t\t\t\t\tif(this.table.options.clipboardCopyFormatter){\r\n\t\t\t\t\t\t\tplain = this.table.options.clipboardCopyFormatter(\"plain\", plain);\r\n\t\t\t\t\t\t\thtml = this.table.options.clipboardCopyFormatter(\"html\", html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (window.clipboardData && window.clipboardData.setData) {\r\n\t\t\t\t\t\twindow.clipboardData.setData('Text', plain);\r\n\t\t\t\t\t} else if (e.clipboardData && e.clipboardData.setData) {\r\n\t\t\t\t\t\te.clipboardData.setData('text/plain', plain);\r\n\t\t\t\t\t\tif(html){\r\n\t\t\t\t\t\t\te.clipboardData.setData('text/html', html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (e.originalEvent && e.originalEvent.clipboardData.setData) {\r\n\t\t\t\t\t\te.originalEvent.clipboardData.setData('text/plain', plain);\r\n\t\t\t\t\t\tif(html){\r\n\t\t\t\t\t\t\te.originalEvent.clipboardData.setData('text/html', html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.dispatchExternal(\"clipboardCopied\", plain, html);\r\n\r\n\t\t\t\t\tthis.reset();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.mode === true || this.mode === \"paste\"){\r\n\t\t\tthis.table.element.addEventListener(\"paste\", (e) => {\r\n\t\t\t\tthis.paste(e);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.setPasteParser(this.table.options.clipboardPasteParser);\r\n\t\tthis.setPasteAction(this.table.options.clipboardPasteAction);\r\n\r\n\t\tthis.registerTableFunction(\"copyToClipboard\", this.copy.bind(this));\r\n\t}\r\n\r\n\treset(){\r\n\t\tthis.blocked = true;\r\n\t\tthis.customSelection = false;\r\n\t}\r\n\r\n\tgeneratePlainContent (list) {\r\n\t\tvar output = [];\r\n\r\n\t\tlist.forEach((row) => {\r\n\t\t\tvar rowData = [];\r\n\r\n\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\tvar value = \"\";\r\n\r\n\t\t\t\tif(col){\r\n\r\n\t\t\t\t\tif(row.type === \"group\"){\r\n\t\t\t\t\t\tcol.value = col.component.getKey();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(col.value === null){\r\n\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\t\tvalue = JSON.stringify(col.value);\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tvalue = col.value;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowData.push(value);\r\n\t\t\t});\r\n\r\n\t\t\toutput.push(rowData.join(\"\\t\"));\r\n\t\t});\r\n\r\n\t\treturn output.join(\"\\n\");\r\n\t}\r\n\r\n\tcopy (range, internal) {\r\n\t\tvar range, sel, textRange;\r\n\t\tthis.blocked = false;\r\n\t\tthis.customSelection = false;\r\n\r\n\t\tif (this.mode === true || this.mode === \"copy\") {\r\n\r\n\t\t\tthis.rowRange = range || this.table.options.clipboardCopyRowRange;\r\n\r\n\t\t\tif (typeof window.getSelection != \"undefined\" && typeof document.createRange != \"undefined\") {\r\n\t\t\t\trange = document.createRange();\r\n\t\t\t\trange.selectNodeContents(this.table.element);\r\n\t\t\t\tsel = window.getSelection();\r\n\r\n\t\t\t\tif (sel.toString() && internal) {\r\n\t\t\t\t\tthis.customSelection = sel.toString();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tsel.removeAllRanges();\r\n\t\t\t\tsel.addRange(range);\r\n\t\t\t} else if (typeof document.selection != \"undefined\" && typeof document.body.createTextRange != \"undefined\") {\r\n\t\t\t\ttextRange = document.body.createTextRange();\r\n\t\t\t\ttextRange.moveToElementText(this.table.element);\r\n\t\t\t\ttextRange.select();\r\n\t\t\t}\r\n\r\n\t\t\tdocument.execCommand('copy');\r\n\r\n\t\t\tif (sel) {\r\n\t\t\t\tsel.removeAllRanges();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//PASTE EVENT HANDLING\r\n\tsetPasteAction(action){\r\n\r\n\t\tswitch(typeof action){\r\n\t\t\tcase \"string\":\r\n\t\t\tthis.pasteAction = Clipboard.pasteActions[action];\r\n\r\n\t\t\tif(!this.pasteAction){\r\n\t\t\t\tconsole.warn(\"Clipboard Error - No such paste action found:\", action);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tthis.pasteAction = action;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tsetPasteParser(parser){\r\n\t\tswitch(typeof parser){\r\n\t\t\tcase \"string\":\r\n\t\t\tthis.pasteParser = Clipboard.pasteParsers[parser];\r\n\r\n\t\t\tif(!this.pasteParser){\r\n\t\t\t\tconsole.warn(\"Clipboard Error - No such paste parser found:\", parser);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tthis.pasteParser = parser;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tpaste(e){\r\n\t\tvar data, rowData, rows;\r\n\r\n\t\tif(this.checkPaseOrigin(e)){\r\n\r\n\t\t\tdata = this.getPasteData(e);\r\n\r\n\t\t\trowData = this.pasteParser.call(this, data);\r\n\r\n\t\t\tif(rowData){\r\n\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\t\t\trowData = this.mutateData(rowData);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trows = this.pasteAction.call(this, rowData);\r\n\r\n\t\t\t\tthis.dispatchExternal(\"clipboardPasted\", data, rowData, rows);\r\n\t\t\t}else{\r\n\t\t\t\tthis.dispatchExternal(\"clipboardPasteError\", data);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmutateData(data){\r\n\t\tvar output = [];\r\n\r\n\t\tif(Array.isArray(data)){\r\n\t\t\tdata.forEach((row) => {\r\n\t\t\t\toutput.push(this.table.modules.mutator.transformRow(row, \"clipboard\"));\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\toutput = data;\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\r\n\tcheckPaseOrigin(e){\r\n\t\tvar valid = true;\r\n\r\n\t\tif(e.target.tagName != \"DIV\" || this.table.modules.edit.currentCell){\r\n\t\t\tvalid = false;\r\n\t\t}\r\n\r\n\t\treturn valid;\r\n\t}\r\n\r\n\tgetPasteData(e){\r\n\t\tvar data;\r\n\r\n\t\tif (window.clipboardData && window.clipboardData.getData) {\r\n\t\t\tdata = window.clipboardData.getData('Text');\r\n\t\t} else if (e.clipboardData && e.clipboardData.getData) {\r\n\t\t\tdata = e.clipboardData.getData('text/plain');\r\n\t\t} else if (e.originalEvent && e.originalEvent.clipboardData.getData) {\r\n\t\t\tdata = e.originalEvent.clipboardData.getData('text/plain');\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n}\r\n\r\nClipboard.moduleName = \"clipboard\";\r\n\r\n//load defaults\r\nClipboard.pasteActions = defaultPasteActions;\r\nClipboard.pasteParsers = defaultPasteParsers;\r\n\r\nexport default Clipboard;","export default {\r\n\treplace:function(rows){\r\n\t\treturn this.table.setData(rows);\r\n\t},\r\n\tupdate:function(rows){\r\n\t\treturn this.table.updateOrAddData(rows);\r\n\t},\r\n\tinsert:function(rows){\r\n\t\treturn this.table.addData(rows);\r\n\t},\r\n};","export default {\r\n\ttable:function(clipboard){\r\n\t\tvar data = [],\r\n\t\tsuccess = false,\r\n\t\theaderFindSuccess = true,\r\n\t\tcolumns = this.table.columnManager.columns,\r\n\t\tcolumnMap = [],\r\n\t\trows = [];\r\n\r\n\t\t//get data from clipboard into array of columns and rows.\r\n\t\tclipboard = clipboard.split(\"\\n\");\r\n\r\n\t\tclipboard.forEach(function(row){\r\n\t\t\tdata.push(row.split(\"\\t\"));\r\n\t\t});\r\n\r\n\t\tif(data.length && !(data.length === 1 && data[0].length < 2)){\r\n\t\t\tsuccess = true;\r\n\r\n\t\t\t//check if headers are present by title\r\n\t\t\tdata[0].forEach(function(value){\r\n\t\t\t\tvar column = columns.find(function(column){\r\n\t\t\t\t\treturn value && column.definition.title && value.trim() && column.definition.title.trim() === value.trim();\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tcolumnMap.push(column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\theaderFindSuccess = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t//check if column headers are present by field\r\n\t\t\tif(!headerFindSuccess){\r\n\t\t\t\theaderFindSuccess = true;\r\n\t\t\t\tcolumnMap = [];\r\n\r\n\t\t\t\tdata[0].forEach(function(value){\r\n\t\t\t\t\tvar column = columns.find(function(column){\r\n\t\t\t\t\t\treturn value && column.field && value.trim() && column.field.trim() === value.trim();\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(column){\r\n\t\t\t\t\t\tcolumnMap.push(column);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\theaderFindSuccess = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(!headerFindSuccess){\r\n\t\t\t\t\tcolumnMap = this.table.columnManager.columnsByIndex;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//remove header row if found\r\n\t\t\tif(headerFindSuccess){\r\n\t\t\t\tdata.shift();\r\n\t\t\t}\r\n\r\n\t\t\tdata.forEach(function(item){\r\n\t\t\t\tvar row = {};\r\n\r\n\t\t\t\titem.forEach(function(value, i){\r\n\t\t\t\t\tif(columnMap[i]){\r\n\t\t\t\t\t\trow[columnMap[i].field] = value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\trows.push(row);\r\n\t\t\t});\r\n\r\n\t\t\treturn rows;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n};","class CalcComponent{\r\n\tconstructor (row){\r\n\t\tthis._row = row;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._row.table.componentFunctionBinder.handle(\"row\", target._row, name)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\tgetData(transform){\r\n\t\treturn this._row.getData(transform);\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._row.getElement();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._row.table;\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._row.getCells().forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tgetCell(column){\r\n\t\tvar cell = this._row.getCell(column);\r\n\t\treturn cell ? cell.getComponent() : false;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._row;\r\n\t}\r\n}\r\n\r\nexport default CalcComponent;","//public cell object\r\nexport default class CellComponent {\r\n\r\n\tconstructor (cell){\r\n\t\tthis._cell = cell;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._cell.table.componentFunctionBinder.handle(\"cell\", target._cell, name)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\tgetValue(){\r\n\t\treturn this._cell.getValue();\r\n\t}\r\n\r\n\tgetOldValue(){\r\n\t\treturn this._cell.getOldValue();\r\n\t}\r\n\r\n\tgetInitialValue(){\r\n\t\treturn this._cell.initialValue;\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._cell.getElement();\r\n\t}\r\n\r\n\tgetRow(){\r\n\t\treturn this._cell.row.getComponent();\r\n\t}\r\n\r\n\tgetData(){\r\n\t\treturn this._cell.row.getData();\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._cell.column.getField();\r\n\t}\r\n\r\n\tgetColumn(){\r\n\t\treturn this._cell.column.getComponent();\r\n\t}\r\n\r\n\tsetValue(value, mutate){\r\n\t\tif(typeof mutate == \"undefined\"){\r\n\t\t\tmutate = true;\r\n\t\t}\r\n\r\n\t\tthis._cell.setValue(value, mutate);\r\n\t}\r\n\r\n\trestoreOldValue(){\r\n\t\tthis._cell.setValueActual(this._cell.getOldValue());\r\n\t}\r\n\r\n\trestoreInitialValue(){\r\n\t\tthis._cell.setValueActual(this._cell.initialValue);\r\n\t}\r\n\r\n\tcheckHeight(){\r\n\t\tthis._cell.checkHeight();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._cell.table;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._cell;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport CellComponent from './CellComponent.js';\r\n\r\nexport default class Cell extends CoreFeature{\r\n\tconstructor(column, row){\r\n\t\tsuper(column.table);\r\n\r\n\t\tthis.table = column.table;\r\n\t\tthis.column = column;\r\n\t\tthis.row = row;\r\n\t\tthis.element = null;\r\n\t\tthis.value = null;\r\n\t\tthis.initialValue;\r\n\t\tthis.oldValue = null;\r\n\t\tthis.modules = {};\r\n\r\n\t\tthis.height = null;\r\n\t\tthis.width = null;\r\n\t\tthis.minWidth = null;\r\n\r\n\t\tthis.component = null;\r\n\r\n\t\tthis.loaded = false; //track if the cell has been added to the DOM yet\r\n\r\n\t\tthis.build();\r\n\t}\r\n\r\n\t//////////////// Setup Functions /////////////////\r\n\t//generate element\r\n\tbuild(){\r\n\t\tthis.generateElement();\r\n\r\n\t\tthis.setWidth();\r\n\r\n\t\tthis._configureCell();\r\n\r\n\t\tthis.setValueActual(this.column.getFieldValue(this.row.data));\r\n\r\n\t\tthis.initialValue = this.value;\r\n\t}\r\n\r\n\tgenerateElement(){\r\n\t\tthis.element = document.createElement('div');\r\n\t\tthis.element.className = \"tabulator-cell\";\r\n\t\tthis.element.setAttribute(\"role\", \"gridcell\");\r\n\t\tthis.element = this.element;\r\n\t}\r\n\r\n\t_configureCell(){\r\n\t\tvar element = this.element,\r\n\t\tfield = this.column.getField(),\r\n\t\tvertAligns = {\r\n\t\t\ttop:\"flex-start\",\r\n\t\t\tbottom:\"flex-end\",\r\n\t\t\tmiddle:\"center\",\r\n\t\t},\r\n\t\thozAligns = {\r\n\t\t\tleft:\"flex-start\",\r\n\t\t\tright:\"flex-end\",\r\n\t\t\tcenter:\"center\",\r\n\t\t};\r\n\r\n\t\t//set text alignment\r\n\t\telement.style.textAlign = this.column.hozAlign;\r\n\r\n\t\tif(this.column.vertAlign){\r\n\t\t\telement.style.display = \"inline-flex\";\r\n\r\n\t\t\telement.style.alignItems = vertAligns[this.column.vertAlign] || \"\";\r\n\r\n\t\t\tif(this.column.hozAlign){\r\n\t\t\t\telement.style.justifyContent = hozAligns[this.column.hozAlign] || \"\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(field){\r\n\t\t\telement.setAttribute(\"tabulator-field\", field);\r\n\t\t}\r\n\r\n\t\t//add class to cell if needed\r\n\t\tif(this.column.definition.cssClass){\r\n\t\t\tvar classNames = this.column.definition.cssClass.split(\" \")\r\n\t\t\tclassNames.forEach((className) => {\r\n\t\t\t\telement.classList.add(className)\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"cell-init\", this);\r\n\r\n\t\t//hide cell if not visible\r\n\t\tif(!this.column.visible){\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\t//generate cell contents\r\n\t_generateContents(){\r\n\t\tvar val;\r\n\r\n\t\tval = this.chain(\"cell-format\", this, null, () => {\r\n\t\t\treturn this.element.innerHTML = this.value;\r\n\t\t});\r\n\r\n\t\tswitch(typeof val){\r\n\t\t\tcase \"object\":\r\n\t\t\tif(val instanceof Node){\r\n\r\n\t\t\t\t//clear previous cell contents\r\n\t\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\r\n\t\t\t\tthis.element.appendChild(val);\r\n\t\t\t}else{\r\n\t\t\t\tthis.element.innerHTML = \"\";\r\n\r\n\t\t\t\tif(val != null){\r\n\t\t\t\t\tconsole.warn(\"Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:\", val);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\tcase \"undefined\":\r\n\t\t\tcase \"null\":\r\n\t\t\tthis.element.innerHTML = \"\";\r\n\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\tthis.element.innerHTML = val;\r\n\t\t}\r\n\t}\r\n\r\n\tcellRendered(){\r\n\t\tthis.dispatch(\"cell-rendered\", this);\r\n\t}\r\n\r\n\t//////////////////// Getters ////////////////////\r\n\tgetElement(containerOnly){\r\n\t\tif(!this.loaded){\r\n\t\t\tthis.loaded = true;\r\n\t\t\tif(!containerOnly){\r\n\t\t\t\tthis.layoutElement();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\tgetValue(){\r\n\t\treturn this.value;\r\n\t}\r\n\r\n\tgetOldValue(){\r\n\t\treturn this.oldValue;\r\n\t}\r\n\r\n\t//////////////////// Actions ////////////////////\r\n\tsetValue(value, mutate, force){\r\n\t\tvar changed = this.setValueProcessData(value, mutate, force);\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.dispatch(\"cell-value-updated\", this);\r\n\r\n\t\t\tthis.cellRendered();\r\n\r\n\t\t\tif(this.column.definition.cellEdited){\r\n\t\t\t\tthis.column.definition.cellEdited.call(this.table, this.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"cellEdited\", this.getComponent());\r\n\r\n\t\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tsetValueProcessData(value, mutate, force){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(this.value !== value || force){\r\n\r\n\t\t\tchanged = true;\r\n\r\n\t\t\tif(mutate){\r\n\t\t\t\tvalue = this.chain(\"cell-value-changing\", [this, value], null, value);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.setValueActual(value);\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.dispatch(\"cell-value-changed\", this);\r\n\t\t}\r\n\r\n\t\treturn changed;\r\n\t}\r\n\r\n\tsetValueActual(value){\r\n\t\tthis.oldValue = this.value;\r\n\r\n\t\tthis.value = value;\r\n\r\n\t\tthis.dispatch(\"cell-value-save-before\", this);\r\n\r\n\t\tthis.column.setFieldValue(this.row.data, value);\r\n\r\n\t\tthis.dispatch(\"cell-value-save-after\", this);\r\n\r\n\t\tif(this.loaded){\r\n\t\t\tthis.layoutElement();\r\n\t\t}\r\n\t}\r\n\r\n\tlayoutElement(){\r\n\t\tthis._generateContents();\r\n\r\n\t\tthis.dispatch(\"cell-layout\", this);\r\n\t}\r\n\r\n\tsetWidth(){\r\n\t\tthis.width = this.column.width;\r\n\t\tthis.element.style.width = this.column.widthStyled;\r\n\t}\r\n\r\n\tclearWidth(){\r\n\t\tthis.width = \"\";\r\n\t\tthis.element.style.width = \"\";\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\treturn this.width || this.element.offsetWidth;\r\n\t}\r\n\r\n\tsetMinWidth(){\r\n\t\tthis.minWidth = this.column.minWidth;\r\n\t\tthis.element.style.minWidth = this.column.minWidthStyled;\r\n\t}\r\n\r\n\tsetMaxWidth(){\r\n\t\tthis.maxWidth = this.column.maxWidth;\r\n\t\tthis.element.style.maxWidth = this.column.maxWidthStyled;\r\n\t}\r\n\r\n\tcheckHeight(){\r\n\t\t// var height = this.element.css(\"height\");\r\n\t\tthis.row.reinitializeHeight();\r\n\t}\r\n\r\n\tclearHeight(){\r\n\t\tthis.element.style.height = \"\";\r\n\t\tthis.height = null;\r\n\r\n\t\tthis.dispatch(\"cell-height\", this, \"\");\r\n\t}\r\n\r\n\tsetHeight(){\r\n\t\tthis.height = this.row.height;\r\n\t\tthis.element.style.height = this.row.heightStyled;\r\n\r\n\t\tthis.dispatch(\"cell-height\", this, this.row.heightStyled);\r\n\t}\r\n\r\n\tgetHeight(){\r\n\t\treturn this.height || this.element.offsetHeight;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tthis.element.style.display = this.column.vertAlign ? \"inline-flex\" : \"\";\r\n\t}\r\n\r\n\thide(){\r\n\t\tthis.element.style.display = \"none\";\r\n\t}\r\n\r\n\tdelete(){\r\n\t\tthis.dispatch(\"cell-delete\", this);\r\n\r\n\t\tif(!this.table.rowManager.redrawBlock && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\r\n\t\tthis.element = false;\r\n\t\tthis.column.deleteCell(this);\r\n\t\tthis.row.deleteCell(this);\r\n\t\tthis.calcs = {};\r\n\t}\r\n\r\n\tgetIndex(){\r\n\t\treturn this.row.getCellIndex(this);\r\n\t}\r\n\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new CellComponent(this);\r\n\t\t}\r\n\r\n\t\treturn this.component;\r\n\t}\r\n}","import Column from './Column.js';\r\n\r\n//public column object\r\nexport default class ColumnComponent {\r\n\tconstructor (column){\r\n\t\tthis._column = column;\r\n\t\tthis.type = \"ColumnComponent\";\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._column.table.componentFunctionBinder.handle(\"column\", target._column, name)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._column.getElement();\r\n\t}\r\n\r\n\tgetDefinition(){\r\n\t\treturn this._column.getDefinition();\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._column.getField();\r\n\t}\r\n\r\n\tgetTitleDownload() {\r\n\t\treturn this._column.getTitleDownload();\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._column.cells.forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tisVisible(){\r\n\t\treturn this._column.visible;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tif(this._column.isGroup){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\tcolumn.show();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis._column.show();\r\n\t\t}\r\n\t}\r\n\r\n\thide(){\r\n\t\tif(this._column.isGroup){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\tcolumn.hide();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis._column.hide();\r\n\t\t}\r\n\t}\r\n\r\n\ttoggle(){\r\n\t\tif(this._column.visible){\r\n\t\t\tthis.hide();\r\n\t\t}else{\r\n\t\t\tthis.show();\r\n\t\t}\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn this._column.delete();\r\n\t}\r\n\r\n\tgetSubColumns(){\r\n\t\tvar output = [];\r\n\r\n\t\tif(this._column.columns.length){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\toutput.push(column.getComponent());\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetParentColumn(){\r\n\t\treturn this._column.parent instanceof Column ? this._column.parent.getComponent() : false;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._column;\r\n\t}\r\n\r\n\tscrollTo(){\r\n\t\treturn this._column.table.columnManager.scrollToColumn(this._column);\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._column.table;\r\n\t}\r\n\r\n\tmove(to, after){\r\n\t\tvar toColumn = this._column.table.columnManager.findColumn(to);\r\n\r\n\t\tif(toColumn){\r\n\t\t\tthis._column.table.columnManager.moveColumn(this._column, toColumn, after)\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching column found:\", toColumn);\r\n\t\t}\r\n\t}\r\n\r\n\tgetNextColumn(){\r\n\t\tvar nextCol = this._column.nextColumn();\r\n\r\n\t\treturn nextCol ? nextCol.getComponent() : false;\r\n\t}\r\n\r\n\tgetPrevColumn(){\r\n\t\tvar prevCol = this._column.prevColumn();\r\n\r\n\t\treturn prevCol ? prevCol.getComponent() : false;\r\n\t}\r\n\r\n\tupdateDefinition(updates){\r\n\t\treturn this._column.updateDefinition(updates);\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\treturn this._column.getWidth();\r\n\t}\r\n\r\n\tsetWidth(width){\r\n\t\tvar result;\r\n\r\n\t\tif(width === true){\r\n\t\t\tresult = this._column.reinitializeWidth(true);\r\n\t\t}else{\r\n\t\t\tresult = this._column.setWidth(width);\r\n\t\t}\r\n\r\n\t\tthis._column.table.columnManager.renderer.rerenderColumns(true);\r\n\r\n\t\treturn result;\r\n\t}\r\n}","export default {\r\n\t\"title\": undefined,\r\n\t\"field\": undefined,\r\n\t\"columns\": undefined,\r\n\t\"visible\": undefined,\r\n\t\"hozAlign\": undefined,\r\n\t\"vertAlign\": undefined,\r\n\t\"width\": undefined,\r\n\t\"minWidth\": 40,\r\n\t\"maxWidth\": undefined,\r\n\t\"maxInitialWidth\": undefined,\r\n\t\"cssClass\": undefined,\r\n\t\"variableHeight\": undefined,\r\n\t\"headerVertical\": undefined,\r\n\t\"headerHozAlign\": undefined,\r\n\t\"editableTitle\": undefined,\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport ColumnComponent from './ColumnComponent.js';\r\nimport defaultOptions from './defaults/options.js';\r\n\r\nimport Cell from '../cell/Cell.js';\r\n\r\nclass Column extends CoreFeature{\r\n\r\n\tconstructor(def, parent){\r\n\t\tsuper(parent.table);\r\n\r\n\t\tthis.definition = def; //column definition\r\n\t\tthis.parent = parent; //hold parent object\r\n\t\tthis.type = \"column\"; //type of element\r\n\t\tthis.columns = []; //child columns\r\n\t\tthis.cells = []; //cells bound to this column\r\n\t\tthis.element = this.createElement(); //column header element\r\n\t\tthis.contentElement = false;\r\n\t\tthis.titleHolderElement = false;\r\n\t\tthis.titleElement = false;\r\n\t\tthis.groupElement = this.createGroupElement(); //column group holder element\r\n\t\tthis.isGroup = false;\r\n\t\tthis.hozAlign = \"\"; //horizontal text alignment\r\n\t\tthis.vertAlign = \"\"; //vert text alignment\r\n\r\n\t\t//multi dimensional filed handling\r\n\t\tthis.field =\"\";\r\n\t\tthis.fieldStructure = \"\";\r\n\t\tthis.getFieldValue = \"\";\r\n\t\tthis.setFieldValue = \"\";\r\n\r\n\t\tthis.titleDownload = null;\r\n\t\tthis.titleFormatterRendered = false;\r\n\r\n\t\tthis.mapDefinitions();\r\n\r\n\t\tthis.setField(this.definition.field);\r\n\r\n\t\tthis.modules = {}; //hold module variables;\r\n\r\n\t\tthis.width = null; //column width\r\n\t\tthis.widthStyled = \"\"; //column width prestyled to improve render efficiency\r\n\t\tthis.maxWidth = null; //column maximum width\r\n\t\tthis.maxWidthStyled = \"\"; //column maximum prestyled to improve render efficiency\r\n\t\tthis.maxInitialWidth = null;\r\n\t\tthis.minWidth = null; //column minimum width\r\n\t\tthis.minWidthStyled = \"\"; //column minimum prestyled to improve render efficiency\r\n\t\tthis.widthFixed = false; //user has specified a width for this column\r\n\r\n\t\tthis.visible = true; //default visible state\r\n\r\n\t\tthis.component = null;\r\n\r\n\t\t//initialize column\r\n\t\tif(this.definition.columns){\r\n\r\n\t\t\tthis.isGroup = true;\r\n\r\n\t\t\tthis.definition.columns.forEach((def, i) => {\r\n\t\t\t\tvar newCol = new Column(def, this);\r\n\t\t\t\tthis.attachColumn(newCol);\r\n\t\t\t});\r\n\r\n\t\t\tthis.checkColumnVisibility();\r\n\t\t}else{\r\n\t\t\tparent.registerColumnField(this);\r\n\t\t}\r\n\r\n\t\tthis._initialize();\r\n\r\n\t\tthis.bindModuleColumns();\r\n\t}\r\n\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-col\");\r\n\t\tel.setAttribute(\"role\", \"columnheader\");\r\n\t\tel.setAttribute(\"aria-sort\", \"none\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tcreateGroupElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-col-group-cols\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tmapDefinitions(){\r\n\t\tvar defaults = this.table.options.columnDefaults;\r\n\r\n\t\t//map columnDefaults onto column definitions\r\n\t\tif(defaults){\r\n\t\t\tfor(let key in defaults){\r\n\t\t\t\tif(typeof this.definition[key] === \"undefined\"){\r\n\t\t\t\t\tthis.definition[key] = defaults[key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.definition = this.table.columnManager.optionsList.generate(Column.defaultOptionList, this.definition)\r\n\t}\r\n\r\n\tcheckDefinition(){\r\n\t\tObject.keys(this.definition).forEach((key) => {\r\n\t\t\tif(Column.defaultOptionList.indexOf(key) === -1){\r\n\t\t\t\tconsole.warn(\"Invalid column definition option in '\" + (this.field || this.definition.title) + \"' column:\", key)\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tsetField(field){\r\n\t\tthis.field = field;\r\n\t\tthis.fieldStructure = field ? (this.table.options.nestedFieldSeparator ? field.split(this.table.options.nestedFieldSeparator) : [field]) : [];\r\n\t\tthis.getFieldValue = this.fieldStructure.length > 1 ? this._getNestedData : this._getFlatData;\r\n\t\tthis.setFieldValue = this.fieldStructure.length > 1 ? this._setNestedData : this._setFlatData;\r\n\t}\r\n\r\n\t//register column position with column manager\r\n\tregisterColumnPosition(column){\r\n\t\tthis.parent.registerColumnPosition(column);\r\n\t}\r\n\r\n\t//register column position with column manager\r\n\tregisterColumnField(column){\r\n\t\tthis.parent.registerColumnField(column);\r\n\t}\r\n\r\n\t//trigger position registration\r\n\treRegisterPosition(){\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tcolumn.reRegisterPosition();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.registerColumnPosition(this);\r\n\t\t}\r\n\t}\r\n\r\n\t_mapDepricatedFunctionality(){\r\n\t\t//all previously deprecated functionality removed in the 5.0 release\r\n\t}\r\n\r\n\t//build header element\r\n\t_initialize(){\r\n\t\tvar def = this.definition;\r\n\r\n\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\r\n\t\tif(def.headerVertical){\r\n\t\t\tthis.element.classList.add(\"tabulator-col-vertical\");\r\n\r\n\t\t\tif(def.headerVertical === \"flip\"){\r\n\t\t\t\tthis.element.classList.add(\"tabulator-col-vertical-flip\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.contentElement = this._bindEvents();\r\n\r\n\t\tthis.contentElement = this._buildColumnHeaderContent();\r\n\r\n\t\tthis.element.appendChild(this.contentElement);\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis._buildGroupHeader();\r\n\t\t}else{\r\n\t\t\tthis._buildColumnHeader();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-init\", this);\r\n\t}\r\n\r\n\t_bindEvents(){\r\n\t\tvar def = this.definition,\r\n\t\tdblTap,\ttapHold, tap;\r\n\r\n\t\t//setup header click event bindings\r\n\t\tif(typeof(def.headerClick) == \"function\"){\r\n\t\t\tthis.element.addEventListener(\"click\", (e) => {def.headerClick(e, this.getComponent());});\r\n\t\t}\r\n\r\n\t\tif(typeof(def.headerDblClick) == \"function\"){\r\n\t\t\tthis.element.addEventListener(\"dblclick\", (e) => {def.headerDblClick(e, this.getComponent());});\r\n\t\t}\r\n\r\n\t\tif(typeof(def.headerContext) == \"function\"){\r\n\t\t\tthis.element.addEventListener(\"contextmenu\", (e) => {def.headerContext(e, this.getComponent());});\r\n\t\t}\r\n\r\n\t\t//setup header tap event bindings\r\n\t\tif(typeof(def.headerTap) == \"function\"){\r\n\t\t\ttap = false;\r\n\r\n\t\t\tthis.element.addEventListener(\"touchstart\", (e) => {\r\n\t\t\t\ttap = true;\r\n\t\t\t}, {passive: true});\r\n\r\n\t\t\tthis.element.addEventListener(\"touchend\", (e) => {\r\n\t\t\t\tif(tap){\r\n\t\t\t\t\tdef.headerTap(e, this.getComponent());\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttap = false;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(typeof(def.headerDblTap) == \"function\"){\r\n\t\t\tdblTap = null;\r\n\r\n\t\t\tthis.element.addEventListener(\"touchend\", (e) => {\r\n\r\n\t\t\t\tif(dblTap){\r\n\t\t\t\t\tclearTimeout(dblTap);\r\n\t\t\t\t\tdblTap = null;\r\n\r\n\t\t\t\t\tdef.headerDblTap(e, this.getComponent());\r\n\t\t\t\t}else{\r\n\r\n\t\t\t\t\tdblTap = setTimeout(() => {\r\n\t\t\t\t\t\tclearTimeout(dblTap);\r\n\t\t\t\t\t\tdblTap = null;\r\n\t\t\t\t\t}, 300);\r\n\t\t\t\t}\r\n\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(typeof(def.headerTapHold) == \"function\"){\r\n\t\t\ttapHold = null;\r\n\r\n\t\t\tthis.element.addEventListener(\"touchstart\", (e) => {\r\n\t\t\t\tclearTimeout(tapHold);\r\n\r\n\t\t\t\ttapHold = setTimeout(function(){\r\n\t\t\t\t\tclearTimeout(tapHold);\r\n\t\t\t\t\ttapHold = null;\r\n\t\t\t\t\ttap = false;\r\n\t\t\t\t\tdef.headerTapHold(e, this.getComponent());\r\n\t\t\t\t}, 1000);\r\n\r\n\t\t\t}, {passive: true});\r\n\r\n\t\t\tthis.element.addEventListener(\"touchend\", (e) => {\r\n\t\t\t\tclearTimeout(tapHold);\r\n\t\t\t\ttapHold = null;\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t//build header element for header\r\n\t_buildColumnHeader(){\r\n\t\tvar def = this.definition,\r\n\t\ttable = this.table;\r\n\r\n\t\tthis.dispatch(\"column-layout\", this);\r\n\r\n\t\t//set column visibility\r\n\t\tif(typeof def.visible != \"undefined\"){\r\n\t\t\tif(def.visible){\r\n\t\t\t\tthis.show(true);\r\n\t\t\t}else{\r\n\t\t\t\tthis.hide(true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//asign additional css classes to column header\r\n\t\tif(def.cssClass){\r\n\t\t\tvar classeNames = def.cssClass.split(\" \");\r\n\t\t\tclasseNames.forEach((className) => {\r\n\t\t\t\tthis.element.classList.add(className);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(def.field){\r\n\t\t\tthis.element.setAttribute(\"tabulator-field\", def.field);\r\n\t\t}\r\n\r\n\t\t//set min width if present\r\n\t\tthis.setMinWidth(parseInt(def.minWidth));\r\n\r\n\t\tif (def.maxInitialWidth) {\r\n\t\t\tthis.maxInitialWidth = parseInt(def.maxInitialWidth);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.maxWidth){\r\n\t\t\tthis.setMaxWidth(parseInt(def.maxWidth));\r\n\t\t}\r\n\r\n\t\tthis.reinitializeWidth();\r\n\r\n\t\t//set orizontal text alignment\r\n\t\tthis.hozAlign = this.definition.hozAlign;\r\n\t\tthis.vertAlign = this.definition.vertAlign;\r\n\r\n\t\tthis.titleElement.style.textAlign = this.definition.headerHozAlign;\r\n\t}\r\n\r\n\t_buildColumnHeaderContent(){\r\n\t\tvar def = this.definition,\r\n\t\ttable = this.table;\r\n\r\n\t\tvar contentElement = document.createElement(\"div\");\r\n\t\tcontentElement.classList.add(\"tabulator-col-content\");\r\n\r\n\t\tthis.titleHolderElement = document.createElement(\"div\");\r\n\t\tthis.titleHolderElement.classList.add(\"tabulator-col-title-holder\");\r\n\r\n\t\tcontentElement.appendChild(this.titleHolderElement);\r\n\r\n\t\tthis.titleElement = this._buildColumnHeaderTitle();\r\n\r\n\t\tthis.titleHolderElement.appendChild(this.titleElement);\r\n\r\n\t\treturn contentElement;\r\n\t}\r\n\r\n\t//build title element of column\r\n\t_buildColumnHeaderTitle(){\r\n\t\tvar def = this.definition,\r\n\t\ttitle;\r\n\r\n\t\tvar titleHolderElement = document.createElement(\"div\");\r\n\t\ttitleHolderElement.classList.add(\"tabulator-col-title\");\r\n\r\n\t\tif(def.editableTitle){\r\n\t\t\tvar titleElement = document.createElement(\"input\");\r\n\t\t\ttitleElement.classList.add(\"tabulator-title-editor\");\r\n\r\n\t\t\ttitleElement.addEventListener(\"click\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\ttitleElement.focus();\r\n\t\t\t});\r\n\r\n\t\t\ttitleElement.addEventListener(\"change\", () => {\r\n\t\t\t\tdef.title = titleElement.value;\r\n\t\t\t\tthis.dispatchExternal(\"columnTitleChanged\", this.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\ttitleHolderElement.appendChild(titleElement);\r\n\r\n\t\t\tif(def.field){\r\n\t\t\t\tthis.langBind(\"columns|\" + def.field, (text) => {\r\n\t\t\t\t\ttitleElement.value = text || (def.title || \" \");\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\ttitleElement.value = def.title || \" \";\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tif(def.field){\r\n\t\t\t\tthis.langBind(\"columns|\" + def.field, (text) => {\r\n\t\t\t\t\tthis._formatColumnHeaderTitle(titleHolderElement, text || (def.title || \" \"));\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tthis._formatColumnHeaderTitle(titleHolderElement, def.title || \" \");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn titleHolderElement;\r\n\t}\r\n\r\n\t_formatColumnHeaderTitle(el, title){\r\n\t\tvar contents = this.chain(\"column-format\", [this, title, el], null, () => {\r\n\t\t\treturn title;\r\n\t\t});\r\n\r\n\t\tswitch(typeof contents){\r\n\t\t\tcase \"object\":\r\n\t\t\tif(contents instanceof Node){\r\n\t\t\t\tel.appendChild(contents);\r\n\t\t\t}else{\r\n\t\t\t\tel.innerHTML = \"\";\r\n\t\t\t\tconsole.warn(\"Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:\", contents);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\tcase \"undefined\":\r\n\t\t\tcase \"null\":\r\n\t\t\tel.innerHTML = \"\";\r\n\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\tel.innerHTML = contents;\r\n\t\t}\r\n\t}\r\n\r\n\t//build header element for column group\r\n\t_buildGroupHeader(){\r\n\t\tthis.element.classList.add(\"tabulator-col-group\");\r\n\t\tthis.element.setAttribute(\"role\", \"columngroup\");\r\n\t\tthis.element.setAttribute(\"aria-title\", this.definition.title);\r\n\r\n\t\t//asign additional css classes to column header\r\n\t\tif(this.definition.cssClass){\r\n\t\t\tvar classeNames = this.definition.cssClass.split(\" \");\r\n\t\t\tclasseNames.forEach((className) => {\r\n\t\t\t\tthis.element.classList.add(className);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.titleElement.style.textAlign = this.definition.headerHozAlign;\r\n\r\n\t\tthis.element.appendChild(this.groupElement);\r\n\t}\r\n\r\n\t//flat field lookup\r\n\t_getFlatData(data){\r\n\t\treturn data[this.field];\r\n\t}\r\n\r\n\t//nested field lookup\r\n\t_getNestedData(data){\r\n\t\tvar dataObj = data,\r\n\t\tstructure = this.fieldStructure,\r\n\t\tlength = structure.length,\r\n\t\toutput;\r\n\r\n\t\tfor(let i = 0; i < length; i++){\r\n\r\n\t\t\tdataObj = dataObj[structure[i]];\r\n\r\n\t\t\toutput = dataObj;\r\n\r\n\t\t\tif(!dataObj){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//flat field set\r\n\t_setFlatData(data, value){\r\n\t\tif(this.field){\r\n\t\t\tdata[this.field] = value;\r\n\t\t}\r\n\t}\r\n\r\n\t//nested field set\r\n\t_setNestedData(data, value){\r\n\t\tvar dataObj = data,\r\n\t\tstructure = this.fieldStructure,\r\n\t\tlength = structure.length;\r\n\r\n\t\tfor(let i = 0; i < length; i++){\r\n\r\n\t\t\tif(i == length -1){\r\n\t\t\t\tdataObj[structure[i]] = value;\r\n\t\t\t}else{\r\n\t\t\t\tif(!dataObj[structure[i]]){\r\n\t\t\t\t\tif(typeof value !== \"undefined\"){\r\n\t\t\t\t\t\tdataObj[structure[i]] = {};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdataObj = dataObj[structure[i]];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//attach column to this group\r\n\tattachColumn(column){\r\n\t\tif(this.groupElement){\r\n\t\t\tthis.columns.push(column);\r\n\t\t\tthis.groupElement.appendChild(column.getElement());\r\n\r\n\t\t\tcolumn.columnRendered();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Warning - Column being attached to another column instead of column group\");\r\n\t\t}\r\n\t}\r\n\r\n\t//vertically align header in column\r\n\tverticalAlign(alignment, height){\r\n\r\n\t\t//calculate height of column header and group holder element\r\n\t\tvar parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : (height || this.parent.getHeadersElement().clientHeight);\r\n\t\t// var parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : this.parent.getHeadersElement().clientHeight;\r\n\r\n\t\tthis.element.style.height = parentHeight + \"px\";\r\n\r\n\t\tthis.dispatch(\"column-height\", this, this.element.style.height);\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.groupElement.style.minHeight = (parentHeight - this.contentElement.offsetHeight) + \"px\";\r\n\t\t}\r\n\r\n\t\t//vertically align cell contents\r\n\t\tif(!this.isGroup && alignment !== \"top\"){\r\n\t\t\tif(alignment === \"bottom\"){\r\n\t\t\t\tthis.element.style.paddingTop = (this.element.clientHeight - this.contentElement.offsetHeight) + \"px\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.element.style.paddingTop = ((this.element.clientHeight - this.contentElement.offsetHeight) / 2) + \"px\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.verticalAlign(alignment);\r\n\t\t});\r\n\t}\r\n\r\n\t//clear vertical alignmenet\r\n\tclearVerticalAlign(){\r\n\t\tthis.element.style.paddingTop = \"\";\r\n\t\tthis.element.style.height = \"\";\r\n\t\tthis.element.style.minHeight = \"\";\r\n\t\tthis.groupElement.style.minHeight = \"\";\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.clearVerticalAlign();\r\n\t\t});\r\n\r\n\t\tthis.dispatch(\"column-height\", this, \"\");\r\n\t}\r\n\r\n\tbindModuleColumns (){\r\n\t\t//check if rownum formatter is being used on a column\r\n\t\tif(this.definition.formatter == \"rownum\"){\r\n\t\t\tthis.table.rowManager.rowNumColumn = this;\r\n\t\t}\r\n\t}\r\n\r\n\t//// Retreive Column Information ////\r\n\t//return column header element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\t//return colunm group element\r\n\tgetGroupElement(){\r\n\t\treturn this.groupElement;\r\n\t}\r\n\r\n\t//return field name\r\n\tgetField(){\r\n\t\treturn this.field;\r\n\t}\r\n\r\n\tgetTitleDownload() {\r\n\t\treturn this.titleDownload;\r\n\t}\r\n\r\n\t//return the first column in a group\r\n\tgetFirstColumn(){\r\n\t\tif(!this.isGroup){\r\n\t\t\treturn this;\r\n\t\t}else{\r\n\t\t\tif(this.columns.length){\r\n\t\t\t\treturn this.columns[0].getFirstColumn();\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//return the last column in a group\r\n\tgetLastColumn(){\r\n\t\tif(!this.isGroup){\r\n\t\t\treturn this;\r\n\t\t}else{\r\n\t\t\tif(this.columns.length){\r\n\t\t\t\treturn this.columns[this.columns.length -1].getLastColumn();\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//return all columns in a group\r\n\tgetColumns(){\r\n\t\treturn this.columns;\r\n\t}\r\n\r\n\t//return all columns in a group\r\n\tgetCells(){\r\n\t\treturn this.cells;\r\n\t}\r\n\r\n\t//retreive the top column in a group of columns\r\n\tgetTopColumn(){\r\n\t\tif(this.parent.isGroup){\r\n\t\t\treturn this.parent.getTopColumn();\r\n\t\t}else{\r\n\t\t\treturn this;\r\n\t\t}\r\n\t}\r\n\r\n\t//return column definition object\r\n\tgetDefinition(updateBranches){\r\n\t\tvar colDefs = [];\r\n\r\n\t\tif(this.isGroup && updateBranches){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tcolDefs.push(column.getDefinition(true));\r\n\t\t\t});\r\n\r\n\t\t\tthis.definition.columns = colDefs;\r\n\t\t}\r\n\r\n\t\treturn this.definition;\r\n\t}\r\n\r\n\t//////////////////// Actions ////////////////////\r\n\tcheckColumnVisibility(){\r\n\t\tvar visible = false;\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvisible = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(visible){\r\n\t\t\tthis.show();\r\n\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), false);\r\n\t\t}else{\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\t//show column\r\n\tshow(silent, responsiveToggle){\r\n\t\tif(!this.visible){\r\n\t\t\tthis.visible = true;\r\n\r\n\t\t\tthis.element.style.display = \"\";\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.checkColumnVisibility();\r\n\t\t\t}\r\n\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.show();\r\n\t\t\t});\r\n\r\n\t\t\tif(!this.isGroup && this.width === null){\r\n\t\t\t\tthis.reinitializeWidth();\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.columnManager.verticalAlignHeaders();\r\n\r\n\t\t\tthis.dispatch(\"column-show\", this, responsiveToggle);\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), true);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\r\n\t\t\tif(!this.silent){\r\n\t\t\t\tthis.table.columnManager.renderer.rerenderColumns();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//hide column\r\n\thide(silent, responsiveToggle){\r\n\t\tif(this.visible){\r\n\t\t\tthis.visible = false;\r\n\r\n\t\t\tthis.element.style.display = \"none\";\r\n\r\n\t\t\tthis.table.columnManager.verticalAlignHeaders();\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.checkColumnVisibility();\r\n\t\t\t}\r\n\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.hide();\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatch(\"column-hide\", this, responsiveToggle);\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), false);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\r\n\t\t\tif(!this.silent){\r\n\t\t\t\tthis.table.columnManager.renderer.rerenderColumns();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmatchChildWidths(){\r\n\t\tvar childWidth = 0;\r\n\r\n\t\tif(this.contentElement && this.columns.length){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tif(column.visible){\r\n\t\t\t\t\tchildWidth += column.getWidth();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.contentElement.style.maxWidth = (childWidth - 1) + \"px\";\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tremoveChild(child){\r\n\t\tvar index = this.columns.indexOf(child);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.columns.splice(index, 1);\r\n\t\t}\r\n\r\n\t\tif(!this.columns.length){\r\n\t\t\tthis.delete();\r\n\t\t}\r\n\t}\r\n\r\n\tsetWidth(width){\r\n\t\tthis.widthFixed = true;\r\n\t\tthis.setWidthActual(width);\r\n\t}\r\n\r\n\tsetWidthActual(width){\r\n\t\tif(isNaN(width)){\r\n\t\t\twidth = Math.floor((this.table.element.clientWidth/100) * parseInt(width));\r\n\t\t}\r\n\r\n\t\twidth = Math.max(this.minWidth, width);\r\n\r\n\t\tif(this.maxWidth){\r\n\t\t\twidth = Math.min(this.maxWidth, width);\r\n\t\t}\r\n\r\n\t\tthis.width = width;\r\n\t\tthis.widthStyled = width ? width + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.width = this.widthStyled;\r\n\r\n\t\tif(!this.isGroup){\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.setWidth();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.parent.isGroup){\r\n\t\t\tthis.parent.matchChildWidths();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-width\", this);\r\n\t}\r\n\r\n\tcheckCellHeights(){\r\n\t\tvar rows = [];\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tif(cell.row.heightInitialized){\r\n\t\t\t\tif(cell.row.getElement().offsetParent !== null){\r\n\t\t\t\t\trows.push(cell.row);\r\n\t\t\t\t\tcell.row.clearCellHeight();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcell.row.heightInitialized = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\trow.calcHeight();\r\n\t\t});\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\trow.setCellHeight();\r\n\t\t});\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\tvar width = 0;\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tif(column.visible){\r\n\t\t\t\t\twidth += column.getWidth();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\twidth = this.width;\r\n\t\t}\r\n\r\n\t\treturn width;\r\n\t}\r\n\r\n\tgetHeight(){\r\n\t\treturn Math.ceil(this.element.getBoundingClientRect().height);\r\n\t}\r\n\r\n\tsetMinWidth(minWidth){\r\n\t\tthis.minWidth = minWidth;\r\n\t\tthis.minWidthStyled = minWidth ? minWidth + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.minWidth = this.minWidthStyled;\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setMinWidth();\r\n\t\t});\r\n\t}\r\n\r\n\tsetMaxWidth(maxWidth){\r\n\t\tthis.maxWidth = maxWidth;\r\n\t\tthis.maxWidthStyled = maxWidth ? maxWidth + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.maxWidth = this.maxWidthStyled;\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setMaxWidth();\r\n\t\t});\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar index;\r\n\r\n\t\t\tif(this.isGroup){\r\n\t\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\t\tcolumn.delete();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatch(\"column-delete\", this);\r\n\r\n\t\t\tvar cellCount = this.cells.length;\r\n\r\n\t\t\tfor(let i = 0; i < cellCount; i++){\r\n\t\t\t\tthis.cells[0].delete();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.element.parentNode){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element = false;\r\n\t\t\tthis.contentElement = false;\r\n\t\t\tthis.titleElement = false;\r\n\t\t\tthis.groupElement = false;\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.removeChild(this);\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.columnManager.deregisterColumn(this);\r\n\r\n\t\t\tthis.table.columnManager.renderer.rerenderColumns(true);\r\n\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\r\n\tcolumnRendered(){\r\n\t\tif(this.titleFormatterRendered){\r\n\t\t\tthis.titleFormatterRendered();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-rendered\", this);\r\n\t}\r\n\r\n\t//////////////// Cell Management /////////////////\r\n\t//generate cell for this column\r\n\tgenerateCell(row){\r\n\t\tvar cell = new Cell(this, row);\r\n\r\n\t\tthis.cells.push(cell);\r\n\r\n\t\treturn cell;\r\n\t}\r\n\r\n\tnextColumn(){\r\n\t\tvar index = this.table.columnManager.findColumnIndex(this);\r\n\t\treturn index > -1 ? this._nextVisibleColumn(index + 1) : false;\r\n\t}\r\n\r\n\t_nextVisibleColumn(index){\r\n\t\tvar column = this.table.columnManager.getColumnByIndex(index);\r\n\t\treturn !column || column.visible ? column : this._nextVisibleColumn(index + 1);\r\n\t}\r\n\r\n\tprevColumn(){\r\n\t\tvar index = this.table.columnManager.findColumnIndex(this);\r\n\t\treturn index > -1 ? this._prevVisibleColumn(index - 1) : false;\r\n\t}\r\n\r\n\t_prevVisibleColumn(index){\r\n\t\tvar column = this.table.columnManager.getColumnByIndex(index);\r\n\t\treturn !column || column.visible ? column : this._prevVisibleColumn(index - 1);\r\n\t}\r\n\r\n\treinitializeWidth(force){\r\n\t\tthis.widthFixed = false;\r\n\r\n\t\t//set width if present\r\n\t\tif(typeof this.definition.width !== \"undefined\" && !force){\r\n\t\t\t// maxInitialWidth ignored here as width specified\r\n\t\t\tthis.setWidth(this.definition.width);\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-width-fit-before\", this);\r\n\r\n\t\tthis.fitToData(force);\r\n\r\n\t\tthis.dispatch(\"column-width-fit-after\", this);\r\n\t}\r\n\r\n\t//set column width to maximum cell width for non group columns\r\n\tfitToData(force){\r\n\t\tif(this.isGroup){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(!this.widthFixed){\r\n\t\t\tthis.element.style.width = \"\";\r\n\r\n\t\t\tthis.cells.forEach((cell) => {\r\n\t\t\t\tcell.clearWidth();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tvar maxWidth = this.element.offsetWidth;\r\n\r\n\t\tif(!this.width || !this.widthFixed){\r\n\t\t\tthis.cells.forEach((cell) => {\r\n\t\t\t\tvar width = cell.getWidth();\r\n\r\n\t\t\t\tif(width > maxWidth){\r\n\t\t\t\t\tmaxWidth = width;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(maxWidth){\r\n\t\t\t\tvar setTo = maxWidth + 1;\r\n\t\t\t\tif (this.maxInitialWidth && !force) {\r\n\t\t\t\t\tsetTo = Math.min(setTo, this.maxInitialWidth);\r\n\t\t\t\t}\r\n\t\t\t\tthis.setWidthActual(setTo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdateDefinition(updates){\r\n\t\tvar definition;\r\n\r\n\t\tif(!this.isGroup){\r\n\t\t\tif(!this.parent.isGroup){\r\n\t\t\t\tdefinition = Object.assign({}, this.getDefinition());\r\n\t\t\t\tdefinition = Object.assign(definition, updates);\r\n\r\n\t\t\t\treturn this.table.columnManager.addColumn(definition, false, this)\r\n\t\t\t\t.then((column) => {\r\n\r\n\t\t\t\t\tif(definition.field == this.field){\r\n\t\t\t\t\t\tthis.field = false; //cleair field name to prevent deletion of duplicate column from arrays\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn this.delete()\r\n\t\t\t\t\t.then(() => {\r\n\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Column Update Error - The updateDefinition function is only available on ungrouped columns\");\r\n\t\t\t\treturn Promise.reject(\"Column Update Error - The updateDefinition function is only available on columns, not column groups\");\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Column Update Error - The updateDefinition function is only available on ungrouped columns\");\r\n\t\t\treturn Promise.reject(\"Column Update Error - The updateDefinition function is only available on columns, not column groups\");\r\n\t\t}\r\n\t}\r\n\r\n\tdeleteCell(cell){\r\n\t\tvar index = this.cells.indexOf(cell);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.cells.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new ColumnComponent(this);\r\n\t\t}\r\n\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n\r\nColumn.defaultOptionList = defaultOptions;\r\n\r\nexport default Column;","//public row object\r\nexport default class RowComponent {\r\n\r\n\tconstructor (row){\r\n\t\tthis._row = row;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._row.table.componentFunctionBinder.handle(\"row\", target._row, name)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\tgetData(transform){\r\n\t\treturn this._row.getData(transform);\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._row.getElement();\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._row.getCells().forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tgetCell(column){\r\n\t\tvar cell = this._row.getCell(column);\r\n\t\treturn cell ? cell.getComponent() : false;\r\n\t}\r\n\r\n\tgetIndex(){\r\n\t\treturn this._row.getData(\"data\")[this._row.table.options.index];\r\n\t}\r\n\r\n\tgetPosition(active){\r\n\t\treturn this._row.table.rowManager.getRowPosition(this._row, active);\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn this._row.delete();\r\n\t}\r\n\r\n\tscrollTo(){\r\n\t\treturn this._row.table.rowManager.scrollToRow(this._row);\r\n\t}\r\n\r\n\tmove(to, after){\r\n\t\tthis._row.moveToRow(to, after);\r\n\t}\r\n\r\n\tupdate(data){\r\n\t\treturn this._row.updateData(data);\r\n\t}\r\n\r\n\tnormalizeHeight(){\r\n\t\tthis._row.normalizeHeight(true);\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._row;\r\n\t}\r\n\r\n\treformat(){\r\n\t\treturn this._row.reinitialize();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._row.table;\r\n\t}\r\n\r\n\tgetNextRow(){\r\n\t\tvar row = this._row.nextRow();\r\n\t\treturn row ? row.getComponent() : row;\r\n\t}\r\n\r\n\tgetPrevRow(){\r\n\t\tvar row = this._row.prevRow();\r\n\t\treturn row ? row.getComponent() : row;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport RowComponent from './RowComponent.js';\r\nimport Helpers from '../tools/Helpers.js';\r\n\r\nexport default class Row extends CoreFeature{\r\n\tconstructor (data, parent, type = \"row\"){\r\n\t\tsuper(parent.table);\r\n\t\t\r\n\t\tthis.parent = parent;\r\n\t\tthis.data = {};\r\n\t\tthis.type = type; //type of element\r\n\t\tthis.element = false;\r\n\t\tthis.modules = {}; //hold module variables;\r\n\t\tthis.cells = [];\r\n\t\tthis.height = 0; //hold element height\r\n\t\tthis.heightStyled = \"\"; //hold element height prestyled to improve render efficiency\r\n\t\tthis.manualHeight = false; //user has manually set row height\r\n\t\tthis.outerHeight = 0; //hold elements outer height\r\n\t\tthis.initialized = false; //element has been rendered\r\n\t\tthis.heightInitialized = false; //element has resized cells to fit\r\n\t\t\r\n\t\tthis.component = null;\r\n\t\t\r\n\t\tthis.created = false;\r\n\t\t\r\n\t\tthis.setData(data);\r\n\t}\r\n\t\r\n\tcreate(){\r\n\t\tif(!this.created){\r\n\t\t\tthis.created = true;\r\n\t\t\tthis.generateElement();\r\n\t\t}\r\n\t}\r\n\t\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-row\");\r\n\t\tel.setAttribute(\"role\", \"row\");\r\n\t\t\r\n\t\tthis.element = el;\r\n\t}\r\n\t\r\n\tgetElement(){\r\n\t\tthis.create();\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\tdetachElement(){\r\n\t\tif (this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgenerateElement(){\r\n\t\tthis.createElement();\r\n\t\tthis.dispatch(\"row-init\", this);\r\n\t}\r\n\t\r\n\tgenerateCells(){\r\n\t\tthis.cells = this.table.columnManager.generateCells(this);\r\n\t}\r\n\t\r\n\t//functions to setup on first render\r\n\tinitialize(force){\r\n\t\tthis.create();\r\n\t\t\r\n\t\tif(!this.initialized || force){\r\n\t\t\t\r\n\t\t\tthis.deleteCells();\r\n\t\t\t\r\n\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout-before\", this);\r\n\t\t\t\r\n\t\t\tthis.generateCells();\r\n\t\t\t\r\n\t\t\tthis.initialized = true;\r\n\t\t\t\r\n\t\t\tthis.table.columnManager.renderer.renderRowCells(this);\r\n\t\t\t\r\n\t\t\tif(force){\r\n\t\t\t\tthis.normalizeHeight();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout\", this);\r\n\t\t\t\r\n\t\t\tif(this.table.options.rowFormatter){\r\n\t\t\t\tthis.table.options.rowFormatter(this.getComponent());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout-after\", this);\r\n\t\t}else{\r\n\t\t\tthis.table.columnManager.renderer.rerenderRowCells(this);\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeHeight(){\r\n\t\tthis.heightInitialized = false;\r\n\t\t\r\n\t\tif(this.element && this.element.offsetParent !== null){\r\n\t\t\tthis.normalizeHeight(true);\r\n\t\t}\r\n\t}\r\n\r\n\tdeinitialize(){\r\n\t\tthis.initialized = false;\r\n\t}\r\n\t\r\n\tdeinitializeHeight(){\r\n\t\tthis.heightInitialized = false;\r\n\t}\r\n\t\r\n\treinitialize(children){\r\n\t\tthis.initialized = false;\r\n\t\tthis.heightInitialized = false;\r\n\t\t\r\n\t\tif(!this.manualHeight){\r\n\t\t\tthis.height = 0;\r\n\t\t\tthis.heightStyled = \"\";\r\n\t\t}\r\n\t\t\r\n\t\tif(this.element && this.element.offsetParent !== null){\r\n\t\t\tthis.initialize(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatch(\"row-relayout\", this);\r\n\t}\r\n\t\r\n\t//get heights when doing bulk row style calcs in virtual DOM\r\n\tcalcHeight(force){\r\n\t\tvar maxHeight = 0,\r\n\t\tminHeight;\r\n\t\t\r\n\t\tif(this.table.options.rowHeight){\r\n\t\t\tthis.height = this.table.options.rowHeight;\r\n\t\t}else{\r\n\t\t\tminHeight = this.table.options.resizableRows ? this.element.clientHeight : 0;\r\n\t\t\t\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tvar height = cell.getHeight();\r\n\t\t\t\tif(height > maxHeight){\r\n\t\t\t\t\tmaxHeight = height;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(force){\r\n\t\t\t\tthis.height = Math.max(maxHeight, minHeight);\r\n\t\t\t}else{\r\n\t\t\t\tthis.height = this.manualHeight ? this.height : Math.max(maxHeight, minHeight);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.heightStyled = this.height ? this.height + \"px\" : \"\";\r\n\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t}\r\n\t\r\n\t//set of cells\r\n\tsetCellHeight(){\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setHeight();\r\n\t\t});\r\n\t\t\r\n\t\tthis.heightInitialized = true;\r\n\t}\r\n\t\r\n\tclearCellHeight(){\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.clearHeight();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//normalize the height of elements in the row\r\n\tnormalizeHeight(force){\r\n\t\tif(force && !this.table.options.rowHeight){\r\n\t\t\tthis.clearCellHeight();\r\n\t\t}\r\n\t\t\r\n\t\tthis.calcHeight(force);\r\n\t\t\r\n\t\tthis.setCellHeight();\r\n\t}\r\n\t\r\n\t//set height of rows\r\n\tsetHeight(height, force){\r\n\t\tif(this.height != height || force){\r\n\t\t\t\r\n\t\t\tthis.manualHeight = true;\r\n\t\t\t\r\n\t\t\tthis.height = height;\r\n\t\t\tthis.heightStyled = height ? height + \"px\" : \"\";\r\n\t\t\t\r\n\t\t\tthis.setCellHeight();\r\n\t\t\t\r\n\t\t\t// this.outerHeight = this.element.outerHeight();\r\n\t\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return rows outer height\r\n\tgetHeight(){\r\n\t\treturn this.outerHeight;\r\n\t}\r\n\t\r\n\t//return rows outer Width\r\n\tgetWidth(){\r\n\t\treturn this.element.offsetWidth;\r\n\t}\r\n\t\r\n\t//////////////// Cell Management /////////////////\r\n\tdeleteCell(cell){\r\n\t\tvar index = this.cells.indexOf(cell);\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.cells.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////// Data Management /////////////////\r\n\tsetData(data){\r\n\t\tthis.data = this.chain(\"row-data-init-before\", [this, data], undefined, data);\r\n\t\t\r\n\t\tthis.dispatch(\"row-data-init-after\", this);\r\n\t}\r\n\t\r\n\t//update the rows data\r\n\tupdateData(updatedData){\r\n\t\tvar visible = this.element && Helpers.elVisible(this.element),\r\n\t\ttempData = {},\r\n\t\tnewRowData;\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\r\n\t\t\tif(typeof updatedData === \"string\"){\r\n\t\t\t\tupdatedData = JSON.parse(updatedData);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-save-before\", this);\r\n\t\t\t\r\n\t\t\tif(this.subscribed(\"row-data-changing\")){\r\n\t\t\t\ttempData = Object.assign(tempData, this.data);\r\n\t\t\t\ttempData = Object.assign(tempData, updatedData);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tnewRowData = this.chain(\"row-data-changing\", [this, tempData, updatedData], null, updatedData);\r\n\t\t\t\r\n\t\t\t//set data\r\n\t\t\tfor (var attrname in newRowData) {\r\n\t\t\t\tthis.data[attrname] = newRowData[attrname];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-save-after\", this);\r\n\t\t\t\r\n\t\t\t//update affected cells only\r\n\t\t\tfor (var attrname in updatedData) {\r\n\t\t\t\t\r\n\t\t\t\tlet columns = this.table.columnManager.getColumnsByFieldRoot(attrname);\r\n\t\t\t\t\r\n\t\t\t\tcolumns.forEach((column) => {\r\n\t\t\t\t\tlet cell = this.getCell(column.getField());\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(cell){\r\n\t\t\t\t\t\tlet value = column.getFieldValue(newRowData);\r\n\t\t\t\t\t\tif(cell.getValue() != value){\r\n\t\t\t\t\t\t\tcell.setValueProcessData(value);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(visible){\r\n\t\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Partial reinitialization if visible\r\n\t\t\tif(visible){\r\n\t\t\t\tthis.normalizeHeight(true);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.rowFormatter){\r\n\t\t\t\t\tthis.table.options.rowFormatter(this.getComponent());\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.initialized = false;\r\n\t\t\t\tthis.height = 0;\r\n\t\t\t\tthis.heightStyled = \"\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-changed\", this, visible, updatedData);\r\n\t\t\t\r\n\t\t\t//this.reinitialize();\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"rowUpdated\", this.getComponent());\r\n\t\t\t\r\n\t\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetData(transform){\r\n\t\tif(transform){\r\n\t\t\treturn this.chain(\"row-data-retrieve\", [this, transform], null, this.data);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.data;\r\n\t}\r\n\t\r\n\tgetCell(column){\r\n\t\tvar match = false;\r\n\t\t\r\n\t\tcolumn = this.table.columnManager.findColumn(column);\r\n\t\t\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.generateCells();\r\n\t\t}\r\n\t\t\r\n\t\tmatch = this.cells.find(function(cell){\r\n\t\t\treturn cell.column === column;\r\n\t\t});\r\n\t\t\r\n\t\treturn match;\r\n\t}\r\n\t\r\n\tgetCellIndex(findCell){\r\n\t\treturn this.cells.findIndex(function(cell){\r\n\t\t\treturn cell === findCell;\r\n\t\t});\r\n\t}\r\n\t\r\n\tfindCell(subject){\r\n\t\treturn this.cells.find((cell) => {\r\n\t\t\treturn cell.element === subject;\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetCells(){\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.generateCells();\r\n\t\t}\r\n\t\t\r\n\t\treturn this.cells;\r\n\t}\r\n\t\r\n\tnextRow(){\r\n\t\tvar row = this.table.rowManager.nextDisplayRow(this, true);\r\n\t\treturn row || false;\r\n\t}\r\n\t\r\n\tprevRow(){\r\n\t\tvar row = this.table.rowManager.prevDisplayRow(this, true);\r\n\t\treturn row || false;\r\n\t}\r\n\t\r\n\tmoveToRow(to, before){\r\n\t\tvar toRow = this.table.rowManager.findRow(to);\r\n\t\t\r\n\t\tif(toRow){\r\n\t\t\tthis.table.rowManager.moveRowActual(this, toRow, !before);\r\n\t\t\tthis.table.rowManager.refreshActiveData(\"display\", false, true);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching row found:\", to);\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////// Actions /////////////////////\r\n\tdelete(){\r\n\t\tthis.dispatch(\"row-delete\", this);\r\n\t\t\r\n\t\tthis.deleteActual();\r\n\t\t\r\n\t\treturn Promise.resolve();\r\n\t}\r\n\t\r\n\tdeleteActual(blockRedraw){\r\n\t\tvar index = this.table.rowManager.getRowIndex(this);\r\n\t\t\r\n\t\tthis.detatchModules();\r\n\t\t\r\n\t\tthis.table.rowManager.deleteRow(this, blockRedraw);\r\n\t\t\r\n\t\tthis.deleteCells();\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.heightInitialized = false;\r\n\t\tthis.element = false;\r\n\t\t\r\n\t\tthis.dispatch(\"row-deleted\", this);\r\n\t}\r\n\t\r\n\tdetatchModules(){\r\n\t\tthis.dispatch(\"row-deleting\", this);\r\n\t}\r\n\t\r\n\tdeleteCells(){\r\n\t\tvar cellCount = this.cells.length;\r\n\t\t\r\n\t\tfor(let i = 0; i < cellCount; i++){\r\n\t\t\tthis.cells[0].delete();\r\n\t\t}\r\n\t}\r\n\t\r\n\twipe(){\r\n\t\tthis.detatchModules();\r\n\t\tthis.deleteCells();\r\n\t\t\r\n\t\tif(this.element){\r\n\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\t\r\n\t\t\tif(this.element.parentNode){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.element = false;\r\n\t\tthis.modules = {};\r\n\t}\r\n\t\r\n\tgetGroup(){\r\n\t\treturn this.modules.group || false;\r\n\t}\r\n\t\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new RowComponent(this);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.component;\r\n\t}\r\n}","export default {\r\n\t\"avg\":function(values, data, calcParams){\r\n\t\tvar output = 0,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : 2\r\n\r\n\t\tif(values.length){\r\n\t\t\toutput = values.reduce(function(sum, value){\r\n\t\t\t\treturn Number(sum) + Number(value);\r\n\t\t\t});\r\n\r\n\t\t\toutput = output / values.length;\r\n\r\n\t\t\toutput = precision !== false ? output.toFixed(precision) : output;\r\n\t\t}\r\n\r\n\t\treturn parseFloat(output).toString();\r\n\t},\r\n\t\"max\":function(values, data, calcParams){\r\n\t\tvar output = null,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tvalues.forEach(function(value){\r\n\r\n\t\t\tvalue = Number(value);\r\n\r\n\t\t\tif(value > output || output === null){\r\n\t\t\t\toutput = value;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output !== null ? (precision !== false ? output.toFixed(precision) : output) : \"\";\r\n\t},\r\n\t\"min\":function(values, data, calcParams){\r\n\t\tvar output = null,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tvalues.forEach(function(value){\r\n\r\n\t\t\tvalue = Number(value);\r\n\r\n\t\t\tif(value < output || output === null){\r\n\t\t\t\toutput = value;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output !== null ? (precision !== false ? output.toFixed(precision) : output) : \"\";\r\n\t},\r\n\t\"sum\":function(values, data, calcParams){\r\n\t\tvar output = 0,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tif(values.length){\r\n\t\t\tvalues.forEach(function(value){\r\n\t\t\t\tvalue = Number(value);\r\n\r\n\t\t\t\toutput += !isNaN(value) ? Number(value) : 0;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn precision !== false ? output.toFixed(precision) : output;\r\n\t},\r\n\t\"concat\":function(values, data, calcParams){\r\n\t\tvar output = 0;\r\n\r\n\t\tif(values.length){\r\n\t\t\toutput = values.reduce(function(sum, value){\r\n\t\t\t\treturn String(sum) + String(value);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t},\r\n\t\"count\":function(values, data, calcParams){\r\n\t\tvar output = 0;\r\n\r\n\t\tif(values.length){\r\n\t\t\tvalues.forEach(function(value){\r\n\t\t\t\tif(value){\r\n\t\t\t\t\toutput ++;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport CalcComponent from './CalcComponent.js';\r\n\r\nimport Cell from '../../core/cell/Cell.js';\r\nimport Column from '../../core/column/Column.js';\r\nimport Row from '../../core/row/Row.js';\r\n\r\nimport defaultCalculations from './defaults/calculations.js';\r\n\r\nclass ColumnCalcs extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.topCalcs = [];\r\n\t\tthis.botCalcs = [];\r\n\t\tthis.genColumn = false;\r\n\t\tthis.topElement = this.createElement();\r\n\t\tthis.botElement = this.createElement();\r\n\t\tthis.topRow = false;\r\n\t\tthis.botRow = false;\r\n\t\tthis.topInitialized = false;\r\n\t\tthis.botInitialized = false;\r\n\r\n\t\tthis.registerTableOption(\"columnCalcs\", true);\r\n\r\n\t\tthis.registerColumnOption(\"topCalc\");\r\n\t\tthis.registerColumnOption(\"topCalcParams\");\r\n\t\tthis.registerColumnOption(\"topCalcFormatter\");\r\n\t\tthis.registerColumnOption(\"topCalcFormatterParams\");\r\n\t\tthis.registerColumnOption(\"bottomCalc\");\r\n\t\tthis.registerColumnOption(\"bottomCalcParams\");\r\n\t\tthis.registerColumnOption(\"bottomCalcFormatter\");\r\n\t\tthis.registerColumnOption(\"bottomCalcFormatterParams\");\r\n\t}\r\n\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tel.classList.add(\"tabulator-calcs-holder\");\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.genColumn = new Column({field:\"value\"}, this);\r\n\r\n\t\tthis.subscribe(\"cell-value-changed\", this.cellValueChanged.bind(this));\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumnCheck.bind(this));\r\n\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"row-added\", this.rowsUpdated.bind(this));\r\n\t\tthis.subscribe(\"column-moved\", this.recalcActiveRows.bind(this));\r\n\t\tthis.subscribe(\"column-add\", this.recalcActiveRows.bind(this));\r\n\t\tthis.subscribe(\"data-refreshed\", this.recalcActiveRowsRefresh.bind(this));\r\n\t\tthis.subscribe(\"table-redraw\", this.tableRedraw.bind(this));\r\n\t\tthis.subscribe(\"rows-visible\", this.visibleRows.bind(this));\r\n\r\n\t\tthis.registerTableFunction(\"getCalcResults\", this.getResults.bind(this));\r\n\t\tthis.registerTableFunction(\"recalc\", this.userRecalc.bind(this));\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\r\n\t\tif(force){\r\n\t\t\tthis.redraw();\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\tuserRecalc(){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tvisibleRows(viewable, rows){\r\n\t\tif(this.topRow){\r\n\t\t\trows.unshift(this.topRow);\r\n\t\t}\r\n\r\n\t\tif(this.botRow){\r\n\t\t\trows.push(this.botRow);\r\n\t\t}\r\n\t\r\n\t\treturn rows;\r\n\t}\r\n\r\n\trowsUpdated(row){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.recalcRowGroup(this);\r\n\t\t}else{\r\n\t\t\tthis.recalcActiveRows();\r\n\t\t}\r\n\t}\r\n\r\n\trecalcActiveRowsRefresh(){\r\n\t\tif(this.table.options.groupBy && this.table.options.dataTreeStartExpanded && this.table.options.dataTree){\r\n\t\t\tthis.recalcAll();\r\n\t\t}else{\r\n\t\t\tthis.recalcActiveRows();\r\n\t\t}\r\n\t}\r\n\r\n\trecalcActiveRows(){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\t}\r\n\r\n\tcellValueChanged(cell){\r\n\t\tif(cell.column.definition.topCalc || cell.column.definition.bottomCalc){\r\n\t\t\tif(this.table.options.groupBy){\r\n\t\t\t\tif(this.table.options.columnCalcs == \"table\" || this.table.options.columnCalcs == \"both\"){\r\n\t\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"table\"){\r\n\t\t\t\t\tthis.recalcRowGroup(cell.row);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeColumnCheck(column){\r\n\t\tif(column.definition.topCalc || column.definition.bottomCalc){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\r\n\t//initialize column calcs\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.definition\r\n\r\n\t\tvar config = {\r\n\t\t\ttopCalcParams:def.topCalcParams || {},\r\n\t\t\tbotCalcParams:def.bottomCalcParams || {},\r\n\t\t};\r\n\r\n\t\tif(def.topCalc){\r\n\r\n\t\t\tswitch(typeof def.topCalc){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tif(ColumnCalcs.calculations[def.topCalc]){\r\n\t\t\t\t\tconfig.topCalc = ColumnCalcs.calculations[def.topCalc]\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Column Calc Error - No such calculation found, ignoring: \", def.topCalc);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tconfig.topCalc = def.topCalc;\r\n\t\t\t\tbreak\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(config.topCalc){\r\n\t\t\t\tcolumn.modules.columnCalcs = config;\r\n\t\t\t\tthis.topCalcs.push(column);\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"group\"){\r\n\t\t\t\t\tthis.initializeTopRow();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tif(def.bottomCalc){\r\n\t\t\tswitch(typeof def.bottomCalc){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tif(ColumnCalcs.calculations[def.bottomCalc]){\r\n\t\t\t\t\tconfig.botCalc = ColumnCalcs.calculations[def.bottomCalc]\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Column Calc Error - No such calculation found, ignoring: \", def.bottomCalc);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tconfig.botCalc = def.bottomCalc;\r\n\t\t\t\tbreak\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(config.botCalc){\r\n\t\t\t\tcolumn.modules.columnCalcs = config;\r\n\t\t\t\tthis.botCalcs.push(column);\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"group\"){\r\n\t\t\t\t\tthis.initializeBottomRow();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t//dummy functions to handle being mock column manager\r\n\tregisterColumnField(){};\r\n\r\n\tremoveCalcs(){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(this.topInitialized){\r\n\t\t\tthis.topInitialized = false;\r\n\t\t\tthis.topElement.parentNode.removeChild(this.topElement);\r\n\t\t\tchanged = true;\r\n\t\t}\r\n\r\n\t\tif(this.botInitialized){\r\n\t\t\tthis.botInitialized = false;\r\n\t\t\tthis.footerRemove(this.botElement);\r\n\t\t\tchanged = true;\r\n\t\t}\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeTopRow(){\r\n\t\tif(!this.topInitialized){\r\n\t\t\tthis.table.columnManager.getElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling);\r\n\t\t\tthis.topInitialized = true;\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeBottomRow(){\r\n\t\tif(!this.botInitialized){\r\n\t\t\tthis.footerPrepend(this.botElement);\r\n\t\t\tthis.botInitialized = true;\r\n\t\t}\r\n\t}\r\n\r\n\tscrollHorizontal(left){\r\n\t\tif(this.botInitialized && this.botRow){\r\n\t\t\tthis.botRow.getElement().style.marginLeft = (-left) + \"px\";\r\n\t\t}\r\n\t}\r\n\r\n\trecalc(rows){\r\n\t\tvar data, row;\r\n\r\n\t\tif(this.topInitialized || this.botInitialized){\r\n\t\t\tdata = this.rowsToData(rows);\r\n\r\n\t\t\tif(this.topInitialized){\r\n\t\t\t\tif(this.topRow){\r\n\t\t\t\t\tthis.topRow.deleteCells();\r\n\t\t\t\t}\r\n\r\n\t\t\t\trow = this.generateRow(\"top\", this.rowsToData(rows))\r\n\t\t\t\tthis.topRow = row;\r\n\t\t\t\twhile(this.topElement.firstChild) this.topElement.removeChild(this.topElement.firstChild);\r\n\t\t\t\tthis.topElement.appendChild(row.getElement());\r\n\t\t\t\trow.initialize(true);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.botInitialized){\r\n\t\t\t\tif(this.botRow){\r\n\t\t\t\t\tthis.botRow.deleteCells();\r\n\t\t\t\t}\r\n\r\n\t\t\t\trow = this.generateRow(\"bottom\", this.rowsToData(rows))\r\n\t\t\t\tthis.botRow = row;\r\n\t\t\t\twhile(this.botElement.firstChild) this.botElement.removeChild(this.botElement.firstChild);\r\n\t\t\t\tthis.botElement.appendChild(row.getElement());\r\n\t\t\t\trow.initialize(true);\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\t//set resizable handles\r\n\t\t\tif(this.table.modExists(\"frozenColumns\")){\r\n\t\t\t\tthis.table.modules.frozenColumns.layout();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trecalcRowGroup(row){\r\n\t\tthis.recalcGroup(this.table.modules.groupRows.getRowGroup(row));\r\n\t}\r\n\r\n\trecalcAll(){\r\n\t\tif(this.topCalcs.length || this.botCalcs.length){\r\n\t\t\tif(this.table.options.columnCalcs !== \"group\"){\r\n\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.options.groupBy && this.table.options.columnCalcs !== \"table\"){\r\n\r\n\t\t\t\tvar groups = this.table.modules.groupRows.getChildGroups();\r\n\r\n\t\t\t\tgroups.forEach((group) => {\r\n\t\t\t\t\tthis.recalcGroup(group);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trecalcGroup(group){\r\n\t\tvar data, rowData;\r\n\r\n\t\tif(group){\r\n\t\t\tif(group.calcs){\r\n\t\t\t\tif(group.calcs.bottom){\r\n\t\t\t\t\tdata = this.rowsToData(group.rows);\r\n\t\t\t\t\trowData = this.generateRowData(\"bottom\", data);\r\n\r\n\t\t\t\t\tgroup.calcs.bottom.updateData(rowData);\r\n\t\t\t\t\tgroup.calcs.bottom.reinitialize();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(group.calcs.top){\r\n\t\t\t\t\tdata = this.rowsToData(group.rows);\r\n\t\t\t\t\trowData = this.generateRowData(\"top\", data);\r\n\r\n\t\t\t\t\tgroup.calcs.top.updateData(rowData);\r\n\t\t\t\t\tgroup.calcs.top.reinitialize();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//generate top stats row\r\n\tgenerateTopRow(rows){\r\n\t\treturn this.generateRow(\"top\", this.rowsToData(rows));\r\n\t}\r\n\t//generate bottom stats row\r\n\tgenerateBottomRow(rows){\r\n\t\treturn this.generateRow(\"bottom\", this.rowsToData(rows));\r\n\t}\r\n\r\n\trowsToData(rows){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\trows.forEach((row) => {\r\n\t\t\tdata.push(row.getData());\r\n\r\n\t\t\tif(this.table.options.dataTree && this.table.options.dataTreeChildColumnCalcs){\r\n\t\t\t\tif(row.modules.dataTree && row.modules.dataTree.open){\r\n\t\t\t\t\tvar children = this.rowsToData(this.table.modules.dataTree.getFilteredTreeChildren(row));\r\n\t\t\t\t\tdata = data.concat(children);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//generate stats row\r\n\tgenerateRow(pos, data){\r\n\t\tvar rowData = this.generateRowData(pos, data),\r\n\t\trow;\r\n\r\n\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\tthis.table.modules.mutator.disable();\r\n\t\t}\r\n\r\n\t\trow = new Row(rowData, this, \"calc\");\r\n\r\n\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\tthis.table.modules.mutator.enable();\r\n\t\t}\r\n\r\n\t\trow.getElement().classList.add(\"tabulator-calcs\", \"tabulator-calcs-\" + pos);\r\n\r\n\t\trow.component = false;\r\n\r\n\t\trow.getComponent = () => {\r\n\t\t\tif(!row.component){\r\n\t\t\t\trow.component = new CalcComponent(row);\r\n\t\t\t}\r\n\r\n\t\t\treturn row.component;\r\n\t\t};\r\n\r\n\t\trow.generateCells = () => {\r\n\r\n\t\t\tvar cells = [];\r\n\r\n\t\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\r\n\t\t\t\t\t//set field name of mock column\r\n\t\t\t\t\tthis.genColumn.setField(column.getField());\r\n\t\t\t\t\tthis.genColumn.hozAlign = column.hozAlign;\r\n\r\n\t\t\t\t\tif(column.definition[pos + \"CalcFormatter\"] && this.table.modExists(\"format\")){\r\n\t\t\t\t\t\tthis.genColumn.modules.format = {\r\n\t\t\t\t\t\t\tformatter: this.table.modules.format.getFormatter(column.definition[pos + \"CalcFormatter\"]),\r\n\t\t\t\t\t\t\tparams: column.definition[pos + \"CalcFormatterParams\"] || {},\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.genColumn.modules.format = {\r\n\t\t\t\t\t\t\tformatter: this.table.modules.format.getFormatter(\"plaintext\"),\r\n\t\t\t\t\t\t\tparams:{}\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//ensure css class defintion is replicated to calculation cell\r\n\t\t\t\t\tthis.genColumn.definition.cssClass = column.definition.cssClass;\r\n\r\n\t\t\t\t\t//generate cell and assign to correct column\r\n\t\t\t\t\tvar cell = new Cell(this.genColumn, row);\r\n\t\t\t\t\tcell.getElement();\r\n\t\t\t\t\tcell.column = column;\r\n\t\t\t\t\tcell.setWidth();\r\n\r\n\t\t\t\t\tcolumn.cells.push(cell);\r\n\t\t\t\t\tcells.push(cell);\r\n\r\n\t\t\t\t\tif(!column.visible){\r\n\t\t\t\t\t\tcell.hide();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\trow.cells = cells;\r\n\t\t};\r\n\r\n\t\treturn row;\r\n\t}\r\n\r\n\t//generate stats row\r\n\tgenerateRowData(pos, data){\r\n\t\tvar rowData = {},\r\n\t\tcalcs = pos == \"top\" ? this.topCalcs : this.botCalcs,\r\n\t\ttype = pos == \"top\" ? \"topCalc\" : \"botCalc\",\r\n\t\tparams, paramKey;\r\n\r\n\t\tcalcs.forEach(function(column){\r\n\t\t\tvar values = [];\r\n\r\n\t\t\tif(column.modules.columnCalcs && column.modules.columnCalcs[type]){\r\n\t\t\t\tdata.forEach(function(item){\r\n\t\t\t\t\tvalues.push(column.getFieldValue(item));\r\n\t\t\t\t});\r\n\r\n\t\t\t\tparamKey = type + \"Params\";\r\n\t\t\t\tparams = typeof column.modules.columnCalcs[paramKey] === \"function\" ? column.modules.columnCalcs[paramKey](values, data) : column.modules.columnCalcs[paramKey];\r\n\r\n\t\t\t\tcolumn.setFieldValue(rowData, column.modules.columnCalcs[type](values, data, params));\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowData;\r\n\t}\r\n\r\n\thasTopCalcs(){\r\n\t\treturn\t!!(this.topCalcs.length);\r\n\t}\r\n\r\n\thasBottomCalcs(){\r\n\t\treturn\t!!(this.botCalcs.length);\r\n\t}\r\n\r\n\t//handle table redraw\r\n\tredraw(){\r\n\t\tif(this.topRow){\r\n\t\t\tthis.topRow.normalizeHeight(true);\r\n\t\t}\r\n\t\tif(this.botRow){\r\n\t\t\tthis.botRow.normalizeHeight(true);\r\n\t\t}\r\n\t}\r\n\r\n\t//return the calculated\r\n\tgetResults(){\r\n\t\tvar results = {},\r\n\t\tgroups;\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tgroups = this.table.modules.groupRows.getGroups(true);\r\n\r\n\t\t\tgroups.forEach((group) => {\r\n\t\t\t\tresults[group.getKey()] = this.getGroupResults(group);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tresults = {\r\n\t\t\t\ttop: this.topRow ? this.topRow.getData() : {},\r\n\t\t\t\tbottom: this.botRow ? this.botRow.getData() : {},\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\t//get results from a group\r\n\tgetGroupResults(group){\r\n\t\tvar groupObj = group._getSelf(),\r\n\t\tsubGroups = group.getSubGroups(),\r\n\t\tsubGroupResults = {},\r\n\t\tresults = {};\r\n\r\n\t\tsubGroups.forEach((subgroup) => {\r\n\t\t\tsubGroupResults[subgroup.getKey()] = this.getGroupResults(subgroup);\r\n\t\t});\r\n\r\n\t\tresults = {\r\n\t\t\ttop: groupObj.calcs.top ? groupObj.calcs.top.getData() : {},\r\n\t\t\tbottom: groupObj.calcs.bottom ? groupObj.calcs.bottom.getData() : {},\r\n\t\t\tgroups: subGroupResults,\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n}\r\n\r\nColumnCalcs.moduleName = \"columnCalcs\";\r\n\r\n//load defaults\r\nColumnCalcs.calculations = defaultCalculations;\r\n\r\nexport default ColumnCalcs;","import Module from '../../core/Module.js';\r\n\r\nimport Row from '../../core/row/Row.js';\r\n\r\nclass DataTree extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.indent = 10;\r\n\t\tthis.field = \"\";\r\n\t\tthis.collapseEl = null;\r\n\t\tthis.expandEl = null;\r\n\t\tthis.branchEl = null;\r\n\t\tthis.elementField = false;\r\n\r\n\t\tthis.startOpen = function(){};\r\n\r\n\t\tthis.displayIndex = 0;\r\n\r\n\t\tthis.registerTableOption(\"dataTree\", false); //enable data tree\r\n\t\tthis.registerTableOption(\"dataTreeFilter\", true); //filter child rows\r\n\t\tthis.registerTableOption(\"dataTreeSort\", true); //sort child rows\r\n\t\tthis.registerTableOption(\"dataTreeElementColumn\", false);\r\n\t\tthis.registerTableOption(\"dataTreeBranchElement\", true);//show data tree branch element\r\n\t\tthis.registerTableOption(\"dataTreeChildIndent\", 9); //data tree child indent in px\r\n\t\tthis.registerTableOption(\"dataTreeChildField\", \"_children\");//data tre column field to look for child rows\r\n\t\tthis.registerTableOption(\"dataTreeCollapseElement\", false);//data tree row collapse element\r\n\t\tthis.registerTableOption(\"dataTreeExpandElement\", false);//data tree row expand element\r\n\t\tthis.registerTableOption(\"dataTreeStartExpanded\", false);\r\n\t\tthis.registerTableOption(\"dataTreeChildColumnCalcs\", false);//include visible data tree rows in column calculations\r\n\t\tthis.registerTableOption(\"dataTreeSelectPropagate\", false);//seleccting a parent row selects its children\r\n\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"treeCollapse\", this.collapseRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"treeExpand\", this.expandRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"treeToggle\", this.toggleRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"getTreeParent\", this.getTreeParent.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"getTreeChildren\", this.getRowChildren.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"addTreeChild\", this.addTreeChildRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isTreeExpanded\", this.isRowExpanded.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.dataTree){\r\n\t\t\tvar dummyEl = null,\r\n\t\t\toptions = this.table.options;\r\n\r\n\t\t\tthis.field = options.dataTreeChildField;\r\n\t\t\tthis.indent = options.dataTreeChildIndent;\r\n\r\n\t\t\tif(options.dataTreeBranchElement){\r\n\r\n\t\t\t\tif(options.dataTreeBranchElement === true){\r\n\t\t\t\t\tthis.branchEl = document.createElement(\"div\");\r\n\t\t\t\t\tthis.branchEl.classList.add(\"tabulator-data-tree-branch\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(typeof options.dataTreeBranchElement === \"string\"){\r\n\t\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\t\tdummyEl.innerHTML = options.dataTreeBranchElement;\r\n\t\t\t\t\t\tthis.branchEl = dummyEl.firstChild;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.branchEl = options.dataTreeBranchElement;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(options.dataTreeCollapseElement){\r\n\t\t\t\tif(typeof options.dataTreeCollapseElement === \"string\"){\r\n\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\tdummyEl.innerHTML = options.dataTreeCollapseElement;\r\n\t\t\t\t\tthis.collapseEl = dummyEl.firstChild;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.collapseEl = options.dataTreeCollapseElement;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.collapseEl = document.createElement(\"div\");\r\n\t\t\t\tthis.collapseEl.classList.add(\"tabulator-data-tree-control\");\r\n\t\t\t\tthis.collapseEl.tabIndex = 0;\r\n\t\t\t\tthis.collapseEl.innerHTML = \"
\";\r\n\t\t\t}\r\n\r\n\t\t\tif(options.dataTreeExpandElement){\r\n\t\t\t\tif(typeof options.dataTreeExpandElement === \"string\"){\r\n\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\tdummyEl.innerHTML = options.dataTreeExpandElement;\r\n\t\t\t\t\tthis.expandEl = dummyEl.firstChild;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.expandEl = options.dataTreeExpandElement;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.expandEl = document.createElement(\"div\");\r\n\t\t\t\tthis.expandEl.classList.add(\"tabulator-data-tree-control\");\r\n\t\t\t\tthis.expandEl.tabIndex = 0;\r\n\t\t\t\tthis.expandEl.innerHTML = \"
\";\r\n\t\t\t}\r\n\r\n\r\n\t\t\tswitch(typeof options.dataTreeStartExpanded){\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\tthis.startOpen = function(row, index){\r\n\t\t\t\t\treturn options.dataTreeStartExpanded;\r\n\t\t\t\t};\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tthis.startOpen = options.dataTreeStartExpanded;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\tthis.startOpen = function(row, index){\r\n\t\t\t\t\treturn options.dataTreeStartExpanded[index];\r\n\t\t\t\t};\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-layout-after\", this.layoutRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowDelete.bind(this),0);\r\n\t\t\tthis.subscribe(\"row-data-changed\", this.rowDataChanged.bind(this), 10);\r\n\t\t\tthis.subscribe(\"cell-value-updated\", this.cellValueChanged.bind(this));\r\n\t\t\tthis.subscribe(\"edit-cancelled\", this.cellValueChanged.bind(this));\r\n\t\t\tthis.subscribe(\"column-moving-rows\", this.columnMoving.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.initializeElementField.bind(this));\r\n\t\t\tthis.subscribe(\"table-redrawing\", this.tableRedrawing.bind(this));\r\n\r\n\t\t\tthis.registerDisplayHandler(this.getRows.bind(this), 30);\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedrawing(force){\r\n\t\tvar rows;\r\n\r\n\t\tif(force){\r\n\t\t\trows = this.table.rowManager.getRows();\r\n\t\t\t\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.reinitializeRowChildren(row);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeElementField(){\r\n\t\tvar firstCol = this.table.columnManager.getFirstVisibleColumn();\r\n\r\n\t\tthis.elementField = this.table.options.dataTreeElementColumn || (firstCol ? firstCol.field : false);\r\n\t}\r\n\t\r\n\tgetRowChildren(row){\r\n\t\treturn this.getTreeChildren(row, true);\r\n\t}\r\n\r\n\tcolumnMoving(){\r\n\t\tvar rows = [];\r\n\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\trows = rows.concat(this.getTreeChildren(row, false, true));\r\n\t\t});\r\n\r\n\t\treturn rows;\r\n\t}\r\n\r\n\trowDataChanged(row, visible, updatedData){\r\n\t\tif(this.redrawNeeded(updatedData)){\r\n\t\t\tthis.initializeRow(row);\r\n\r\n\t\t\tif(visible){\r\n\t\t\t\tthis.layoutRow(row);\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tcellValueChanged(cell){\r\n\t\tvar field = cell.column.getField();\r\n\r\n\t\tif(field === this.elementField){\r\n\t\t\tthis.layoutRow(cell.row);\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar childArray = row.getData()[this.field];\r\n\t\tvar isArray = Array.isArray(childArray);\r\n\r\n\t\tvar children = isArray || (!isArray && typeof childArray === \"object\" && childArray !== null);\r\n\r\n\t\tif(!children && row.modules.dataTree && row.modules.dataTree.branchEl){\r\n\t\t\trow.modules.dataTree.branchEl.parentNode.removeChild(row.modules.dataTree.branchEl);\r\n\t\t}\r\n\r\n\t\tif(!children && row.modules.dataTree && row.modules.dataTree.controlEl){\r\n\t\t\trow.modules.dataTree.controlEl.parentNode.removeChild(row.modules.dataTree.controlEl);\r\n\t\t}\r\n\r\n\t\trow.modules.dataTree = {\r\n\t\t\tindex: row.modules.dataTree ? row.modules.dataTree.index : 0,\r\n\t\t\topen: children ? (row.modules.dataTree ? row.modules.dataTree.open : this.startOpen(row.getComponent(), 0)) : false,\r\n\t\t\tcontrolEl: row.modules.dataTree && children ? row.modules.dataTree.controlEl : false,\r\n\t\t\tbranchEl: row.modules.dataTree && children ? row.modules.dataTree.branchEl : false,\r\n\t\t\tparent: row.modules.dataTree ? row.modules.dataTree.parent : false,\r\n\t\t\tchildren:children,\r\n\t\t};\r\n\t}\r\n\r\n\treinitializeRowChildren(row){\r\n\t\tvar children = this.getTreeChildren(row, false, true);\r\n\r\n\t\tchildren.forEach(function(child){\r\n\t\t\tchild.reinitialize(true);\r\n\t\t});\r\n\t}\r\n\r\n\tlayoutRow(row){\r\n\t\tvar cell = this.elementField ? row.getCell(this.elementField) : row.getCells()[0],\r\n\t\tel = cell.getElement(),\r\n\t\tconfig = row.modules.dataTree;\r\n\r\n\t\tif(config.branchEl){\r\n\t\t\tif(config.branchEl.parentNode){\r\n\t\t\t\tconfig.branchEl.parentNode.removeChild(config.branchEl);\r\n\t\t\t}\r\n\t\t\tconfig.branchEl = false;\r\n\t\t}\r\n\r\n\t\tif(config.controlEl){\r\n\t\t\tif(config.controlEl.parentNode){\r\n\t\t\t\tconfig.controlEl.parentNode.removeChild(config.controlEl);\r\n\t\t\t}\r\n\t\t\tconfig.controlEl = false;\r\n\t\t}\r\n\r\n\t\tthis.generateControlElement(row, el);\r\n\r\n\t\trow.getElement().classList.add(\"tabulator-tree-level-\" + config.index);\r\n\r\n\t\tif(config.index){\r\n\t\t\tif(this.branchEl){\r\n\t\t\t\tconfig.branchEl = this.branchEl.cloneNode(true);\r\n\t\t\t\tel.insertBefore(config.branchEl, el.firstChild);\r\n\r\n\t\t\t\tif(this.table.rtl){\r\n\t\t\t\t\tconfig.branchEl.style.marginRight = (((config.branchEl.offsetWidth + config.branchEl.style.marginLeft) * (config.index - 1)) + (config.index * this.indent)) + \"px\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconfig.branchEl.style.marginLeft = (((config.branchEl.offsetWidth + config.branchEl.style.marginRight) * (config.index - 1)) + (config.index * this.indent)) + \"px\";\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\r\n\t\t\t\tif(this.table.rtl){\r\n\t\t\t\t\tel.style.paddingRight = parseInt(window.getComputedStyle(el, null).getPropertyValue('padding-right')) + (config.index * this.indent) + \"px\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.style.paddingLeft = parseInt(window.getComputedStyle(el, null).getPropertyValue('padding-left')) + (config.index * this.indent) + \"px\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateControlElement(row, el){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\tel = el || row.getCells()[0].getElement(),\r\n\t\toldControl = config.controlEl;\r\n\r\n\t\tif(config.children !== false){\r\n\r\n\t\t\tif(config.open){\r\n\t\t\t\tconfig.controlEl = this.collapseEl.cloneNode(true);\r\n\t\t\t\tconfig.controlEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\tthis.collapseRow(row);\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconfig.controlEl = this.expandEl.cloneNode(true);\r\n\t\t\t\tconfig.controlEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\tthis.expandRow(row);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tconfig.controlEl.addEventListener(\"mousedown\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t});\r\n\r\n\t\t\tif(oldControl && oldControl.parentNode === el){\r\n\t\t\t\toldControl.parentNode.replaceChild(config.controlEl,oldControl);\r\n\t\t\t}else{\r\n\t\t\t\tel.insertBefore(config.controlEl, el.firstChild);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tsetDisplayIndex (index) {\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\r\n\tgetDisplayIndex () {\r\n\t\treturn this.displayIndex;\r\n\t}\r\n\r\n\tgetRows(rows){\r\n\t\tvar output = [];\r\n\r\n\t\trows.forEach((row, i) => {\r\n\t\t\tvar config, children;\r\n\r\n\t\t\toutput.push(row);\r\n\r\n\t\t\tif(row instanceof Row){\r\n\r\n\t\t\t\trow.create();\r\n\r\n\t\t\t\tconfig = row.modules.dataTree.children;\r\n\r\n\t\t\t\tif(!config.index && config.children !== false){\r\n\t\t\t\t\tchildren = this.getChildren(row);\r\n\r\n\t\t\t\t\tchildren.forEach((child) => {\r\n\t\t\t\t\t\tchild.create();\r\n\t\t\t\t\t\toutput.push(child);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetChildren(row, allChildren){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\tchildren = [],\r\n\t\toutput = [];\r\n\r\n\t\tif(config.children !== false && (config.open || allChildren)){\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"filter\") && this.table.options.dataTreeFilter){\r\n\t\t\t\tchildren = this.table.modules.filter.filter(config.children);\r\n\t\t\t}else{\r\n\t\t\t\tchildren = config.children;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"sort\") && this.table.options.dataTreeSort){\r\n\t\t\t\tthis.table.modules.sort.sort(children);\r\n\t\t\t}\r\n\r\n\t\t\tchildren.forEach((child) => {\r\n\t\t\t\toutput.push(child);\r\n\r\n\t\t\t\tvar subChildren = this.getChildren(child);\r\n\r\n\t\t\t\tsubChildren.forEach((sub) => {\r\n\t\t\t\t\toutput.push(sub);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgenerateChildren(row){\r\n\t\tvar children = [];\r\n\r\n\t\tvar childArray = row.getData()[this.field];\r\n\r\n\t\tif(!Array.isArray(childArray)){\r\n\t\t\tchildArray = [childArray];\r\n\t\t}\r\n\r\n\t\tchildArray.forEach((childData) => {\r\n\t\t\tvar childRow = new Row(childData || {}, this.table.rowManager);\r\n\r\n\t\t\tchildRow.create();\r\n\r\n\t\t\tchildRow.modules.dataTree.index = row.modules.dataTree.index + 1;\r\n\t\t\tchildRow.modules.dataTree.parent = row;\r\n\r\n\t\t\tif(childRow.modules.dataTree.children){\r\n\t\t\t\tchildRow.modules.dataTree.open = this.startOpen(childRow.getComponent(), childRow.modules.dataTree.index);\r\n\t\t\t}\r\n\t\t\tchildren.push(childRow);\r\n\t\t});\r\n\r\n\t\treturn children;\r\n\t}\r\n\r\n\texpandRow(row, silent){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tconfig.open = true;\r\n\r\n\t\t\trow.reinitialize();\r\n\r\n\t\t\tthis.refreshData(true);\r\n\r\n\t\t\tthis.dispatchExternal(\"dataTreeRowExpanded\", row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\t}\r\n\r\n\tcollapseRow(row){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tconfig.open = false;\r\n\r\n\t\t\trow.reinitialize();\r\n\r\n\t\t\tthis.refreshData(true);\r\n\r\n\t\t\tthis.dispatchExternal(\"dataTreeRowCollapsed\", row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\t}\r\n\r\n\ttoggleRow(row){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tif(config.open){\r\n\t\t\t\tthis.collapseRow(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.expandRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tisRowExpanded(row){\r\n\t\treturn row.modules.dataTree.open;\r\n\t}\r\n\r\n\tgetTreeParent(row){\r\n\t\treturn row.modules.dataTree.parent ? row.modules.dataTree.parent.getComponent() : false;\r\n\t}\r\n\r\n\tgetTreeParentRoot(row){\r\n\t\treturn row.modules.dataTree.parent ? this.getTreeParentRoot(row.modules.dataTree.parent) : row;\r\n\t}\r\n\r\n\tgetFilteredTreeChildren(row){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\toutput = [], children;\r\n\r\n\t\tif(config.children){\r\n\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"filter\") && this.table.options.dataTreeFilter){\r\n\t\t\t\tchildren = this.table.modules.filter.filter(config.children);\r\n\t\t\t}else{\r\n\t\t\t\tchildren = config.children;\r\n\t\t\t}\r\n\r\n\t\t\tchildren.forEach((childRow) => {\r\n\t\t\t\tif(childRow instanceof Row){\r\n\t\t\t\t\toutput.push(childRow);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\trowDelete(row){\r\n\t\tvar parent = row.modules.dataTree.parent,\r\n\t\tchildIndex;\r\n\r\n\t\tif(parent){\r\n\t\t\tchildIndex = this.findChildIndex(row, parent);\r\n\r\n\t\t\tif(childIndex !== false){\r\n\t\t\t\tparent.data[this.field].splice(childIndex, 1);\r\n\t\t\t}\r\n\r\n\t\t\tif(!parent.data[this.field].length){\r\n\t\t\t\tdelete parent.data[this.field];\r\n\t\t\t}\r\n\r\n\t\t\tthis.initializeRow(parent);\r\n\t\t\tthis.layoutRow(parent);\r\n\t\t}\r\n\r\n\t\tthis.refreshData(true);\r\n\t}\r\n\r\n\taddTreeChildRow(row, data, top, index){\r\n\t\tvar childIndex = false;\r\n\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\r\n\t\tif(!Array.isArray(row.data[this.field])){\r\n\t\t\trow.data[this.field] = [];\r\n\r\n\t\t\trow.modules.dataTree.open = this.startOpen(row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\r\n\t\tif(typeof index !== \"undefined\"){\r\n\t\t\tchildIndex = this.findChildIndex(index, row);\r\n\r\n\t\t\tif(childIndex !== false){\r\n\t\t\t\trow.data[this.field].splice((top ? childIndex : childIndex + 1), 0, data);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(childIndex === false){\r\n\t\t\tif(top){\r\n\t\t\t\trow.data[this.field].unshift(data);\r\n\t\t\t}else{\r\n\t\t\t\trow.data[this.field].push(data);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.initializeRow(row);\r\n\t\tthis.layoutRow(row);\r\n\r\n\t\tthis.refreshData(true);\r\n\t}\r\n\r\n\tfindChildIndex(subject, parent){\r\n\t\tvar match = false;\r\n\r\n\t\tif(typeof subject == \"object\"){\r\n\r\n\t\t\tif(subject instanceof Row){\r\n\t\t\t\t//subject is row element\r\n\t\t\t\tmatch = subject.data;\r\n\t\t\t}else if(subject instanceof RowComponent){\r\n\t\t\t\t//subject is public row component\r\n\t\t\t\tmatch = subject._getSelf().data;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\t\t\t\tif(parent.modules.dataTree){\r\n\t\t\t\t\tmatch = parent.modules.dataTree.children.find((childRow) => {\r\n\t\t\t\t\t\treturn childRow instanceof Row ? childRow.element === subject : false;\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(match){\r\n\t\t\t\t\t\tmatch = match.data;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}else if(typeof subject == \"undefined\" || subject === null){\r\n\t\t\tmatch = false\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the index of the row\r\n\t\t\tmatch = parent.data[this.field].find((row) => {\r\n\t\t\t\treturn row.data[this.table.options.index] == subject;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(match){\r\n\r\n\t\t\tif(Array.isArray(parent.data[this.field])){\r\n\t\t\t\tmatch = parent.data[this.field].indexOf(match);\r\n\t\t\t}\r\n\r\n\t\t\tif(match == -1){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//catch all for any other type of input\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tgetTreeChildren(row, component, recurse){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\toutput = [];\r\n\r\n\t\tif(config.children){\r\n\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tconfig.children.forEach((childRow) => {\r\n\t\t\t\tif(childRow instanceof Row){\r\n\t\t\t\t\toutput.push(component ? childRow.getComponent() : childRow);\r\n\r\n\t\t\t\t\tif(recurse){\r\n\t\t\t\t\t\toutput = output.concat(this.getTreeChildren(childRow, component, recurse));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetChildField(){\r\n\t\treturn this.field;\r\n\t}\r\n\r\n\tredrawNeeded(data){\r\n\t\treturn (this.field ? typeof data[this.field] !== \"undefined\" : false) || (this.elementField ? typeof data[this.elementField] !== \"undefined\" : false);\r\n\t}\r\n}\r\n\r\nDataTree.moduleName = \"dataTree\";\r\n\r\nexport default DataTree;","import csv from './downloaders/csv.js';\r\nimport json from './downloaders/json.js';\r\nimport pdf from './downloaders/pdf.js';\r\nimport xlsx from './downloaders/xlsx.js';\r\nimport html from './downloaders/html.js';\r\nimport jsonLines from './downloaders/jsonLines.js';\r\n\r\nexport default {\r\n\tcsv:csv,\r\n\tjson:json,\r\n\tjsonLines:jsonLines,\r\n\tpdf:pdf,\r\n\txlsx:xlsx,\r\n\thtml:html,\r\n};","export default function(list, options, setFileContents){\r\n\tvar delimiter = options && options.delimiter ? options.delimiter : \",\",\r\n\tfileContents = [],\r\n\theaders = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tvar item = [];\r\n\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"group\":\r\n\t\t\tconsole.warn(\"Download Warning - CSV downloader cannot process row groups\");\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\tconsole.warn(\"Download Warning - CSV downloader cannot process column calculations\");\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"header\":\r\n\t\t\trow.columns.forEach((col, i) => {\r\n\t\t\t\tif(col && col.depth === 1){\r\n\t\t\t\t\theaders[i] = typeof col.value == \"undefined\" || col.value === null ? \"\" : ('\"' + String(col.value).split('\"').join('\"\"') + '\"');\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\trow.columns.forEach((col) => {\r\n\r\n\t\t\t\tif(col){\r\n\r\n\t\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\tcol.value = JSON.stringify(col.value);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\tcase \"null\":\r\n\t\t\t\t\t\tcol.value = \"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\titem.push('\"' + String(col.value).split('\"').join('\"\"') + '\"');\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tfileContents.push(item.join(delimiter));\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(headers.length){\r\n\t\tfileContents.unshift(headers.join(delimiter));\r\n\t}\r\n\r\n\tfileContents = fileContents.join(\"\\n\");\r\n\r\n\tif(options.bom){\r\n\t\tfileContents = \"\\ufeff\" + fileContents;\r\n\t}\r\n\r\n\tsetFileContents(fileContents, \"text/csv\");\r\n};","export default function(list, options, setFileContents){\r\n\tvar fileContents = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tvar item = {};\r\n\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"header\":\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process row groups\");\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process column calculations\");\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\tif(col){\r\n\t\t\t\t\titem[col.component.getTitleDownload() || col.component.getField()] = col.value;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tfileContents.push(item);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tfileContents = JSON.stringify(fileContents, null, '\\t');\r\n\r\n\tsetFileContents(fileContents, \"application/json\");\r\n};","export default function (list, options, setFileContents) {\r\n\tconst fileContents = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tconst item = {};\r\n\r\n\t\tswitch (row.type) {\r\n\t\t\tcase \"header\":\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process row groups\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process column calculations\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\t\tif (col) {\r\n\t\t\t\t\t\titem[col.component.getTitleDownload() || col.component.getField()] = col.value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tfileContents.push(JSON.stringify(item));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tsetFileContents(fileContents.join(\"\\n\"), \"application/x-ndjson\");\r\n};","export default function(list, options, setFileContents){\r\n\tvar header = [],\r\n\tbody = [],\r\n\tautoTableParams = {},\r\n\trowGroupStyles = options.rowGroupStyles || {\r\n\t\tfontStyle: \"bold\",\r\n\t\tfontSize: 12,\r\n\t\tcellPadding: 6,\r\n\t\tfillColor: 220,\r\n\t},\r\n\trowCalcStyles = options.rowCalcStyles || {\r\n\t\tfontStyle: \"bold\",\r\n\t\tfontSize: 10,\r\n\t\tcellPadding: 4,\r\n\t\tfillColor: 232,\r\n\t},\r\n\tjsPDFParams = options.jsPDF || {},\r\n\ttitle = options && options.title ? options.title : \"\";\r\n\r\n\tif(!jsPDFParams.orientation){\r\n\t\tjsPDFParams.orientation = options.orientation || \"landscape\";\r\n\t}\r\n\r\n\tif(!jsPDFParams.unit){\r\n\t\tjsPDFParams.unit = \"pt\";\r\n\t}\r\n\r\n\t//parse row list\r\n\tlist.forEach((row) => {\r\n\t\tvar item = {};\r\n\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"header\":\r\n\t\t\theader.push(parseRow(row));\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\tbody.push(parseRow(row, rowGroupStyles));\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\tbody.push(parseRow(row, rowCalcStyles));\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\tbody.push(parseRow(row));\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tfunction parseRow(row, styles){\r\n\t\tvar rowData = [];\r\n\r\n\t\trow.columns.forEach((col) =>{\r\n\t\t\tvar cell;\r\n\r\n\t\t\tif(col){\r\n\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\tcol.value = JSON.stringify(col.value);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\tcase \"null\":\r\n\t\t\t\t\tcol.value = \"\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcell = {\r\n\t\t\t\t\tcontent:col.value,\r\n\t\t\t\t\tcolSpan:col.width,\r\n\t\t\t\t\trowSpan:col.height,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tif(styles){\r\n\t\t\t\t\tcell.styles = styles;\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowData.push(cell);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowData;\r\n\t}\r\n\r\n\r\n\t//configure PDF\r\n\tvar doc = new jspdf.jsPDF(jsPDFParams); //set document to landscape, better for most tables\r\n\r\n\tif(options && options.autoTable){\r\n\t\tif(typeof options.autoTable === \"function\"){\r\n\t\t\tautoTableParams = options.autoTable(doc) || {};\r\n\t\t}else{\r\n\t\t\tautoTableParams = options.autoTable;\r\n\t\t}\r\n\t}\r\n\r\n\tif(title){\r\n\t\tautoTableParams.didDrawPage = function(data) {\r\n\t\t\tdoc.text(title, 40, 30);\r\n\t\t};\r\n\t}\r\n\r\n\tautoTableParams.head = header;\r\n\tautoTableParams.body = body;\r\n\r\n\tdoc.autoTable(autoTableParams);\r\n\r\n\tif(options && options.documentProcessing){\r\n\t\toptions.documentProcessing(doc);\r\n\t}\r\n\r\n\tsetFileContents(doc.output(\"arraybuffer\"), \"application/pdf\");\r\n};","import CoreFeature from '../../../../core/CoreFeature.js';\r\n\r\nexport default function(list, options, setFileContents){\r\n\tvar self = this,\r\n\tsheetName = options.sheetName || \"Sheet1\",\r\n\tworkbook = XLSX.utils.book_new(),\r\n\ttableFeatures = new CoreFeature(this),\r\n\toutput;\r\n\r\n\tworkbook.SheetNames = [];\r\n\tworkbook.Sheets = {};\r\n\r\n\tfunction generateSheet(){\r\n\t\tvar rows = [],\r\n\t\tmerges = [],\r\n\t\tworksheet = {},\r\n\t\trange = {s: {c:0, r:0}, e: {c:(list[0] ? list[0].columns.reduce((a, b) => a + (b && b.width ? b.width : 1), 0) : 0), r:list.length }};\r\n\r\n\t\t//parse row list\r\n\t\tlist.forEach((row, i) => {\r\n\t\t\tvar rowData = [];\r\n\r\n\t\t\trow.columns.forEach(function(col, j){\r\n\r\n\t\t\t\tif(col){\r\n\t\t\t\t\trowData.push(!(col.value instanceof Date) && typeof col.value === \"object\" ? JSON.stringify(col.value) : col.value);\r\n\r\n\t\t\t\t\tif(col.width > 1 || col.height > -1){\r\n\t\t\t\t\t\tif(col.height > 1 || col.width > 1){\r\n\t\t\t\t\t\t\tmerges.push({s:{r:i,c:j},e:{r:i + col.height - 1,c:j + col.width - 1}});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\trowData.push(\"\");\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trows.push(rowData);\r\n\t\t});\r\n\r\n\t\t//convert rows to worksheet\r\n\t\tXLSX.utils.sheet_add_aoa(worksheet, rows);\r\n\r\n\t\tworksheet['!ref'] = XLSX.utils.encode_range(range);\r\n\r\n\t\tif(merges.length){\r\n\t\t\tworksheet[\"!merges\"] = merges;\r\n\t\t}\r\n\r\n\t\treturn worksheet;\r\n\t}\r\n\r\n\tif(options.sheetOnly){\r\n\t\tsetFileContents(generateSheet());\r\n\t\treturn;\r\n\t}\r\n\r\n\tif(options.sheets){\r\n\t\tfor(var sheet in options.sheets){\r\n\r\n\t\t\tif(options.sheets[sheet] === true){\r\n\t\t\t\tworkbook.SheetNames.push(sheet);\r\n\t\t\t\tworkbook.Sheets[sheet] = generateSheet();\r\n\t\t\t}else{\r\n\r\n\t\t\t\tworkbook.SheetNames.push(sheet);\r\n\r\n\t\t\t\ttableFeatures.commsSend(options.sheets[sheet], \"download\", \"intercept\",{\r\n\t\t\t\t\ttype:\"xlsx\",\r\n\t\t\t\t\toptions:{sheetOnly:true},\r\n\t\t\t\t\tactive:self.active,\r\n\t\t\t\t\tintercept:function(data){\r\n\t\t\t\t\t\tworkbook.Sheets[sheet] = data;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tworkbook.SheetNames.push(sheetName);\r\n\t\tworkbook.Sheets[sheetName] = generateSheet();\r\n\t}\r\n\r\n\tif(options.documentProcessing){\r\n\t\tworkbook = options.documentProcessing(workbook);\r\n\t}\r\n\r\n\t//convert workbook to binary array\r\n\tfunction s2ab(s) {\r\n\t\tvar buf = new ArrayBuffer(s.length);\r\n\t\tvar view = new Uint8Array(buf);\r\n\t\tfor (var i=0; i!=s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;\r\n\t\t\treturn buf;\r\n\t}\r\n\r\n\toutput = XLSX.write(workbook, {bookType:'xlsx', bookSST:true, type: 'binary'});\r\n\r\n\tsetFileContents(s2ab(output), \"application/octet-stream\");\r\n};","export default function(list, options, setFileContents){\r\n\tif(this.modExists(\"export\", true)){\r\n\t\tsetFileContents(this.modules.export.genereateHTMLTable(list), \"text/html\");\r\n\t}\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultDownloaders from './defaults/downloaders.js';\r\n\r\nclass Download extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.registerTableOption(\"downloadReady\", function(data, blob){return blob;}); //function to manipulate download data\r\n\t\tthis.registerTableOption(\"downloadConfig\", {}); //download config\r\n\t\tthis.registerTableOption(\"downloadRowRange\", \"active\"); //restrict download to active rows only\r\n\r\n\t\tthis.registerColumnOption(\"download\");\r\n\t\tthis.registerColumnOption(\"titleDownload\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"download\", this.download.bind(this));\r\n\t\tthis.registerTableFunction(\"downloadToTab\", this.downloadToTab.bind(this));\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tdownloadToTab(type, filename, options, active){\r\n\t\tthis.download(type, filename, options, active, true);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\t//trigger file download\r\n\tdownload(type, filename, options, range, interceptCallback){\r\n\t\tvar downloadFunc = false;\r\n\r\n\t\tfunction buildLink(data, mime){\r\n\t\t\tif(interceptCallback){\r\n\t\t\t\tif(interceptCallback === true){\r\n\t\t\t\t\tthis.triggerDownload(data, mime, type, filename, true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tinterceptCallback(data);\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tthis.triggerDownload(data, mime, type, filename);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(typeof type == \"function\"){\r\n\t\t\tdownloadFunc = type;\r\n\t\t}else{\r\n\t\t\tif(Download.downloaders[type]){\r\n\t\t\t\tdownloadFunc = Download.downloaders[type];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Download Error - No such download type found: \", type);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(downloadFunc){\r\n\t\t\tvar list = this.generateExportList(range);\r\n\r\n\t\t\tdownloadFunc.call(this.table, list , options || {}, buildLink.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateExportList(range){\r\n\t\tvar list = this.table.modules.export.generateExportList(this.table.options.downloadConfig, false, range || this.table.options.downloadRowRange, \"download\");\r\n\r\n\t\t//assign group header formatter\r\n\t\tvar groupHeader = this.table.options.groupHeaderDownload;\r\n\r\n\t\tif(groupHeader && !Array.isArray(groupHeader)){\r\n\t\t\tgroupHeader = [groupHeader];\r\n\t\t}\r\n\r\n\t\tlist.forEach((row) => {\r\n\t\t\tvar group;\r\n\r\n\t\t\tif(row.type === \"group\"){\r\n\t\t\t\tgroup = row.columns[0];\r\n\r\n\t\t\t\tif(groupHeader && groupHeader[row.indent]){\r\n\t\t\t\t\tgroup.value = groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn list;\r\n\t}\r\n\r\n\ttriggerDownload(data, mime, type, filename, newTab){\r\n\t\tvar element = document.createElement('a'),\r\n\t\tblob = new Blob([data],{type:mime}),\r\n\t\tfilename = filename || \"Tabulator.\" + (typeof type === \"function\" ? \"txt\" : type);\r\n\r\n\t\tblob = this.table.options.downloadReady(data, blob);\r\n\r\n\t\tif(blob){\r\n\r\n\t\t\tif(newTab){\r\n\t\t\t\twindow.open(window.URL.createObjectURL(blob));\r\n\t\t\t}else{\r\n\t\t\t\tif(navigator.msSaveOrOpenBlob){\r\n\t\t\t\t\tnavigator.msSaveOrOpenBlob(blob, filename);\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.setAttribute('href', window.URL.createObjectURL(blob));\r\n\r\n\t\t\t\t\t//set file title\r\n\t\t\t\t\telement.setAttribute('download', filename);\r\n\r\n\t\t\t\t\t//trigger download\r\n\t\t\t\t\telement.style.display = 'none';\r\n\t\t\t\t\tdocument.body.appendChild(element);\r\n\t\t\t\t\telement.click();\r\n\r\n\t\t\t\t\t//remove temporary link element\r\n\t\t\t\t\tdocument.body.removeChild(element);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"downloadComplete\");\r\n\t\t}\r\n\t}\r\n\r\n\tcommsReceived(table, action, data){\r\n\t\tswitch(action){\r\n\t\t\tcase \"intercept\":\r\n\t\t\tthis.download(data.type, \"\", data.options, data.active, data.intercept);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nDownload.moduleName = \"download\";\r\n\r\n//load defaults\r\nDownload.downloaders = defaultDownloaders;\r\n\r\nexport default Download;","export default function maskInput(el, options){\r\n\tvar mask = options.mask,\r\n\tmaskLetter = typeof options.maskLetterChar !== \"undefined\" ? options.maskLetterChar : \"A\",\r\n\tmaskNumber = typeof options.maskNumberChar !== \"undefined\" ? options.maskNumberChar : \"9\",\r\n\tmaskWildcard = typeof options.maskWildcardChar !== \"undefined\" ? options.maskWildcardChar : \"*\",\r\n\tsuccess = false;\r\n\r\n\tfunction fillSymbols(index){\r\n\t\tvar symbol = mask[index];\r\n\t\tif(typeof symbol !== \"undefined\" && symbol !== maskWildcard && symbol !== maskLetter && symbol !== maskNumber){\r\n\t\t\tel.value = el.value + \"\" + symbol;\r\n\t\t\tfillSymbols(index+1);\r\n\t\t}\r\n\t}\r\n\r\n\tel.addEventListener(\"keydown\", (e) => {\r\n\t\tvar index = el.value.length,\r\n\t\tchar = e.key;\r\n\r\n\t\tif(e.keyCode > 46){\r\n\t\t\tif(index >= mask.length){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tsuccess = false;\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\tswitch(mask[index]){\r\n\t\t\t\t\tcase maskLetter:\r\n\t\t\t\t\tif(char.toUpperCase() == char.toLowerCase()){\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\tsuccess = false;\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase maskNumber:\r\n\t\t\t\t\tif(isNaN(char)){\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\tsuccess = false;\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase maskWildcard:\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\tif(char !== mask[index]){\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\tsuccess = false;\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tsuccess = true;\r\n\t\t}\r\n\r\n\t\treturn;\r\n\t});\r\n\r\n\tel.addEventListener(\"keyup\", (e) => {\r\n\t\tif(e.keyCode > 46){\r\n\t\t\tif(options.maskAutoFill){\r\n\t\t\t\tfillSymbols(el.value.length);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\r\n\tif(!el.placeholder){\r\n\t\tel.placeholder = mask;\r\n\t}\r\n\r\n\tif(options.maskAutoFill){\r\n\t\tfillSymbols(el.value.length);\r\n\t}\r\n}","import maskInput from './inputMask.js';\r\nimport urlBuilder from '../Ajax/defaults/urlGenerator.js';\r\n\r\nexport default class Edit{\r\n constructor(editor, cell, onRendered, success, cancel, editorParams){\r\n this.edit = editor;\r\n this.table = editor.table;\r\n this.cell = cell;\r\n this.params = this._initializeParams(editorParams);\r\n \r\n this.data = [];\r\n this.displayItems = [];\r\n this.currentItems = [];\r\n this.focusedItem = null;\r\n \r\n this.input = this._createInputElement();\r\n this.listEl = this._createListElement();\r\n \r\n this.initialValues = null; \r\n \r\n this.isFilter = !cell._getSelf;\r\n \r\n this.filterTimeout = null;\r\n this.filtered = false;\r\n this.typing = false;\r\n \r\n this.values = []; \r\n this.popup = null; \r\n \r\n this.listIteration = 0;\r\n \r\n this.blurable = true;\r\n \r\n this.actions = {\r\n success:success,\r\n cancel:cancel\r\n }\r\n \r\n this._deprecationCheck();\r\n this._initializeValue();\r\n \r\n onRendered(this._onRendered.bind(this));\r\n }\r\n \r\n _deprecationCheck(){\r\n if(this.params.listItemFormatter){\r\n console.warn(\"The listItemFormatter editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n }\r\n \r\n if(this.params.sortValuesList){\r\n console.warn(\"The sortValuesList editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n }\r\n \r\n if(this.params.searchFunc){\r\n console.warn(\"The searchFunc editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n }\r\n \r\n if(this.params.searchingPlaceholder){\r\n console.warn(\"The searchingPlaceholder editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n }\r\n }\r\n \r\n _initializeValue(){\r\n var initialValue = this.cell.getValue();\r\n \r\n if(typeof initialValue === \"undefined\" && typeof this.params.defaultValue !== \"undefined\"){\r\n initialValue = this.params.defaultValue;\r\n }\r\n \r\n this.initialValues = this.params.multiselect ? initialValue : [initialValue];\r\n \r\n if(this.isFilter){\r\n this.input.value = this.initialValues.join(\",\");\r\n this.headerFilterInitialListGen(); \r\n }\r\n }\r\n \r\n _onRendered(){\r\n var cellEl = this.cell.getElement();\r\n \r\n function clickStop(e){\r\n e.stopPropagation();\r\n }\r\n \r\n this.input.style.height = \"100%\";\r\n this.input.focus({preventScroll: true});\r\n \r\n \r\n cellEl.addEventListener(\"click\", clickStop);\r\n \r\n setTimeout(() => {\r\n cellEl.removeEventListener(\"click\", clickStop);\r\n }, 1000)\r\n }\r\n \r\n _createListElement(){\r\n var listEl = document.createElement(\"div\");\r\n listEl.classList.add(\"tabulator-edit-list\");\r\n \r\n listEl.addEventListener(\"mousedown\", this._preventBlur.bind(this));\r\n listEl.addEventListener(\"keydown\", this._inputKeyDown.bind(this))\r\n \r\n return listEl;\r\n }\r\n \r\n _setListWidth(){\r\n var element = this.isFilter ? this.input : this.cell.getElement();\r\n \r\n this.listEl.style.minWidth = element.offsetWidth + \"px\";\r\n \r\n if(this.params.maxWidth){\r\n if(this.params.maxWidth === true){\r\n this.listEl.style.maxWidth = element.offsetWidth + \"px\";\r\n }else if(typeof this.params.maxWidth === \"number\"){\r\n this.listEl.style.maxWidth = this.params.maxWidth + \"px\";\r\n }else{\r\n this.listEl.style.maxWidth = this.params.maxWidth;\r\n }\r\n }\r\n \r\n }\r\n \r\n _createInputElement(){\r\n var attribs = this.params.elementAttributes;\r\n var input = document.createElement(\"input\");\r\n \r\n input.setAttribute(\"type\", this.params.clearable ? \"search\" : \"text\");\r\n \r\n input.style.padding = \"4px\";\r\n input.style.width = \"100%\";\r\n input.style.boxSizing = \"border-box\";\r\n \r\n if(!this.params.autocomplete){\r\n input.style.cursor = \"default\";\r\n input.style.caretColor = \"transparent\";\r\n // input.readOnly = (this.edit.currentCell != false);\r\n }\r\n \r\n if(attribs && typeof attribs == \"object\"){\r\n for (let key in attribs){\r\n if(key.charAt(0) == \"+\"){\r\n key = key.slice(1);\r\n input.setAttribute(key, input.getAttribute(key) + attribs[\"+\" + key]);\r\n }else{\r\n input.setAttribute(key, attribs[key]);\r\n }\r\n }\r\n }\r\n \r\n if(this.params.mask){\r\n maskInput(input, this.params);\r\n }\r\n \r\n this._bindInputEvents(input);\r\n \r\n return input;\r\n }\r\n \r\n _initializeParams(params){\r\n var valueKeys = [\"values\", \"valuesURL\", \"valuesLookup\"],\r\n valueCheck;\r\n\r\n params = Object.assign({}, params);\r\n \r\n params.verticalNavigation = params.verticalNavigation || \"editor\";\r\n params.placeholderLoading = typeof params.placeholderLoading === \"undefined\" ? \"Searching ...\" : params.placeholderLoading;\r\n params.placeholderEmpty = typeof params.placeholderEmpty === \"undefined\" ? \"No Results Found\" : params.placeholderEmpty;\r\n params.filterDelay = typeof params.filterDelay === \"undefined\" ? 300 : params.filterDelay;\r\n \r\n params.emptyValue = Object.keys(params).includes(\"emptyValue\") ? params.emptyValue : \"\";\r\n\r\n valueCheck = Object.keys(params).filter(key => valueKeys.includes(key)).length;\r\n\r\n if(!valueCheck){\r\n console.warn(\"list editor config error - either the values, valuesURL, or valuesLookup option must be set\")\r\n }else if(valueCheck > 1){\r\n console.warn(\"list editor config error - only one of the values, valuesURL, or valuesLookup options can be set on the same editor\")\r\n }\r\n \r\n if(params.autocomplete){\r\n if(params.multiselect){\r\n params.multiselect = false;\r\n console.warn(\"list editor config error - multiselect option is not available when autocomplete is enabled\")\r\n }\r\n }else{\r\n if(params.freetext){\r\n params.freetext = false;\r\n console.warn(\"list editor config error - freetext option is only available when autocomplete is enabled\");\r\n }\r\n \r\n if(params.filterFunc){\r\n params.filterFunc = false;\r\n console.warn(\"list editor config error - filterFunc option is only available when autocomplete is enabled\");\r\n }\r\n \r\n if(params.filterRemote){\r\n params.filterRemote = false;\r\n console.warn(\"list editor config error - filterRemote option is only available when autocomplete is enabled\");\r\n }\r\n \r\n if(params.mask){\r\n params.mask = false;\r\n console.warn(\"list editor config error - mask option is only available when autocomplete is enabled\");\r\n }\r\n \r\n if(params.allowEmpty){\r\n params.allowEmpty = false;\r\n console.warn(\"list editor config error - allowEmpty option is only available when autocomplete is enabled\");\r\n }\r\n \r\n if(params.listOnEmpty){\r\n params.listOnEmpty = false;\r\n console.warn(\"list editor config error - listOnEmpty option is only available when autocomplete is enabled\");\r\n }\r\n }\r\n \r\n if(params.filterRemote && !(typeof params.valuesLookup === \"function\" || typeof params.valuesURL)){\r\n params.filterRemote = false;\r\n console.warn(\"list editor config error - filterRemote option should only be used when values list is populated from a remote source\");\r\n }\r\n return params;\r\n }\r\n //////////////////////////////////////\r\n ////////// Event Handling ////////////\r\n //////////////////////////////////////\r\n \r\n _bindInputEvents(input){\r\n input.addEventListener(\"focus\", this._inputFocus.bind(this))\r\n input.addEventListener(\"click\", this._inputClick.bind(this))\r\n input.addEventListener(\"blur\", this._inputBlur.bind(this))\r\n input.addEventListener(\"keydown\", this._inputKeyDown.bind(this))\r\n input.addEventListener(\"search\", this._inputSearch.bind(this))\r\n \r\n if(this.params.autocomplete){\r\n input.addEventListener(\"keyup\", this._inputKeyUp.bind(this))\r\n }\r\n }\r\n \r\n \r\n _inputFocus(e){\r\n this.rebuildOptionsList();\r\n }\r\n \r\n _filter(){\r\n if(this.params.filterRemote){\r\n clearTimeout(this.filterTimeout);\r\n \r\n this.filterTimeout = setTimeout(() => {\r\n this.rebuildOptionsList();\r\n }, this.params.filterDelay);\r\n }else{\r\n this._filterList();\r\n }\r\n }\r\n \r\n _inputClick(e){\r\n e.stopPropagation();\r\n }\r\n \r\n _inputBlur(e){\r\n if(this.blurable && this.popup){\r\n this.popup.hide();\r\n }\r\n }\r\n \r\n _inputSearch(){\r\n this._clearChoices();\r\n }\r\n \r\n _inputKeyDown(e){\r\n switch(e.keyCode){\r\n \r\n case 38: //up arrow\r\n this._keyUp(e);\r\n break\r\n \r\n case 40: //down arrow\r\n this._keyDown(e);\r\n break;\r\n \r\n case 37: //left arrow\r\n case 39: //right arrow\r\n this._keySide(e);\r\n break;\r\n \r\n case 13: //enter\r\n this._keyEnter();\r\n break;\r\n \r\n case 27: //escape\r\n this._keyEsc();\r\n break;\r\n \r\n case 36: //home\r\n case 35: //end\r\n this._keyHomeEnd(e);\r\n break;\r\n \r\n case 9: //tab\r\n break;\r\n \r\n default:\r\n this._keySelectLetter(e);\r\n }\r\n }\r\n \r\n _inputKeyUp(e){\r\n switch(e.keyCode){\r\n case 38: //up arrow\r\n case 37: //left arrow\r\n case 39: //up arrow\r\n case 40: //right arrow\r\n case 13: //enter\r\n case 27: //escape\r\n break;\r\n \r\n default:\r\n this._keyAutoCompLetter(e);\r\n }\r\n }\r\n \r\n _preventBlur(){\r\n this.blurable = false;\r\n \r\n setTimeout(function(){\r\n this.blurable = true;\r\n }, 10);\r\n }\r\n \r\n //////////////////////////////////////\r\n //////// Keyboard Navigation /////////\r\n //////////////////////////////////////\r\n \r\n _keyUp(e){\r\n var index = this.displayItems.indexOf(this.focusedItem);\r\n \r\n if(this.params.verticalNavigation == \"editor\" || (this.params.verticalNavigation == \"hybrid\" && index)){\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n e.preventDefault();\r\n \r\n if(index > 0){\r\n this._focusItem(this.displayItems[index - 1]);\r\n }\r\n }\r\n }\r\n \r\n _keyDown(e){\r\n var index = this.displayItems.indexOf(this.focusedItem);\r\n \r\n if(this.params.verticalNavigation == \"editor\" || (this.params.verticalNavigation == \"hybrid\" && index < this.displayItems.length - 1)){\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n e.preventDefault();\r\n \r\n if(index < this.displayItems.length - 1){\r\n if(index == -1){\r\n this._focusItem(this.displayItems[0]);\r\n }else{\r\n this._focusItem(this.displayItems[index + 1]);\r\n }\r\n }\r\n }\r\n }\r\n \r\n _keySide(e){\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n e.preventDefault();\r\n }\r\n \r\n _keyEnter(e){\r\n if(this.focusedItem){\r\n this._chooseItem(this.focusedItem);\r\n }else{\r\n this._cancel();\r\n }\r\n }\r\n \r\n _keyEsc(e){\r\n this._cancel();\r\n }\r\n \r\n _keyHomeEnd(e){\r\n if(this.params.autocomplete){\r\n //prevent table navigation while using input element\r\n e.stopImmediatePropagation();\r\n }\r\n }\r\n \r\n _keySelectLetter(e){\r\n if(!this.params.autocomplete){\r\n // if(this.edit.currentCell === false){\r\n e.preventDefault();\r\n // }\r\n \r\n if(e.keyCode >= 38 && e.keyCode <= 90){\r\n this._scrollToValue(e.keyCode);\r\n }\r\n }\r\n }\r\n \r\n _keyAutoCompLetter(e){\r\n this._filter();\r\n this.typing = true;\r\n }\r\n \r\n \r\n _scrollToValue(char){\r\n clearTimeout(this.filterTimeout);\r\n \r\n var character = String.fromCharCode(char).toLowerCase();\r\n this.filterTerm += character.toLowerCase();\r\n \r\n var match = this.displayItems.find((item) => {\r\n return typeof item.label !== \"undefined\" && item.label.toLowerCase().startsWith(this.filterTerm);\r\n });\r\n \r\n if(match){\r\n this._focusItem(match);\r\n }\r\n \r\n this.filterTimeout = setTimeout(() => {\r\n this.filterTerm = \"\";\r\n }, 800)\r\n }\r\n \r\n _focusItem(item){\r\n if(this.focusedItem && this.focusedItem.element){\r\n this.focusedItem.element.classList.remove(\"focused\");\r\n }\r\n \r\n this.focusedItem = item;\r\n \r\n if(item && item.element){\r\n item.element.classList.add(\"focused\");\r\n item.element.scrollIntoView({behavior: 'smooth', block: 'nearest', inline: 'start'});\r\n }\r\n }\r\n \r\n \r\n //////////////////////////////////////\r\n /////// Data List Generation /////////\r\n //////////////////////////////////////\r\n headerFilterInitialListGen(){\r\n this._generateOptions(true);\r\n }\r\n \r\n rebuildOptionsList(){\r\n this._generateOptions()\r\n .then(this._sortOptions.bind(this))\r\n .then(this._buildList.bind(this))\r\n .then(this._showList.bind(this))\r\n .catch((e) => {\r\n if(!Number.isInteger(e)){\r\n console.error(\"List generation error\", e);\r\n }\r\n })\r\n }\r\n \r\n _filterList(){\r\n this._buildList(this._filterOptions());\r\n this._showList();\r\n }\r\n \r\n _generateOptions(silent){\r\n var values = [];\r\n var itteration = ++ this.listIteration;\r\n \r\n this.filtered = false;\r\n \r\n if(this.params.values){\r\n values = this.params.values;\r\n }else if (this.params.valuesURL){\r\n values = this._ajaxRequest(this.params.valuesURL, this.input.value);\r\n }else{\r\n if(typeof this.params.valuesLookup === \"function\"){\r\n values = this.params.valuesLookup(this.cell, this.input.value);\r\n }else if(this.params.valuesLookup){\r\n values = this._uniqueColumnValues(this.params.valuesLookupField);\r\n }\r\n }\r\n \r\n if(values instanceof Promise){\r\n if(!silent){\r\n this._addPlaceholder(this.params.placeholderLoading);\r\n }\r\n \r\n return values.then()\r\n .then((responseValues) => {\r\n if(this.listIteration === itteration){\r\n return this._parseList(responseValues);\r\n }else{\r\n return Promise.reject(itteration);\r\n }\r\n });\r\n }else{\r\n return Promise.resolve(this._parseList(values))\r\n }\r\n }\r\n \r\n _addPlaceholder(contents){\r\n var placeholder = document.createElement(\"div\");\r\n \r\n if(typeof contents === \"function\"){\r\n contents = contents(cell.getComponent(), this.listEl);\r\n }\r\n \r\n if(contents){\r\n this._clearList();\r\n \r\n if(contents instanceof HTMLElement){\r\n placeholder = contents;\r\n }else{\r\n placeholder.classList.add(\"tabulator-edit-list-placeholder\")\r\n placeholder.innerHTML = contents;\r\n }\r\n \r\n this.listEl.appendChild(placeholder);\r\n \r\n this._showList();\r\n }\r\n }\r\n \r\n _ajaxRequest(url, term){\r\n var params = this.params.filterRemote ? {term:term} : {};\r\n url = urlBuilder(url, {}, params);\r\n \r\n return fetch(url)\r\n .then((response)=>{\r\n if(response.ok) {\r\n return response.json()\r\n .catch((error)=>{\r\n console.warn(\"List Ajax Load Error - Invalid JSON returned\", error);\r\n return Promise.reject(error);\r\n });\r\n }else{\r\n console.error(\"List Ajax Load Error - Connection Error: \" + response.status, response.statusText);\r\n return Promise.reject(response);\r\n }\r\n })\r\n .catch((error)=>{\r\n console.error(\"List Ajax Load Error - Connection Error: \", error);\r\n return Promise.reject(error);\r\n });\r\n }\r\n \r\n _uniqueColumnValues(field){\r\n var output = {},\r\n data = this.table.getData(this.params.valuesLookup),\r\n column;\r\n \r\n if(field){\r\n column = this.table.columnManager.getColumnByField(field);\r\n }else{\r\n column = this.cell.getColumn()._getSelf();\r\n }\r\n \r\n if(column){\r\n data.forEach((row) => {\r\n var val = column.getFieldValue(row);\r\n \r\n if(val !== null && typeof val !== \"undefined\" && val !== \"\"){\r\n output[val] = true;\r\n }\r\n });\r\n }else{\r\n console.warn(\"unable to find matching column to create select lookup list:\", field);\r\n output = [];\r\n }\r\n \r\n return Object.keys(output);\r\n }\r\n \r\n \r\n _parseList(inputValues){\r\n var data = [];\r\n \r\n if(!Array.isArray(inputValues)){\r\n inputValues = Object.entries(inputValues).map(([key, value]) => {\r\n return {\r\n label:value,\r\n value:key,\r\n };\r\n });\r\n }\r\n \r\n inputValues.forEach((value) => {\r\n if(typeof value !== \"object\"){\r\n value = {\r\n label:value,\r\n value:value,\r\n };\r\n }\r\n \r\n this._parseListItem(value, data, 0);\r\n });\r\n \r\n this.data = data;\r\n \r\n return data; \r\n }\r\n \r\n _parseListItem(option, data, level){\r\n var item = {};\r\n \r\n if(option.options){\r\n item = this._parseListGroup(option, level + 1);\r\n }else{\r\n item = {\r\n label:option.label,\r\n value:option.value,\r\n itemParams:option.itemParams,\r\n elementAttributes: option.elementAttributes,\r\n element:false,\r\n selected:false,\r\n visible:true,\r\n level:level,\r\n original:option,\r\n };\r\n \r\n if(this.initialValues && this.initialValues.indexOf(option.value) > -1){\r\n this._chooseItem(item, true);\r\n }\r\n }\r\n \r\n data.push(item);\r\n }\r\n \r\n _parseListGroup(option, level){\r\n var item = {\r\n label:option.label,\r\n group:true,\r\n itemParams:option.itemParams,\r\n elementAttributes:option.elementAttributes,\r\n element:false,\r\n visible:true,\r\n level:level,\r\n options:[],\r\n original:option,\r\n };\r\n \r\n option.options.forEach((child) => {\r\n this._parseListItem(child, item.options, level);\r\n });\r\n \r\n return item;\r\n }\r\n \r\n _sortOptions(options){\r\n var sorter;\r\n \r\n if(this.params.sort){\r\n sorter = typeof this.params.sort === \"function\" ? this.params.sort : this._defaultSortFunction.bind(this);\r\n \r\n this._sortGroup(sorter, options);\r\n }\r\n \r\n return options;\r\n }\r\n \r\n _sortGroup(sorter, options){\r\n options.sort((a,b) => {\r\n return sorter(a.label, b.label, a.value, b.value, a.original, b.original);\r\n });\r\n \r\n options.forEach((option) => {\r\n if(option.group){\r\n this._sortGroup(sorter, option.options);\r\n }\r\n })\r\n }\r\n \r\n _defaultSortFunction(as, bs){\r\n var a, b, a1, b1, i= 0, L, rx = /(\\d+)|(\\D+)/g, rd = /\\d/;\r\n var emptyAlign = 0;\r\n \r\n if(this.params.sort === \"desc\"){\r\n [as, bs] = [bs, as];\r\n }\r\n \r\n //handle empty values\r\n if(!as && as!== 0){\r\n emptyAlign = !bs && bs!== 0 ? 0 : -1;\r\n }else if(!bs && bs!== 0){\r\n emptyAlign = 1;\r\n }else{\r\n if(isFinite(as) && isFinite(bs)) return as - bs;\r\n a = String(as).toLowerCase();\r\n b = String(bs).toLowerCase();\r\n if(a === b) return 0;\r\n if(!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1;\r\n a = a.match(rx);\r\n b = b.match(rx);\r\n L = a.length > b.length ? b.length : a.length;\r\n while(i < L){\r\n a1= a[i];\r\n b1= b[i++];\r\n if(a1 !== b1){\r\n if(isFinite(a1) && isFinite(b1)){\r\n if(a1.charAt(0) === \"0\") a1 = \".\" + a1;\r\n if(b1.charAt(0) === \"0\") b1 = \".\" + b1;\r\n return a1 - b1;\r\n }\r\n else return a1 > b1 ? 1 : -1;\r\n }\r\n }\r\n \r\n return a.length > b.length;\r\n }\r\n \r\n return emptyAlign;\r\n }\r\n \r\n _filterOptions(){\r\n var filterFunc = this.params.filterFunc || this._defaultFilterFunc;\r\n var term = this.input.value;\r\n var results = [];\r\n \r\n if(term){\r\n this.filtered = true;\r\n \r\n this.data.forEach((item) => {\r\n this._filterItem(filterFunc, term, item);\r\n });\r\n }else{\r\n this.filtered = false;\r\n }\r\n \r\n return this.data;\r\n }\r\n \r\n _filterItem(func, term, item){\r\n var matches = false;\r\n \r\n if(!item.group){\r\n item.visible = func(term, item.label, item.value, item.original);\r\n }else{\r\n item.options.forEach((option) => {\r\n if(this._filterItem(func, term, option)){\r\n matches = true;\r\n }\r\n });\r\n \r\n item.visible = matches;\r\n }\r\n \r\n return item.visible;\r\n }\r\n \r\n _defaultFilterFunc(term, label, value, item){\r\n var term = String(term).toLowerCase();\r\n \r\n if(label !== null || typeof label !== \"undefined\"){\r\n if(String(label).toLowerCase().indexOf(term) > -1 || String(value).toLowerCase(term).indexOf() > -1){\r\n return true;\r\n }\r\n }\r\n \r\n return false;\r\n }\r\n \r\n //////////////////////////////////////\r\n /////////// Display List /////////////\r\n //////////////////////////////////////\r\n \r\n _clearList(){\r\n while(this.listEl.firstChild) this.listEl.removeChild(this.listEl.firstChild);\r\n \r\n this.displayItems = [];\r\n }\r\n \r\n _buildList(data){\r\n this._clearList();\r\n \r\n data.forEach((option) => {\r\n this._buildItem(option);\r\n });\r\n \r\n if(!this.displayItems.length){\r\n this._addPlaceholder(this.params.placeholderEmpty);\r\n } \r\n }\r\n \r\n _buildItem(item){\r\n var el = item.element,\r\n contents;\r\n \r\n if(!this.filtered || item.visible){\r\n \r\n if(!el){\r\n el = document.createElement(\"div\");\r\n el.tabIndex = 0;\r\n \r\n contents = this.params.itemFormatter ? this.params.itemFormatter(item.label, item.value, item.original, el) : item.label;\r\n \r\n if(contents instanceof HTMLElement){\r\n el.appendChild(contents)\r\n }else{\r\n el.innerHTML = contents;\r\n }\r\n \r\n if(item.group){\r\n el.classList.add(\"tabulator-edit-list-group\");\r\n }else{\r\n el.classList.add(\"tabulator-edit-list-item\");\r\n }\r\n \r\n el.classList.add(\"tabulator-edit-list-group-level-\" + item.level);\r\n \r\n if(item.elementAttributes && typeof item.elementAttributes == \"object\"){\r\n for (let key in item.elementAttributes){\r\n if(key.charAt(0) == \"+\"){\r\n key = key.slice(1);\r\n el.setAttribute(key, this.input.getAttribute(key) + item.elementAttributes[\"+\" + key]);\r\n }else{\r\n el.setAttribute(key, item.elementAttributes[key]);\r\n }\r\n }\r\n }\r\n \r\n if(item.group){\r\n el.addEventListener(\"click\", this._groupClick.bind(this, item));\r\n }else{\r\n el.addEventListener(\"click\", this._itemClick.bind(this, item));\r\n }\r\n \r\n el.addEventListener(\"mousedown\", this._preventBlur.bind(this));\r\n \r\n item.element = el;\r\n }\r\n \r\n this._styleItem(item);\r\n \r\n this.listEl.appendChild(el);\r\n \r\n if(item.group){\r\n item.options.forEach((option) => {\r\n this._buildItem(option);\r\n });\r\n }else{\r\n this.displayItems.push(item);\r\n }\r\n }\r\n }\r\n \r\n _showList(){\r\n var startVis = this.popup && this.popup.isVisible();\r\n \r\n if(this.input.parentNode){\r\n if(this.params.autocomplete && this.input.value === \"\" && !this.params.listOnEmpty){\r\n if(this.popup){\r\n this.popup.hide(true);\r\n return;\r\n }\r\n }\r\n \r\n this._setListWidth();\r\n \r\n if(!this.popup){\r\n this.popup = this.edit.popup(this.listEl);\r\n }\r\n \r\n this.popup.show(this.cell.getElement(), \"bottom\")\r\n \r\n if(!startVis){\r\n this.popup.hideOnBlur(this._resolveValue.bind(this, true));\r\n }\r\n }\r\n }\r\n \r\n _styleItem(item){\r\n if(item && item.element){\r\n if(item.selected){\r\n item.element.classList.add(\"active\");\r\n }else{\r\n item.element.classList.remove(\"active\");\r\n }\r\n }\r\n }\r\n \r\n //////////////////////////////////////\r\n ///////// User Interaction ///////////\r\n //////////////////////////////////////\r\n \r\n _itemClick(item, e){\r\n e.stopPropagation();\r\n \r\n this._chooseItem(item);\r\n }\r\n \r\n _groupClick(item, e){\r\n e.stopPropagation();\r\n }\r\n \r\n \r\n //////////////////////////////////////\r\n ////// Current Item Management ///////\r\n //////////////////////////////////////\r\n \r\n _cancel(){\r\n this.popup.hide(true);\r\n this.actions.cancel();\r\n }\r\n \r\n _clearChoices(){\r\n this.typing = true;\r\n \r\n this.currentItems.forEach((item) => {\r\n item.selected = false;\r\n this._styleItem(item);\r\n });\r\n \r\n this.currentItems = [];\r\n \r\n this.focusedItem = null;\r\n }\r\n \r\n _chooseItem(item, silent){\r\n var index;\r\n \r\n this.typing = false;\r\n \r\n if(this.params.multiselect){\r\n index = this.currentItems.indexOf(item);\r\n \r\n if(index > -1){\r\n this.currentItems.splice(index, 1);\r\n item.selected = false;\r\n }else{\r\n this.currentItems.push(item);\r\n item.selected = true;\r\n }\r\n \r\n this.input.value = this.currentItems.map(item => item.label).join(\",\");\r\n \r\n this._styleItem(item);\r\n \r\n }else{\r\n this.currentItems = [item];\r\n item.selected = true;\r\n \r\n this.input.value = item.label;\r\n \r\n this._styleItem(item);\r\n \r\n if(!silent){\r\n this._resolveValue();\r\n }\r\n }\r\n \r\n this._focusItem(item);\r\n }\r\n \r\n _resolveValue(blur){\r\n var output, initialValue;\r\n \r\n this.popup.hide(true);\r\n \r\n if(this.params.multiselect){\r\n output = this.currentItems.map(item => item.value);\r\n }else{\r\n if(blur && this.params.autocomplete && this.typing){\r\n if(this.params.freetext || (this.params.allowEmpty && this.input.value === \"\")){\r\n output = this.input.value;\r\n }else{\r\n this.actions.cancel();\r\n return;\r\n }\r\n }else{\r\n if(this.currentItems[0]){\r\n output = this.currentItems[0].value;\r\n }else{\r\n initialValue = this.initialValues[0];\r\n \r\n if(initialValue === null || typeof initialValue === \"undefined\" || initialValue === \"\"){\r\n output = initialValue;\r\n }else{\r\n output = this.params.emptyValue;\r\n }\r\n }\r\n \r\n }\r\n }\r\n \r\n if(output === \"\"){\r\n output = this.params.emptyValue;\r\n }\r\n \r\n this.actions.success(output);\r\n \r\n if(this.isFilter){\r\n this.initialValues = output && !Array.isArray[output] ? [output] : output;\r\n }\r\n }\r\n \r\n}\r\n","import input from './editors/input.js';\r\nimport textarea from './editors/textarea.js';\r\nimport number from './editors/number.js';\r\nimport range from './editors/range.js';\r\nimport select from './editors/select.js';\r\nimport list from './editors/list.js';\r\nimport autocomplete from './editors/autocomplete.js';\r\nimport star from './editors/star.js';\r\nimport progress from './editors/progress.js';\r\nimport tickCross from './editors/tickCross.js';\r\n\r\nexport default {\r\n\tinput:input,\r\n\ttextarea:textarea,\r\n number:number,\r\n range:range,\r\n\tselect:select,\r\n\tlist:list,\r\n\tautocomplete:autocomplete,\r\n\tstar:star,\r\n\tprogress:progress,\r\n\ttickCross:tickCross,\r\n};","import maskInput from '../../inputMask.js';\r\n\r\n//input element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\t//create and style input\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", editorParams.search ? \"search\" : \"text\");\r\n\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = typeof cellValue !== \"undefined\" ? cellValue : \"\";\r\n\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\r\n\tfunction onChange(e){\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && input.value !== \"\") || input.value !== cellValue){\r\n\t\t\tif(success(input.value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t// case 9:\r\n\t\t\tcase 13:\r\n\t\t\tonChange(e);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\tcancel();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\te.stopPropagation();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(editorParams.mask){\r\n\t\tmaskInput(input, editorParams);\r\n\t}\r\n\r\n\treturn input;\r\n};","import maskInput from '../../inputMask.js';\r\n\r\n//resizable text area element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n var self = this,\r\n cellValue = cell.getValue(),\r\n vertNav = editorParams.verticalNavigation || \"hybrid\",\r\n value = String(cellValue !== null && typeof cellValue !== \"undefined\" ? cellValue : \"\"),\r\n count = (value.match(/(?:\\r\\n|\\r|\\n)/g) || []).length + 1,\r\n input = document.createElement(\"textarea\"),\r\n scrollHeight = 0;\r\n\r\n //create and style input\r\n input.style.display = \"block\";\r\n input.style.padding = \"2px\";\r\n input.style.height = \"100%\";\r\n input.style.width = \"100%\";\r\n input.style.boxSizing = \"border-box\";\r\n input.style.whiteSpace = \"pre-wrap\";\r\n input.style.resize = \"none\";\r\n\r\n if(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n for (let key in editorParams.elementAttributes){\r\n if(key.charAt(0) == \"+\"){\r\n key = key.slice(1);\r\n input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n }else{\r\n input.setAttribute(key, editorParams.elementAttributes[key]);\r\n }\r\n }\r\n }\r\n\r\n input.value = value;\r\n\r\n onRendered(function(){\r\n input.focus({preventScroll: true});\r\n input.style.height = \"100%\";\r\n\r\n input.scrollHeight;\r\n input.style.height = input.scrollHeight + \"px\";\r\n cell.getRow().normalizeHeight();\r\n\r\n if(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n });\r\n\r\n function onChange(e){\r\n\r\n if(((cellValue === null || typeof cellValue === \"undefined\") && input.value !== \"\") || input.value !== cellValue){\r\n\r\n if(success(input.value)){\r\n cellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n }\r\n\r\n setTimeout(function(){\r\n cell.getRow().normalizeHeight();\r\n },300)\r\n }else{\r\n cancel();\r\n }\r\n }\r\n\r\n //submit new value on blur or change\r\n input.addEventListener(\"change\", onChange);\r\n input.addEventListener(\"blur\", onChange);\r\n\r\n input.addEventListener(\"keyup\", function(){\r\n\r\n input.style.height = \"\";\r\n\r\n var heightNow = input.scrollHeight;\r\n\r\n input.style.height = heightNow + \"px\";\r\n\r\n if(heightNow != scrollHeight){\r\n scrollHeight = heightNow;\r\n cell.getRow().normalizeHeight();\r\n }\r\n });\r\n\r\n input.addEventListener(\"keydown\", function(e){\r\n\r\n switch(e.keyCode){\r\n case 27:\r\n cancel();\r\n break;\r\n\r\n case 38: //up arrow\r\n if(vertNav == \"editor\" || (vertNav == \"hybrid\" && input.selectionStart)){\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n }\r\n\r\n break;\r\n\r\n case 40: //down arrow\r\n if(vertNav == \"editor\" || (vertNav == \"hybrid\" && input.selectionStart !== input.value.length)){\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n }\r\n break;\r\n\r\n case 35:\r\n case 36:\r\n e.stopPropagation();\r\n break;\r\n }\r\n });\r\n\r\n if(editorParams.mask){\r\n maskInput(input, editorParams);\r\n }\r\n\r\n return input;\r\n};","import maskInput from '../../inputMask.js';\r\n\r\n//input element with type of number\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar cellValue = cell.getValue(),\r\n\tvertNav = editorParams.verticalNavigation || \"editor\",\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", \"number\");\r\n\r\n\tif(typeof editorParams.max != \"undefined\"){\r\n\t\tinput.setAttribute(\"max\", editorParams.max);\r\n\t}\r\n\r\n\tif(typeof editorParams.min != \"undefined\"){\r\n\t\tinput.setAttribute(\"min\", editorParams.min);\r\n\t}\r\n\r\n\tif(typeof editorParams.step != \"undefined\"){\r\n\t\tinput.setAttribute(\"step\", editorParams.step);\r\n\t}\r\n\r\n\t//create and style input\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\r\n\tvar blurFunc = function(e){\r\n\t\tonChange();\r\n\t};\r\n\r\n\tonRendered(function () {\r\n\t\t//submit new value on blur\r\n\t\tinput.removeEventListener(\"blur\", blurFunc);\r\n\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\r\n\t\t//submit new value on blur\r\n\t\tinput.addEventListener(\"blur\", blurFunc);\r\n\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\r\n\tfunction onChange(){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(!isNaN(value) && value !==\"\"){\r\n\t\t\tvalue = Number(value);\r\n\t\t}\r\n\r\n\t\tif(value !== cellValue){\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 13:\r\n\t\t\t// case 9:\r\n\t\t\tonChange();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\tcancel();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 38: //up arrow\r\n\t\t\tcase 40: //down arrow\r\n\t\t\tif(vertNav == \"editor\"){\r\n\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\te.stopPropagation();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(editorParams.mask){\r\n\t\tmaskInput(input, editorParams);\r\n\t}\r\n\r\n\treturn input;\r\n};","//input element with type of number\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", \"range\");\r\n\r\n\tif (typeof editorParams.max != \"undefined\") {\r\n\t\tinput.setAttribute(\"max\", editorParams.max);\r\n\t}\r\n\r\n\tif (typeof editorParams.min != \"undefined\") {\r\n\t\tinput.setAttribute(\"min\", editorParams.min);\r\n\t}\r\n\r\n\tif (typeof editorParams.step != \"undefined\") {\r\n\t\tinput.setAttribute(\"step\", editorParams.step);\r\n\t}\r\n\r\n\t//create and style input\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\r\n\tonRendered(function () {\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\t});\r\n\r\n\tfunction onChange(){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(!isNaN(value) && value !==\"\"){\r\n\t\t\tvalue = Number(value);\r\n\t\t}\r\n\r\n\t\tif(value != cellValue){\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur\r\n\tinput.addEventListener(\"blur\", function(e){\r\n\t\tonChange();\r\n\t});\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 13:\r\n\t\t\t// case 9:\r\n\t\t\tonChange();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\tcancel();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\treturn input;\r\n};","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\r\n\t console.warn(\"The select editor has been deprecated, please use the new list editor\");\r\n\r\n var list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n return list.input;\r\n}","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n var list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n return list.input;\r\n}","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\r\n\tconsole.warn(\"The autocomplete editor has been deprecated, please use the new list editor with the 'autocomplete' editorParam\");\r\n\r\n\teditorParams.autocomplete = true;\r\n\r\n var list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n return list.input;\r\n}","//star rating\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar self = this,\r\n\telement = cell.getElement(),\r\n\tvalue = cell.getValue(),\r\n\tmaxStars = element.getElementsByTagName(\"svg\").length || 5,\r\n\tsize = element.getElementsByTagName(\"svg\")[0] ? element.getElementsByTagName(\"svg\")[0].getAttribute(\"width\") : 14,\r\n\tstars = [],\r\n\tstarsHolder = document.createElement(\"div\"),\r\n\tstar = document.createElementNS('http://www.w3.org/2000/svg', \"svg\");\r\n\r\n\r\n\t//change star type\r\n\tfunction starChange(val){\r\n\t\tstars.forEach(function(star, i){\r\n\t\t\tif(i < val){\r\n\t\t\t\tif(self.table.browser == \"ie\"){\r\n\t\t\t\t\tstar.setAttribute(\"class\", \"tabulator-star-active\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tstar.classList.replace(\"tabulator-star-inactive\", \"tabulator-star-active\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstar.innerHTML = '';\r\n\t\t\t}else{\r\n\t\t\t\tif(self.table.browser == \"ie\"){\r\n\t\t\t\t\tstar.setAttribute(\"class\", \"tabulator-star-inactive\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tstar.classList.replace(\"tabulator-star-active\", \"tabulator-star-inactive\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstar.innerHTML = '';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//build stars\r\n\tfunction buildStar(i){\r\n\r\n\t\tvar starHolder = document.createElement(\"span\");\r\n\t\tvar nextStar = star.cloneNode(true);\r\n\r\n\t\tstars.push(nextStar);\r\n\r\n\t\tstarHolder.addEventListener(\"mouseenter\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\tstarChange(i);\r\n\t\t});\r\n\r\n\t\tstarHolder.addEventListener(\"mousemove\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t});\r\n\r\n\t\tstarHolder.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\tsuccess(i);\r\n\t\t\telement.blur();\r\n\t\t});\r\n\r\n\t\tstarHolder.appendChild(nextStar);\r\n\t\tstarsHolder.appendChild(starHolder);\r\n\r\n\t}\r\n\r\n\t//handle keyboard navigation value change\r\n\tfunction changeValue(val){\r\n\t\tvalue = val;\r\n\t\tstarChange(val);\r\n\t}\r\n\r\n\t//style cell\r\n\telement.style.whiteSpace = \"nowrap\";\r\n\telement.style.overflow = \"hidden\";\r\n\telement.style.textOverflow = \"ellipsis\";\r\n\r\n\t//style holding element\r\n\tstarsHolder.style.verticalAlign = \"middle\";\r\n\tstarsHolder.style.display = \"inline-block\";\r\n\tstarsHolder.style.padding = \"4px\";\r\n\r\n\t//style star\r\n\tstar.setAttribute(\"width\", size);\r\n\tstar.setAttribute(\"height\", size);\r\n\tstar.setAttribute(\"viewBox\", \"0 0 512 512\");\r\n\tstar.setAttribute(\"xml:space\", \"preserve\");\r\n\tstar.style.padding = \"0 1px\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tstarsHolder.setAttribute(key, starsHolder.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tstarsHolder.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//create correct number of stars\r\n\tfor(var i=1;i<= maxStars;i++){\r\n\t\tbuildStar(i);\r\n\t}\r\n\r\n\t//ensure value does not exceed number of stars\r\n\tvalue = Math.min(parseInt(value), maxStars);\r\n\r\n\t// set initial styling of stars\r\n\tstarChange(value);\r\n\r\n\tstarsHolder.addEventListener(\"mousemove\", function(e){\r\n\t\tstarChange(0);\r\n\t});\r\n\r\n\tstarsHolder.addEventListener(\"click\", function(e){\r\n\t\tsuccess(0);\r\n\t});\r\n\r\n\telement.addEventListener(\"blur\", function(e){\r\n\t\tcancel();\r\n\t});\r\n\r\n\t//allow key based navigation\r\n\telement.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 39: //right arrow\r\n\t\t\tchangeValue(value + 1);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 37: //left arrow\r\n\t\t\tchangeValue(value - 1);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 13: //enter\r\n\t\t\tsuccess(value);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 27: //escape\r\n\t\t\tcancel();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\treturn starsHolder;\r\n};","//draggable progress bar\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar element = cell.getElement(),\r\n\tmax = typeof editorParams.max === \"undefined\" ? ((element.getElementsByTagName(\"div\")[0] && element.getElementsByTagName(\"div\")[0].getAttribute(\"max\")) || 100) : editorParams.max,\r\n\tmin = typeof editorParams.min === \"undefined\" ? ((element.getElementsByTagName(\"div\")[0] && element.getElementsByTagName(\"div\")[0].getAttribute(\"min\")) || 0) : editorParams.min,\r\n\tpercent = (max - min) / 100,\r\n\tvalue = cell.getValue() || 0,\r\n\thandle = document.createElement(\"div\"),\r\n\tbar = document.createElement(\"div\"),\r\n\tmouseDrag, mouseDragWidth;\r\n\r\n\t//set new value\r\n\tfunction updateValue(){\r\n\t\tvar style = window.getComputedStyle(element, null);\r\n\r\n\t\tvar calcVal = (percent * Math.round(bar.offsetWidth / ((element.clientWidth - parseInt(style.getPropertyValue(\"padding-left\")) - parseInt(style.getPropertyValue(\"padding-right\")))/100))) + min;\r\n\t\tsuccess(calcVal);\r\n\t\telement.setAttribute(\"aria-valuenow\", calcVal);\r\n\t\telement.setAttribute(\"aria-label\", value);\r\n\t}\r\n\r\n\t//style handle\r\n\thandle.style.position = \"absolute\";\r\n\thandle.style.right = \"0\";\r\n\thandle.style.top = \"0\";\r\n\thandle.style.bottom = \"0\";\r\n\thandle.style.width = \"5px\";\r\n\thandle.classList.add(\"tabulator-progress-handle\");\r\n\r\n\t//style bar\r\n\tbar.style.display = \"inline-block\";\r\n\tbar.style.position = \"relative\";\r\n\t// bar.style.top = \"8px\";\r\n\t// bar.style.bottom = \"8px\";\r\n\t// bar.style.left = \"4px\";\r\n\t// bar.style.marginRight = \"4px\";\r\n\tbar.style.height = \"100%\";\r\n\tbar.style.backgroundColor = \"#488CE9\";\r\n\tbar.style.maxWidth = \"100%\";\r\n\tbar.style.minWidth = \"0%\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tbar.setAttribute(key, bar.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tbar.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//style cell\r\n\telement.style.padding = \"4px 4px\";\r\n\r\n\t//make sure value is in range\r\n\tvalue = Math.min(parseFloat(value), max);\r\n\tvalue = Math.max(parseFloat(value), min);\r\n\r\n\t//workout percentage\r\n\tvalue = Math.round((value - min) / percent);\r\n\t// bar.style.right = value + \"%\";\r\n\tbar.style.width = value + \"%\";\r\n\r\n\telement.setAttribute(\"aria-valuemin\", min);\r\n\telement.setAttribute(\"aria-valuemax\", max);\r\n\r\n\tbar.appendChild(handle);\r\n\r\n\thandle.addEventListener(\"mousedown\", function(e){\r\n\t\tmouseDrag = e.screenX;\r\n\t\tmouseDragWidth = bar.offsetWidth;\r\n\t});\r\n\r\n\thandle.addEventListener(\"mouseover\", function(){\r\n\t\thandle.style.cursor = \"ew-resize\";\r\n\t});\r\n\r\n\telement.addEventListener(\"mousemove\", function(e){\r\n\t\tif(mouseDrag){\r\n\t\t\tbar.style.width = (mouseDragWidth + e.screenX - mouseDrag) + \"px\";\r\n\t\t}\r\n\t});\r\n\r\n\telement.addEventListener(\"mouseup\", function(e){\r\n\t\tif(mouseDrag){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\r\n\t\t\tmouseDrag = false;\r\n\t\t\tmouseDragWidth = false;\r\n\r\n\t\t\tupdateValue();\r\n\t\t}\r\n\t});\r\n\r\n\t//allow key based navigation\r\n\telement.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 39: //right arrow\r\n\t\t\te.preventDefault();\r\n\t\t\tbar.style.width = (bar.clientWidth + element.clientWidth/100) + \"px\";\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 37: //left arrow\r\n\t\t\te.preventDefault();\r\n\t\t\tbar.style.width = (bar.clientWidth - element.clientWidth/100) + \"px\";\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 9: //tab\r\n\t\t\tcase 13: //enter\r\n\t\t\tupdateValue();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 27: //escape\r\n\t\t\tcancel();\r\n\t\t\tbreak;\r\n\r\n\t\t}\r\n\t});\r\n\r\n\telement.addEventListener(\"blur\", function(){\r\n\t\tcancel();\r\n\t});\r\n\r\n\treturn bar;\r\n};","//checkbox\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar value = cell.getValue(),\r\n\tinput = document.createElement(\"input\"),\r\n\ttristate = editorParams.tristate,\r\n\tindetermValue = typeof editorParams.indeterminateValue === \"undefined\" ? null : editorParams.indeterminateValue,\r\n\tindetermState = false,\r\n\ttrueValueSet = Object.keys(editorParams).includes(\"trueValue\"),\r\n\tfalseValueSet = Object.keys(editorParams).includes(\"falseValue\");\r\n\r\n\tinput.setAttribute(\"type\", \"checkbox\");\r\n\tinput.style.marginTop = \"5px\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = value;\r\n\r\n\tif(tristate && (typeof value === \"undefined\" || value === indetermValue || value === \"\")){\r\n\t\tindetermState = true;\r\n\t\tinput.indeterminate = true;\r\n\t}\r\n\r\n\tif(this.table.browser != \"firefox\"){ //prevent blur issue on mac firefox\r\n\t\tonRendered(function(){\r\n\t\t\tinput.focus({preventScroll: true});\r\n\t\t});\r\n\t}\r\n\r\n\tinput.checked = trueValueSet ? value === editorParams.trueValue : (value === true || value === \"true\" || value === \"True\" || value === 1);\r\n\r\n\tonRendered(function(){\r\n\t\tinput.focus();\r\n\t});\r\n\r\n\tfunction setValue(blur){\r\n\t\tvar checkedValue = input.checked;\r\n\r\n\t\tif(trueValueSet && checkedValue){\r\n\t\t\tcheckedValue = editorParams.trueValue;\r\n\t\t}else if(falseValueSet && !checkedValue){\r\n\t\t\tcheckedValue = editorParams.falseValue;\r\n\t\t}else{\r\n\t\t\tcheckedValue = checkedValue;\r\n\t\t}\r\n\r\n\t\tif(tristate){\r\n\t\t\tif(!blur){\r\n\t\t\t\tif(input.checked && !indetermState){\r\n\t\t\t\t\tinput.checked = false;\r\n\t\t\t\t\tinput.indeterminate = true;\r\n\t\t\t\t\tindetermState = true;\r\n\t\t\t\t\treturn indetermValue;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tindetermState = false;\r\n\t\t\t\t\treturn checkedValue;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(indetermState){\r\n\t\t\t\t\treturn indetermValue;\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn checkedValue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn checkedValue;\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur\r\n\tinput.addEventListener(\"change\", function(e){\r\n\t\tsuccess(setValue());\r\n\t});\r\n\r\n\tinput.addEventListener(\"blur\", function(e){\r\n\t\tsuccess(setValue(true));\r\n\t});\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tif(e.keyCode == 13){\r\n\t\t\tsuccess(setValue());\r\n\t\t}\r\n\t\tif(e.keyCode == 27){\r\n\t\t\tcancel();\r\n\t\t}\r\n\t});\r\n\r\n\treturn input;\r\n};","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defaultEditors from './defaults/editors.js';\r\n\r\nclass Edit extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.currentCell = false; //hold currently editing cell\r\n\t\tthis.mouseClick = false; //hold mousedown state to prevent click binding being overriden by editor opening\r\n\t\tthis.recursionBlock = false; //prevent focus recursion\r\n\t\tthis.invalidEdit = false;\r\n\t\tthis.editedCells = [];\r\n\r\n\t\tthis.editors = Edit.editors;\r\n\r\n\t\tthis.registerColumnOption(\"editable\");\r\n\t\tthis.registerColumnOption(\"editor\");\r\n\t\tthis.registerColumnOption(\"editorParams\");\r\n\r\n\t\tthis.registerColumnOption(\"cellEditing\");\r\n\t\tthis.registerColumnOption(\"cellEdited\");\r\n\t\tthis.registerColumnOption(\"cellEditCancelled\");\r\n\r\n\t\tthis.registerTableFunction(\"getEditedCells\", this.getEditedCells.bind(this));\r\n\t\tthis.registerTableFunction(\"clearCellEdited\", this.clearCellEdited.bind(this));\r\n\t\tthis.registerTableFunction(\"navigatePrev\", this.navigatePrev.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateNext\", this.navigateNext.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateLeft\", this.navigateLeft.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateRight\", this.navigateRight.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateUp\", this.navigateUp.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateDown\", this.navigateDown.bind(this));\r\n\r\n\t\tthis.registerComponentFunction(\"cell\", \"isEdited\", this.cellisEdited.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"clearEdited\", this.clearEdited.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"edit\", this.editCell.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"cancelEdit\", this.cellCancelEdit.bind(this));\r\n\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigatePrev\", this.navigatePrev.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateNext\", this.navigateNext.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateLeft\", this.navigateLeft.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateRight\", this.navigateRight.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateUp\", this.navigateUp.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateDown\", this.navigateDown.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-init\", this.bindEditor.bind(this));\r\n\t\tthis.subscribe(\"cell-delete\", this.clearEdited.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumnCheck.bind(this));\r\n\t\tthis.subscribe(\"column-delete\", this.columnDeleteCheck.bind(this));\r\n\t\tthis.subscribe(\"row-deleting\", this.rowDeleteCheck.bind(this));\r\n\t\tthis.subscribe(\"data-refreshing\", this.cancelEdit.bind(this));\r\n\r\n\t\tthis.subscribe(\"keybinding-nav-prev\", this.navigatePrev.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-next\", this.keybindingNavigateNext.bind(this));\r\n\t\tthis.subscribe(\"keybinding-nav-left\", this.navigateLeft.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-right\", this.navigateRight.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-up\", this.navigateUp.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-down\", this.navigateDown.bind(this, undefined));\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t////// Keybinding Functions ///////\r\n\t///////////////////////////////////\r\n\r\n\tkeybindingNavigateNext(e){\r\n\t\tvar cell = this.currentCell,\r\n\t\tnewRow = this.options(\"tabEndNewRow\");\r\n\r\n\t\tif(cell){\r\n\t\t\tif(!this.navigateNext(cell, e)){\r\n\t\t\t\tif(newRow){\r\n\t\t\t\t\tcell.getElement().firstChild.blur();\r\n\r\n\t\t\t\t\tif(newRow === true){\r\n\t\t\t\t\t\tnewRow = this.table.addRow({})\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(typeof newRow == \"function\"){\r\n\t\t\t\t\t\t\tnewRow = this.table.addRow(newRow(cell.row.getComponent()))\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnewRow = this.table.addRow(Object.assign({}, newRow));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tnewRow.then(() => {\r\n\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\tcell.getComponent().navigateNext();\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Cell Functions //////////\r\n\t///////////////////////////////////\r\n\r\n\tcellisEdited(cell){\r\n\t\treturn !! cell.modules.edit && cell.modules.edit.edited;\r\n\t}\r\n\r\n\tcellCancelEdit(cell){\r\n\t\tif(cell === this.currentCell){\r\n\t\t\tthis.table.modules.edit.cancelEdit();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cancel Editor Error - This cell is not currently being edited \");\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\tclearCellEdited(cells){\r\n\t\tif(!cells){\r\n\t\t\tcells = this.table.modules.edit.getEditedCells();\r\n\t\t}\r\n\r\n\t\tif(!Array.isArray(cells)){\r\n\t\t\tcells = [cells];\r\n\t\t}\r\n\r\n\t\tcells.forEach((cell) => {\r\n\t\t\tthis.table.modules.edit.clearEdited(cell._getSelf());\r\n\t\t});\r\n\t}\r\n\r\n\tnavigatePrev(cell = this.currentCell, e){\r\n\t\tvar nextCell, prevRow;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tnextCell = this.navigateLeft();\r\n\r\n\t\t\tif(nextCell){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tprevRow = this.table.rowManager.prevDisplayRow(cell.row, true);\r\n\r\n\t\t\t\tif(prevRow){\r\n\t\t\t\t\tnextCell = this.findNextEditableCell(prevRow, prevRow.cells.length);\r\n\r\n\t\t\t\t\tif(nextCell){\r\n\t\t\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tnavigateNext(cell = this.currentCell, e){\r\n\t\tvar nextCell, nextRow;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tnextCell = this.navigateRight();\r\n\r\n\t\t\tif(nextCell){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tnextRow = this.table.rowManager.nextDisplayRow(cell.row, true);\r\n\r\n\t\t\t\tif(nextRow){\r\n\t\t\t\t\tnextCell = this.findNextEditableCell(nextRow, -1);\r\n\r\n\t\t\t\t\tif(nextCell){\r\n\t\t\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tnavigateLeft(cell = this.currentCell, e){\r\n\t\tvar index, nextCell;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextCell = this.findPrevEditableCell(cell.row, index);\r\n\r\n\t\t\tif(nextCell){\r\n\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tnavigateRight(cell = this.currentCell, e){\r\n\t\tvar index, nextCell;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextCell = this.findNextEditableCell(cell.row, index);\r\n\r\n\t\t\tif(nextCell){\r\n\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tnavigateUp(cell = this.currentCell, e){\r\n\t\tvar index, nextRow;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextRow = this.table.rowManager.prevDisplayRow(cell.row, true);\r\n\r\n\t\t\tif(nextRow){\r\n\t\t\t\tnextRow.cells[index].getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tnavigateDown(cell = this.currentCell, e){\r\n\t\tvar index, nextRow;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextRow = this.table.rowManager.nextDisplayRow(cell.row, true);\r\n\r\n\t\t\tif(nextRow){\r\n\t\t\t\tnextRow.cells[index].getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfindNextEditableCell(row, index){\r\n\t\tvar nextCell = false;\r\n\r\n\t\tif(index < row.cells.length-1){\r\n\t\t\tfor(var i = index+1; i < row.cells.length; i++){\r\n\t\t\t\tlet cell = row.cells[i];\r\n\r\n\t\t\t\tif(cell.column.modules.edit && Helpers.elVisible(cell.getElement())){\r\n\t\t\t\t\tlet allowEdit = true;\r\n\r\n\t\t\t\t\tif(typeof cell.column.modules.edit.check == \"function\"){\r\n\t\t\t\t\t\tallowEdit = cell.column.modules.edit.check(cell.getComponent());\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(allowEdit){\r\n\t\t\t\t\t\tnextCell = cell;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn nextCell;\r\n\t}\r\n\r\n\tfindPrevEditableCell(row, index){\r\n\t\tvar prevCell = false;\r\n\r\n\t\tif(index > 0){\r\n\t\t\tfor(var i = index-1; i >= 0; i--){\r\n\t\t\t\tlet cell = row.cells[i],\r\n\t\t\t\tallowEdit = true;\r\n\r\n\t\t\t\tif(cell.column.modules.edit && Helpers.elVisible(cell.getElement())){\r\n\t\t\t\t\tif(typeof cell.column.modules.edit.check == \"function\"){\r\n\t\t\t\t\t\tallowEdit = cell.column.modules.edit.check(cell.getComponent());\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(allowEdit){\r\n\t\t\t\t\t\tprevCell = cell;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn prevCell;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tinitializeColumnCheck(column){\r\n\t\tif(typeof column.definition.editor !== \"undefined\"){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\r\n\tcolumnDeleteCheck(column){\r\n\t\tif(this.currentCell && this.currentCell.column === column){\r\n\t\t\tthis.cancelEdit();\r\n\t\t}\r\n\t}\r\n\r\n\trowDeleteCheck(row){\r\n\t\tif(this.currentCell && this.currentCell.row === row){\r\n\t\t\tthis.cancelEdit();\r\n\t\t}\r\n\t}\r\n\r\n\t//initialize column editor\r\n\tinitializeColumn(column){\r\n\t\tvar self = this,\r\n\t\tconfig = {\r\n\t\t\teditor:false,\r\n\t\t\tblocked:false,\r\n\t\t\tcheck:column.definition.editable,\r\n\t\t\tparams:column.definition.editorParams || {}\r\n\t\t};\r\n\r\n\t\t//set column editor\r\n\t\tswitch(typeof column.definition.editor){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(this.editors[column.definition.editor]){\r\n\t\t\t\tconfig.editor = this.editors[column.definition.editor];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Editor Error - No such editor found: \", column.definition.editor);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tconfig.editor = column.definition.editor;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"boolean\":\r\n\t\t\tif(column.definition.editor === true){\r\n\t\t\t\tif(typeof column.definition.formatter !== \"function\"){\r\n\t\t\t\t\tif(this.editors[column.definition.formatter]){\r\n\t\t\t\t\t\tconfig.editor = this.editors[column.definition.formatter];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconfig.editor = this.editors[\"input\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Editor Error - Cannot auto lookup editor for a custom formatter: \", column.definition.formatter);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(config.editor){\r\n\t\t\tcolumn.modules.edit = config;\r\n\t\t}\r\n\t}\r\n\r\n\tgetCurrentCell(){\r\n\t\treturn this.currentCell ? this.currentCell.getComponent() : false;\r\n\t}\r\n\r\n\tclearEditor(cancel){\r\n\t\tvar cell = this.currentCell,\r\n\t\tcellEl;\r\n\r\n\t\tthis.invalidEdit = false;\r\n\r\n\t\tif(cell){\r\n\t\t\tthis.currentCell = false;\r\n\r\n\t\t\tcellEl = cell.getElement();\r\n\r\n\t\t\tthis.dispatch(\"edit-editor-clear\", cell, cancel);\r\n\r\n\t\t\tcellEl.classList.remove(\"tabulator-editing\");\r\n\r\n\t\t\twhile(cellEl.firstChild) cellEl.removeChild(cellEl.firstChild);\r\n\r\n\t\t\tcell.row.getElement().classList.remove(\"tabulator-row-editing\");\r\n\t\t}\r\n\t}\r\n\r\n\tcancelEdit(){\r\n\t\tif(this.currentCell){\r\n\t\t\tvar cell = this.currentCell;\r\n\t\t\tvar component = this.currentCell.getComponent();\r\n\r\n\t\t\tthis.clearEditor(true);\r\n\t\t\tcell.setValueActual(cell.getValue());\r\n\t\t\tcell.cellRendered();\r\n\r\n\t\t\tif(cell.column.definition.editor == \"textarea\" || cell.column.definition.variableHeight){\r\n\t\t\t\tcell.row.normalizeHeight(true);\r\n\t\t\t}\r\n\r\n\t\t\tif(cell.column.definition.cellEditCancelled){\r\n\t\t\t\tcell.column.definition.cellEditCancelled.call(this.table, component);\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatch(\"edit-cancelled\", cell);\r\n\t\t\tthis.dispatchExternal(\"cellEditCancelled\", component);\r\n\t\t}\r\n\t}\r\n\r\n\t//return a formatted value for a cell\r\n\tbindEditor(cell){\r\n\t\tif(cell.column.modules.edit){\r\n\t\t\tvar self = this,\r\n\t\t\telement = cell.getElement(true);\r\n\r\n\t\t\telement.setAttribute(\"tabindex\", 0);\r\n\r\n\t\t\telement.addEventListener(\"click\", function(e){\r\n\t\t\t\tif(!element.classList.contains(\"tabulator-editing\")){\r\n\t\t\t\t\telement.focus({preventScroll: true});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\telement.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif (e.button === 2) {\r\n\t\t\t\t\te.preventDefault();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself.mouseClick = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\telement.addEventListener(\"focus\", function(e){\r\n\t\t\t\tif(!self.recursionBlock){\r\n\t\t\t\t\tself.edit(cell, e, false);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tfocusCellNoEvent(cell, block){\r\n\t\tthis.recursionBlock = true;\r\n\r\n\t\tif(!(block && this.table.browser === \"ie\")){\r\n\t\t\tcell.getElement().focus({preventScroll: true});\r\n\t\t}\r\n\r\n\t\tthis.recursionBlock = false;\r\n\t}\r\n\r\n\teditCell(cell, forceEdit){\r\n\t\tthis.focusCellNoEvent(cell);\r\n\t\tthis.edit(cell, false, forceEdit);\r\n\t}\r\n\r\n\tfocusScrollAdjust(cell){\r\n\t\tif(this.table.rowManager.getRenderMode() == \"virtual\"){\r\n\t\t\tvar topEdge = this.table.rowManager.element.scrollTop,\r\n\t\t\tbottomEdge = this.table.rowManager.element.clientHeight + this.table.rowManager.element.scrollTop,\r\n\t\t\trowEl = cell.row.getElement(),\r\n\t\t\toffset = rowEl.offsetTop;\r\n\r\n\t\t\tif(rowEl.offsetTop < topEdge){\r\n\t\t\t\tthis.table.rowManager.element.scrollTop -= (topEdge - rowEl.offsetTop);\r\n\t\t\t}else{\r\n\t\t\t\tif(rowEl.offsetTop + rowEl.offsetHeight > bottomEdge){\r\n\t\t\t\t\tthis.table.rowManager.element.scrollTop += (rowEl.offsetTop + rowEl.offsetHeight - bottomEdge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar leftEdge = this.table.rowManager.element.scrollLeft,\r\n\t\t\trightEdge = this.table.rowManager.element.clientWidth + this.table.rowManager.element.scrollLeft,\r\n\t\t\tcellEl = cell.getElement(),\r\n\t\t\toffset = cellEl.offsetLeft;\r\n\r\n\t\t\tif(this.table.modExists(\"frozenColumns\")){\r\n\t\t\t\tleftEdge += parseInt(this.table.modules.frozenColumns.leftMargin);\r\n\t\t\t\trightEdge -= parseInt(this.table.modules.frozenColumns.rightMargin);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.options.renderHorizontal === \"virtual\"){\r\n\t\t\t\tleftEdge -= parseInt(this.table.columnManager.renderer.vDomPadLeft);\r\n\t\t\t\trightEdge -= parseInt(this.table.columnManager.renderer.vDomPadLeft);\r\n\t\t\t}\r\n\r\n\t\t\tif(cellEl.offsetLeft < leftEdge){\r\n\r\n\t\t\t\tthis.table.rowManager.element.scrollLeft -= (leftEdge - cellEl.offsetLeft);\r\n\t\t\t}else{\r\n\t\t\t\tif(cellEl.offsetLeft + cellEl.offsetWidth > rightEdge){\r\n\t\t\t\t\tthis.table.rowManager.element.scrollLeft += (cellEl.offsetLeft + cellEl.offsetWidth - rightEdge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tedit(cell, e, forceEdit){\r\n\t\tvar self = this,\r\n\t\tallowEdit = true,\r\n\t\trendered = function(){},\r\n\t\telement = cell.getElement(),\r\n\t\tcellEditor, component, params;\r\n\r\n\t\t//prevent editing if another cell is refusing to leave focus (eg. validation fail)\r\n\t\tif(this.currentCell){\r\n\t\t\tif(!this.invalidEdit){\r\n\t\t\t\tthis.cancelEdit();\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//handle successful value change\r\n\t\tfunction success(value){\r\n\t\t\tif(self.currentCell === cell){\r\n\t\t\t\tvar valid = self.chain(\"edit-success\", [cell, value], true, true);\r\n\r\n\t\t\t\tif(valid === true || self.table.options.validationMode === \"highlight\"){\r\n\t\t\t\t\tself.clearEditor();\r\n\r\n\r\n\t\t\t\t\tif(!cell.modules.edit){\r\n\t\t\t\t\t\tcell.modules.edit = {};\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tcell.modules.edit.edited = true;\r\n\r\n\t\t\t\t\tif(self.editedCells.indexOf(cell) == -1){\r\n\t\t\t\t\t\tself.editedCells.push(cell);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tcell.setValue(value, true);\r\n\r\n\t\t\t\t\treturn valid === true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself.invalidEdit = true;\r\n\t\t\t\t\tself.focusCellNoEvent(cell, true);\r\n\t\t\t\t\trendered();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t// console.warn(\"Edit Success Error - cannot call success on a cell that is no longer being edited\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//handle aborted edit\r\n\t\tfunction cancel(){\r\n\t\t\tif(self.currentCell === cell){\r\n\t\t\t\tself.cancelEdit();\r\n\t\t\t}else{\r\n\t\t\t\t// console.warn(\"Edit Success Error - cannot call cancel on a cell that is no longer being edited\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\trendered = callback;\r\n\t\t}\r\n\r\n\t\tif(!cell.column.modules.edit.blocked){\r\n\t\t\tif(e){\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t}\r\n\r\n\t\t\tswitch(typeof cell.column.modules.edit.check){\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tallowEdit = cell.column.modules.edit.check(cell.getComponent());\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\tallowEdit = cell.column.modules.edit.check;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(allowEdit || forceEdit){\r\n\r\n\t\t\t\tself.cancelEdit();\r\n\r\n\t\t\t\tself.currentCell = cell;\r\n\r\n\t\t\t\tthis.focusScrollAdjust(cell);\r\n\r\n\t\t\t\tcomponent = cell.getComponent();\r\n\r\n\t\t\t\tif(this.mouseClick){\r\n\t\t\t\t\tthis.mouseClick = false;\r\n\r\n\t\t\t\t\tif(cell.column.definition.cellClick){\r\n\t\t\t\t\t\tcell.column.definition.cellClick.call(this.table, e, component);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(cell.column.definition.cellEditing){\r\n\t\t\t\t\tcell.column.definition.cellEditing.call(this.table, component);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.dispatch(\"cell-editing\", cell);\r\n\t\t\t\tthis.dispatchExternal(\"cellEditing\", component);\r\n\r\n\t\t\t\tparams = typeof cell.column.modules.edit.params === \"function\" ? cell.column.modules.edit.params(component) : cell.column.modules.edit.params;\r\n\r\n\t\t\t\tcellEditor = cell.column.modules.edit.editor.call(self, component, onRendered, success, cancel, params);\r\n\r\n\t\t\t\t//if editor returned, add to DOM, if false, abort edit\r\n\t\t\t\tif(cellEditor !== false){\r\n\r\n\t\t\t\t\tif(cellEditor instanceof Node){\r\n\t\t\t\t\t\telement.classList.add(\"tabulator-editing\");\r\n\t\t\t\t\t\tcell.row.getElement().classList.add(\"tabulator-row-editing\");\r\n\t\t\t\t\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\t\t\t\t\telement.appendChild(cellEditor);\r\n\r\n\t\t\t\t\t\t//trigger onRendered Callback\r\n\t\t\t\t\t\trendered();\r\n\r\n\t\t\t\t\t\t//prevent editing from triggering rowClick event\r\n\t\t\t\t\t\tvar children = element.children;\r\n\r\n\t\t\t\t\t\tfor (var i = 0; i < children.length; i++) {\r\n\t\t\t\t\t\t\tchildren[i].addEventListener(\"click\", function(e){\r\n\t\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Edit Error - Editor should return an instance of Node, the editor returned:\", cellEditor);\r\n\t\t\t\t\t\telement.blur();\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.blur();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tthis.mouseClick = false;\r\n\t\t\t\telement.blur();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.mouseClick = false;\r\n\t\t\telement.blur();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tgetEditedCells(){\r\n\t\tvar output = [];\r\n\r\n\t\tthis.editedCells.forEach((cell) => {\r\n\t\t\toutput.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tclearEdited(cell){\r\n\t\tvar editIndex;\r\n\r\n\t\tif(cell.modules.edit && cell.modules.edit.edited){\r\n\t\t\tcell.modules.edit.edited = false;\r\n\r\n\t\t\tthis.dispatch(\"edit-edited-clear\", cell);\r\n\t\t}\r\n\r\n\t\teditIndex = this.editedCells.indexOf(cell);\r\n\r\n\t\tif(editIndex > -1){\r\n\t\t\tthis.editedCells.splice(editIndex, 1);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nEdit.moduleName = \"edit\";\r\n\r\n//load defaults\r\nEdit.editors = defaultEditors;\r\n\r\n\r\nexport default Edit;\r\n","class ExportRow{\r\n\tconstructor(type, columns, component, indent){\r\n\t\tthis.type = type;\r\n\t\tthis.columns = columns;\r\n\t\tthis.component = component || false;\r\n\t\tthis.indent = indent || 0;\r\n\t}\r\n}\r\n\r\nexport default ExportRow;","class ExportColumn{\r\n\tconstructor(value, component, width, height, depth){\r\n\t\tthis.value = value;\r\n\t\tthis.component = component || false;\r\n\t\tthis.width = width;\r\n\t\tthis.height = height;\r\n\t\tthis.depth = depth;\r\n\t}\r\n}\r\n\r\nexport default ExportColumn;","import Module from '../../core/Module.js';\r\n\r\nimport ExportRow from './ExportRow.js';\r\nimport ExportColumn from './ExportColumn.js';\r\n\r\nclass Export extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.config = {};\r\n\t\tthis.cloneTableStyle = true;\r\n\t\tthis.colVisProp = \"\";\r\n\r\n\t\tthis.registerTableOption(\"htmlOutputConfig\", false); //html outypu config\r\n\r\n\t\tthis.registerColumnOption(\"htmlOutput\");\r\n\t\tthis.registerColumnOption(\"titleHtmlOutput\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"getHtml\", this.getHtml.bind(this));\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tgenerateExportList(config, style, range, colVisProp){\r\n\t\tthis.cloneTableStyle = style;\r\n\t\tthis.config = config || {};\r\n\t\tthis.colVisProp = colVisProp;\r\n\r\n\t\tvar headers = this.config.columnHeaders !== false ? this.headersToExportRows(this.generateColumnGroupHeaders()) : [];\r\n\t\tvar body = this.bodyToExportRows(this.rowLookup(range));\r\n\r\n\t\treturn headers.concat(body);\r\n\t}\r\n\r\n\tgenereateTable(config, style, range, colVisProp){\r\n\t\tvar list = this.generateExportList(config, style, range, colVisProp);\r\n\r\n\t\treturn this.genereateTableElement(list);\r\n\t}\r\n\r\n\trowLookup(range){\r\n\t\tvar rows = [];\r\n\r\n\t\tif(typeof range == \"function\"){\r\n\t\t\trange.call(this.table).forEach((row) =>{\r\n\t\t\t\trow = this.table.rowManager.findRow(row);\r\n\r\n\t\t\t\tif(row){\r\n\t\t\t\t\trows.push(row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tswitch(range){\r\n\t\t\t\tcase true:\r\n\t\t\t\tcase \"visible\":\r\n\t\t\t\trows = this.table.rowManager.getVisibleRows(false, true);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"all\":\r\n\t\t\t\trows = this.table.rowManager.rows;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"selected\":\r\n\t\t\t\trows = this.table.modules.selectRow.selectedRows;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"active\":\r\n\t\t\t\tdefault:\r\n\t\t\t\tif(this.table.options.pagination){\r\n\t\t\t\t\trows = this.table.rowManager.getDisplayRows(this.table.rowManager.displayRows.length - 2);\r\n\t\t\t\t}else{\r\n\t\t\t\t\trows = this.table.rowManager.getDisplayRows();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Object.assign([], rows);\r\n\t}\r\n\r\n\tgenerateColumnGroupHeaders(){\r\n\t\tvar output = [];\r\n\r\n\t\tvar columns = this.config.columnGroups !== false ? this.table.columnManager.columns : this.table.columnManager.columnsByIndex;\r\n\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\tvar colData = this.processColumnGroup(column);\r\n\r\n\t\t\tif(colData){\r\n\t\t\t\toutput.push(colData);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tprocessColumnGroup(column){\r\n\t\tvar subGroups = column.columns,\r\n\t\tmaxDepth = 0,\r\n\t\ttitle = column.definition[\"title\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))] || column.definition.title;\r\n\r\n\t\tvar groupData = {\r\n\t\t\ttitle:title,\r\n\t\t\tcolumn:column,\r\n\t\t\tdepth:1,\r\n\t\t};\r\n\r\n\t\tif(subGroups.length){\r\n\t\t\tgroupData.subGroups = [];\r\n\t\t\tgroupData.width = 0;\r\n\r\n\t\t\tsubGroups.forEach((subGroup) => {\r\n\t\t\t\tvar subGroupData = this.processColumnGroup(subGroup);\r\n\r\n\t\t\t\tif(subGroupData){\r\n\t\t\t\t\tgroupData.width += subGroupData.width;\r\n\t\t\t\t\tgroupData.subGroups.push(subGroupData);\r\n\r\n\t\t\t\t\tif(subGroupData.depth > maxDepth){\r\n\t\t\t\t\t\tmaxDepth = subGroupData.depth;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tgroupData.depth += maxDepth;\r\n\r\n\t\t\tif(!groupData.width){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.columnVisCheck(column)){\r\n\t\t\t\tgroupData.width = 1;\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn groupData;\r\n\t}\r\n\r\n\tcolumnVisCheck(column){\r\n\t\treturn column.definition[this.colVisProp] !== false && (column.visible || (!column.visible && column.definition[this.colVisProp]));\r\n\t}\r\n\r\n\theadersToExportRows(columns){\r\n\t\tvar headers = [],\r\n\t\theaderDepth = 0,\r\n\t\texportRows = [];\r\n\r\n\t\tfunction parseColumnGroup(column, level){\r\n\r\n\t\t\tvar depth = headerDepth - level;\r\n\r\n\t\t\tif(typeof headers[level] === \"undefined\"){\r\n\t\t\t\theaders[level] = [];\r\n\t\t\t}\r\n\r\n\t\t\tcolumn.height = column.subGroups ? 1 : (depth - column.depth) + 1;\r\n\r\n\t\t\theaders[level].push(column);\r\n\r\n\t\t\tif(column.height > 1){\r\n\t\t\t\tfor(let i = 1; i < column.height; i ++){\r\n\r\n\t\t\t\t\tif(typeof headers[level + i] === \"undefined\"){\r\n\t\t\t\t\t\theaders[level + i] = [];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\theaders[level + i].push(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(column.width > 1){\r\n\t\t\t\tfor(let i = 1; i < column.width; i ++){\r\n\t\t\t\t\theaders[level].push(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(column.subGroups){\r\n\t\t\t\tcolumn.subGroups.forEach(function(subGroup){\r\n\t\t\t\t\tparseColumnGroup(subGroup, level+1);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//calculate maximum header debth\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tif(column.depth > headerDepth){\r\n\t\t\t\theaderDepth = column.depth;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tparseColumnGroup(column,0);\r\n\t\t});\r\n\r\n\t\theaders.forEach((header) => {\r\n\t\t\tvar columns = [];\r\n\r\n\t\t\theader.forEach((col) => {\r\n\t\t\t\tif(col){\r\n\t\t\t\t\tlet title = typeof col.title === \"undefined\" ? \"\" : col.title;\r\n\t\t\t\t\tcolumns.push(new ExportColumn(title, col.column.getComponent(), col.width, col.height, col.depth));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolumns.push(null);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\texportRows.push(new ExportRow(\"header\", columns));\r\n\t\t});\r\n\r\n\t\treturn exportRows;\r\n\t}\r\n\r\n\tbodyToExportRows(rows){\r\n\r\n\t\tvar columns = [];\r\n\t\tvar exportRows = [];\r\n\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tif (this.columnVisCheck(column)) {\r\n\t\t\t\tcolumns.push(column.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(this.config.columnCalcs !== false && this.table.modExists(\"columnCalcs\")){\r\n\t\t\tif(this.table.modules.columnCalcs.topInitialized){\r\n\t\t\t\trows.unshift(this.table.modules.columnCalcs.topRow);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modules.columnCalcs.botInitialized){\r\n\t\t\t\trows.push(this.table.modules.columnCalcs.botRow);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\trows = rows.filter((row) => {\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\treturn this.config.rowGroups !== false;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"calc\":\r\n\t\t\t\treturn this.config.columnCalcs !== false;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"row\":\r\n\t\t\t\treturn !(this.table.options.dataTree && this.config.dataTree === false && row.modules.dataTree.parent);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\trows.forEach((row, i) => {\r\n\t\t\tvar rowData = row.getData(this.colVisProp);\r\n\t\t\tvar exportCols = [];\r\n\t\t\tvar indent = 0;\r\n\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\tindent = row.level;\r\n\t\t\t\texportCols.push(new ExportColumn(row.key, row.getComponent(), columns.length, 1));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"calc\" :\r\n\t\t\t\tcase \"row\" :\r\n\t\t\t\tcolumns.forEach((col) => {\r\n\t\t\t\t\texportCols.push(new ExportColumn(col._column.getFieldValue(rowData), col, 1, 1));\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(this.table.options.dataTree && this.config.dataTree !== false){\r\n\t\t\t\t\tindent = row.modules.dataTree.index;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\texportRows.push(new ExportRow(row.type, exportCols, row.getComponent(), indent));\r\n\t\t});\r\n\r\n\t\treturn exportRows;\r\n\t}\r\n\r\n\tgenereateTableElement(list){\r\n\t\tvar table = document.createElement(\"table\"),\r\n\t\theaderEl = document.createElement(\"thead\"),\r\n\t\tbodyEl = document.createElement(\"tbody\"),\r\n\t\tstyles = this.lookupTableStyles(),\r\n\t\trowFormatter = this.table.options[\"rowFormatter\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))],\r\n\t\tsetup = {};\r\n\r\n\t\tsetup.rowFormatter = rowFormatter !== null ? rowFormatter : this.table.options.rowFormatter;\r\n\r\n\t\tif(this.table.options.dataTree &&this.config.dataTree !== false && this.table.modExists(\"columnCalcs\")){\r\n\t\t\tsetup.treeElementField = this.table.modules.dataTree.elementField;\r\n\t\t}\r\n\r\n\t\t//assign group header formatter\r\n\t\tsetup.groupHeader = this.table.options[\"groupHeader\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))];\r\n\r\n\t\tif(setup.groupHeader && !Array.isArray(setup.groupHeader)){\r\n\t\t\tsetup.groupHeader = [setup.groupHeader];\r\n\t\t}\r\n\r\n\t\ttable.classList.add(\"tabulator-print-table\");\r\n\r\n\t\tthis.mapElementStyles(this.table.columnManager.getHeadersElement(), headerEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"background-color\", \"color\", \"font-weight\", \"font-family\", \"font-size\"]);\r\n\r\n\r\n\t\tif(list.length > 1000){\r\n\t\t\tconsole.warn(\"It may take a long time to render an HTML table with more than 1000 rows\");\r\n\t\t}\r\n\r\n\t\tlist.forEach((row, i) => {\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"header\":\r\n\t\t\t\theaderEl.appendChild(this.genereateHeaderElement(row, setup, styles));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\tbodyEl.appendChild(this.genereateGroupElement(row, setup, styles));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"calc\":\r\n\t\t\t\tbodyEl.appendChild(this.genereateCalcElement(row, setup, styles));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"row\":\r\n\t\t\t\tlet rowEl = this.genereateRowElement(row, setup, styles);\r\n\t\t\t\tthis.mapElementStyles(((i % 2) && styles.evenRow) ? styles.evenRow : styles.oddRow, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\t\t\t\tbodyEl.appendChild(rowEl);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(headerEl.innerHTML){\r\n\t\t\ttable.appendChild(headerEl);\r\n\t\t}\r\n\r\n\t\ttable.appendChild(bodyEl);\r\n\r\n\r\n\t\tthis.mapElementStyles(this.table.element, table, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\"]);\r\n\t\treturn table;\r\n\t}\r\n\r\n\tlookupTableStyles(){\r\n\t\tvar styles = {};\r\n\r\n\t\t//lookup row styles\r\n\t\tif(this.cloneTableStyle && window.getComputedStyle){\r\n\t\t\tstyles.oddRow = this.table.element.querySelector(\".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.evenRow = this.table.element.querySelector(\".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.calcRow = this.table.element.querySelector(\".tabulator-row.tabulator-calcs\");\r\n\t\t\tstyles.firstRow = this.table.element.querySelector(\".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.firstGroup = this.table.element.getElementsByClassName(\"tabulator-group\")[0];\r\n\r\n\t\t\tif(styles.firstRow){\r\n\t\t\t\tstyles.styleCells = styles.firstRow.getElementsByClassName(\"tabulator-cell\");\r\n\t\t\t\tstyles.firstCell = styles.styleCells[0];\r\n\t\t\t\tstyles.lastCell = styles.styleCells[styles.styleCells.length - 1];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn styles;\r\n\t}\r\n\r\n\tgenereateHeaderElement(row, setup, styles){\r\n\t\tvar rowEl = document.createElement(\"tr\");\r\n\r\n\t\trow.columns.forEach((column) => {\r\n\t\t\tif(column){\r\n\t\t\t\tvar cellEl = document.createElement(\"th\");\r\n\t\t\t\tvar classNames = column.component._column.definition.cssClass ? column.component._column.definition.cssClass.split(\" \") : [];\r\n\r\n\t\t\t\tcellEl.colSpan = column.width;\r\n\t\t\t\tcellEl.rowSpan = column.height;\r\n\r\n\t\t\t\tcellEl.innerHTML = column.value;\r\n\r\n\t\t\t\tif(this.cloneTableStyle){\r\n\t\t\t\t\tcellEl.style.boxSizing = \"border-box\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\tclassNames.forEach(function(className) {\r\n\t\t\t\t\tcellEl.classList.add(className);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.mapElementStyles(column.component.getElement(), cellEl, [\"text-align\", \"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"background-color\", \"color\", \"font-weight\", \"font-family\", \"font-size\"]);\r\n\t\t\t\tthis.mapElementStyles(column.component._column.contentElement, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\"]);\r\n\r\n\t\t\t\tif(column.component._column.visible){\r\n\t\t\t\t\tthis.mapElementStyles(column.component.getElement(), cellEl, [\"width\"]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(column.component._column.definition.width){\r\n\t\t\t\t\t\tcellEl.style.width = column.component._column.definition.width + \"px\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(column.component._column.parent){\r\n\t\t\t\t\tthis.mapElementStyles(column.component._column.parent.groupElement, cellEl, [\"border-top\"]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowEl.appendChild(cellEl);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenereateGroupElement(row, setup, styles){\r\n\r\n\t\tvar rowEl = document.createElement(\"tr\"),\r\n\t\tcellEl = document.createElement(\"td\"),\r\n\t\tgroup = row.columns[0];\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-row\");\r\n\r\n\t\tif(setup.groupHeader && setup.groupHeader[row.indent]){\r\n\t\t\tgroup.value = setup.groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t}else{\r\n\t\t\tif(setup.groupHeader === false){\r\n\t\t\t\tgroup.value = group.value;\r\n\t\t\t}else{\r\n\t\t\t\tgroup.value = row.component._group.generator(group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcellEl.colSpan = group.width;\r\n\t\tcellEl.innerHTML = group.value;\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-group\");\r\n\t\trowEl.classList.add(\"tabulator-group-level-\" + row.indent);\r\n\r\n\t\tif(group.component.isVisible()){\r\n\t\t\trowEl.classList.add(\"tabulator-group-visible\");\r\n\t\t}\r\n\r\n\t\tthis.mapElementStyles(styles.firstGroup, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\t\tthis.mapElementStyles(styles.firstGroup, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\"]);\r\n\r\n\t\trowEl.appendChild(cellEl);\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenereateCalcElement(row, setup, styles){\r\n\t\tvar rowEl = this.genereateRowElement(row, setup, styles);\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-calcs\");\r\n\t\tthis.mapElementStyles(styles.calcRow, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenereateRowElement(row, setup, styles){\r\n\t\tvar rowEl = document.createElement(\"tr\");\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-row\");\r\n\r\n\t\trow.columns.forEach((col) => {\r\n\t\t\tif(col){\r\n\t\t\t\tvar cellEl = document.createElement(\"td\"),\r\n\t\t\t\tcolumn = col.component._column,\r\n\t\t\t\tindex = this.table.columnManager.findColumnIndex(column),\r\n\t\t\t\tvalue = col.value;\r\n\r\n\t\t\t\tvar cellWrapper = {\r\n\t\t\t\t\tmodules:{},\r\n\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetField:function(){\r\n\t\t\t\t\t\treturn column.definition.field;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\treturn cellEl;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetData:function(){\r\n\t\t\t\t\t\treturn row.component.getData();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\treturn row.component;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetComponent:function(){\r\n\t\t\t\t\t\treturn cellWrapper;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tcolumn:column,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tvar classNames = column.definition.cssClass ? column.definition.cssClass.split(\" \") : [];\r\n\r\n\t\t\t\tclassNames.forEach(function(className) {\r\n\t\t\t\t\tcellEl.classList.add(className);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(this.table.modExists(\"format\") && this.config.formatCells !== false){\r\n\t\t\t\t\tvalue = this.table.modules.format.formatExportValue(cellWrapper, this.colVisProp);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\tvalue = JSON.stringify(value);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\tcase \"null\":\r\n\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tvalue = value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(value instanceof Node){\r\n\t\t\t\t\tcellEl.appendChild(value);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcellEl.innerHTML = value;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(styles.styleCells[index] || styles.firstCell){\r\n\t\t\t\t\tthis.mapElementStyles(styles.styleCells[index] || styles.firstCell, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\", \"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"text-align\"]);\r\n\r\n\t\t\t\t\tif(column.definition.align){\r\n\t\t\t\t\t\tcellEl.style.textAlign = column.definition.align;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(this.table.options.dataTree && this.config.dataTree !== false){\r\n\t\t\t\t\tif((setup.treeElementField && setup.treeElementField == column.field) || (!setup.treeElementField && i == 0)){\r\n\t\t\t\t\t\tif(row.component._row.modules.dataTree.controlEl){\r\n\t\t\t\t\t\t\tcellEl.insertBefore(row.component._row.modules.dataTree.controlEl.cloneNode(true), cellEl.firstChild);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(row.component._row.modules.dataTree.branchEl){\r\n\t\t\t\t\t\t\tcellEl.insertBefore(row.component._row.modules.dataTree.branchEl.cloneNode(true), cellEl.firstChild);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowEl.appendChild(cellEl);\r\n\r\n\t\t\t\tif(cellWrapper.modules.format && cellWrapper.modules.format.renderedCallback){\r\n\t\t\t\t\tcellWrapper.modules.format.renderedCallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(setup.rowFormatter && this.config.formatCells !== false){\r\n\t\t\t\t\tsetup.rowFormatter(row.component);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenereateHTMLTable(list){\r\n\t\tvar holder = document.createElement(\"div\");\r\n\r\n\t\tholder.appendChild(this.genereateTableElement(list));\r\n\r\n\t\treturn holder.innerHTML;\r\n\t}\r\n\r\n\tgetHtml(visible, style, config, colVisProp){\r\n\t\tvar list = this.generateExportList(config || this.table.options.htmlOutputConfig, style, visible, colVisProp || \"htmlOutput\");\r\n\r\n\t\treturn this.genereateHTMLTable(list);\r\n\t}\r\n\r\n\tmapElementStyles(from, to, props){\r\n\t\tif(this.cloneTableStyle && from && to){\r\n\r\n\t\t\tvar lookup = {\r\n\t\t\t\t\"background-color\" : \"backgroundColor\",\r\n\t\t\t\t\"color\" : \"fontColor\",\r\n\t\t\t\t\"width\" : \"width\",\r\n\t\t\t\t\"font-weight\" : \"fontWeight\",\r\n\t\t\t\t\"font-family\" : \"fontFamily\",\r\n\t\t\t\t\"font-size\" : \"fontSize\",\r\n\t\t\t\t\"text-align\" : \"textAlign\",\r\n\t\t\t\t\"border-top\" : \"borderTop\",\r\n\t\t\t\t\"border-left\" : \"borderLeft\",\r\n\t\t\t\t\"border-right\" : \"borderRight\",\r\n\t\t\t\t\"border-bottom\" : \"borderBottom\",\r\n\t\t\t\t\"padding-top\" : \"paddingTop\",\r\n\t\t\t\t\"padding-left\" : \"paddingLeft\",\r\n\t\t\t\t\"padding-right\" : \"paddingRight\",\r\n\t\t\t\t\"padding-bottom\" : \"paddingBottom\",\r\n\t\t\t};\r\n\r\n\t\t\tif(window.getComputedStyle){\r\n\t\t\t\tvar fromStyle = window.getComputedStyle(from);\r\n\r\n\t\t\t\tprops.forEach(function(prop){\r\n\t\t\t\t\tto.style[lookup[prop]] = fromStyle.getPropertyValue(prop);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nExport.moduleName = \"export\";\r\n\r\nexport default Export;\r\n","export default {\r\n\r\n\t//equal to\r\n\t\"=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal == filterVal ? true : false;\r\n\t},\r\n\r\n\t//less than\r\n\t\"<\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal < filterVal ? true : false;\r\n\t},\r\n\r\n\t//less than or equal to\r\n\t\"<=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal <= filterVal ? true : false;\r\n\t},\r\n\r\n\t//greater than\r\n\t\">\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal > filterVal ? true : false;\r\n\t},\r\n\r\n\t//greater than or equal to\r\n\t\">=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal >= filterVal ? true : false;\r\n\t},\r\n\r\n\t//not equal to\r\n\t\"!=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal != filterVal ? true : false;\r\n\t},\r\n\r\n\t\"regex\":function(filterVal, rowVal, rowData, filterParams){\r\n\r\n\t\tif(typeof filterVal == \"string\"){\r\n\t\t\tfilterVal = new RegExp(filterVal);\r\n\t\t}\r\n\r\n\t\treturn filterVal.test(rowVal);\r\n\t},\r\n\r\n\t//contains the string\r\n\t\"like\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().indexOf(filterVal.toLowerCase()) > -1;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//contains the keywords\r\n\t\"keywords\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tvar keywords = filterVal.toLowerCase().split(typeof filterParams.separator === \"undefined\" ? \" \" : filterParams.separator),\r\n\t\tvalue = String(rowVal === null || typeof rowVal === \"undefined\" ? \"\" : rowVal).toLowerCase(),\r\n\t\tmatches = [];\r\n\r\n\t\tkeywords.forEach((keyword) =>{\r\n\t\t\tif(value.includes(keyword)){\r\n\t\t\t\tmatches.push(true);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn filterParams.matchAll ? matches.length === keywords.length : !!matches.length;\r\n\t},\r\n\r\n\t//starts with the string\r\n\t\"starts\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().startsWith(filterVal.toLowerCase());\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//ends with the string\r\n\t\"ends\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().endsWith(filterVal.toLowerCase());\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//in array\r\n\t\"in\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(Array.isArray(filterVal)){\r\n\t\t\treturn filterVal.length ? filterVal.indexOf(rowVal) > -1 : true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Filter Error - filter value is not an array:\", filterVal);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultFilters from './defaults/filters.js';\r\n\r\nclass Filter extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.filterList = []; //hold filter list\r\n\t\tthis.headerFilters = {}; //hold column filters\r\n\t\tthis.headerFilterColumns = []; //hold columns that use header filters\r\n\r\n\t\tthis.prevHeaderFilterChangeCheck = \"\";\r\n\t\tthis.prevHeaderFilterChangeCheck = \"{}\";\r\n\r\n\t\tthis.changed = false; //has filtering changed since last render\r\n\t\tthis.tableInitialized = false;\r\n\r\n\t\tthis.registerTableOption(\"filterMode\", \"local\"); //local or remote filtering\r\n\r\n\t\tthis.registerTableOption(\"initialFilter\", false); //initial filtering criteria\r\n\t\tthis.registerTableOption(\"initialHeaderFilter\", false); //initial header filtering criteria\r\n\t\tthis.registerTableOption(\"headerFilterLiveFilterDelay\", 300); //delay before updating column after user types in header filter\r\n\r\n\t\tthis.registerColumnOption(\"headerFilter\");\r\n\t\tthis.registerColumnOption(\"headerFilterPlaceholder\");\r\n\t\tthis.registerColumnOption(\"headerFilterParams\");\r\n\t\tthis.registerColumnOption(\"headerFilterEmptyCheck\");\r\n\t\tthis.registerColumnOption(\"headerFilterFunc\");\r\n\t\tthis.registerColumnOption(\"headerFilterFuncParams\");\r\n\t\tthis.registerColumnOption(\"headerFilterLiveFilter\");\r\n\r\n\t\tthis.registerTableFunction(\"searchRows\", this.searchRows.bind(this));\r\n\t\tthis.registerTableFunction(\"searchData\", this.searchData.bind(this));\r\n\r\n\t\tthis.registerTableFunction(\"setFilter\", this.userSetFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"refreshFilter\", this.userRefreshFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"addFilter\", this.userAddFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"getFilters\", this.getFilters.bind(this));\r\n\t\tthis.registerTableFunction(\"setHeaderFilterFocus\", this.userSetHeaderFilterFocus.bind(this));\r\n\t\tthis.registerTableFunction(\"getHeaderFilterValue\", this.userGetHeaderFilterValue.bind(this));\r\n\t\tthis.registerTableFunction(\"setHeaderFilterValue\", this.userSetHeaderFilterValue.bind(this));\r\n\t\tthis.registerTableFunction(\"getHeaderFilters\", this.getHeaderFilters.bind(this));\r\n\t\tthis.registerTableFunction(\"removeFilter\", this.userRemoveFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"clearFilter\", this.userClearFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"clearHeaderFilter\", this.userClearHeaderFilter.bind(this));\r\n\r\n\t\tthis.registerComponentFunction(\"column\", \"headerFilterFocus\", this.setHeaderFilterFocus.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"reloadHeaderFilter\", this.reloadHeaderFilter.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"getHeaderFilterValue\", this.getHeaderFilterValue.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"setHeaderFilterValue\", this.setHeaderFilterValue.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumnHeaderFilter.bind(this));\r\n\t\tthis.subscribe(\"column-width-fit-before\", this.hideHeaderFilterElements.bind(this));\r\n\t\tthis.subscribe(\"column-width-fit-after\", this.showHeaderFilterElements.bind(this));\r\n\t\tthis.subscribe(\"table-built\", this.tableBuilt.bind(this));\r\n\r\n\t\tif(this.table.options.filterMode === \"remote\"){\r\n\t\t\tthis.subscribe(\"data-params\", this.remoteFilterParams.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerDataHandler(this.filter.bind(this), 10);\r\n\t}\r\n\r\n\ttableBuilt(){\r\n\t\tif(this.table.options.initialFilter){\r\n\t\t\tthis.setFilter(this.table.options.initialFilter);\r\n\t\t}\r\n\r\n\t\tif(this.table.options.initialHeaderFilter){\r\n\t\t\tthis.table.options.initialHeaderFilter.forEach((item) => {\r\n\r\n\t\t\t\tvar column = this.table.columnManager.findColumn(item.field);\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tthis.setHeaderFilterValue(column, item.value);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", item.field);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.tableInitialized = true;\r\n\t}\r\n\r\n\tremoteFilterParams(data, config, silent, params){\r\n\t\tparams.filter = this.getFilters(true, true);\r\n\t\treturn params;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\t//set standard filters\r\n\tuserSetFilter(field, type, value, params){\r\n\t\tthis.setFilter(field, type, value, params);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//set standard filters\r\n\tuserRefreshFilter(){\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//add filter to array\r\n\tuserAddFilter(field, type, value, params){\r\n\t\tthis.addFilter(field, type, value, params);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\tuserSetHeaderFilterFocus(field){\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\tthis.setHeaderFilterFocus(column);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Focus Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tuserGetHeaderFilterValue(field) {\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\treturn this.getHeaderFilterValue(column);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", field);\r\n\t\t}\r\n\t}\r\n\r\n\tuserSetHeaderFilterValue(field, value){\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\tthis.setHeaderFilterValue(column, value);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//remove filter from array\r\n\tuserRemoveFilter(field, type, value){\r\n\t\tthis.removeFilter(field, type, value);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//clear filters\r\n\tuserClearFilter(all){\r\n\t\tthis.clearFilter(all);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//clear header filters\r\n\tuserClearHeaderFilter(){\r\n\t\tthis.clearHeaderFilter();\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\r\n\t//search for specific row components\r\n\tsearchRows(field, type, value){\r\n\t\treturn this.search(\"rows\", field, type, value);\r\n\t}\r\n\r\n\t//search for specific data\r\n\tsearchData(field, type, value){\r\n\t\treturn this.search(\"data\", field, type, value);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tinitializeColumnHeaderFilter(column){\r\n\t\tvar def = column.definition;\r\n\r\n\t\tif(def.headerFilter){\r\n\r\n\t\t\tif(typeof def.headerFilterPlaceholder !== \"undefined\" && def.field){\r\n\t\t\t\tthis.module(\"localize\").setHeaderFilterColumnPlaceholder(def.field, def.headerFilterPlaceholder);\r\n\t\t\t}\r\n\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\r\n\t//initialize column header filter\r\n\tinitializeColumn(column, value){\r\n\t\tvar self = this,\r\n\t\tfield = column.getField(),\r\n\t\tparams;\r\n\r\n\t\t//handle successfull value change\r\n\t\tfunction success(value){\r\n\t\t\tvar filterType = (column.modules.filter.tagType == \"input\" && column.modules.filter.attrType == \"text\") || column.modules.filter.tagType == \"textarea\" ? \"partial\" : \"match\",\r\n\t\t\ttype = \"\",\r\n\t\t\tfilterChangeCheck = \"\",\r\n\t\t\tfilterFunc;\r\n\r\n\t\t\tif(typeof column.modules.filter.prevSuccess === \"undefined\" || column.modules.filter.prevSuccess !== value){\r\n\r\n\t\t\t\tcolumn.modules.filter.prevSuccess = value;\r\n\r\n\t\t\t\tif(!column.modules.filter.emptyFunc(value)){\r\n\t\t\t\t\tcolumn.modules.filter.value = value;\r\n\r\n\t\t\t\t\tswitch(typeof column.definition.headerFilterFunc){\r\n\t\t\t\t\t\tcase \"string\":\r\n\t\t\t\t\t\tif(Filter.filters[column.definition.headerFilterFunc]){\r\n\t\t\t\t\t\t\ttype = column.definition.headerFilterFunc;\r\n\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\tvar params = column.definition.headerFilterFuncParams || {};\r\n\t\t\t\t\t\t\t\tvar fieldVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\t\tparams = typeof params === \"function\" ? params(value, fieldVal, data) : params;\r\n\r\n\t\t\t\t\t\t\t\treturn Filter.filters[column.definition.headerFilterFunc](value, fieldVal, data, params);\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tconsole.warn(\"Header Filter Error - Matching filter function not found: \", column.definition.headerFilterFunc);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"function\":\r\n\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\tvar params = column.definition.headerFilterFuncParams || {};\r\n\t\t\t\t\t\t\tvar fieldVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\tparams = typeof params === \"function\" ? params(value, fieldVal, data) : params;\r\n\r\n\t\t\t\t\t\t\treturn column.definition.headerFilterFunc(value, fieldVal, data, params);\r\n\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\ttype = filterFunc;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(!filterFunc){\r\n\t\t\t\t\t\tswitch(filterType){\r\n\t\t\t\t\t\t\tcase \"partial\":\r\n\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\tvar colVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\t\tif(typeof colVal !== 'undefined' && colVal !== null){\r\n\t\t\t\t\t\t\t\t\treturn String(colVal).toLowerCase().indexOf(String(value).toLowerCase()) > -1;\r\n\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\ttype = \"like\";\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\treturn column.getFieldValue(data) == value;\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\ttype = \"=\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tself.headerFilters[field] = {value:value, func:filterFunc, type:type, params:params || {}};\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdelete self.headerFilters[field];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcolumn.modules.filter.value = value;\r\n\r\n\t\t\t\tfilterChangeCheck = JSON.stringify(self.headerFilters);\r\n\r\n\t\t\t\tif(self.prevHeaderFilterChangeCheck !== filterChangeCheck){\r\n\t\t\t\t\tself.prevHeaderFilterChangeCheck = filterChangeCheck;\r\n\r\n\t\t\t\t\tself.trackChanges();\r\n\t\t\t\t\tself.refreshFilter();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tcolumn.modules.filter = {\r\n\t\t\tsuccess:success,\r\n\t\t\tattrType:false,\r\n\t\t\ttagType:false,\r\n\t\t\temptyFunc:false,\r\n\t\t};\r\n\r\n\t\tthis.generateHeaderFilterElement(column);\r\n\t}\r\n\r\n\tgenerateHeaderFilterElement(column, initialValue, reinitialize){\r\n\t\tvar self = this,\r\n\t\tsuccess = column.modules.filter.success,\r\n\t\tfield = column.getField(),\r\n\t\tfilterElement, editor, editorElement, cellWrapper, typingTimer, searchTrigger, params;\r\n\r\n\t\tcolumn.modules.filter.value = initialValue;\r\n\r\n\t\t//handle aborted edit\r\n\t\tfunction cancel(){}\r\n\r\n\t\tif(column.modules.filter.headerElement && column.modules.filter.headerElement.parentNode){\r\n\t\t\tcolumn.contentElement.removeChild(column.modules.filter.headerElement.parentNode);\r\n\t\t}\r\n\r\n\t\tif(field){\r\n\r\n\t\t\t//set empty value function\r\n\t\t\tcolumn.modules.filter.emptyFunc = column.definition.headerFilterEmptyCheck || function(value){\r\n\t\t\t\treturn !value && value !== \"0\" && value !== 0;\r\n\t\t\t};\r\n\r\n\t\t\tfilterElement = document.createElement(\"div\");\r\n\t\t\tfilterElement.classList.add(\"tabulator-header-filter\");\r\n\r\n\t\t\t//set column editor\r\n\t\t\tswitch(typeof column.definition.headerFilter){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tif(self.table.modules.edit.editors[column.definition.headerFilter]){\r\n\t\t\t\t\teditor = self.table.modules.edit.editors[column.definition.headerFilter];\r\n\r\n\t\t\t\t\tif((column.definition.headerFilter === \"tick\" || column.definition.headerFilter === \"tickCross\") && !column.definition.headerFilterEmptyCheck){\r\n\t\t\t\t\t\tcolumn.modules.filter.emptyFunc = function(value){\r\n\t\t\t\t\t\t\treturn value !== true && value !== false;\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Filter Error - Cannot build header filter, No such editor found: \", column.definition.editor);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\teditor = column.definition.headerFilter;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\tif(column.modules.edit && column.modules.edit.editor){\r\n\t\t\t\t\teditor = column.modules.edit.editor;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(column.definition.formatter && self.table.modules.edit.editors[column.definition.formatter]){\r\n\t\t\t\t\t\teditor = self.table.modules.edit.editors[column.definition.formatter];\r\n\r\n\t\t\t\t\t\tif((column.definition.formatter === \"tick\" || column.definition.formatter === \"tickCross\") && !column.definition.headerFilterEmptyCheck){\r\n\t\t\t\t\t\t\tcolumn.modules.filter.emptyFunc = function(value){\r\n\t\t\t\t\t\t\t\treturn value !== true && value !== false;\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\teditor = self.table.modules.edit.editors[\"input\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(editor){\r\n\r\n\t\t\t\tcellWrapper = {\r\n\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\treturn typeof initialValue !== \"undefined\" ? initialValue : \"\";\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetField:function(){\r\n\t\t\t\t\t\treturn column.definition.field;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\treturn filterElement;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tnormalizeHeight:function(){\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\r\n\t\t\t\tparams = column.definition.headerFilterParams || {};\r\n\r\n\t\t\t\tparams = typeof params === \"function\" ? params.call(self.table, cellWrapper) : params;\r\n\r\n\t\t\t\teditorElement = editor.call(this.table.modules.edit, cellWrapper, function(){}, success, cancel, params);\r\n\r\n\t\t\t\tif(!editorElement){\r\n\t\t\t\t\tconsole.warn(\"Filter Error - Cannot add filter to \" + field + \" column, editor returned a value of false\");\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!(editorElement instanceof Node)){\r\n\t\t\t\t\tconsole.warn(\"Filter Error - Cannot add filter to \" + field + \" column, editor should return an instance of Node, the editor returned:\", editorElement);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//set Placeholder Text\r\n\t\t\t\tif(field){\r\n\t\t\t\t\tself.langBind(\"headerFilters|columns|\" + column.definition.field, function(value){\r\n\t\t\t\t\t\teditorElement.setAttribute(\"placeholder\", typeof value !== \"undefined\" && value ? value : self.langText(\"headerFilters|default\"));\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself.langBind(\"headerFilters|default\", function(value){\r\n\t\t\t\t\t\teditorElement.setAttribute(\"placeholder\", value);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//focus on element on click\r\n\t\t\t\teditorElement.addEventListener(\"click\", function(e){\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\teditorElement.focus();\r\n\t\t\t\t});\r\n\r\n\t\t\t\teditorElement.addEventListener(\"focus\", (e) => {\r\n\t\t\t\t\tvar left = this.table.columnManager.element.scrollLeft;\r\n\r\n\t\t\t\t\tvar headerPos = this.table.rowManager.element.scrollLeft + parseInt(this.table.columnManager.element.style.marginLeft);\r\n\r\n\t\t\t\t\tif(left !== headerPos){\r\n\t\t\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\t\t\tthis.table.columnManager.scrollHorizontal(left);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\t//live update filters as user types\r\n\t\t\t\ttypingTimer = false;\r\n\r\n\t\t\t\tsearchTrigger = function(e){\r\n\t\t\t\t\tif(typingTimer){\r\n\t\t\t\t\t\tclearTimeout(typingTimer);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\ttypingTimer = setTimeout(function(){\r\n\t\t\t\t\t\tsuccess(editorElement.value);\r\n\t\t\t\t\t},self.table.options.headerFilterLiveFilterDelay);\r\n\t\t\t\t};\r\n\r\n\t\t\t\tcolumn.modules.filter.headerElement = editorElement;\r\n\t\t\t\tcolumn.modules.filter.attrType = editorElement.hasAttribute(\"type\") ? editorElement.getAttribute(\"type\").toLowerCase() : \"\" ;\r\n\t\t\t\tcolumn.modules.filter.tagType = editorElement.tagName.toLowerCase();\r\n\r\n\t\t\t\tif(column.definition.headerFilterLiveFilter !== false){\r\n\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\t!(\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === 'autocomplete' ||\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === 'tickCross' ||\r\n\t\t\t\t\t\t\t((column.definition.editor === 'autocomplete' ||\r\n\t\t\t\t\t\t\t\tcolumn.definition.editor === 'tickCross') &&\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === true)\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t) {\r\n\t\t\t\t\t\teditorElement.addEventListener(\"keyup\", searchTrigger);\r\n\t\t\t\t\teditorElement.addEventListener(\"search\", searchTrigger);\r\n\r\n\r\n\t\t\t\t\t//update number filtered columns on change\r\n\t\t\t\t\tif(column.modules.filter.attrType == \"number\"){\r\n\t\t\t\t\t\teditorElement.addEventListener(\"change\", function(e){\r\n\t\t\t\t\t\t\tsuccess(editorElement.value);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//change text inputs to search inputs to allow for clearing of field\r\n\t\t\t\t\tif(column.modules.filter.attrType == \"text\" && this.table.browser !== \"ie\"){\r\n\t\t\t\t\t\teditorElement.setAttribute(\"type\", \"search\");\r\n\t\t\t\t\t\t// editorElement.off(\"change blur\"); //prevent blur from triggering filter and preventing selection click\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t\t//prevent input and select elements from propegating click to column sorters etc\r\n\t\t\t\t\tif(column.modules.filter.tagType == \"input\" || column.modules.filter.tagType == \"select\" || column.modules.filter.tagType == \"textarea\"){\r\n\t\t\t\t\t\teditorElement.addEventListener(\"mousedown\",function(e){\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfilterElement.appendChild(editorElement);\r\n\r\n\t\t\t\tcolumn.contentElement.appendChild(filterElement);\r\n\r\n\t\t\t\tif(!reinitialize){\r\n\t\t\t\t\tself.headerFilterColumns.push(column);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Filter Error - Cannot add header filter, column has no field set:\", column.definition.title);\r\n\t\t}\r\n\t}\r\n\r\n\t//hide all header filter elements (used to ensure correct column widths in \"fitData\" layout mode)\r\n\thideHeaderFilterElements(){\r\n\t\tthis.headerFilterColumns.forEach(function(column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tcolumn.modules.filter.headerElement.style.display = 'none';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//show all header filter elements (used to ensure correct column widths in \"fitData\" layout mode)\r\n\tshowHeaderFilterElements(){\r\n\t\tthis.headerFilterColumns.forEach(function(column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tcolumn.modules.filter.headerElement.style.display = '';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//programatically set focus of header filter\r\n\tsetHeaderFilterFocus(column){\r\n\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\tcolumn.modules.filter.headerElement.focus();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Focus Error - No header filter set on column:\", column.getField());\r\n\t\t}\r\n\t}\r\n\r\n\t//programmatically get value of header filter\r\n\tgetHeaderFilterValue(column){\r\n\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\treturn column.modules.filter.value;\r\n\t\t} else {\r\n\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t}\r\n\t}\r\n\r\n\t//programatically set value of header filter\r\n\tsetHeaderFilterValue(column, value){\r\n\t\tif (column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tthis.generateHeaderFilterElement(column, value, true);\r\n\t\t\t\tcolumn.modules.filter.success(value);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treloadHeaderFilter(column){\r\n\t\tif (column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tthis.generateHeaderFilterElement(column, column.modules.filter.value, true);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trefreshFilter(){\r\n\t\tif(this.tableInitialized){\r\n\t\t\tif(this.table.options.filterMode === \"remote\"){\r\n\t\t\t\tthis.reloadData(null, false, false);\r\n\t\t\t}else{\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//TODO - Persist left position of row manager\r\n\t\t// left = this.scrollLeft;\r\n\t\t// this.scrollHorizontal(left);\r\n\t}\r\n\r\n\t//check if the filters has changed since last use\r\n\ttrackChanges(){\r\n\t\tthis.changed = true;\r\n\t\tthis.dispatch(\"filter-changed\");\r\n\t}\r\n\r\n\t//check if the filters has changed since last use\r\n\thasChanged(){\r\n\t\tvar changed = this.changed;\r\n\t\tthis.changed = false;\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t//set standard filters\r\n\tsetFilter(field, type, value, params){\r\n\t\tthis.filterList = [];\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value, params:params}];\r\n\t\t}\r\n\r\n\t\tthis.addFilter(field);\r\n\t}\r\n\r\n\t//add filter to array\r\n\taddFilter(field, type, value, params){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value, params:params}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\tthis.filterList.push(filter);\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.trackChanges();\r\n\t\t}\r\n\t}\r\n\r\n\tfindFilter(filter){\r\n\t\tvar column;\r\n\r\n\t\tif(Array.isArray(filter)){\r\n\t\t\treturn this.findSubFilters(filter);\r\n\t\t}\r\n\r\n\t\tvar filterFunc = false;\r\n\r\n\t\tif(typeof filter.field == \"function\"){\r\n\t\t\tfilterFunc = function(data){\r\n\t\t\t\treturn filter.field(data, filter.type || {})// pass params to custom filter function\r\n\t\t\t};\r\n\t\t}else{\r\n\r\n\t\t\tif(Filter.filters[filter.type]){\r\n\r\n\t\t\t\tcolumn = this.table.columnManager.getColumnByField(filter.field);\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\treturn Filter.filters[filter.type](filter.value, column.getFieldValue(data), data, filter.params || {});\r\n\t\t\t\t\t};\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\treturn Filter.filters[filter.type](filter.value, data[filter.field], data, filter.params || {});\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Filter Error - No such filter type found, ignoring: \", filter.type);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfilter.func = filterFunc;\r\n\r\n\t\treturn filter.func ? filter : false;\r\n\t}\r\n\r\n\tfindSubFilters(filters){\r\n\t\tvar output = [];\r\n\r\n\t\tfilters.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\toutput.push(filter);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output.length ? output : false;\r\n\t}\r\n\r\n\t//get all filters\r\n\tgetFilters(all, ajax){\r\n\t\tvar output = [];\r\n\r\n\t\tif(all){\r\n\t\t\toutput = this.getHeaderFilters();\r\n\t\t}\r\n\r\n\t\tif(ajax){\r\n\t\t\toutput.forEach(function(item){\r\n\t\t\t\tif(typeof item.type == \"function\"){\r\n\t\t\t\t\titem.type = \"function\";\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\toutput = output.concat(this.filtersToArray(this.filterList, ajax));\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//filter to Object\r\n\tfiltersToArray(filterList, ajax){\r\n\t\tvar output = [];\r\n\r\n\t\tfilterList.forEach((filter) => {\r\n\t\t\tvar item;\r\n\r\n\t\t\tif(Array.isArray(filter)){\r\n\t\t\t\toutput.push(this.filtersToArray(filter, ajax));\r\n\t\t\t}else{\r\n\t\t\t\titem = {field:filter.field, type:filter.type, value:filter.value}\r\n\r\n\t\t\t\tif(ajax){\r\n\t\t\t\t\tif(typeof item.type == \"function\"){\r\n\t\t\t\t\t\titem.type = \"function\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\toutput.push(item);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//get all filters\r\n\tgetHeaderFilters(){\r\n\t\tvar output = [];\r\n\r\n\t\tfor(var key in this.headerFilters){\r\n\t\t\toutput.push({field:key, type:this.headerFilters[key].type, value:this.headerFilters[key].value});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//remove filter from array\r\n\tremoveFilter(field, type, value){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tvar index = -1;\r\n\r\n\t\t\tif(typeof filter.field == \"object\"){\r\n\t\t\t\tindex = this.filterList.findIndex((element) => {\r\n\t\t\t\t\treturn filter === element;\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tindex = this.filterList.findIndex((element) => {\r\n\t\t\t\t\treturn filter.field === element.field && filter.type === element.type && filter.value === element.value;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.filterList.splice(index, 1);\r\n\t\t\t\tchanged = true;\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Filter Error - No matching filter type found, ignoring: \", filter.type);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//clear filters\r\n\tclearFilter(all){\r\n\t\tthis.filterList = [];\r\n\r\n\t\tif(all){\r\n\t\t\tthis.clearHeaderFilter();\r\n\t\t}\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//clear header filters\r\n\tclearHeaderFilter(){\r\n\t\tthis.headerFilters = {};\r\n\t\tthis.prevHeaderFilterChangeCheck = \"{}\";\r\n\r\n\t\tthis.headerFilterColumns.forEach((column) => {\r\n\t\t\tif(typeof column.modules.filter.value !== \"undefined\"){\r\n\t\t\t\tdelete column.modules.filter.value;\r\n\t\t\t}\r\n\t\t\tcolumn.modules.filter.prevSuccess = undefined;\r\n\t\t\tthis.reloadHeaderFilter(column);\r\n\t\t});\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//search data and return matching rows\r\n\tsearch (searchType, field, type, value){\r\n\t\tvar activeRows = [],\r\n\t\tfilterList = [];\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\tfilterList.push(filter);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\tvar match = true;\r\n\r\n\t\t\tfilterList.forEach((filter) => {\r\n\t\t\t\tif(!this.filterRecurse(filter, row.getData())){\r\n\t\t\t\t\tmatch = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tactiveRows.push(searchType === \"data\" ? row.getData(\"data\") : row.getComponent());\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t\treturn activeRows;\r\n\t}\r\n\r\n\t//filter row array\r\n\tfilter(rowList, filters){\r\n\t\tvar activeRows = [],\r\n\t\tactiveRowComponents = [];\r\n\r\n\t\tif(this.subscribedExternal(\"dataFiltering\")){\r\n\t\t\tthis.dispatchExternal(\"dataFiltering\", this.getFilters(true));\r\n\t\t}\r\n\r\n\t\tif(this.table.options.filterMode !== \"remote\" && (this.filterList.length || Object.keys(this.headerFilters).length)){\r\n\r\n\t\t\trowList.forEach((row) => {\r\n\t\t\t\tif(this.filterRow(row)){\r\n\t\t\t\t\tactiveRows.push(row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t}else{\r\n\t\t\tactiveRows = rowList.slice(0);\r\n\t\t}\r\n\r\n\t\tif(this.subscribedExternal(\"dataFiltered\")){\r\n\r\n\t\t\tactiveRows.forEach((row) => {\r\n\t\t\t\tactiveRowComponents.push(row.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatchExternal(\"dataFiltered\", this.getFilters(true), activeRowComponents);\r\n\t\t}\r\n\r\n\t\treturn activeRows;\r\n\t}\r\n\r\n\t//filter individual row\r\n\tfilterRow(row, filters){\r\n\t\tvar match = true,\r\n\t\tdata = row.getData();\r\n\r\n\t\tthis.filterList.forEach((filter) => {\r\n\t\t\tif(!this.filterRecurse(filter, data)){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\tfor(var field in this.headerFilters){\r\n\t\t\tif(!this.headerFilters[field].func(data)){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tfilterRecurse(filter, data){\r\n\t\tvar match = false;\r\n\r\n\t\tif(Array.isArray(filter)){\r\n\t\t\tfilter.forEach((subFilter) => {\r\n\t\t\t\tif(this.filterRecurse(subFilter, data)){\r\n\t\t\t\t\tmatch = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tmatch = filter.func(data);\r\n\t\t}\r\n\r\n\t\treturn match;\r\n\t}\r\n}\r\n\r\nFilter.moduleName = \"filter\";\r\n\r\n//load defaults\r\nFilter.filters = defaultFilters;\r\n\r\nexport default Filter;","export default function(cell, formatterParams, onRendered){\r\n\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n};","import plaintext from './formatters/plaintext.js';\r\nimport html from './formatters/html.js';\r\nimport textarea from './formatters/textarea.js';\r\nimport money from './formatters/money.js';\r\nimport link from './formatters/link.js';\r\nimport image from './formatters/image.js';\r\nimport tickCross from './formatters/tickCross.js';\r\nimport datetime from './formatters/datetime.js';\r\nimport datetimediff from './formatters/datetimediff.js';\r\nimport lookup from './formatters/lookup.js';\r\nimport star from './formatters/star.js';\r\nimport traffic from './formatters/traffic.js';\r\nimport progress from './formatters/progress.js';\r\nimport color from './formatters/color.js';\r\nimport buttonTick from './formatters/buttonTick.js';\r\nimport buttonCross from './formatters/buttonCross.js';\r\nimport rownum from './formatters/rownum.js';\r\nimport handle from './formatters/handle.js';\r\nimport responsiveCollapse from './formatters/responsiveCollapse.js';\r\nimport rowSelection from './formatters/rowSelection.js';\r\n\r\nexport default {\r\n\tplaintext:plaintext,\r\n\thtml:html,\r\n\ttextarea:textarea,\r\n\tmoney:money,\r\n\tlink:link,\r\n\timage:image,\r\n\ttickCross:tickCross,\r\n\tdatetime:datetime,\r\n\tdatetimediff:datetimediff,\r\n\tlookup:lookup,\r\n\tstar:star,\r\n\ttraffic:traffic,\r\n\tprogress:progress,\r\n\tcolor:color,\r\n\tbuttonTick:buttonTick,\r\n\tbuttonCross:buttonCross,\r\n\trownum:rownum,\r\n\thandle:handle,\r\n\tresponsiveCollapse:responsiveCollapse,\r\n\trowSelection:rowSelection,\r\n};","export default function(cell, formatterParams, onRendered){\r\n\treturn cell.getValue();\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().style.whiteSpace = \"pre-wrap\";\r\n\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar floatVal = parseFloat(cell.getValue()),\r\n\tsign = \"\",\r\n\tnumber, integer, decimal, rgx;\r\n\r\n\tvar decimalSym = formatterParams.decimal || \".\";\r\n\tvar thousandSym = formatterParams.thousand || \",\";\r\n\tvar negativeSign = formatterParams.negativeSign || \"-\";\r\n\tvar symbol = formatterParams.symbol || \"\";\r\n\tvar after = !!formatterParams.symbolAfter;\r\n\tvar precision = typeof formatterParams.precision !== \"undefined\" ? formatterParams.precision : 2;\r\n\r\n\tif(isNaN(floatVal)){\r\n\t\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n\t}\r\n\r\n\tif(floatVal < 0){\r\n\t\tfloatVal = Math.abs(floatVal);\r\n\t\tsign = negativeSign;\r\n\t}\r\n\r\n\tnumber = precision !== false ? floatVal.toFixed(precision) : floatVal;\r\n\tnumber = String(number).split(\".\");\r\n\r\n\tinteger = number[0];\r\n\tdecimal = number.length > 1 ? decimalSym + number[1] : \"\";\r\n\r\n\tif (formatterParams.thousand !== false) {\r\n\t\trgx = /(\\d+)(\\d{3})/;\r\n\r\n\t\twhile (rgx.test(integer)){\r\n\t\t\tinteger = integer.replace(rgx, \"$1\" + thousandSym + \"$2\");\r\n\t\t}\r\n\t}\r\n\r\n\treturn after ? sign + integer + decimal + symbol : sign + symbol + integer + decimal;\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\turlPrefix = formatterParams.urlPrefix || \"\",\r\n\tdownload = formatterParams.download,\r\n\tlabel = value,\r\n\tel = document.createElement(\"a\"),\r\n\tdata;\r\n\r\n\tfunction labelTraverse(path, data){\r\n\t\tvar item = path.shift(),\r\n\t\tvalue = data[item];\r\n\t\t\r\n\t\tif(path.length && typeof value === \"object\"){\r\n\t\t\treturn labelTraverse(path, value);\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t};\r\n\r\n\tif(formatterParams.labelField){\r\n\t\tdata = cell.getData();\r\n\t\tlabel = labelTraverse(formatterParams.labelField.split(this.table.options.nestedFieldSeparator), data);\r\n\t}\r\n\r\n\tif(formatterParams.label){\r\n\t\tswitch(typeof formatterParams.label){\r\n\t\t\tcase \"string\":\r\n\t\t\tlabel = formatterParams.label;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tlabel = formatterParams.label(cell);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif(label){\r\n\t\tif(formatterParams.urlField){\r\n\t\t\tdata = cell.getData();\r\n\t\t\tvalue = data[formatterParams.urlField];\r\n\t\t}\r\n\r\n\t\tif(formatterParams.url){\r\n\t\t\tswitch(typeof formatterParams.url){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tvalue = formatterParams.url;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tvalue = formatterParams.url(cell);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tel.setAttribute(\"href\", urlPrefix + value);\r\n\r\n\t\tif(formatterParams.target){\r\n\t\t\tel.setAttribute(\"target\", formatterParams.target);\r\n\t\t}\r\n\r\n\t\tif(formatterParams.download){\r\n\r\n\t\t\tif(typeof download == \"function\"){\r\n\t\t\t\tdownload = download(cell);\r\n\t\t\t}else{\r\n\t\t\t\tdownload = download === true ? \"\" : download;\r\n\t\t\t}\r\n\r\n\t\t\tel.setAttribute(\"download\", download);\r\n\t\t}\r\n\r\n\t\tel.innerHTML = this.emptyToSpace(this.sanitizeHTML(label));\r\n\r\n\t\treturn el;\r\n\t}else{\r\n\t\treturn \" \";\r\n\t}\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar el = document.createElement(\"img\"),\r\n\tsrc = cell.getValue();\r\n\r\n\tif(formatterParams.urlPrefix){\r\n\t\tsrc = formatterParams.urlPrefix + cell.getValue();\r\n\t}\r\n\r\n\tif(formatterParams.urlSuffix){\r\n\t\tsrc = src + formatterParams.urlSuffix;\r\n\t}\r\n\r\n\tel.setAttribute(\"src\", src);\r\n\r\n\tswitch(typeof formatterParams.height){\r\n\t\tcase \"number\":\r\n\t\tel.style.height = formatterParams.height + \"px\";\r\n\t\tbreak;\r\n\r\n\t\tcase \"string\":\r\n\t\tel.style.height = formatterParams.height;\r\n\t\tbreak;\r\n\t}\r\n\r\n\tswitch(typeof formatterParams.width){\r\n\t\tcase \"number\":\r\n\t\tel.style.width = formatterParams.width + \"px\";\r\n\t\tbreak;\r\n\r\n\t\tcase \"string\":\r\n\t\tel.style.width = formatterParams.width;\r\n\t\tbreak;\r\n\t}\r\n\r\n\tel.addEventListener(\"load\", function(){\r\n\t\tcell.getRow().normalizeHeight();\r\n\t});\r\n\r\n\treturn el;\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\telement = cell.getElement(),\r\n\tempty = formatterParams.allowEmpty,\r\n\ttruthy = formatterParams.allowTruthy,\r\n\ttrueValueSet = Object.keys(formatterParams).includes(\"trueValue\"),\r\n\ttick = typeof formatterParams.tickElement !== \"undefined\" ? formatterParams.tickElement : '',\r\n\tcross = typeof formatterParams.crossElement !== \"undefined\" ? formatterParams.crossElement : '';\r\n\r\n\tif((trueValueSet && value === formatterParams.trueValue) || (!trueValueSet && ((truthy && value) || (value === true || value === \"true\" || value === \"True\" || value === 1 || value === \"1\")))){\r\n\t\telement.setAttribute(\"aria-checked\", true);\r\n\t\treturn tick || \"\";\r\n\t}else{\r\n\t\tif(empty && (value === \"null\" || value === \"\" || value === null || typeof value === \"undefined\")){\r\n\t\t\telement.setAttribute(\"aria-checked\", \"mixed\");\r\n\t\t\treturn \"\";\r\n\t\t}else{\r\n\t\t\telement.setAttribute(\"aria-checked\", false);\r\n\t\t\treturn cross || \"\";\r\n\t\t}\r\n\t}\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar inputFormat = formatterParams.inputFormat || \"yyyy-MM-dd HH:mm:ss\";\r\n\tvar\toutputFormat = formatterParams.outputFormat || \"dd/MM/yyyy HH:mm:ss\";\r\n\tvar\tinvalid = typeof formatterParams.invalidPlaceholder !== \"undefined\" ? formatterParams.invalidPlaceholder : \"\";\r\n\tvar value = cell.getValue();\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tvar newDatetime;\r\n\r\n\t\tif(DT.isDateTime(value)){\r\n\t\t\t newDatetime = value;\r\n\t\t }else if(inputFormat === \"iso\"){\r\n\t\t\t newDatetime = DT.fromISO(String(value));\r\n\t\t }else{\r\n\t\t\t newDatetime = DT.fromFormat(String(value), inputFormat);\r\n\t\t }\r\n\r\n\t\tif(newDatetime.isValid){\r\n\t\t\tif(formatterParams.timezone){\r\n\t\t\t\tnewDatetime = newDatetime.setZone(formatterParams.timezone);\r\n\t\t\t}\r\n\r\n\t\t\treturn newDatetime.toFormat(outputFormat);\r\n\t\t}else{\r\n\t\t\tif(invalid === true || !value){\r\n\t\t\t\treturn value;\r\n\t\t\t}else if(typeof invalid === \"function\"){\r\n\t\t\t\treturn invalid(value);\r\n\t\t\t}else{\r\n\t\t\t\treturn invalid;\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tconsole.error(\"Format Error - 'datetime' formatter is dependant on luxon.js\");\r\n\t}\r\n};","export default function (cell, formatterParams, onRendered) {\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar inputFormat = formatterParams.inputFormat || \"yyyy-MM-dd HH:mm:ss\";\r\n\tvar invalid = typeof formatterParams.invalidPlaceholder !== \"undefined\" ? formatterParams.invalidPlaceholder : \"\";\r\n\tvar suffix = typeof formatterParams.suffix !== \"undefined\" ? formatterParams.suffix : false;\r\n\tvar unit = typeof formatterParams.unit !== \"undefined\" ? formatterParams.unit : \"days\";\r\n\tvar humanize = typeof formatterParams.humanize !== \"undefined\" ? formatterParams.humanize : false;\r\n\tvar date = typeof formatterParams.date !== \"undefined\" ? formatterParams.date : DT.now();\r\n\tvar value = cell.getValue();\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tvar newDatetime;\r\n\r\n\t\tif(DT.isDateTime(value)){\r\n\t\t\t newDatetime = value;\r\n\t\t }else if(inputFormat === \"iso\"){\r\n\t\t\t newDatetime = DT.fromISO(String(value));\r\n\t\t }else{\r\n\t\t\t newDatetime = DT.fromFormat(String(value), inputFormat);\r\n\t\t }\r\n\r\n\t\tif (newDatetime.isValid){\r\n\t\t\tif(humanize){\r\n\t\t\t\treturn newDatetime.diff(date, unit).toHuman() + (suffix ? \" \" + suffix : \"\");\r\n\t\t\t}else{\r\n\t\t\t\treturn parseInt(newDatetime.diff(date, unit)[unit]) + (suffix ? \" \" + suffix : \"\");\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\tif (invalid === true) {\r\n\t\t\t\treturn value;\r\n\t\t\t} else if (typeof invalid === \"function\") {\r\n\t\t\t\treturn invalid(value);\r\n\t\t\t} else {\r\n\t\t\t\treturn invalid;\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tconsole.error(\"Format Error - 'datetimediff' formatter is dependant on luxon.js\");\r\n\t}\r\n};","export default function (cell, formatterParams, onRendered) {\r\n\tvar value = cell.getValue();\r\n\r\n\tif (typeof formatterParams[value] === \"undefined\") {\r\n\t\tconsole.warn('Missing display value for ' + value);\r\n\t\treturn value;\r\n\t}\r\n\r\n\treturn formatterParams[value];\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\telement = cell.getElement(),\r\n\tmaxStars = formatterParams && formatterParams.stars ? formatterParams.stars : 5,\r\n\tstars = document.createElement(\"span\"),\r\n\tstar = document.createElementNS('http://www.w3.org/2000/svg', \"svg\"),\r\n\tstarActive = '',\r\n\tstarInactive = '';\r\n\r\n\t//style stars holder\r\n\tstars.style.verticalAlign = \"middle\";\r\n\r\n\t//style star\r\n\tstar.setAttribute(\"width\", \"14\");\r\n\tstar.setAttribute(\"height\", \"14\");\r\n\tstar.setAttribute(\"viewBox\", \"0 0 512 512\");\r\n\tstar.setAttribute(\"xml:space\", \"preserve\");\r\n\tstar.style.padding = \"0 1px\";\r\n\r\n\tvalue = value && !isNaN(value) ? parseInt(value) : 0;\r\n\r\n\tvalue = Math.max(0, Math.min(value, maxStars));\r\n\r\n\tfor(var i=1;i<= maxStars;i++){\r\n\t\tvar nextStar = star.cloneNode(true);\r\n\t\tnextStar.innerHTML = i <= value ? starActive : starInactive;\r\n\r\n\t\tstars.appendChild(nextStar);\r\n\t}\r\n\r\n\telement.style.whiteSpace = \"nowrap\";\r\n\telement.style.overflow = \"hidden\";\r\n\telement.style.textOverflow = \"ellipsis\";\r\n\r\n\telement.setAttribute(\"aria-label\", value);\r\n\r\n\treturn stars;\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar value = this.sanitizeHTML(cell.getValue()) || 0,\r\n\tel = document.createElement(\"span\"),\r\n\tmax = formatterParams && formatterParams.max ? formatterParams.max : 100,\r\n\tmin = formatterParams && formatterParams.min ? formatterParams.min : 0,\r\n\tcolors = formatterParams && typeof formatterParams.color !== \"undefined\" ? formatterParams.color : [\"red\", \"orange\", \"green\"],\r\n\tcolor = \"#666666\",\r\n\tpercent, percentValue;\r\n\r\n\tif(isNaN(value) || typeof cell.getValue() === \"undefined\"){\r\n\t\treturn;\r\n\t}\r\n\r\n\tel.classList.add(\"tabulator-traffic-light\");\r\n\r\n\t//make sure value is in range\r\n\tpercentValue = parseFloat(value) <= max ? parseFloat(value) : max;\r\n\tpercentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min;\r\n\r\n\t//workout percentage\r\n\tpercent = (max - min) / 100;\r\n\tpercentValue = Math.round((percentValue - min) / percent);\r\n\r\n\t//set color\r\n\tswitch(typeof colors){\r\n\t\tcase \"string\":\r\n\t\tcolor = colors;\r\n\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\tcolor = colors(value);\r\n\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\tif(Array.isArray(colors)){\r\n\t\t\tvar unit = 100 / colors.length;\r\n\t\t\tvar index = Math.floor(percentValue / unit);\r\n\r\n\t\t\tindex = Math.min(index, colors.length - 1);\r\n\t\t\tindex = Math.max(index, 0);\r\n\t\t\tcolor = colors[index];\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tel.style.backgroundColor = color;\r\n\r\n\treturn el;\r\n};","import CellComponent from '../../../../core/cell/CellComponent.js';\r\n\r\nexport default function(cell, formatterParams, onRendered){ //progress bar\r\n\tvar value = this.sanitizeHTML(cell.getValue()) || 0,\r\n\telement = cell.getElement(),\r\n\tmax = formatterParams && formatterParams.max ? formatterParams.max : 100,\r\n\tmin = formatterParams && formatterParams.min ? formatterParams.min : 0,\r\n\tlegendAlign = formatterParams && formatterParams.legendAlign ? formatterParams.legendAlign : \"center\",\r\n\tpercent, percentValue, color, legend, legendColor, top, left, right, bottom;\r\n\r\n\t//make sure value is in range\r\n\tpercentValue = parseFloat(value) <= max ? parseFloat(value) : max;\r\n\tpercentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min;\r\n\r\n\t//workout percentage\r\n\tpercent = (max - min) / 100;\r\n\tpercentValue = Math.round((percentValue - min) / percent);\r\n\r\n\t//set bar color\r\n\tswitch(typeof formatterParams.color){\r\n\t\tcase \"string\":\r\n\t\tcolor = formatterParams.color;\r\n\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\tcolor = formatterParams.color(value);\r\n\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\tif(Array.isArray(formatterParams.color)){\r\n\t\t\tvar unit = 100 / formatterParams.color.length;\r\n\t\t\tvar index = Math.floor(percentValue / unit);\r\n\r\n\t\t\tindex = Math.min(index, formatterParams.color.length - 1);\r\n\t\t\tindex = Math.max(index, 0);\r\n\t\t\tcolor = formatterParams.color[index];\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tdefault:\r\n\t\tcolor = \"#2DC214\";\r\n\t}\r\n\r\n\t//generate legend\r\n\tswitch(typeof formatterParams.legend){\r\n\t\tcase \"string\":\r\n\t\tlegend = formatterParams.legend;\r\n\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\tlegend = formatterParams.legend(value);\r\n\t\tbreak;\r\n\t\tcase \"boolean\":\r\n\t\tlegend = value;\r\n\t\tbreak;\r\n\t\tdefault:\r\n\t\tlegend = false;\r\n\t}\r\n\r\n\t//set legend color\r\n\tswitch(typeof formatterParams.legendColor){\r\n\t\tcase \"string\":\r\n\t\tlegendColor = formatterParams.legendColor;\r\n\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\tlegendColor = formatterParams.legendColor(value);\r\n\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\tif(Array.isArray(formatterParams.legendColor)){\r\n\t\t\tvar unit = 100 / formatterParams.legendColor.length;\r\n\t\t\tvar index = Math.floor(percentValue / unit);\r\n\r\n\t\t\tindex = Math.min(index, formatterParams.legendColor.length - 1);\r\n\t\t\tindex = Math.max(index, 0);\r\n\t\t\tlegendColor = formatterParams.legendColor[index];\r\n\t\t}\r\n\t\tbreak;\r\n\t\tdefault:\r\n\t\tlegendColor = \"#000\";\r\n\t}\r\n\r\n\telement.style.minWidth = \"30px\";\r\n\telement.style.position = \"relative\";\r\n\r\n\telement.setAttribute(\"aria-label\", percentValue);\r\n\r\n\tvar barEl = document.createElement(\"div\");\r\n\tbarEl.style.display = \"inline-block\";\r\n\tbarEl.style.position = \"absolute\";\r\n\tbarEl.style.width = percentValue + \"%\";\r\n\tbarEl.style.backgroundColor = color;\r\n\tbarEl.style.height = \"100%\";\r\n\r\n\tbarEl.setAttribute('data-max', max);\r\n\tbarEl.setAttribute('data-min', min);\r\n\r\n\tvar barContainer = document.createElement(\"div\");\r\n\tbarContainer.style.position = \"relative\";\r\n\tbarContainer.style.width = \"100%\";\r\n\tbarContainer.style.height = \"100%\";\r\n\r\n\tif(legend){\r\n\t\tvar legendEl = document.createElement(\"div\");\r\n\t\tlegendEl.style.position = \"absolute\";\r\n\t\tlegendEl.style.top = 0;\r\n\t\tlegendEl.style.left = 0;\r\n\t\tlegendEl.style.textAlign = legendAlign;\r\n\t\tlegendEl.style.width = \"100%\";\r\n\t\tlegendEl.style.color = legendColor;\r\n\t\tlegendEl.innerHTML = legend;\r\n\t}\r\n\r\n\tonRendered(function(){\r\n\r\n\t\t//handle custom element needed if formatter is to be included in printed/downloaded output\r\n\t\tif(!(cell instanceof CellComponent)){\r\n\t\t\tvar holderEl = document.createElement(\"div\");\r\n\t\t\tholderEl.style.position = \"absolute\";\r\n\t\t\tholderEl.style.top = \"4px\";\r\n\t\t\tholderEl.style.bottom = \"4px\";\r\n\t\t\tholderEl.style.left = \"4px\";\r\n\t\t\tholderEl.style.right = \"4px\";\r\n\r\n\t\t\telement.appendChild(holderEl);\r\n\r\n\t\t\telement = holderEl;\r\n\t\t}\r\n\r\n\t\telement.appendChild(barContainer);\r\n\t\tbarContainer.appendChild(barEl);\r\n\r\n\t\tif(legend){\r\n\t\t\tbarContainer.appendChild(legendEl);\r\n\t\t}\r\n\t});\r\n\r\n\treturn \"\";\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().style.backgroundColor = this.sanitizeHTML(cell.getValue());\r\n\treturn \"\";\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().classList.add(\"tabulator-row-handle\");\r\n\treturn \"
\";\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar open = false,\r\n\tel = document.createElement(\"div\"),\r\n\tconfig = cell.getRow()._row.modules.responsiveLayout;\r\n\r\n\tel.classList.add(\"tabulator-responsive-collapse-toggle\");\r\n\tel.innerHTML = \"+-\";\r\n\r\n\tcell.getElement().classList.add(\"tabulator-row-handle\");\r\n\r\n\tfunction toggleList(isOpen){\r\n\t\tvar collapseEl = config.element;\r\n\r\n\t\tconfig.open = isOpen;\r\n\r\n\t\tif(collapseEl){\r\n\r\n\t\t\tif(config.open){\r\n\t\t\t\tel.classList.add(\"open\");\r\n\t\t\t\tcollapseEl.style.display = '';\r\n\t\t\t}else{\r\n\t\t\t\tel.classList.remove(\"open\");\r\n\t\t\t\tcollapseEl.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tel.addEventListener(\"click\", function(e){\r\n\t\te.stopImmediatePropagation();\r\n\t\ttoggleList(!config.open);\r\n\t});\r\n\r\n\ttoggleList(config.open);\r\n\r\n\treturn el;\r\n};","import RowComponent from '../../../../core/row/RowComponent.js';\r\n\r\nexport default function(cell, formatterParams, onRendered){\r\n\tvar checkbox = document.createElement(\"input\");\r\n\tvar blocked = false;\r\n\r\n\tcheckbox.type = 'checkbox';\r\n\r\n\tcheckbox.setAttribute(\"aria-label\", \"Select Row\");\r\n\t\r\n\tif(this.table.modExists(\"selectRow\", true)){\r\n\r\n\t\tcheckbox.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tif(typeof cell.getRow == 'function'){\r\n\t\t\tvar row = cell.getRow();\r\n\r\n\t\t\tif(row instanceof RowComponent){\r\n\r\n\t\t\t\tcheckbox.addEventListener(\"change\", (e) => {\r\n\t\t\t\t\tif(this.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\t\tif(!blocked){\r\n\t\t\t\t\t\t\trow.toggleSelect();\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tblocked = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trow.toggleSelect();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(this.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\tcheckbox.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\tblocked = true;\r\n\t\t\t\t\t\tthis.table.modules.selectRow.handleComplexRowClick(row._row, e);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcheckbox.checked = row.isSelected && row.isSelected();\r\n\t\t\t\tthis.table.modules.selectRow.registerRowSelectCheckbox(row, checkbox);\r\n\t\t\t}else{\r\n\t\t\t\tcheckbox = \"\";\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\tcheckbox.addEventListener(\"change\", (e) => {\r\n\t\t\t\tif(this.table.modules.selectRow.selectedRows.length){\r\n\t\t\t\t\tthis.table.deselectRow();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis.table.selectRow(formatterParams.rowRange);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.table.modules.selectRow.registerHeaderSelectCheckbox(checkbox);\r\n\t\t}\r\n\t}\r\n\r\n\treturn checkbox;\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultFormatters from './defaults/formatters.js';\r\n\r\nclass Format extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.registerColumnOption(\"formatter\");\r\n\t\tthis.registerColumnOption(\"formatterParams\");\r\n\r\n\t\tthis.registerColumnOption(\"formatterPrint\");\r\n\t\tthis.registerColumnOption(\"formatterPrintParams\");\r\n\t\tthis.registerColumnOption(\"formatterClipboard\");\r\n\t\tthis.registerColumnOption(\"formatterClipboardParams\");\r\n\t\tthis.registerColumnOption(\"formatterHtmlOutput\");\r\n\t\tthis.registerColumnOption(\"formatterHtmlOutputParams\");\r\n\t\tthis.registerColumnOption(\"titleFormatter\");\r\n\t\tthis.registerColumnOption(\"titleFormatterParams\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-format\", this.formatValue.bind(this));\r\n\t\tthis.subscribe(\"cell-rendered\", this.cellRendered.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"column-format\", this.formatHeader.bind(this));\r\n\t}\r\n\r\n\t//initialize column formatter\r\n\tinitializeColumn(column){\r\n\t\tcolumn.modules.format = this.lookupFormatter(column, \"\");\r\n\r\n\t\tif(typeof column.definition.formatterPrint !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.print = this.lookupFormatter(column, \"Print\");\r\n\t\t}\r\n\r\n\t\tif(typeof column.definition.formatterClipboard !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.clipboard = this.lookupFormatter(column, \"Clipboard\");\r\n\t\t}\r\n\r\n\t\tif(typeof column.definition.formatterHtmlOutput !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.htmlOutput = this.lookupFormatter(column, \"HtmlOutput\");\r\n\t\t}\r\n\t}\r\n\r\n\tlookupFormatter(column, type){\r\n\t\tvar config = {params:column.definition[\"formatter\" + type + \"Params\"] || {}},\r\n\t\tformatter = column.definition[\"formatter\" + type];\r\n\r\n\t\t//set column formatter\r\n\t\tswitch(typeof formatter){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(Format.formatters[formatter]){\r\n\t\t\t\tconfig.formatter = Format.formatters[formatter];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Formatter Error - No such formatter found: \", formatter);\r\n\t\t\t\tconfig.formatter = Format.formatters.plaintext;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tconfig.formatter = formatter;\r\n\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\tconfig.formatter = Format.formatters.plaintext;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn config;\r\n\t}\r\n\r\n\tcellRendered(cell){\r\n\t\tif(cell.modules.format && cell.modules.format.renderedCallback && !cell.modules.format.rendered){\r\n\t\t\tcell.modules.format.renderedCallback();\r\n\t\t\tcell.modules.format.rendered = true;\r\n\t\t}\r\n\t}\r\n\r\n\t//return a formatted value for a column header\r\n\tformatHeader(column, title, el){\r\n\t\tvar formatter, params, onRendered, mockCell;\r\n\r\n\t\tif(column.definition.titleFormatter){\r\n\t\t\tformatter = this.getFormatter(column.definition.titleFormatter);\r\n\r\n\t\t\tonRendered = (callback) => {\r\n\t\t\t\tcolumn.titleFormatterRendered = callback;\r\n\t\t\t};\r\n\r\n\t\t\tmockCell = {\r\n\t\t\t\tgetValue:function(){\r\n\t\t\t\t\treturn title;\r\n\t\t\t\t},\r\n\t\t\t\tgetElement:function(){\r\n\t\t\t\t\treturn el;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\tparams = column.definition.titleFormatterParams || {};\r\n\r\n\t\t\tparams = typeof params === \"function\" ? params() : params;\r\n\r\n\t\t\treturn formatter.call(this, mockCell, params, onRendered);\r\n\t\t}else{\r\n\t\t\treturn title;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t//return a formatted value for a cell\r\n\tformatValue(cell){\r\n\t\tvar component = cell.getComponent(),\r\n\t\tparams = typeof cell.column.modules.format.params === \"function\" ? cell.column.modules.format.params(component) : cell.column.modules.format.params;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\tif(!cell.modules.format){\r\n\t\t\t\tcell.modules.format = {};\r\n\t\t\t}\r\n\r\n\t\t\tcell.modules.format.renderedCallback = callback;\r\n\t\t\tcell.modules.format.rendered = false;\r\n\t\t}\r\n\r\n\t\treturn cell.column.modules.format.formatter.call(this, component, params, onRendered);\r\n\t}\r\n\r\n\tformatExportValue(cell, type){\r\n\t\tvar formatter = cell.column.modules.format[type],\r\n\t\tparams;\r\n\r\n\t\tif(formatter){\r\n\t\t\tparams = typeof formatter.params === \"function\" ? formatter.params(component) : formatter.params;\r\n\r\n\t\t\tfunction onRendered(callback){\r\n\t\t\t\tif(!cell.modules.format){\r\n\t\t\t\t\tcell.modules.format = {};\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcell.modules.format.renderedCallback = callback;\r\n\t\t\t\tcell.modules.format.rendered = false;\r\n\t\t\t}\r\n\r\n\t\t\treturn formatter.formatter.call(this, cell.getComponent(), params, onRendered);\r\n\r\n\t\t}else{\r\n\t\t\treturn this.formatValue(cell);\r\n\t\t}\r\n\t}\r\n\r\n\tsanitizeHTML(value){\r\n\t\tif(value){\r\n\t\t\tvar entityMap = {\r\n\t\t\t\t'&': '&',\r\n\t\t\t\t'<': '<',\r\n\t\t\t\t'>': '>',\r\n\t\t\t\t'\"': '"',\r\n\t\t\t\t\"'\": ''',\r\n\t\t\t\t'/': '/',\r\n\t\t\t\t'`': '`',\r\n\t\t\t\t'=': '='\r\n\t\t\t};\r\n\r\n\t\t\treturn String(value).replace(/[&<>\"'`=\\/]/g, function (s) {\r\n\t\t\t\treturn entityMap[s];\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn value;\r\n\t\t}\r\n\t}\r\n\r\n\temptyToSpace(value){\r\n\t\treturn value === null || typeof value === \"undefined\" || value === \"\" ? \" \" : value;\r\n\t}\r\n\r\n\t//get formatter for cell\r\n\tgetFormatter(formatter){\r\n\t\tvar formatter;\r\n\r\n\t\tswitch(typeof formatter){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(Format.formatters[formatter]){\r\n\t\t\t\tformatter = Format.formatters[formatter]\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Formatter Error - No such formatter found: \", formatter);\r\n\t\t\t\tformatter = Format.formatters.plaintext;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tformatter = formatter;\r\n\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\tformatter = Format.formatters.plaintext;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn formatter;\r\n\t}\r\n}\r\n\r\nFormat.moduleName = \"format\";\r\n\r\n//load defaults\r\nFormat.formatters = defaultFormatters;\r\n\r\nexport default Format;","import Module from '../../core/Module.js';\r\n\r\nclass FrozenColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.leftColumns = [];\r\n\t\tthis.rightColumns = [];\r\n\t\tthis.leftMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.rightPadding = 0;\r\n\t\tthis.initializationMode = \"left\";\r\n\t\tthis.active = false;\r\n\t\tthis.blocked = true;\r\n\t\t\r\n\t\tthis.registerColumnOption(\"frozen\");\r\n\t}\r\n\t\r\n\t//reset initial state\r\n\treset(){\r\n\t\tthis.initializationMode = \"left\";\r\n\t\tthis.leftColumns = [];\r\n\t\tthis.rightColumns = [];\r\n\t\tthis.leftMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.active = false;\r\n\t\t\r\n\t\tthis.table.columnManager.headersElement.style.marginLeft = 0;\r\n\t\tthis.table.columnManager.element.style.paddingRight = 0;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-layout\", this.layoutCell.bind(this));\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"column-width\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"row-layout-after\", this.layoutRow.bind(this));\r\n\t\tthis.subscribe(\"table-layout\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"columns-loading\", this.reset.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"column-add\", this.reinitializeColumns.bind(this));\r\n\t\tthis.subscribe(\"column-delete\", this.reinitializeColumns.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"table-redraw\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"layout-refreshing\", this.blockLayout.bind(this));\r\n\t\tthis.subscribe(\"layout-refreshed\", this.unblockLayout.bind(this));\r\n\t}\r\n\t\r\n\tblockLayout(){\r\n\t\tthis.blocked = true;\r\n\t}\r\n\t\r\n\tunblockLayout(){\r\n\t\tthis.blocked = false;\r\n\t}\r\n\t\r\n\tlayoutCell(cell){\r\n\t\tthis.layoutElement(cell.element, cell.column)\r\n\t}\r\n\t\r\n\treinitializeColumns(){\r\n\t\tthis.reset();\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//initialize specific column\r\n\tinitializeColumn(column){\r\n\t\tvar config = {margin:0, edge:false};\r\n\t\t\r\n\t\tif(!column.isGroup){\r\n\t\t\t\r\n\t\t\tif(this.frozenCheck(column)){\r\n\t\t\t\t\r\n\t\t\t\tconfig.position = this.initializationMode;\r\n\t\t\t\t\r\n\t\t\t\tif(this.initializationMode == \"left\"){\r\n\t\t\t\t\tthis.leftColumns.push(column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.rightColumns.unshift(column);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.active = true;\r\n\t\t\t\t\r\n\t\t\t\tcolumn.modules.frozen = config;\r\n\t\t\t}else{\r\n\t\t\t\tthis.initializationMode = \"right\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tfrozenCheck(column){\r\n\t\tif(column.parent.isGroup && column.definition.frozen){\r\n\t\t\tconsole.warn(\"Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups\");\r\n\t\t}\r\n\t\t\r\n\t\tif(column.parent.isGroup){\r\n\t\t\treturn this.frozenCheck(column.parent);\r\n\t\t}else{\r\n\t\t\treturn column.definition.frozen;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//quick layout to smooth horizontal scrolling\r\n\tscrollHorizontal(){\r\n\t\tvar rows;\r\n\t\t\r\n\t\tif(this.active){\t\t\r\n\t\t\tthis.calcMargins(true);\r\n\t\t\t\r\n\t\t\tthis.layoutColumnPosition();\r\n\t\t\t\r\n\t\t\tthis.layoutCalcRows();\r\n\t\t\t\r\n\t\t\tthis.reinitializeRows();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//calculate margins for rows\r\n\tcalcMargins(scroll){\r\n\t\t\r\n\t\tif(!scroll){\r\n\t\t\tthis.leftMargin = this._calcSpace(this.leftColumns, this.leftColumns.length) + \"px\";\t\t\t\r\n\t\t\tthis.rightMargin = this._calcSpace(this.rightColumns, this.rightColumns.length) + \"px\";\t\r\n\t\t\tthis.table.rowManager.tableElement.style.marginRight = this.rightMargin;\r\n\t\t}\r\n\t\t\r\n\t\t//calculate right frozen columns\r\n\t\tthis.rightPadding = this.table.rowManager.element.clientWidth + this.table.columnManager.scrollLeft;\r\n\t}\r\n\t\r\n\t//layout calculation rows\r\n\tlayoutCalcRows(){\r\n\t\tif(this.table.modExists(\"columnCalcs\")){\r\n\t\t\tif(this.table.modules.columnCalcs.topInitialized && this.table.modules.columnCalcs.topRow){\r\n\t\t\t\tthis.layoutRow(this.table.modules.columnCalcs.topRow);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.modules.columnCalcs.botInitialized && this.table.modules.columnCalcs.botRow){\r\n\t\t\t\tthis.layoutRow(this.table.modules.columnCalcs.botRow);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.modExists(\"groupRows\")){\r\n\t\t\t\tthis.layoutGroupCalcs(this.table.modules.groupRows.getGroups())\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tlayoutGroupCalcs(groups){\r\n\t\tgroups.forEach((group) => {\r\n\t\t\tif(group.calcs.top){\r\n\t\t\t\tthis.layoutRow(group.calcs.top);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(group.calcs.bottom){\r\n\t\t\t\tthis.layoutRow(group.calcs.bottom);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(group.groupList && group.groupList.length){\r\n\t\t\t\tthis.layoutGroupCalcs(group.groupList && group.groupList);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//calculate column positions and layout headers\r\n\tlayoutColumnPosition(allCells){\r\n\t\tvar leftParents = [];\r\n\t\t\r\n\t\tvar leftMargin = 0;\r\n\t\tvar rightMargin = 0;\r\n\t\t\r\n\t\tthis.table.columnManager.headersElement.style.marginLeft = this.leftMargin;\r\n\t\tthis.table.columnManager.element.style.paddingRight = this.rightMargin;\r\n\t\t\r\n\t\tthis.leftColumns.forEach((column, i) => {\t\r\n\t\t\tcolumn.modules.frozen.marginValue = leftMargin + this.table.columnManager.scrollLeft;\r\n\t\t\tcolumn.modules.frozen.margin = column.modules.frozen.marginValue + \"px\";\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\tleftMargin += column.getWidth();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(i == this.leftColumns.length - 1){\r\n\t\t\t\tcolumn.modules.frozen.edge = true;\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.modules.frozen.edge = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(column.parent.isGroup){\r\n\t\t\t\tvar parentEl = this.getColGroupParentElement(column);\r\n\t\t\t\tif(!leftParents.includes(parentEl)){\r\n\t\t\t\t\tthis.layoutElement(parentEl, column);\r\n\t\t\t\t\tleftParents.push(parentEl);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(column.modules.frozen.edge){\r\n\t\t\t\t\tparentEl.classList.add(\"tabulator-frozen-\" + column.modules.frozen.position);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.layoutElement(column.getElement(), column);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(allCells){\r\n\t\t\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.rightColumns.forEach((column, i) => {\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\trightMargin += column.getWidth();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.frozen.marginValue = this.rightPadding - rightMargin;\r\n\t\t\tcolumn.modules.frozen.margin = column.modules.frozen.marginValue + \"px\";\r\n\t\t\t\r\n\t\t\tif(i == this.rightColumns.length - 1){\r\n\t\t\t\tcolumn.modules.frozen.edge = true;\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.modules.frozen.edge = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif(column.parent.isGroup){\r\n\t\t\t\tthis.layoutElement(this.getColGroupParentElement(column), column);\r\n\t\t\t}else{\r\n\t\t\t\tthis.layoutElement(column.getElement(), column);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(allCells){\r\n\t\t\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetColGroupParentElement(column){\r\n\t\treturn column.parent.isGroup ? this.getColGroupParentElement(column.parent) : column.getElement();\r\n\t}\r\n\t\r\n\t//layout columns appropriately\r\n\tlayout(){\t\r\n\t\tif(this.active && !this.blocked){\r\n\t\t\t//calculate row padding\r\n\t\t\tthis.calcMargins();\r\n\t\t\t\r\n\t\t\t//calculate left columns\r\n\t\t\tthis.layoutColumnPosition();\r\n\r\n\t\t\tthis.reinitializeRows();\r\n\t\t\t\r\n\t\t\tthis.layoutCalcRows();\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeRows(){\r\n\t\tvar visibleRows = this.table.rowManager.getVisibleRows();\r\n\t\tvar otherRows = this.table.rowManager.getRows().filter(row => !visibleRows.includes(row));\r\n\r\n\t\totherRows.forEach((row) =>{\r\n\t\t\trow.deinitialize();\r\n\t\t});\r\n\t\t\r\n\t\tvisibleRows.forEach((row) =>{\r\n\t\t\tif(row.type === \"row\"){\r\n\t\t\t\tthis.layoutRow(row);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tlayoutRow(row){\r\n\t\t// console.trace(\"row\")\r\n\t\tvar rowEl = row.getElement();\r\n\t\t\r\n\t\trowEl.style.paddingLeft = this.leftMargin;\r\n\t\t\r\n\t\tif(this.table.options.layout === \"fitDataFill\" && this.rightColumns.length){\r\n\t\t\tthis.table.rowManager.getTableElement().style.minWidth = \"calc(100% - \" + this.rightMargin + \")\";\r\n\t\t}\r\n\t\t\r\n\t\tthis.leftColumns.forEach((column) => {\r\n\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\r\n\t\t\tif(cell){\r\n\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.rightColumns.forEach((column) => {\r\n\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\r\n\t\t\tif(cell){\r\n\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tlayoutElement(element, column){\r\n\t\t\r\n\t\tif(column.modules.frozen){\r\n\t\t\telement.style.position = \"absolute\";\r\n\t\t\telement.style.left = column.modules.frozen.margin;\r\n\t\t\t\r\n\t\t\telement.classList.add(\"tabulator-frozen\");\r\n\t\t\t\r\n\t\t\tif(column.modules.frozen.edge){\r\n\t\t\t\telement.classList.add(\"tabulator-frozen-\" + column.modules.frozen.position);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_calcSpace(columns, index){\r\n\t\tvar width = 0;\r\n\t\t\r\n\t\tfor (let i = 0; i < index; i++){\r\n\t\t\tif(columns[i].visible){\r\n\t\t\t\twidth += columns[i].getWidth();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn width;\r\n\t}\r\n}\r\n\r\nFrozenColumns.moduleName = \"frozenColumns\";\r\n\r\nexport default FrozenColumns;","import Module from '../../core/Module.js';\r\n\r\nclass FrozenRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.topElement = document.createElement(\"div\");\r\n\t\tthis.rows = [];\r\n\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"freeze\", this.freezeRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"unfreeze\", this.unfreezeRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isFrozen\", this.isRowFrozen.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.rows = [];\r\n\r\n\t\tthis.topElement.classList.add(\"tabulator-frozen-rows-holder\");\r\n\r\n\t\t// this.table.columnManager.element.append(this.topElement);\r\n\t\tthis.table.columnManager.getElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling);\r\n\r\n\t\tthis.subscribe(\"row-deleting\", this.detachRow.bind(this));\r\n\t\tthis.subscribe(\"rows-visible\", this.visibleRows.bind(this));\r\n\r\n\t\tthis.registerDisplayHandler(this.getRows.bind(this), 10);\r\n\t}\r\n\r\n\tisRowFrozen(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\t\treturn index > -1;\r\n\t}\r\n\r\n\tisFrozen(){\r\n\t\treturn !!this.rows.length;\r\n\t}\r\n\r\n\tvisibleRows(viewable, rows){\r\n\t\tthis.rows.forEach((row) => {\r\n\t\t\trows.push(row);\r\n\t\t});\r\n\r\n\t\treturn rows;\r\n\t}\r\n\r\n\t//filter frozen rows out of display data\r\n\tgetRows(rows){\r\n\t\tvar self = this,\r\n\t\tfrozen = [],\r\n\t\toutput = rows.slice(0);\r\n\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\tvar index = output.indexOf(row);\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\toutput.splice(index, 1);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tfreezeRow(row){\r\n\t\tif(!row.modules.frozen){\r\n\t\t\trow.modules.frozen = true;\r\n\t\t\tthis.topElement.appendChild(row.getElement());\r\n\t\t\trow.initialize();\r\n\t\t\trow.normalizeHeight();\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\tthis.rows.push(row);\r\n\r\n\t\t\tthis.refreshData(false, \"display\")\r\n\r\n\t\t\tthis.styleRows();\r\n\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Freeze Error - Row is already frozen\");\r\n\t\t}\r\n\t}\r\n\r\n\tunfreezeRow(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\r\n\t\tif(row.modules.frozen){\r\n\r\n\t\t\trow.modules.frozen = false;\r\n\r\n\t\t\tthis.detachRow(row);\r\n\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\tthis.refreshData(false, \"display\")\r\n\r\n\t\t\tif(this.rows.length){\r\n\t\t\t\tthis.styleRows();\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Freeze Error - Row is already unfrozen\");\r\n\t\t}\r\n\t}\r\n\r\n\tdetachRow(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tvar rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\r\n\t\t\tthis.rows.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\tstyleRows(row){\r\n\t\tthis.rows.forEach((row, i) => {\r\n\t\t\tthis.table.rowManager.styleRow(row, i);\r\n\t\t});\r\n\t}\r\n}\r\n\r\nFrozenRows.moduleName = \"frozenRows\";\r\n\r\nexport default FrozenRows;","//public group object\r\nclass GroupComponent {\r\n\tconstructor (group){\r\n\t\tthis._group = group;\r\n\t\tthis.type = \"GroupComponent\";\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._group.groupManager.table.componentFunctionBinder.handle(\"row\", target._group, name)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\tgetKey(){\r\n\t\treturn this._group.key;\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._group.field;\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._group.element;\r\n\t}\r\n\r\n\tgetRows(){\r\n\t\treturn this._group.getRows(true);\r\n\t}\r\n\r\n\tgetSubGroups(){\r\n\t\treturn this._group.getSubGroups(true);\r\n\t}\r\n\r\n\tgetParentGroup(){\r\n\t\treturn this._group.parent ? this._group.parent.getComponent() : false;\r\n\t}\r\n\r\n\tisVisible(){\r\n\t\treturn this._group.visible;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tthis._group.show();\r\n\t}\r\n\r\n\thide(){\r\n\t\tthis._group.hide();\r\n\t}\r\n\r\n\ttoggle(){\r\n\t\tthis._group.toggleVisibility();\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._group;\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._group.groupManager.table;\r\n\t}\r\n}\r\n\r\nexport default GroupComponent;","import Helpers from '../../core/tools/Helpers.js';\r\nimport GroupComponent from './GroupComponent.js';\r\n\r\n//Group functions\r\nclass Group{\r\n\t\r\n\tconstructor(groupManager, parent, level, key, field, generator, oldGroup){\r\n\t\tthis.groupManager = groupManager;\r\n\t\tthis.parent = parent;\r\n\t\tthis.key = key;\r\n\t\tthis.level = level;\r\n\t\tthis.field = field;\r\n\t\tthis.hasSubGroups = level < (groupManager.groupIDLookups.length - 1);\r\n\t\tthis.addRow = this.hasSubGroups ? this._addRowToGroup : this._addRow;\r\n\t\tthis.type = \"group\"; //type of element\r\n\t\tthis.old = oldGroup;\r\n\t\tthis.rows = [];\r\n\t\tthis.groups = [];\r\n\t\tthis.groupList = [];\r\n\t\tthis.generator = generator;\r\n\t\tthis.element = false;\r\n\t\tthis.elementContents = false;\r\n\t\tthis.height = 0;\r\n\t\tthis.outerHeight = 0;\r\n\t\tthis.initialized = false;\r\n\t\tthis.calcs = {};\r\n\t\tthis.initialized = false;\r\n\t\tthis.modules = {};\r\n\t\tthis.arrowElement = false;\r\n\t\t\r\n\t\tthis.visible = oldGroup ? oldGroup.visible : (typeof groupManager.startOpen[level] !== \"undefined\" ? groupManager.startOpen[level] : groupManager.startOpen[0]);\r\n\t\t\r\n\t\tthis.component = null;\r\n\t\t\r\n\t\tthis.createElements();\r\n\t\tthis.addBindings();\r\n\t\t\r\n\t\tthis.createValueGroups();\r\n\t}\r\n\t\r\n\twipe(){\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\tgroup.wipe();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\tif(row.modules){\r\n\t\t\t\t\tdelete row.modules.group;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tthis.element = false;\r\n\t\tthis.arrowElement = false;\r\n\t\tthis.elementContents = false;\r\n\t}\r\n\t\r\n\tcreateElements(){\r\n\t\tvar arrow = document.createElement(\"div\");\r\n\t\tarrow.classList.add(\"tabulator-arrow\");\r\n\t\t\r\n\t\tthis.element = document.createElement(\"div\");\r\n\t\tthis.element.classList.add(\"tabulator-row\");\r\n\t\tthis.element.classList.add(\"tabulator-group\");\r\n\t\tthis.element.classList.add(\"tabulator-group-level-\" + this.level);\r\n\t\tthis.element.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\tthis.arrowElement = document.createElement(\"div\");\r\n\t\tthis.arrowElement.classList.add(\"tabulator-group-toggle\");\r\n\t\tthis.arrowElement.appendChild(arrow);\r\n\t\t\r\n\t\t//setup movable rows\r\n\t\tif(this.groupManager.table.options.movableRows !== false && this.groupManager.table.modExists(\"moveRow\")){\r\n\t\t\tthis.groupManager.table.modules.moveRow.initializeGroupHeader(this);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcreateValueGroups(){\r\n\t\tvar level = this.level + 1;\r\n\t\tif(this.groupManager.allowedValues && this.groupManager.allowedValues[level]){\r\n\t\t\tthis.groupManager.allowedValues[level].forEach((value) => {\r\n\t\t\t\tthis._createGroup(value, level);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\taddBindings(){\r\n\t\tvar toggleElement;\r\n\t\t\r\n\t\tif(this.groupManager.table.options.groupToggleElement){\r\n\t\t\ttoggleElement = this.groupManager.table.options.groupToggleElement == \"arrow\" ? this.arrowElement : this.element;\r\n\t\t\t\r\n\t\t\ttoggleElement.addEventListener(\"click\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\tthis.toggleVisibility();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\t_createGroup(groupID, level){\r\n\t\tvar groupKey = level + \"_\" + groupID;\r\n\t\tvar group = new Group(this.groupManager, this, level, groupID, this.groupManager.groupIDLookups[level].field, this.groupManager.headerGenerator[level] || this.groupManager.headerGenerator[0], this.old ? this.old.groups[groupKey] : false);\r\n\t\t\r\n\t\tthis.groups[groupKey] = group;\r\n\t\tthis.groupList.push(group);\r\n\t}\r\n\t\r\n\t_addRowToGroup(row){\r\n\t\t\r\n\t\tvar level = this.level + 1;\r\n\t\t\r\n\t\tif(this.hasSubGroups){\r\n\t\t\tvar groupID = this.groupManager.groupIDLookups[level].func(row.getData()),\r\n\t\t\tgroupKey = level + \"_\" + groupID;\r\n\t\t\t\r\n\t\t\tif(this.groupManager.allowedValues && this.groupManager.allowedValues[level]){\r\n\t\t\t\tif(this.groups[groupKey]){\r\n\t\t\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(!this.groups[groupKey]){\r\n\t\t\t\t\tthis._createGroup(groupID, level);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_addRow(row){\r\n\t\tthis.rows.push(row);\r\n\t\trow.modules.group = this;\r\n\t}\r\n\t\r\n\tinsertRow(row, to, after){\r\n\t\tvar data = this.conformRowData({});\r\n\t\t\r\n\t\trow.updateData(data);\r\n\t\t\r\n\t\tvar toIndex = this.rows.indexOf(to);\r\n\t\t\r\n\t\tif(toIndex > -1){\r\n\t\t\tif(after){\r\n\t\t\t\tthis.rows.splice(toIndex+1, 0, row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.splice(toIndex, 0, row);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(after){\r\n\t\t\t\tthis.rows.push(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.unshift(row);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\trow.modules.group = this;\r\n\t\t\r\n\t\tthis.generateGroupHeaderContents();\r\n\t\t\r\n\t\tif(this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\tthis.groupManager.table.modules.columnCalcs.recalcGroup(this);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.updateGroupRows(true);\r\n\t}\r\n\t\r\n\tscrollHeader(left){\r\n\t\tif(this.arrowElement){\r\n\t\t\tthis.arrowElement.style.marginLeft = left;\r\n\t\t\t\r\n\t\t\tthis.groupList.forEach(function(child){\r\n\t\t\t\tchild.scrollHeader(left);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRowIndex(row){}\r\n\t\r\n\t//update row data to match grouping contraints\r\n\tconformRowData(data){\r\n\t\tif(this.field){\r\n\t\t\tdata[this.field] = this.key;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Data Conforming Error - Cannot conform row data to match new group as groupBy is a function\");\r\n\t\t}\r\n\t\t\r\n\t\tif(this.parent){\r\n\t\t\tdata = this.parent.conformRowData(data);\r\n\t\t}\r\n\t\t\r\n\t\treturn data;\r\n\t}\r\n\t\r\n\tremoveRow(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\t\tvar el = row.getElement();\r\n\t\t\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.rows.splice(index, 1);\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.groupManager.table.options.groupValues && !this.rows.length){\r\n\t\t\tif(this.parent){\r\n\t\t\t\tthis.parent.removeGroup(this);\r\n\t\t\t}else{\r\n\t\t\t\tthis.groupManager.removeGroup(this);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tif(el.parentNode){\r\n\t\t\t\tel.parentNode.removeChild(el);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.generateGroupHeaderContents();\r\n\t\t\t\r\n\t\t\tif(this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\t\tthis.groupManager.table.modules.columnCalcs.recalcGroup(this);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveGroup(group){\r\n\t\tvar groupKey = group.level + \"_\" + group.key,\r\n\t\tindex;\r\n\t\t\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tdelete this.groups[groupKey];\r\n\t\t\t\r\n\t\t\tindex = this.groupList.indexOf(group);\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.groupList.splice(index, 1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(!this.groupList.length){\r\n\t\t\t\tif(this.parent){\r\n\t\t\t\t\tthis.parent.removeGroup(this);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.groupManager.removeGroup(this);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetHeadersAndRows(noCalc){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\toutput.push(this);\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(this.visible){\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\t\toutput = output.concat(group.getHeadersAndRows(noCalc));\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tif(!noCalc && this.groupManager.table.options.columnCalcs != \"table\" && this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.modules.columnCalcs.hasTopCalcs()){\r\n\t\t\t\t\tif(this.calcs.top){\r\n\t\t\t\t\t\tthis.calcs.top.detachElement();\r\n\t\t\t\t\t\tthis.calcs.top.deleteCells();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows);\r\n\t\t\t\t\toutput.push(this.calcs.top);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\toutput = output.concat(this.rows);\r\n\t\t\t\t\r\n\t\t\t\tif(!noCalc && this.groupManager.table.options.columnCalcs != \"table\" && this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()){\r\n\t\t\t\t\tif(this.calcs.bottom){\r\n\t\t\t\t\t\tthis.calcs.bottom.detachElement();\r\n\t\t\t\t\t\tthis.calcs.bottom.deleteCells();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows);\r\n\t\t\t\t\toutput.push(this.calcs.bottom);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!this.groupList.length && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\t\t\r\n\t\t\t\tif(this.groupManager.table.modExists(\"columnCalcs\")){\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!noCalc && this.groupManager.table.modules.columnCalcs.hasTopCalcs()){\r\n\t\t\t\t\t\tif(this.calcs.top){\r\n\t\t\t\t\t\t\tthis.calcs.top.detachElement();\r\n\t\t\t\t\t\t\tthis.calcs.top.deleteCells();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.groupManager.table.options.groupClosedShowCalcs){\r\n\t\t\t\t\t\t\tthis.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows);\r\n\t\t\t\t\t\t\toutput.push(this.calcs.top);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!noCalc && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()){\r\n\t\t\t\t\t\tif(this.calcs.bottom){\r\n\t\t\t\t\t\t\tthis.calcs.bottom.detachElement();\r\n\t\t\t\t\t\t\tthis.calcs.bottom.deleteCells();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.groupManager.table.options.groupClosedShowCalcs){\r\n\t\t\t\t\t\t\tthis.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows);\r\n\t\t\t\t\t\t\toutput.push(this.calcs.bottom);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetData(visible, transform){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(!visible || (visible && this.visible)){\r\n\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\toutput.push(row.getData(transform || \"data\"));\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetRowCount(){\r\n\t\tvar count = 0;\r\n\t\t\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\tcount += group.getRowCount();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tcount = this.rows.length;\r\n\t\t}\r\n\t\treturn count;\r\n\t}\r\n\t\r\n\ttoggleVisibility(){\r\n\t\tif(this.visible){\r\n\t\t\tthis.hide();\r\n\t\t}else{\r\n\t\t\tthis.show();\r\n\t\t}\r\n\t}\r\n\t\r\n\thide(){\r\n\t\tthis.visible = false;\r\n\t\t\r\n\t\tif(this.groupManager.table.rowManager.getRenderMode() == \"classic\" && !this.groupManager.table.options.pagination){\r\n\t\t\t\r\n\t\t\tthis.element.classList.remove(\"tabulator-group-visible\");\r\n\t\t\t\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar rows = group.getHeadersAndRows();\r\n\t\t\t\t\t\r\n\t\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\t\trow.detachElement();\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());\r\n\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth();\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.table.externalEvents.dispatch(\"groupVisibilityChanged\", this.getComponent(), false);\r\n\t}\r\n\t\r\n\tshow(){\r\n\t\tthis.visible = true;\r\n\t\t\r\n\t\tif(this.groupManager.table.rowManager.getRenderMode() == \"classic\" && !this.groupManager.table.options.pagination){\r\n\t\t\t\r\n\t\t\tthis.element.classList.add(\"tabulator-group-visible\");\r\n\t\t\t\r\n\t\t\tvar prev = this.generateElement();\r\n\t\t\t\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\t\tvar rows = group.getHeadersAndRows();\r\n\t\t\t\t\t\r\n\t\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\t\tprev.parentNode.insertBefore(rowEl, prev.nextSibling);\r\n\t\t\t\t\t\trow.initialize();\r\n\t\t\t\t\t\tprev = rowEl;\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\tprev.parentNode.insertBefore(rowEl, prev.nextSibling);\r\n\t\t\t\t\trow.initialize();\r\n\t\t\t\t\tprev = rowEl;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());\r\n\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth();\r\n\t\t}else{\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.table.externalEvents.dispatch(\"groupVisibilityChanged\", this.getComponent(), true);\r\n\t}\r\n\t\r\n\t_visSet(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tif(typeof this.visible == \"function\"){\r\n\t\t\t\r\n\t\t\tthis.rows.forEach(function(row){\r\n\t\t\t\tdata.push(row.getData());\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.visible = this.visible(this.key, this.getRowCount(), data, this.getComponent());\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRowGroup(row){\r\n\t\tvar match = false;\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\tvar result = group.getRowGroup(row);\r\n\t\t\t\t\r\n\t\t\t\tif(result){\r\n\t\t\t\t\tmatch = result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tif(this.rows.find(function(item){\r\n\t\t\t\treturn item === row;\r\n\t\t\t})){\r\n\t\t\t\tmatch = this;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn match;\r\n\t}\r\n\t\r\n\tgetSubGroups(component){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.groupList.forEach(function(child){\r\n\t\t\toutput.push(component ? child.getComponent() : child);\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetRows(compoment){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\toutput.push(compoment ? row.getComponent() : row);\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgenerateGroupHeaderContents(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\tdata.push(row.getData());\r\n\t\t});\r\n\t\t\r\n\t\tthis.elementContents = this.generator(this.key, this.getRowCount(), data, this.getComponent());\r\n\t\t\r\n\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\r\n\t\tif(typeof this.elementContents === \"string\"){\r\n\t\t\tthis.element.innerHTML = this.elementContents;\r\n\t\t}else{\r\n\t\t\tthis.element.appendChild(this.elementContents);\r\n\t\t}\r\n\t\t\r\n\t\tthis.element.insertBefore(this.arrowElement, this.element.firstChild);\r\n\t}\r\n\t\r\n\tgetPath(path = []) {\r\n\t\tpath.unshift(this.key);\r\n\t\tif(this.parent) {\r\n\t\t\tthis.parent.getPath(path);\r\n\t\t}\r\n\t\treturn path;\r\n\t}\r\n\t\r\n\t////////////// Standard Row Functions //////////////\r\n\t\r\n\tgetElement(){\r\n\t\treturn this.elementContents ? this.element : this.generateElement();\r\n\t}\r\n\t\r\n\tgenerateElement(){\r\n\t\tthis.addBindings = false;\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(this.visible){\r\n\t\t\tthis.element.classList.add(\"tabulator-group-visible\");\r\n\t\t}else{\r\n\t\t\tthis.element.classList.remove(\"tabulator-group-visible\");\r\n\t\t}\r\n\t\t\r\n\t\tfor(var i = 0; i < this.element.childNodes.length; ++i){\r\n\t\t\tthis.element.childNodes[i].parentNode.removeChild(this.element.childNodes[i]);\r\n\t\t}\r\n\t\t\r\n\t\tthis.generateGroupHeaderContents();\r\n\t\t\r\n\t\t// this.addBindings();\r\n\t\t\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\tdetachElement(){\r\n\t\tif (this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//normalize the height of elements in the row\r\n\tnormalizeHeight(){\r\n\t\tthis.setHeight(this.element.clientHeight);\r\n\t}\r\n\t\r\n\tinitialize(force){\r\n\t\tif(!this.initialized || force){\r\n\t\t\tthis.normalizeHeight();\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitialize(){\r\n\t\tthis.initialized = false;\r\n\t\tthis.height = 0;\r\n\t\t\r\n\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\tthis.initialize(true);\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetHeight(height){\r\n\t\tif(this.height != height){\r\n\t\t\tthis.height = height;\r\n\t\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return rows outer height\r\n\tgetHeight(){\r\n\t\treturn this.outerHeight;\r\n\t}\r\n\t\r\n\tgetGroup(){\r\n\t\treturn this;\r\n\t}\r\n\t\r\n\treinitializeHeight(){}\r\n\t\r\n\tcalcHeight(){}\r\n\t\r\n\tsetCellHeight(){}\r\n\t\r\n\tclearCellHeight(){}\r\n\t\r\n\tdeinitializeHeight(){}\r\n\t\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new GroupComponent(this);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n\r\nexport default Group;","import Module from '../../core/Module.js';\r\n\r\nimport GroupComponent from './GroupComponent.js';\r\nimport Group from './Group.js';\r\n\r\nclass GroupRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.groupIDLookups = false; //enable table grouping and set field to group by\r\n\t\tthis.startOpen = [function(){return false;}]; //starting state of group\r\n\t\tthis.headerGenerator = [function(){return \"\";}];\r\n\t\tthis.groupList = []; //ordered list of groups\r\n\t\tthis.allowedValues = false;\r\n\t\tthis.groups = {}; //hold row groups\r\n\t\tthis.displayIndex = 0; //index in display pipeline\r\n\r\n\t\tthis.displayHandler = this.getRows.bind(this);\r\n\r\n\t\t//register table options\r\n\t\tthis.registerTableOption(\"groupBy\", false); //enable table grouping and set field to group by\r\n\t\tthis.registerTableOption(\"groupStartOpen\", true); //starting state of group\r\n\t\tthis.registerTableOption(\"groupValues\", false);\r\n\t\tthis.registerTableOption(\"groupUpdateOnCellEdit\", false);\r\n\t\tthis.registerTableOption(\"groupHeader\", false); //header generation function\r\n\t\tthis.registerTableOption(\"groupHeaderPrint\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderClipboard\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderHtmlOutput\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderDownload\", null);\r\n\t\tthis.registerTableOption(\"groupToggleElement\", \"arrow\");\r\n\t\tthis.registerTableOption(\"groupClosedShowCalcs\", false);\r\n\r\n\t\t//register table functions\r\n\t\tthis.registerTableFunction(\"setGroupBy\", this.setGroupBy.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupValues\", this.setGroupValues.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupStartOpen\", this.setGroupStartOpen.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupHeader\", this.setGroupHeader.bind(this));\r\n\t\tthis.registerTableFunction(\"getGroups\", this.userGetGroups.bind(this));\r\n\t\tthis.registerTableFunction(\"getGroupedData\", this.userGetGroupedData.bind(this));\r\n\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"getGroup\", this.rowGetGroup.bind(this));\r\n\t}\r\n\r\n\t//initialize group configuration\r\n\tinitialize(){\r\n\t\tif(this.table.options.groupBy){\r\n\r\n\t\t\tif(this.table.options.groupUpdateOnCellEdit){\r\n\t\t\t\tthis.subscribe(\"cell-value-updated\", this.cellUpdated.bind(this));\r\n\t\t\t\tthis.subscribe(\"row-data-changed\", this.reassignRowToGroup.bind(this), 0);\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"table-built\", this.configureGroupSetup.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"row-deleting\", this.rowDeleting.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHeaders.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.wipe.bind(this));\r\n\t\t\tthis.subscribe(\"rows-added\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"row-moving\", this.rowMoving.bind(this));\r\n\t\t\tthis.subscribe(\"row-adding-index\", this.rowAddingIndex.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"rows-sample\", this.rowSample.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"render-virtual-fill\", this.virtualRenderFill.bind(this));\r\n\r\n\t\t\tthis.registerDisplayHandler(this.displayHandler, 20);\r\n\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\r\n\tconfigureGroupSetup(){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tvar groupBy = this.table.options.groupBy,\r\n\t\t\tstartOpen = this.table.options.groupStartOpen,\r\n\t\t\tgroupHeader = this.table.options.groupHeader;\r\n\r\n\t\t\tthis.allowedValues = this.table.options.groupValues;\r\n\r\n\t\t\tif(Array.isArray(groupBy) && Array.isArray(groupHeader) && groupBy.length > groupHeader.length){\r\n\t\t\t\tconsole.warn(\"Error creating group headers, groupHeader array is shorter than groupBy array\");\r\n\t\t\t}\r\n\r\n\t\t\tthis.headerGenerator = [function(){return \"\";}];\r\n\t\t\tthis.startOpen = [function(){return false;}]; //starting state of group\r\n\r\n\t\t\tthis.langBind(\"groups|item\", (langValue, lang) => {\r\n\t\t\t\tthis.headerGenerator[0] = (value, count, data) => { //header layout function\r\n\t\t\t\t\treturn (typeof value === \"undefined\" ? \"\" : value) + \"(\" + count + \" \" + ((count === 1) ? langValue : lang.groups.items) + \")\";\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tthis.groupIDLookups = [];\r\n\r\n\t\t\tif(Array.isArray(groupBy) || groupBy){\r\n\t\t\t\tif(this.table.modExists(\"columnCalcs\") && this.table.options.columnCalcs != \"table\" && this.table.options.columnCalcs != \"both\"){\r\n\t\t\t\t\tthis.table.modules.columnCalcs.removeCalcs();\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.modExists(\"columnCalcs\") && this.table.options.columnCalcs != \"group\"){\r\n\r\n\t\t\t\t\tvar cols = this.table.columnManager.getRealColumns();\r\n\r\n\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\tif(col.definition.topCalc){\r\n\t\t\t\t\t\t\tthis.table.modules.columnCalcs.initializeTopRow();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(col.definition.bottomCalc){\r\n\t\t\t\t\t\t\tthis.table.modules.columnCalcs.initializeBottomRow();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(!Array.isArray(groupBy)){\r\n\t\t\t\tgroupBy = [groupBy];\r\n\t\t\t}\r\n\r\n\t\t\tgroupBy.forEach((group, i) => {\r\n\t\t\t\tvar lookupFunc, column;\r\n\r\n\t\t\t\tif(typeof group == \"function\"){\r\n\t\t\t\t\tlookupFunc = group;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolumn = this.table.columnManager.getColumnByField(group);\r\n\r\n\t\t\t\t\tif(column){\r\n\t\t\t\t\t\tlookupFunc = function(data){\r\n\t\t\t\t\t\t\treturn column.getFieldValue(data);\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tlookupFunc = function(data){\r\n\t\t\t\t\t\t\treturn data[group];\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.groupIDLookups.push({\r\n\t\t\t\t\tfield: typeof group === \"function\" ? false : group,\r\n\t\t\t\t\tfunc:lookupFunc,\r\n\t\t\t\t\tvalues:this.allowedValues ? this.allowedValues[i] : false,\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t\tif(startOpen){\r\n\t\t\t\tif(!Array.isArray(startOpen)){\r\n\t\t\t\t\tstartOpen = [startOpen];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstartOpen.forEach((level) => {\r\n\t\t\t\t\tlevel = typeof level == \"function\" ? level : function(){return true;};\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.startOpen = startOpen;\r\n\t\t\t}\r\n\r\n\t\t\tif(groupHeader){\r\n\t\t\t\tthis.headerGenerator = Array.isArray(groupHeader) ? groupHeader : [groupHeader];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trowSample(rows, prevValue){\r\n\t\tvar group = this.getGroups(false)[0];\r\n\r\n\t\tprevValue.push(group.getRows(false)[0]);\r\n\r\n\t\treturn prevValue;\r\n\t}\r\n\r\n\tvirtualRenderFill(){\r\n\t\tvar el = this.table.rowManager.tableElement;\r\n\t\tvar rows = this.table.rowManager.getVisibleRows();\r\n\r\n\t\trows = rows.filter((row) => {\r\n\t\t\treturn row.type !== \"group\";\r\n\t\t});\r\n\r\n\t\tel.style.minWidth = !rows.length ? this.table.columnManager.getWidth() + \"px\" : \"\";\r\n\r\n\t\t// if(this.table.options.groupBy){\r\n\t\t// \tif(this.layoutMode() != \"fitDataFill\" && rowsCount == this.table.modules.groupRows.countGroups()){\r\n\t\t// \t\tel.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t// \t}\r\n\t\t// }\r\n\t}\r\n\r\n\trowAddingIndex(row, index, top){\r\n\t\tthis.assignRowToGroup(row);\r\n\r\n\t\tvar groupRows = row.modules.group.rows;\r\n\r\n\t\tif(groupRows.length > 1){\r\n\t\t\tif(!index || (index && groupRows.indexOf(index) == -1)){\r\n\t\t\t\tif(top){\r\n\t\t\t\t\tif(groupRows[0] !== row){\r\n\t\t\t\t\t\tindex = groupRows[0];\r\n\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(groupRows[groupRows.length -1] !== row){\r\n\t\t\t\t\t\tindex = groupRows[groupRows.length -1];\r\n\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn index;\r\n\t}\r\n\r\n\ttrackChanges(){\r\n\t\tthis.dispatch(\"group-changed\");\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tsetGroupBy(groups){\r\n\t\tthis.table.options.groupBy = groups;\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.initialize();\r\n\t\t}else{\r\n\t\t\tthis.configureGroupSetup();\r\n\t\t}\r\n\r\n\t\tthis.refreshData();\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\tsetGroupValues(groupValues){\r\n\t\tthis.table.options.groupValues = groupValues;\r\n\t\tthis.configureGroupSetup();\r\n\t\tthis.refreshData();\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\tsetGroupStartOpen(values){\r\n\t\tthis.table.options.groupStartOpen = values;\r\n\t\tthis.configureGroupSetup();\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\r\n\t\t\tthis.trackChanges();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Grouping Update - cant refresh view, no groups have been set\");\r\n\t\t}\r\n\t}\r\n\r\n\tsetGroupHeader(values){\r\n\t\tthis.table.options.groupHeader = values;\r\n\t\tthis.configureGroupSetup();\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\r\n\t\t\tthis.trackChanges();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Grouping Update - cant refresh view, no groups have been set\");\r\n\t\t}\r\n\t}\r\n\r\n\tuserGetGroups(values){\r\n\t\treturn this.getGroups(true);\r\n\t}\r\n\r\n\t// get grouped table data in the same format as getData()\r\n\tuserGetGroupedData(){\r\n\t\treturn this.table.options.groupBy ?\r\n\t\tthis.getGroupedData() : this.getData()\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////////\r\n\t///////// Component Functions /////////\r\n\t///////////////////////////////////////\r\n\r\n\trowGetGroup(row){\r\n\t\treturn row.modules.group ? row.modules.group.getComponent() : false;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\trowMoving(from, to, after){\r\n\t\tif(!after && to instanceof Group){\r\n\t\t\tto = this.table.rowManager.prevDisplayRow(from) || to;\r\n\t\t}\r\n\r\n\t\tvar toGroup = to instanceof Group ? to : to.modules.group;\r\n\t\tvar fromGroup = from instanceof Group ? from : from.modules.group;\r\n\r\n\t\tif(toGroup === fromGroup){\r\n\t\t\tthis.table.rowManager.moveRowInArray(toGroup.rows, from, to, after);\r\n\t\t}else{\r\n\t\t\tif(fromGroup){\r\n\t\t\t\tfromGroup.removeRow(from);\r\n\t\t\t}\r\n\r\n\t\t\ttoGroup.insertRow(from, to, after);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trowDeleting(row){\r\n\t\t//remove from group\r\n\t\tif(row.modules.group){\r\n\t\t\trow.modules.group.removeRow(row);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trowsUpdated(row){\r\n\t\tthis.updateGroupRows(true);\r\n\t}\r\n\r\n\tcellUpdated(cell){\r\n\t\tthis.reassignRowToGroup(cell.row);\r\n\t}\r\n\r\n\r\n\tsetDisplayIndex(index){\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\r\n\tgetDisplayIndex(){\r\n\t\treturn this.displayIndex;\r\n\t}\r\n\r\n\t//return appropriate rows with group headers\r\n\tgetRows(rows){\r\n\t\tif(this.table.options.groupBy && this.groupIDLookups.length){\r\n\r\n\t\t\tthis.dispatchExternal(\"dataGrouping\");\r\n\r\n\t\t\tthis.generateGroups(rows);\r\n\r\n\t\t\tif(this.subscribedExternal(\"dataGrouped\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataGrouped\", this.getGroups(true));\r\n\t\t\t}\r\n\r\n\t\t\treturn this.updateGroupRows();\r\n\r\n\t\t}else{\r\n\t\t\treturn rows.slice(0);\r\n\t\t}\r\n\t}\r\n\r\n\tgetGroups(component){\r\n\t\tvar groupComponents = [];\r\n\r\n\t\tthis.groupList.forEach(function(group){\r\n\t\t\tgroupComponents.push(component ? group.getComponent() : group);\r\n\t\t});\r\n\r\n\t\treturn groupComponents;\r\n\t}\r\n\r\n\tgetChildGroups(group){\r\n\t\tvar groupComponents = [];\r\n\r\n\t\tif(!group){\r\n\t\t\tgroup = this;\r\n\t\t}\r\n\r\n\t\tgroup.groupList.forEach((child) => {\r\n\t\t\tif(child.groupList.length){\r\n\t\t\t\tgroupComponents = groupComponents.concat(this.getChildGroups(child));\r\n\t\t\t}else{\r\n\t\t\t\tgroupComponents.push(child);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn groupComponents;\r\n\t}\r\n\r\n\twipe(){\r\n\t\tthis.groupList.forEach(function(group){\r\n\t\t\tgroup.wipe();\r\n\t\t});\r\n\t}\r\n\r\n\tpullGroupListData(groupList) {\r\n\t\tvar groupListData = [];\r\n\r\n\t\tgroupList.forEach((group) => {\r\n\t\t\tvar groupHeader = {};\r\n\t\t\tgroupHeader.level = 0;\r\n\t\t\tgroupHeader.rowCount = 0;\r\n\t\t\tgroupHeader.headerContent = \"\";\r\n\t\t\tvar childData = [];\r\n\r\n\t\t\tif (group.hasSubGroups) {\r\n\t\t\t\tchildData = this.pullGroupListData(group.groupList);\r\n\r\n\t\t\t\tgroupHeader.level = group.level;\r\n\t\t\t\tgroupHeader.rowCount = childData.length - group.groupList.length; // data length minus number of sub-headers\r\n\t\t\t\tgroupHeader.headerContent = group.generator(group.key, groupHeader.rowCount, group.rows, group);\r\n\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\t\t\t\tgroupListData = groupListData.concat(childData);\r\n\t\t\t}\r\n\r\n\t\t\telse {\r\n\t\t\t\tgroupHeader.level = group.level;\r\n\t\t\t\tgroupHeader.headerContent = group.generator(group.key, group.rows.length, group.rows, group);\r\n\t\t\t\tgroupHeader.rowCount = group.getRows().length;\r\n\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\r\n\t\t\t\tgroup.getRows().forEach((row) => {\r\n\t\t\t\t\tgroupListData.push(row.getData(\"data\"));\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn groupListData\r\n\t}\r\n\r\n\tgetGroupedData(){\r\n\r\n\t\treturn this.pullGroupListData(this.groupList);\r\n\t}\r\n\r\n\tgetRowGroup(row){\r\n\t\tvar match = false;\r\n\r\n\t\tif(this.options(\"dataTree\")){\r\n\t\t\trow = this.table.modules.dataTree.getTreeParentRoot(row);\r\n\t\t}\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\tvar result = group.getRowGroup(row);\r\n\r\n\t\t\tif(result){\r\n\t\t\t\tmatch = result;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tcountGroups(){\r\n\t\treturn this.groupList.length;\r\n\t}\r\n\r\n\tgenerateGroups(rows){\r\n\t\tvar oldGroups = this.groups;\r\n\r\n\t\tthis.groups = {};\r\n\t\tthis.groupList = [];\r\n\r\n\t\tif(this.allowedValues && this.allowedValues[0]){\r\n\t\t\tthis.allowedValues[0].forEach((value) => {\r\n\t\t\t\tthis.createGroup(value, 0, oldGroups);\r\n\t\t\t});\r\n\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.assignRowToExistingGroup(row, oldGroups);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.assignRowToGroup(row, oldGroups);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tcreateGroup(groupID, level, oldGroups){\r\n\t\tvar groupKey = level + \"_\" + groupID,\r\n\t\tgroup;\r\n\r\n\t\toldGroups = oldGroups || [];\r\n\r\n\t\tgroup = new Group(this, false, level, groupID, this.groupIDLookups[0].field, this.headerGenerator[0], oldGroups[groupKey]);\r\n\r\n\t\tthis.groups[groupKey] = group;\r\n\t\tthis.groupList.push(group);\r\n\t}\r\n\r\n\tassignRowToExistingGroup(row, oldGroups){\r\n\t\tvar groupID = this.groupIDLookups[0].func(row.getData()),\r\n\t\tgroupKey = \"0_\" + groupID;\r\n\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t}\r\n\t}\r\n\r\n\tassignRowToGroup(row, oldGroups){\r\n\t\tvar groupID = this.groupIDLookups[0].func(row.getData()),\r\n\t\tnewGroupNeeded = !this.groups[\"0_\" + groupID];\r\n\r\n\t\tif(newGroupNeeded){\r\n\t\t\tthis.createGroup(groupID, 0, oldGroups);\r\n\t\t}\r\n\r\n\t\tthis.groups[\"0_\" + groupID].addRow(row);\r\n\r\n\t\treturn !newGroupNeeded;\r\n\t}\r\n\r\n\treassignRowToGroup(row){\r\n\t\tif(row.type === \"row\"){\r\n\t\t\tvar oldRowGroup = row.modules.group,\r\n\t\t\toldGroupPath = oldRowGroup.getPath(),\r\n\t\t\tnewGroupPath = this.getExpectedPath(row),\r\n\t\t\tsamePath = true;\r\n\r\n\t\t\t// figure out if new group path is the same as old group path\r\n\t\t\tvar samePath = (oldGroupPath.length == newGroupPath.length) && oldGroupPath.every((element, index) => {\r\n\t\t\t\treturn element === newGroupPath[index];\r\n\t\t\t});\r\n\r\n\t\t\t// refresh if they new path and old path aren't the same (aka the row's groupings have changed)\r\n\t\t\tif(!samePath) {\r\n\t\t\t\toldRowGroup.removeRow(row);\r\n\t\t\t\tthis.assignRowToGroup(row, this.groups);\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgetExpectedPath(row) {\r\n\t\tvar groupPath = [], rowData = row.getData();\r\n\r\n\t\tthis.groupIDLookups.forEach((groupId) => {\r\n\t\t\tgroupPath.push(groupId.func(rowData));\r\n\t\t});\r\n\r\n\t\treturn groupPath;\r\n\t}\r\n\r\n\tupdateGroupRows(force){\r\n\t\tvar output = [],\r\n\t\toldRowCount;\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\toutput = output.concat(group.getHeadersAndRows());\r\n\t\t});\r\n\r\n\t\tif(force){\r\n\t\t\tthis.refreshData(true, this.displayHandler);\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tscrollHeaders(left){\r\n\t\tif(this.table.options.renderHorizontal === \"virtual\"){\r\n\t\t\tleft -= this.table.columnManager.renderer.vDomPadLeft;\r\n\t\t}\r\n\r\n\t\tleft = left + \"px\";\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\tgroup.scrollHeader(left);\r\n\t\t});\r\n\t}\r\n\r\n\tremoveGroup(group){\r\n\t\tvar groupKey = group.level + \"_\" + group.key,\r\n\t\tindex;\r\n\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tdelete this.groups[groupKey];\r\n\r\n\t\t\tindex = this.groupList.indexOf(group);\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.groupList.splice(index, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nGroupRows.moduleName = \"groupRows\";\r\n\r\nexport default GroupRows;","export default {\r\n\tcellEdit: function(action){\r\n\t\taction.component.setValueProcessData(action.data.oldValue);\r\n\t\taction.component.cellRendered();\r\n\t},\r\n\r\n\trowAdd: function(action){\r\n\t\taction.component.deleteActual();\r\n\t},\r\n\r\n\trowDelete: function(action){\r\n\t\tvar newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index);\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tthis.table.modules.groupRows.updateGroupRows(true);\r\n\t\t}\r\n\r\n\t\tthis._rebindRow(action.component, newRow);\r\n\t},\r\n\r\n\trowMove: function(action){\r\n\t\tthis.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posFrom], !action.data.after);\r\n\t\tthis.table.rowManager.redraw();\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\nimport Row from '../../core/row/Row.js';\r\nimport Cell from '../../core/cell/Cell.js';\r\n\r\nimport defaultUndoers from './defaults/undoers.js';\r\nimport defaultRedoers from './defaults/redoers.js';\r\n\r\nclass History extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.history = [];\r\n\t\tthis.index = -1;\r\n\r\n\t\tthis.registerTableOption(\"history\", false); //enable edit history\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.history){\r\n\t\t\tthis.subscribe(\"cell-value-updated\", this.cellUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"cell-delete\", this.clearComponentHistory.bind(this));\r\n\t\t\tthis.subscribe(\"row-delete\", this.rowDeleted.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.clear.bind(this));\r\n\t\t\tthis.subscribe(\"row-added\", this.rowAdded.bind(this));\r\n\t\t\tthis.subscribe(\"row-move\", this.rowMoved.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"undo\", this.undo.bind(this));\r\n\t\tthis.registerTableFunction(\"redo\", this.redo.bind(this));\r\n\t\tthis.registerTableFunction(\"getHistoryUndoSize\", this.getHistoryUndoSize.bind(this));\r\n\t\tthis.registerTableFunction(\"getHistoryRedoSize\", this.getHistoryRedoSize.bind(this));\r\n\t\tthis.registerTableFunction(\"clearHistory\", this.clear.bind(this));\r\n\t}\r\n\r\n\trowMoved(from, to, after){\r\n\t\tthis.action(\"rowMove\", from, {posFrom:this.table.rowManager.getRowPosition(from), posTo:this.table.rowManager.getRowPosition(to), to:to, after:after});\r\n\t}\r\n\r\n\trowAdded(row, data, pos, index){\r\n\t\tthis.action(\"rowAdd\", row, {data:data, pos:pos, index:index});\r\n\t}\r\n\r\n\trowDeleted(row){\r\n\t\tvar index, rows;\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\r\n\t\t\trows = row.getComponent().getGroup().rows\r\n\t\t\tindex = rows.indexOf(row);\r\n\r\n\t\t\tif(index){\r\n\t\t\t\tindex = rows[index-1];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tindex = row.table.rowManager.getRowIndex(row);\r\n\r\n\t\t\tif(index){\r\n\t\t\t\tindex = row.table.rowManager.rows[index-1];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.action(\"rowDelete\", row, {data:row.getData(), pos:!index, index:index});\r\n\t}\r\n\r\n\tcellUpdated(cell){\r\n\t\tthis.action(\"cellEdit\", cell, {oldValue:cell.oldValue, newValue:cell.value});\r\n\t}\r\n\r\n\tclear(){\r\n\t\tthis.history = [];\r\n\t\tthis.index = -1;\r\n\t}\r\n\r\n\taction(type, component, data){\r\n\t\tthis.history = this.history.slice(0, this.index + 1);\r\n\r\n\t\tthis.history.push({\r\n\t\t\ttype:type,\r\n\t\t\tcomponent:component,\r\n\t\t\tdata:data,\r\n\t\t});\r\n\r\n\t\tthis.index ++;\r\n\t}\r\n\r\n\tgetHistoryUndoSize(){\r\n\t\treturn this.index + 1;\r\n\t}\r\n\r\n\tgetHistoryRedoSize(){\r\n\t\treturn this.history.length - (this.index + 1);\r\n\t}\r\n\r\n\tclearComponentHistory(component){\r\n\t\tvar index = this.history.findIndex(function(item){\r\n\t\t\treturn item.component === component;\r\n\t\t});\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.history.splice(index, 1);\r\n\t\t\tif(index <= this.index){\r\n\t\t\t\tthis.index--;\r\n\t\t\t}\r\n\r\n\t\t\tthis.clearComponentHistory(component);\r\n\t\t}\r\n\t}\r\n\r\n\tundo(){\r\n\t\tif(this.index > -1){\r\n\t\t\tlet action = this.history[this.index];\r\n\r\n\t\t\tHistory.undoers[action.type].call(this, action);\r\n\r\n\t\t\tthis.index--;\r\n\r\n\t\t\tthis.dispatchExternal(\"historyUndo\", action.type, action.component.getComponent(), action.data);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"History Undo Error - No more history to undo\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tredo(){\r\n\t\tif(this.history.length-1 > this.index){\r\n\r\n\t\t\tthis.index++;\r\n\r\n\t\t\tlet action = this.history[this.index];\r\n\r\n\t\t\tHistory.redoers[action.type].call(this, action);\r\n\r\n\t\t\tthis.dispatchExternal(\"historyRedo\", action.type, action.component.getComponent(), action.data);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"History Redo Error - No more history to redo\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//rebind rows to new element after deletion\r\n\t_rebindRow(oldRow, newRow){\r\n\t\tthis.history.forEach(function(action){\r\n\t\t\tif(action.component instanceof Row){\r\n\t\t\t\tif(action.component === oldRow){\r\n\t\t\t\t\taction.component = newRow;\r\n\t\t\t\t}\r\n\t\t\t}else if(action.component instanceof Cell){\r\n\t\t\t\tif(action.component.row === oldRow){\r\n\t\t\t\t\tvar field = action.component.column.getField();\r\n\r\n\t\t\t\t\tif(field){\r\n\t\t\t\t\t\taction.component = newRow.getCell(field);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n\r\nHistory.moduleName = \"history\";\r\n\r\n//load defaults\r\nHistory.undoers = defaultUndoers;\r\nHistory.redoers = defaultRedoers;\r\n\r\nexport default History;","import Module from '../../core/Module.js';\r\nimport Column from '../../core/column/Column.js';\r\n\r\nclass HtmlTableImport extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.fieldIndex = [];\r\n\t\tthis.hasIndex = false;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.tableElementCheck();\r\n\t}\r\n\r\n\ttableElementCheck(){\r\n\t\tif(this.table.originalElement && this.table.originalElement.tagName === \"TABLE\"){\r\n\t\t\tif(this.table.originalElement.childNodes.length){\r\n\t\t\t\tthis.parseTable();\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Unable to parse data from empty table tag, Tabulator should be initialized on a div tag unless importing data from a table element.\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tparseTable(){\r\n\t\tvar element = this.table.originalElement,\r\n\t\toptions = this.table.options,\r\n\t\tcolumns = options.columns,\r\n\t\theaders = element.getElementsByTagName(\"th\"),\r\n\t\trows = element.getElementsByTagName(\"tbody\")[0],\r\n\t\tdata = [],\r\n\t\tnewTable;\r\n\r\n\t\tthis.hasIndex = false;\r\n\r\n\t\tthis.dispatchExternal(\"htmlImporting\");\r\n\r\n\t\trows = rows ? rows.getElementsByTagName(\"tr\") : [];\r\n\r\n\t\t//check for Tabulator inline options\r\n\t\tthis._extractOptions(element, options);\r\n\r\n\t\tif(headers.length){\r\n\t\t\tthis._extractHeaders(headers, rows);\r\n\t\t}else{\r\n\t\t\tthis._generateBlankHeaders(headers, rows);\r\n\t\t}\r\n\r\n\t\t//iterate through table rows and build data set\r\n\t\tfor(var index = 0; index < rows.length; index++){\r\n\t\t\tvar row = rows[index],\r\n\t\t\tcells = row.getElementsByTagName(\"td\"),\r\n\t\t\titem = {};\r\n\r\n\t\t\t//create index if the dont exist in table\r\n\t\t\tif(!this.hasIndex){\r\n\t\t\t\titem[options.index] = index;\r\n\t\t\t}\r\n\r\n\t\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\t\tvar cell = cells[i];\r\n\t\t\t\tif(typeof this.fieldIndex[i] !== \"undefined\"){\r\n\t\t\t\t\titem[this.fieldIndex[i]] = cell.innerHTML;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//add row data to item\r\n\t\t\tdata.push(item);\r\n\t\t}\r\n\r\n\t\toptions.data = data;\r\n\r\n\t\tthis.dispatchExternal(\"htmlImported\");\r\n\t}\r\n\r\n\t//extract tabulator attribute options\r\n\t_extractOptions(element, options, defaultOptions){\r\n\t\tvar attributes = element.attributes;\r\n\t\tvar optionsArr = defaultOptions ? Object.keys(defaultOptions) : Object.keys(options);\r\n\t\tvar optionsList = {};\r\n\r\n\t\toptionsArr.forEach((item) => {\r\n\t\t\toptionsList[item.toLowerCase()] = item;\r\n\t\t});\r\n\r\n\t\tfor(var index in attributes){\r\n\t\t\tvar attrib = attributes[index];\r\n\t\t\tvar name;\r\n\r\n\t\t\tif(attrib && typeof attrib == \"object\" && attrib.name && attrib.name.indexOf(\"tabulator-\") === 0){\r\n\t\t\t\tname = attrib.name.replace(\"tabulator-\", \"\");\r\n\r\n\t\t\t\tif(typeof optionsList[name] !== \"undefined\"){\r\n\t\t\t\t\toptions[optionsList[name]] = this._attribValue(attrib.value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//get value of attribute\r\n\t_attribValue(value){\r\n\t\tif(value === \"true\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif(value === \"false\"){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\t//find column if it has already been defined\r\n\t_findCol(title){\r\n\t\tvar match = this.table.options.columns.find((column) => {\r\n\t\t\treturn column.title === title;\r\n\t\t});\r\n\r\n\t\treturn match || false;\r\n\t}\r\n\r\n\t//extract column from headers\r\n\t_extractHeaders(headers, rows){\r\n\t\tfor(var index = 0; index < headers.length; index++){\r\n\t\t\tvar header = headers[index],\r\n\t\t\texists = false,\r\n\t\t\tcol = this._findCol(header.textContent),\r\n\t\t\twidth, attributes;\r\n\r\n\t\t\tif(col){\r\n\t\t\t\texists = true;\r\n\t\t\t}else{\r\n\t\t\t\tcol = {title:header.textContent.trim()};\r\n\t\t\t}\r\n\r\n\t\t\tif(!col.field) {\r\n\t\t\t\tcol.field = header.textContent.trim().toLowerCase().replace(\" \", \"_\");\r\n\t\t\t}\r\n\r\n\t\t\twidth = header.getAttribute(\"width\");\r\n\r\n\t\t\tif(width && !col.width)\t{\r\n\t\t\t\tcol.width = width;\r\n\t\t\t}\r\n\r\n\t\t\t//check for Tabulator inline options\r\n\t\t\tthis._extractOptions(header, col, this.table.columnManager.optionsList.registeredDefaults);\r\n\r\n\t\t\tthis.fieldIndex[index] = col.field;\r\n\r\n\t\t\tif(col.field == this.table.options.index){\r\n\t\t\t\tthis.hasIndex = true;\r\n\t\t\t}\r\n\r\n\t\t\tif(!exists){\r\n\t\t\t\tthis.table.options.columns.push(col);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\r\n\t//generate blank headers\r\n\t_generateBlankHeaders(headers, rows){\r\n\t\tfor(var index = 0; index < headers.length; index++){\r\n\t\t\tvar header = headers[index],\r\n\t\t\tcol = {title:\"\", field:\"col\" + index};\r\n\r\n\t\t\tthis.fieldIndex[index] = col.field;\r\n\r\n\t\t\tvar width = header.getAttribute(\"width\");\r\n\r\n\t\t\tif(width){\r\n\t\t\t\tcol.width = width;\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.options.columns.push(col);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nHtmlTableImport.moduleName = \"htmlTableImport\";\r\n\r\nexport default HtmlTableImport;","export default {\r\n\tcellEdit: function(action){\r\n\t\taction.component.setValueProcessData(action.data.newValue);\r\n\t\taction.component.cellRendered();\r\n\t},\r\n\r\n\trowAdd: function(action){\r\n\t\tvar newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index);\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tthis.table.modules.groupRows.updateGroupRows(true);\r\n\t\t}\r\n\r\n\t\tthis._rebindRow(action.component, newRow);\r\n\t},\r\n\r\n\trowDelete:function(action){\r\n\t\taction.component.deleteActual();\r\n\t},\r\n\r\n\trowMove: function(action){\r\n\t\tthis.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posTo], action.data.after);\r\n\t\tthis.table.rowManager.redraw();\r\n\t},\r\n};","function csvImporter(input){\r\n var data = [],\r\n row = 0, \r\n col = 0,\r\n inQuote = false;\r\n \r\n //Iterate over each character\r\n for (let index = 0; index < input.length; index++) {\r\n let char = input[index], \r\n nextChar = input[index+1]; \r\n \r\n //Initialize empty row\r\n if(!data[row]){\r\n data[row] = [];\r\n }\r\n\r\n //Initialize empty column\r\n if(!data[row][col]){\r\n data[row][col] = \"\";\r\n }\r\n \r\n //Handle quotation mark inside string\r\n if (char == '\"' && inQuote && nextChar == '\"') { \r\n data[row][col] += char; \r\n index++;\r\n continue; \r\n }\r\n \r\n //Begin / End Quote\r\n if (char == '\"') { \r\n inQuote = !inQuote;\r\n continue;\r\n }\r\n \r\n //Next column (if not in quote)\r\n if (char == ',' && !inQuote) { \r\n col++;\r\n continue; \r\n }\r\n \r\n //New row if new line and not in quote (CRLF) \r\n if (char == '\\r' && nextChar == '\\n' && !inQuote) { \r\n col = 0; \r\n row++; \r\n index++; \r\n continue; \r\n }\r\n \r\n //New row if new line and not in quote (CR or LF) \r\n if ((char == '\\r' || char == '\\n') && !inQuote) { \r\n col = 0;\r\n row++;\r\n continue; \r\n }\r\n\r\n //Normal Character, append to column\r\n data[row][col] += char;\r\n }\r\n\r\n return data;\r\n}\r\n\r\nexport default csvImporter;","import Module from '../../core/Module.js';\r\n\r\nimport defaultImporters from './defaults/importers.js';\r\n\r\nclass Import extends Module{\r\n \r\n constructor(table){\r\n super(table);\r\n \r\n this.registerTableOption(\"importFormat\");\r\n this.registerTableOption(\"importReader\", \"text\");\r\n }\r\n \r\n initialize(){\r\n this.registerTableFunction(\"import\", this.importFromFile.bind(this));\r\n\r\n if(this.table.options.importFormat){\r\n this.subscribe(\"data-loading\", this.loadDataCheck.bind(this), 10);\r\n this.subscribe(\"data-load\", this.loadData.bind(this), 10);\r\n }\r\n }\r\n\r\n loadDataCheck(data){\r\n return typeof data === \"string\";\r\n }\r\n\r\n loadData(data, params, config, silent, previousData){\r\n return this.importData(this.lookupImporter(), data)\r\n .then(this.structureData.bind(this))\r\n .catch((err) => {\r\n console.error(\"Import Error:\", err || \"Unable to import data\")\r\n return Promise.reject(err);\r\n })\r\n }\r\n\r\n lookupImporter(importFormat){\r\n var importer;\r\n \r\n if(!importFormat){\r\n importFormat = this.table.options.importFormat;\r\n }\r\n \r\n if(typeof importFormat === \"string\"){\r\n importer = Import.importers[importFormat];\r\n }else{\r\n importer = importFormat;\r\n }\r\n\r\n if(!importer){\r\n console.error(\"Import Error - Importer not found:\", importFormat);\r\n }\r\n \r\n return importer;\r\n }\r\n \r\n importFromFile(importFormat, extension){\r\n var importer = this.lookupImporter(importFormat);\r\n \r\n if(importer){\r\n return this.pickFile(extension)\r\n .then(this.importData.bind(this, importer))\r\n .then(this.structureData.bind(this))\r\n .then(this.setData.bind(this))\r\n .catch((err) => {\r\n console.error(\"Import Error:\", err || \"Unable to import file\")\r\n return Promise.reject(err);\r\n })\r\n }\r\n }\r\n \r\n pickFile(extensions){\r\n return new Promise((resolve, reject) => {\r\n var input = document.createElement(\"input\");\r\n input.type = \"file\";\r\n input.accept = extensions;\r\n \r\n input.addEventListener(\"change\", (e) => {\r\n var file = input.files[0],\r\n reader = new FileReader(),\r\n data;\r\n \r\n switch(this.table.options.importReader){\r\n case \"buffer\":\r\n reader.readAsArrayBuffer(file);\r\n break;\r\n\r\n case \"binary\":\r\n reader.readAsBinaryString(file);\r\n break;\r\n\r\n case \"url\":\r\n reader.readAsDataURL(file);\r\n break;\r\n\r\n case \"text\":\r\n default:\r\n reader.readAsText(file);\r\n }\r\n \r\n reader.onload = (e) => {\r\n resolve(reader.result)\r\n };\r\n \r\n reader.onerror = (e) => {\r\n console.warn(\"File Load Error - Unable to read file\");\r\n reject();\r\n };\r\n });\r\n \r\n input.click();\r\n });\r\n }\r\n \r\n importData(importer, fileContents){\r\n var data = importer.call(this.table, fileContents);\r\n \r\n if(data instanceof Promise){\r\n return data;\r\n }else{\r\n return data ? Promise.resolve(data) : Promise.reject();\r\n }\r\n }\r\n\r\n structureData(parsedData){\r\n var data = [];\r\n \r\n if(Array.isArray(parsedData) && parsedData.length && Array.isArray(parsedData[0])){\r\n if(this.table.options.autoColumns){\r\n data = this.structureArrayToObject(parsedData);\r\n }else{\r\n data = this.structureArrayToColumns(parsedData);\r\n }\r\n\r\n return data;\r\n }else{\r\n return parsedData;\r\n }\r\n }\r\n\r\n structureArrayToObject(parsedData){\r\n var columns = parsedData.shift();\r\n\r\n var data = parsedData.map((values) => {\r\n var row = {};\r\n\r\n columns.forEach((key, i) => {\r\n row[key] = values[i];\r\n })\r\n\r\n return row;\r\n })\r\n\r\n return data;\r\n }\r\n\r\n structureArrayToColumns(parsedData){\r\n var data = [],\r\n columns = this.table.getColumns();\r\n\r\n //remove first row if it is the column names\r\n if(columns[0] && parsedData[0][0]){\r\n if(columns[0].getDefinition().title === parsedData[0][0]){\r\n parsedData.shift();\r\n }\r\n }\r\n \r\n //convert row arrays to objects\r\n parsedData.forEach((rowData) => {\r\n var row = {};\r\n\r\n rowData.forEach((value, index) => {\r\n var column = columns[index];\r\n\r\n if(column){\r\n row[column.getField()] = value;\r\n }\r\n })\r\n\r\n data.push(row);\r\n });\r\n\r\n return data;\r\n }\r\n \r\n setData(data){\r\n return this.table.setData(data);\r\n }\r\n}\r\n\r\nImport.moduleName = \"import\";\r\n\r\n//load defaults\r\nImport.importers = defaultImporters;\r\n\r\nexport default Import;","export default function(input){\r\n try {\r\n return JSON.parse(input);\r\n } catch(e) {\r\n console.warn(\"JSON Import Error - File contents is invalid JSON\", e);\r\n return Promise.reject();\r\n }\r\n}","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport Cell from '../../core/cell/Cell';\r\nimport Column from '../../core/column/Column';\r\n\r\nclass Interaction extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.eventMap = {\r\n\t\t\t//row events\r\n\t\t\trowClick:\"row-click\",\r\n\t\t\trowDblClick:\"row-dblclick\",\r\n\t\t\trowContext:\"row-contextmenu\",\r\n\t\t\trowMouseEnter:\"row-mouseenter\",\r\n\t\t\trowMouseLeave:\"row-mouseleave\",\r\n\t\t\trowMouseOver:\"row-mouseover\",\r\n\t\t\trowMouseOut:\"row-mouseout\",\r\n\t\t\trowMouseMove:\"row-mousemove\",\r\n\t\t\trowTap:\"row\",\r\n\t\t\trowDblTap:\"row\",\r\n\t\t\trowTapHold:\"row\",\r\n\r\n\t\t\t//cell events\r\n\t\t\tcellClick:\"cell-click\",\r\n\t\t\tcellDblClick:\"cell-dblclick\",\r\n\t\t\tcellContext:\"cell-contextmenu\",\r\n\t\t\tcellMouseEnter:\"cell-mouseenter\",\r\n\t\t\tcellMouseLeave:\"cell-mouseleave\",\r\n\t\t\tcellMouseOver:\"cell-mouseover\",\r\n\t\t\tcellMouseOut:\"cell-mouseout\",\r\n\t\t\tcellMouseMove:\"cell-mousemove\",\r\n\t\t\tcellTap:\"cell\",\r\n\t\t\tcellDblTap:\"cell\",\r\n\t\t\tcellTapHold:\"cell\",\r\n\r\n\t\t\t//column header events\r\n\t\t\theaderClick:\"column-click\",\r\n\t\t\theaderDblClick:\"column-dblclick\",\r\n\t\t\theaderContext:\"column-contextmenu\",\r\n\t\t\theaderMouseEnter:\"column-mouseenter\",\r\n\t\t\theaderMouseLeave:\"column-mouseleave\",\r\n\t\t\theaderMouseOver:\"column-mouseover\",\r\n\t\t\theaderMouseOut:\"column-mouseout\",\r\n\t\t\theaderMouseMove:\"column-mousemove\",\r\n\t\t\theaderTap:\"column\",\r\n\t\t\theaderDblTap:\"column\",\r\n\t\t\theaderTapHold:\"column\",\r\n\r\n\t\t\t//group header\r\n\t\t\tgroupClick:\"group-click\",\r\n\t\t\tgroupDblClick:\"group-dblclick\",\r\n\t\t\tgroupContext:\"group-contextmenu\",\r\n\t\t\tgroupMouseEnter:\"group-mouseenter\",\r\n\t\t\tgroupMouseLeave:\"group-mouseleave\",\r\n\t\t\tgroupMouseOver:\"group-mouseover\",\r\n\t\t\tgroupMouseOut:\"group-mouseout\",\r\n\t\t\tgroupMouseMove:\"group-mousemove\",\r\n\t\t\tgroupTap:\"group\",\r\n\t\t\tgroupDblTap:\"group\",\r\n\t\t\tgroupTapHold:\"group\",\r\n\t\t}\r\n\r\n\t\tthis.subscribers = {};\r\n\r\n\t\tthis.touchSubscribers = {};\r\n\r\n\t\tthis.columnSubscribers = {};\r\n\r\n\t\tthis.touchWatchers = {\r\n\t\t\trow:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tcell:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tcolumn:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tgroup:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.registerColumnOption(\"headerClick\");\r\n\t\tthis.registerColumnOption(\"headerDblClick\");\r\n\t\tthis.registerColumnOption(\"headerContext\");\r\n\t\tthis.registerColumnOption(\"headerMouseEnter\");\r\n\t\tthis.registerColumnOption(\"headerMouseLeave\");\r\n\t\tthis.registerColumnOption(\"headerMouseOver\");\r\n\t\tthis.registerColumnOption(\"headerMouseOut\");\r\n\t\tthis.registerColumnOption(\"headerMouseMove\");\r\n\t\tthis.registerColumnOption(\"headerTap\");\r\n\t\tthis.registerColumnOption(\"headerDblTap\");\r\n\t\tthis.registerColumnOption(\"headerTapHold\");\r\n\r\n\t\tthis.registerColumnOption(\"cellClick\");\r\n\t\tthis.registerColumnOption(\"cellDblClick\");\r\n\t\tthis.registerColumnOption(\"cellContext\");\r\n\t\tthis.registerColumnOption(\"cellMouseEnter\");\r\n\t\tthis.registerColumnOption(\"cellMouseLeave\");\r\n\t\tthis.registerColumnOption(\"cellMouseOver\");\r\n\t\tthis.registerColumnOption(\"cellMouseOut\");\r\n\t\tthis.registerColumnOption(\"cellMouseMove\");\r\n\t\tthis.registerColumnOption(\"cellTap\");\r\n\t\tthis.registerColumnOption(\"cellDblTap\");\r\n\t\tthis.registerColumnOption(\"cellTapHold\");\r\n\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.initializeExternalEvents();\r\n\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this))\r\n\t\tthis.subscribe(\"cell-dblclick\", this.cellContentsSelectionFixer.bind(this))\r\n\t}\r\n\r\n\tcellContentsSelectionFixer(e, cell){\r\n\t\tif(this.table.modExists(\"edit\")){\r\n\t\t\tif (this.table.modules.edit.currentCell === this){\r\n\t\t\t\treturn; //prevent instant selection of editor content\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\ttry{\r\n\t\t\tif (document.selection) { // IE\r\n\t\t\t\tvar range = document.body.createTextRange();\r\n\t\t\t\trange.moveToElementText(this.element);\r\n\t\t\t\trange.select();\r\n\t\t\t} else if (window.getSelection) {\r\n\t\t\t\tvar range = document.createRange();\r\n\t\t\t\trange.selectNode(this.element);\r\n\t\t\t\twindow.getSelection().removeAllRanges();\r\n\t\t\t\twindow.getSelection().addRange(range);\r\n\t\t\t}\r\n\t\t}catch(e){}\r\n\t}\r\n\r\n\tinitializeExternalEvents(){\r\n\t\tfor(let key in this.eventMap){\r\n\t\t\tthis.subscriptionChangeExternal(key, this.subscriptionChanged.bind(this, key))\r\n\t\t}\r\n\t}\r\n\r\n\tsubscriptionChanged(key, added){\r\n\t\tvar index;\r\n\r\n\t\tif(added){\r\n\t\t\tif(!this.subscribers[key]){\r\n\t\t\t\tif(this.eventMap[key].includes(\"-\")){\r\n\t\t\t\t\tthis.subscribers[key] = this.handle.bind(this, key);\r\n\t\t\t\t\tthis.subscribe(this.eventMap[key], this.subscribers[key]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.subscribeTouchEvents(key);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.eventMap[key].includes(\"-\")){\r\n\t\t\t\tif(this.subscribers[key] && !this.columnSubscribers[key] && !this.subscribedExternal(key)){\r\n\t\t\t\t\tthis.unsubscribe(this.eventMap[key], this.subscribers[key]);\r\n\t\t\t\t\tdelete this.subscribers[key];\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.unsubscribeTouchEvents(key);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tsubscribeTouchEvents(key){\r\n\t\tvar type = this.eventMap[key];\r\n\r\n\t\tif(!this.touchSubscribers[type + \"-touchstart\"]){\r\n\t\t\tthis.touchSubscribers[type + \"-touchstart\"] = this.handleTouch.bind(this, type, \"start\");\r\n\t\t\tthis.touchSubscribers[type + \"-touchend\"] = this.handleTouch.bind(this, type, \"end\");\r\n\r\n\t\t\tthis.subscribe(type + \"-touchstart\", this.touchSubscribers[type + \"-touchstart\"]);\r\n\t\t\tthis.subscribe(type + \"-touchend\", this.touchSubscribers[type + \"-touchend\"]);\r\n\t\t}\r\n\r\n\t\tthis.subscribers[key] = true;\r\n\t}\r\n\r\n\tunsubscribeTouchEvents(key){\r\n\t\tvar notouch = true,\r\n\t\ttype = this.eventMap[key];\r\n\r\n\t\tif(this.subscribers[key] && !this.subscribedExternal(key)){\r\n\t\t\tdelete this.subscribers[key];\r\n\r\n\t\t\tfor(let i in this.eventMap){\r\n\t\t\t\tif(this.eventMap[i] === type){\r\n\t\t\t\t\tif(this.subscribers[i]){\r\n\t\t\t\t\t\tnotouch = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(notouch){\r\n\t\t\t\tthis.unsubscribe(type + \"-touchstart\", this.touchSubscribers[type + \"-touchstart\"]);\r\n\t\t\t\tthis.unsubscribe(type + \"-touchend\", this.touchSubscribers[type + \"-touchend\"]);\r\n\r\n\t\t\t\tdelete this.touchSubscribers[type + \"-touchstart\"];\r\n\t\t\t\tdelete this.touchSubscribers[type + \"-touchend\"];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.definition;\r\n\r\n\t\tfor(let key in this.eventMap){\r\n\t\t\tif(def[key]){\r\n\t\t\t\tthis.subscriptionChanged(key, true);\r\n\r\n\t\t\t\tif(!this.columnSubscribers[key]){\r\n\t\t\t\t\tthis.columnSubscribers[key] = [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.columnSubscribers[key].push(column);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\thandle(action, e, component){\r\n\t\tthis.dispatchEvent(action, e, component);\r\n\t}\r\n\r\n\thandleTouch(type, action, e, component){\r\n\t\tvar watchers = this.touchWatchers[type];\r\n\r\n\t\tif(type === \"column\"){\r\n\t\t\ttype = \"header\";\r\n\t\t}\r\n\r\n\t\tswitch(action){\r\n\t\t\tcase \"start\":\r\n\t\t\twatchers.tap = true;\r\n\r\n\t\t\tclearTimeout(watchers.tapHold);\r\n\r\n\t\t\twatchers.tapHold = setTimeout(() => {\r\n\t\t\t\tclearTimeout(watchers.tapHold);\r\n\t\t\t\twatchers.tapHold = null;\r\n\r\n\t\t\t\twatchers.tap = null;\r\n\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\twatchers.tapDbl = null;\r\n\r\n\t\t\t\tthis.dispatchEvent(type + \"TapHold\", e, component);\r\n\t\t\t}, 1000);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"end\":\r\n\t\t\tif(watchers.tap){\r\n\r\n\t\t\t\twatchers.tap = null;\r\n\t\t\t\tthis.dispatchEvent(type + \"Tap\", e, component);\r\n\t\t\t}\r\n\r\n\t\t\tif(watchers.tapDbl){\r\n\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\twatchers.tapDbl = null;\r\n\r\n\t\t\t\tthis.dispatchEvent(type + \"DblTap\", e, component);\r\n\t\t\t}else{\r\n\t\t\t\twatchers.tapDbl = setTimeout(() => {\r\n\t\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\t\twatchers.tapDbl = null;\r\n\t\t\t\t}, 300);\r\n\t\t\t}\r\n\r\n\t\t\tclearTimeout(watchers.tapHold);\r\n\t\t\twatchers.tapHold = null;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tdispatchEvent(action, e, component){\r\n\t\tvar componentObj = component.getComponent(),\r\n\t\tcallback;\r\n\r\n\t\tif(this.columnSubscribers[action]){\r\n\r\n\t\t\tif(component instanceof Cell){\r\n\t\t\t\tcallback = component.column.definition[action];\r\n\t\t\t}else if(component instanceof Column){\r\n\t\t\t\tcallback = component.definition[action];\r\n\t\t\t}\r\n\r\n\t\t\tif(callback){\r\n\t\t\t\tcallback(e, componentObj);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(action, e, componentObj);\r\n\t}\r\n}\r\n\r\nInteraction.moduleName = \"interaction\";\r\n\r\nexport default Interaction;","export default {\r\n\tnavPrev:\"shift + 9\",\r\n\tnavNext:9,\r\n\tnavUp:38,\r\n\tnavDown:40,\r\n\tscrollPageUp:33,\r\n\tscrollPageDown:34,\r\n\tscrollToStart:36,\r\n\tscrollToEnd:35,\r\n\tundo:[\"ctrl + 90\", \"meta + 90\"],\r\n\tredo:[\"ctrl + 89\", \"meta + 89\"],\r\n\tcopyToClipboard:[\"ctrl + 67\", \"meta + 89\"],\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultBindings from './defaults/bindings.js';\r\nimport defaultActions from './defaults/actions.js';\r\n\r\nclass Keybindings extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.watchKeys = null;\r\n\t\tthis.pressedKeys = null;\r\n\t\tthis.keyupBinding = false;\r\n\t\tthis.keydownBinding = false;\r\n\r\n\t\tthis.registerTableOption(\"keybindings\", {}); //array for keybindings\r\n\t\tthis.registerTableOption(\"tabEndNewRow\", false); //create new row when tab to end of table\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tvar bindings = this.table.options.keybindings,\r\n\t\tmergedBindings = {};\r\n\r\n\t\tthis.watchKeys = {};\r\n\t\tthis.pressedKeys = [];\r\n\r\n\t\tif(bindings !== false){\r\n\t\t\tObject.assign(mergedBindings, Keybindings.bindings)\r\n\t\t\tObject.assign(mergedBindings, bindings)\r\n\r\n\t\t\tthis.mapBindings(mergedBindings);\r\n\t\t\tthis.bindEvents();\r\n\t\t}\r\n\r\n\t\tthis.subscribe(\"table-destroy\", this.clearBindings.bind(this));\r\n\t}\r\n\r\n\tmapBindings(bindings){\r\n\t\tfor(let key in bindings){\r\n\t\t\tif(Keybindings.actions[key]){\r\n\t\t\t\tif(bindings[key]){\r\n\t\t\t\t\tif(typeof bindings[key] !== \"object\"){\r\n\t\t\t\t\t\tbindings[key] = [bindings[key]];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbindings[key].forEach((binding) => {\r\n\t\t\t\t\t\tvar bindingList = Array.isArray(binding) ? binding : [binding];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tbindingList.forEach((item) => {\r\n\t\t\t\t\t\t\tthis.mapBinding(key, item);\r\n\t\t\t\t\t\t});\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Key Binding Error - no such action:\", key);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmapBinding(action, symbolsList){\r\n\t\tvar binding = {\r\n\t\t\taction: Keybindings.actions[action],\r\n\t\t\tkeys: [],\r\n\t\t\tctrl: false,\r\n\t\t\tshift: false,\r\n\t\t\tmeta: false,\r\n\t\t};\r\n\r\n\t\tvar symbols = symbolsList.toString().toLowerCase().split(\" \").join(\"\").split(\"+\");\r\n\r\n\t\tsymbols.forEach((symbol) => {\r\n\t\t\tswitch(symbol){\r\n\t\t\t\tcase \"ctrl\":\r\n\t\t\t\tbinding.ctrl = true;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"shift\":\r\n\t\t\t\tbinding.shift = true;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"meta\":\r\n\t\t\t\tbinding.meta = true;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\tsymbol = isNaN(symbol) ? symbol.toUpperCase().charCodeAt(0) : parseInt(symbol);\r\n\t\t\t\tbinding.keys.push(symbol);\r\n\r\n\t\t\t\tif(!this.watchKeys[symbol]){\r\n\t\t\t\t\tthis.watchKeys[symbol] = [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.watchKeys[symbol].push(binding);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tbindEvents(){\r\n\t\tvar self = this;\r\n\r\n\t\tthis.keyupBinding = function(e){\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tvar bindings = self.watchKeys[code];\r\n\r\n\t\t\tif(bindings){\r\n\r\n\t\t\t\tself.pressedKeys.push(code);\r\n\r\n\t\t\t\tbindings.forEach(function(binding){\r\n\t\t\t\t\tself.checkBinding(e, binding);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.keydownBinding = function(e){\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tvar bindings = self.watchKeys[code];\r\n\r\n\t\t\tif(bindings){\r\n\r\n\t\t\t\tvar index = self.pressedKeys.indexOf(code);\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tself.pressedKeys.splice(index, 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.table.element.addEventListener(\"keydown\", this.keyupBinding);\r\n\r\n\t\tthis.table.element.addEventListener(\"keyup\", this.keydownBinding);\r\n\t}\r\n\r\n\tclearBindings(){\r\n\t\tif(this.keyupBinding){\r\n\t\t\tthis.table.element.removeEventListener(\"keydown\", this.keyupBinding);\r\n\t\t}\r\n\r\n\t\tif(this.keydownBinding){\r\n\t\t\tthis.table.element.removeEventListener(\"keyup\", this.keydownBinding);\r\n\t\t}\r\n\t}\r\n\r\n\tcheckBinding(e, binding){\r\n\t\tvar match = true;\r\n\r\n\t\tif(e.ctrlKey == binding.ctrl && e.shiftKey == binding.shift && e.metaKey == binding.meta){\r\n\t\t\tbinding.keys.forEach((key) => {\r\n\t\t\t\tvar index = this.pressedKeys.indexOf(key);\r\n\r\n\t\t\t\tif(index == -1){\r\n\t\t\t\t\tmatch = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tbinding.action.call(this, e);\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\nKeybindings.moduleName = \"keybindings\";\r\n\r\n//load defaults\r\nKeybindings.bindings = defaultBindings;\r\nKeybindings.actions = defaultActions;\r\n\r\nexport default Keybindings;","import Module from '../../core/Module.js';\r\n\r\nclass Menu extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.menuContainer = null;\r\n\t\tthis.nestedMenuBlock = false;\r\n\t\t\r\n\t\tthis.currentComponent = null;\r\n\t\tthis.rootPopup = null;\r\n\t\t\r\n\t\tthis.columnSubscribers = {};\r\n\t\t\r\n\t\tthis.registerTableOption(\"menuContainer\", undefined); //deprecated\r\n\r\n\t\tthis.registerTableOption(\"rowContextMenu\", false);\r\n\t\tthis.registerTableOption(\"rowClickMenu\", false);\r\n\t\tthis.registerTableOption(\"groupContextMenu\", false);\r\n\t\tthis.registerTableOption(\"groupClickMenu\", false);\r\n\t\t\r\n\t\tthis.registerColumnOption(\"headerContextMenu\");\r\n\t\tthis.registerColumnOption(\"headerClickMenu\");\r\n\t\tthis.registerColumnOption(\"headerMenu\");\r\n\t\tthis.registerColumnOption(\"headerMenuIcon\");\r\n\t\tthis.registerColumnOption(\"contextMenu\");\r\n\t\tthis.registerColumnOption(\"clickMenu\");\r\n\t\t\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.deprecationCheck();\r\n\t\tthis.initializeRowWatchers();\r\n\t\tthis.initializeGroupWatchers();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\r\n\tdeprecationCheck(){\r\n\t\tif(typeof this.table.options.menuContainer !== \"undefined\"){\r\n\t\t\tconsole.warn(\"Use of the menuContainer option is now deprecated. Please use the popupContainer option instead\");\r\n\r\n\t\t\tthis.table.options.popupContainer = this.table.options.menuContainer;\r\n\t\t}\r\n\t}\t\r\n\t\r\n\tinitializeRowWatchers(){\r\n\t\tif(this.table.options.rowContextMenu){\r\n\t\t\tthis.subscribe(\"row-contextmenu\", this.loadMenuEvent.bind(this, this.table.options.rowContextMenu));\r\n\t\t\tthis.table.on(\"rowTapHold\", this.loadMenuEvent.bind(this, this.table.options.rowContextMenu));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.rowClickMenu){\r\n\t\t\tthis.subscribe(\"row-click\", this.loadMenuEvent.bind(this, this.table.options.rowClickMenu));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeGroupWatchers(){\r\n\t\tif(this.table.options.groupContextMenu){\r\n\t\t\tthis.subscribe(\"group-contextmenu\", this.loadMenuEvent.bind(this, this.table.options.groupContextMenu));\r\n\t\t\tthis.table.on(\"groupTapHold\", this.loadMenuEvent.bind(this, this.table.options.groupContextMenu));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.groupClickMenu){\r\n\t\t\tthis.subscribe(\"group-click\", this.loadMenuEvent.bind(this, this.table.options.groupClickMenu));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar options = [\"headerContextMenu\", \"headerClickMenu\"],\r\n\t\tdef = column.definition;\r\n\t\t\r\n\t\t//handle column events\r\n\t\tif(def.headerContextMenu && !this.columnSubscribers.headerContextMenu){\r\n\t\t\tthis.columnSubscribers.headerContextMenu = this.loadMenuTableColumnEvent.bind(this, \"headerContextMenu\");\r\n\t\t\tthis.subscribe(\"column-contextmenu\", this.columnSubscribers.headerContextMenu);\r\n\t\t\tthis.table.on(\"headerTapHold\", this.loadMenuTableColumnEvent.bind(this, \"headerContextMenu\"))\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerClickMenu && !this.columnSubscribers.headerClickMenu){\r\n\t\t\tthis.columnSubscribers.headerClickMenu = this.loadMenuTableColumnEvent.bind(this, \"headerClickMenu\");\r\n\t\t\tthis.subscribe(\"column-click\", this.columnSubscribers.headerClickMenu);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerMenu){\r\n\t\t\tthis.initializeColumnHeaderMenu(column);\r\n\t\t}\r\n\t\t\r\n\t\t//handle cell events\r\n\t\tif(def.contextMenu && !this.columnSubscribers.contextMenu){\r\n\t\t\tthis.columnSubscribers.contextMenu = this.loadMenuTableCellEvent.bind(this, \"contextMenu\");\r\n\t\t\tthis.subscribe(\"cell-contextmenu\", this.columnSubscribers.contextMenu);\r\n\t\t\tthis.table.on(\"cellTapHold\", this.loadMenuTableCellEvent.bind(this, \"contextMenu\"))\r\n\t\t}\r\n\t\t\r\n\t\tif(def.clickMenu && !this.columnSubscribers.clickMenu){\r\n\t\t\tthis.columnSubscribers.clickMenu = this.loadMenuTableCellEvent.bind(this, \"clickMenu\");\r\n\t\t\tthis.subscribe(\"cell-click\", this.columnSubscribers.clickMenu);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumnHeaderMenu(column){\r\n\t\tvar icon = column.definition.headerMenuIcon,\r\n\t\theaderMenuEl;\r\n\t\t\r\n\t\theaderMenuEl = document.createElement(\"span\");\r\n\t\theaderMenuEl.classList.add(\"tabulator-header-popup-button\");\r\n\r\n\t\tif(icon){\r\n\t\t\tif(typeof icon === \"function\"){\r\n\t\t\t\ticon = icon(column.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tif(icon instanceof HTMLElement){\r\n\t\t\t\theaderMenuEl.appendChild(icon);\r\n\t\t\t}else{\r\n\t\t\t\theaderMenuEl.innerHTML = icon;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\theaderMenuEl.innerHTML = \"⋮\";\r\n\t\t}\r\n\t\t\r\n\t\theaderMenuEl.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tthis.loadMenuEvent(column.definition.headerMenu, e, column);\r\n\t\t});\r\n\t\t\r\n\t\tcolumn.titleElement.insertBefore(headerMenuEl, column.titleElement.firstChild);\r\n\t}\r\n\t\r\n\tloadMenuTableCellEvent(option, e, cell){\r\n\t\tif(cell._cell){\r\n\t\t\tcell = cell._cell;\r\n\t\t}\r\n\t\t\r\n\t\tif(cell.column.definition[option]){\r\n\t\t\tthis.loadMenuEvent(cell.column.definition[option], e, cell);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadMenuTableColumnEvent(option, e, column){\r\n\t\tif(column._column){\r\n\t\t\tcolumn = column._column;\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition[option]){\r\n\t\t\tthis.loadMenuEvent(column.definition[option], e, column);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadMenuEvent(menu, e, component){\r\n\t\tif(component._group){\r\n\t\t\tcomponent = component._group;\r\n\t\t}else if(component._row){\r\n\t\t\tcomponent = component._row;\r\n\t\t}\r\n\t\t\r\n\t\tmenu = typeof menu == \"function\" ? menu.call(this.table, e, component.getComponent()) : menu;\r\n\t\t\r\n\t\tthis.loadMenu(e, component, menu);\r\n\t}\r\n\t\r\n\tloadMenu(e, component, menu, parentEl, parentPopup){\r\n\t\tvar touch = !(e instanceof MouseEvent),\t\t\r\n\t\tmenuEl = document.createElement(\"div\"),\r\n\t\tpopup;\r\n\t\t\r\n\t\tmenuEl.classList.add(\"tabulator-menu\");\r\n\t\t\r\n\t\tif(!touch){\r\n\t\t\te.preventDefault();\r\n\t\t}\r\n\t\t\r\n\t\t//abort if no menu set\r\n\t\tif(!menu || !menu.length){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif(!parentEl){\r\n\t\t\tif(this.nestedMenuBlock){\r\n\t\t\t\t//abort if child menu already open\r\n\t\t\t\tif(this.rootPopup){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.nestedMenuBlock = setTimeout(() => {\r\n\t\t\t\t\tthis.nestedMenuBlock = false;\r\n\t\t\t\t}, 100)\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.rootPopup){\r\n\t\t\t\tthis.rootPopup.hide();\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.rootPopup = popup = this.popup(menuEl);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tpopup = parentPopup.child(menuEl);\r\n\t\t}\r\n\t\t\r\n\t\tmenu.forEach((item) => {\r\n\t\t\tvar itemEl = document.createElement(\"div\"),\r\n\t\t\tlabel = item.label,\r\n\t\t\tdisabled = item.disabled;\r\n\t\t\t\r\n\t\t\tif(item.separator){\r\n\t\t\t\titemEl.classList.add(\"tabulator-menu-separator\");\r\n\t\t\t}else{\r\n\t\t\t\titemEl.classList.add(\"tabulator-menu-item\");\r\n\t\t\t\t\r\n\t\t\t\tif(typeof label == \"function\"){\r\n\t\t\t\t\tlabel = label.call(this.table, component.getComponent());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(label instanceof Node){\r\n\t\t\t\t\titemEl.appendChild(label);\r\n\t\t\t\t}else{\r\n\t\t\t\t\titemEl.innerHTML = label;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(typeof disabled == \"function\"){\r\n\t\t\t\t\tdisabled = disabled.call(this.table, component.getComponent());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(disabled){\r\n\t\t\t\t\titemEl.classList.add(\"tabulator-menu-item-disabled\");\r\n\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(item.menu && item.menu.length){\r\n\t\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\tthis.loadMenu(e, component, item.menu, itemEl, popup);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(item.action){\r\n\t\t\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\t\t\titem.action(e, component.getComponent());\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(item.menu && item.menu.length){\r\n\t\t\t\t\titemEl.classList.add(\"tabulator-menu-item-submenu\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmenuEl.appendChild(itemEl);\r\n\t\t});\r\n\t\t\r\n\t\tmenuEl.addEventListener(\"click\", (e) => {\r\n\t\t\tthis.rootPopup.hide();\r\n\t\t});\r\n\t\t\r\n\t\tpopup.show(parentEl || e);\r\n\t\t\r\n\t\tif(popup === this.rootPopup){\r\n\t\t\tthis.rootPopup.hideOnBlur(() => {\r\n\t\t\t\tthis.rootPopup = null;\r\n\t\t\t\t\r\n\t\t\t\tif(this.currentComponent){\r\n\t\t\t\t\tthis.dispatchExternal(\"menuClosed\", this.currentComponent.getComponent());\r\n\t\t\t\t\tthis.currentComponent = null;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.currentComponent = component;\r\n\r\n\t\t\tthis.dispatchExternal(\"menuOpened\", component.getComponent())\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMenu.moduleName = \"menu\";\r\n\r\nexport default Menu;\r\n","export default {\r\n\tkeyBlock:function(e){\r\n\t\te.stopPropagation();\r\n\t\te.preventDefault();\r\n\t},\r\n\tscrollPageUp:function(e){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tnewPos = rowManager.scrollTop - rowManager.element.clientHeight,\r\n\t\tscrollMax = rowManager.element.scrollHeight;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\tif(newPos >= 0){\r\n\t\t\t\trowManager.element.scrollTop = newPos;\r\n\t\t\t}else{\r\n\t\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[0]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tscrollPageDown:function(e){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tnewPos = rowManager.scrollTop + rowManager.element.clientHeight,\r\n\t\tscrollMax = rowManager.element.scrollHeight;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\tif(newPos <= scrollMax){\r\n\t\t\t\trowManager.element.scrollTop = newPos;\r\n\t\t\t}else{\r\n\t\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\r\n\t},\r\n\tscrollToStart:function(e){\r\n\t\tvar rowManager = this.table.rowManager;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[0]);\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tscrollToEnd:function(e){\r\n\t\tvar rowManager = this.table.rowManager;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]);\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tnavPrev:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-prev\", e);\r\n\t},\r\n\r\n\tnavNext:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-next\", e);\r\n\t},\r\n\r\n\tnavLeft:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-left\", e);\r\n\t},\r\n\r\n\tnavRight:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-right\", e);\r\n\t},\r\n\r\n\tnavUp:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-up\", e);\r\n\t},\r\n\r\n\tnavDown:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-down\", e);\r\n\t},\r\n\r\n\tundo:function(e){\r\n\t\tvar cell = false;\r\n\t\tif(this.table.options.history && this.table.modExists(\"history\") && this.table.modExists(\"edit\")){\r\n\r\n\t\t\tcell = this.table.modules.edit.currentCell;\r\n\r\n\t\t\tif(!cell){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tthis.table.modules.history.undo();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tredo:function(e){\r\n\t\tvar cell = false;\r\n\t\tif(this.table.options.history && this.table.modExists(\"history\") && this.table.modExists(\"edit\")){\r\n\r\n\t\t\tcell = this.table.modules.edit.currentCell;\r\n\r\n\t\t\tif(!cell){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tthis.table.modules.history.redo();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tcopyToClipboard:function(e){\r\n\t\tif(!this.table.modules.edit.currentCell){\r\n\t\t\tif(this.table.modExists(\"clipboard\", true)){\r\n\t\t\t\tthis.table.modules.clipboard.copy(false, true);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nclass MoveColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.placeholderElement = this.createPlaceholderElement();\r\n\t\tthis.hoverElement = false; //floating column header element\r\n\t\tthis.checkTimeout = false; //click check timeout holder\r\n\t\tthis.checkPeriod = 250; //period to wait on mousedown to consider this a move and not a click\r\n\t\tthis.moving = false; //currently moving column\r\n\t\tthis.toCol = false; //destination column\r\n\t\tthis.toColAfter = false; //position of moving column relative to the desitnation column\r\n\t\tthis.startX = 0; //starting position within header element\r\n\t\tthis.autoScrollMargin = 40; //auto scroll on edge when within margin\r\n\t\tthis.autoScrollStep = 5; //auto scroll distance in pixels\r\n\t\tthis.autoScrollTimeout = false; //auto scroll timeout\r\n\t\tthis.touchMove = false;\r\n\t\t\r\n\t\tthis.moveHover = this.moveHover.bind(this);\r\n\t\tthis.endMove = this.endMove.bind(this);\r\n\t\t\r\n\t\tthis.registerTableOption(\"movableColumns\", false); //enable movable columns\r\n\t}\r\n\t\r\n\tcreatePlaceholderElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-col\");\r\n\t\tel.classList.add(\"tabulator-col-placeholder\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.movableColumns){\r\n\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar self = this,\r\n\t\tconfig = {},\r\n\t\tcolEl;\r\n\t\t\r\n\t\tif(!column.modules.frozen && !column.isGroup){\r\n\t\t\tcolEl = column.getElement();\r\n\t\t\t\r\n\t\t\tconfig.mousemove = function(e){\r\n\t\t\t\tif(column.parent === self.moving.parent){\r\n\t\t\t\t\tif((((self.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(colEl).left) + self.table.columnManager.element.scrollLeft) > (column.getWidth() / 2)){\r\n\t\t\t\t\t\tif(self.toCol !== column || !self.toColAfter){\r\n\t\t\t\t\t\t\tcolEl.parentNode.insertBefore(self.placeholderElement, colEl.nextSibling);\r\n\t\t\t\t\t\t\tself.moveColumn(column, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(self.toCol !== column || self.toColAfter){\r\n\t\t\t\t\t\t\tcolEl.parentNode.insertBefore(self.placeholderElement, colEl);\r\n\t\t\t\t\t\t\tself.moveColumn(column, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}.bind(self);\r\n\t\t\t\r\n\t\t\tcolEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tself.touchMove = false;\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, column);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tcolEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tself.bindTouchEvents(column);\r\n\t\t}\r\n\t\t\r\n\t\tcolumn.modules.moveColumn = config;\r\n\t}\r\n\t\r\n\tbindTouchEvents(column){\r\n\t\tvar colEl = column.getElement(),\r\n\t\tstartXMove = false, //shifting center position of the cell\r\n\t\tdir = false,\r\n\t\tcurrentCol, nextCol, prevCol, nextColWidth, prevColWidth, nextColWidthLast, prevColWidthLast;\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchstart\", (e) => {\r\n\t\t\tthis.checkTimeout = setTimeout(() => {\r\n\t\t\t\tthis.touchMove = true;\r\n\t\t\t\tcurrentCol = column;\r\n\t\t\t\tnextCol = column.nextColumn();\r\n\t\t\t\tnextColWidth = nextCol ? nextCol.getWidth()/2 : 0;\r\n\t\t\t\tprevCol = column.prevColumn();\r\n\t\t\t\tprevColWidth = prevCol ? prevCol.getWidth()/2 : 0;\r\n\t\t\t\tnextColWidthLast = 0;\r\n\t\t\t\tprevColWidthLast = 0;\r\n\t\t\t\tstartXMove = false;\r\n\t\t\t\t\r\n\t\t\t\tthis.startMove(e, column);\r\n\t\t\t}, this.checkPeriod);\r\n\t\t}, {passive: true});\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchmove\", (e) => {\r\n\t\t\tvar halfCol, diff, moveToCol;\r\n\t\t\t\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.moveHover(e);\r\n\t\t\t\t\r\n\t\t\t\tif(!startXMove){\r\n\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tdiff = e.touches[0].pageX - startXMove;\r\n\t\t\t\t\r\n\t\t\t\tif(diff > 0){\r\n\t\t\t\t\tif(nextCol && diff - nextColWidthLast > nextColWidth){\r\n\t\t\t\t\t\tmoveToCol = nextCol;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(moveToCol !== column){\r\n\t\t\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t\t\t\tmoveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement().nextSibling);\r\n\t\t\t\t\t\t\tthis.moveColumn(moveToCol, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(prevCol && -diff - prevColWidthLast > prevColWidth){\r\n\t\t\t\t\t\tmoveToCol = prevCol;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(moveToCol !== column){\r\n\t\t\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t\t\t\tmoveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement());\r\n\t\t\t\t\t\t\tthis.moveColumn(moveToCol, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(moveToCol){\r\n\t\t\t\t\tcurrentCol = moveToCol;\r\n\t\t\t\t\tnextCol = moveToCol.nextColumn();\r\n\t\t\t\t\tnextColWidthLast = nextColWidth;\r\n\t\t\t\t\tnextColWidth = nextCol ? nextCol.getWidth() / 2 : 0;\r\n\t\t\t\t\tprevCol = moveToCol.prevColumn();\r\n\t\t\t\t\tprevColWidthLast = prevColWidth;\r\n\t\t\t\t\tprevColWidth = prevCol ? prevCol.getWidth() / 2 : 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}, {passive: true});\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchend\", (e) => {\r\n\t\t\tif(this.checkTimeout){\r\n\t\t\t\tclearTimeout(this.checkTimeout);\r\n\t\t\t}\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.endMove(e);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tstartMove(e, column){\r\n\t\tvar element = column.getElement(),\r\n\t\theaderElement = this.table.columnManager.getElement(),\r\n\t\theadersElement = this.table.columnManager.getHeadersElement();\r\n\t\t\r\n\t\tthis.moving = column;\r\n\t\tthis.startX = (this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(element).left;\r\n\t\t\r\n\t\tthis.table.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\t//create placeholder\r\n\t\tthis.placeholderElement.style.width = column.getWidth() + \"px\";\r\n\t\tthis.placeholderElement.style.height = column.getHeight() + \"px\";\r\n\t\t\r\n\t\telement.parentNode.insertBefore(this.placeholderElement, element);\r\n\t\telement.parentNode.removeChild(element);\r\n\t\t\r\n\t\t//create hover element\r\n\t\tthis.hoverElement = element.cloneNode(true);\r\n\t\tthis.hoverElement.classList.add(\"tabulator-moving\");\r\n\t\t\r\n\t\tthis.table.columnManager.getElement().appendChild(this.hoverElement);\r\n\t\t\r\n\t\tthis.hoverElement.style.left = \"0\";\r\n\t\tthis.hoverElement.style.bottom = (headerElement.clientHeight - headersElement.offsetHeight) + \"px\";\r\n\t\t\r\n\t\tif(!this.touchMove){\r\n\t\t\tthis._bindMouseMove();\r\n\t\t\t\r\n\t\t\tdocument.body.addEventListener(\"mousemove\", this.moveHover);\r\n\t\t\tdocument.body.addEventListener(\"mouseup\", this.endMove);\r\n\t\t}\r\n\t\t\r\n\t\tthis.moveHover(e);\r\n\t}\r\n\t\r\n\t_bindMouseMove(){\r\n\t\tthis.table.columnManager.columnsByIndex.forEach(function(column){\r\n\t\t\tif(column.modules.moveColumn.mousemove){\r\n\t\t\t\tcolumn.getElement().addEventListener(\"mousemove\", column.modules.moveColumn.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t_unbindMouseMove(){\r\n\t\tthis.table.columnManager.columnsByIndex.forEach(function(column){\r\n\t\t\tif(column.modules.moveColumn.mousemove){\r\n\t\t\t\tcolumn.getElement().removeEventListener(\"mousemove\", column.modules.moveColumn.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tmoveColumn(column, after){\r\n\t\tvar movingCells = this.moving.getCells();\r\n\t\t\r\n\t\tthis.toCol = column;\r\n\t\tthis.toColAfter = after;\r\n\t\t\r\n\t\tif(after){\r\n\t\t\tcolumn.getCells().forEach(function(cell, i){\r\n\t\t\t\tvar cellEl = cell.getElement(true);\r\n\t\t\t\t\r\n\t\t\t\tif(cellEl.parentNode && movingCells[i]){\r\n\t\t\t\t\tcellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl.nextSibling);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tcolumn.getCells().forEach(function(cell, i){\r\n\t\t\t\tvar cellEl = cell.getElement(true);\r\n\t\t\t\t\r\n\t\t\t\tif(cellEl.parentNode && movingCells[i]){\r\n\t\t\t\t\tcellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tendMove(e){\r\n\t\tif(e.which === 1 || this.touchMove){\r\n\t\t\tthis._unbindMouseMove();\r\n\t\t\t\r\n\t\t\tthis.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling);\r\n\t\t\tthis.placeholderElement.parentNode.removeChild(this.placeholderElement);\r\n\t\t\tthis.hoverElement.parentNode.removeChild(this.hoverElement);\r\n\t\t\t\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-block-select\");\r\n\t\t\t\r\n\t\t\tif(this.toCol){\r\n\t\t\t\tthis.table.columnManager.moveColumnActual(this.moving, this.toCol, this.toColAfter);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.moving = false;\r\n\t\t\tthis.toCol = false;\r\n\t\t\tthis.toColAfter = false;\r\n\t\t\t\r\n\t\t\tif(!this.touchMove){\r\n\t\t\t\tdocument.body.removeEventListener(\"mousemove\", this.moveHover);\r\n\t\t\t\tdocument.body.removeEventListener(\"mouseup\", this.endMove);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveHover(e){\r\n\t\tvar columnHolder = this.table.columnManager.getElement(),\r\n\t\tscrollLeft = columnHolder.scrollLeft,\r\n\t\txPos = ((this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(columnHolder).left) + scrollLeft,\r\n\t\tscrollPos;\r\n\t\t\r\n\t\tthis.hoverElement.style.left = (xPos - this.startX) + \"px\";\r\n\t\t\r\n\t\tif(xPos - scrollLeft < this.autoScrollMargin){\r\n\t\t\tif(!this.autoScrollTimeout){\r\n\t\t\t\tthis.autoScrollTimeout = setTimeout(() => {\r\n\t\t\t\t\tscrollPos = Math.max(0,scrollLeft-5);\r\n\t\t\t\t\tthis.table.rowManager.getElement().scrollLeft = scrollPos;\r\n\t\t\t\t\tthis.autoScrollTimeout = false;\r\n\t\t\t\t}, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(scrollLeft + columnHolder.clientWidth - xPos < this.autoScrollMargin){\r\n\t\t\tif(!this.autoScrollTimeout){\r\n\t\t\t\tthis.autoScrollTimeout = setTimeout(() => {\r\n\t\t\t\t\tscrollPos = Math.min(columnHolder.clientWidth, scrollLeft+5);\r\n\t\t\t\t\tthis.table.rowManager.getElement().scrollLeft = scrollPos;\r\n\t\t\t\t\tthis.autoScrollTimeout = false;\r\n\t\t\t\t}, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMoveColumns.moduleName = \"moveColumn\";\r\n\r\nexport default MoveColumns;\r\n","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nclass MoveRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.placeholderElement = this.createPlaceholderElement();\r\n\t\tthis.hoverElement = false; //floating row header element\r\n\t\tthis.checkTimeout = false; //click check timeout holder\r\n\t\tthis.checkPeriod = 150; //period to wait on mousedown to consider this a move and not a click\r\n\t\tthis.moving = false; //currently moving row\r\n\t\tthis.toRow = false; //destination row\r\n\t\tthis.toRowAfter = false; //position of moving row relative to the desitnation row\r\n\t\tthis.hasHandle = false; //row has handle instead of fully movable row\r\n\t\tthis.startY = 0; //starting Y position within header element\r\n\t\tthis.startX = 0; //starting X position within header element\r\n\r\n\t\tthis.moveHover = this.moveHover.bind(this);\r\n\t\tthis.endMove = this.endMove.bind(this);\r\n\t\tthis.tableRowDropEvent = false;\r\n\r\n\t\tthis.touchMove = false;\r\n\r\n\t\tthis.connection = false;\r\n\t\tthis.connectionSelectorsTables = false;\r\n\t\tthis.connectionSelectorsElements = false;\r\n\t\tthis.connectionElements = [];\r\n\t\tthis.connections = [];\r\n\r\n\t\tthis.connectedTable = false;\r\n\t\tthis.connectedRow = false;\r\n\r\n\t\tthis.registerTableOption(\"movableRows\", false); //enable movable rows\r\n\t\tthis.registerTableOption(\"movableRowsConnectedTables\", false); //tables for movable rows to be connected to\r\n\t\tthis.registerTableOption(\"movableRowsConnectedElements\", false); //other elements for movable rows to be connected to\r\n\t\tthis.registerTableOption(\"movableRowsSender\", false);\r\n\t\tthis.registerTableOption(\"movableRowsReceiver\", \"insert\");\r\n\r\n\t\tthis.registerColumnOption(\"rowHandle\");\r\n\t}\r\n\r\n\tcreatePlaceholderElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-row\");\r\n\t\tel.classList.add(\"tabulator-row-placeholder\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.movableRows){\r\n\t\t\tthis.connectionSelectorsTables = this.table.options.movableRowsConnectedTables;\r\n\t\t\tthis.connectionSelectorsElements = this.table.options.movableRowsConnectedElements;\r\n\r\n\t\t\tthis.connection = this.connectionSelectorsTables || this.connectionSelectorsElements;\r\n\r\n\t\t\tthis.subscribe(\"cell-init\", this.initializeCell.bind(this));\r\n\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeGroupHeader(group){\r\n\t\tvar self = this,\r\n\t\tconfig = {},\r\n\t\trowEl;\r\n\r\n\t\t//inter table drag drop\r\n\t\tconfig.mouseup = function(e){\r\n\t\t\tself.tableRowDrop(e, row);\r\n\t\t}.bind(self);\r\n\r\n\t\t//same table drag drop\r\n\t\tconfig.mousemove = function(e){\r\n\t\t\tif(((e.pageY - Helpers.elOffset(group.element).top) + self.table.rowManager.element.scrollTop) > (group.getHeight() / 2)){\r\n\t\t\t\tif(self.toRow !== group || !self.toRowAfter){\r\n\t\t\t\t\tvar rowEl = group.getElement();\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);\r\n\t\t\t\t\tself.moveRow(group, true);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(self.toRow !== group || self.toRowAfter){\r\n\t\t\t\t\tvar rowEl = group.getElement();\r\n\t\t\t\t\tif(rowEl.previousSibling){\r\n\t\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl);\r\n\t\t\t\t\t\tself.moveRow(group, false);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.bind(self);\r\n\r\n\t\tgroup.modules.moveRow = config;\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\tconfig = {},\r\n\t\trowEl;\r\n\r\n\t\t//inter table drag drop\r\n\t\tconfig.mouseup = function(e){\r\n\t\t\tself.tableRowDrop(e, row);\r\n\t\t}.bind(self);\r\n\r\n\t\t//same table drag drop\r\n\t\tconfig.mousemove = function(e){\r\n\t\t\tvar rowEl = row.getElement();\r\n\r\n\t\t\tif(((e.pageY - Helpers.elOffset(rowEl).top) + self.table.rowManager.element.scrollTop) > (row.getHeight() / 2)){\r\n\t\t\t\tif(self.toRow !== row || !self.toRowAfter){\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);\r\n\t\t\t\t\tself.moveRow(row, true);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(self.toRow !== row || self.toRowAfter){\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl);\r\n\t\t\t\t\tself.moveRow(row, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.bind(self);\r\n\r\n\r\n\t\tif(!this.hasHandle){\r\n\r\n\t\t\trowEl = row.getElement();\r\n\r\n\t\t\trowEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, row);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trowEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.bindTouchEvents(row, row.getElement());\r\n\t\t}\r\n\r\n\t\trow.modules.moveRow = config;\r\n\t}\r\n\r\n\tinitializeColumn(column){\r\n\t\tif(column.definition.rowHandle && this.table.options.movableRows !== false){\r\n\t\t\tthis.hasHandle = true;\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeCell(cell){\r\n\t\tif(cell.column.definition.rowHandle && this.table.options.movableRows !== false){\r\n\t\t\tvar self = this,\r\n\t\t\tcellEl = cell.getElement(true);\r\n\r\n\t\t\tcellEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, cell.row);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tcellEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.bindTouchEvents(cell.row, cellEl);\r\n\t\t}\r\n\t}\r\n\r\n\tbindTouchEvents(row, element){\r\n\t\tvar startYMove = false, //shifting center position of the cell\r\n\t\tdir = false,\r\n\t\tcurrentRow, nextRow, prevRow, nextRowHeight, prevRowHeight, nextRowHeightLast, prevRowHeightLast;\r\n\r\n\t\telement.addEventListener(\"touchstart\", (e) => {\r\n\t\t\tthis.checkTimeout = setTimeout(() => {\r\n\t\t\t\tthis.touchMove = true;\r\n\t\t\t\tcurrentRow = row;\r\n\t\t\t\tnextRow = row.nextRow();\r\n\t\t\t\tnextRowHeight = nextRow ? nextRow.getHeight()/2 : 0;\r\n\t\t\t\tprevRow = row.prevRow();\r\n\t\t\t\tprevRowHeight = prevRow ? prevRow.getHeight()/2 : 0;\r\n\t\t\t\tnextRowHeightLast = 0;\r\n\t\t\t\tprevRowHeightLast = 0;\r\n\t\t\t\tstartYMove = false;\r\n\r\n\t\t\t\tthis.startMove(e, row);\r\n\t\t\t}, this.checkPeriod);\r\n\t\t}, {passive: true});\r\n\t\tthis.moving, this.toRow, this.toRowAfter\r\n\t\telement.addEventListener(\"touchmove\", (e) => {\r\n\r\n\t\t\tvar halfCol, diff, moveToRow;\r\n\r\n\t\t\tif(this.moving){\r\n\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\tthis.moveHover(e);\r\n\r\n\t\t\t\tif(!startYMove){\r\n\t\t\t\t\tstartYMove = e.touches[0].pageY;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdiff = e.touches[0].pageY - startYMove;\r\n\r\n\t\t\t\tif(diff > 0){\r\n\t\t\t\t\tif(nextRow && diff - nextRowHeightLast > nextRowHeight){\r\n\t\t\t\t\t\tmoveToRow = nextRow;\r\n\r\n\t\t\t\t\t\tif(moveToRow !== row){\r\n\t\t\t\t\t\t\tstartYMove = e.touches[0].pageY\r\n\t\t\t\t\t\t\tmoveToRow.getElement().parentNode.insertBefore(this.placeholderElement, moveToRow.getElement().nextSibling);\r\n\t\t\t\t\t\t\tthis.moveRow(moveToRow, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(prevRow && -diff - prevRowHeightLast > prevRowHeight){\r\n\t\t\t\t\t\tmoveToRow = prevRow;\r\n\r\n\t\t\t\t\t\tif(moveToRow !== row){\r\n\t\t\t\t\t\t\tstartYMove = e.touches[0].pageY;\r\n\t\t\t\t\t\t\tmoveToRow.getElement().parentNode.insertBefore(this.placeholderElement, moveToRow.getElement());\r\n\t\t\t\t\t\t\tthis.moveRow(moveToRow, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(moveToRow){\r\n\t\t\t\t\tcurrentRow = moveToRow;\r\n\t\t\t\t\tnextRow = moveToRow.nextRow();\r\n\t\t\t\t\tnextRowHeightLast = nextRowHeight;\r\n\t\t\t\t\tnextRowHeight = nextRow ? nextRow.getHeight() / 2 : 0;\r\n\t\t\t\t\tprevRow = moveToRow.prevRow();\r\n\t\t\t\t\tprevRowHeightLast = prevRowHeight;\r\n\t\t\t\t\tprevRowHeight = prevRow ? prevRow.getHeight() / 2 : 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\telement.addEventListener(\"touchend\", (e) => {\r\n\t\t\tif(this.checkTimeout){\r\n\t\t\t\tclearTimeout(this.checkTimeout);\r\n\t\t\t}\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.endMove(e);\r\n\t\t\t\tthis.touchMove = false;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t_bindMouseMove(){\r\n\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\tif((row.type === \"row\" || row.type === \"group\") && row.modules.moveRow && row.modules.moveRow.mousemove){\r\n\t\t\t\trow.getElement().addEventListener(\"mousemove\", row.modules.moveRow.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t_unbindMouseMove(){\r\n\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\tif((row.type === \"row\" || row.type === \"group\") && row.modules.moveRow && row.modules.moveRow.mousemove){\r\n\t\t\t\trow.getElement().removeEventListener(\"mousemove\", row.modules.moveRow.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tstartMove(e, row){\r\n\t\tvar element = row.getElement();\r\n\r\n\t\tthis.setStartPosition(e, row);\r\n\r\n\t\tthis.moving = row;\r\n\r\n\t\tthis.table.element.classList.add(\"tabulator-block-select\");\r\n\r\n\t\t//create placeholder\r\n\t\tthis.placeholderElement.style.width = row.getWidth() + \"px\";\r\n\t\tthis.placeholderElement.style.height = row.getHeight() + \"px\";\r\n\r\n\t\tif(!this.connection){\r\n\t\t\telement.parentNode.insertBefore(this.placeholderElement, element);\r\n\t\t\telement.parentNode.removeChild(element);\r\n\t\t}else{\r\n\t\t\tthis.table.element.classList.add(\"tabulator-movingrow-sending\");\r\n\t\t\tthis.connectToTables(row);\r\n\t\t}\r\n\r\n\t\t//create hover element\r\n\t\tthis.hoverElement = element.cloneNode(true);\r\n\t\tthis.hoverElement.classList.add(\"tabulator-moving\");\r\n\r\n\t\tif(this.connection){\r\n\t\t\tdocument.body.appendChild(this.hoverElement);\r\n\t\t\tthis.hoverElement.style.left = \"0\";\r\n\t\t\tthis.hoverElement.style.top = \"0\";\r\n\t\t\tthis.hoverElement.style.width = this.table.element.clientWidth + \"px\";\r\n\t\t\tthis.hoverElement.style.whiteSpace = \"nowrap\";\r\n\t\t\tthis.hoverElement.style.overflow = \"hidden\";\r\n\t\t\tthis.hoverElement.style.pointerEvents = \"none\";\r\n\t\t}else{\r\n\t\t\tthis.table.rowManager.getTableElement().appendChild(this.hoverElement);\r\n\r\n\t\t\tthis.hoverElement.style.left = \"0\";\r\n\t\t\tthis.hoverElement.style.top = \"0\";\r\n\r\n\t\t\tthis._bindMouseMove();\r\n\t\t}\r\n\r\n\t\tdocument.body.addEventListener(\"mousemove\", this.moveHover);\r\n\t\tdocument.body.addEventListener(\"mouseup\", this.endMove);\r\n\r\n\t\tthis.dispatchExternal(\"rowMoving\", row.getComponent());\r\n\r\n\t\tthis.moveHover(e);\r\n\t}\r\n\r\n\tsetStartPosition(e, row){\r\n\t\tvar pageX = this.touchMove ? e.touches[0].pageX : e.pageX,\r\n\t\tpageY = this.touchMove ? e.touches[0].pageY : e.pageY,\r\n\t\telement, position;\r\n\r\n\t\telement = row.getElement();\r\n\t\tif(this.connection){\r\n\t\t\tposition = element.getBoundingClientRect();\r\n\r\n\t\t\tthis.startX = position.left - pageX + window.pageXOffset;\r\n\t\t\tthis.startY = position.top - pageY + window.pageYOffset;\r\n\t\t}else{\r\n\t\t\tthis.startY = (pageY - element.getBoundingClientRect().top);\r\n\t\t}\r\n\t}\r\n\r\n\tendMove(e){\r\n\t\tif(!e || e.which === 1 || this.touchMove){\r\n\t\t\tthis._unbindMouseMove();\r\n\r\n\t\t\tif(!this.connection){\r\n\t\t\t\tthis.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling);\r\n\t\t\t\tthis.placeholderElement.parentNode.removeChild(this.placeholderElement);\r\n\t\t\t}\r\n\r\n\t\t\tthis.hoverElement.parentNode.removeChild(this.hoverElement);\r\n\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-block-select\");\r\n\r\n\t\t\tif(this.toRow){\r\n\t\t\t\tthis.table.rowManager.moveRow(this.moving, this.toRow, this.toRowAfter);\r\n\t\t\t}else{\r\n\t\t\t\tthis.dispatchExternal(\"rowMoveCancelled\", this.moving.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tthis.moving = false;\r\n\t\t\tthis.toRow = false;\r\n\t\t\tthis.toRowAfter = false;\r\n\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", this.moveHover);\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", this.endMove);\r\n\r\n\t\t\tif(this.connection){\r\n\t\t\t\tthis.table.element.classList.remove(\"tabulator-movingrow-sending\");\r\n\t\t\t\tthis.disconnectFromTables();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmoveRow(row, after){\r\n\t\tthis.toRow = row;\r\n\t\tthis.toRowAfter = after;\r\n\t}\r\n\r\n\tmoveHover(e){\r\n\t\tif(this.connection){\r\n\t\t\tthis.moveHoverConnections.call(this, e);\r\n\t\t}else{\r\n\t\t\tthis.moveHoverTable.call(this, e);\r\n\t\t}\r\n\t}\r\n\r\n\tmoveHoverTable(e){\r\n\t\tvar rowHolder = this.table.rowManager.getElement(),\r\n\t\tscrollTop = rowHolder.scrollTop,\r\n\t\tyPos = ((this.touchMove ? e.touches[0].pageY : e.pageY) - rowHolder.getBoundingClientRect().top) + scrollTop,\r\n\t\tscrollPos;\r\n\r\n\t\tthis.hoverElement.style.top = (yPos - this.startY) + \"px\";\r\n\t}\r\n\r\n\tmoveHoverConnections(e){\r\n\t\tthis.hoverElement.style.left = (this.startX + (this.touchMove ? e.touches[0].pageX : e.pageX)) + \"px\";\r\n\t\tthis.hoverElement.style.top = (this.startY + (this.touchMove ? e.touches[0].pageY : e.pageY)) + \"px\";\r\n\t}\r\n\r\n\telementRowDrop(e, element, row){\r\n\t\tthis.dispatchExternal(\"movableRowsElementDrop\", e, element, row ? row.getComponent() : false);\r\n\t}\r\n\r\n\t//establish connection with other tables\r\n\tconnectToTables(row){\r\n\t\tvar connectionTables;\r\n\r\n\t\tif(this.connectionSelectorsTables){\r\n\t\t\tconnectionTables = this.commsConnections(this.connectionSelectorsTables);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSendingStart\", connectionTables);\r\n\r\n\t\t\tthis.commsSend(this.connectionSelectorsTables, \"moveRow\", \"connect\", {\r\n\t\t\t\trow:row,\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.connectionSelectorsElements){\r\n\r\n\t\t\tthis.connectionElements = [];\r\n\r\n\t\t\tif(!Array.isArray(this.connectionSelectorsElements)){\r\n\t\t\t\tthis.connectionSelectorsElements = [this.connectionSelectorsElements];\r\n\t\t\t}\r\n\r\n\t\t\tthis.connectionSelectorsElements.forEach((query) => {\r\n\t\t\t\tif(typeof query === \"string\"){\r\n\t\t\t\t\tthis.connectionElements = this.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(query)));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.connectionElements.push(query);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.connectionElements.forEach((element) => {\r\n\t\t\t\tvar dropEvent = (e) => {\r\n\t\t\t\t\tthis.elementRowDrop(e, element, this.moving);\r\n\t\t\t\t};\r\n\r\n\t\t\t\telement.addEventListener(\"mouseup\", dropEvent);\r\n\t\t\t\telement.tabulatorElementDropEvent = dropEvent;\r\n\r\n\t\t\t\telement.classList.add(\"tabulator-movingrow-receiving\");\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t//disconnect from other tables\r\n\tdisconnectFromTables(){\r\n\t\tvar connectionTables;\r\n\r\n\t\tif(this.connectionSelectorsTables){\r\n\t\t\tconnectionTables = this.commsConnections(this.connectionSelectorsTables);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSendingStop\", connectionTables);\r\n\r\n\t\t\tthis.commsSend(this.connectionSelectorsTables, \"moveRow\", \"disconnect\");\r\n\t\t}\r\n\r\n\t\tthis.connectionElements.forEach((element) => {\r\n\t\t\telement.classList.remove(\"tabulator-movingrow-receiving\");\r\n\t\t\telement.removeEventListener(\"mouseup\", element.tabulatorElementDropEvent);\r\n\t\t\tdelete element.tabulatorElementDropEvent;\r\n\t\t});\r\n\t}\r\n\r\n\t//accept incomming connection\r\n\tconnect(table, row){\r\n\t\tif(!this.connectedTable){\r\n\t\t\tthis.connectedTable = table;\r\n\t\t\tthis.connectedRow = row;\r\n\r\n\t\t\tthis.table.element.classList.add(\"tabulator-movingrow-receiving\");\r\n\r\n\t\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\t\tif(row.type === \"row\" && row.modules.moveRow && row.modules.moveRow.mouseup){\r\n\t\t\t\t\trow.getElement().addEventListener(\"mouseup\", row.modules.moveRow.mouseup);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.tableRowDropEvent = this.tableRowDrop.bind(this);\r\n\r\n\t\t\tthis.table.element.addEventListener(\"mouseup\", this.tableRowDropEvent);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivingStart\", row, table);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Row Error - Table cannot accept connection, already connected to table:\", this.connectedTable);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//close incomming connection\r\n\tdisconnect(table){\r\n\t\tif(table === this.connectedTable){\r\n\t\t\tthis.connectedTable = false;\r\n\t\t\tthis.connectedRow = false;\r\n\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-movingrow-receiving\");\r\n\r\n\t\t\tthis.table.rowManager.getDisplayRows().forEach((row) =>{\r\n\t\t\t\tif(row.type === \"row\" && row.modules.moveRow && row.modules.moveRow.mouseup){\r\n\t\t\t\t\trow.getElement().removeEventListener(\"mouseup\", row.modules.moveRow.mouseup);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.table.element.removeEventListener(\"mouseup\", this.tableRowDropEvent);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivingStop\", table);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Row Error - trying to disconnect from non connected table\")\r\n\t\t}\r\n\t}\r\n\r\n\tdropComplete(table, row, success){\r\n\t\tvar sender = false;\r\n\r\n\t\tif(success){\r\n\r\n\t\t\tswitch(typeof this.table.options.movableRowsSender){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tsender = this.senders[this.table.options.movableRowsSender];\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tsender = this.table.options.movableRowsSender;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(sender){\r\n\t\t\t\tsender.call(this, this.moving.getComponent(), row ? row.getComponent() : undefined, table)\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.options.movableRowsSender){\r\n\t\t\t\t\tconsole.warn(\"Mover Row Error - no matching sender found:\", this.table.options.movableRowsSender);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSent\", this.moving.getComponent(), row ? row.getComponent() : undefined, table);\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"movableRowsSentFailed\", this.moving.getComponent(), row ? row.getComponent() : undefined, table);\r\n\t\t}\r\n\r\n\t\tthis.endMove();\r\n\t}\r\n\r\n\ttableRowDrop(e, row){\r\n\t\tvar receiver = false,\r\n\t\tsuccess = false;\r\n\r\n\t\te.stopImmediatePropagation();\r\n\r\n\t\tswitch(typeof this.table.options.movableRowsReceiver){\r\n\t\t\tcase \"string\":\r\n\t\t\treceiver = this.receivers[this.table.options.movableRowsReceiver];\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\treceiver = this.table.options.movableRowsReceiver;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(receiver){\r\n\t\t\tsuccess = receiver.call(this, this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable)\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Mover Row Error - no matching receiver found:\", this.table.options.movableRowsReceiver)\r\n\t\t}\r\n\r\n\t\tif(success){\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceived\", this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivedFailed\", this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);\r\n\t\t}\r\n\r\n\t\tthis.commsSend(this.connectedTable, \"moveRow\", \"dropcomplete\", {\r\n\t\t\trow:row,\r\n\t\t\tsuccess:success,\r\n\t\t});\r\n\t}\r\n\r\n\tcommsReceived(table, action, data){\r\n\t\tswitch(action){\r\n\t\t\tcase \"connect\":\r\n\t\t\treturn this.connect(table, data.row);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"disconnect\":\r\n\t\t\treturn this.disconnect(table);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"dropcomplete\":\r\n\t\t\treturn this.dropComplete(table, data.row, data.success);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMoveRows.prototype.receivers = {\r\n\tinsert:function(fromRow, toRow, fromTable){\r\n\t\tthis.table.addRow(fromRow.getData(), undefined, toRow);\r\n\t\treturn true;\r\n\t},\r\n\r\n\tadd:function(fromRow, toRow, fromTable){\r\n\t\tthis.table.addRow(fromRow.getData());\r\n\t\treturn true;\r\n\t},\r\n\r\n\tupdate:function(fromRow, toRow, fromTable){\r\n\t\tif(toRow){\r\n\t\t\ttoRow.update(fromRow.getData());\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n\r\n\treplace:function(fromRow, toRow, fromTable){\r\n\t\tif(toRow){\r\n\t\t\tthis.table.addRow(fromRow.getData(), undefined, toRow);\r\n\t\t\ttoRow.delete();\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n};\r\n\r\nMoveRows.prototype.senders = {\r\n\tdelete:function(fromRow, toRow, toTable){\r\n\t\tfromRow.delete();\r\n\t}\r\n};\r\n\r\nMoveRows.moduleName = \"moveRow\";\r\n\r\nexport default MoveRows;","export default {};","import Module from '../../core/Module.js';\r\n\r\nimport defaultMutators from './defaults/mutators.js';\r\n\r\nclass Mutator extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.allowedTypes = [\"\", \"data\", \"edit\", \"clipboard\"]; //list of muatation types\r\n\t\tthis.enabled = true;\r\n\r\n\t\tthis.registerColumnOption(\"mutator\");\r\n\t\tthis.registerColumnOption(\"mutatorParams\");\r\n\t\tthis.registerColumnOption(\"mutatorData\");\r\n\t\tthis.registerColumnOption(\"mutatorDataParams\");\r\n\t\tthis.registerColumnOption(\"mutatorEdit\");\r\n\t\tthis.registerColumnOption(\"mutatorEditParams\");\r\n\t\tthis.registerColumnOption(\"mutatorClipboard\");\r\n\t\tthis.registerColumnOption(\"mutatorClipboardParams\");\r\n\t\tthis.registerColumnOption(\"mutateLink\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-value-changing\", this.transformCell.bind(this));\r\n\t\tthis.subscribe(\"cell-value-changed\", this.mutateLink.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"row-data-init-before\", this.rowDataChanged.bind(this));\r\n\t\tthis.subscribe(\"row-data-changing\", this.rowDataChanged.bind(this));\r\n\t}\r\n\r\n\trowDataChanged(row, tempData, updatedData){\r\n\t\treturn this.transformRow(tempData, \"data\", updatedData);\r\n\t}\r\n\r\n\t//initialize column mutator\r\n\tinitializeColumn(column){\r\n\t\tvar match = false,\r\n\t\tconfig = {};\r\n\r\n\t\tthis.allowedTypes.forEach((type) => {\r\n\t\t\tvar key = \"mutator\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\t\tmutator;\r\n\r\n\t\t\tif(column.definition[key]){\r\n\t\t\t\tmutator = this.lookupMutator(column.definition[key]);\r\n\r\n\t\t\t\tif(mutator){\r\n\t\t\t\t\tmatch = true;\r\n\r\n\t\t\t\t\tconfig[key] = {\r\n\t\t\t\t\t\tmutator:mutator,\r\n\t\t\t\t\t\tparams: column.definition[key + \"Params\"] || {},\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(match){\r\n\t\t\tcolumn.modules.mutate = config;\r\n\t\t}\r\n\t}\r\n\r\n\tlookupMutator(value){\r\n\t\tvar mutator = false;\r\n\r\n\t\t//set column mutator\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(Mutator.mutators[value]){\r\n\t\t\t\tmutator = Mutator.mutators[value];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Mutator Error - No such mutator found, ignoring: \", value);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tmutator = value;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn mutator;\r\n\t}\r\n\r\n\t//apply mutator to row\r\n\ttransformRow(data, type, updatedData){\r\n\t\tvar key = \"mutator\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\tvalue;\r\n\r\n\t\tif(this.enabled){\r\n\r\n\t\t\tthis.table.columnManager.traverse((column) => {\r\n\t\t\t\tvar mutator, params, component;\r\n\r\n\t\t\t\tif(column.modules.mutate){\r\n\t\t\t\t\tmutator = column.modules.mutate[key] || column.modules.mutate.mutator || false;\r\n\r\n\t\t\t\t\tif(mutator){\r\n\t\t\t\t\t\tvalue = column.getFieldValue(typeof updatedData !== \"undefined\" ? updatedData : data);\r\n\r\n\t\t\t\t\t\tif(type == \"data\" || typeof value !== \"undefined\"){\r\n\t\t\t\t\t\t\tcomponent = column.getComponent();\r\n\t\t\t\t\t\t\tparams = typeof mutator.params === \"function\" ? mutator.params(value, data, type, component) : mutator.params;\r\n\t\t\t\t\t\t\tcolumn.setFieldValue(data, mutator.mutator(value, data, type, params, component));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//apply mutator to new cell value\r\n\ttransformCell(cell, value){\r\n\t\tif(cell.column.modules.mutate){\r\n\t\t\tvar mutator = cell.column.modules.mutate.mutatorEdit || cell.column.modules.mutate.mutator || false,\r\n\t\t\ttempData = {};\r\n\r\n\t\t\tif(mutator){\r\n\t\t\t\ttempData = Object.assign(tempData, cell.row.getData());\r\n\t\t\t\tcell.column.setFieldValue(tempData, value);\r\n\t\t\t\treturn mutator.mutator(value, tempData, \"edit\", mutator.params, cell.getComponent());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\tmutateLink(cell){\r\n\t\tvar links = cell.column.definition.mutateLink;\r\n\r\n\t\tif(links){\r\n\t\t\tif(!Array.isArray(links)){\r\n\t\t\t\tlinks = [links];\r\n\t\t\t}\r\n\r\n\t\t\tlinks.forEach((link) => {\r\n\t\t\t\tvar linkCell = cell.row.getCell(link);\r\n\r\n\t\t\t\tif(linkCell){\r\n\t\t\t\t\tlinkCell.setValue(linkCell.getValue(), true, true);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tenable(){\r\n\t\tthis.enabled = true;\r\n\t}\r\n\r\n\tdisable(){\r\n\t\tthis.enabled = false;\r\n\t}\r\n}\r\n\r\nMutator.moduleName = \"mutator\";\r\n\r\n//load defaults\r\nMutator.mutators = defaultMutators;\r\n\r\nexport default Mutator;","export default function(pageSize, currentRow, currentPage, totalRows, totalPages){\r\n\tvar el = document.createElement(\"span\"),\r\n\tshowingEl = document.createElement(\"span\"),\r\n\tvalueEl = document.createElement(\"span\"),\r\n\tofEl = document.createElement(\"span\"),\r\n\ttotalEl = document.createElement(\"span\"),\r\n\trowsEl = document.createElement(\"span\");\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|showing\", (value) => {\r\n\t\tshowingEl.innerHTML = value;\r\n\t});\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|of\", (value) => {\r\n\t\tofEl.innerHTML = value;\r\n\t});\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|rows\", (value) => {\r\n\t\trowsEl.innerHTML = value;\r\n\t});\r\n\r\n\tif(totalRows){\r\n\t\tvalueEl.innerHTML = \" \" + currentRow + \"-\" + Math.min((currentRow + pageSize - 1), totalRows) + \" \";\r\n\t\t\r\n\t\ttotalEl.innerHTML = \" \" + totalRows + \" \";\r\n\t\t\r\n\t\tel.appendChild(showingEl);\r\n\t\tel.appendChild(valueEl);\r\n\t\tel.appendChild(ofEl);\r\n\t\tel.appendChild(totalEl);\r\n\t\tel.appendChild(rowsEl);\r\n\t}else{\r\n\t\tvalueEl.innerHTML = \" 0 \";\r\n\r\n\t\tel.appendChild(showingEl);\r\n\t\tel.appendChild(valueEl);\r\n\t\tel.appendChild(rowsEl);\r\n\t}\r\n\t\r\n\treturn el;\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultPageCounters from './defaults/pageCounters.js';\r\n\r\nclass Page extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.mode = \"local\";\r\n\t\tthis.progressiveLoad = false;\r\n\t\t\r\n\t\tthis.element = null;\r\n\t\tthis.pageCounterElement = null;\r\n\t\tthis.pageCounter = null;\r\n\t\t\r\n\t\tthis.size = 0;\r\n\t\tthis.page = 1;\r\n\t\tthis.count = 5;\r\n\t\tthis.max = 1;\r\n\r\n\t\tthis.remoteRowCountEstimate = null;\r\n\t\t\r\n\t\tthis.displayIndex = 0; //index in display pipeline\r\n\t\t\r\n\t\tthis.initialLoad = true;\r\n\t\tthis.dataChanging = false; //flag to check if data is being changed by this module\r\n\t\t\r\n\t\tthis.pageSizes = [];\r\n\t\t\r\n\t\tthis.registerTableOption(\"pagination\", false); //set pagination type\r\n\t\tthis.registerTableOption(\"paginationMode\", \"local\"); //local or remote pagination\r\n\t\tthis.registerTableOption(\"paginationSize\", false); //set number of rows to a page\r\n\t\tthis.registerTableOption(\"paginationInitialPage\", 1); //initial page to show on load\r\n\t\tthis.registerTableOption(\"paginationCounter\", false); // set pagination counter\r\n\t\tthis.registerTableOption(\"paginationCounterElement\", false); // set pagination counter\r\n\t\tthis.registerTableOption(\"paginationButtonCount\", 5); // set count of page button\r\n\t\tthis.registerTableOption(\"paginationSizeSelector\", false); //add pagination size selector element\r\n\t\tthis.registerTableOption(\"paginationElement\", false); //element to hold pagination numbers\r\n\t\t// this.registerTableOption(\"paginationDataSent\", {}); //pagination data sent to the server\r\n\t\t// this.registerTableOption(\"paginationDataReceived\", {}); //pagination data received from the server\r\n\t\tthis.registerTableOption(\"paginationAddRow\", \"page\"); //add rows on table or page\r\n\t\t\r\n\t\tthis.registerTableOption(\"progressiveLoad\", false); //progressive loading\r\n\t\tthis.registerTableOption(\"progressiveLoadDelay\", 0); //delay between requests\r\n\t\tthis.registerTableOption(\"progressiveLoadScrollMargin\", 0); //margin before scroll begins\r\n\t\t\r\n\t\tthis.registerTableFunction(\"setMaxPage\", this.setMaxPage.bind(this));\r\n\t\tthis.registerTableFunction(\"setPage\", this.setPage.bind(this));\r\n\t\tthis.registerTableFunction(\"setPageToRow\", this.userSetPageToRow.bind(this));\r\n\t\tthis.registerTableFunction(\"setPageSize\", this.userSetPageSize.bind(this));\r\n\t\tthis.registerTableFunction(\"getPageSize\", this.getPageSize.bind(this));\r\n\t\tthis.registerTableFunction(\"previousPage\", this.previousPage.bind(this));\r\n\t\tthis.registerTableFunction(\"nextPage\", this.nextPage.bind(this));\r\n\t\tthis.registerTableFunction(\"getPage\", this.getPage.bind(this));\r\n\t\tthis.registerTableFunction(\"getPageMax\", this.getPageMax.bind(this));\r\n\t\t\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"pageTo\", this.setPageToRow.bind(this));\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"row-added\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"data-processed\", this.initialLoadComplete.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.calculatePageSizes.bind(this));\r\n\t\t\tthis.subscribe(\"footer-redraw\", this.footerRedraw.bind(this));\r\n\r\n\t\t\tif(this.table.options.paginationAddRow == \"page\"){\r\n\t\t\t\tthis.subscribe(\"row-adding-position\", this.rowAddingPosition.bind(this));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.options.paginationMode === \"remote\"){\r\n\t\t\t\tthis.subscribe(\"data-params\", this.remotePageParams.bind(this));\r\n\t\t\t\tthis.subscribe(\"data-loaded\", this._parseRemoteData.bind(this));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.options.progressiveLoad){\r\n\t\t\t\tconsole.error(\"Progressive Load Error - Pagination and progressive load cannot be used at the same time\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.registerDisplayHandler(this.restOnRenderBefore.bind(this), 40);\r\n\t\t\tthis.registerDisplayHandler(this.getRows.bind(this), 50);\r\n\t\t\t\r\n\t\t\tthis.createElements();\r\n\t\t\tthis.initializePageCounter();\r\n\t\t\tthis.initializePaginator();\r\n\t\t}else if(this.table.options.progressiveLoad){\r\n\t\t\tthis.subscribe(\"data-params\", this.remotePageParams.bind(this));\r\n\t\t\tthis.subscribe(\"data-loaded\", this._parseRemoteData.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.calculatePageSizes.bind(this));\r\n\t\t\tthis.subscribe(\"data-processed\", this.initialLoadComplete.bind(this));\r\n\t\t\t\r\n\t\t\tthis.initializeProgressive(this.table.options.progressiveLoad)\r\n\t\t\t\r\n\t\t\tif(this.table.options.progressiveLoad === \"scroll\"){\r\n\t\t\t\tthis.subscribe(\"scroll-vertical\", this.scrollVertical.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trowAddingPosition(row, top){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tdispRows = rowManager.getDisplayRows(),\r\n\t\tindex;\r\n\t\t\r\n\t\tif(top){\r\n\t\t\tif(dispRows.length){\r\n\t\t\t\tindex = dispRows[0];\r\n\t\t\t}else{\r\n\t\t\t\tif(rowManager.activeRows.length){\r\n\t\t\t\t\tindex = rowManager.activeRows[rowManager.activeRows.length-1];\r\n\t\t\t\t\ttop = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(dispRows.length){\r\n\t\t\t\tindex = dispRows[dispRows.length - 1];\r\n\t\t\t\ttop = dispRows.length < this.size ? false : true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn {index, top}\r\n\t}\r\n\t\r\n\tcalculatePageSizes(){\r\n\t\tvar testElRow, testElCell;\r\n\t\t\r\n\t\tif(this.table.options.paginationSize){\r\n\t\t\tthis.size = this.table.options.paginationSize;\r\n\t\t}else{\r\n\t\t\ttestElRow = document.createElement(\"div\");\r\n\t\t\ttestElRow.classList.add(\"tabulator-row\");\r\n\t\t\ttestElRow.style.visibility = \"hidden\";\r\n\t\t\t\r\n\t\t\ttestElCell = document.createElement(\"div\");\r\n\t\t\ttestElCell.classList.add(\"tabulator-cell\");\r\n\t\t\ttestElCell.innerHTML = \"Page Row Test\";\r\n\t\t\t\r\n\t\t\ttestElRow.appendChild(testElCell);\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.getTableElement().appendChild(testElRow);\r\n\t\t\t\r\n\t\t\tthis.size = Math.floor(this.table.rowManager.getElement().clientHeight / testElRow.offsetHeight);\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.getTableElement().removeChild(testElRow);\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(\"pageSizeChanged\", this.size);\r\n\t\t\r\n\t\tthis.generatePageSizeSelectList();\r\n\t}\r\n\t\r\n\tinitialLoadComplete(){\r\n\t\tthis.initialLoad = false;\r\n\t}\r\n\t\r\n\tremotePageParams(data, config, silent, params){\r\n\t\tif(!this.initialLoad){\r\n\t\t\tif((this.progressiveLoad && !silent) || (!this.progressiveLoad && !this.dataChanging)){\r\n\t\t\t\tthis.reset(true);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//configure request params\r\n\t\tparams.page = this.page;\r\n\t\t\r\n\t\t//set page size if defined\r\n\t\tif(this.size){\r\n\t\t\tparams.size = this.size;\r\n\t\t}\r\n\t\t\r\n\t\treturn params;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\tuserSetPageToRow(row){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\trow = this.rowManager.findRow(row);\r\n\t\t\t\r\n\t\t\tif(row){\r\n\t\t\t\treturn this.setPageToRow(row)\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn Promise.reject();\r\n\t}\r\n\t\r\n\tuserSetPageSize(size){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\tthis.setPageSize(size);\r\n\t\t\treturn this.setPage(1);\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tscrollVertical(top, dir){\r\n\t\tvar element, diff, margin;\r\n\t\tif(!dir && !this.table.dataLoader.loading){\r\n\t\t\telement = this.table.rowManager.getElement();\r\n\t\t\tdiff = element.scrollHeight - element.clientHeight - top;\r\n\t\t\tmargin = this.table.options.progressiveLoadScrollMargin || (element.clientHeight * 2);\r\n\t\t\t\r\n\t\t\tif(diff < margin){\r\n\t\t\t\tthis.nextPage()\r\n\t\t\t\t.catch(() => {}); //consume the exception thrown when on the last page\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trestOnRenderBefore(rows, renderInPosition){\r\n\t\tif(!renderInPosition){\r\n\t\t\tif(this.mode === \"local\"){\r\n\t\t\t\tthis.reset();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\trowsUpdated(){\r\n\t\tthis.refreshData(true, \"all\");\r\n\t}\r\n\t\r\n\tcreateElements(){\r\n\t\tvar button;\r\n\t\t\r\n\t\tthis.element = document.createElement(\"span\");\r\n\t\tthis.element.classList.add(\"tabulator-paginator\");\r\n\t\t\r\n\t\tthis.pagesElement = document.createElement(\"span\");\r\n\t\tthis.pagesElement.classList.add(\"tabulator-pages\");\r\n\t\t\r\n\t\tbutton = document.createElement(\"button\");\r\n\t\tbutton.classList.add(\"tabulator-page\");\r\n\t\tbutton.setAttribute(\"type\", \"button\");\r\n\t\tbutton.setAttribute(\"role\", \"button\");\r\n\t\tbutton.setAttribute(\"aria-label\", \"\");\r\n\t\tbutton.setAttribute(\"title\", \"\");\r\n\t\t\r\n\t\tthis.firstBut = button.cloneNode(true);\r\n\t\tthis.firstBut.setAttribute(\"data-page\", \"first\");\r\n\t\t\r\n\t\tthis.prevBut = button.cloneNode(true);\r\n\t\tthis.prevBut.setAttribute(\"data-page\", \"prev\");\r\n\t\t\r\n\t\tthis.nextBut = button.cloneNode(true);\r\n\t\tthis.nextBut.setAttribute(\"data-page\", \"next\");\r\n\t\t\r\n\t\tthis.lastBut = button.cloneNode(true);\r\n\t\tthis.lastBut.setAttribute(\"data-page\", \"last\");\r\n\t\t\r\n\t\tif(this.table.options.paginationSizeSelector){\r\n\t\t\tthis.pageSizeSelect = document.createElement(\"select\");\r\n\t\t\tthis.pageSizeSelect.classList.add(\"tabulator-page-size\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tgeneratePageSizeSelectList(){\r\n\t\tvar pageSizes = [];\r\n\t\t\r\n\t\tif(this.pageSizeSelect){\r\n\t\t\t\r\n\t\t\tif(Array.isArray(this.table.options.paginationSizeSelector)){\r\n\t\t\t\tpageSizes = this.table.options.paginationSizeSelector;\r\n\t\t\t\tthis.pageSizes = pageSizes;\r\n\t\t\t\t\r\n\t\t\t\tif(this.pageSizes.indexOf(this.size) == -1){\r\n\t\t\t\t\tpageSizes.unshift(this.size);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t\r\n\t\t\t\tif(this.pageSizes.indexOf(this.size) == -1){\r\n\t\t\t\t\tpageSizes = [];\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (let i = 1; i < 5; i++){\r\n\t\t\t\t\t\tpageSizes.push(this.size * i);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.pageSizes = pageSizes;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tpageSizes = this.pageSizes;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\twhile(this.pageSizeSelect.firstChild) this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);\r\n\t\t\t\r\n\t\t\tpageSizes.forEach((item) => {\r\n\t\t\t\tvar itemEl = document.createElement(\"option\");\r\n\t\t\t\titemEl.value = item;\r\n\t\t\t\t\r\n\t\t\t\tif(item === true){\r\n\t\t\t\t\tthis.langBind(\"pagination|all\", function(value){\r\n\t\t\t\t\t\titemEl.innerHTML = value;\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\titemEl.innerHTML = item;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tthis.pageSizeSelect.appendChild(itemEl);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.pageSizeSelect.value = this.size;\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializePageCounter(){\r\n\t\tvar counter = this.table.options.paginationCounter,\r\n\t\tpageCounter = null;\r\n\t\t\r\n\t\tif(counter){\r\n\t\t\tif(typeof counter === \"function\"){\r\n\t\t\t\tpageCounter = counter;\r\n\t\t\t}else{\r\n\t\t\t\tpageCounter = Page.pageCounters[counter];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(pageCounter){\r\n\t\t\t\tthis.pageCounter = pageCounter;\r\n\t\t\t\t\r\n\t\t\t\tthis.pageCounterElement = document.createElement(\"span\");\r\n\t\t\t\tthis.pageCounterElement.classList.add(\"tabulator-page-counter\");\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Pagination Error - No such page counter found: \", counter);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//setup pagination\r\n\tinitializePaginator(hidden){\r\n\t\tvar pageSelectLabel, paginationCounterHolder;\r\n\t\t\r\n\t\tif(!hidden){\r\n\t\t\t//build pagination element\r\n\t\t\t\r\n\t\t\t//bind localizations\r\n\t\t\tthis.langBind(\"pagination|first\", (value) => {\r\n\t\t\t\tthis.firstBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|first_title\", (value) => {\r\n\t\t\t\tthis.firstBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.firstBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|prev\", (value) => {\r\n\t\t\t\tthis.prevBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|prev_title\", (value) => {\r\n\t\t\t\tthis.prevBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.prevBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|next\", (value) => {\r\n\t\t\t\tthis.nextBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|next_title\", (value) => {\r\n\t\t\t\tthis.nextBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.nextBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|last\", (value) => {\r\n\t\t\t\tthis.lastBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|last_title\", (value) => {\r\n\t\t\t\tthis.lastBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.lastBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t//click bindings\r\n\t\t\tthis.firstBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.setPage(1)\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.prevBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.previousPage()\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.nextBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.nextPage()\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.lastBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.setPage(this.max)\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(this.table.options.paginationElement){\r\n\t\t\t\tthis.element = this.table.options.paginationElement;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.pageSizeSelect){\r\n\t\t\t\tpageSelectLabel = document.createElement(\"label\");\r\n\t\t\t\t\r\n\t\t\t\tthis.langBind(\"pagination|page_size\", (value) => {\r\n\t\t\t\t\tthis.pageSizeSelect.setAttribute(\"aria-label\", value);\r\n\t\t\t\t\tthis.pageSizeSelect.setAttribute(\"title\", value);\r\n\t\t\t\t\tpageSelectLabel.innerHTML = value;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.element.appendChild(pageSelectLabel);\r\n\t\t\t\tthis.element.appendChild(this.pageSizeSelect);\r\n\t\t\t\t\r\n\t\t\t\tthis.pageSizeSelect.addEventListener(\"change\", (e) => {\r\n\t\t\t\t\tthis.setPageSize(this.pageSizeSelect.value == \"true\" ? true : this.pageSizeSelect.value);\r\n\t\t\t\t\tthis.setPage(1)\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//append to DOM\r\n\t\t\tthis.element.appendChild(this.firstBut);\r\n\t\t\tthis.element.appendChild(this.prevBut);\r\n\t\t\tthis.element.appendChild(this.pagesElement);\r\n\t\t\tthis.element.appendChild(this.nextBut);\r\n\t\t\tthis.element.appendChild(this.lastBut);\r\n\t\t\t\r\n\t\t\tif(!this.table.options.paginationElement && !hidden){\r\n\t\t\t\tif(this.table.options.paginationCounter){\r\n\r\n\t\t\t\t\tpaginationCounterHolder \r\n\r\n\t\t\t\t\tif(this.table.options.paginationCounterElement){\r\n\t\t\t\t\t\tif(this.table.options.paginationCounterElement instanceof HTMLElement){\r\n\t\t\t\t\t\t\tthis.table.options.paginationCounterElement.appendChild(this.pageCounterElement);\r\n\t\t\t\t\t\t}else if(typeof this.table.options.paginationCounterElement === \"string\"){\r\n\t\t\t\t\t\t\tpaginationCounterHolder = document.querySelector(this.table.options.paginationCounterElement);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(paginationCounterHolder){\r\n\t\t\t\t\t\t\t\tpaginationCounterHolder.appendChild(this.pageCounterElement);\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Pagination Error - Unable to find element matching paginationCounterElement selector:\", this.table.options.paginationCounterElement);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.footerAppend(this.pageCounterElement);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.footerAppend(this.element);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.page = this.table.options.paginationInitialPage;\r\n\t\t\tthis.count = this.table.options.paginationButtonCount;\r\n\t\t}\r\n\t\t\r\n\t\t//set default values\r\n\t\tthis.mode = this.table.options.paginationMode;\r\n\t}\r\n\t\r\n\tinitializeProgressive(mode){\r\n\t\tthis.initializePaginator(true);\r\n\t\tthis.mode = \"progressive_\" + mode;\r\n\t\tthis.progressiveLoad = true;\r\n\t}\r\n\t\r\n\ttrackChanges(){\r\n\t\tthis.dispatch(\"page-changed\");\r\n\t}\r\n\t\r\n\tsetDisplayIndex(index){\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\t\r\n\tgetDisplayIndex(){\r\n\t\treturn this.displayIndex;\r\n\t}\r\n\t\r\n\t//calculate maximum page from number of rows\r\n\tsetMaxRows(rowCount){\r\n\t\tif(!rowCount){\r\n\t\t\tthis.max = 1;\r\n\t\t}else{\r\n\t\t\tthis.max = this.size === true ? 1 : Math.ceil(rowCount/this.size);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.page > this.max){\r\n\t\t\tthis.page = this.max;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//reset to first page without triggering action\r\n\treset(force){\r\n\t\tif(!this.initialLoad){\r\n\t\t\tif(this.mode == \"local\" || force){\r\n\t\t\t\tthis.page = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set the maximum page\r\n\tsetMaxPage(max){\r\n\t\t\r\n\t\tmax = parseInt(max);\r\n\t\t\r\n\t\tthis.max = max || 1;\r\n\t\t\r\n\t\tif(this.page > this.max){\r\n\t\t\tthis.page = this.max;\r\n\t\t\tthis.trigger();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set current page number\r\n\tsetPage(page){\r\n\t\tswitch(page){\r\n\t\t\tcase \"first\":\r\n\t\t\treturn this.setPage(1);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"prev\":\r\n\t\t\treturn this.previousPage();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"next\":\r\n\t\t\treturn this.nextPage();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"last\":\r\n\t\t\treturn this.setPage(this.max);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\tpage = parseInt(page);\r\n\t\t\r\n\t\tif((page > 0 && page <= this.max) || this.mode !== \"local\"){\r\n\t\t\tthis.page = page;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Requested page is out of range of 1 - \" + this.max + \":\", page);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetPageToRow(row){\r\n\t\tvar rows = this.table.rowManager.getDisplayRows(this.displayIndex - 1);\r\n\t\tvar index = rows.indexOf(row);\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tvar page = this.size === true ? 1 : Math.ceil((index + 1) / this.size);\r\n\t\t\t\r\n\t\t\treturn this.setPage(page)\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Requested row is not visible\");\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetPageSize(size){\r\n\t\tif(size !== true){\r\n\t\t\tsize = parseInt(size);\r\n\t\t}\r\n\r\n\t\tif(size > 0){\r\n\t\t\tthis.size = size;\r\n\t\t\tthis.dispatchExternal(\"pageSizeChanged\", size);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.pageSizeSelect){\r\n\t\t\t// this.pageSizeSelect.value = size;\r\n\t\t\tthis.generatePageSizeSelectList();\r\n\t\t}\r\n\t\t\r\n\t\tthis.trackChanges();\r\n\t}\r\n\t\r\n\t_setPageCounter(totalRows, size, currentRow){\r\n\t\tvar content;\r\n\t\t\r\n\t\tif(this.pageCounter){\r\n\r\n\t\t\tif(this.mode === \"remote\"){\r\n\t\t\t\tsize = this.size;\r\n\t\t\t\tcurrentRow = ((this.page - 1) * this.size) + 1;\r\n\t\t\t\ttotalRows = this.remoteRowCountEstimate;\r\n\t\t\t}\r\n\r\n\t\t\tcontent = this.pageCounter.call(this, size, currentRow, this.page, totalRows, this.max);\r\n\t\t\t\r\n\t\t\tswitch(typeof content){\r\n\t\t\t\tcase \"object\":\r\n\t\t\t\tif(content instanceof Node){\r\n\t\t\t\t\t\r\n\t\t\t\t\t//clear previous cell contents\r\n\t\t\t\t\twhile(this.pageCounterElement.firstChild) this.pageCounterElement.removeChild(this.pageCounterElement.firstChild);\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.pageCounterElement.appendChild(content);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.pageCounterElement.innerHTML = \"\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(content != null){\r\n\t\t\t\t\t\tconsole.warn(\"Page Counter Error - Page Counter has returned a type of object, the only valid page counter object return is an instance of Node, the page counter returned:\", content);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"undefined\":\r\n\t\t\t\tcase \"null\":\r\n\t\t\t\tthis.pageCounterElement.innerHTML = \"\";\r\n\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\tthis.pageCounterElement.innerHTML = content;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//setup the pagination buttons\r\n\t_setPageButtons(){\r\n\t\tlet leftSize = Math.floor((this.count-1) / 2);\r\n\t\tlet rightSize = Math.ceil((this.count-1) / 2);\r\n\t\tlet min = this.max - this.page + leftSize + 1 < this.count ? this.max-this.count+1: Math.max(this.page-leftSize,1);\r\n\t\tlet max = this.page <= rightSize? Math.min(this.count, this.max) :Math.min(this.page+rightSize, this.max);\r\n\t\t\r\n\t\twhile(this.pagesElement.firstChild) this.pagesElement.removeChild(this.pagesElement.firstChild);\r\n\t\t\r\n\t\tif(this.page == 1){\r\n\t\t\tthis.firstBut.disabled = true;\r\n\t\t\tthis.prevBut.disabled = true;\r\n\t\t}else{\r\n\t\t\tthis.firstBut.disabled = false;\r\n\t\t\tthis.prevBut.disabled = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.page == this.max){\r\n\t\t\tthis.lastBut.disabled = true;\r\n\t\t\tthis.nextBut.disabled = true;\r\n\t\t}else{\r\n\t\t\tthis.lastBut.disabled = false;\r\n\t\t\tthis.nextBut.disabled = false;\r\n\t\t}\r\n\t\t\r\n\t\tfor(let i = min; i <= max; i++){\r\n\t\t\tif(i>0 && i <= this.max){\r\n\t\t\t\tthis.pagesElement.appendChild(this._generatePageButton(i));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.footerRedraw();\r\n\t}\r\n\t\r\n\t_generatePageButton(page){\r\n\t\tvar button = document.createElement(\"button\");\r\n\t\t\r\n\t\tbutton.classList.add(\"tabulator-page\");\r\n\t\tif(page == this.page){\r\n\t\t\tbutton.classList.add(\"active\");\r\n\t\t}\r\n\t\t\r\n\t\tbutton.setAttribute(\"type\", \"button\");\r\n\t\tbutton.setAttribute(\"role\", \"button\");\r\n\t\t\r\n\t\tthis.langBind(\"pagination|page_title\", (value) => {\r\n\t\t\tbutton.setAttribute(\"aria-label\", value + \" \" + page);\r\n\t\t\tbutton.setAttribute(\"title\", value + \" \" + page);\r\n\t\t});\r\n\t\t\r\n\t\tbutton.setAttribute(\"data-page\", page);\r\n\t\tbutton.textContent = page;\r\n\t\t\r\n\t\tbutton.addEventListener(\"click\", (e) => {\r\n\t\t\tthis.setPage(page)\r\n\t\t});\r\n\t\t\r\n\t\treturn button;\r\n\t}\r\n\t\r\n\t//previous page\r\n\tpreviousPage(){\r\n\t\tif(this.page > 1){\r\n\t\t\tthis.page--;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger()\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Previous page would be less than page 1:\", 0);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//next page\r\n\tnextPage(){\r\n\t\tif(this.page < this.max){\r\n\t\t\tthis.page++;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger();\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tif(!this.progressiveLoad){\r\n\t\t\t\tconsole.warn(\"Pagination Error - Next page would be greater than maximum page of \" + this.max + \":\", this.max + 1);\r\n\t\t\t}\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return current page number\r\n\tgetPage(){\r\n\t\treturn this.page;\r\n\t}\r\n\t\r\n\t//return max page number\r\n\tgetPageMax(){\r\n\t\treturn this.max;\r\n\t}\r\n\t\r\n\tgetPageSize(size){\r\n\t\treturn this.size;\r\n\t}\r\n\t\r\n\tgetMode(){\r\n\t\treturn this.mode;\r\n\t}\r\n\t\r\n\t//return appropriate rows for current page\r\n\tgetRows(data){\r\n\t\tvar actualRowPageSize = 0,\r\n\t\toutput, start, end, actualStartRow;\r\n\r\n\t\tvar actualRows = data.filter((row) => {\r\n\t\t\treturn row.type === \"row\";\r\n\t\t});\r\n\t\t\r\n\t\tif(this.mode == \"local\"){\r\n\t\t\toutput = [];\r\n\t\t\t\r\n\t\t\tthis.setMaxRows(data.length);\r\n\t\t\t\r\n\t\t\tif(this.size === true){\r\n\t\t\t\tstart = 0;\r\n\t\t\t\tend = data.length;\r\n\t\t\t}else{\r\n\t\t\t\tstart = this.size * (this.page - 1);\r\n\t\t\t\tend = start + parseInt(this.size);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._setPageButtons();\r\n\t\t\t\r\n\t\t\tfor(let i = start; i < end; i++){\r\n\t\t\t\tlet row = data[i];\r\n\r\n\t\t\t\tif(row){\r\n\t\t\t\t\toutput.push(row);\r\n\r\n\t\t\t\t\tif(row.type === \"row\"){\r\n\t\t\t\t\t\tif(!actualStartRow){\r\n\t\t\t\t\t\t\tactualStartRow = row;\r\n\t\t\t\t\t\t}\t\r\n\r\n\t\t\t\t\t\tactualRowPageSize++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._setPageCounter(actualRows.length, actualRowPageSize, actualStartRow ? (actualRows.indexOf(actualStartRow) + 1) : 0);\r\n\t\t\t\r\n\t\t\treturn output;\r\n\t\t}else{\r\n\t\t\tthis._setPageButtons();\r\n\t\t\tthis._setPageCounter(actualRows.length);\r\n\t\t\t\r\n\t\t\treturn data.slice(0);\r\n\t\t}\r\n\t}\r\n\t\r\n\ttrigger(){\r\n\t\tvar left;\r\n\t\t\r\n\t\tswitch(this.mode){\r\n\t\t\tcase \"local\":\r\n\t\t\tleft = this.table.rowManager.scrollLeft;\r\n\t\t\t\r\n\t\t\tthis.refreshData();\r\n\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"pageLoaded\", this.getPage());\r\n\t\t\t\r\n\t\t\treturn Promise.resolve();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"remote\":\r\n\t\t\tthis.dataChanging = true;\r\n\t\t\treturn this.reloadData(null)\r\n\t\t\t.finally(() => {\r\n\t\t\t\tthis.dataChanging = false;\r\n\t\t\t})\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"progressive_load\":\r\n\t\t\tcase \"progressive_scroll\":\r\n\t\t\treturn this.reloadData(null, true);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\tconsole.warn(\"Pagination Error - no such pagination mode:\", this.mode);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_parseRemoteData(data){\r\n\t\tvar left, data, margin;\r\n\t\t\r\n\t\tif(typeof data.last_page === \"undefined\"){\r\n\t\t\tconsole.warn(\"Remote Pagination Error - Server response missing '\" + (this.options(\"dataReceiveParams\").last_page || \"last_page\") + \"' property\");\r\n\t\t}\r\n\t\t\r\n\t\tif(data.data){\r\n\t\t\tthis.max = parseInt(data.last_page) || 1;\r\n\r\n\t\t\tthis.remoteRowCountEstimate = typeof data.last_row !== \"undefined\" ? data.last_row : (data.last_page * this.size - (this.page == data.last_page ? (this.size - data.data.length) : 0));\r\n\t\t\t\r\n\t\t\tif(this.progressiveLoad){\r\n\t\t\t\tswitch(this.mode){\r\n\t\t\t\t\tcase \"progressive_load\":\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.page == 1){\r\n\t\t\t\t\t\tthis.table.rowManager.setData(data.data, false, this.page == 1)\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.table.rowManager.addRows(data.data);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.page < this.max){\r\n\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\tthis.nextPage();\r\n\t\t\t\t\t\t}, this.table.options.progressiveLoadDelay);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"progressive_scroll\":\r\n\t\t\t\t\tdata = this.page === 1 ? data.data : this.table.rowManager.getData().concat(data.data);\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.table.rowManager.setData(data, this.page !== 1, this.page == 1);\r\n\t\t\t\t\t\r\n\t\t\t\t\tmargin = this.table.options.progressiveLoadScrollMargin || (this.table.rowManager.element.clientHeight * 2);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.table.rowManager.element.scrollHeight <= (this.table.rowManager.element.clientHeight + margin)){\r\n\t\t\t\t\t\tif(this.page < this.max){\r\n\t\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\t\tthis.nextPage();\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\t// left = this.table.rowManager.scrollLeft;\r\n\t\t\t\tthis.dispatchExternal(\"pageLoaded\", this.getPage());\r\n\t\t\t\t// this.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\t// this.table.columnManager.scrollHorizontal(left);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Remote Pagination Error - Server response missing '\" + (this.options(\"dataReceiveParams\").data || \"data\") + \"' property\");\r\n\t\t}\r\n\t\t\r\n\t\treturn data.data;\r\n\t}\r\n\t\r\n\t//handle the footer element being redrawn\r\n\tfooterRedraw(){\r\n\t\tvar footer = this.table.footerManager.containerElement;\r\n\r\n\t\tif((Math.ceil(footer.clientWidth) - footer.scrollWidth) < 0){\r\n\t\t\tthis.pagesElement.style.display = 'none';\r\n\t\t}else{\r\n\t\t\tthis.pagesElement.style.display = '';\r\n\t\t\t\r\n\t\t\tif((Math.ceil(footer.clientWidth) - footer.scrollWidth) < 0){\r\n\t\t\t\tthis.pagesElement.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nPage.moduleName = \"page\";\r\n\r\n//load defaults\r\nPage.pageCounters = defaultPageCounters;\r\n\r\nexport default Page;","export default function(pageSize, currentRow, currentPage, totalRows, totalPages){\r\n\r\n var el = document.createElement(\"span\"),\r\n\tshowingEl = document.createElement(\"span\"),\r\n\tvalueEl = document.createElement(\"span\"),\r\n\tofEl = document.createElement(\"span\"),\r\n\ttotalEl = document.createElement(\"span\"),\r\n\trowsEl = document.createElement(\"span\");\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|showing\", (value) => {\r\n\t\tshowingEl.innerHTML = value;\r\n\t});\r\n\t\r\n\tvalueEl.innerHTML = \" \" + currentPage + \" \";\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|of\", (value) => {\r\n\t\tofEl.innerHTML = value;\r\n\t});\r\n\t\r\n\ttotalEl.innerHTML = \" \" + totalPages + \" \";\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|pages\", (value) => {\r\n\t\trowsEl.innerHTML = value;\r\n\t});\r\n\t\r\n\tel.appendChild(showingEl);\r\n\tel.appendChild(valueEl);\r\n\tel.appendChild(ofEl);\r\n\tel.appendChild(totalEl);\r\n\tel.appendChild(rowsEl);\r\n\t\r\n\treturn el;\r\n};","import rows from './pageCounters/rows.js';\r\nimport pages from './pageCounters/pages.js';\r\n\r\n\r\nexport default {\r\n\trows:rows,\r\n\tpages:pages,\r\n};","// read peristence information from storage\r\nexport default {\r\n\tlocal:function(id, type){\r\n\t\tvar data = localStorage.getItem(id + \"-\" + type);\r\n\r\n\t\treturn data ? JSON.parse(data) : false;\r\n\t},\r\n\tcookie:function(id, type){\r\n\t\tvar cookie = document.cookie,\r\n\t\tkey = id + \"-\" + type,\r\n\t\tcookiePos = cookie.indexOf(key + \"=\"),\r\n\t\tend, data;\r\n\r\n\t\t//if cookie exists, decode and load column data into tabulator\r\n\t\tif(cookiePos > -1){\r\n\t\t\tcookie = cookie.slice(cookiePos);\r\n\r\n\t\t\tend = cookie.indexOf(\";\");\r\n\r\n\t\t\tif(end > -1){\r\n\t\t\t\tcookie = cookie.slice(0, end);\r\n\t\t\t}\r\n\r\n\t\t\tdata = cookie.replace(key + \"=\", \"\");\r\n\t\t}\r\n\r\n\t\treturn data ? JSON.parse(data) : false;\r\n\t}\r\n};\r\n","//write persistence information to storage\r\nexport default {\r\n\tlocal:function(id, type, data){\r\n\t\tlocalStorage.setItem(id + \"-\" + type, JSON.stringify(data));\r\n\t},\r\n\tcookie:function(id, type, data){\r\n\t\tvar expireDate = new Date();\r\n\r\n\t\texpireDate.setDate(expireDate.getDate() + 10000);\r\n\r\n\t\tdocument.cookie = id + \"-\" + type + \"=\" + JSON.stringify(data) + \"; expires=\" + expireDate.toUTCString();\r\n\t}\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultReaders from './defaults/readers.js';\r\nimport defaultWriters from './defaults/writers.js';\r\n\r\nclass Persistence extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.mode = \"\";\r\n\t\tthis.id = \"\";\r\n\t\t// this.persistProps = [\"field\", \"width\", \"visible\"];\r\n\t\tthis.defWatcherBlock = false;\r\n\t\tthis.config = {};\r\n\t\tthis.readFunc = false;\r\n\t\tthis.writeFunc = false;\r\n\r\n\t\tthis.registerTableOption(\"persistence\", false);\r\n\t\tthis.registerTableOption(\"persistenceID\", \"\"); //key for persistent storage\r\n\t\tthis.registerTableOption(\"persistenceMode\", true); //mode for storing persistence information\r\n\t\tthis.registerTableOption(\"persistenceReaderFunc\", false); //function for handling persistence data reading\r\n\t\tthis.registerTableOption(\"persistenceWriterFunc\", false); //function for handling persistence data writing\r\n\t}\r\n\r\n\t// Test for whether localStorage is available for use.\r\n\tlocalStorageTest() {\r\n\t\tvar testKey = \"_tabulator_test\";\r\n\r\n\t\ttry {\r\n\t\t\twindow.localStorage.setItem( testKey, testKey);\r\n\t\t\twindow.localStorage.removeItem( testKey );\r\n\t\t\treturn true;\r\n\t\t} catch(e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//setup parameters\r\n\tinitialize(){\r\n\t\tif(this.table.options.persistence){\r\n\t\t\t//determine persistent layout storage type\r\n\t\t\tvar mode = this.table.options.persistenceMode,\r\n\t\t\tid = this.table.options.persistenceID,\r\n\t\t\tretreivedData;\r\n\r\n\t\t\tthis.mode = mode !== true ? mode : (this.localStorageTest() ? \"local\" : \"cookie\");\r\n\r\n\t\t\tif(this.table.options.persistenceReaderFunc){\r\n\t\t\t\tif(typeof this.table.options.persistenceReaderFunc === \"function\"){\r\n\t\t\t\t\tthis.readFunc = this.table.options.persistenceReaderFunc;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(Persistence.readers[this.table.options.persistenceReaderFunc]){\r\n\t\t\t\t\t\tthis.readFunc = Persistence.readers[this.table.options.persistenceReaderFunc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Persistence Read Error - invalid reader set\", this.table.options.persistenceReaderFunc);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(Persistence.readers[this.mode]){\r\n\t\t\t\t\tthis.readFunc = Persistence.readers[this.mode];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Persistence Read Error - invalid reader set\", this.mode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.options.persistenceWriterFunc){\r\n\t\t\t\tif(typeof this.table.options.persistenceWriterFunc === \"function\"){\r\n\t\t\t\t\tthis.writeFunc = this.table.options.persistenceWriterFunc;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(Persistence.writers[this.table.options.persistenceWriterFunc]){\r\n\t\t\t\t\t\tthis.writeFunc = Persistence.writers[this.table.options.persistenceWriterFunc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Persistence Write Error - invalid reader set\", this.table.options.persistenceWriterFunc);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(Persistence.writers[this.mode]){\r\n\t\t\t\t\tthis.writeFunc = Persistence.writers[this.mode];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Persistence Write Error - invalid writer set\", this.mode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//set storage tag\r\n\t\t\tthis.id = \"tabulator-\" + (id || (this.table.element.getAttribute(\"id\") || \"\"));\r\n\r\n\t\t\tthis.config = {\r\n\t\t\t\tsort:this.table.options.persistence === true || this.table.options.persistence.sort,\r\n\t\t\t\tfilter:this.table.options.persistence === true || this.table.options.persistence.filter,\r\n\t\t\t\tgroup:this.table.options.persistence === true || this.table.options.persistence.group,\r\n\t\t\t\tpage:this.table.options.persistence === true || this.table.options.persistence.page,\r\n\t\t\t\tcolumns:this.table.options.persistence === true ? [\"title\", \"width\", \"visible\"] : this.table.options.persistence.columns,\r\n\t\t\t};\r\n\r\n\t\t\t//load pagination data if needed\r\n\t\t\tif(this.config.page){\r\n\t\t\t\tretreivedData = this.retreiveData(\"page\");\r\n\r\n\t\t\t\tif(retreivedData){\r\n\t\t\t\t\tif(typeof retreivedData.paginationSize !== \"undefined\" && (this.config.page === true || this.config.page.size)){\r\n\t\t\t\t\t\tthis.table.options.paginationSize = retreivedData.paginationSize;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(typeof retreivedData.paginationInitialPage !== \"undefined\" && (this.config.page === true || this.config.page.page)){\r\n\t\t\t\t\t\tthis.table.options.paginationInitialPage = retreivedData.paginationInitialPage;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//load group data if needed\r\n\t\t\tif(this.config.group){\r\n\t\t\t\tretreivedData = this.retreiveData(\"group\");\r\n\r\n\t\t\t\tif(retreivedData){\r\n\t\t\t\t\tif(typeof retreivedData.groupBy !== \"undefined\" && (this.config.group === true || this.config.group.groupBy)){\r\n\t\t\t\t\t\tthis.table.options.groupBy = retreivedData.groupBy;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(typeof retreivedData.groupStartOpen !== \"undefined\" && (this.config.group === true || this.config.group.groupStartOpen)){\r\n\t\t\t\t\t\tthis.table.options.groupStartOpen = retreivedData.groupStartOpen;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(typeof retreivedData.groupHeader !== \"undefined\" && (this.config.group === true || this.config.group.groupHeader)){\r\n\t\t\t\t\t\tthis.table.options.groupHeader = retreivedData.groupHeader;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.columns){\r\n\t\t\t\tthis.table.options.columns = this.load(\"columns\", this.table.options.columns);\r\n\t\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t\t\tthis.subscribe(\"column-show\", this.save.bind(this, \"columns\"));\r\n\t\t\t\tthis.subscribe(\"column-hide\", this.save.bind(this, \"columns\"));\r\n\t\t\t\tthis.subscribe(\"column-moved\", this.save.bind(this, \"columns\"));\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"table-built\", this.tableBuilt.bind(this), 0);\r\n\r\n\t\t\tthis.subscribe(\"table-redraw\", this.tableRedraw.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"filter-changed\", this.eventSave.bind(this, \"filter\"));\r\n\t\t\tthis.subscribe(\"sort-changed\", this.eventSave.bind(this, \"sort\"));\r\n\t\t\tthis.subscribe(\"group-changed\", this.eventSave.bind(this, \"group\"));\r\n\t\t\tthis.subscribe(\"page-changed\", this.eventSave.bind(this, \"page\"));\r\n\t\t\tthis.subscribe(\"column-resized\", this.eventSave.bind(this, \"columns\"));\r\n\t\t\tthis.subscribe(\"layout-refreshed\", this.eventSave.bind(this, \"columns\"));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"getColumnLayout\", this.getColumnLayout.bind(this));\r\n\t\tthis.registerTableFunction(\"setColumnLayout\", this.setColumnLayout.bind(this));\r\n\t}\r\n\r\n\teventSave(type){\r\n\t\tif(this.config[type]){\r\n\t\t\tthis.save(type);\r\n\t\t}\r\n\t}\r\n\r\n\ttableBuilt(){\r\n\t\tvar options = this.table.options,\r\n\t\tsorters, filters;\r\n\r\n\t\tif(this.config.sort){\r\n\t\t\tsorters = this.load(\"sort\");\r\n\r\n\t\t\tif(!sorters === false){\r\n\t\t\t\tthis.table.options.initialSort = sorters;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this.config.filter){\r\n\t\t\tfilters = this.load(\"filter\");\r\n\r\n\t\t\tif(!filters === false){\r\n\t\t\t\tthis.table.options.initialFilter = filters;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tif(force && this.config.columns){\r\n\t\t\tthis.save(\"columns\");\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tgetColumnLayout(){\r\n\t\treturn this.parseColumns(this.table.columnManager.getColumns());\r\n\t}\r\n\r\n\tsetColumnLayout(layout){\r\n\t\tthis.table.columnManager.setColumns(this.mergeDefinition(this.table.options.columns, layout))\r\n\t\treturn true;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tinitializeColumn(column){\r\n\t\tvar def, keys;\r\n\r\n\t\tif(this.config.columns){\r\n\t\t\tthis.defWatcherBlock = true;\r\n\r\n\t\t\tdef = column.getDefinition();\r\n\r\n\t\t\tkeys = this.config.columns === true ? Object.keys(def) : this.config.columns;\r\n\r\n\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\tvar props = Object.getOwnPropertyDescriptor(def, key);\r\n\t\t\t\tvar value = def[key];\r\n\t\t\t\tif(props){\r\n\t\t\t\t\tObject.defineProperty(def, key, {\r\n\t\t\t\t\t\tset: function(newValue){\r\n\t\t\t\t\t\t\tvalue = newValue;\r\n\r\n\t\t\t\t\t\t\tif(!this.defWatcherBlock){\r\n\t\t\t\t\t\t\t\tthis.save(\"columns\");\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif(props.set){\r\n\t\t\t\t\t\t\t\tprops.set(newValue);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tget:function(){\r\n\t\t\t\t\t\t\tif(props.get){\r\n\t\t\t\t\t\t\t\tprops.get();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.defWatcherBlock = false;\r\n\t\t}\r\n\t}\r\n\r\n\t//load saved definitions\r\n\tload(type, current){\r\n\t\tvar data = this.retreiveData(type);\r\n\r\n\t\tif(current){\r\n\t\t\tdata = data ? this.mergeDefinition(current, data) : current;\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//retreive data from memory\r\n\tretreiveData(type){\r\n\t\treturn this.readFunc ? this.readFunc(this.id, type) : false;\r\n\t}\r\n\r\n\t//merge old and new column definitions\r\n\tmergeDefinition(oldCols, newCols){\r\n\t\tvar output = [];\r\n\r\n\t\tnewCols = newCols || [];\r\n\r\n\t\tnewCols.forEach((column, to) => {\r\n\t\t\tvar from = this._findColumn(oldCols, column),\r\n\t\t\tkeys;\r\n\r\n\t\t\tif(from){\r\n\t\t\t\tif(this.config.columns === true || this.config.columns == undefined){\r\n\t\t\t\t\tkeys = Object.keys(from);\r\n\t\t\t\t\tkeys.push(\"width\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tkeys = this.config.columns;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\t\tif(key !== \"columns\" && typeof column[key] !== \"undefined\"){\r\n\t\t\t\t\t\tfrom[key] = column[key];\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(from.columns){\r\n\t\t\t\t\tfrom.columns = this.mergeDefinition(from.columns, column.columns);\r\n\t\t\t\t}\r\n\r\n\t\t\t\toutput.push(from);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\toldCols.forEach((column, i) => {\r\n\t\t\tvar from = this._findColumn(newCols, column);\r\n\r\n\t\t\tif (!from) {\r\n\t\t\t\tif(output.length>i){\r\n\t\t\t\t\toutput.splice(i, 0, column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\toutput.push(column);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//find matching columns\r\n\t_findColumn(columns, subject){\r\n\t\tvar type = subject.columns ? \"group\" : (subject.field ? \"field\" : \"object\");\r\n\r\n\t\treturn columns.find(function(col){\r\n\t\t\tswitch(type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\treturn col.title === subject.title && col.columns.length === subject.columns.length;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"field\":\r\n\t\t\t\treturn col.field === subject.field;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"object\":\r\n\t\t\t\treturn col === subject;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//save data\r\n\tsave(type){\r\n\t\tvar data = {};\r\n\r\n\t\tswitch(type){\r\n\t\t\tcase \"columns\":\r\n\t\t\tdata = this.parseColumns(this.table.columnManager.getColumns())\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"filter\":\r\n\t\t\tdata = this.table.modules.filter.getFilters();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"sort\":\r\n\t\t\tdata = this.validateSorters(this.table.modules.sort.getSort());\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\tdata = this.getGroupConfig();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"page\":\r\n\t\t\tdata = this.getPageConfig();\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(this.writeFunc){\r\n\t\t\tthis.writeFunc(this.id, type, data);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t//ensure sorters contain no function data\r\n\tvalidateSorters(data){\r\n\t\tdata.forEach(function(item){\r\n\t\t\titem.column = item.field;\r\n\t\t\tdelete item.field;\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tgetGroupConfig(){\r\n\t\tvar data = {};\r\n\r\n\t\tif(this.config.group){\r\n\t\t\tif(this.config.group === true || this.config.group.groupBy){\r\n\t\t\t\tdata.groupBy = this.table.options.groupBy;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.group === true || this.config.group.groupStartOpen){\r\n\t\t\t\tdata.groupStartOpen = this.table.options.groupStartOpen;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.group === true || this.config.group.groupHeader){\r\n\t\t\t\tdata.groupHeader = this.table.options.groupHeader;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tgetPageConfig(){\r\n\t\tvar data = {};\r\n\r\n\t\tif(this.config.page){\r\n\t\t\tif(this.config.page === true || this.config.page.size){\r\n\t\t\t\tdata.paginationSize = this.table.modules.page.getPageSize();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.page === true || this.config.page.page){\r\n\t\t\t\tdata.paginationInitialPage = this.table.modules.page.getPage();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\r\n\t//parse columns for data to store\r\n\tparseColumns(columns){\r\n\t\tvar definitions = [],\r\n\t\texcludedKeys = [\"headerContextMenu\", \"headerMenu\", \"contextMenu\", \"clickMenu\"];\r\n\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\tvar defStore = {},\r\n\t\t\tcolDef = column.getDefinition(),\r\n\t\t\tkeys;\r\n\r\n\t\t\tif(column.isGroup){\r\n\t\t\t\tdefStore.title = colDef.title;\r\n\t\t\t\tdefStore.columns = this.parseColumns(column.getColumns());\r\n\t\t\t}else{\r\n\t\t\t\tdefStore.field = column.getField();\r\n\r\n\t\t\t\tif(this.config.columns === true || this.config.columns == undefined){\r\n\t\t\t\t\tkeys = Object.keys(colDef);\r\n\t\t\t\t\tkeys.push(\"width\");\r\n\t\t\t\t\tkeys.push(\"visible\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tkeys = this.config.columns;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\t\tswitch(key){\r\n\t\t\t\t\t\tcase \"width\":\r\n\t\t\t\t\t\tdefStore.width = column.getWidth();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"visible\":\r\n\t\t\t\t\t\tdefStore.visible = column.visible;\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tif(typeof colDef[key] !== \"function\" && excludedKeys.indexOf(key) === -1){\r\n\t\t\t\t\t\t\tdefStore[key] = colDef[key];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tdefinitions.push(defStore);\r\n\t\t});\r\n\r\n\t\treturn definitions;\r\n\t}\r\n}\r\n\r\nPersistence.moduleName = \"persistence\";\r\n\r\nPersistence.moduleInitOrder = -10;\r\n\r\n//load defaults\r\nPersistence.readers = defaultReaders;\r\nPersistence.writers = defaultWriters;\r\n\r\nexport default Persistence;","import Module from '../../core/Module.js';\r\n\r\nclass Popup extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.columnSubscribers = {};\r\n\t\t\r\n\t\tthis.registerTableOption(\"rowContextPopup\", false);\r\n\t\tthis.registerTableOption(\"rowClickPopup\", false);\r\n\t\tthis.registerTableOption(\"groupContextPopup\", false);\r\n\t\tthis.registerTableOption(\"groupClickPopup\", false);\r\n\t\t\r\n\t\tthis.registerColumnOption(\"headerContextPopup\");\r\n\t\tthis.registerColumnOption(\"headerClickPopup\");\r\n\t\tthis.registerColumnOption(\"headerPopup\");\r\n\t\tthis.registerColumnOption(\"headerPopupIcon\");\r\n\t\tthis.registerColumnOption(\"contextPopup\");\r\n\t\tthis.registerColumnOption(\"clickPopup\");\r\n\t\t\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.initializeRowWatchers();\r\n\t\tthis.initializeGroupWatchers();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\t\r\n\tinitializeRowWatchers(){\r\n\t\tif(this.table.options.rowContextPopup){\r\n\t\t\tthis.subscribe(\"row-contextmenu\", this.loadPopupEvent.bind(this, this.table.options.rowContextPopup));\r\n\t\t\tthis.table.on(\"rowTapHold\", this.loadPopupEvent.bind(this, this.table.options.rowContextPopup));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.rowClickPopup){\r\n\t\t\tthis.subscribe(\"row-click\", this.loadPopupEvent.bind(this, this.table.options.rowClickPopup));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeGroupWatchers(){\r\n\t\tif(this.table.options.groupContextPopup){\r\n\t\t\tthis.subscribe(\"group-contextmenu\", this.loadPopupEvent.bind(this, this.table.options.groupContextPopup));\r\n\t\t\tthis.table.on(\"groupTapHold\", this.loadPopupEvent.bind(this, this.table.options.groupContextPopup));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.groupClickPopup){\r\n\t\t\tthis.subscribe(\"group-click\", this.loadPopupEvent.bind(this, this.table.options.groupClickPopup));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar options = [\"headerContextPopup\", \"headerClickPopup\"],\r\n\t\tdef = column.definition;\r\n\t\t\r\n\t\t//handle column events\r\n\t\tif(def.headerContextPopup && !this.columnSubscribers.headerContextPopup){\r\n\t\t\tthis.columnSubscribers.headerContextPopup = this.loadPopupTableColumnEvent.bind(this, \"headerContextPopup\");\r\n\t\t\tthis.subscribe(\"column-contextmenu\", this.columnSubscribers.headerContextPopup);\r\n\t\t\tthis.table.on(\"headerTapHold\", this.loadPopupTableColumnEvent.bind(this, \"headerContextPopup\"))\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerClickPopup && !this.columnSubscribers.headerClickPopup){\r\n\t\t\tthis.columnSubscribers.headerClickPopup = this.loadPopupTableColumnEvent.bind(this, \"headerClickPopup\");\r\n\t\t\tthis.subscribe(\"column-click\", this.columnSubscribers.headerClickPopup);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerPopup){\r\n\t\t\tthis.initializeColumnHeaderPopup(column);\r\n\t\t}\r\n\t\t\r\n\t\t//handle cell events\r\n\t\tif(def.contextPopup && !this.columnSubscribers.contextPopup){\r\n\t\t\tthis.columnSubscribers.contextPopup = this.loadPopupTableCellEvent.bind(this, \"contextPopup\");\r\n\t\t\tthis.subscribe(\"cell-contextmenu\", this.columnSubscribers.contextPopup);\r\n\t\t\tthis.table.on(\"cellTapHold\", this.loadPopupTableCellEvent.bind(this, \"contextPopup\"))\r\n\t\t}\r\n\t\t\r\n\t\tif(def.clickPopup && !this.columnSubscribers.clickPopup){\r\n\t\t\tthis.columnSubscribers.clickPopup = this.loadPopupTableCellEvent.bind(this, \"clickPopup\");\r\n\t\t\tthis.subscribe(\"cell-click\", this.columnSubscribers.clickPopup);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumnHeaderPopup(column){\r\n\t\tvar icon = column.definition.headerPopupIcon,\r\n\t\theaderPopupEl;\r\n\t\t\r\n\t\theaderPopupEl = document.createElement(\"span\");\r\n\t\theaderPopupEl.classList.add(\"tabulator-header-popup-button\");\r\n\r\n\t\tif(icon){\r\n\t\t\tif(typeof icon === \"function\"){\r\n\t\t\t\ticon = icon(column.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tif(icon instanceof HTMLElement){\r\n\t\t\t\theaderPopupEl.appendChild(icon);\r\n\t\t\t}else{\r\n\t\t\t\theaderPopupEl.innerHTML = icon;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\theaderPopupEl.innerHTML = \"⋮\";\r\n\t\t}\r\n\t\t\r\n\t\theaderPopupEl.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tthis.loadPopupEvent(column.definition.headerPopup, e, column);\r\n\t\t});\r\n\t\t\r\n\t\tcolumn.titleElement.insertBefore(headerPopupEl, column.titleElement.firstChild);\r\n\t}\r\n\t\r\n\tloadPopupTableCellEvent(option, e, cell){\r\n\t\tif(cell._cell){\r\n\t\t\tcell = cell._cell;\r\n\t\t}\r\n\t\t\r\n\t\tif(cell.column.definition[option]){\r\n\t\t\tthis.loadPopupEvent(cell.column.definition[option], e, cell);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadPopupTableColumnEvent(option, e, column){\r\n\t\tif(column._column){\r\n\t\t\tcolumn = column._column;\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition[option]){\r\n\t\t\tthis.loadPopupEvent(column.definition[option], e, column);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadPopupEvent(contents, e, component){\r\n\t\tvar renderedCallback;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\trenderedCallback = callback;\r\n\t\t}\r\n\t\t\r\n\t\tif(component._group){\r\n\t\t\tcomponent = component._group;\r\n\t\t}else if(component._row){\r\n\t\t\tcomponent = component._row;\r\n\t\t}\r\n\t\t\r\n\t\tcontents = typeof contents == \"function\" ? contents.call(this.table, e, component.getComponent(), onRendered) : contents;\r\n\t\t\r\n\t\tthis.loadPopup(e, component, contents, renderedCallback);\r\n\t}\r\n\t\r\n\tloadPopup(e, component, contents, renderedCallback){\r\n\t\tvar touch = !(e instanceof MouseEvent),\r\n\t\tcontentsEl, popup;\r\n\t\t\r\n\t\tif(contents instanceof HTMLElement){\r\n\t\t\tcontentsEl = contents;\r\n\t\t}else{\r\n\t\t\tcontentsEl = document.createElement(\"div\");\r\n\t\t\tcontentsEl.innerHTML = contents;\r\n\t\t}\r\n\t\t\r\n\t\tcontentsEl.classList.add(\"tabulator-popup\");\r\n\r\n\t\tcontentsEl.addEventListener(\"click\", (e) =>{\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tif(!touch){\r\n\t\t\te.preventDefault();\r\n\t\t}\r\n\t\t\r\n\t\tpopup = this.popup(contentsEl);\r\n\r\n\t\tif(typeof renderedCallback === \"function\"){\r\n\t\t\tpopup.renderCallback(renderedCallback);\r\n\t\t}\r\n\t\t\r\n\t\tpopup.show(e).hideOnBlur(() => {\r\n\t\t\tthis.dispatchExternal(\"popupClosed\", component.getComponent());\r\n\t\t});\r\n\r\n\r\n\r\n\t\tthis.dispatchExternal(\"popupOpened\", component.getComponent())\r\n\t}\r\n}\r\n\r\nPopup.moduleName = \"popup\";\r\n\r\nexport default Popup;\r\n","import Module from '../../core/Module.js';\r\n\r\nclass Print extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.element = false;\r\n\t\tthis.manualBlock = false;\r\n\r\n\t\tthis.registerTableOption(\"printAsHtml\", false); //enable print as html\r\n\t\tthis.registerTableOption(\"printFormatter\", false); //printing page formatter\r\n\t\tthis.registerTableOption(\"printHeader\", false); //page header contents\r\n\t\tthis.registerTableOption(\"printFooter\", false); //page footer contents\r\n\t\tthis.registerTableOption(\"printStyled\", true); //enable print as html styling\r\n\t\tthis.registerTableOption(\"printRowRange\", \"visible\"); //restrict print to visible rows only\r\n\t\tthis.registerTableOption(\"printConfig\", {}); //print config options\r\n\r\n\t\tthis.registerColumnOption(\"print\");\r\n\t\tthis.registerColumnOption(\"titlePrint\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.printAsHtml){\r\n\t\t\twindow.addEventListener(\"beforeprint\", this.replaceTable.bind(this));\r\n\t\t\twindow.addEventListener(\"afterprint\", this.cleanup.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"print\", this.printFullscreen.bind(this));\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\treplaceTable(){\r\n\t\tif(!this.manualBlock){\r\n\t\t\tthis.element = document.createElement(\"div\");\r\n\t\t\tthis.element.classList.add(\"tabulator-print-table\");\r\n\r\n\t\t\tthis.element.appendChild(this.table.modules.export.genereateTable(this.table.options.printConfig, this.table.options.printStyled, this.table.options.printRowRange, \"print\"));\r\n\r\n\t\t\tthis.table.element.style.display = \"none\";\r\n\r\n\t\t\tthis.table.element.parentNode.insertBefore(this.element, this.table.element);\r\n\t\t}\r\n\t}\r\n\r\n\tcleanup(){\r\n\t\tdocument.body.classList.remove(\"tabulator-print-fullscreen-hide\");\r\n\r\n\t\tif(this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\tthis.table.element.style.display = \"\";\r\n\t\t}\r\n\t}\r\n\r\n\tprintFullscreen(visible, style, config){\r\n\t\tvar scrollX = window.scrollX,\r\n\t\tscrollY = window.scrollY,\r\n\t\theaderEl = document.createElement(\"div\"),\r\n\t\tfooterEl = document.createElement(\"div\"),\r\n\t\ttableEl = this.table.modules.export.genereateTable(typeof config != \"undefined\" ? config : this.table.options.printConfig, typeof style != \"undefined\" ? style : this.table.options.printStyled, visible || this.table.options.printRowRange, \"print\"),\r\n\t\theaderContent, footerContent;\r\n\r\n\t\tthis.manualBlock = true;\r\n\r\n\t\tthis.element = document.createElement(\"div\");\r\n\t\tthis.element.classList.add(\"tabulator-print-fullscreen\");\r\n\r\n\t\tif(this.table.options.printHeader){\r\n\t\t\theaderEl.classList.add(\"tabulator-print-header\");\r\n\r\n\t\t\theaderContent = typeof this.table.options.printHeader == \"function\" ? this.table.options.printHeader.call(this.table) : this.table.options.printHeader;\r\n\r\n\t\t\tif(typeof headerContent == \"string\"){\r\n\t\t\t\theaderEl.innerHTML = headerContent;\r\n\t\t\t}else{\r\n\t\t\t\theaderEl.appendChild(headerContent);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element.appendChild(headerEl);\r\n\t\t}\r\n\r\n\t\tthis.element.appendChild(tableEl);\r\n\r\n\t\tif(this.table.options.printFooter){\r\n\t\t\tfooterEl.classList.add(\"tabulator-print-footer\");\r\n\r\n\t\t\tfooterContent = typeof this.table.options.printFooter == \"function\" ? this.table.options.printFooter.call(this.table) : this.table.options.printFooter;\r\n\r\n\r\n\t\t\tif(typeof footerContent == \"string\"){\r\n\t\t\t\tfooterEl.innerHTML = footerContent;\r\n\t\t\t}else{\r\n\t\t\t\tfooterEl.appendChild(footerContent);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element.appendChild(footerEl);\r\n\t\t}\r\n\r\n\t\tdocument.body.classList.add(\"tabulator-print-fullscreen-hide\");\r\n\t\tdocument.body.appendChild(this.element);\r\n\r\n\t\tif(this.table.options.printFormatter){\r\n\t\t\tthis.table.options.printFormatter(this.element, tableEl);\r\n\t\t}\r\n\r\n\t\twindow.print();\r\n\r\n\t\tthis.cleanup();\r\n\r\n\t\twindow.scrollTo(scrollX, scrollY);\r\n\r\n\t\tthis.manualBlock = false;\r\n\t}\r\n}\r\n\r\nPrint.moduleName = \"print\";\r\n\r\nexport default Print;","import Module from '../../core/Module.js';\r\n\r\nclass ReactiveData extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.data = false;\r\n\t\tthis.blocked = false; //block reactivity while performing update\r\n\t\tthis.origFuncs = {}; // hold original data array functions to allow replacement after data is done with\r\n\t\tthis.currentVersion = 0;\r\n\r\n\t\tthis.registerTableOption(\"reactiveData\", false); //enable data reactivity\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.reactiveData){\r\n\t\t\tthis.subscribe(\"cell-value-save-before\", this.block.bind(this));\r\n\t\t\tthis.subscribe(\"cell-value-save-after\", this.unblock.bind(this));\r\n\t\t\tthis.subscribe(\"row-data-save-before\", this.block.bind(this));\r\n\t\t\tthis.subscribe(\"row-data-save-after\", this.unblock.bind(this));\r\n\t\t\tthis.subscribe(\"row-data-init-after\", this.watchRow.bind(this));\r\n\t\t\tthis.subscribe(\"data-processing\", this.watchData.bind(this));\r\n\t\t\tthis.subscribe(\"table-destroy\", this.unwatchData.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\twatchData(data){\r\n\t\tvar self = this,\r\n\t\tpushFunc, version;\r\n\r\n\t\tthis.currentVersion ++;\r\n\r\n\t\tversion = this.currentVersion;\r\n\r\n\t\tthis.unwatchData();\r\n\r\n\t\tthis.data = data;\r\n\r\n\t\t//override array push function\r\n\t\tthis.origFuncs.push = data.push;\r\n\r\n\t\tObject.defineProperty(this.data, \"push\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments);\r\n\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\targs.forEach((arg) => {\r\n\t\t\t\t\t\tself.table.rowManager.addRowActual(arg, false);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.origFuncs.push.apply(data, arguments);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t//override array unshift function\r\n\t\tthis.origFuncs.unshift = data.unshift;\r\n\r\n\t\tObject.defineProperty(this.data, \"unshift\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments);\r\n\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\targs.forEach((arg) => {\r\n\t\t\t\t\t\tself.table.rowManager.addRowActual(arg, true);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.origFuncs.unshift.apply(data, arguments);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\t//override array shift function\r\n\t\tthis.origFuncs.shift = data.shift;\r\n\r\n\t\tObject.defineProperty(this.data, \"shift\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar row;\r\n\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tif(self.data.length){\r\n\t\t\t\t\t\trow = self.table.rowManager.getRowFromDataObject(self.data[0]);\r\n\r\n\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\trow.deleteActual();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.origFuncs.shift.call(data);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t//override array pop function\r\n\t\tthis.origFuncs.pop = data.pop;\r\n\r\n\t\tObject.defineProperty(this.data, \"pop\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar row;\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tif(self.data.length){\r\n\t\t\t\t\t\trow = self.table.rowManager.getRowFromDataObject(self.data[self.data.length - 1]);\r\n\r\n\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\trow.deleteActual();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn self.origFuncs.pop.call(data);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\t//override array splice function\r\n\t\tthis.origFuncs.splice = data.splice;\r\n\r\n\t\tObject.defineProperty(this.data, \"splice\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments),\r\n\t\t\t\tstart = args[0] < 0 ? data.length + args[0] : args[0],\r\n\t\t\t\tend = args[1],\r\n\t\t\t\tnewRows = args[2] ? args.slice(2) : false,\r\n\t\t\t\tstartRow;\r\n\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\r\n\t\t\t\t\t//add new rows\r\n\t\t\t\t\tif(newRows){\r\n\t\t\t\t\t\tstartRow = data[start] ? self.table.rowManager.getRowFromDataObject(data[start]) : false;\r\n\r\n\t\t\t\t\t\tif(startRow){\r\n\t\t\t\t\t\t\tnewRows.forEach((rowData) => {\r\n\t\t\t\t\t\t\t\tself.table.rowManager.addRowActual(rowData, true, startRow, true);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnewRows = newRows.slice().reverse();\r\n\r\n\t\t\t\t\t\t\tnewRows.forEach((rowData) => {\r\n\t\t\t\t\t\t\t\tself.table.rowManager.addRowActual(rowData, true, false, true);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//delete removed rows\r\n\t\t\t\t\tif(end !== 0){\r\n\t\t\t\t\t\tvar oldRows = data.slice(start, typeof args[1] === \"undefined\" ? args[1] : start + end);\r\n\r\n\t\t\t\t\t\toldRows.forEach((rowData, i) => {\r\n\t\t\t\t\t\t\tvar row = self.table.rowManager.getRowFromDataObject(rowData);\r\n\r\n\t\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\t\trow.deleteActual(i !== oldRows.length - 1);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(newRows || end !== 0){\r\n\t\t\t\t\t\tself.table.rowManager.reRenderInPosition();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.origFuncs.splice.apply(data, arguments);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tunwatchData(){\r\n\t\tif(this.data !== false){\r\n\t\t\tfor(var key in this.origFuncs){\r\n\t\t\t\tObject.defineProperty(this.data, key, {\r\n\t\t\t\t\tenumerable: true,\r\n\t\t\t\t\tconfigurable:true,\r\n\t\t\t\t\twritable:true,\r\n\t\t\t\t\tvalue: this.origFuncs.key,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\twatchRow(row){\r\n\t\tvar data = row.getData();\r\n\r\n\t\tthis.blocked = true;\r\n\r\n\t\tfor(var key in data){\r\n\t\t\tthis.watchKey(row, data, key);\r\n\t\t}\r\n\r\n\t\tif(this.table.options.dataTree){\r\n\t\t\tthis.watchTreeChildren(row);\r\n\t\t}\r\n\r\n\t\tthis.blocked = false;\r\n\t}\r\n\r\n\twatchTreeChildren (row){\r\n\t\tvar childField = row.getData()[this.table.options.dataTreeChildField],\r\n\t\torigFuncs = {};\r\n\r\n\t\tfunction rebuildTree(){\r\n\t\t\tthis.table.modules.dataTree.initializeRow(row);\r\n\t\t\tthis.table.modules.dataTree.layoutRow(row);\r\n\t\t\tthis.table.rowManager.refreshActiveData(\"tree\", false, true);\r\n\t\t}\r\n\r\n\t\tif(childField){\r\n\r\n\t\t\torigFuncs.push = childField.push;\r\n\r\n\t\t\tObject.defineProperty(childField, \"push\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tvar result = origFuncs.push.apply(childField, arguments);\r\n\r\n\t\t\t\t\trebuildTree();\r\n\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\torigFuncs.unshift = childField.unshift;\r\n\r\n\t\t\tObject.defineProperty(childField, \"unshift\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tvar result = origFuncs.unshift.apply(childField, arguments);\r\n\r\n\t\t\t\t\trebuildTree();\r\n\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\torigFuncs.shift = childField.shift;\r\n\r\n\t\t\tObject.defineProperty(childField, \"shift\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tvar result = origFuncs.shift.call(childField);\r\n\r\n\t\t\t\t\trebuildTree();\r\n\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\torigFuncs.pop = childField.pop;\r\n\r\n\t\t\tObject.defineProperty(childField, \"pop\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tvar result = origFuncs.pop.call(childField);\r\n\r\n\t\t\t\t\trebuildTree();\r\n\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\torigFuncs.splice = childField.splice;\r\n\r\n\t\t\tObject.defineProperty(childField, \"splice\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tvar result = origFuncs.splice.apply(childField, arguments);\r\n\r\n\t\t\t\t\trebuildTree();\r\n\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\twatchKey(row, data, key){\r\n\t\tvar props = Object.getOwnPropertyDescriptor(data, key),\r\n\t\tvalue = data[key],\r\n\t\tversion = this.currentVersion;\r\n\r\n\t\tObject.defineProperty(data, key, {\r\n\t\t\tset: (newValue) => {\r\n\t\t\t\tvalue = newValue;\r\n\t\t\t\tif(!this.blocked && version === this.currentVersion){\r\n\t\t\t\t\tvar update = {};\r\n\t\t\t\t\tupdate[key] = newValue;\r\n\t\t\t\t\trow.updateData(update);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(props.set){\r\n\t\t\t\t\tprops.set(newValue);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tget:() => {\r\n\r\n\t\t\t\tif(props.get){\r\n\t\t\t\t\tprops.get();\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn value;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tunwatchRow(row){\r\n\t\tvar data = row.getData();\r\n\r\n\t\tfor(var key in data){\r\n\t\t\tObject.defineProperty(data, key, {\r\n\t\t\t\tvalue:data[key],\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tblock(){\r\n\t\tthis.blocked = true;\r\n\t}\r\n\r\n\tunblock(){\r\n\t\tthis.blocked = false;\r\n\t}\r\n}\r\n\r\nReactiveData.moduleName = \"reactiveData\";\r\n\r\nexport default ReactiveData;\r\n\r\n\r\n\r\n","import Module from '../../core/Module.js';\r\n\r\nclass ResizeColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.startColumn = false;\r\n\t\tthis.startX = false;\r\n\t\tthis.startWidth = false;\r\n\t\tthis.latestX = false;\r\n\t\tthis.handle = null;\r\n\t\tthis.initialNextColumn = null;\r\n\t\tthis.nextColumn = null;\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.registerColumnOption(\"resizable\", true);\r\n\t\tthis.registerTableOption(\"resizableColumnFit\", false);\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-rendered\", this.layoutColumnHeader.bind(this));\r\n\t}\r\n\t\r\n\tinitializeEventWatchers(){\r\n\t\tif(!this.initialized){\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-rendered\", this.layoutCellHandles.bind(this));\r\n\t\t\tthis.subscribe(\"cell-delete\", this.deInitializeComponent.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-height\", this.resizeHandle.bind(this));\r\n\t\t\tthis.subscribe(\"column-moved\", this.columnLayoutUpdated.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-hide\", this.deInitializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"column-show\", this.columnLayoutUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"column-width\", this.columnWidthUpdated.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-delete\", this.deInitializeComponent.bind(this));\r\n\t\t\tthis.subscribe(\"column-height\", this.resizeHandle.bind(this));\r\n\t\t\t\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\tlayoutCellHandles(cell){\r\n\t\tif(cell.row.type === \"row\"){\r\n\t\t\tthis.deInitializeComponent(cell);\r\n\t\t\tthis.initializeColumn(\"cell\", cell, cell.column, cell.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tlayoutColumnHeader(column){\r\n\t\tif(column.definition.resizable){\r\n\t\t\tthis.initializeEventWatchers();\r\n\t\t\tthis.deInitializeComponent(column);\r\n\t\t\tthis.initializeColumn(\"header\", column, column, column.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolumnLayoutUpdated(column){\r\n\t\tvar prev = column.prevColumn();\r\n\t\t\r\n\t\tthis.reinitializeColumn(column);\r\n\t\t\r\n\t\tif(prev){\r\n\t\t\tthis.reinitializeColumn(prev);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolumnWidthUpdated(column){\r\n\t\tif(column.modules.frozen){\r\n\t\t\tif(this.table.modules.frozenColumns.leftColumns.includes(column)){\r\n\t\t\t\tthis.table.modules.frozenColumns.leftColumns.forEach((col) => {\r\n\t\t\t\t\tthis.reinitializeColumn(col);\r\n\t\t\t\t});\r\n\t\t\t}else if(this.table.modules.frozenColumns.rightColumns.includes(column)){\r\n\t\t\t\tthis.table.modules.frozenColumns.rightColumns.forEach((col) => {\r\n\t\t\t\t\tthis.reinitializeColumn(col);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeColumn(column){\r\n\t\tvar frozenOffset = column.modules.frozen ? (column.modules.frozen.marginValue + column.getWidth() + \"px\") : false;\r\n\t\t;\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tif(cell.modules.resize && cell.modules.resize.handleEl){\r\n\t\t\t\tif(frozenOffset){\r\n\t\t\t\t\tcell.modules.resize.handleEl.style.left = frozenOffset;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcell.element.after(cell.modules.resize.handleEl);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(column.modules.resize && column.modules.resize.handleEl){\r\n\t\t\tif(frozenOffset){\r\n\t\t\t\tcolumn.modules.resize.handleEl.style.left = frozenOffset;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.element.after(column.modules.resize.handleEl);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(type, component, column, element){\r\n\t\tvar self = this,\r\n\t\tvariableHeight = false,\r\n\t\tmode = column.definition.resizable,\r\n\t\tconfig = {},\r\n\t\tnearestColumn = column.getLastColumn();\r\n\t\t\r\n\t\t//set column resize mode\r\n\t\tif(type === \"header\"){\r\n\t\t\tvariableHeight = column.definition.formatter == \"textarea\" || column.definition.variableHeight;\r\n\t\t\tconfig = {variableHeight:variableHeight};\r\n\t\t}\r\n\t\t\r\n\t\tif((mode === true || mode == type) && this._checkResizability(nearestColumn)){\r\n\t\t\t\r\n\t\t\tvar handle = document.createElement('span');\r\n\t\t\thandle.className = \"tabulator-col-resize-handle\";\r\n\t\t\t\r\n\t\t\thandle.addEventListener(\"click\", function(e){\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tvar handleDown = function(e){\r\n\t\t\t\tself.startColumn = column;\r\n\t\t\t\tself.initialNextColumn = self.nextColumn = nearestColumn.nextColumn();\r\n\t\t\t\tself._mouseDown(e, nearestColumn, handle);\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\thandle.addEventListener(\"mousedown\", handleDown);\r\n\t\t\thandle.addEventListener(\"touchstart\", handleDown, {passive: true});\r\n\t\t\t\r\n\t\t\t//resize column on double click\r\n\t\t\thandle.addEventListener(\"dblclick\", (e) => {\r\n\t\t\t\tvar oldWidth = nearestColumn.getWidth();\r\n\t\t\t\t\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tnearestColumn.reinitializeWidth(true);\r\n\t\t\t\t\r\n\t\t\t\tif(oldWidth !== nearestColumn.getWidth()){\r\n\t\t\t\t\tself.dispatch(\"column-resized\", nearestColumn);\r\n\t\t\t\t\tself.table.externalEvents.dispatch(\"columnResized\", nearestColumn.getComponent());\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(column.modules.frozen){\r\n\t\t\t\thandle.style.position = \"absolute\";\r\n\t\t\t\thandle.style.left = column.modules.frozen.marginValue + column.getWidth() + \"px\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconfig.handleEl = handle;\r\n\t\t\t\r\n\t\t\tif(element.parentNode){\r\n\t\t\t\telement.after(handle);\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcomponent.modules.resize = config;\r\n\t}\r\n\t\r\n\tdeInitializeColumn(column){\r\n\t\tthis.deInitializeComponent(column);\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tthis.deInitializeComponent(cell);\r\n\t\t});\r\n\t}\r\n\t\r\n\tdeInitializeComponent(component){\r\n\t\tvar handleEl;\r\n\t\t\r\n\t\tif(component.modules.resize){\r\n\t\t\thandleEl = component.modules.resize.handleEl;\r\n\t\t\t\r\n\t\t\tif(handleEl && handleEl.parentElement){\r\n\t\t\t\thandleEl.parentElement.removeChild(handleEl);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tresizeHandle(component, height){\r\n\t\tif(component.modules.resize && component.modules.resize.handleEl){\r\n\t\t\tcomponent.modules.resize.handleEl.style.height = height;\r\n\t\t}\r\n\t}\r\n\t\r\n\t_checkResizability(column){\r\n\t\treturn column.definition.resizable;\r\n\t}\r\n\t\r\n\t_mouseDown(e, column, handle){\r\n\t\tvar self = this;\r\n\t\t\r\n\t\tself.table.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\tfunction mouseMove(e){\r\n\t\t\tvar x = typeof e.screenX === \"undefined\" ? e.touches[0].screenX : e.screenX,\r\n\t\t\tstartDiff = x - self.startX,\r\n\t\t\tmoveDiff = x - self.latestX,\r\n\t\t\tblockedBefore, blockedAfter;\r\n\t\t\t\r\n\t\t\tself.latestX = x;\r\n\t\t\t\r\n\t\t\tif(self.table.rtl){\r\n\t\t\t\tstartDiff = -startDiff;\r\n\t\t\t\tmoveDiff = -moveDiff;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tblockedBefore = column.width == column.minWidth || column.width == column.maxWidth;\r\n\t\t\t\r\n\t\t\tcolumn.setWidth(self.startWidth + startDiff);\r\n\t\t\t\r\n\t\t\tblockedAfter = column.width == column.minWidth || column.width == column.maxWidth;\r\n\t\t\t\r\n\t\t\tif(moveDiff < 0){\r\n\t\t\t\tself.nextColumn = self.initialNextColumn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(self.table.options.resizableColumnFit && self.nextColumn && !(blockedBefore && blockedAfter)){\r\n\t\t\t\tlet colWidth = self.nextColumn.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tif(moveDiff > 0){\r\n\t\t\t\t\tif(colWidth <= self.nextColumn.minWidth){\r\n\t\t\t\t\t\tself.nextColumn = self.nextColumn.nextColumn();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(self.nextColumn){\r\n\t\t\t\t\tself.nextColumn.setWidth(self.nextColumn.getWidth() - moveDiff);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tself.table.columnManager.renderer.rerenderColumns(true);\r\n\t\t\t\r\n\t\t\tif(!self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight){\r\n\t\t\t\tcolumn.checkCellHeights();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfunction mouseUp(e){\r\n\t\t\t\r\n\t\t\t//block editor from taking action while resizing is taking place\r\n\t\t\tif(self.startColumn.modules.edit){\r\n\t\t\t\tself.startColumn.modules.edit.blocked = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight){\r\n\t\t\t\tcolumn.checkCellHeights();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", mouseUp);\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", mouseMove);\r\n\t\t\t\r\n\t\t\thandle.removeEventListener(\"touchmove\", mouseMove);\r\n\t\t\thandle.removeEventListener(\"touchend\", mouseUp);\r\n\t\t\t\r\n\t\t\tself.table.element.classList.remove(\"tabulator-block-select\");\r\n\t\t\t\r\n\t\t\tif(self.startWidth !== column.getWidth()){\r\n\t\t\t\tself.dispatch(\"column-resized\", column);\r\n\t\t\t\tself.table.externalEvents.dispatch(\"columnResized\", column.getComponent());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\te.stopPropagation(); //prevent resize from interfereing with movable columns\r\n\t\t\r\n\t\t//block editor from taking action while resizing is taking place\r\n\t\tif(self.startColumn.modules.edit){\r\n\t\t\tself.startColumn.modules.edit.blocked = true;\r\n\t\t}\r\n\t\t\r\n\t\tself.startX = typeof e.screenX === \"undefined\" ? e.touches[0].screenX : e.screenX;\r\n\t\tself.latestX = self.startX;\r\n\t\tself.startWidth = column.getWidth();\r\n\t\t\r\n\t\tdocument.body.addEventListener(\"mousemove\", mouseMove);\r\n\t\tdocument.body.addEventListener(\"mouseup\", mouseUp);\r\n\t\thandle.addEventListener(\"touchmove\", mouseMove, {passive: true});\r\n\t\thandle.addEventListener(\"touchend\", mouseUp);\r\n\t}\r\n}\r\n\r\nResizeColumns.moduleName = \"resizeColumns\";\r\n\r\nexport default ResizeColumns;","import Module from '../../core/Module.js';\r\n\r\nclass ResizeRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.startColumn = false;\r\n\t\tthis.startY = false;\r\n\t\tthis.startHeight = false;\r\n\t\tthis.handle = null;\r\n\t\tthis.prevHandle = null;\r\n\r\n\t\tthis.registerTableOption(\"resizableRows\", false); //resizable rows\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.resizableRows){\r\n\t\t\tthis.subscribe(\"row-layout-after\", this.initializeRow.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\trowEl = row.getElement();\r\n\r\n\t\tvar handle = document.createElement('div');\r\n\t\thandle.className = \"tabulator-row-resize-handle\";\r\n\r\n\t\tvar prevHandle = document.createElement('div');\r\n\t\tprevHandle.className = \"tabulator-row-resize-handle prev\";\r\n\r\n\t\thandle.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tvar handleDown = function(e){\r\n\t\t\tself.startRow = row;\r\n\t\t\tself._mouseDown(e, row, handle);\r\n\t\t};\r\n\r\n\t\thandle.addEventListener(\"mousedown\", handleDown);\r\n\t\thandle.addEventListener(\"touchstart\", handleDown, {passive: true});\r\n\r\n\t\tprevHandle.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tvar prevHandleDown = function(e){\r\n\t\t\tvar prevRow = self.table.rowManager.prevDisplayRow(row);\r\n\r\n\t\t\tif(prevRow){\r\n\t\t\t\tself.startRow = prevRow;\r\n\t\t\t\tself._mouseDown(e, prevRow, prevHandle);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tprevHandle.addEventListener(\"mousedown\",prevHandleDown);\r\n\t\tprevHandle.addEventListener(\"touchstart\",prevHandleDown, {passive: true});\r\n\r\n\t\trowEl.appendChild(handle);\r\n\t\trowEl.appendChild(prevHandle);\r\n\t}\r\n\r\n\t_mouseDown(e, row, handle){\r\n\t\tvar self = this;\r\n\r\n\t\tself.table.element.classList.add(\"tabulator-block-select\");\r\n\r\n\t\tfunction mouseMove(e){\r\n\t\t\trow.setHeight(self.startHeight + ((typeof e.screenY === \"undefined\" ? e.touches[0].screenY : e.screenY) - self.startY));\r\n\t\t}\r\n\r\n\t\tfunction mouseUp(e){\r\n\r\n\t\t\t// //block editor from taking action while resizing is taking place\r\n\t\t\t// if(self.startColumn.modules.edit){\r\n\t\t\t// \tself.startColumn.modules.edit.blocked = false;\r\n\t\t\t// }\r\n\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", mouseMove);\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", mouseMove);\r\n\r\n\t\t\thandle.removeEventListener(\"touchmove\", mouseMove);\r\n\t\t\thandle.removeEventListener(\"touchend\", mouseUp);\r\n\r\n\t\t\tself.table.element.classList.remove(\"tabulator-block-select\");\r\n\r\n\t\t\tself.dispatchExternal(\"rowResized\", row.getComponent());\r\n\t\t}\r\n\r\n\t\te.stopPropagation(); //prevent resize from interfereing with movable columns\r\n\r\n\t\t//block editor from taking action while resizing is taking place\r\n\t\t// if(self.startColumn.modules.edit){\r\n\t\t// \tself.startColumn.modules.edit.blocked = true;\r\n\t\t// }\r\n\r\n\t\tself.startY = typeof e.screenY === \"undefined\" ? e.touches[0].screenY : e.screenY;\r\n\t\tself.startHeight = row.getHeight();\r\n\r\n\t\tdocument.body.addEventListener(\"mousemove\", mouseMove);\r\n\t\tdocument.body.addEventListener(\"mouseup\", mouseUp);\r\n\r\n\t\thandle.addEventListener(\"touchmove\", mouseMove, {passive: true});\r\n\t\thandle.addEventListener(\"touchend\", mouseUp);\r\n\t}\r\n}\r\n\r\nResizeRows.moduleName = \"resizeRows\";\r\n\r\nexport default ResizeRows;","import Module from '../../core/Module.js';\r\n\r\nclass ResizeTable extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.binding = false;\r\n\t\tthis.observer = false;\r\n\t\tthis.containerObserver = false;\r\n\r\n\t\tthis.tableHeight = 0;\r\n\t\tthis.tableWidth = 0;\r\n\t\tthis.containerHeight = 0;\r\n\t\tthis.containerWidth = 0;\r\n\r\n\t\tthis.autoResize = false;\r\n\r\n\t\tthis.registerTableOption(\"autoResize\", true); //auto resize table\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.autoResize){\r\n\t\t\tvar table = this.table,\r\n\t\t\ttableStyle;\r\n\r\n\t\t\tthis.tableHeight = table.element.clientHeight;\r\n\t\t\tthis.tableWidth = table.element.clientWidth;\r\n\r\n\t\t\tif(table.element.parentNode){\r\n\t\t\t\tthis.containerHeight = table.element.parentNode.clientHeight;\r\n\t\t\t\tthis.containerWidth = table.element.parentNode.clientWidth;\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof ResizeObserver !== \"undefined\" && table.rowManager.getRenderMode() === \"virtual\"){\r\n\r\n\t\t\t\tthis.autoResize = true;\r\n\r\n\t\t\t\tthis.observer = new ResizeObserver((entry) => {\r\n\t\t\t\t\tif(!table.browserMobile || (table.browserMobile &&!table.modules.edit.currentCell)){\r\n\r\n\t\t\t\t\t\tvar nodeHeight = Math.floor(entry[0].contentRect.height);\r\n\t\t\t\t\t\tvar nodeWidth = Math.floor(entry[0].contentRect.width);\r\n\r\n\t\t\t\t\t\tif(this.tableHeight != nodeHeight || this.tableWidth != nodeWidth){\r\n\t\t\t\t\t\t\tthis.tableHeight = nodeHeight;\r\n\t\t\t\t\t\t\tthis.tableWidth = nodeWidth;\r\n\r\n\t\t\t\t\t\t\tif(table.element.parentNode){\r\n\t\t\t\t\t\t\t\tthis.containerHeight = table.element.parentNode.clientHeight;\r\n\t\t\t\t\t\t\t\tthis.containerWidth = table.element.parentNode.clientWidth;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tthis.table.columnManager.renderer.rerenderColumns(true);\r\n\r\n\t\t\t\t\t\t\ttable.redraw();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.observer.observe(table.element);\r\n\r\n\t\t\t\ttableStyle = window.getComputedStyle(table.element);\r\n\r\n\t\t\t\tif(this.table.element.parentNode && !this.table.rowManager.fixedHeight && (tableStyle.getPropertyValue(\"max-height\") || tableStyle.getPropertyValue(\"min-height\"))){\r\n\r\n\t\t\t\t\tthis.containerObserver = new ResizeObserver((entry) => {\r\n\t\t\t\t\t\tif(!table.browserMobile || (table.browserMobile &&!table.modules.edit.currentCell)){\r\n\r\n\t\t\t\t\t\t\tvar nodeHeight = Math.floor(entry[0].contentRect.height);\r\n\t\t\t\t\t\t\tvar nodeWidth = Math.floor(entry[0].contentRect.width);\r\n\r\n\t\t\t\t\t\t\tif(this.containerHeight != nodeHeight || this.containerWidth != nodeWidth){\r\n\t\t\t\t\t\t\t\tthis.containerHeight = nodeHeight;\r\n\t\t\t\t\t\t\t\tthis.containerWidth = nodeWidth;\r\n\t\t\t\t\t\t\t\tthis.tableHeight = table.element.clientHeight;\r\n\t\t\t\t\t\t\t\tthis.tableWidth = table.element.clientWidth;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\ttable.columnManager.renderer.rerenderColumns(true);\r\n\r\n\t\t\t\t\t\t\ttable.redraw();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tthis.containerObserver.observe(this.table.element.parentNode);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.subscribe(\"table-resize\", this.tableResized.bind(this));\r\n\r\n\t\t\t}else{\r\n\t\t\t\tthis.binding = function(){\r\n\t\t\t\t\tif(!table.browserMobile || (table.browserMobile && !table.modules.edit.currentCell)){\r\n\r\n\t\t\t\t\t\ttable.columnManager.renderer.rerenderColumns(true);\r\n\r\n\t\t\t\t\t\ttable.redraw();\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\r\n\t\t\t\twindow.addEventListener(\"resize\", this.binding);\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"table-destroy\", this.clearBindings.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\ttableResized(){\r\n\t\tthis.table.rowManager.redraw();\r\n\t}\r\n\r\n\tclearBindings(){\r\n\t\tif(this.binding){\r\n\t\t\twindow.removeEventListener(\"resize\", this.binding);\r\n\t\t}\r\n\r\n\t\tif(this.observer){\r\n\t\t\tthis.observer.unobserve(this.table.element);\r\n\t\t}\r\n\r\n\t\tif(this.containerObserver){\r\n\t\t\tthis.containerObserver.unobserve(this.table.element.parentNode);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nResizeTable.moduleName = \"resizeTable\";\r\n\r\nexport default ResizeTable;","import Module from '../../core/Module.js';\r\n\r\nclass ResponsiveLayout extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.columns = [];\r\n\t\tthis.hiddenColumns = [];\r\n\t\tthis.mode = \"\";\r\n\t\tthis.index = 0;\r\n\t\tthis.collapseFormatter = [];\r\n\t\tthis.collapseStartOpen = true;\r\n\t\tthis.collapseHandleColumn = false;\r\n\r\n\t\tthis.registerTableOption(\"responsiveLayout\", false); //responsive layout flags\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseStartOpen\", true); //start showing collapsed data\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseUseFormatters\", true); //responsive layout collapse formatter\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseFormatter\", false); //responsive layout collapse formatter\r\n\r\n\t\tthis.registerColumnOption(\"responsive\");\r\n\t}\r\n\r\n\t//generate responsive columns list\r\n\tinitialize(){\r\n\t\tvar self = this,\r\n\t\tcolumns = [];\r\n\r\n\t\tif(this.table.options.responsiveLayout){\r\n\t\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"column-show\", this.updateColumnVisibility.bind(this));\r\n\t\t\tthis.subscribe(\"column-hide\", this.updateColumnVisibility.bind(this));\r\n\t\t\tthis.subscribe(\"columns-loaded\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-moved\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-add\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-delete\", this.initializeResponsivity.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"table-redrawing\", this.tableRedraw.bind(this));\r\n\r\n\t\t\tif(this.table.options.responsiveLayout === \"collapse\"){\r\n\t\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\t\tthis.subscribe(\"row-layout\", this.layoutRow.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tif([\"fitColumns\", \"fitDataStretch\"].indexOf(this.layoutMode()) === -1){\r\n\t\t\tif(!force){\r\n\t\t\t\tthis.update();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeResponsivity(){\r\n\t\tvar columns = [];\r\n\r\n\t\tthis.mode = this.table.options.responsiveLayout;\r\n\t\tthis.collapseFormatter = this.table.options.responsiveLayoutCollapseFormatter || this.formatCollapsedData;\r\n\t\tthis.collapseStartOpen = this.table.options.responsiveLayoutCollapseStartOpen;\r\n\t\tthis.hiddenColumns = [];\r\n\r\n\t\t//determine level of responsivity for each column\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column, i) => {\r\n\t\t\tif(column.modules.responsive){\r\n\t\t\t\tif(column.modules.responsive.order && column.modules.responsive.visible){\r\n\t\t\t\t\tcolumn.modules.responsive.index = i;\r\n\t\t\t\t\tcolumns.push(column);\r\n\r\n\t\t\t\t\tif(!column.visible && this.mode === \"collapse\"){\r\n\t\t\t\t\t\tthis.hiddenColumns.push(column);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t//sort list by responsivity\r\n\t\tcolumns = columns.reverse();\r\n\t\tcolumns = columns.sort((a, b) => {\r\n\t\t\tvar diff = b.modules.responsive.order - a.modules.responsive.order;\r\n\t\t\treturn diff || (b.modules.responsive.index - a.modules.responsive.index);\r\n\t\t});\r\n\r\n\t\tthis.columns = columns;\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tthis.generateCollapsedContent();\r\n\t\t}\r\n\r\n\t\t//assign collapse column\r\n\t\tfor (let col of this.table.columnManager.columnsByIndex){\r\n\t\t\tif(col.definition.formatter == \"responsiveCollapse\"){\r\n\t\t\t\tthis.collapseHandleColumn = col;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this.collapseHandleColumn){\r\n\t\t\tif(this.hiddenColumns.length){\r\n\t\t\t\tthis.collapseHandleColumn.show();\r\n\t\t\t}else{\r\n\t\t\t\tthis.collapseHandleColumn.hide();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//define layout information\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.getDefinition();\r\n\r\n\t\tcolumn.modules.responsive = {order: typeof def.responsive === \"undefined\" ? 1 : def.responsive, visible:def.visible === false ? false : true};\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar el;\r\n\r\n\t\tif(row.type !== \"calc\"){\r\n\t\t\tel = document.createElement(\"div\");\r\n\t\t\tel.classList.add(\"tabulator-responsive-collapse\");\r\n\r\n\t\t\trow.modules.responsiveLayout = {\r\n\t\t\t\telement:el,\r\n\t\t\t\topen:this.collapseStartOpen,\r\n\t\t\t};\r\n\r\n\t\t\tif(!this.collapseStartOpen){\r\n\t\t\t\tel.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tlayoutRow(row){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tif(row.modules.responsiveLayout){\r\n\t\t\trowEl.appendChild(row.modules.responsiveLayout.element);\r\n\t\t\tthis.generateCollapsedRowContent(row);\r\n\t\t}\r\n\t}\r\n\r\n\t//update column visibility\r\n\tupdateColumnVisibility(column, responsiveToggle){\r\n\t\tif(!responsiveToggle && column.modules.responsive){\r\n\t\t\tcolumn.modules.responsive.visible = column.visible;\r\n\t\t\tthis.initializeResponsivity();\r\n\t\t}\r\n\t}\r\n\r\n\thideColumn(column){\r\n\t\tvar colCount = this.hiddenColumns.length;\r\n\r\n\t\tcolumn.hide(false, true);\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tthis.hiddenColumns.unshift(column);\r\n\t\t\tthis.generateCollapsedContent();\r\n\r\n\t\t\tif(this.collapseHandleColumn && !colCount){\r\n\t\t\t\tthis.collapseHandleColumn.show();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tshowColumn(column){\r\n\t\tvar index;\r\n\r\n\t\tcolumn.show(false, true);\r\n\t\t//set column width to prevent calculation loops on uninitialized columns\r\n\t\tcolumn.setWidth(column.getWidth());\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tindex = this.hiddenColumns.indexOf(column);\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.hiddenColumns.splice(index, 1);\r\n\t\t\t}\r\n\r\n\t\t\tthis.generateCollapsedContent();\r\n\r\n\t\t\tif(this.collapseHandleColumn && !this.hiddenColumns.length){\r\n\t\t\t\tthis.collapseHandleColumn.hide();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//redraw columns to fit space\r\n\tupdate(){\r\n\t\tvar self = this,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\r\n\t\t\tlet width = self.table.modules.layout.getMode() == \"fitColumns\" ? self.table.columnManager.getFlexBaseWidth() : self.table.columnManager.getWidth();\r\n\r\n\t\t\tlet diff = (self.table.options.headerVisible ? self.table.columnManager.element.clientWidth : self.table.element.clientWidth) - width;\r\n\r\n\t\t\tif(diff < 0){\r\n\t\t\t\t//table is too wide\r\n\t\t\t\tlet column = self.columns[self.index];\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tself.hideColumn(column);\r\n\t\t\t\t\tself.index ++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\r\n\t\t\t\t//table has spare space\r\n\t\t\t\tlet column = self.columns[self.index -1];\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tif(diff > 0){\r\n\t\t\t\t\t\tif(diff >= column.getWidth()){\r\n\t\t\t\t\t\t\tself.showColumn(column);\r\n\t\t\t\t\t\t\tself.index --;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tworking = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tworking = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(!self.table.rowManager.activeRowsCount){\r\n\t\t\t\tself.table.rowManager.renderEmptyScroll();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateCollapsedContent(){\r\n\t\tvar self = this,\r\n\t\trows = this.table.rowManager.getDisplayRows();\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\tself.generateCollapsedRowContent(row);\r\n\t\t});\r\n\t}\r\n\r\n\tgenerateCollapsedRowContent(row){\r\n\t\tvar el, contents;\r\n\r\n\t\tif(row.modules.responsiveLayout){\r\n\t\t\tel = row.modules.responsiveLayout.element;\r\n\r\n\t\t\twhile(el.firstChild) el.removeChild(el.firstChild);\r\n\r\n\t\t\tcontents = this.collapseFormatter(this.generateCollapsedRowData(row));\r\n\t\t\tif(contents){\r\n\t\t\t\tel.appendChild(contents);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateCollapsedRowData(row){\r\n\t\tvar self = this,\r\n\t\tdata = row.getData(),\r\n\t\toutput = [],\r\n\t\tmockCellComponent;\r\n\r\n\t\tthis.hiddenColumns.forEach(function(column){\r\n\t\t\tvar value = column.getFieldValue(data);\r\n\r\n\t\t\tif(column.definition.title && column.field){\r\n\t\t\t\tif(column.modules.format && self.table.options.responsiveLayoutCollapseUseFormatters){\r\n\r\n\t\t\t\t\tmockCellComponent = {\r\n\t\t\t\t\t\tvalue:false,\r\n\t\t\t\t\t\tdata:{},\r\n\t\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetData:function(){\r\n\t\t\t\t\t\t\treturn data;\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\t\treturn document.createElement(\"div\");\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\t\treturn row.getComponent();\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tfunction onRendered(callback){\r\n\t\t\t\t\t\tcallback();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\toutput.push({\r\n\t\t\t\t\t\tfield: column.field,\r\n\t\t\t\t\t\ttitle: column.definition.title,\r\n\t\t\t\t\t\tvalue: column.modules.format.formatter.call(self.table.modules.format, mockCellComponent, column.modules.format.params, onRendered)\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\toutput.push({\r\n\t\t\t\t\t\tfield: column.field,\r\n\t\t\t\t\t\ttitle: column.definition.title,\r\n\t\t\t\t\t\tvalue: value\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tformatCollapsedData(data){\r\n\t\tvar list = document.createElement(\"table\");\r\n\r\n\t\tdata.forEach(function(item){\r\n\t\t\tvar row = document.createElement(\"tr\");\r\n\t\t\tvar titleData = document.createElement(\"td\");\r\n\t\t\tvar valueData = document.createElement(\"td\");\r\n\t\t\tvar node_content;\r\n\r\n\t\t\tvar titleHighlight = document.createElement(\"strong\");\r\n\t\t\ttitleData.appendChild(titleHighlight);\r\n\t\t\tthis.langBind(\"columns|\" + item.field, function(text){\r\n\t\t\t\ttitleHighlight.innerHTML = text || item.title;\r\n\t\t\t});\r\n\r\n\t\t\tif(item.value instanceof Node){\r\n\t\t\t\tnode_content = document.createElement(\"div\");\r\n\t\t\t\tnode_content.appendChild(item.value);\r\n\t\t\t\tvalueData.appendChild(node_content);\r\n\t\t\t}else{\r\n\t\t\t\tvalueData.innerHTML = item.value;\r\n\t\t\t}\r\n\r\n\t\t\trow.appendChild(titleData);\r\n\t\t\trow.appendChild(valueData);\r\n\t\t\tlist.appendChild(row);\r\n\t\t}, this);\r\n\r\n\t\treturn Object.keys(data).length ? list : \"\";\r\n\t}\r\n}\r\n\r\nResponsiveLayout.moduleName = \"responsiveLayout\";\r\n\r\nexport default ResponsiveLayout;","import Module from '../../core/Module.js';\r\n\r\nclass SelectRow extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.selecting = false; //flag selecting in progress\r\n\t\tthis.lastClickedRow = false; //last clicked row\r\n\t\tthis.selectPrev = []; //hold previously selected element for drag drop selection\r\n\t\tthis.selectedRows = []; //hold selected rows\r\n\t\tthis.headerCheckboxElement = null; // hold header select element\r\n\t\t\r\n\t\tthis.registerTableOption(\"selectable\", \"highlight\"); //highlight rows on hover\r\n\t\tthis.registerTableOption(\"selectableRangeMode\", \"drag\"); //highlight rows on hover\r\n\t\tthis.registerTableOption(\"selectableRollingSelection\", true); //roll selection once maximum number of selectable rows is reached\r\n\t\tthis.registerTableOption(\"selectablePersistence\", true); // maintain selection when table view is updated\r\n\t\tthis.registerTableOption(\"selectableCheck\", function(data, row){return true;}); //check wheather row is selectable\r\n\t\t\r\n\t\tthis.registerTableFunction(\"selectRow\", this.selectRows.bind(this));\r\n\t\tthis.registerTableFunction(\"deselectRow\", this.deselectRows.bind(this));\r\n\t\tthis.registerTableFunction(\"toggleSelectRow\", this.toggleRow.bind(this));\r\n\t\tthis.registerTableFunction(\"getSelectedRows\", this.getSelectedRows.bind(this));\r\n\t\tthis.registerTableFunction(\"getSelectedData\", this.getSelectedData.bind(this));\r\n\t\t\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"select\", this.selectRows.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"deselect\", this.deselectRows.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"toggleSelect\", this.toggleRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isSelected\", this.isRowSelected.bind(this));\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.selectable !== false){\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleting\", this.rowDeleted.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.clearSelectionData.bind(this));\r\n\t\t\tthis.subscribe(\"rows-retrieve\", this.rowRetrieve.bind(this));\r\n\t\t\t\r\n\t\t\tif(this.table.options.selectable && !this.table.options.selectablePersistence){\r\n\t\t\t\tthis.subscribe(\"data-refreshing\", this.deselectRows.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trowRetrieve(type, prevValue){\r\n\t\treturn type === \"selected\" ? this.selectedRows : prevValue;\r\n\t}\r\n\t\r\n\trowDeleted(row){\r\n\t\tthis._deselectRow(row, true);\r\n\t}\r\n\t\r\n\tclearSelectionData(silent){\r\n\t\tthis.selecting = false;\r\n\t\tthis.lastClickedRow = false;\r\n\t\tthis.selectPrev = [];\r\n\t\tthis.selectedRows = [];\r\n\t\t\r\n\t\tif(silent !== true){\r\n\t\t\tthis._rowSelectionChanged();\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\telement = row.getElement();\r\n\t\t\r\n\t\t// trigger end of row selection\r\n\t\tvar endSelect = function(){\r\n\t\t\t\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tself.selecting = false;\r\n\t\t\t}, 50);\r\n\t\t\t\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", endSelect);\r\n\t\t};\r\n\t\t\r\n\t\trow.modules.select = {selected:false};\r\n\t\t\r\n\t\t//set row selection class\r\n\t\tif(self.table.options.selectableCheck.call(this.table, row.getComponent())){\r\n\t\t\telement.classList.add(\"tabulator-selectable\");\r\n\t\t\telement.classList.remove(\"tabulator-unselectable\");\r\n\t\t\t\r\n\t\t\tif(self.table.options.selectable && self.table.options.selectable != \"highlight\"){\r\n\t\t\t\tif(self.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\telement.addEventListener(\"click\", this.handleComplexRowClick.bind(this, row));\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.addEventListener(\"click\", function(e){\r\n\t\t\t\t\t\tif(!self.table.modExists(\"edit\") || !self.table.modules.edit.getCurrentCell()){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!self.selecting){\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\t\t\tif(e.shiftKey){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.selecting = true;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.selectPrev = [];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tdocument.body.addEventListener(\"mouseup\", endSelect);\r\n\t\t\t\t\t\t\tdocument.body.addEventListener(\"keyup\", endSelect);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mouseenter\", function(e){\r\n\t\t\t\t\t\tif(self.selecting){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(self.selectPrev[1] == row){\r\n\t\t\t\t\t\t\t\tself.toggleRow(self.selectPrev[0]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mouseout\", function(e){\r\n\t\t\t\t\t\tif(self.selecting){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\tself.selectPrev.unshift(row);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\telement.classList.add(\"tabulator-unselectable\");\r\n\t\t\telement.classList.remove(\"tabulator-selectable\");\r\n\t\t}\r\n\t}\r\n\t\r\n\thandleComplexRowClick(row, e){\r\n\t\tif(e.shiftKey){\r\n\t\t\tthis.table._clearSelection();\r\n\t\t\tthis.lastClickedRow = this.lastClickedRow || row;\r\n\t\t\t\r\n\t\t\tvar lastClickedRowIdx = this.table.rowManager.getDisplayRowIndex(this.lastClickedRow);\r\n\t\t\tvar rowIdx = this.table.rowManager.getDisplayRowIndex(row);\r\n\t\t\t\r\n\t\t\tvar fromRowIdx = lastClickedRowIdx <= rowIdx ? lastClickedRowIdx : rowIdx;\r\n\t\t\tvar toRowIdx = lastClickedRowIdx >= rowIdx ? lastClickedRowIdx : rowIdx;\r\n\t\t\t\r\n\t\t\tvar rows = this.table.rowManager.getDisplayRows().slice(0);\r\n\t\t\tvar toggledRows = rows.splice(fromRowIdx, toRowIdx - fromRowIdx + 1);\r\n\t\t\t\r\n\t\t\tif(e.ctrlKey || e.metaKey){\r\n\t\t\t\ttoggledRows.forEach((toggledRow)=>{\r\n\t\t\t\t\tif(toggledRow !== this.lastClickedRow){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.table.options.selectable !== true && !this.isRowSelected(row)){\r\n\t\t\t\t\t\t\tif(this.selectedRows.length < this.table.options.selectable){\r\n\t\t\t\t\t\t\t\tthis.toggleRow(toggledRow);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.toggleRow(toggledRow);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tthis.lastClickedRow = row;\r\n\t\t\t}else{\r\n\t\t\t\tthis.deselectRows(undefined, true);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.selectable !== true){\r\n\t\t\t\t\tif(toggledRows.length > this.table.options.selectable){\r\n\t\t\t\t\t\ttoggledRows = toggledRows.slice(0, this.table.options.selectable)\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.selectRows(toggledRows);\r\n\t\t\t}\r\n\t\t\tthis.table._clearSelection();\r\n\t\t}\r\n\t\telse if(e.ctrlKey || e.metaKey){\r\n\t\t\tthis.toggleRow(row);\r\n\t\t\tthis.lastClickedRow = row;\r\n\t\t}else{\r\n\t\t\tthis.deselectRows(undefined, true);\r\n\t\t\tthis.selectRows(row);\r\n\t\t\tthis.lastClickedRow = row;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//toggle row selection\r\n\ttoggleRow(row){\r\n\t\tif(this.table.options.selectableCheck.call(this.table, row.getComponent())){\r\n\t\t\tif(row.modules.select && row.modules.select.selected){\r\n\t\t\t\tthis._deselectRow(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis._selectRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//select a number of rows\r\n\tselectRows(rows){\r\n\t\tvar rowMatch;\r\n\t\t\r\n\t\tswitch(typeof rows){\r\n\t\t\tcase \"undefined\":\r\n\t\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis._rowSelectionChanged();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"string\":\r\n\t\t\t\r\n\t\t\trowMatch = this.table.rowManager.findRow(rows);\r\n\t\t\t\r\n\t\t\tif(rowMatch){\r\n\t\t\t\tthis._selectRow(rowMatch, true, true);\r\n\t\t\t}else{\r\n\t\t\t\tthis.table.rowManager.getRows(rows).forEach((row) => {\r\n\t\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._rowSelectionChanged();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\tif(Array.isArray(rows)){\r\n\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis._rowSelectionChanged();\r\n\t\t\t}else{\r\n\t\t\t\tthis._selectRow(rows, false, true);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//select an individual row\r\n\t_selectRow(rowInfo, silent, force){\r\n\t\tvar index;\r\n\t\t\r\n\t\t//handle max row count\r\n\t\tif(!isNaN(this.table.options.selectable) && this.table.options.selectable !== true && !force){\r\n\t\t\tif(this.selectedRows.length >= this.table.options.selectable){\r\n\t\t\t\tif(this.table.options.selectableRollingSelection){\r\n\t\t\t\t\tthis._deselectRow(this.selectedRows[0]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tvar row = this.table.rowManager.findRow(rowInfo);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\tif(this.selectedRows.indexOf(row) == -1){\r\n\t\t\t\trow.getElement().classList.add(\"tabulator-selected\");\r\n\t\t\t\tif(!row.modules.select){\r\n\t\t\t\t\trow.modules.select = {};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\trow.modules.select.selected = true;\r\n\t\t\t\tif(row.modules.select.checkboxEl){\r\n\t\t\t\t\trow.modules.select.checkboxEl.checked = true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.selectedRows.push(row);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.dataTreeSelectPropagate){\r\n\t\t\t\t\tthis.childRowSelection(row, true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatchExternal(\"rowSelected\", row.getComponent());\r\n\t\t\t\t\r\n\t\t\t\tthis._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Selection Error - No such row found, ignoring selection:\" + rowInfo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tisRowSelected(row){\r\n\t\treturn this.selectedRows.indexOf(row) !== -1;\r\n\t}\r\n\t\r\n\t//deselect a number of rows\r\n\tdeselectRows(rows, silent){\r\n\t\tvar self = this,\r\n\t\trowCount;\r\n\t\t\r\n\t\tif(typeof rows == \"undefined\"){\r\n\t\t\t\r\n\t\t\trowCount = self.selectedRows.length;\r\n\t\t\t\r\n\t\t\tfor(let i = 0; i < rowCount; i++){\r\n\t\t\t\tself._deselectRow(self.selectedRows[0], true);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(rowCount){\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tif(Array.isArray(rows)){\r\n\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\tself._deselectRow(row, true);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}else{\r\n\t\t\t\tself._deselectRow(rows, silent);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//deselect an individual row\r\n\t_deselectRow(rowInfo, silent){\r\n\t\tvar self = this,\r\n\t\trow = self.table.rowManager.findRow(rowInfo),\r\n\t\tindex;\r\n\t\t\r\n\t\tif(row){\r\n\t\t\tindex = self.selectedRows.findIndex(function(selectedRow){\r\n\t\t\t\treturn selectedRow == row;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\t\r\n\t\t\t\trow.getElement().classList.remove(\"tabulator-selected\");\r\n\t\t\t\tif(!row.modules.select){\r\n\t\t\t\t\trow.modules.select = {};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\trow.modules.select.selected = false;\r\n\t\t\t\tif(row.modules.select.checkboxEl){\r\n\t\t\t\t\trow.modules.select.checkboxEl.checked = false;\r\n\t\t\t\t}\r\n\t\t\t\tself.selectedRows.splice(index, 1);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.dataTreeSelectPropagate){\r\n\t\t\t\t\tthis.childRowSelection(row, false);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatchExternal(\"rowDeselected\", row.getComponent());\r\n\t\t\t\t\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Deselection Error - No such row found, ignoring selection:\" + rowInfo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetSelectedData(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tthis.selectedRows.forEach(function(row){\r\n\t\t\tdata.push(row.getData());\r\n\t\t});\r\n\t\t\r\n\t\treturn data;\r\n\t}\r\n\t\r\n\tgetSelectedRows(){\r\n\t\t\r\n\t\tvar rows = [];\r\n\t\t\r\n\t\tthis.selectedRows.forEach(function(row){\r\n\t\t\trows.push(row.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t_rowSelectionChanged(silent){\r\n\t\tif(this.headerCheckboxElement){\r\n\t\t\tif(this.selectedRows.length === 0){\r\n\t\t\t\tthis.headerCheckboxElement.checked = false;\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = false;\r\n\t\t\t} else if(this.table.rowManager.rows.length === this.selectedRows.length){\r\n\t\t\t\tthis.headerCheckboxElement.checked = true;\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = false;\r\n\t\t\t} else {\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = true;\r\n\t\t\t\tthis.headerCheckboxElement.checked = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(!silent){\r\n\t\t\tthis.dispatchExternal(\"rowSelectionChanged\", this.getSelectedData(), this.getSelectedRows());\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterRowSelectCheckbox (row, element) {\r\n\t\tif(!row._row.modules.select){\r\n\t\t\trow._row.modules.select = {};\r\n\t\t}\r\n\t\t\r\n\t\trow._row.modules.select.checkboxEl = element;\r\n\t}\r\n\t\r\n\tregisterHeaderSelectCheckbox (element) {\r\n\t\tthis.headerCheckboxElement = element;\r\n\t}\r\n\t\r\n\tchildRowSelection(row, select){\r\n\t\tvar children = this.table.modules.dataTree.getChildren(row, true);\r\n\t\t\r\n\t\tif(select){\r\n\t\t\tfor(let child of children){\r\n\t\t\t\tthis._selectRow(child, true);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tfor(let child of children){\r\n\t\t\t\tthis._deselectRow(child, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nSelectRow.moduleName = \"selectRow\";\r\n\r\nexport default SelectRow;","//sort datetime\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar format = params.format || \"dd/MM/yyyy HH:mm:ss\",\r\n\talignEmptyValues = params.alignEmptyValues,\r\n\temptyAlign = 0;\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tif(DT.isDateTime(a)){\r\n\t\t\t a = a;\r\n\t\t}else if(format === \"iso\"){\r\n\t\t\t a = DT.fromISO(String(a));\r\n\t\t}else{\r\n\t\t\t a = DT.fromFormat(String(a), format);\r\n\t\t}\r\n\r\n\t\tif(DT.isDateTime(b)){\r\n\t\t\t b = b;\r\n\t\t}else if(format === \"iso\"){\r\n\t\t\t b = DT.fromISO(String(b));\r\n\t\t}else{\r\n\t\t\t b = DT.fromFormat(String(b), format);\r\n\t\t}\r\n\r\n\t\tif(!a.isValid){\r\n\t\t\temptyAlign = !b.isValid ? 0 : -1;\r\n\t\t}else if(!b.isValid){\r\n\t\t\temptyAlign = 1;\r\n\t\t}else{\r\n\t\t\t//compare valid values\r\n\t\t\treturn a - b;\r\n\t\t}\r\n\r\n\t\t//fix empty values in position\r\n\t\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\t\temptyAlign *= -1;\r\n\t\t}\r\n\r\n\t\treturn emptyAlign;\r\n\r\n\t}else{\r\n\t\tconsole.error(\"Sort Error - 'datetime' sorter is dependant on luxon.js\");\r\n\t}\r\n};","import datetime from './datetime.js';\r\n\r\n//sort date\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tif(!params.format){\r\n\t\tparams.format = \"dd/MM/yyyy\";\r\n\t}\r\n\r\n\treturn datetime.call(this, a, b, aRow, bRow, column, dir, params);\r\n};","//sort numbers\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar decimal = params.decimalSeparator;\r\n\tvar thousand = params.thousandSeparator;\r\n\tvar emptyAlign = 0;\r\n\r\n\ta = String(a);\r\n\tb = String(b);\r\n\r\n\tif(thousand){\r\n\t\ta = a.split(thousand).join(\"\");\r\n\t\tb = b.split(thousand).join(\"\");\r\n\t}\r\n\r\n\tif(decimal){\r\n\t\ta = a.split(decimal).join(\".\");\r\n\t\tb = b.split(decimal).join(\".\");\r\n\t}\r\n\r\n\ta = parseFloat(a);\r\n\tb = parseFloat(b);\r\n\r\n\t//handle non numeric values\r\n\tif(isNaN(a)){\r\n\t\temptyAlign = isNaN(b) ? 0 : -1;\r\n\t}else if(isNaN(b)){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\t\t//compare valid values\r\n\t\treturn a - b;\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n};","import number from './sorters/number.js';\r\nimport string from './sorters/string.js';\r\nimport date from './sorters/date.js';\r\nimport time from './sorters/time.js';\r\nimport datetime from './sorters/datetime.js';\r\nimport boolean from './sorters/boolean.js';\r\nimport array from './sorters/array.js';\r\nimport exists from './sorters/exists.js';\r\nimport alphanum from './sorters/alphanum.js';\r\n\r\nexport default {\r\n\tnumber:number,\r\n\tstring:string,\r\n\tdate:date,\r\n\ttime:time,\r\n\tdatetime:datetime,\r\n\tboolean:boolean,\r\n\tarray:array,\r\n\texists:exists,\r\n\talphanum:alphanum\r\n};","//sort strings\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar emptyAlign = 0;\r\n\tvar locale;\r\n\r\n\t//handle empty values\r\n\tif(!a){\r\n\t\temptyAlign = !b ? 0 : -1;\r\n\t}else if(!b){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\t\t//compare valid values\r\n\t\tswitch(typeof params.locale){\r\n\t\t\tcase \"boolean\":\r\n\t\t\tif(params.locale){\r\n\t\t\t\tlocale = this.langLocale();\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\tcase \"string\":\r\n\t\t\tlocale = params.locale;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn String(a).toLowerCase().localeCompare(String(b).toLowerCase(), locale);\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n};","import datetime from './datetime.js';\r\n\r\n//sort times\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tif(!params.format){\r\n\t\tparams.format = \"HH:mm\";\r\n\t}\r\n\r\n\treturn datetime.call(this, a, b, aRow, bRow, column, dir, params);\r\n};","//sort booleans\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar el1 = a === true || a === \"true\" || a === \"True\" || a === 1 ? 1 : 0;\r\n\tvar el2 = b === true || b === \"true\" || b === \"True\" || b === 1 ? 1 : 0;\r\n\r\n\treturn el1 - el2;\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultSorters from './defaults/sorters.js';\r\n\r\nclass Sort extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t \tthis.sortList = []; //holder current sort\r\n\t \tthis.changed = false; //has the sort changed since last render\r\n\r\n\t \tthis.registerTableOption(\"sortMode\", \"local\"); //local or remote sorting\r\n\r\n\t \tthis.registerTableOption(\"initialSort\", false); //initial sorting criteria\r\n\t \tthis.registerTableOption(\"columnHeaderSortMulti\", true); //multiple or single column sorting\r\n\t \tthis.registerTableOption(\"sortOrderReverse\", false); //reverse internal sort ordering\r\n\t \tthis.registerTableOption(\"headerSortElement\", \"
\"); //header sort element\r\n\r\n\t \tthis.registerColumnOption(\"sorter\");\r\n\t \tthis.registerColumnOption(\"sorterParams\");\r\n\r\n\t \tthis.registerColumnOption(\"headerSort\", true);\r\n\t \tthis.registerColumnOption(\"headerSortStartingDir\");\r\n\t \tthis.registerColumnOption(\"headerSortTristate\");\r\n\r\n\t }\r\n\r\n\t initialize(){\r\n\t \tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t \tthis.subscribe(\"table-built\", this.tableBuilt.bind(this));\r\n\t \tthis.registerDataHandler(this.sort.bind(this), 20);\r\n\r\n\t \tthis.registerTableFunction(\"setSort\", this.userSetSort.bind(this));\r\n\t \tthis.registerTableFunction(\"getSorters\", this.getSort.bind(this));\r\n\t \tthis.registerTableFunction(\"clearSort\", this.clearSort.bind(this));\r\n\r\n\t \tif(this.table.options.sortMode === \"remote\"){\r\n\t \t\tthis.subscribe(\"data-params\", this.remoteSortParams.bind(this));\r\n\t \t}\r\n\t }\r\n\r\n\t tableBuilt(){\r\n\t \tif(this.table.options.initialSort){\r\n\t \t\tthis.setSort(this.table.options.initialSort);\r\n\t \t}\r\n\t }\r\n\r\n\t remoteSortParams(data, config, silent, params){\r\n\t \tvar sorters = this.getSort();\r\n\r\n\t \tsorters.forEach((item) => {\r\n\t \t\tdelete item.column;\r\n\t \t});\r\n\r\n\t \tparams.sort = sorters;\r\n\r\n\t \treturn params;\r\n\t }\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tuserSetSort(sortList, dir){\r\n\t\tthis.setSort(sortList, dir);\r\n\t\t// this.table.rowManager.sorterRefresh();\r\n\t\tthis.refreshSort();\r\n\t}\r\n\r\n\tclearSort(){\r\n\t\tthis.clear();\r\n\t\t// this.table.rowManager.sorterRefresh();\r\n\t\tthis.refreshSort();\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\t//initialize column header for sorting\r\n\tinitializeColumn(column){\r\n\t\tvar sorter = false,\r\n\t\tcolEl,\r\n\t\tarrowEl;\r\n\r\n\t\tswitch(typeof column.definition.sorter){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(Sort.sorters[column.definition.sorter]){\r\n\t\t\t\tsorter = Sort.sorters[column.definition.sorter];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Sort Error - No such sorter found: \", column.definition.sorter);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tsorter = column.definition.sorter;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcolumn.modules.sort = {\r\n\t\t\tsorter:sorter, dir:\"none\",\r\n\t\t\tparams:column.definition.sorterParams || {},\r\n\t\t\tstartingDir:column.definition.headerSortStartingDir || \"asc\",\r\n\t\t\ttristate: column.definition.headerSortTristate,\r\n\t\t};\r\n\r\n\t\tif(column.definition.headerSort !== false){\r\n\r\n\t\t\tcolEl = column.getElement();\r\n\r\n\t\t\tcolEl.classList.add(\"tabulator-sortable\");\r\n\r\n\r\n\t\t\tarrowEl = document.createElement(\"div\");\r\n\t\t\tarrowEl.classList.add(\"tabulator-col-sorter\");\r\n\r\n\t\t\tif(typeof this.table.options.headerSortElement == \"object\"){\r\n\t\t\t\tarrowEl.appendChild(this.table.options.headerSortElement);\r\n\t\t\t}else{\r\n\t\t\t\tarrowEl.innerHTML = this.table.options.headerSortElement;\r\n\t\t\t}\r\n\r\n\t\t\t//create sorter arrow\r\n\t\t\tcolumn.titleHolderElement.appendChild(arrowEl);\r\n\r\n\t\t\tcolumn.modules.sort.element = arrowEl;\r\n\r\n\t\t\t//sort on click\r\n\t\t\tcolEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\tvar dir = \"\",\r\n\t\t\t\tsorters=[],\r\n\t\t\t\tmatch = false;\r\n\r\n\t\t\t\tif(column.modules.sort){\r\n\t\t\t\t\tif(column.modules.sort.tristate){\r\n\t\t\t\t\t\tif(column.modules.sort.dir == \"none\"){\r\n\t\t\t\t\t\t\tdir = column.modules.sort.startingDir;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(column.modules.sort.dir == column.modules.sort.startingDir){\r\n\t\t\t\t\t\t\t\tdir = column.modules.sort.dir == \"asc\" ? \"desc\" : \"asc\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tdir = \"none\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tswitch(column.modules.sort.dir){\r\n\t\t\t\t\t\t\tcase \"asc\":\r\n\t\t\t\t\t\t\tdir = \"desc\";\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase \"desc\":\r\n\t\t\t\t\t\t\tdir = \"asc\";\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tdir = column.modules.sort.startingDir;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\tif (this.table.options.columnHeaderSortMulti && (e.shiftKey || e.ctrlKey)) {\r\n\t\t\t\t\t\tsorters = this.getSort();\r\n\r\n\t\t\t\t\t\tmatch = sorters.findIndex((sorter) => {\r\n\t\t\t\t\t\t\treturn sorter.field === column.getField();\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\tif(match > -1){\r\n\t\t\t\t\t\t\tsorters[match].dir = dir;\r\n\r\n\t\t\t\t\t\t\tif(match != sorters.length -1){\r\n\t\t\t\t\t\t\t\tmatch = sorters.splice(match, 1)[0];\r\n\t\t\t\t\t\t\t\tif(dir != \"none\"){\r\n\t\t\t\t\t\t\t\t\tsorters.push(match);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(dir != \"none\"){\r\n\t\t\t\t\t\t\t\tsorters.push({column:column, dir:dir});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t//add to existing sort\r\n\t\t\t\t\t\tthis.setSort(sorters);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(dir == \"none\"){\r\n\t\t\t\t\t\t\tthis.clear();\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t//sort by column only\r\n\t\t\t\t\t\t\tthis.setSort(column, dir);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// this.table.rowManager.sorterRefresh(!this.sortList.length);\r\n\t\t\t\t\tthis.refreshSort();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\trefreshSort(){\r\n\t\tif(this.table.options.sortMode === \"remote\"){\r\n\t\t\tthis.reloadData(null, false, false);\r\n\t\t}else{\r\n\t\t\tthis.refreshData(true);\r\n\t\t}\r\n\r\n\t\t//TODO - Persist left position of row manager\r\n\t\t// left = this.scrollLeft;\r\n\t\t// this.scrollHorizontal(left);\r\n\t}\r\n\r\n\t//check if the sorters have changed since last use\r\n\thasChanged(){\r\n\t\tvar changed = this.changed;\r\n\t\tthis.changed = false;\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t//return current sorters\r\n\tgetSort(){\r\n\t\tvar self = this,\r\n\t\tsorters = [];\r\n\r\n\t\tself.sortList.forEach(function(item){\r\n\t\t\tif(item.column){\r\n\t\t\t\tsorters.push({column:item.column.getComponent(), field:item.column.getField(), dir:item.dir});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn sorters;\r\n\t}\r\n\r\n\t//change sort list and trigger sort\r\n\tsetSort(sortList, dir){\r\n\t\tvar self = this,\r\n\t\tnewSortList = [];\r\n\r\n\t\tif(!Array.isArray(sortList)){\r\n\t\t\tsortList = [{column: sortList, dir:dir}];\r\n\t\t}\r\n\r\n\t\tsortList.forEach(function(item){\r\n\t\t\tvar column;\r\n\r\n\t\t\tcolumn = self.table.columnManager.findColumn(item.column);\r\n\r\n\t\t\tif(column){\r\n\t\t\t\titem.column = column;\r\n\t\t\t\tnewSortList.push(item);\r\n\t\t\t\tself.changed = true;\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Sort Warning - Sort field does not exist and is being ignored: \", item.column);\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t\tself.sortList = newSortList;\r\n\r\n\t\tthis.dispatch(\"sort-changed\");\r\n\t}\r\n\r\n\t//clear sorters\r\n\tclear(){\r\n\t\tthis.setSort([]);\r\n\t}\r\n\r\n\t//find appropriate sorter for column\r\n\tfindSorter(column){\r\n\t\tvar row = this.table.rowManager.activeRows[0],\r\n\t\tsorter = \"string\",\r\n\t\tfield, value;\r\n\r\n\t\tif(row){\r\n\t\t\trow = row.getData();\r\n\t\t\tfield = column.getField();\r\n\r\n\t\t\tif(field){\r\n\r\n\t\t\t\tvalue = column.getFieldValue(row);\r\n\r\n\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\tsorter = \"boolean\";\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\tif(!isNaN(value) && value !== \"\"){\r\n\t\t\t\t\t\tsorter = \"number\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)){\r\n\t\t\t\t\t\t\tsorter = \"alphanum\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Sort.sorters[sorter];\r\n\t}\r\n\r\n\t//work through sort list sorting data\r\n\tsort(data){\r\n\t\tvar self = this,\r\n\t\tsortList = this.table.options.sortOrderReverse ? self.sortList.slice().reverse() : self.sortList,\r\n\t\tsortListActual = [],\r\n\t\trowComponents = [],\r\n\t\tlastSort;\r\n\r\n\t\tif(this.subscribedExternal(\"dataSorting\")){\r\n\t\t\tthis.dispatchExternal(\"dataSorting\", self.getSort());\r\n\t\t}\r\n\r\n\t\tself.clearColumnHeaders();\r\n\r\n\t\tif(this.table.options.sortMode !== \"remote\"){\r\n\r\n\t\t\t//build list of valid sorters and trigger column specific callbacks before sort begins\r\n\t\t\tsortList.forEach(function(item, i){\r\n\t\t\t\tvar sortObj = item.column.modules.sort;\r\n\r\n\t\t\t\tif(item.column && sortObj){\r\n\r\n\t\t\t\t\t//if no sorter has been defined, take a guess\r\n\t\t\t\t\tif(!sortObj.sorter){\r\n\t\t\t\t\t\tsortObj.sorter = self.findSorter(item.column);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\titem.params = typeof sortObj.params === \"function\" ? sortObj.params(item.column.getComponent(), item.dir) : sortObj.params;\r\n\r\n\t\t\t\t\tsortListActual.push(item);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tself.setColumnHeader(item.column, item.dir);\r\n\t\t\t});\r\n\r\n\t\t\t//sort data\r\n\t\t\tif (sortListActual.length) {\r\n\t\t\t\tself._sortItems(data, sortListActual);\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tsortList.forEach(function(item, i){\r\n\t\t\t\tself.setColumnHeader(item.column, item.dir);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.subscribedExternal(\"dataSorted\")){\r\n\t\t\tdata.forEach((row) => {\r\n\t\t\t\trowComponents.push(row.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatchExternal(\"dataSorted\", self.getSort(), rowComponents);\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//clear sort arrows on columns\r\n\tclearColumnHeaders(){\r\n\t\tthis.table.columnManager.getRealColumns().forEach(function(column){\r\n\t\t\tif(column.modules.sort){\r\n\t\t\t\tcolumn.modules.sort.dir = \"none\";\r\n\t\t\t\tcolumn.getElement().setAttribute(\"aria-sort\", \"none\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//set the column header sort direction\r\n\tsetColumnHeader(column, dir){\r\n\t\tcolumn.modules.sort.dir = dir;\r\n\t\tcolumn.getElement().setAttribute(\"aria-sort\", dir);\r\n\t}\r\n\r\n\t//sort each item in sort list\r\n\t_sortItems(data, sortList){\r\n\t\tvar sorterCount = sortList.length - 1;\r\n\r\n\t\tdata.sort((a, b) => {\r\n\t\t\tvar result;\r\n\r\n\t\t\tfor(var i = sorterCount; i>= 0; i--){\r\n\t\t\t\tlet sortItem = sortList[i];\r\n\r\n\t\t\t\tresult = this._sortRow(a, b, sortItem.column, sortItem.dir, sortItem.params);\r\n\r\n\t\t\t\tif(result !== 0){\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn result;\r\n\t\t});\r\n\t}\r\n\r\n\t//process individual rows for a sort function on active data\r\n\t_sortRow(a, b, column, dir, params){\r\n\t\tvar el1Comp, el2Comp, colComp;\r\n\r\n\t\t//switch elements depending on search direction\r\n\t\tvar el1 = dir == \"asc\" ? a : b;\r\n\t\tvar el2 = dir == \"asc\" ? b : a;\r\n\r\n\t\ta = column.getFieldValue(el1.getData());\r\n\t\tb = column.getFieldValue(el2.getData());\r\n\r\n\t\ta = typeof a !== \"undefined\" ? a : \"\";\r\n\t\tb = typeof b !== \"undefined\" ? b : \"\";\r\n\r\n\t\tel1Comp = el1.getComponent();\r\n\t\tel2Comp = el2.getComponent();\r\n\r\n\t\treturn column.modules.sort.sorter.call(this, a, b, el1Comp, el2Comp, column.getComponent(), dir, params);\r\n\t}\r\n}\r\n\r\nSort.moduleName = \"sort\";\r\n\r\n//load defaults\r\nSort.sorters = defaultSorters;\r\n\r\nexport default Sort;","//sort if element contains any data\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar el1 = 0;\r\n\tvar el2 = 0;\r\n\tvar type = params.type || \"length\";\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar emptyAlign = 0;\r\n\r\n\tfunction calc(value){\r\n\r\n\t\tswitch(type){\r\n\t\t\tcase \"length\":\r\n\t\t\treturn value.length;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"sum\":\r\n\t\t\treturn value.reduce(function(c, d){\r\n\t\t\t\treturn c + d;\r\n\t\t\t});\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"max\":\r\n\t\t\treturn Math.max.apply(null, value) ;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"min\":\r\n\t\t\treturn Math.min.apply(null, value) ;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"avg\":\r\n\t\t\treturn value.reduce(function(c, d){\r\n\t\t\t\treturn c + d;\r\n\t\t\t}) / value.length;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\t//handle non array values\r\n\tif(!Array.isArray(a)){\r\n\t\talignEmptyValues = !Array.isArray(b) ? 0 : -1;\r\n\t}else if(!Array.isArray(b)){\r\n\t\talignEmptyValues = 1;\r\n\t}else{\r\n\r\n\t\t//compare valid values\r\n\t\tel1 = a ? calc(a) : 0;\r\n\t\tel2 = b ? calc(b) : 0;\r\n\r\n\t\treturn el1 - el2;\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n};","//sort if element contains any data\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar el1 = typeof a == \"undefined\" ? 0 : 1;\r\n\tvar el2 = typeof b == \"undefined\" ? 0 : 1;\r\n\r\n\treturn el1 - el2;\r\n};","//sort alpha numeric strings\r\nexport default function(as, bs, aRow, bRow, column, dir, params){\r\n\tvar a, b, a1, b1, i= 0, L, rx = /(\\d+)|(\\D+)/g, rd = /\\d/;\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar emptyAlign = 0;\r\n\r\n\t//handle empty values\r\n\tif(!as && as!== 0){\r\n\t\temptyAlign = !bs && bs!== 0 ? 0 : -1;\r\n\t}else if(!bs && bs!== 0){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\r\n\t\tif(isFinite(as) && isFinite(bs)) return as - bs;\r\n\t\ta = String(as).toLowerCase();\r\n\t\tb = String(bs).toLowerCase();\r\n\t\tif(a === b) return 0;\r\n\t\tif(!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1;\r\n\t\ta = a.match(rx);\r\n\t\tb = b.match(rx);\r\n\t\tL = a.length > b.length ? b.length : a.length;\r\n\t\twhile(i < L){\r\n\t\t\ta1= a[i];\r\n\t\t\tb1= b[i++];\r\n\t\t\tif(a1 !== b1){\r\n\t\t\t\tif(isFinite(a1) && isFinite(b1)){\r\n\t\t\t\t\tif(a1.charAt(0) === \"0\") a1 = \".\" + a1;\r\n\t\t\t\t\tif(b1.charAt(0) === \"0\") b1 = \".\" + b1;\r\n\t\t\t\t\treturn a1 - b1;\r\n\t\t\t\t}\r\n\t\t\t\telse return a1 > b1 ? 1 : -1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn a.length > b.length;\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n};","import Module from '../../core/Module.js';\r\nimport Cell from '../../core/cell/Cell.js';\r\n\r\nclass Tooltip extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.tooltipSubscriber = null,\r\n\t\tthis.headerSubscriber = null,\r\n\t\t\r\n\t\tthis.timeout = null;\r\n\t\tthis.popupInstance = null;\r\n\t\t\r\n\t\tthis.registerTableOption(\"tooltipGenerationMode\", undefined); //deprecated\r\n\t\tthis.registerTableOption(\"tooltipDelay\", 300); \r\n\t\t\r\n\t\tthis.registerColumnOption(\"tooltip\");\r\n\t\tthis.registerColumnOption(\"headerTooltip\");\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.deprecationCheck();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\t\r\n\tdeprecationCheck(){\r\n\t\tif(typeof this.table.options.tooltipGenerationMode !== \"undefined\"){\r\n\t\t\tconsole.warn(\"Use of the tooltipGenerationMode option is now deprecated. This option is no longer needed as tooltips are always generated on hover now\");\r\n\t\t}\r\n\t}\t\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tif(column.definition.headerTooltip && !this.headerSubscriber){\r\n\t\t\tthis.headerSubscriber = true;\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-mousemove\", this.mousemoveCheck.bind(this, \"headerTooltip\"));\r\n\t\t\tthis.subscribe(\"column-mouseout\", this.mouseoutCheck.bind(this, \"headerTooltip\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition.tooltip && !this.tooltipSubscriber){\r\n\t\t\tthis.tooltipSubscriber = true;\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-mousemove\", this.mousemoveCheck.bind(this, \"tooltip\"));\r\n\t\t\tthis.subscribe(\"cell-mouseout\", this.mouseoutCheck.bind(this, \"tooltip\"));\r\n\t\t}\r\n\t}\r\n\t\r\n\tmousemoveCheck(action, e, component){\r\n\t\tvar tooltip = action === \"tooltip\" ? component.column.definition.tooltip : component.definition.headerTooltip;\r\n\t\t\r\n\t\tif(tooltip){\r\n\t\t\tthis.clearPopup();\r\n\t\t\tthis.timeout = setTimeout(this.loadTooltip.bind(this, e, component, tooltip), this.table.options.tooltipDelay);\r\n\t\t}\r\n\t}\r\n\r\n\tmouseoutCheck(action, e, component){\r\n\t\tif(!this.popupInstance){\r\n\t\t\tthis.clearPopup();\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearPopup(action, e, component){\r\n\t\tclearTimeout(this.timeout);\r\n\t\tthis.timeout = null;\r\n\t\t\r\n\t\tif(this.popupInstance){\r\n\t\t\tthis.popupInstance.hide();\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadTooltip(e, component, tooltip){\r\n\t\tvar contentsEl, renderedCallback, coords;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\trenderedCallback = callback;\r\n\t\t}\r\n\t\t\r\n\t\tif(typeof tooltip === \"function\"){\r\n\t\t\ttooltip = tooltip(e, component.getComponent(), onRendered);\r\n\t\t}\r\n\t\t\r\n\t\tif(tooltip instanceof HTMLElement){\r\n\t\t\tcontentsEl = tooltip;\r\n\t\t}else{\r\n\t\t\tcontentsEl = document.createElement(\"div\");\r\n\t\t\t\r\n\t\t\tif(tooltip === true){\r\n\t\t\t\tif(component instanceof Cell){\r\n\t\t\t\t\ttooltip = component.value;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(component.definition.field){\r\n\t\t\t\t\t\tthis.langBind(\"columns|\" + component.definition.field, (value) => {\r\n\t\t\t\t\t\t\tcontentsEl.innerHTML = tooltip = value || component.definition.title;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\ttooltip = component.definition.title;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcontentsEl.innerHTML = tooltip;\r\n\t\t}\r\n\t\t\r\n\t\tif(tooltip || tooltip === 0 || tooltip === \"0\" || tooltip === false){\r\n\t\t\tcontentsEl.classList.add(\"tabulator-tooltip\");\r\n\r\n\t\t\tcontentsEl.addEventListener(\"mousemove\", e => e.preventDefault())\r\n\t\t\t\r\n\t\t\tthis.popupInstance = this.popup(contentsEl);\r\n\t\t\t\r\n\t\t\tif(typeof renderedCallback === \"function\"){\r\n\t\t\t\tthis.popupInstance.renderCallback(renderedCallback);\r\n\t\t\t}\r\n\r\n\t\t\tcoords = this.popupInstance.containerEventCoords(e);\r\n\t\t\t\r\n\t\t\tthis.popupInstance.show(coords.x + 15, coords.y + 15).hideOnBlur(() => {\r\n\t\t\t\tthis.dispatchExternal(\"TooltipClosed\", component.getComponent());\r\n\t\t\t\tthis.popupInstance = null;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"TooltipOpened\", component.getComponent());\r\n\t\t}\r\n\t}\r\n}\r\n\r\nTooltip.moduleName = \"tooltip\";\r\n\r\nexport default Tooltip;\r\n","export default {\r\n\t//is integer\r\n\tinteger: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvalue = Number(value);\r\n\t\treturn typeof value === 'number' && isFinite(value) && Math.floor(value) === value;\r\n\t},\r\n\r\n\t//is float\r\n\tfloat: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvalue = Number(value);\r\n\t\treturn typeof value === 'number' && isFinite(value) && value % 1 !== 0;\r\n\t},\r\n\r\n\t//must be a number\r\n\tnumeric: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn !isNaN(value);\r\n\t},\r\n\r\n\t//must be a string\r\n\tstring: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn isNaN(value);\r\n\t},\r\n\r\n\t//maximum value\r\n\tmax: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn parseFloat(value) <= parameters;\r\n\t},\r\n\r\n\t//minimum value\r\n\tmin: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn parseFloat(value) >= parameters;\r\n\t},\r\n\r\n\t//starts with value\r\n\tstarts: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).toLowerCase().startsWith(String(parameters).toLowerCase());\r\n\t},\r\n\r\n\t//ends with value\r\n\tends: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).toLowerCase().endsWith(String(parameters).toLowerCase());\r\n\t},\r\n\r\n\r\n\t//minimum string length\r\n\tminLength: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).length >= parameters;\r\n\t},\r\n\r\n\t//maximum string length\r\n\tmaxLength: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).length <= parameters;\r\n\t},\r\n\r\n\t//in provided value list\r\n\tin: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif(typeof parameters == \"string\"){\r\n\t\t\tparameters = parameters.split(\"|\");\r\n\t\t}\r\n\r\n\t\treturn value === \"\" || parameters.indexOf(value) > -1;\r\n\t},\r\n\r\n\t//must match provided regex\r\n\tregex: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar reg = new RegExp(parameters);\r\n\r\n\t\treturn reg.test(value);\r\n\t},\r\n\r\n\t//value must be unique in this column\r\n\tunique: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar unique = true;\r\n\r\n\t\tvar cellData = cell.getData();\r\n\t\tvar column = cell.getColumn()._getSelf();\r\n\r\n\t\tthis.table.rowManager.rows.forEach(function(row){\r\n\t\t\tvar data = row.getData();\r\n\r\n\t\t\tif(data !== cellData){\r\n\t\t\t\tif(value == column.getFieldValue(data)){\r\n\t\t\t\t\tunique = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn unique;\r\n\t},\r\n\r\n\t//must have a value\r\n\trequired:function(cell, value, parameters){\r\n\t\treturn value !== \"\" && value !== null && typeof value !== \"undefined\";\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultValidators from './defaults/validators.js';\r\n\r\nclass Validate extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.invalidCells = [];\r\n\t\t\r\n\t\tthis.registerTableOption(\"validationMode\", \"blocking\");\r\n\t\t\r\n\t\tthis.registerColumnOption(\"validator\");\r\n\t\t\r\n\t\tthis.registerTableFunction(\"getInvalidCells\", this.getInvalidCells.bind(this));\r\n\t\tthis.registerTableFunction(\"clearCellValidation\", this.userClearCellValidation.bind(this));\r\n\t\tthis.registerTableFunction(\"validate\", this.userValidate.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"cell\", \"isValid\", this.cellIsValid.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"clearValidation\", this.clearValidation.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"validate\", this.cellValidate.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"column\", \"validate\", this.columnValidate.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"validate\", this.rowValidate.bind(this));\r\n\t}\r\n\t\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-delete\", this.clearValidation.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumnCheck.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"edit-success\", this.editValidate.bind(this));\r\n\t\tthis.subscribe(\"edit-editor-clear\", this.editorClear.bind(this));\r\n\t\tthis.subscribe(\"edit-edited-clear\", this.editedClear.bind(this));\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Event Handling //////////\r\n\t///////////////////////////////////\r\n\t\r\n\teditValidate(cell, value, previousValue){\r\n\t\tvar valid = this.table.options.validationMode !== \"manual\" ? this.validate(cell.column.modules.validate, cell, value) : true;\r\n\t\t\r\n\t\t// allow time for editor to make render changes then style cell\r\n\t\tif(valid !== true){\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tcell.getElement().classList.add(\"tabulator-validation-fail\");\r\n\t\t\t\tthis.dispatchExternal(\"validationFailed\", cell.getComponent(), value, valid);\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\treturn valid;\r\n\t}\r\n\t\r\n\teditorClear(cell, cancelled){\r\n\t\tif(cancelled){\r\n\t\t\tif(cell.column.modules.validate){\r\n\t\t\t\tthis.cellValidate(cell);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t}\r\n\t\r\n\teditedClear(cell){\r\n\t\tif(cell.modules.validate){\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t////////// Cell Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\tcellIsValid(cell){\r\n\t\treturn cell.modules.validate ? (cell.modules.validate.invalid || true) : true;\r\n\t}\r\n\t\r\n\tcellValidate(cell){\r\n\t\treturn this.validate(cell.column.modules.validate, cell, cell.getValue());\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Column Functions ////////\r\n\t///////////////////////////////////\r\n\t\r\n\tcolumnValidate(column){\r\n\t\tvar invalid = [];\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tif(this.cellValidate(cell) !== true){\r\n\t\t\t\tinvalid.push(cell.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn invalid.length ? invalid : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t////////// Row Functions //////////\r\n\t///////////////////////////////////\r\n\t\r\n\trowValidate(row){\r\n\t\tvar invalid = [];\r\n\t\t\r\n\t\trow.cells.forEach((cell) => {\r\n\t\t\tif(this.cellValidate(cell) !== true){\r\n\t\t\t\tinvalid.push(cell.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn invalid.length ? invalid : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\t\r\n\tuserClearCellValidation(cells){\r\n\t\tif(!cells){\r\n\t\t\tcells = this.getInvalidCells();\r\n\t\t}\r\n\t\t\r\n\t\tif(!Array.isArray(cells)){\r\n\t\t\tcells = [cells];\r\n\t\t}\r\n\t\t\r\n\t\tcells.forEach((cell) => {\r\n\t\t\tthis.clearValidation(cell._getSelf());\r\n\t\t});\r\n\t}\r\n\t\r\n\tuserValidate(cells){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\t//clear row data\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\trow = row.getComponent();\r\n\t\t\t\r\n\t\t\tvar valid = row.validate();\r\n\t\t\t\r\n\t\t\tif(valid !== true){\r\n\t\t\t\toutput = output.concat(valid);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn output.length ? output : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tinitializeColumnCheck(column){\r\n\t\tif(typeof column.definition.validator !== \"undefined\"){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//validate\r\n\tinitializeColumn(column){\r\n\t\tvar self = this,\r\n\t\tconfig = [],\r\n\t\tvalidator;\r\n\t\t\r\n\t\tif(column.definition.validator){\r\n\t\t\t\r\n\t\t\tif(Array.isArray(column.definition.validator)){\r\n\t\t\t\tcolumn.definition.validator.forEach((item) => {\r\n\t\t\t\t\tvalidator = self._extractValidator(item);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(validator){\r\n\t\t\t\t\t\tconfig.push(validator);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tvalidator = this._extractValidator(column.definition.validator);\r\n\t\t\t\t\r\n\t\t\t\tif(validator){\r\n\t\t\t\t\tconfig.push(validator);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.validate = config.length ? config : false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t_extractValidator(value){\r\n\t\tvar type, params, pos;\r\n\t\t\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\tpos = value.indexOf(':');\r\n\t\t\t\r\n\t\t\tif(pos > -1){\r\n\t\t\t\ttype = value.substring(0,pos);\r\n\t\t\t\tparams = value.substring(pos+1);\r\n\t\t\t}else{\r\n\t\t\t\ttype = value;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn this._buildValidator(type, params);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"function\":\r\n\t\t\treturn this._buildValidator(value);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"object\":\r\n\t\t\treturn this._buildValidator(value.type, value.parameters);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t\r\n\t_buildValidator(type, params){\r\n\t\t\r\n\t\tvar func = typeof type == \"function\" ? type : Validate.validators[type];\r\n\t\t\r\n\t\tif(!func){\r\n\t\t\tconsole.warn(\"Validator Setup Error - No matching validator found:\", type);\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn {\r\n\t\t\t\ttype:typeof type == \"function\" ? \"function\" : type,\r\n\t\t\t\tfunc:func,\r\n\t\t\t\tparams:params,\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n\t\r\n\tvalidate(validators, cell, value){\r\n\t\tvar self = this,\r\n\t\tfailedValidators = [],\r\n\t\tinvalidIndex = this.invalidCells.indexOf(cell);\r\n\t\t\r\n\t\tif(validators){\r\n\t\t\tvalidators.forEach((item) => {\r\n\t\t\t\tif(!item.func.call(self, cell.getComponent(), value, item.params)){\r\n\t\t\t\t\tfailedValidators.push({\r\n\t\t\t\t\t\ttype:item.type,\r\n\t\t\t\t\t\tparameters:item.params\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tif(!cell.modules.validate){\r\n\t\t\tcell.modules.validate = {};\r\n\t\t}\r\n\t\t\r\n\t\tif(!failedValidators.length){\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t\t\t\r\n\t\t\tif(invalidIndex > -1){\r\n\t\t\t\tthis.invalidCells.splice(invalidIndex, 1);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcell.modules.validate.invalid = failedValidators;\r\n\t\t\t\r\n\t\t\tif(this.table.options.validationMode !== \"manual\"){\r\n\t\t\t\tcell.getElement().classList.add(\"tabulator-validation-fail\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(invalidIndex == -1){\r\n\t\t\t\tthis.invalidCells.push(cell);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn failedValidators.length ? failedValidators : true;\r\n\t}\r\n\t\r\n\tgetInvalidCells(){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.invalidCells.forEach((cell) => {\r\n\t\t\toutput.push(cell.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tclearValidation(cell){\r\n\t\tvar invalidIndex;\r\n\t\t\r\n\t\tif(cell.modules.validate && cell.modules.validate.invalid){\r\n\t\t\t\r\n\t\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t\t\r\n\t\t\tinvalidIndex = this.invalidCells.indexOf(cell);\r\n\t\t\t\r\n\t\t\tif(invalidIndex > -1){\r\n\t\t\t\tthis.invalidCells.splice(invalidIndex, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nValidate.moduleName = \"validate\";\r\n\r\n//load defaults\r\nValidate.validators = defaultValidators;\r\n\r\nexport default Validate;\r\n","export default {\r\n\r\n\tdebugEventsExternal:false, //flag to console log events\r\n\tdebugEventsInternal:false, //flag to console log events\r\n\tdebugInvalidOptions:true, //allow toggling of invalid option warnings\r\n\tdebugInitialization:true, //allow toggling of invalid option warnings\r\n\r\n\theight:false, //height of tabulator\r\n\tminHeight:false, //minimum height of tabulator\r\n\tmaxHeight:false, //maximum height of tabulator\r\n\r\n\tcolumnHeaderVertAlign:\"top\", //vertical alignment of column headers\r\n\r\n\tpopupContainer:false,\r\n\r\n\tcolumns:[],//store for colum header info\r\n\tcolumnDefaults:{}, //store column default props\r\n\r\n\tdata:false, //default starting data\r\n\r\n\tautoColumns:false, //build columns from data row structure\r\n\tautoColumnsDefinitions:false,\r\n\r\n\tnestedFieldSeparator:\".\", //separator for nested data\r\n\r\n\tfooterElement:false, //hold footer element\r\n\r\n\tindex:\"id\", //filed for row index\r\n\r\n\ttextDirection:\"auto\",\r\n\r\n\taddRowPos:\"bottom\", //position to insert blank rows, top|bottom\r\n\r\n\theaderVisible:true, //hide header\r\n\r\n\trenderVertical:\"virtual\",\r\n\trenderHorizontal:\"basic\",\r\n\trenderVerticalBuffer:0, // set virtual DOM buffer size\r\n\r\n\tscrollToRowPosition:\"top\",\r\n\tscrollToRowIfVisible:true,\r\n\r\n\tscrollToColumnPosition:\"left\",\r\n\tscrollToColumnIfVisible:true,\r\n\r\n\trowFormatter:false,\r\n\trowFormatterPrint:null,\r\n\trowFormatterClipboard:null,\r\n\trowFormatterHtmlOutput:null,\r\n\r\n\trowHeight:null,\r\n\r\n\tplaceholder:false,\r\n\r\n\tdataLoader:true,\r\n\tdataLoaderLoading:false,\r\n\tdataLoaderError:false,\r\n\tdataLoaderErrorTimeout:3000,\r\n\r\n\tdataSendParams:{},\r\n\r\n\tdataReceiveParams:{},\r\n}\r\n","export default class OptionsList {\r\n\tconstructor(table, msgType, defaults = {}){\r\n\t\tthis.table = table;\r\n\t\tthis.msgType = msgType;\r\n\t\tthis.registeredDefaults = Object.assign({}, defaults)\r\n\t}\r\n\r\n\tregister(option, value){\r\n\t\tthis.registeredDefaults[option] = value;\r\n\t}\r\n\r\n\tgenerate(defaultOptions, userOptions = {}){\r\n\t\tvar output = Object.assign({}, this.registeredDefaults);\r\n\r\n\t\tObject.assign(output, defaultOptions);\r\n\r\n\t\tif(userOptions.debugInvalidOptions !== false || this.table.options.debugInvalidOptions){\r\n\t\t\tfor (var key in userOptions){\r\n\t\t\t\tif(!output.hasOwnProperty(key)){\r\n\t\t\t\t\tconsole.warn(\"Invalid \" + this.msgType + \" option:\", key)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (var key in output){\r\n\t\t\tif(key in userOptions){\r\n\t\t\t\toutput[key] = userOptions[key];\r\n\t\t\t}else{\r\n\t\t\t\tif(Array.isArray(output[key])){\r\n\t\t\t\t\toutput[key] = Object.assign([], output[key]);\r\n\t\t\t\t}else if(typeof output[key] === \"object\" && output[key] !== null){\r\n\t\t\t\t\toutput[key] = Object.assign({}, output[key]);\r\n\t\t\t\t}else if (typeof output[key] === \"undefined\"){\r\n\t\t\t\t\tdelete output[key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from '../tools/Helpers.js';\r\n\r\nexport default class Renderer extends CoreFeature{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.elementVertical = table.rowManager.element;\r\n\t\tthis.elementHorizontal = table.columnManager.element;\r\n\t\tthis.tableElement = table.rowManager.tableElement;\r\n\r\n\t\tthis.verticalFillMode = \"fit\"; // used by row manager to determin how to size the render area (\"fit\" - fits container to the contents, \"fill\" - fills the contianer without resizing it)\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t/////// Internal Bindings /////////\r\n\t///////////////////////////////////\r\n\r\n\tinitialize(){\r\n\t\t//initialize core functionality\r\n\t}\r\n\r\n\tclearRows(){\r\n\t\t//clear down existing rows layout\r\n\t}\r\n\r\n\tclearColumns(){\r\n\t\t//clear down existing columns layout\r\n\t}\r\n\r\n\r\n\treinitializeColumnWidths(columns){\r\n\t\t//resize columns to fit data\r\n\t}\r\n\r\n\r\n\trenderRows(){\r\n\t\t//render rows from a clean slate\r\n\t}\r\n\r\n\trenderColumns(){\r\n\t\t//render columns from a clean slate\r\n\t}\r\n\r\n\trerenderRows(callback){\r\n\t\t// rerender rows and keep position\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\t}\r\n\r\n\trerenderColumns(update, blockRedraw){\r\n\t\t//rerender columns\r\n\t}\r\n\r\n\trenderRowCells(row){\r\n\t\t//render the cells in a row\r\n\t}\r\n\r\n\trerenderRowCells(row, force){\r\n\t\t//rerender the cells in a row\r\n\t}\r\n\r\n\tscrollColumns(left, dir){\r\n\t\t//handle horizontal scrolling\r\n\t}\r\n\r\n\tscrollRows(top, dir){\r\n\t\t//handle vertical scolling\r\n\t}\r\n\r\n\tresize(){\r\n\t\t//container has rezied, carry out any needed recalculations (DO NOT RERENDER IN THIS FUNCTION)\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\t//scroll to a specific row\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\t//determine weather the row is nearest the top or bottom of the table, retur true for top or false for bottom\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\t//return the visible rows\r\n\t\treturn [];\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t//////// Helper Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\trows(){\r\n\t\treturn this.table.rowManager.getDisplayRows();\r\n\t}\r\n\r\n\tstyleRow(row, index){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tif(index % 2){\r\n\t\t\trowEl.classList.add(\"tabulator-row-even\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-odd\");\r\n\t\t}else{\r\n\t\t\trowEl.classList.add(\"tabulator-row-odd\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-even\");\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t/////// External Triggers /////////\r\n\t/////// (DO NOT OVERRIDE) /////////\r\n\t///////////////////////////////////\r\n\r\n\tclear(){\r\n\t\t//clear down existing layout\r\n\t\tthis.clearRows();\r\n\t\tthis.clearColumns();\r\n\t}\r\n\r\n\trender(){\r\n\t\t//render from a clean slate\r\n\t\tthis.renderRows();\r\n\t\tthis.renderColumns();\r\n\t}\r\n\r\n\trerender(callback){\r\n\t\t// rerender and keep position\r\n\t\tthis.rerenderRows();\r\n\t\tthis.rerenderColumns();\r\n\t}\r\n\r\n\tscrollToRowPosition(row, position, ifVisible){\r\n\t\tvar rowIndex = this.rows().indexOf(row),\r\n\t\trowEl = row.getElement(),\r\n\t\toffset = 0;\r\n\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tif(rowIndex > -1){\r\n\r\n\t\t\t\tif(typeof ifVisible === \"undefined\"){\r\n\t\t\t\t\tifVisible = this.table.options.scrollToRowIfVisible;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//check row visibility\r\n\t\t\t\tif(!ifVisible){\r\n\t\t\t\t\tif(Helpers.elVisible(rowEl)){\r\n\t\t\t\t\t\toffset = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(offset > 0 && offset < this.elementVertical.clientHeight - rowEl.offsetHeight){\r\n\t\t\t\t\t\t\tresolve();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(typeof position === \"undefined\"){\r\n\t\t\t\t\tposition = this.table.options.scrollToRowPosition;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(position === \"nearest\"){\r\n\t\t\t\t\tposition = this.scrollToRowNearestTop(row) ? \"top\" : \"bottom\"\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//scroll to row\r\n\t\t\t\tthis.scrollToRow(row);\r\n\r\n\t\t\t\t//align to correct position\r\n\t\t\t\tswitch(position){\r\n\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\tcase \"center\":\r\n\r\n\t\t\t\t\tif(this.elementVertical.scrollHeight - this.elementVertical.scrollTop == this.elementVertical.clientHeight){\r\n\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop + (rowEl.offsetTop - this.elementVertical.scrollTop) - ((this.elementVertical.scrollHeight - rowEl.offsetTop) / 2);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - (this.elementVertical.clientHeight / 2);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"bottom\":\r\n\r\n\t\t\t\t\tif(this.elementVertical.scrollHeight - this.elementVertical.scrollTop == this.elementVertical.clientHeight){\r\n\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - (this.elementVertical.scrollHeight - rowEl.offsetTop) + rowEl.offsetHeight;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - this.elementVertical.clientHeight + rowEl.offsetHeight;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tcase \"top\":\r\n\t\t\t\t\tthis.elementVertical.scrollTop = rowEl.offsetTop;\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tresolve();\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - Row not visible\");\r\n\t\t\t\treject(\"Scroll Error - Row not visible\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class BaiscHorizontal extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t}\r\n\r\n\trenderRowCells(row){\r\n\t\trow.cells.forEach((cell) => {\r\n\t\t\trow.element.appendChild(cell.getElement());\r\n\t\t\tcell.cellRendered();\r\n\t\t});\r\n\t}\r\n\r\n\treinitializeColumnWidths(columns){\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t});\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class VirtualDomHorizontal extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.leftCol = 0;\r\n\t\tthis.rightCol = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = 0;\r\n\t\tthis.vDomScrollPosRight = 0;\r\n\t\t\r\n\t\tthis.vDomPadLeft = 0;\r\n\t\tthis.vDomPadRight = 0;\r\n\t\t\r\n\t\tthis.fitDataColAvg = 0;\r\n\t\t\r\n\t\tthis.windowBuffer = 200; //pixel margin to make column visible before it is shown on screen\r\n\t\t\r\n\t\tthis.visibleRows = null;\r\n\r\n\t\tthis.initialized = false;\r\n\t\tthis.isFitData = false;\r\n\t\t\r\n\t\tthis.columns = [];\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.compatibilityCheck();\r\n\t\tthis.layoutCheck();\r\n\t\tthis.vertScrollListen();\r\n\t}\r\n\t\r\n\tcompatibilityCheck(){\r\n\t\tvar columns = this.options(\"columns\"),\r\n\t\tfrozen = false,\r\n\t\tok = true;\r\n\t\t\r\n\t\tif(this.options(\"layout\") == \"fitDataTable\"){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with fitDataTable layout mode\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.options(\"responsiveLayout\")){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with responsive columns\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.options(\"rtl\")){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not currently compatible with RTL text direction\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(columns){\r\n\t\t\tfrozen = columns.find((col) => {\r\n\t\t\t\treturn col.frozen;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(frozen){\r\n\t\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with frozen columns\");\r\n\t\t\t\tok = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// if(!ok){\r\n\t\t// \toptions.virtualDomHoz = false;\r\n\t\t// }\r\n\t\t\r\n\t\treturn ok;\r\n\t}\r\n\t\r\n\tlayoutCheck(){\r\n\t\tthis.isFitData = this.options(\"layout\").startsWith('fitData');\r\n\t}\r\n\r\n\tvertScrollListen(){\r\n\t\tthis.subscribe(\"scroll-vertical\", this.clearVisRowCache.bind(this));\r\n\t\tthis.subscribe(\"data-refreshed\", this.clearVisRowCache.bind(this));\r\n\t}\r\n\r\n\tclearVisRowCache(){\r\n\t\tthis.visibleRows = null;\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t///////// Public Functions ///////////\r\n\t//////////////////////////////////////\r\n\t\r\n\trenderColumns(row, force){\r\n\t\tthis.dataChange();\r\n\t}\r\n\r\n\t\r\n\tscrollColumns(left, dir){\r\n\t\tif(this.scrollLeft != left){\r\n\t\t\tthis.scrollLeft = left;\r\n\t\t\t\r\n\t\t\tthis.scroll(left - (this.vDomScrollPosLeft + this.windowBuffer));\r\n\t\t}\r\n\t}\r\n\t\r\n\tcalcWindowBuffer(){\r\n\t\tvar buffer = this.elementVertical.clientWidth;\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvar width = column.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tif(width > buffer){\r\n\t\t\t\t\tbuffer = width;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.windowBuffer = buffer * 2;\r\n\t}\r\n\t\r\n\trerenderColumns(update, blockRedraw){\t\t\r\n\t\tvar old = {\r\n\t\t\tcols:this.columns,\r\n\t\t\tleftCol:this.leftCol,\r\n\t\t\trightCol:this.rightCol,\r\n\t\t},\r\n\t\tcolPos = 0;\r\n\t\t\r\n\t\t\r\n\t\tif(update && !this.initialized){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tthis.clear();\r\n\t\t\r\n\t\tthis.calcWindowBuffer();\r\n\t\t\r\n\t\tthis.scrollLeft = this.elementVertical.scrollLeft;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = this.scrollLeft - this.windowBuffer;\r\n\t\tthis.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.windowBuffer;\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tvar config = {};\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvar width = column.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tconfig.leftPos = colPos;\r\n\t\t\t\tconfig.rightPos = colPos + width;\r\n\t\t\t\t\r\n\t\t\t\tconfig.width = width;\r\n\t\t\t\t\r\n\t\t\t\tif (this.isFitData) {\r\n\t\t\t\t\tconfig.fitDataCheck = column.modules.vdomHoz ? column.modules.vdomHoz.fitDataCheck : true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif((colPos + width > this.vDomScrollPosLeft) && (colPos < this.vDomScrollPosRight)){\r\n\t\t\t\t\t//column is visible\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.leftCol == -1){\r\n\t\t\t\t\t\tthis.leftCol = this.columns.length;\r\n\t\t\t\t\t\tthis.vDomPadLeft = colPos;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.rightCol = this.columns.length;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t// column is hidden\r\n\t\t\t\t\tif(this.leftCol !== -1){\r\n\t\t\t\t\t\tthis.vDomPadRight += width;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.columns.push(column);\r\n\t\t\t\t\r\n\t\t\t\tcolumn.modules.vdomHoz = config;\r\n\t\t\t\t\r\n\t\t\t\tcolPos += width;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t\r\n\t\tthis.initialized = true;\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tif(!update || this.reinitChanged(old)){\r\n\t\t\t\tthis.reinitializeRows();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.elementVertical.scrollLeft = this.scrollLeft;\r\n\t}\r\n\t\r\n\trenderRowCells(row){\r\n\t\tif(this.initialized){\r\n\t\t\tthis.initializeRow(row);\r\n\t\t}else{\r\n\t\t\trow.cells.forEach((cell) => {\r\n\t\t\t\trow.element.appendChild(cell.getElement());\r\n\t\t\t\tcell.cellRendered();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\trerenderRowCells(row, force){\r\n\t\tthis.reinitializeRow(row, force);\r\n\t}\r\n\t\r\n\treinitializeColumnWidths(columns){\r\n\t\tfor(let i = this.leftCol; i <= this.rightCol; i++){\r\n\t\t\tthis.columns[i].reinitializeWidth();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t//////// Internal Rendering //////////\r\n\t//////////////////////////////////////\r\n\t\r\n\tdeinitialize(){\r\n\t\tthis.initialized = false;\r\n\t}\r\n\t\r\n\tclear(){\r\n\t\tthis.columns = [];\r\n\t\t\r\n\t\tthis.leftCol = -1;\r\n\t\tthis.rightCol = 0;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = 0;\r\n\t\tthis.vDomScrollPosRight = 0;\r\n\t\tthis.vDomPadLeft = 0;\r\n\t\tthis.vDomPadRight = 0;\r\n\t}\r\n\t\r\n\tdataChange(){\r\n\t\tvar change = false,\r\n\t\tcollsWidth = 0,\r\n\t\tcolEnd = 0,\r\n\t\tgroup, row, rowEl;\r\n\t\t\r\n\t\tif(this.isFitData){\r\n\t\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\t\tif(!column.definition.width && column.visible){\r\n\t\t\t\t\tchange = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(change){\r\n\t\t\t\tif(change && this.table.rowManager.getDisplayRows().length){\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.windowBuffer;\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar row = this.chain(\"rows-sample\", [1], [], () => {\r\n\t\t\t\t\t\treturn this.table.rowManager.getDisplayRows();\r\n\t\t\t\t\t})[0];\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trowEl = row.getElement();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trow.generateCells();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.tableElement.appendChild(rowEl);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor(var colEnd = 0; colEnd < row.cells.length; colEnd++){\r\n\t\t\t\t\t\t\tlet cell = row.cells[colEnd];\r\n\t\t\t\t\t\t\trowEl.appendChild(cell.getElement());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcell.column.reinitializeWidth();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcollsWidth += cell.column.getWidth();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// if(collsWidth > this.vDomScrollPosRight){\r\n\t\t\t\t\t\t\t// \tbreak;\r\n\t\t\t\t\t\t\t// }\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// this.fitDataColAvg = Math.floor(collsWidth / (colEnd + 1));\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// for(colEnd; colEnd < this.table.columnManager.columnsByIndex.length; colEnd++){\r\n\t\t\t\t\t\t// \tthis.table.columnManager.columnsByIndex[colEnd].setWidth(this.fitDataColAvg);\r\n\t\t\t\t\t\t// }\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.rerenderColumns(false, true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.options(\"layout\") === \"fitColumns\"){\r\n\t\t\t\tthis.layoutRefresh();\r\n\t\t\t\tthis.rerenderColumns(false, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitChanged(old){\r\n\t\tvar match = true;\r\n\t\t\r\n\t\tif(old.cols.length !== this.columns.length || old.leftCol !== this.leftCol || old.rightCol !== this.rightCol){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\told.cols.forEach((col, i) => {\r\n\t\t\tif(col !== this.columns[i]){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn !match;\r\n\t}\r\n\t\r\n\treinitializeRows(){\r\n\t\tvar rows = this.getVisibleRows();\r\n\t\trows.forEach((row) => {\r\n\t\t\tthis.reinitializeRow(row, true);\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetVisibleRows(){\r\n\t\tif (!this.visibleRows){\r\n\t\t\tthis.visibleRows = this.table.rowManager.getVisibleRows();\r\n\t\t}\r\n\r\n\t\treturn this.visibleRows;\t\r\n\t}\r\n\t\r\n\tscroll(diff){\r\n\t\tthis.vDomScrollPosLeft += diff;\r\n\t\tthis.vDomScrollPosRight += diff;\r\n\r\n\t\tif(Math.abs(diff) > (this.windowBuffer / 2)){\r\n\t\t\tthis.rerenderColumns();\r\n\t\t}else{\r\n\t\t\tif(diff > 0){\r\n\t\t\t\t//scroll right\r\n\t\t\t\tthis.addColRight();\r\n\t\t\t\tthis.removeColLeft();\r\n\t\t\t}else{\r\n\t\t\t\t//scroll left\r\n\t\t\t\tthis.addColLeft();\r\n\t\t\t\tthis.removeColRight();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolPositionAdjust (start, end, diff){\r\n\t\tfor(let i = start; i < end; i++){\r\n\t\t\tlet column = this.columns[i];\r\n\t\t\t\r\n\t\t\tcolumn.modules.vdomHoz.leftPos += diff;\r\n\t\t\tcolumn.modules.vdomHoz.rightPos += diff;\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColRight(){\r\n\t\tvar changes = false;\r\n\t\t\r\n\t\twhile(true){\r\n\t\t\t\r\n\t\t\tlet column = this.columns[this.rightCol + 1];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.leftPos <= this.vDomScrollPosRight){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\trow.getElement().appendChild(cell.getElement());\r\n\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.fitDataColActualWidthCheck(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.rightCol++; // Don't move this below the >= check below\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.rightCol >= (this.columns.length - 1)){\r\n\t\t\t\t\t\tthis.vDomPadRight = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomPadRight -= column.getWidth();\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColLeft(){\r\n\t\tvar changes = false;\r\n\t\t\r\n\t\twhile(true){\r\n\t\t\tlet column = this.columns[this.leftCol - 1];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.rightPos >= this.vDomScrollPosLeft){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\trow.getElement().prepend(cell.getElement());\r\n\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.leftCol--; // don't move this below the <= check below\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.leftCol <= 0){ // replicating logic in addColRight\r\n\t\t\t\t\t\tthis.vDomPadLeft = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomPadLeft -= column.getWidth();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tlet diff = this.fitDataColActualWidthCheck(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(diff){\r\n\t\t\t\t\t\tthis.scrollLeft = this.elementVertical.scrollLeft = this.elementVertical.scrollLeft + diff;\r\n\t\t\t\t\t\tthis.vDomPadRight -= diff;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveColRight(){\r\n\t\tvar changes = false;\r\n\t\t\r\n\t\twhile(true){\r\n\t\t\tlet column = this.columns[this.rightCol];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.leftPos > this.vDomScrollPosRight){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\trow.getElement().removeChild(cell.getElement());\r\n\t\t\t\t\t\t\t} catch (ex) {\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Could not removeColRight\", ex.message)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.vDomPadRight += column.getWidth();\r\n\t\t\t\t\tthis.rightCol --;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveColLeft(){\r\n\t\tvar changes = false;\r\n\t\t\r\n\t\twhile(true){\r\n\t\t\tlet column = this.columns[this.leftCol];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.rightPos < this.vDomScrollPosLeft){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\t\t\t\t\t\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\trow.getElement().removeChild(cell.getElement());\r\n\t\t\t\t\t\t\t} catch (ex) {\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Could not removeColLeft\", ex.message)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.vDomPadLeft += column.getWidth();\r\n\t\t\t\t\tthis.leftCol ++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\tfitDataColActualWidthCheck(column){\r\n\t\tvar newWidth, widthDiff;\r\n\t\t\r\n\t\tif(column.modules.vdomHoz.fitDataCheck){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t\t\r\n\t\t\tnewWidth = column.getWidth();\r\n\t\t\twidthDiff = newWidth - column.modules.vdomHoz.width;\r\n\t\t\t\r\n\t\t\tif(widthDiff){\r\n\t\t\t\tcolumn.modules.vdomHoz.rightPos += widthDiff;\r\n\t\t\t\tcolumn.modules.vdomHoz.width = newWidth;\r\n\t\t\t\tthis.colPositionAdjust(this.columns.indexOf(column) + 1, this.columns.length, widthDiff);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.vdomHoz.fitDataCheck = false;\r\n\t\t}\r\n\t\t\r\n\t\treturn widthDiff;\r\n\t}\r\n\t\r\n\tinitializeRow(row){\r\n\t\tif(row.type !== \"group\"){\r\n\t\t\trow.modules.vdomHoz = {\r\n\t\t\t\tleftCol:this.leftCol,\r\n\t\t\t\trightCol:this.rightCol,\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tfor(let i = this.leftCol; i <= this.rightCol; i++){\r\n\t\t\t\tlet column = this.columns[i];\r\n\t\t\t\t\r\n\t\t\t\tif(column && column.visible){\r\n\t\t\t\t\tlet cell = row.getCell(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\trow.getElement().appendChild(cell.getElement());\r\n\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeRow(row, force){\r\n\t\tif(row.type !== \"group\"){\r\n\t\t\tif(force || !row.modules.vdomHoz || row.modules.vdomHoz.leftCol !== this.leftCol || row.modules.vdomHoz.rightCol !== this.rightCol){\r\n\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\twhile(rowEl.firstChild) rowEl.removeChild(rowEl.firstChild);\r\n\t\t\t\t\r\n\t\t\t\tthis.initializeRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Column from './column/Column.js';\r\nimport ColumnComponent from './column/ColumnComponent.js';\r\nimport Helpers from './tools/Helpers.js';\r\nimport OptionsList from './tools/OptionsList.js';\r\n\r\nimport RendererBasicHorizontal from './rendering/renderers/BasicHorizontal.js';\r\nimport RendererVirtualDomHorizontal from './rendering/renderers/VirtualDomHorizontal.js';\r\n\r\nimport defaultColumnOptions from './column/defaults/options.js';\r\n\r\nexport default class ColumnManager extends CoreFeature {\r\n\r\n\tconstructor (table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.blockHozScrollEvent = false;\r\n\t\tthis.headersElement = null;\r\n\t\tthis.element = null ; //containing element\r\n\t\tthis.columns = []; // column definition object\r\n\t\tthis.columnsByIndex = []; //columns by index\r\n\t\tthis.columnsByField = {}; //columns by field\r\n\t\tthis.scrollLeft = 0;\r\n\t\tthis.optionsList = new OptionsList(this.table, \"column definition\", defaultColumnOptions);\r\n\r\n\t\tthis.renderer = null;\r\n\t}\r\n\r\n\t////////////// Setup Functions /////////////////\r\n\r\n\tinitialize(){\r\n\t\tthis.initializeRenderer();\r\n\r\n\t\tthis.headersElement = this.createHeadersElement();\r\n\t\tthis.element = this.createHeaderElement();\r\n\r\n\t\tthis.element.insertBefore(this.headersElement, this.element.firstChild);\r\n\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t}\r\n\r\n\tinitializeRenderer(){\r\n\t\tvar renderClass;\r\n\r\n\t\tvar renderers = {\r\n\t\t\t\"virtual\": RendererVirtualDomHorizontal,\r\n\t\t\t\"basic\": RendererBasicHorizontal,\r\n\t\t};\r\n\r\n\t\tif(typeof this.table.options.renderHorizontal === \"string\"){\r\n\t\t\trenderClass = renderers[this.table.options.renderHorizontal];\r\n\t\t}else{\r\n\t\t\trenderClass = this.table.options.renderHorizontal;\r\n\t\t}\r\n\r\n\t\tif(renderClass){\r\n\t\t\tthis.renderer = new renderClass(this.table, this.element, this.tableElement);\r\n\t\t\tthis.renderer.initialize();\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Unable to find matching renderer:\", table.options.renderHorizontal);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tcreateHeadersElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-headers\");\r\n\t\tel.setAttribute(\"role\", \"row\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tcreateHeaderElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-header\");\r\n\t\tel.setAttribute(\"role\", \"rowgroup\");\r\n\r\n\t\tif(!this.table.options.headerVisible){\r\n\t\t\tel.classList.add(\"tabulator-header-hidden\");\r\n\t\t}\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\t//return containing element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\t//return header containing element\r\n\tgetHeadersElement(){\r\n\t\treturn this.headersElement;\r\n\t}\r\n\r\n\t//scroll horizontally to match table body\r\n\tscrollHorizontal(left){\r\n\t\tvar hozAdjust = 0,\r\n\t\tscrollWidth = this.element.scrollWidth - this.table.element.clientWidth;\r\n\r\n\t\t// this.tempScrollBlock();\r\n\t\tthis.element.scrollLeft = left;\r\n\r\n\t\t//adjust for vertical scrollbar moving table when present\r\n\t\tif(left > scrollWidth){\r\n\t\t\thozAdjust = left - scrollWidth;\r\n\t\t\tthis.element.style.marginLeft = (-(hozAdjust)) + \"px\";\r\n\t\t}else{\r\n\t\t\tthis.element.style.marginLeft = 0;\r\n\t\t}\r\n\r\n\t\tthis.scrollLeft = left;\r\n\r\n\t\tthis.renderer.scrollColumns(left);\r\n\t}\r\n\r\n\t///////////// Column Setup Functions /////////////\r\n\tgenerateColumnsFromRowData(data){\r\n\t\tvar cols = [],\r\n\t\tdefinitions = this.table.options.autoColumnsDefinitions,\r\n\t\trow, sorter;\r\n\r\n\t\tif(data && data.length){\r\n\r\n\t\t\trow = data[0];\r\n\r\n\t\t\tfor(var key in row){\r\n\t\t\t\tlet col = {\r\n\t\t\t\t\tfield:key,\r\n\t\t\t\t\ttitle:key,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tlet value = row[key];\r\n\r\n\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\tsorter = \"boolean\";\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\tif(Array.isArray(value)){\r\n\t\t\t\t\t\tsorter = \"array\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\tif(!isNaN(value) && value !== \"\"){\r\n\t\t\t\t\t\tsorter = \"number\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)){\r\n\t\t\t\t\t\t\tsorter = \"alphanum\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcol.sorter = sorter;\r\n\r\n\t\t\t\tcols.push(col);\r\n\t\t\t}\r\n\r\n\t\t\tif(definitions){\r\n\r\n\t\t\t\tswitch(typeof definitions){\r\n\t\t\t\t\tcase \"function\":\r\n\t\t\t\t\tthis.table.options.columns = definitions.call(this.table, cols);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\tif(Array.isArray(definitions)){\r\n\t\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\t\tvar match = definitions.find((def) => {\r\n\t\t\t\t\t\t\t\treturn def.field === col.field;\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\tif(match){\r\n\t\t\t\t\t\t\t\tObject.assign(col, match);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\t\tif(definitions[col.field]){\r\n\t\t\t\t\t\t\t\tObject.assign(col, definitions[col.field]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.table.options.columns = cols;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.table.options.columns = cols;\r\n\t\t\t}\r\n\r\n\t\t\tthis.setColumns(this.table.options.columns);\r\n\t\t}\r\n\t}\r\n\r\n\tsetColumns(cols, row){\r\n\t\twhile(this.headersElement.firstChild) this.headersElement.removeChild(this.headersElement.firstChild);\r\n\r\n\t\tthis.columns = [];\r\n\t\tthis.columnsByIndex = [];\r\n\t\tthis.columnsByField = {};\r\n\r\n\t\tthis.dispatch(\"columns-loading\");\r\n\r\n\t\tcols.forEach((def, i) => {\r\n\t\t\tthis._addColumn(def);\r\n\t\t});\r\n\r\n\t\tthis._reIndexColumns();\r\n\r\n\t\tthis.dispatch(\"columns-loaded\");\r\n\r\n\t\tthis.renderer.rerenderColumns(false, true);\r\n\r\n\t\tthis.redraw(true);\r\n\t}\r\n\r\n\t_addColumn(definition, before, nextToColumn){\r\n\t\tvar column = new Column(definition, this),\r\n\t\tcolEl = column.getElement(),\r\n\t\tindex = nextToColumn ? this.findColumnIndex(nextToColumn) : nextToColumn;\r\n\r\n\t\tif(nextToColumn && index > -1){\r\n\t\t\tvar topColumn = nextToColumn.getTopColumn()\r\n\t\t\tvar parentIndex = this.columns.indexOf(topColumn);\r\n\t\t\tvar nextEl = topColumn.getElement();\r\n\r\n\t\t\tif(before){\r\n\t\t\t\tthis.columns.splice(parentIndex, 0, column);\r\n\t\t\t\tnextEl.parentNode.insertBefore(colEl, nextEl);\r\n\t\t\t}else{\r\n\t\t\t\tthis.columns.splice(parentIndex + 1, 0, column);\r\n\t\t\t\tnextEl.parentNode.insertBefore(colEl, nextEl.nextSibling);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(before){\r\n\t\t\t\tthis.columns.unshift(column);\r\n\t\t\t\tthis.headersElement.insertBefore(column.getElement(), this.headersElement.firstChild);\r\n\t\t\t}else{\r\n\t\t\t\tthis.columns.push(column);\r\n\t\t\t\tthis.headersElement.appendChild(column.getElement());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcolumn.columnRendered();\r\n\r\n\t\treturn column;\r\n\t}\r\n\r\n\tregisterColumnField(col){\r\n\t\tif(col.definition.field){\r\n\t\t\tthis.columnsByField[col.definition.field] = col;\r\n\t\t}\r\n\t}\r\n\r\n\tregisterColumnPosition(col){\r\n\t\tthis.columnsByIndex.push(col);\r\n\t}\r\n\r\n\t_reIndexColumns(){\r\n\t\tthis.columnsByIndex = [];\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.reRegisterPosition();\r\n\t\t});\r\n\t}\r\n\r\n\t//ensure column headers take up the correct amount of space in column groups\r\n\tverticalAlignHeaders(){\r\n\t\tvar minHeight = 0;\r\n\r\n\t\tthis.columns.forEach((column) => {\r\n\t\t\tvar height;\r\n\r\n\t\t\tcolumn.clearVerticalAlign();\r\n\r\n\t\t\theight = column.getHeight();\r\n\r\n\t\t\tif(height > minHeight){\r\n\t\t\t\tminHeight = height;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.columns.forEach((column) => {\r\n\t\t\tcolumn.verticalAlign(this.table.options.columnHeaderVertAlign, minHeight);\r\n\t\t});\r\n\r\n\t\tthis.table.rowManager.adjustTableSize();\r\n\t}\r\n\r\n\t//////////////// Column Details /////////////////\r\n\tfindColumn(subject){\r\n\t\tif(typeof subject == \"object\"){\r\n\r\n\t\t\tif(subject instanceof Column){\r\n\t\t\t\t//subject is column element\r\n\t\t\t\treturn subject;\r\n\t\t\t}else if(subject instanceof ColumnComponent){\r\n\t\t\t\t//subject is public column component\r\n\t\t\t\treturn subject._getSelf() || false;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\t\t\t\t//subject is a HTML element of the column header\r\n\t\t\t\tlet match = this.columns.find((column) => {\r\n\t\t\t\t\treturn column.element === subject;\r\n\t\t\t\t});\r\n\r\n\t\t\t\treturn match || false;\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the field name of the column\r\n\t\t\treturn this.columnsByField[subject] || false;\r\n\t\t}\r\n\r\n\t\t//catch all for any other type of input\r\n\t\treturn false;\r\n\t}\r\n\r\n\tgetColumnByField(field){\r\n\t\treturn this.columnsByField[field];\r\n\t}\r\n\r\n\tgetColumnsByFieldRoot(root){\r\n\t\tvar matches = [];\r\n\r\n\t\tObject.keys(this.columnsByField).forEach((field) => {\r\n\t\t\tvar fieldRoot = field.split(\".\")[0];\r\n\t\t\tif(fieldRoot === root){\r\n\t\t\t\tmatches.push(this.columnsByField[field]);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn matches;\r\n\t}\r\n\r\n\tgetColumnByIndex(index){\r\n\t\treturn this.columnsByIndex[index];\r\n\t}\r\n\r\n\tgetFirstVisibleColumn(index){\r\n\t\tvar index = this.columnsByIndex.findIndex((col) => {\r\n\t\t\treturn col.visible;\r\n\t\t});\r\n\r\n\t\treturn index > -1 ? this.columnsByIndex[index] : false;\r\n\t}\r\n\r\n\tgetColumns(){\r\n\t\treturn this.columns;\r\n\t}\r\n\r\n\tfindColumnIndex(column){\r\n\t\treturn this.columnsByIndex.findIndex((col) => {\r\n\t\t\treturn column === col;\r\n\t\t});\r\n\t}\r\n\r\n\t//return all columns that are not groups\r\n\tgetRealColumns(){\r\n\t\treturn this.columnsByIndex;\r\n\t}\r\n\r\n\t//travers across columns and call action\r\n\ttraverse(callback){\r\n\t\tthis.columnsByIndex.forEach((column,i) =>{\r\n\t\t\tcallback(column, i);\r\n\t\t});\r\n\t}\r\n\r\n\t//get defintions of actual columns\r\n\tgetDefinitions(active){\r\n\t\tvar output = [];\r\n\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tif(!active || (active && column.visible)){\r\n\t\t\t\toutput.push(column.getDefinition());\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//get full nested definition tree\r\n\tgetDefinitionTree(){\r\n\t\tvar output = [];\r\n\r\n\t\tthis.columns.forEach((column) => {\r\n\t\t\toutput.push(column.getDefinition(true));\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetComponents(structured){\r\n\t\tvar output = [],\r\n\t\tcolumns = structured ? this.columns : this.columnsByIndex;\r\n\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\toutput.push(column.getComponent());\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\tvar width = 0;\r\n\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tif(column.visible){\r\n\t\t\t\twidth += column.getWidth();\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn width;\r\n\t}\r\n\r\n\tmoveColumn(from, to, after){\r\n\t\tthis.moveColumnActual(from, to, after);\r\n\r\n\t\tto.element.parentNode.insertBefore(from.element, to.element);\r\n\r\n\t\tif(after){\r\n\t\t\tto.element.parentNode.insertBefore(to.element, from.element);\r\n\t\t}\r\n\r\n\t\tthis.verticalAlignHeaders();\r\n\r\n\t\tthis.table.rowManager.reinitialize();\r\n\t}\r\n\r\n\tmoveColumnActual(from, to, after){\r\n\t\tif(from.parent.isGroup){\r\n\t\t\tthis._moveColumnInArray(from.parent.columns, from, to, after);\r\n\t\t}else{\r\n\t\t\tthis._moveColumnInArray(this.columns, from, to, after);\r\n\t\t}\r\n\r\n\t\tthis._moveColumnInArray(this.columnsByIndex, from, to, after, true);\r\n\r\n\t\tthis.renderer.rerenderColumns(true);\r\n\r\n\t\tthis.dispatch(\"column-moved\", from, to, after);\r\n\r\n\t\tif(this.subscribedExternal(\"columnMoved\")){\r\n\t\t\tthis.dispatchExternal(\"columnMoved\", from.getComponent(), this.table.columnManager.getComponents());\r\n\t\t}\r\n\t}\r\n\r\n\t_moveColumnInArray(columns, from, to, after, updateRows){\r\n\t\tvar\tfromIndex = columns.indexOf(from),\r\n\t\ttoIndex, rows = [];\r\n\r\n\t\tif (fromIndex > -1) {\r\n\r\n\t\t\tcolumns.splice(fromIndex, 1);\r\n\r\n\t\t\ttoIndex = columns.indexOf(to);\r\n\r\n\t\t\tif (toIndex > -1) {\r\n\r\n\t\t\t\tif(after){\r\n\t\t\t\t\ttoIndex = toIndex+1;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\ttoIndex = fromIndex;\r\n\t\t\t}\r\n\r\n\t\t\tcolumns.splice(toIndex, 0, from);\r\n\r\n\t\t\tif(updateRows){\r\n\r\n\t\t\t\trows = this.chain(\"column-moving-rows\", [from, to, after], null, []) || [];\r\n\r\n\t\t\t\trows = rows.concat(this.table.rowManager.rows);\r\n\r\n\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\tif(row.cells.length){\r\n\t\t\t\t\t\tvar cell = row.cells.splice(fromIndex, 1)[0];\r\n\t\t\t\t\t\trow.cells.splice(toIndex, 0, cell);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tscrollToColumn(column, position, ifVisible){\r\n\t\tvar left = 0,\r\n\t\toffset = 0,\r\n\t\tadjust = 0,\r\n\t\tcolEl = column.getElement();\r\n\r\n\t\treturn new Promise((resolve, reject) => {\r\n\r\n\t\t\tif(typeof position === \"undefined\"){\r\n\t\t\t\tposition = this.table.options.scrollToColumnPosition;\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof ifVisible === \"undefined\"){\r\n\t\t\t\tifVisible = this.table.options.scrollToColumnIfVisible;\r\n\t\t\t}\r\n\r\n\t\t\tif(column.visible){\r\n\r\n\t\t\t\t//align to correct position\r\n\t\t\t\tswitch(position){\r\n\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\tcase \"center\":\r\n\t\t\t\t\tadjust = -this.element.clientWidth / 2;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"right\":\r\n\t\t\t\t\tadjust = colEl.clientWidth - this.headersElement.clientWidth;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//check column visibility\r\n\t\t\t\tif(!ifVisible){\r\n\r\n\t\t\t\t\toffset = colEl.offsetLeft;\r\n\r\n\t\t\t\t\tif(offset > 0 && offset + colEl.offsetWidth < this.element.clientWidth){\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//calculate scroll position\r\n\t\t\t\tleft = colEl.offsetLeft + adjust;\r\n\r\n\t\t\t\tleft = Math.max(Math.min(left, this.table.rowManager.element.scrollWidth - this.table.rowManager.element.clientWidth),0);\r\n\r\n\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\tthis.scrollHorizontal(left);\r\n\r\n\t\t\t\tresolve();\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - Column not visible\");\r\n\t\t\t\treject(\"Scroll Error - Column not visible\");\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t}\r\n\r\n\t//////////////// Cell Management /////////////////\r\n\tgenerateCells(row){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tcells.push(column.generateCell(row));\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\t//////////////// Column Management /////////////////\r\n\tgetFlexBaseWidth(){\r\n\t\tvar totalWidth = this.table.element.clientWidth, //table element width\r\n\t\tfixedWidth = 0;\r\n\r\n\t\t//adjust for vertical scrollbar if present\r\n\t\tif(this.table.rowManager.element.scrollHeight > this.table.rowManager.element.clientHeight){\r\n\t\t\ttotalWidth -= this.table.rowManager.element.offsetWidth - this.table.rowManager.element.clientWidth;\r\n\t\t}\r\n\r\n\t\tthis.columnsByIndex.forEach(function(column){\r\n\t\t\tvar width, minWidth, colWidth;\r\n\r\n\t\t\tif(column.visible){\r\n\r\n\t\t\t\twidth = column.definition.width || 0;\r\n\r\n\t\t\t\tminWidth = parseInt(column.minWidth);\r\n\r\n\t\t\t\tif(typeof(width) == \"string\"){\r\n\t\t\t\t\tif(width.indexOf(\"%\") > -1){\r\n\t\t\t\t\t\tcolWidth = (totalWidth / 100) * parseInt(width) ;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tcolWidth = parseInt(width);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolWidth = width;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfixedWidth += colWidth > minWidth ? colWidth : minWidth;\r\n\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn fixedWidth;\r\n\t}\r\n\r\n\taddColumn(definition, before, nextToColumn){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar column = this._addColumn(definition, before, nextToColumn);\r\n\r\n\t\t\tthis._reIndexColumns();\r\n\r\n\t\t\tthis.dispatch(\"column-add\", definition, before, nextToColumn);\r\n\r\n\t\t\tif(this.layoutMode() != \"fitColumns\"){\r\n\t\t\t\tcolumn.reinitializeWidth();\r\n\t\t\t}\r\n\r\n\t\t\tthis.redraw(true);\r\n\r\n\t\t\tthis.table.rowManager.reinitialize();\r\n\r\n\t\t\tthis.renderer.rerenderColumns();\r\n\r\n\t\t\tresolve(column);\r\n\t\t});\r\n\t}\r\n\r\n\t//remove column from system\r\n\tderegisterColumn(column){\r\n\t\tvar field = column.getField(),\r\n\t\tindex;\r\n\r\n\t\t//remove from field list\r\n\t\tif(field){\r\n\t\t\tdelete this.columnsByField[field];\r\n\t\t}\r\n\r\n\t\t//remove from index list\r\n\t\tindex = this.columnsByIndex.indexOf(column);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.columnsByIndex.splice(index, 1);\r\n\t\t}\r\n\r\n\t\t//remove from column list\r\n\t\tindex = this.columns.indexOf(column);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.columns.splice(index, 1);\r\n\t\t}\r\n\r\n\t\tthis.verticalAlignHeaders();\r\n\r\n\t\tthis.redraw();\r\n\t}\r\n\r\n\t//redraw columns\r\n\tredraw(force){\r\n\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\tthis.verticalAlignHeaders();\r\n\t\t}\r\n\r\n\t\tif(force){\r\n\t\t\tthis.table.rowManager.resetScroll();\r\n\t\t\tthis.table.rowManager.reinitialize();\r\n\t\t}\r\n\r\n\t\tif(!this.confirm(\"table-redrawing\", force)){\r\n\t\t\tthis.layoutRefresh();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"table-redraw\", force);\r\n\r\n\t\tthis.table.footerManager.redraw();\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class BaiscVertical extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.verticalFillMode = \"fill\";\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t}\r\n\r\n\tclearRows(){\r\n\t\tvar element = this.tableElement;\r\n\r\n\t\t// element.children.detach();\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\telement.scrollTop = 0;\r\n\t\telement.scrollLeft = 0;\r\n\r\n\t\telement.style.minWidth = \"\";\r\n\t\telement.style.minHeight = \"\";\r\n\t\telement.style.display = \"\";\r\n\t\telement.style.visibility = \"\";\r\n\t}\r\n\r\n\trenderRows(){\r\n\t\tvar element = this.tableElement,\r\n\t\tonlyGroupHeaders = true;\r\n\r\n\t\tthis.rows().forEach((row, index) => {\r\n\t\t\tthis.styleRow(row, index);\r\n\t\t\telement.appendChild(row.getElement());\r\n\t\t\trow.initialize(true);\r\n\r\n\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\tonlyGroupHeaders = false;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(onlyGroupHeaders){\r\n\t\t\telement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t}else{\r\n\t\t\telement.style.minWidth = \"\";\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trerenderRows(callback){\r\n\t\tthis.clearRows();\r\n\t\tthis.renderRows();\r\n\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\tvar rowTop = Helpers.elOffset(row.getElement()).top;\r\n\r\n\t\treturn !(Math.abs(this.elementVertical.scrollTop - rowTop) > Math.abs(this.elementVertical.scrollTop + this.elementVertical.clientHeight - rowTop));\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tthis.elementVertical.scrollTop = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top + this.elementVertical.scrollTop;\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\treturn this.rows();\r\n\t}\r\n\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class VirtualDomVertical extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.verticalFillMode = \"fill\";\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.vDomRowHeight = 20; //approximation of row heights for padding\r\n\r\n\t\tthis.vDomTop = 0; //hold position for first rendered row in the virtual DOM\r\n\t\tthis.vDomBottom = 0; //hold possition for last rendered row in the virtual DOM\r\n\r\n\t\tthis.vDomScrollPosTop = 0; //last scroll position of the vDom top;\r\n\t\tthis.vDomScrollPosBottom = 0; //last scroll position of the vDom bottom;\r\n\r\n\t\tthis.vDomTopPad = 0; //hold value of padding for top of virtual DOM\r\n\t\tthis.vDomBottomPad = 0; //hold value of padding for bottom of virtual DOM\r\n\r\n\t\tthis.vDomMaxRenderChain = 90; //the maximum number of dom elements that can be rendered in 1 go\r\n\r\n\t\tthis.vDomWindowBuffer = 0; //window row buffer before removing elements, to smooth scrolling\r\n\r\n\t\tthis.vDomWindowMinTotalRows = 20; //minimum number of rows to be generated in virtual dom (prevent buffering issues on tables with tall rows)\r\n\t\tthis.vDomWindowMinMarginRows = 5; //minimum number of rows to be generated in virtual dom margin\r\n\r\n\t\tthis.vDomTopNewRows = []; //rows to normalize after appending to optimize render speed\r\n\t\tthis.vDomBottomNewRows = []; //rows to normalize after appending to optimize render speed\r\n\t}\r\n\r\n\t//////////////////////////////////////\r\n\t///////// Public Functions ///////////\r\n\t//////////////////////////////////////\r\n\r\n\tclearRows(){\r\n\t\tvar element = this.tableElement;\r\n\r\n\t\t// element.children.detach();\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\telement.style.paddingTop = \"\";\r\n\t\telement.style.paddingBottom = \"\";\r\n\t\t// element.style.minWidth = \"\";\r\n\t\telement.style.minHeight = \"\";\r\n\t\telement.style.display = \"\";\r\n\t\telement.style.visibility = \"\";\r\n\r\n\t\tthis.elementVertical.scrollTop = 0;\r\n\t\tthis.elementVertical.scrollLeft = 0;\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.vDomTop = 0;\r\n\t\tthis.vDomBottom = 0;\r\n\t\tthis.vDomTopPad = 0;\r\n\t\tthis.vDomBottomPad = 0;\r\n\t\tthis.vDomScrollPosTop = 0;\r\n\t\tthis.vDomScrollPosBottom = 0;\r\n\t}\r\n\r\n\trenderRows(){\r\n\t\tthis._virtualRenderFill();\r\n\t}\r\n\r\n\trerenderRows(callback){\r\n\t\tvar scrollTop = this.elementVertical.scrollTop;\r\n\t\tvar topRow = false;\r\n\t\tvar topOffset = false;\r\n\r\n\t\tvar left = this.table.rowManager.scrollLeft;\r\n\r\n\t\tvar rows = this.rows();\r\n\r\n\t\tfor(var i = this.vDomTop; i <= this.vDomBottom; i++){\r\n\r\n\t\t\tif(rows[i]){\r\n\t\t\t\tvar diff = scrollTop - rows[i].getElement().offsetTop;\r\n\r\n\t\t\t\tif(topOffset === false || Math.abs(diff) < topOffset){\r\n\t\t\t\t\ttopOffset = diff;\r\n\t\t\t\t\ttopRow = i;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\trows.forEach((row) => {\r\n\t\t\trow.deinitializeHeight();\r\n\t\t});\r\n\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\r\n\t\tthis._virtualRenderFill((topRow === false ? this.rows.length - 1 : topRow), true, topOffset || 0);\r\n\r\n\t\tthis.scrollColumns(left);\r\n\t}\r\n\r\n\tscrollColumns(left){\r\n\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t}\r\n\r\n\tscrollRows(top, dir){\r\n\t\tvar topDiff = top - this.vDomScrollPosTop;\r\n\t\tvar bottomDiff = top - this.vDomScrollPosBottom;\r\n\t\tvar margin = this.vDomWindowBuffer * 2;\r\n\t\tvar rows = this.rows();\r\n\r\n\t\tthis.scrollTop = top;\r\n\r\n\t\tif(-topDiff > margin || bottomDiff > margin){\r\n\t\t\t//if big scroll redraw table;\r\n\t\t\tvar left = this.table.rowManager.scrollLeft;\r\n\t\t\tthis._virtualRenderFill(Math.floor((this.elementVertical.scrollTop / this.elementVertical.scrollHeight) * rows.length));\r\n\t\t\tthis.scrollColumns(left);\r\n\t\t}else{\r\n\r\n\t\t\tif(dir){\r\n\t\t\t\t//scrolling up\r\n\t\t\t\tif(topDiff < 0){\r\n\t\t\t\t\tthis._addTopRow(rows, -topDiff);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(bottomDiff < 0){\r\n\t\t\t\t\t//hide bottom row if needed\r\n\t\t\t\t\tif(this.vDomScrollHeight - this.scrollTop > this.vDomWindowBuffer){\r\n\t\t\t\t\t\tthis._removeBottomRow(rows, -bottomDiff);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomScrollPosBottom = this.scrollTop;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\r\n\t\t\t\tif(bottomDiff >= 0){\r\n\t\t\t\t\tthis._addBottomRow(rows, bottomDiff);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//scrolling down\r\n\t\t\t\tif(topDiff >= 0){\r\n\t\t\t\t\t//hide top row if needed\r\n\t\t\t\t\tif(this.scrollTop > this.vDomWindowBuffer){\r\n\t\t\t\t\t\tthis._removeTopRow(rows, topDiff);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomScrollPosTop = this.scrollTop;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tresize(){\r\n\t\tthis.vDomWindowBuffer = this.table.options.renderVerticalBuffer || this.elementVertical.clientHeight;\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\tvar rowIndex = this.rows().indexOf(row);\r\n\r\n\t\treturn !(Math.abs(this.vDomTop - rowIndex) > Math.abs(this.vDomBottom - rowIndex));\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\tvar index = this.rows().indexOf(row);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis._virtualRenderFill(index, true);\r\n\t\t}\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\tvar topEdge = this.elementVertical.scrollTop,\r\n\t\tbottomEdge = this.elementVertical.clientHeight + topEdge,\r\n\t\ttopFound = false,\r\n\t\ttopRow = 0,\r\n\t\tbottomRow = 0,\r\n\t\trows = this.rows();\r\n\r\n\t\tif(includingBuffer){\r\n\t\t\ttopRow = this.vDomTop;\r\n\t\t\tbottomRow = this.vDomBottom;\r\n\t\t}else{\r\n\t\t\tfor(var i = this.vDomTop; i <= this.vDomBottom; i++){\r\n\t\t\t\tif(rows[i]){\r\n\t\t\t\t\tif(!topFound){\r\n\t\t\t\t\t\tif((topEdge - rows[i].getElement().offsetTop) >= 0){\r\n\t\t\t\t\t\t\ttopRow = i;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\ttopFound = true;\r\n\r\n\t\t\t\t\t\t\tif(bottomEdge - rows[i].getElement().offsetTop >= 0){\r\n\t\t\t\t\t\t\t\tbottomRow = i;\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(bottomEdge - rows[i].getElement().offsetTop >= 0){\r\n\t\t\t\t\t\t\tbottomRow = i;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn rows.slice(topRow, bottomRow + 1);\r\n\t}\r\n\r\n\t//////////////////////////////////////\r\n\t//////// Internal Rendering //////////\r\n\t//////////////////////////////////////\r\n\r\n\t//full virtual render\r\n\t_virtualRenderFill(position, forceMove, offset){\r\n\t\tvar\telement = this.tableElement,\r\n\t\tholder = this.elementVertical,\r\n\t\ttopPad = 0,\r\n\t\trowsHeight = 0,\r\n\t\theightOccupied = 0,\r\n\t\ttopPadHeight = 0,\r\n\t\ti = 0,\r\n\t\trows = this.rows(),\r\n\t\trowsCount = rows.length,\r\n\t\tcontainerHeight = this.elementVertical.clientHeight;\r\n\r\n\t\tposition = position || 0;\r\n\r\n\t\toffset = offset || 0;\r\n\r\n\t\tif(!position){\r\n\t\t\tthis.clear();\r\n\t\t}else{\r\n\t\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\t\t//check if position is too close to bottom of table\r\n\t\t\theightOccupied = (rowsCount - position + 1) * this.vDomRowHeight;\r\n\r\n\t\t\tif(heightOccupied < containerHeight){\r\n\t\t\t\tposition -= Math.ceil((containerHeight - heightOccupied) / this.vDomRowHeight);\r\n\t\t\t\tif(position < 0){\r\n\t\t\t\t\tposition = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//calculate initial pad\r\n\t\t\ttopPad = Math.min(Math.max(Math.floor(this.vDomWindowBuffer / this.vDomRowHeight), this.vDomWindowMinMarginRows), position);\r\n\t\t\tposition -= topPad;\r\n\t\t}\r\n\r\n\t\tif(rowsCount && Helpers.elVisible(this.elementVertical)){\r\n\t\t\tthis.vDomTop = position;\r\n\r\n\t\t\tthis.vDomBottom = position -1;\r\n\r\n\t\t\twhile ((rowsHeight <= containerHeight + this.vDomWindowBuffer || i < this.vDomWindowMinTotalRows) && this.vDomBottom < rowsCount -1){\r\n\t\t\t\tvar index = this.vDomBottom + 1,\r\n\t\t\t\trow = rows[index],\r\n\t\t\t\trowHeight = 0;\r\n\r\n\t\t\t\tthis.styleRow(row, index);\r\n\r\n\t\t\t\telement.appendChild(row.getElement());\r\n\r\n\t\t\t\trow.initialize();\r\n\r\n\t\t\t\tif(!row.heightInitialized){\r\n\t\t\t\t\trow.normalizeHeight(true);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowHeight = row.getHeight();\r\n\r\n\t\t\t\tif(i < topPad){\r\n\t\t\t\t\ttopPadHeight += rowHeight;\r\n\t\t\t\t}else{\r\n\t\t\t\t\trowsHeight += rowHeight;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.vDomBottom ++;\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\r\n\t\t\tif(!position){\r\n\t\t\t\tthis.vDomTopPad = 0;\r\n\t\t\t\t//adjust rowheight to match average of rendered elements\r\n\t\t\t\tthis.vDomRowHeight = Math.floor((rowsHeight + topPadHeight) / i);\r\n\t\t\t\tthis.vDomBottomPad = this.vDomRowHeight * (rowsCount - this.vDomBottom -1);\r\n\r\n\t\t\t\tthis.vDomScrollHeight = topPadHeight + rowsHeight + this.vDomBottomPad - containerHeight;\r\n\t\t\t}else{\r\n\t\t\t\tthis.vDomTopPad = !forceMove ? this.scrollTop - topPadHeight : (this.vDomRowHeight * this.vDomTop) + offset;\r\n\t\t\t\tthis.vDomBottomPad = this.vDomBottom == rowsCount-1 ? 0 : Math.max(this.vDomScrollHeight - this.vDomTopPad - rowsHeight - topPadHeight, 0);\r\n\t\t\t}\r\n\r\n\t\t\telement.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\telement.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\r\n\t\t\tif(forceMove){\r\n\t\t\t\tthis.scrollTop = this.vDomTopPad + (topPadHeight) + offset - (this.elementVertical.scrollWidth > this.elementVertical.clientWidth ? this.elementVertical.offsetHeight - containerHeight : 0);\r\n\t\t\t}\r\n\r\n\t\t\tthis.scrollTop = Math.min(this.scrollTop, this.elementVertical.scrollHeight - containerHeight);\r\n\r\n\t\t\t//adjust for horizontal scrollbar if present (and not at top of table)\r\n\t\t\tif(this.elementVertical.scrollWidth > this.elementVertical.offsetWidth && forceMove){\r\n\t\t\t\tthis.scrollTop += this.elementVertical.offsetHeight - containerHeight;\r\n\t\t\t}\r\n\r\n\t\t\tthis.vDomScrollPosTop = this.scrollTop;\r\n\t\t\tthis.vDomScrollPosBottom = this.scrollTop;\r\n\r\n\t\t\tholder.scrollTop = this.scrollTop;\r\n\r\n\t\t\tthis.dispatch(\"render-virtual-fill\");\r\n\t\t}\r\n\t}\r\n\r\n\t_addTopRow(rows, fillableSpace){\r\n\t\tvar table = this.tableElement,\r\n\t\taddedRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\tindex = this.vDomTop -1,\r\n\t\ti = 0;\r\n\r\n\t\twhile(true){\r\n\t\t\tif(this.vDomTop){\r\n\t\t\t\tlet row = rows[index],\r\n\t\t\t\trowHeight, initialized;\r\n\r\n\t\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\t\t\t\t\tinitialized = row.initialized;\r\n\r\n\t\t\t\t\tif(fillableSpace >= rowHeight){\r\n\r\n\t\t\t\t\t\tthis.styleRow(row, index);\r\n\t\t\t\t\t\ttable.insertBefore(row.getElement(), table.firstChild);\r\n\r\n\t\t\t\t\t\tif(!row.initialized || !row.heightInitialized){\r\n\t\t\t\t\t\t\taddedRows.push(row);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\trow.initialize();\r\n\r\n\t\t\t\t\t\tif(!initialized){\r\n\t\t\t\t\t\t\trowHeight = row.getElement().offsetHeight;\r\n\r\n\t\t\t\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\t\tthis.vDomTop--;\r\n\t\t\t\t\t\tindex--;\r\n\t\t\t\t\t\ti++;\r\n\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of addedRows){\r\n\t\t\trow.clearCellHeight();\r\n\t\t}\r\n\r\n\t\tthis._quickNormalizeRowHeight(addedRows);\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomTopPad -= paddingAdjust;\r\n\r\n\t\t\tif(this.vDomTopPad < 0){\r\n\t\t\t\tthis.vDomTopPad = index * this.vDomRowHeight;\r\n\t\t\t}\r\n\r\n\t\t\tif(index < 1){\r\n\t\t\t\tthis.vDomTopPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\ttable.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\tthis.vDomScrollPosTop -= paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_removeTopRow(rows, fillableSpace){\r\n\t\tvar removableRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\ti = 0;\r\n\r\n\t\twhile(true){\r\n\t\t\tlet row = rows[this.vDomTop],\r\n\t\t\trowHeight, diff;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\t\t\t\t\tthis.vDomTop++;\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tremovableRows.push(row);\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of removableRows){\r\n\t\t\tlet rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomTopPad += paddingAdjust;\r\n\t\t\tthis.tableElement.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\tthis.vDomScrollPosTop += this.vDomTop ? paddingAdjust : paddingAdjust + this.vDomWindowBuffer;\r\n\t\t}\r\n\t}\r\n\r\n\t_addBottomRow(rows, fillableSpace){\r\n\t\tvar table = this.tableElement,\r\n\t\taddedRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\tindex = this.vDomBottom + 1,\r\n\t\ti = 0;\r\n\r\n\t\twhile(true){\r\n\t\t\tlet row = rows[index],\r\n\t\t\trowHeight, initialized;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\t\t\t\tinitialized = row.initialized;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\r\n\t\t\t\t\tthis.styleRow(row, index);\r\n\t\t\t\t\ttable.appendChild(row.getElement());\r\n\r\n\t\t\t\t\tif(!row.initialized || !row.heightInitialized){\r\n\t\t\t\t\t\taddedRows.push(row);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\trow.initialize();\r\n\r\n\t\t\t\t\tif(!initialized){\r\n\t\t\t\t\t\trowHeight = row.getElement().offsetHeight;\r\n\r\n\t\t\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tthis.vDomBottom++;\r\n\t\t\t\t\tindex++;\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of addedRows){\r\n\t\t\trow.clearCellHeight();\r\n\t\t}\r\n\r\n\t\tthis._quickNormalizeRowHeight(addedRows);\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomBottomPad -= paddingAdjust;\r\n\r\n\t\t\tif(this.vDomBottomPad < 0 || index == rows.length -1){\r\n\t\t\t\tthis.vDomBottomPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\ttable.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\t\t\tthis.vDomScrollPosBottom += paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_removeBottomRow(rows, fillableSpace){\r\n\t\tvar removableRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\ti = 0;\r\n\r\n\t\twhile(true){\r\n\t\t\tlet row = rows[this.vDomBottom],\r\n\t\t\trowHeight, diff;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\t\t\t\t\tthis.vDomBottom --;\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tremovableRows.push(row);\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of removableRows){\r\n\t\t\tlet rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomBottomPad += paddingAdjust;\r\n\r\n\t\t\tif(this.vDomBottomPad < 0){\r\n\t\t\t\tthis.vDomBottomPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\tthis.tableElement.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\t\t\tthis.vDomScrollPosBottom -= paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_quickNormalizeRowHeight(rows){\r\n\t\tfor(let row of rows){\r\n\t\t\trow.calcHeight();\r\n\t\t}\r\n\r\n\t\tfor(let row of rows){\r\n\t\t\trow.setCellHeight();\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Row from './row/Row.js';\r\nimport RowComponent from './row/RowComponent.js';\r\nimport Helpers from './tools/Helpers.js';\r\n\r\nimport RendererBasicVertical from './rendering/renderers/BasicVertical.js';\r\nimport RendererVirtualDomVertical from './rendering/renderers/VirtualDomVertical.js';\r\n\r\nexport default class RowManager extends CoreFeature{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.element = this.createHolderElement(); //containing element\r\n\t\tthis.tableElement = this.createTableElement(); //table element\r\n\t\tthis.heightFixer = this.createTableElement(); //table element\r\n\t\tthis.placeholder = null; //placeholder element\r\n\t\tthis.placeholderContents = null; //placeholder element\r\n\t\t\r\n\t\tthis.firstRender = false; //handle first render\r\n\t\tthis.renderMode = \"virtual\"; //current rendering mode\r\n\t\tthis.fixedHeight = false; //current rendering mode\r\n\t\t\r\n\t\tthis.rows = []; //hold row data objects\r\n\t\tthis.activeRowsPipeline = []; //hold calculation of active rows\r\n\t\tthis.activeRows = []; //rows currently available to on display in the table\r\n\t\tthis.activeRowsCount = 0; //count of active rows\r\n\t\t\r\n\t\tthis.displayRows = []; //rows currently on display in the table\r\n\t\tthis.displayRowsCount = 0; //count of display rows\r\n\t\t\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.rowNumColumn = false; //hold column component for row number column\r\n\t\t\r\n\t\tthis.redrawBlock = false; //prevent redraws to allow multiple data manipulations before continuing\r\n\t\tthis.redrawBlockRestoreConfig = false; //store latest redraw function calls for when redraw is needed\r\n\t\tthis.redrawBlockRenderInPosition = false; //store latest redraw function calls for when redraw is needed\r\n\t\t\r\n\t\tthis.dataPipeline = []; //hold data pipeline tasks\r\n\t\tthis.displayPipeline = []; //hold data display pipeline tasks\r\n\t\t\r\n\t\tthis.renderer = null;\r\n\t}\r\n\t\r\n\t//////////////// Setup Functions /////////////////\r\n\t\r\n\tcreateHolderElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-tableholder\");\r\n\t\tel.setAttribute(\"tabindex\", 0);\r\n\t\tel.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tcreateTableElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-table\");\r\n\t\tel.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tinitializePlaceholder(){\r\n\t\t//configure placeholder element\r\n\t\tif(typeof this.table.options.placeholder == \"string\"){\r\n\t\t\tlet el = document.createElement(\"div\");\r\n\t\t\tel.classList.add(\"tabulator-placeholder\");\r\n\t\t\t\r\n\t\t\tlet contents = document.createElement(\"div\");\r\n\t\t\tcontents.classList.add(\"tabulator-placeholder-contents\");\r\n\t\t\tcontents.innerHTML = this.table.options.placeholder;\r\n\t\t\t\r\n\t\t\tel.appendChild(contents);\r\n\t\t\t\r\n\t\t\tthis.placeholderContents = contents;\r\n\t\t\tthis.placeholder = el;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return containing element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\t//return table element\r\n\tgetTableElement(){\r\n\t\treturn this.tableElement;\r\n\t}\r\n\t\r\n\t//return position of row in table\r\n\tgetRowPosition(row, active){\r\n\t\tif(active){\r\n\t\t\treturn this.activeRows.indexOf(row);\r\n\t\t}else{\r\n\t\t\treturn this.rows.indexOf(row);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.initializePlaceholder()\r\n\t\tthis.initializeRenderer();\r\n\t\t\r\n\t\t//initialize manager\r\n\t\tthis.element.appendChild(this.tableElement);\r\n\t\t\r\n\t\tthis.firstRender = true;\r\n\t\t\r\n\t\t//scroll header along with table body\r\n\t\tthis.element.addEventListener(\"scroll\", () => {\r\n\t\t\tvar left = this.element.scrollLeft,\r\n\t\t\tleftDir = this.scrollLeft > left,\r\n\t\t\ttop = this.element.scrollTop,\r\n\t\t\ttopDir = this.scrollTop > top;\r\n\t\t\t\r\n\t\t\t//handle horizontal scrolling\r\n\t\t\tif(this.scrollLeft != left){\r\n\t\t\t\tthis.scrollLeft = left;\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"scroll-horizontal\", left, leftDir);\r\n\t\t\t\tthis.dispatchExternal(\"scrollHorizontal\", left, leftDir);\r\n\r\n\t\t\t\tthis._positionPlaceholder();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//handle vertical scrolling\r\n\t\t\tif(this.scrollTop != top){\r\n\t\t\t\tthis.scrollTop = top;\r\n\t\t\t\t\r\n\t\t\t\tthis.renderer.scrollRows(top, topDir);\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"scroll-vertical\", top, topDir);\r\n\t\t\t\tthis.dispatchExternal(\"scrollVertical\", top, topDir);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t////////////////// Row Manipulation //////////////////\r\n\tfindRow(subject){\r\n\t\tif(typeof subject == \"object\"){\r\n\t\t\tif(subject instanceof Row){\r\n\t\t\t\t//subject is row element\r\n\t\t\t\treturn subject;\r\n\t\t\t}else if(subject instanceof RowComponent){\r\n\t\t\t\t//subject is public row component\r\n\t\t\t\treturn subject._getSelf() || false;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\t\t\t\t//subject is a HTML element of the row\r\n\t\t\t\tlet match = this.rows.find((row) => {\r\n\t\t\t\t\treturn row.getElement() === subject;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\treturn match || false;\r\n\t\t\t}\r\n\t\t}else if(typeof subject == \"undefined\" || subject === null){\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the index of the row\r\n\t\t\tlet match = this.rows.find((row) => {\r\n\t\t\t\treturn row.data[this.table.options.index] == subject;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\treturn match || false;\r\n\t\t}\r\n\t\t\r\n\t\t//catch all for any other type of input\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tgetRowFromDataObject(data){\r\n\t\tvar match = this.rows.find((row) => {\r\n\t\t\treturn row.data === data;\r\n\t\t});\r\n\t\t\r\n\t\treturn match || false;\r\n\t}\r\n\t\r\n\tgetRowFromPosition(position, active){\r\n\t\tif(active){\r\n\t\t\treturn this.activeRows[position];\r\n\t\t}else{\r\n\t\t\treturn this.rows[position];\r\n\t\t}\r\n\t}\r\n\t\r\n\tscrollToRow(row, position, ifVisible){\r\n\t\treturn this.renderer.scrollToRowPosition(row, position, ifVisible);\r\n\t}\r\n\t\r\n\t////////////////// Data Handling //////////////////\r\n\tsetData(data, renderInPosition, columnsChanged){\r\n\t\treturn new Promise((resolve, reject)=>{\r\n\t\t\tif(renderInPosition && this.getDisplayRows().length){\r\n\t\t\t\tif(this.table.options.pagination){\r\n\t\t\t\t\tthis._setDataActual(data, true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.reRenderInPosition(() => {\r\n\t\t\t\t\t\tthis._setDataActual(data);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.options.autoColumns && columnsChanged && this.table.initialized){\r\n\t\t\t\t\tthis.table.columnManager.generateColumnsFromRowData(data);\r\n\t\t\t\t}\r\n\t\t\t\tthis.resetScroll();\r\n\t\t\t\t\r\n\t\t\t\tthis._setDataActual(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\t\r\n\t_setDataActual(data, renderInPosition){\r\n\t\tthis.dispatchExternal(\"dataProcessing\", data);\r\n\t\t\r\n\t\tthis._wipeElements();\r\n\t\t\r\n\t\tif(Array.isArray(data)){\r\n\t\t\tthis.dispatch(\"data-processing\", data);\r\n\t\t\t\r\n\t\t\tdata.forEach((def, i) => {\r\n\t\t\t\tif(def && typeof def === \"object\"){\r\n\t\t\t\t\tvar row = new Row(def, this);\r\n\t\t\t\t\tthis.rows.push(row);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Data Loading Warning - Invalid row data detected and ignored, expecting object but received:\", def);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.refreshActiveData(false, false, renderInPosition);\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"data-processed\", data);\r\n\t\t\tthis.dispatchExternal(\"dataProcessed\", data);\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Data Loading Error - Unable to process data due to invalid data type \\nExpecting: array \\nReceived: \", typeof data, \"\\nData: \", data);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_wipeElements(){\r\n\t\tthis.dispatch(\"rows-wipe\");\r\n\t\t\r\n\t\tthis.rows.forEach((row) => {\r\n\t\t\trow.wipe();\r\n\t\t});\r\n\t\t\r\n\t\tthis.rows = [];\r\n\t\tthis.activeRows = [];\r\n\t\tthis.activeRowsPipeline = [];\r\n\t\tthis.activeRowsCount = 0;\r\n\t\tthis.displayRows = [];\r\n\t\tthis.displayRowsCount = 0;\r\n\t\t\r\n\t\tthis.adjustTableSize();\r\n\t}\r\n\t\r\n\tdeleteRow(row, blockRedraw){\r\n\t\tvar allIndex = this.rows.indexOf(row),\r\n\t\tactiveIndex = this.activeRows.indexOf(row);\r\n\t\t\r\n\t\tif(activeIndex > -1){\r\n\t\t\tthis.activeRows.splice(activeIndex, 1);\r\n\t\t}\r\n\t\t\r\n\t\tif(allIndex > -1){\r\n\t\t\tthis.rows.splice(allIndex, 1);\r\n\t\t}\r\n\t\t\r\n\t\tthis.setActiveRows(this.activeRows);\r\n\t\t\r\n\t\tthis.displayRowIterator((rows) => {\r\n\t\t\tvar displayIndex = rows.indexOf(row);\r\n\t\t\t\r\n\t\t\tif(displayIndex > -1){\r\n\t\t\t\trows.splice(displayIndex, 1);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t}\r\n\t\t\r\n\t\tthis.regenerateRowNumbers();\r\n\t\t\r\n\t\tthis.dispatchExternal(\"rowDeleted\", row.getComponent());\r\n\t\t\r\n\t\tif(!this.displayRowsCount){\r\n\t\t\tthis._showPlaceholder();\r\n\t\t}\r\n\t\t\r\n\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\tthis.dispatchExternal(\"dataChanged\", this.getData());\r\n\t\t}\r\n\t}\r\n\t\r\n\taddRow(data, pos, index, blockRedraw){\r\n\t\tvar row = this.addRowActual(data, pos, index, blockRedraw);\r\n\t\treturn row;\r\n\t}\r\n\t\r\n\t//add multiple rows\r\n\taddRows(data, pos, index){\r\n\t\tvar length = 0,\r\n\t\trows = [];\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tpos = this.findAddRowPos(pos);\r\n\t\t\t\r\n\t\t\tif(!Array.isArray(data)){\r\n\t\t\t\tdata = [data];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tlength = data.length - 1;\r\n\t\t\t\r\n\t\t\tif((typeof index == \"undefined\" && pos) || (typeof index !== \"undefined\" && !pos)){\r\n\t\t\t\tdata.reverse();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdata.forEach((item, i) => {\r\n\t\t\t\tvar row = this.addRow(item, pos, index, true);\r\n\t\t\t\trows.push(row);\r\n\t\t\t\tthis.dispatch(\"row-added\", row, data, pos, index);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.refreshActiveData(false, false, true);\r\n\t\t\t\r\n\t\t\tthis.regenerateRowNumbers();\r\n\t\t\t\r\n\t\t\tif(rows.length){\r\n\t\t\t\tthis._clearPlaceholder();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve(rows);\r\n\t\t});\r\n\t}\r\n\t\r\n\tfindAddRowPos(pos){\r\n\t\tif(typeof pos === \"undefined\"){\r\n\t\t\tpos = this.table.options.addRowPos;\r\n\t\t}\r\n\t\t\r\n\t\tif(pos === \"pos\"){\r\n\t\t\tpos = true;\r\n\t\t}\r\n\t\t\r\n\t\tif(pos === \"bottom\"){\r\n\t\t\tpos = false;\r\n\t\t}\r\n\t\t\r\n\t\treturn pos;\r\n\t}\r\n\t\r\n\taddRowActual(data, pos, index, blockRedraw){\r\n\t\tvar row = data instanceof Row ? data : new Row(data || {}, this),\r\n\t\ttop = this.findAddRowPos(pos),\r\n\t\tallIndex = -1,\r\n\t\tactiveIndex, chainResult;\r\n\t\t\r\n\t\tif(!index){\r\n\t\t\tchainResult = this.chain(\"row-adding-position\", [row, top], null, {index, top});\r\n\t\t\t\r\n\t\t\tindex = chainResult.index;\r\n\t\t\ttop = chainResult.top;\r\n\t\t}\r\n\t\t\r\n\t\tif(typeof index !== \"undefined\"){\r\n\t\t\tindex = this.findRow(index);\r\n\t\t}\r\n\t\t\r\n\t\tindex = this.chain(\"row-adding-index\", [row, index, top], null, index);\r\n\t\t\r\n\t\tif(index){\r\n\t\t\tallIndex = this.rows.indexOf(index);\r\n\t\t}\r\n\t\t\r\n\t\tif(index && allIndex > -1){\r\n\t\t\tactiveIndex = this.activeRows.indexOf(index);\r\n\t\t\t\r\n\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\tvar displayIndex = rows.indexOf(index);\r\n\t\t\t\t\r\n\t\t\t\tif(displayIndex > -1){\r\n\t\t\t\t\trows.splice((top ? displayIndex : displayIndex + 1), 0, row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(activeIndex > -1){\r\n\t\t\t\tthis.activeRows.splice((top ? activeIndex : activeIndex + 1), 0, row);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.rows.splice((top ? allIndex : allIndex + 1), 0, row);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tif(top){\r\n\t\t\t\t\r\n\t\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\t\trows.unshift(row);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.activeRows.unshift(row);\r\n\t\t\t\tthis.rows.unshift(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\t\trows.push(row);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.activeRows.push(row);\r\n\t\t\t\tthis.rows.push(row);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.setActiveRows(this.activeRows);\r\n\t\t\r\n\t\tthis.dispatchExternal(\"rowAdded\", row.getComponent());\r\n\t\t\r\n\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t}\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t}\r\n\t\t\r\n\t\treturn row;\r\n\t}\r\n\t\r\n\tmoveRow(from, to, after){\r\n\t\tthis.dispatch(\"row-move\", from, to, after);\r\n\t\t\r\n\t\tthis.moveRowActual(from, to, after);\r\n\t\t\r\n\t\tthis.regenerateRowNumbers();\r\n\t\t\r\n\t\tthis.dispatch(\"row-moved\", from, to, after);\r\n\t\tthis.dispatchExternal(\"rowMoved\", from.getComponent());\r\n\t}\r\n\t\r\n\tmoveRowActual(from, to, after){\r\n\t\tthis.moveRowInArray(this.rows, from, to, after);\r\n\t\tthis.moveRowInArray(this.activeRows, from, to, after);\r\n\t\t\r\n\t\tthis.displayRowIterator((rows) => {\r\n\t\t\tthis.moveRowInArray(rows, from, to, after);\r\n\t\t});\r\n\t\t\r\n\t\tthis.dispatch(\"row-moving\", from, to, after);\r\n\t}\r\n\t\r\n\tmoveRowInArray(rows, from, to, after){\r\n\t\tvar\tfromIndex, toIndex, start, end;\r\n\t\t\r\n\t\tif(from !== to){\r\n\t\t\t\r\n\t\t\tfromIndex = rows.indexOf(from);\r\n\t\t\t\r\n\t\t\tif (fromIndex > -1) {\r\n\t\t\t\t\r\n\t\t\t\trows.splice(fromIndex, 1);\r\n\t\t\t\t\r\n\t\t\t\ttoIndex = rows.indexOf(to);\r\n\t\t\t\t\r\n\t\t\t\tif (toIndex > -1) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(after){\r\n\t\t\t\t\t\trows.splice(toIndex+1, 0, from);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trows.splice(toIndex, 0, from);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\trows.splice(fromIndex, 0, from);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//restyle rows\r\n\t\t\tif(rows === this.getDisplayRows()){\r\n\t\t\t\t\r\n\t\t\t\tstart = fromIndex < toIndex ? fromIndex : toIndex;\r\n\t\t\t\tend = toIndex > fromIndex ? toIndex : fromIndex +1;\r\n\t\t\t\t\r\n\t\t\t\tfor(let i = start; i <= end; i++){\r\n\t\t\t\t\tif(rows[i]){\r\n\t\t\t\t\t\tthis.styleRow(rows[i], i);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearData(){\r\n\t\tthis.setData([]);\r\n\t}\r\n\t\r\n\tgetRowIndex(row){\r\n\t\treturn this.findRowIndex(row, this.rows);\r\n\t}\r\n\t\r\n\tgetDisplayRowIndex(row){\r\n\t\tvar index = this.getDisplayRows().indexOf(row);\r\n\t\treturn index > -1 ? index : false;\r\n\t}\r\n\t\r\n\tnextDisplayRow(row, rowOnly){\r\n\t\tvar index = this.getDisplayRowIndex(row),\r\n\t\tnextRow = false;\r\n\t\t\r\n\t\t\r\n\t\tif(index !== false && index < this.displayRowsCount -1){\r\n\t\t\tnextRow = this.getDisplayRows()[index+1];\r\n\t\t}\r\n\t\t\r\n\t\tif(nextRow && (!(nextRow instanceof Row) || nextRow.type != \"row\")){\r\n\t\t\treturn this.nextDisplayRow(nextRow, rowOnly);\r\n\t\t}\r\n\t\t\r\n\t\treturn nextRow;\r\n\t}\r\n\t\r\n\tprevDisplayRow(row, rowOnly){\r\n\t\tvar index = this.getDisplayRowIndex(row),\r\n\t\tprevRow = false;\r\n\t\t\r\n\t\tif(index){\r\n\t\t\tprevRow = this.getDisplayRows()[index-1];\r\n\t\t}\r\n\t\t\r\n\t\tif(rowOnly && prevRow && (!(prevRow instanceof Row) || prevRow.type != \"row\")){\r\n\t\t\treturn this.prevDisplayRow(prevRow, rowOnly);\r\n\t\t}\r\n\t\t\r\n\t\treturn prevRow;\r\n\t}\r\n\t\r\n\tfindRowIndex(row, list){\r\n\t\tvar rowIndex;\r\n\t\t\r\n\t\trow = this.findRow(row);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\trowIndex = list.indexOf(row);\r\n\t\t\t\r\n\t\t\tif(rowIndex > -1){\r\n\t\t\t\treturn rowIndex;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tgetData(active, transform){\r\n\t\tvar output = [],\r\n\t\trows = this.getRows(active);\r\n\t\t\r\n\t\trows.forEach(function(row){\r\n\t\t\tif(row.type == \"row\"){\r\n\t\t\t\toutput.push(row.getData(transform || \"data\"));\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetComponents(active){\r\n\t\tvar\toutput = [],\r\n\t\trows = this.getRows(active);\r\n\t\t\r\n\t\trows.forEach(function(row){\r\n\t\t\toutput.push(row.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetDataCount(active){\r\n\t\tvar rows = this.getRows(active);\r\n\t\t\r\n\t\treturn rows.length;\r\n\t}\r\n\t\r\n\tscrollHorizontal(left){\r\n\t\tthis.scrollLeft = left;\r\n\t\tthis.element.scrollLeft = left;\r\n\t\t\r\n\t\tthis.dispatch(\"scroll-horizontal\", left);\r\n\t}\r\n\t\r\n\tregisterDataPipelineHandler(handler, priority){\r\n\t\tif(typeof priority !== \"undefined\"){\r\n\t\t\tthis.dataPipeline.push({handler, priority})\r\n\t\t\tthis.dataPipeline.sort((a, b) => {\r\n\t\t\t\treturn a.priority - b.priority;\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Data pipeline handlers must have a priority in order to be registered\")\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterDisplayPipelineHandler(handler, priority){\r\n\t\tif(typeof priority !== \"undefined\"){\r\n\t\t\tthis.displayPipeline.push({handler, priority})\r\n\t\t\tthis.displayPipeline.sort((a, b) => {\r\n\t\t\t\treturn a.priority - b.priority;\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Display pipeline handlers must have a priority in order to be registered\")\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set active data set\r\n\trefreshActiveData(handler, skipStage, renderInPosition){\r\n\t\tvar table = this.table,\r\n\t\tstage = \"\",\r\n\t\tindex = 0,\r\n\t\tcascadeOrder = [\"all\", \"dataPipeline\", \"display\", \"displayPipeline\", \"end\"],\r\n\t\tdisplayIndex;\r\n\t\t\r\n\t\t\r\n\t\tif(typeof handler === \"function\"){\r\n\t\t\tindex = this.dataPipeline.findIndex((item) => {\r\n\t\t\t\treturn item.handler === handler;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tstage = \"dataPipeline\";\r\n\t\t\t\t\r\n\t\t\t\tif(skipStage){\r\n\t\t\t\t\tif(index == this.dataPipeline.length - 1){\r\n\t\t\t\t\t\tstage = \"display\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tindex = this.displayPipeline.findIndex((item) => {\r\n\t\t\t\t\treturn item.handler === handler;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tstage = \"displayPipeline\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(skipStage){\r\n\t\t\t\t\t\tif(index == this.displayPipeline.length - 1){\r\n\t\t\t\t\t\t\tstage = \"end\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.error(\"Unable to refresh data, invalid handler provided\", handler)\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tstage = handler || \"all\";\r\n\t\t\tindex = 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.redrawBlock){\r\n\t\t\tif(!this.redrawBlockRestoreConfig || (this.redrawBlockRestoreConfig && ((this.redrawBlockRestoreConfig.stage === stage && index < this.redrawBlockRestoreConfig.index) || (cascadeOrder.indexOf(stage) < cascadeOrder.indexOf(this.redrawBlockRestoreConfig.stage))))){\r\n\t\t\t\tthis.redrawBlockRestoreConfig = {\r\n\t\t\t\t\thandler: handler,\r\n\t\t\t\t\tskipStage: skipStage,\r\n\t\t\t\t\trenderInPosition: renderInPosition,\r\n\t\t\t\t\tstage:stage,\r\n\t\t\t\t\tindex:index,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn;\r\n\t\t}else{\r\n\t\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\t\tif(renderInPosition){\r\n\t\t\t\t\tthis.reRenderInPosition(this.refreshPipelines.bind(this, handler, stage, index, renderInPosition));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!handler){\r\n\t\t\t\t\t\tthis.table.columnManager.renderer.renderColumns();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.renderTable();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(table.options.layoutColumnsOnNewData){\r\n\t\t\t\t\t\tthis.table.columnManager.redraw(true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"data-refreshed\");\r\n\t\t}\r\n\t}\r\n\t\r\n\trefreshPipelines(handler, stage, index, renderInPosition){\r\n\t\tthis.dispatch(\"data-refreshing\");\r\n\t\t\r\n\t\tif(!handler){\r\n\t\t\tthis.activeRowsPipeline[0] = this.rows.slice(0);\r\n\t\t}\r\n\t\t\r\n\t\t//cascade through data refresh stages\r\n\t\tswitch(stage){\r\n\t\t\tcase \"all\":\r\n\t\t\t//handle case where alldata needs refreshing\r\n\t\t\t\r\n\t\t\tcase \"dataPipeline\":\r\n\t\t\t\r\n\t\t\tfor(let i = index; i < this.dataPipeline.length; i++){\r\n\t\t\t\tlet result = this.dataPipeline[i].handler(this.activeRowsPipeline[i].slice(0));\r\n\t\t\t\t\r\n\t\t\t\tthis.activeRowsPipeline[i + 1] = result || this.activeRowsPipeline[i].slice(0);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.setActiveRows(this.activeRowsPipeline[this.dataPipeline.length]);\r\n\t\t\t\r\n\t\t\tthis.regenerateRowNumbers();\r\n\t\t\t\r\n\t\t\tcase \"display\":\r\n\t\t\tindex = 0;\r\n\t\t\tthis.resetDisplayRows();\r\n\t\t\t\r\n\t\t\tcase \"displayPipeline\":\r\n\t\t\tfor(let i = index; i < this.displayPipeline.length; i++){\r\n\t\t\t\tlet result = this.displayPipeline[i].handler((i ? this.getDisplayRows(i - 1) : this.activeRows).slice(0), renderInPosition);\r\n\t\t\t\t\r\n\t\t\t\tthis.setDisplayRows(result || this.getDisplayRows(i - 1).slice(0), i);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase \"end\":\r\n\t\t\t//case to handle scenario when trying to skip past end stage\r\n\t\t}\r\n\t}\r\n\t\r\n\t//regenerate row numbers for row number formatter if in use\r\n\tregenerateRowNumbers(){\r\n\t\tif(this.rowNumColumn){\r\n\t\t\tthis.activeRows.forEach((row) => {\r\n\t\t\t\tvar cell = row.getCell(this.rowNumColumn);\r\n\t\t\t\t\r\n\t\t\t\tif(cell){\r\n\t\t\t\t\tcell._generateContents();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetActiveRows(activeRows){\r\n\t\tthis.activeRows = activeRows;\r\n\t\tthis.activeRowsCount = this.activeRows.length;\r\n\t}\r\n\t\r\n\t//reset display rows array\r\n\tresetDisplayRows(){\r\n\t\tthis.displayRows = [];\r\n\t\t\r\n\t\tthis.displayRows.push(this.activeRows.slice(0));\r\n\t\t\r\n\t\tthis.displayRowsCount = this.displayRows[0].length;\r\n\t}\r\n\t\r\n\tgetNextDisplayIndex(){\r\n\t\treturn this.displayRows.length;\r\n\t}\r\n\t\r\n\t//set display row pipeline data\r\n\tsetDisplayRows(displayRows, index){\r\n\t\t\r\n\t\tvar output = true;\r\n\t\t\r\n\t\tif(index && typeof this.displayRows[index] != \"undefined\"){\r\n\t\t\tthis.displayRows[index] = displayRows;\r\n\t\t\toutput = true;\r\n\t\t}else{\r\n\t\t\tthis.displayRows.push(displayRows)\r\n\t\t\toutput = index = this.displayRows.length -1;\r\n\t\t}\r\n\t\t\r\n\t\tif(index == this.displayRows.length -1){\r\n\t\t\tthis.displayRowsCount = this.displayRows[this.displayRows.length -1].length;\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetDisplayRows(index){\r\n\t\tif(typeof index == \"undefined\"){\r\n\t\t\treturn this.displayRows.length ? this.displayRows[this.displayRows.length -1] : [];\r\n\t\t}else{\r\n\t\t\treturn this.displayRows[index] || [];\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetVisibleRows(chain, viewable){\r\n\t\tvar rows = Object.assign([], this.renderer.visibleRows(!viewable));\r\n\t\t\r\n\t\tif(chain){\r\n\t\t\trows = this.chain(\"rows-visible\", [viewable], rows, rows);\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t//repeat action accross display rows\r\n\tdisplayRowIterator(callback){\r\n\t\tthis.activeRowsPipeline.forEach(callback);\r\n\t\tthis.displayRows.forEach(callback);\r\n\t\t\r\n\t\tthis.displayRowsCount = this.displayRows[this.displayRows.length -1].length;\r\n\t}\r\n\t\r\n\t//return only actual rows (not group headers etc)\r\n\tgetRows(type){\r\n\t\tvar rows;\r\n\t\t\r\n\t\tswitch(type){\r\n\t\t\tcase \"active\":\r\n\t\t\trows = this.activeRows;\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"display\":\r\n\t\t\trows = this.table.rowManager.getDisplayRows();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"visible\":\r\n\t\t\trows = this.getVisibleRows(false, true);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\trows = this.chain(\"rows-retrieve\", type, null, this.rows) || this.rows;\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t///////////////// Table Rendering /////////////////\r\n\t//trigger rerender of table in current position\r\n\treRenderInPosition(callback){\r\n\t\tif(this.redrawBlock){\r\n\t\t\tif(callback){\r\n\t\t\t\tcallback();\r\n\t\t\t}else{\r\n\t\t\t\tthis.redrawBlockRenderInPosition = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"renderStarted\");\r\n\t\t\tthis.renderer.rerenderRows(callback);\r\n\t\t\tthis.dispatchExternal(\"renderComplete\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeRenderer(){\r\n\t\tvar renderClass;\r\n\t\t\r\n\t\tvar renderers = {\r\n\t\t\t\"virtual\": RendererVirtualDomVertical,\r\n\t\t\t\"basic\": RendererBasicVertical,\r\n\t\t};\r\n\t\t\r\n\t\tif(typeof this.table.options.renderVertical === \"string\"){\r\n\t\t\trenderClass = renderers[this.table.options.renderVertical];\r\n\t\t}else{\r\n\t\t\trenderClass = this.table.options.renderVertical;\r\n\t\t}\r\n\t\t\r\n\t\tif(renderClass){\r\n\t\t\tthis.renderer = new renderClass(this.table, this.element, this.tableElement);\r\n\t\t\tthis.renderer.initialize();\r\n\t\t\t\r\n\t\t\tif((this.table.element.clientHeight || this.table.options.height)){\r\n\t\t\t\tthis.fixedHeight = true;\r\n\t\t\t}else{\r\n\t\t\t\tthis.fixedHeight = false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Unable to find matching renderer:\", table.options.renderVertical);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRenderMode(){\r\n\t\treturn this.renderMode;\r\n\t}\r\n\t\r\n\trenderTable(){\r\n\t\tthis.dispatchExternal(\"renderStarted\");\r\n\t\t\r\n\t\tthis.element.scrollTop = 0;\r\n\t\t\r\n\t\tthis._clearTable();\r\n\t\t\r\n\t\tif(this.displayRowsCount){\r\n\t\t\tthis.renderer.renderRows();\r\n\t\t\t\r\n\t\t\tif(this.firstRender){\r\n\t\t\t\tthis.firstRender = false;\r\n\t\t\t\tthis.layoutRefresh();\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.renderEmptyScroll();\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.fixedHeight){\r\n\t\t\tthis.adjustTableSize();\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatch(\"table-layout\");\r\n\t\t\r\n\t\tif(!this.displayRowsCount){\r\n\t\t\tthis._showPlaceholder();\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatchExternal(\"renderComplete\");\r\n\t}\r\n\t\r\n\t//show scrollbars on empty table div\r\n\trenderEmptyScroll(){\r\n\t\tif(this.placeholder){\r\n\t\t\tthis.tableElement.style.display = \"none\";\r\n\t\t}else{\r\n\t\t\tthis.tableElement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t\t// this.tableElement.style.minHeight = \"1px\";\r\n\t\t\t// this.tableElement.style.visibility = \"hidden\";\r\n\t\t}\r\n\t}\r\n\t\r\n\t_clearTable(){\r\n\t\tvar element = this.tableElement;\r\n\t\t\r\n\t\tthis._clearPlaceholder();\r\n\t\t\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.renderer.clearRows();\r\n\t}\r\n\t\r\n\t_showPlaceholder(){\r\n\t\tif(this.placeholder){\r\n\t\t\tthis.placeholder.setAttribute(\"tabulator-render-mode\", this.renderMode);\r\n\t\t\t\r\n\t\t\tthis.getElement().appendChild(this.placeholder);\r\n\t\t\tthis._positionPlaceholder();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_clearPlaceholder(){\r\n\t\tif(this.placeholder && this.placeholder.parentNode){\r\n\t\t\tthis.placeholder.parentNode.removeChild(this.placeholder);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_positionPlaceholder(){\r\n\t\tif(this.placeholder && this.placeholder.parentNode){\r\n\t\t\tthis.placeholder.style.width = this.table.columnManager.getWidth() + \"px\";\r\n\t\t\tthis.placeholderContents.style.width = this.table.rowManager.element.clientWidth + \"px\";\r\n\t\t\tthis.placeholderContents.style.marginLeft = this.scrollLeft + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tstyleRow(row, index){\r\n\t\tvar rowEl = row.getElement();\r\n\t\t\r\n\t\tif(index % 2){\r\n\t\t\trowEl.classList.add(\"tabulator-row-even\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-odd\");\r\n\t\t}else{\r\n\t\t\trowEl.classList.add(\"tabulator-row-odd\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-even\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t//normalize height of active rows\r\n\tnormalizeHeight(){\r\n\t\tthis.activeRows.forEach(function(row){\r\n\t\t\trow.normalizeHeight();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//adjust the height of the table holder to fit in the Tabulator element\r\n\tadjustTableSize(){\r\n\t\tvar initialHeight = this.element.clientHeight,\r\n\t\tmodExists;\r\n\t\t\r\n\t\tif(this.renderer.verticalFillMode === \"fill\"){\r\n\t\t\tlet otherHeight = Math.floor(this.table.columnManager.getElement().getBoundingClientRect().height + (this.table.footerManager && this.table.footerManager.active && !this.table.footerManager.external ? this.table.footerManager.getElement().getBoundingClientRect().height : 0));\r\n\t\t\t\r\n\t\t\tif(this.fixedHeight){\r\n\t\t\t\tthis.element.style.minHeight = \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t\tthis.element.style.height = \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t\tthis.element.style.maxHeight = \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.element.style.height = \"\";\r\n\t\t\t\tthis.element.style.height = (this.table.element.clientHeight - otherHeight) + \"px\";\r\n\t\t\t\tthis.element.scrollTop = this.scrollTop;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.renderer.resize();\r\n\t\t\t\r\n\t\t\t//check if the table has changed size when dealing with variable height tables\r\n\t\t\tif(!this.fixedHeight && initialHeight != this.element.clientHeight){\r\n\t\t\t\tif(this.subscribed(\"table-resize\")){\r\n\t\t\t\t\tthis.dispatch(\"table-resize\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.redraw();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis._positionPlaceholder();\r\n\t}\r\n\t\r\n\t//renitialize all rows\r\n\treinitialize(){\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\trow.reinitialize(true);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//prevent table from being redrawn\r\n\tblockRedraw (){\r\n\t\tthis.redrawBlock = true;\r\n\t\tthis.redrawBlockRestoreConfig = false;\r\n\t}\r\n\t\r\n\t//restore table redrawing\r\n\trestoreRedraw (){\r\n\t\tthis.redrawBlock = false;\r\n\t\t\r\n\t\tif(this.redrawBlockRestoreConfig){\r\n\t\t\tthis.refreshActiveData(this.redrawBlockRestoreConfig.handler, this.redrawBlockRestoreConfig.skipStage, this.redrawBlockRestoreConfig.renderInPosition)\r\n\t\t\t\r\n\t\t\tthis.redrawBlockRestoreConfig = false;\r\n\t\t}else{\r\n\t\t\tif(this.redrawBlockRenderInPosition){\r\n\t\t\t\tthis.reRenderInPosition();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.redrawBlockRenderInPosition = false;\r\n\t}\r\n\t\r\n\t//redraw table\r\n\tredraw (force){\r\n\t\tvar pos = 0,\r\n\t\tleft = this.scrollLeft;\r\n\t\t\r\n\t\tthis.adjustTableSize();\r\n\t\t\r\n\t\tthis.table.tableWidth = this.table.element.clientWidth;\r\n\t\t\r\n\t\tif(!force){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t\tthis.scrollHorizontal(left);\r\n\t\t}else{\r\n\t\t\tthis.renderTable();\r\n\t\t}\r\n\t}\r\n\t\r\n\tresetScroll(){\r\n\t\tthis.element.scrollLeft = 0;\r\n\t\tthis.element.scrollTop = 0;\r\n\t\t\r\n\t\tif(this.table.browser === \"ie\"){\r\n\t\t\tvar event = document.createEvent(\"Event\");\r\n\t\t\tevent.initEvent(\"scroll\", false, true);\r\n\t\t\tthis.element.dispatchEvent(event);\r\n\t\t}else{\r\n\t\t\tthis.element.dispatchEvent(new Event('scroll'));\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\n\r\nexport default class FooterManager extends CoreFeature{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.active = false;\r\n\t\tthis.element = this.createElement(); //containing element\r\n\t\tthis.containerElement = this.createContainerElement(); //containing element\r\n\t\tthis.external = false;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.initializeElement();\r\n\t}\r\n\r\n\tcreateElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-footer\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\t\r\n\tcreateContainerElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-footer-contents\");\r\n\r\n\t\tthis.element.appendChild(el);\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitializeElement(){\r\n\t\tif(this.table.options.footerElement){\r\n\r\n\t\t\tswitch(typeof this.table.options.footerElement){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tif(this.table.options.footerElement[0] === \"<\"){\r\n\t\t\t\t\tthis.containerElement.innerHTML = this.table.options.footerElement;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.external = true;\r\n\t\t\t\t\tthis.containerElement = document.querySelector(this.table.options.footerElement);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\tthis.element = this.table.options.footerElement;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\tappend(element){\r\n\t\tthis.activate();\r\n\r\n\t\tthis.containerElement.appendChild(element);\r\n\t\tthis.table.rowManager.adjustTableSize();\r\n\t}\r\n\r\n\tprepend(element){\r\n\t\tthis.activate();\r\n\r\n\t\tthis.element.insertBefore(element, this.element.firstChild);\r\n\t\tthis.table.rowManager.adjustTableSize();\r\n\t}\r\n\r\n\tremove(element){\r\n\t\telement.parentNode.removeChild(element);\r\n\t\tthis.deactivate();\r\n\t}\r\n\r\n\tdeactivate(force){\r\n\t\tif(!this.element.firstChild || force){\r\n\t\t\tif(!this.external){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\t\t\tthis.active = false;\r\n\t\t}\r\n\t}\r\n\r\n\tactivate(){\r\n\t\tif(!this.active){\r\n\t\t\tthis.active = true;\r\n\t\t\tif(!this.external){\r\n\t\t\t\tthis.table.element.appendChild(this.getElement());\r\n\t\t\t\tthis.table.element.style.display = '';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tredraw(){\r\n\t\tthis.dispatch(\"footer-redraw\")\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from './Helpers.js';\r\nimport Row from '../row/Row.js';\r\n\r\nexport default class InteractionManager extends CoreFeature {\r\n\t\r\n\tconstructor (table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.el = null;\r\n\t\t\r\n\t\tthis.abortClasses = [\"tabulator-headers\", \"tabulator-table\"];\r\n\t\t\r\n\t\tthis.previousTargets = {};\r\n\t\t\r\n\t\tthis.listeners = [\r\n\t\t\t\"click\",\r\n\t\t\t\"dblclick\",\r\n\t\t\t\"contextmenu\",\r\n\t\t\t\"mouseenter\",\r\n\t\t\t\"mouseleave\",\r\n\t\t\t\"mouseover\",\r\n\t\t\t\"mouseout\",\r\n\t\t\t\"mousemove\",\r\n\t\t\t\"touchstart\",\r\n\t\t\t\"touchend\",\r\n\t\t];\r\n\t\t\r\n\t\tthis.componentMap = {\r\n\t\t\t\"tabulator-cell\":\"cell\",\r\n\t\t\t\"tabulator-row\":\"row\",\r\n\t\t\t\"tabulator-group\":\"group\",\r\n\t\t\t\"tabulator-col\":\"column\",\r\n\t\t};\r\n\t\t\r\n\t\tthis.pseudoTrackers = {\r\n\t\t\t\"row\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"cell\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"group\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"column\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t}\r\n\t\t\r\n\t\tthis.pseudoTracking = false;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.el = this.table.element;\r\n\t\t\r\n\t\tthis.buildListenerMap();\r\n\t\tthis.bindSubscriptionWatchers();\r\n\t}\r\n\t\r\n\tbuildListenerMap(){\r\n\t\tvar listenerMap = {};\r\n\t\t\r\n\t\tthis.listeners.forEach((listener) => {\r\n\t\t\tlistenerMap[listener] = {\r\n\t\t\t\thandler:null,\r\n\t\t\t\tcomponents:[],\r\n\t\t\t}\r\n\t\t})\r\n\t\t\r\n\t\tthis.listeners = listenerMap;\r\n\t}\r\n\t\r\n\tbindPseudoEvents(){\r\n\t\tObject.keys(this.pseudoTrackers).forEach((key) => {\r\n\t\t\tthis.pseudoTrackers[key].subscriber = this.pseudoMouseEnter.bind(this, key);\r\n\t\t\tthis.subscribe(key + \"-mouseover\", this.pseudoTrackers[key].subscriber);\r\n\t\t});\r\n\t\t\r\n\t\tthis.pseudoTracking = true;\r\n\t}\r\n\t\r\n\tpseudoMouseEnter(key, e, target){\r\n\t\tif(this.pseudoTrackers[key].target !== target){\r\n\t\t\t\r\n\t\t\tif(this.pseudoTrackers[key].target){\r\n\t\t\t\tthis.dispatch(key + \"-mouseleave\", e, this.pseudoTrackers[key].target);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.pseudoMouseLeave(key, e);\r\n\t\t\t\r\n\t\t\tthis.pseudoTrackers[key].target = target;\r\n\t\t\t\r\n\t\t\tthis.dispatch(key + \"-mouseenter\", e, target);\r\n\t\t}\r\n\t}\r\n\t\r\n\tpseudoMouseLeave(key, e){\r\n\t\tvar leaveList = Object.keys(this.pseudoTrackers),\r\n\t\tlinkedKeys = {\r\n\t\t\t\"row\":[\"cell\"],\r\n\t\t\t\"cell\":[\"row\"],\r\n\t\t};\r\n\t\t\r\n\t\tleaveList = leaveList.filter((item) => {\r\n\t\t\tvar links = linkedKeys[key];\r\n\t\t\treturn item !== key && (!links || (links && !links.includes(item)));\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\tleaveList.forEach((key) => {\r\n\t\t\tvar target = this.pseudoTrackers[key].target;\r\n\t\t\t\r\n\t\t\tif(this.pseudoTrackers[key].target){\r\n\t\t\t\tthis.dispatch(key + \"-mouseleave\", e, target);\r\n\t\t\t\t\r\n\t\t\t\tthis.pseudoTrackers[key].target = null;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t\r\n\tbindSubscriptionWatchers(){\r\n\t\tvar listeners = Object.keys(this.listeners),\r\n\t\tcomponents = Object.values(this.componentMap);\r\n\t\t\r\n\t\tfor(let comp of components){\r\n\t\t\tfor(let listener of listeners){\r\n\t\t\t\tlet key = comp + \"-\" + listener;\r\n\t\t\t\t\r\n\t\t\t\tthis.subscriptionChange(key, this.subscriptionChanged.bind(this, comp, listener));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.subscribe(\"table-destroy\", this.clearWatchers.bind(this))\r\n\t}\r\n\t\r\n\tsubscriptionChanged(component, key, added){\r\n\t\tvar listener = this.listeners[key].components,\r\n\t\tindex = listener.indexOf(component),\r\n\t\tchanged = false;\r\n\t\t\r\n\t\tif(added){\r\n\t\t\tif(index === -1){\r\n\t\t\t\tlistener.push(component);\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!this.subscribed(component + \"-\" + key)){\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tlistener.splice(index, 1);\r\n\t\t\t\t\tchanged = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif((key === \"mouseenter\" || key === \"mouseleave\") && !this.pseudoTracking){\r\n\t\t\tthis.bindPseudoEvents();\r\n\t\t}\r\n\t\t\r\n\t\tif(changed){\r\n\t\t\tthis.updateEventListeners();\r\n\t\t}\r\n\t}\r\n\t\r\n\tupdateEventListeners(){\r\n\t\tfor(let key in this.listeners){\r\n\t\t\tlet listener = this.listeners[key];\r\n\t\t\t\r\n\t\t\tif(listener.components.length){\r\n\t\t\t\tif(!listener.handler){\r\n\t\t\t\t\tlistener.handler = this.track.bind(this, key);\r\n\t\t\t\t\tthis.el.addEventListener(key, listener.handler)\r\n\t\t\t\t\t// this.el.addEventListener(key, listener.handler, {passive: true})\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(listener.handler){\r\n\t\t\t\t\tthis.el.removeEventListener(key, listener.handler)\r\n\t\t\t\t\tlistener.handler = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\ttrack(type, e){\r\n\t\tvar path = (e.composedPath && e.composedPath()) || e.path;\r\n\t\t\r\n\t\tvar targets = this.findTargets(path);\r\n\t\ttargets = this.bindComponents(type, targets);\r\n\t\t\r\n\t\tthis.triggerEvents(type, e, targets);\r\n\t\t\r\n\t\tif(this.pseudoTracking && (type == \"mouseover\" || type == \"mouseleave\") && !Object.keys(targets).length){\r\n\t\t\tthis.pseudoMouseLeave(\"none\", e);\r\n\t\t}\r\n\t}\r\n\t\r\n\tfindTargets(path){\r\n\t\tvar targets = {};\r\n\t\t\r\n\t\tlet componentMap = Object.keys(this.componentMap);\r\n\t\t\r\n\t\tfor (let el of path) {\r\n\t\t\tlet classList = el.classList ? [...el.classList] : [];\r\n\t\t\t\r\n\t\t\tlet abort = classList.filter((item) => {\r\n\t\t\t\treturn this.abortClasses.includes(item);\r\n\t\t\t})\r\n\t\t\t\r\n\t\t\tif(abort.length){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tlet elTargets = classList.filter((item) => {\r\n\t\t\t\treturn componentMap.includes(item);\r\n\t\t\t})\r\n\t\t\t\r\n\t\t\tfor (let target of elTargets) {\r\n\t\t\t\ttargets[this.componentMap[target]] = el;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(targets.group && targets.group === targets.row){\r\n\t\t\tdelete targets.row;\r\n\t\t}\r\n\t\t\r\n\t\treturn targets;\r\n\t}\r\n\t\r\n\tbindComponents(type, targets){\r\n\t\t//ensure row component is looked up before cell\r\n\t\tvar keys = Object.keys(targets).reverse(),\r\n\t\tlistener = this.listeners[type],\r\n\t\ttargetMatches = {};\r\n\t\t\r\n\t\tfor(let key of keys){\r\n\t\t\tlet component;\r\n\t\t\tlet target = targets[key];\r\n\t\t\tlet previousTarget = this.previousTargets[key];\r\n\t\t\t\r\n\t\t\tif(previousTarget && previousTarget.target === target){\r\n\t\t\t\tcomponent = previousTarget.component;\r\n\t\t\t}else{\r\n\t\t\t\tswitch(key){\r\n\t\t\t\t\tcase \"row\":\r\n\t\t\t\t\tcase \"group\":\r\n\t\t\t\t\tif(listener.components.includes(\"row\") || listener.components.includes(\"cell\") || listener.components.includes(\"group\")){\r\n\t\t\t\t\t\tlet rows = this.table.rowManager.getVisibleRows(true);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcomponent = rows.find((row) => {\r\n\t\t\t\t\t\t\treturn row.getElement() === target;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(targets[\"row\"] && targets[\"row\"].parentNode && targets[\"row\"].parentNode.closest(\".tabulator-row\")){\r\n\t\t\t\t\t\t\ttargets[key] = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"column\":\r\n\t\t\t\t\tif(listener.components.includes(\"column\")){\r\n\t\t\t\t\t\tcomponent = this.table.columnManager.findColumn(target);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"cell\":\r\n\t\t\t\t\tif(listener.components.includes(\"cell\")){\r\n\t\t\t\t\t\tif(targets[\"row\"] instanceof Row){\r\n\t\t\t\t\t\t\tcomponent = targets[\"row\"].findCell(target);\r\n\t\t\t\t\t\t}else{\t\r\n\t\t\t\t\t\t\tif(targets[\"row\"]){\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?\")\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(component){\r\n\t\t\t\ttargets[key] = component;\r\n\t\t\t\ttargetMatches[key] = {\r\n\t\t\t\t\ttarget:target,\r\n\t\t\t\t\tcomponent:component,\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.previousTargets = targetMatches;\r\n\t\t\r\n\t\treturn targets;\r\n\t}\r\n\t\r\n\ttriggerEvents(type, e, targets){\r\n\t\tvar listener = this.listeners[type];\r\n\t\t\r\n\t\tfor(let key in targets){\r\n\t\t\tif(targets[key] && listener.components.includes(key)){\r\n\t\t\t\tthis.dispatch(key + \"-\" + type, e, targets[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearWatchers(){\r\n\t\tfor(let key in this.listeners){\r\n\t\t\tlet listener = this.listeners[key];\r\n\t\t\t\r\n\t\t\tif(listener.handler){\r\n\t\t\t\tthis.el.removeEventListener(key, listener.handler)\r\n\t\t\t\tlistener.handler = null;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}","export default class ComponentFunctionBinder{\r\n\r\n\tconstructor(table){\r\n\t\tthis.table = table;\r\n\r\n\t\tthis.bindings = {};\r\n\t}\r\n\r\n\tbind(type, funcName, handler){\r\n\t\tif(!this.bindings[type]){\r\n\t\t\tthis.bindings[type] = {};\r\n\t\t}\r\n\r\n\t\tif(this.bindings[type][funcName]){\r\n\t\t\tconsole.warn(\"Unable to bind component handler, a matching function name is already bound\", type, funcName, handler)\r\n\t\t}else{\r\n\t\t\tthis.bindings[type][funcName] = handler;\r\n\t\t}\r\n\t}\r\n\r\n\thandle(type, component, name){\r\n\t\tif(this.bindings[type] && this.bindings[type][name] && typeof this.bindings[type][name].bind === 'function'){\r\n\t\t\treturn this.bindings[type][name].bind(null, component);\r\n\t\t}else{\r\n\t\t\tif(name !== \"then\" && typeof name === \"string\" && !name.startsWith(\"_\")){\r\n\t\t\t\t\tconsole.error(\"The \" + type + \" component does not have a \" + name + \" function, have you checked that you have the correct Tabulator module installed?\")\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n","import CoreFeature from '../CoreFeature.js';\r\n\r\nexport default class DataLoader extends CoreFeature{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.requestOrder = 0; //prevent requests coming out of sequence if overridden by another load request\r\n\t\tthis.loading = false;\r\n\t}\r\n\r\n\tinitialize(){}\r\n\r\n\tload(data, params, config, replace, silent, columnsChanged){\r\n\t\tvar requestNo = ++this.requestOrder;\r\n\r\n\t\tthis.dispatchExternal(\"dataLoading\", data);\r\n\r\n\t\t//parse json data to array\r\n\t\tif (data && (data.indexOf(\"{\") == 0 || data.indexOf(\"[\") == 0)){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\r\n\t\tif(this.confirm(\"data-loading\", [data, params, config, silent])){\r\n\t\t\tthis.loading = true;\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.alertLoader();\r\n\t\t\t}\r\n\r\n\t\t\t//get params for request\r\n\t\t\tparams = this.chain(\"data-params\", [data, config, silent], params || {}, params || {});\r\n\r\n\t\t\tparams = this.mapParams(params, this.table.options.dataSendParams);\r\n\r\n\t\t\tvar result = this.chain(\"data-load\", [data, params, config, silent], false, Promise.resolve([]));\r\n\t\t\t\r\n\t\t\treturn result.then((response) => {\r\n\t\t\t\tif(!Array.isArray(response) && typeof response == \"object\"){\r\n\t\t\t\t\tresponse = this.mapParams(response, this.objectInvert(this.table.options.dataReceiveParams));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar rowData = this.chain(\"data-loaded\", response, null, response);\r\n\r\n\t\t\t\tif(requestNo == this.requestOrder){\r\n\t\t\t\t\tthis.clearAlert();\r\n\r\n\t\t\t\t\tif(rowData !== false){\r\n\t\t\t\t\t\tthis.dispatchExternal(\"dataLoaded\", rowData);\r\n\t\t\t\t\t\tthis.table.rowManager.setData(rowData, replace, typeof columnsChanged === \"undefined\" ? !replace : columnsChanged);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made\");\r\n\t\t\t\t}\r\n\t\t\t}).catch((error) => {\r\n\t\t\t\tconsole.error(\"Data Load Error: \", error);\r\n\t\t\t\tthis.dispatchExternal(\"dataLoadError\", error);\r\n\r\n\t\t\t\tif(!silent){\r\n\t\t\t\t\tthis.alertError();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tthis.clearAlert();\r\n\t\t\t\t}, this.table.options.dataLoaderErrorTimeout);\r\n\t\t\t})\r\n\t\t\t.finally(() => {\r\n\t\t\t\tthis.loading = false;\r\n\t\t\t})\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"dataLoaded\", data);\r\n\r\n\t\t\tif(!data){\r\n\t\t\t\tdata = [];\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.rowManager.setData(data, replace, typeof columnsChanged === \"undefined\" ? !replace : columnsChanged);\r\n\t\t\treturn Promise.resolve();\r\n\t\t}\r\n\t}\r\n\r\n\tmapParams(params, map){\r\n\t\tvar output = {};\r\n\r\n\t\tfor(let key in params){\r\n\t\t\toutput[map.hasOwnProperty(key) ? map[key] : key] = params[key];\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tobjectInvert(obj){\r\n\t\tvar output = {};\r\n\r\n\t\tfor(let key in obj){\r\n\t\t\toutput[obj[key]] = key;\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tblockActiveLoad(){\r\n\t\tthis.requestOrder++;\r\n\t}\r\n\r\n\talertLoader(){\r\n\t\tvar shouldLoad = typeof this.table.options.dataLoader === \"function\" ? this.table.options.dataLoader() : this.table.options.dataLoader;\r\n\r\n\t\tif(shouldLoad){\r\n\t\t\tthis.table.alertManager.alert(this.table.options.dataLoaderLoading || this.langText(\"data|loading\"));\r\n\t\t}\r\n\t}\r\n\r\n\talertError(){\r\n\t\tthis.table.alertManager.alert(this.table.options.dataLoaderError || this.langText(\"data|error\"), \"error\");\r\n\t}\r\n\r\n\tclearAlert(){\r\n\t\tthis.table.alertManager.clear();\r\n\t}\r\n}","export default class ExternalEventBus {\r\n\r\n\tconstructor(table, optionsList, debug){\r\n\t\tthis.table = table;\r\n\t\tthis.events = {};\r\n\t\tthis.optionsList = optionsList || {};\r\n\t\tthis.subscriptionNotifiers = {};\r\n\r\n\t\tthis.dispatch = debug ? this._debugDispatch.bind(this) : this._dispatch.bind(this);\r\n\t\tthis.debug = debug;\r\n\t}\r\n\r\n\tsubscriptionChange(key, callback){\r\n\t\tif(!this.subscriptionNotifiers[key]){\r\n\t\t\tthis.subscriptionNotifiers[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.subscriptionNotifiers[key].push(callback);\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis._notifiySubscriptionChange(key, true);\r\n\t\t}\r\n\t}\r\n\r\n\tsubscribe(key, callback){\r\n\t\tif(!this.events[key]){\r\n\t\t\tthis.events[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.events[key].push(callback);\r\n\r\n\t\tthis._notifiySubscriptionChange(key, true);\r\n\t}\r\n\r\n\tunsubscribe(key, callback){\r\n\t\tvar index;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tif(callback){\r\n\t\t\t\tindex = this.events[key].findIndex((item) => {\r\n\t\t\t\t\treturn item === callback;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tthis.events[key].splice(index, 1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Cannot remove event, no matching event found:\", key, callback);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tdelete this.events[key];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cannot remove event, no events set on:\", key);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._notifiySubscriptionChange(key, false);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.events[key] && this.events[key].length;\r\n\t}\r\n\r\n\t_notifiySubscriptionChange(key, subscribed){\r\n\t\tvar notifiers = this.subscriptionNotifiers[key];\r\n\r\n\t\tif(notifiers){\r\n\t\t\tnotifiers.forEach((callback)=>{\r\n\t\t\t\tcallback(subscribed);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_dispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args.shift(),\r\n\t\tresult;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tthis.events[key].forEach((callback, i) => {\r\n\t\t\t\tlet callResult = callback.apply(this.table, args);\r\n\r\n\t\t\t\tif(!i){\r\n\t\t\t\t\tresult = callResult;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\t_debugDispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"ExternalEvent:\" + args[0];\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._dispatch(...arguments)\r\n\t}\r\n}","export default class InternalEventBus {\r\n\r\n\tconstructor(debug){\r\n\t\tthis.events = {};\r\n\t\tthis.subscriptionNotifiers = {};\r\n\r\n\t\tthis.dispatch = debug ? this._debugDispatch.bind(this) : this._dispatch.bind(this);\r\n\t\tthis.chain = debug ? this._debugChain.bind(this) : this._chain.bind(this);\r\n\t\tthis.confirm = debug ? this._debugConfirm.bind(this) : this._confirm.bind(this);\r\n\t\tthis.debug = debug;\r\n\t}\r\n\r\n\tsubscriptionChange(key, callback){\r\n\t\tif(!this.subscriptionNotifiers[key]){\r\n\t\t\tthis.subscriptionNotifiers[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.subscriptionNotifiers[key].push(callback);\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis._notifiySubscriptionChange(key, true);\r\n\t\t}\r\n\t}\r\n\r\n\tsubscribe(key, callback, priority = 10000){\r\n\t\tif(!this.events[key]){\r\n\t\t\tthis.events[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.events[key].push({callback, priority});\r\n\r\n\t\tthis.events[key].sort((a, b) => {\r\n\t\t\treturn a.priority - b.priority;\r\n\t\t});\r\n\r\n\t\tthis._notifiySubscriptionChange(key, true);\r\n\t}\r\n\r\n\tunsubscribe(key, callback){\r\n\t\tvar index;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tif(callback){\r\n\t\t\t\tindex = this.events[key].findIndex((item) => {\r\n\t\t\t\t\treturn item.callback === callback;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tthis.events[key].splice(index, 1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Cannot remove event, no matching event found:\", key, callback);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cannot remove event, no events set on:\", key);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._notifiySubscriptionChange(key, false);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.events[key] && this.events[key].length;\r\n\t}\r\n\r\n\t_chain(key, args, initialValue, fallback){\r\n\t\tvar value = initialValue;\r\n\r\n\t\tif(!Array.isArray(args)){\r\n\t\t\targs = [args];\r\n\t\t}\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis.events[key].forEach((subscriber, i) => {\r\n\t\t\t\tvalue = subscriber.callback.apply(this, args.concat([value]));\r\n\t\t\t});\r\n\r\n\t\t\treturn value;\r\n\t\t}else{\r\n\t\t\treturn typeof fallback === \"function\" ? fallback() : fallback;\r\n\t\t}\r\n\t}\r\n\r\n\t_confirm(key, args){\r\n\t\tvar confirmed = false;\r\n\r\n\t\tif(!Array.isArray(args)){\r\n\t\t\targs = [args];\r\n\t\t}\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis.events[key].forEach((subscriber, i) => {\r\n\t\t\t\tif(subscriber.callback.apply(this, args)){\r\n\t\t\t\t\tconfirmed = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn confirmed;\r\n\t}\r\n\r\n\t_notifiySubscriptionChange(key, subscribed){\r\n\t\tvar notifiers = this.subscriptionNotifiers[key];\r\n\r\n\t\tif(notifiers){\r\n\t\t\tnotifiers.forEach((callback)=>{\r\n\t\t\t\tcallback(subscribed);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_dispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args.shift();\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tthis.events[key].forEach((subscriber) => {\r\n\t\t\t\tlet callResult = subscriber.callback.apply(this, args);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_debugDispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._dispatch(...arguments);\r\n\t}\r\n\r\n\t_debugChain(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._chain(...arguments);\r\n\t}\r\n\r\n\t_debugConfirm(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._confirm(...arguments);\r\n\t}\r\n}","import Tabulator from '../Tabulator.js';\r\n\r\nclass TableRegistry {\r\n\r\n\tstatic register(table){\r\n\t\tTableRegistry.tables.push(table);\r\n\t}\r\n\r\n\tstatic deregister(table){\r\n\t\tvar index = TableRegistry.tables.indexOf(table);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tTableRegistry.tables.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\tstatic lookupTable(query, silent){\r\n\t\tvar results = [],\r\n\t\tmatches, match;\r\n\r\n\t\tif(typeof query === \"string\"){\r\n\t\t\tmatches = document.querySelectorAll(query);\r\n\r\n\t\t\tif(matches.length){\r\n\t\t\t\tfor(var i = 0; i < matches.length; i++){\r\n\t\t\t\t\tmatch = TableRegistry.matchElement(matches[i]);\r\n\r\n\t\t\t\t\tif(match){\r\n\t\t\t\t\t\tresults.push(match);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}else if((typeof HTMLElement !== \"undefined\" && query instanceof HTMLElement) || query instanceof Tabulator){\r\n\t\t\tmatch = TableRegistry.matchElement(query);\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tresults.push(match);\r\n\t\t\t}\r\n\t\t}else if(Array.isArray(query)){\r\n\t\t\tquery.forEach(function(item){\r\n\t\t\t\tresults = results.concat(TableRegistry.lookupTable(item));\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Table Connection Error - Invalid Selector\", query);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\tstatic matchElement(element){\r\n\t\treturn TableRegistry.tables.find(function(table){\r\n\t\t\treturn element instanceof Tabulator ? table === element : table.element === element;\r\n\t\t});\r\n\t}\r\n}\r\n\r\nTableRegistry.tables = [];\r\n\r\nexport default TableRegistry;","//resize columns to fit data they contain\r\nexport default function(columns){\r\n\tthis.table.columnManager.renderer.reinitializeColumnWidths(columns);\r\n\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n};","//resize columns to fit data the contain and stretch last column to fill table\r\nexport default function(columns){\r\n\tvar colsWidth = 0,\r\n\ttableWidth = this.table.rowManager.element.clientWidth,\r\n\tgap = 0,\r\n\tlastCol = false;\r\n\r\n\tcolumns.forEach((column, i) => {\r\n\t\tif(!column.widthFixed){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t}\r\n\r\n\t\tif(this.table.options.responsiveLayout ? column.modules.responsive.visible : column.visible){\r\n\t\t\tlastCol = column;\r\n\t\t}\r\n\r\n\t\tif(column.visible){\r\n\t\t\tcolsWidth += column.getWidth();\r\n\t\t}\r\n\t});\r\n\r\n\tif(lastCol){\r\n\t\tgap = tableWidth - colsWidth + lastCol.getWidth();\r\n\r\n\t\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\t\tlastCol.setWidth(0);\r\n\t\t\tthis.table.modules.responsiveLayout.update();\r\n\t\t}\r\n\r\n\t\tif(gap > 0){\r\n\t\t\tlastCol.setWidth(gap);\r\n\t\t}else{\r\n\t\t\tlastCol.reinitializeWidth();\r\n\t\t}\r\n\t}else{\r\n\t\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\t\tthis.table.modules.responsiveLayout.update();\r\n\t\t}\r\n\t}\r\n};","//resize columns to fit data they contain and stretch row to fill table, also used for fitDataTable\r\nexport default function(columns){\r\n\tcolumns.forEach(function(column){\r\n\t\tcolumn.reinitializeWidth();\r\n\t});\r\n\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultModes from './defaults/modes.js';\r\n\r\nclass Layout extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table, \"layout\");\r\n\r\n\t\tthis.mode = null;\r\n\r\n\t\tthis.registerTableOption(\"layout\", \"fitData\"); //layout type\r\n\t\tthis.registerTableOption(\"layoutColumnsOnNewData\", false); //update column widths on setData\r\n\r\n\t\tthis.registerColumnOption(\"widthGrow\");\r\n\t\tthis.registerColumnOption(\"widthShrink\");\r\n\t}\r\n\r\n\t//initialize layout system\r\n\tinitialize(){\r\n\t\tvar layout = this.table.options.layout;\r\n\r\n\t\tif(Layout.modes[layout]){\r\n\t\t\tthis.mode = layout;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Layout Error - invalid mode set, defaulting to 'fitData' : \" + layout);\r\n\t\t\tthis.mode = 'fitData';\r\n\t\t}\r\n\r\n\t\tthis.table.element.setAttribute(\"tabulator-layout\", this.mode);\r\n\t}\r\n\r\n\tgetMode(){\r\n\t\treturn this.mode;\r\n\t}\r\n\r\n\t//trigger table layout\r\n\tlayout(){\r\n\t\tthis.dispatch(\"layout-refreshing\")\r\n\t\tLayout.modes[this.mode].call(this, this.table.columnManager.columnsByIndex);\r\n\r\n\t\tthis.dispatch(\"layout-refreshed\")\r\n\t}\r\n}\r\n\r\nLayout.moduleName = \"layout\";\r\n\r\n//load defaults\r\nLayout.modes = defaultModes;\r\n\r\nexport default Layout;","//resize columns to fit\r\nexport default function(columns){\r\n\tvar totalWidth = this.table.element.clientWidth; //table element width\r\n\tvar fixedWidth = 0; //total width of columns with a defined width\r\n\tvar flexWidth = 0; //total width available to flexible columns\r\n\tvar flexGrowUnits = 0; //total number of widthGrow blocks accross all columns\r\n\tvar flexColWidth = 0; //desired width of flexible columns\r\n\tvar flexColumns = []; //array of flexible width columns\r\n\tvar fixedShrinkColumns = []; //array of fixed width columns that can shrink\r\n\tvar flexShrinkUnits = 0; //total number of widthShrink blocks accross all columns\r\n\tvar overflowWidth = 0; //horizontal overflow width\r\n\tvar gapFill=0; //number of pixels to be added to final column to close and half pixel gaps\r\n\r\n\tfunction calcWidth(width){\r\n\t\tvar colWidth;\r\n\r\n\t\tif(typeof(width) == \"string\"){\r\n\t\t\tif(width.indexOf(\"%\") > -1){\r\n\t\t\t\tcolWidth = (totalWidth / 100) * parseInt(width);\r\n\t\t\t}else{\r\n\t\t\t\tcolWidth = parseInt(width);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcolWidth = width;\r\n\t\t}\r\n\r\n\t\treturn colWidth;\r\n\t}\r\n\r\n\t//ensure columns resize to take up the correct amount of space\r\n\tfunction scaleColumns(columns, freeSpace, colWidth, shrinkCols){\r\n\r\n\t\tvar oversizeCols = [],\r\n\t\toversizeSpace = 0,\r\n\t\tremainingSpace = 0,\r\n\t\tnextColWidth = 0,\r\n\t\tremainingFlexGrowUnits = flexGrowUnits,\r\n\t\tgap = 0,\r\n\t\tchangeUnits = 0,\r\n\t\tundersizeCols = [];\r\n\r\n\t\tfunction calcGrow(col){\r\n\t\t\treturn (colWidth * (col.column.definition.widthGrow || 1));\r\n\t\t}\r\n\r\n\t\tfunction calcShrink(col){\r\n\t\t\treturn (calcWidth(col.width) - (colWidth * (col.column.definition.widthShrink || 0)))\r\n\t\t}\r\n\r\n\t\tcolumns.forEach(function(col, i){\r\n\t\t\tvar width = shrinkCols ? calcShrink(col) : calcGrow(col);\r\n\t\t\tif(col.column.minWidth >= width){\r\n\t\t\t\toversizeCols.push(col);\r\n\t\t\t}else{\r\n\t\t\t\tif(col.column.maxWidth && col.column.maxWidth < width){\r\n\t\t\t\t\tcol.width = col.column.maxWidth;\r\n\t\t\t\t\tfreeSpace -= col.column.maxWidth;\r\n\r\n\t\t\t\t\tremainingFlexGrowUnits -= shrinkCols ? (col.column.definition.widthShrink || 1) : (col.column.definition.widthGrow || 1);\r\n\r\n\t\t\t\t\tif(remainingFlexGrowUnits){\r\n\t\t\t\t\t\tcolWidth = Math.floor(freeSpace/remainingFlexGrowUnits);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tundersizeCols.push(col);\r\n\t\t\t\t\tchangeUnits += shrinkCols ? (col.column.definition.widthShrink || 1) : (col.column.definition.widthGrow || 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(oversizeCols.length){\r\n\t\t\toversizeCols.forEach(function(col){\r\n\t\t\t\toversizeSpace += shrinkCols ? col.width - col.column.minWidth : col.column.minWidth;\r\n\t\t\t\tcol.width = col.column.minWidth;\r\n\t\t\t});\r\n\r\n\t\t\tremainingSpace = freeSpace - oversizeSpace;\r\n\r\n\t\t\tnextColWidth = changeUnits ? Math.floor(remainingSpace/changeUnits) : remainingSpace;\r\n\r\n\t\t\tgap = remainingSpace - (nextColWidth * changeUnits);\r\n\r\n\t\t\tgap += scaleColumns(undersizeCols, remainingSpace, nextColWidth, shrinkCols);\r\n\t\t}else{\r\n\t\t\tgap = changeUnits ? freeSpace - (Math.floor(freeSpace/changeUnits) * changeUnits) : freeSpace;\r\n\r\n\t\t\tundersizeCols.forEach(function(column){\r\n\t\t\t\tcolumn.width = shrinkCols ? calcShrink(column) : calcGrow(column);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn gap;\r\n\t}\r\n\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n\r\n\t//adjust for vertical scrollbar if present\r\n\tif(this.table.rowManager.element.scrollHeight > this.table.rowManager.element.clientHeight){\r\n\t\ttotalWidth -= this.table.rowManager.element.offsetWidth - this.table.rowManager.element.clientWidth;\r\n\t}\r\n\r\n\tcolumns.forEach(function(column){\r\n\t\tvar width, minWidth, colWidth;\r\n\r\n\t\tif(column.visible){\r\n\r\n\t\t\twidth = column.definition.width;\r\n\t\t\tminWidth = parseInt(column.minWidth);\r\n\r\n\t\t\tif(width){\r\n\r\n\t\t\t\tcolWidth = calcWidth(width);\r\n\r\n\t\t\t\tfixedWidth += colWidth > minWidth ? colWidth : minWidth;\r\n\r\n\t\t\t\tif(column.definition.widthShrink){\r\n\t\t\t\t\tfixedShrinkColumns.push({\r\n\t\t\t\t\t\tcolumn:column,\r\n\t\t\t\t\t\twidth:colWidth > minWidth ? colWidth : minWidth\r\n\t\t\t\t\t});\r\n\t\t\t\t\tflexShrinkUnits += column.definition.widthShrink;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tflexColumns.push({\r\n\t\t\t\t\tcolumn:column,\r\n\t\t\t\t\twidth:0,\r\n\t\t\t\t});\r\n\t\t\t\tflexGrowUnits += column.definition.widthGrow || 1;\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\t//calculate available space\r\n\tflexWidth = totalWidth - fixedWidth;\r\n\r\n\t//calculate correct column size\r\n\tflexColWidth = Math.floor(flexWidth / flexGrowUnits)\r\n\r\n\t//generate column widths\r\n\tvar gapFill = scaleColumns(flexColumns, flexWidth, flexColWidth, false);\r\n\r\n\t//increase width of last column to account for rounding errors\r\n\tif(flexColumns.length && gapFill > 0){\r\n\t\tflexColumns[flexColumns.length-1].width += + gapFill;\r\n\t}\r\n\r\n\t//caculate space for columns to be shrunk into\r\n\tflexColumns.forEach(function(col){\r\n\t\tflexWidth -= col.width;\r\n\t});\r\n\r\n\toverflowWidth = Math.abs(gapFill) + flexWidth;\r\n\r\n\t//shrink oversize columns if there is no available space\r\n\tif(overflowWidth > 0 && flexShrinkUnits){\r\n\t\tgapFill = scaleColumns(fixedShrinkColumns, overflowWidth, Math.floor(overflowWidth / flexShrinkUnits), true);\r\n\t}\r\n\r\n\t//decrease width of last column to account for rounding errors\r\n\tif(fixedShrinkColumns.length){\r\n\t\tfixedShrinkColumns[fixedShrinkColumns.length-1].width -= gapFill;\r\n\t}\r\n\r\n\tflexColumns.forEach(function(col){\r\n\t\tcol.column.setWidth(col.width);\r\n\t});\r\n\r\n\tfixedShrinkColumns.forEach(function(col){\r\n\t\tcol.column.setWidth(col.width);\r\n\t});\r\n};","import fitData from './modes/fitData.js';\r\nimport fitDataGeneral from './modes/fitDataGeneral.js';\r\nimport fitDataStretch from './modes/fitDataStretch.js';\r\nimport fitColumns from './modes/fitColumns.js';\r\n\r\nexport default {\r\n\tfitData:fitData,\r\n\tfitDataFill:fitDataGeneral,\r\n\tfitDataTable:fitDataGeneral,\r\n\tfitDataStretch:fitDataStretch,\r\n\tfitColumns:fitColumns ,\r\n};","export default {\r\n\t\"default\":{ //hold default locale text\r\n\t\t\"groups\":{\r\n\t\t\t\"item\":\"item\",\r\n\t\t\t\"items\":\"items\",\r\n\t\t},\r\n\t\t\"columns\":{\r\n\t\t},\r\n\t\t\"data\":{\r\n\t\t\t\"loading\":\"Loading\",\r\n\t\t\t\"error\":\"Error\",\r\n\t\t},\r\n\t\t\"pagination\":{\r\n\t\t\t\"page_size\":\"Page Size\",\r\n\t\t\t\"page_title\":\"Show Page\",\r\n\t\t\t\"first\":\"First\",\r\n\t\t\t\"first_title\":\"First Page\",\r\n\t\t\t\"last\":\"Last\",\r\n\t\t\t\"last_title\":\"Last Page\",\r\n\t\t\t\"prev\":\"Prev\",\r\n\t\t\t\"prev_title\":\"Prev Page\",\r\n\t\t\t\"next\":\"Next\",\r\n\t\t\t\"next_title\":\"Next Page\",\r\n\t\t\t\"all\":\"All\",\r\n\t\t\t\"counter\":{\r\n\t\t\t\t\"showing\": \"Showing\",\r\n\t\t\t\t\"of\": \"of\",\r\n\t\t\t\t\"rows\": \"rows\",\r\n\t\t\t\t\"pages\": \"pages\",\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"headerFilters\":{\r\n\t\t\t\"default\":\"filter column...\",\r\n\t\t\t\"columns\":{}\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defaultLangs from './defaults/langs.js';\r\n\r\nclass Localize extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.locale = \"default\"; //current locale\r\n\t\tthis.lang = false; //current language\r\n\t\tthis.bindings = {}; //update events to call when locale is changed\r\n\t\tthis.langList = {};\r\n\r\n\t\tthis.registerTableOption(\"locale\", false); //current system language\r\n\t\tthis.registerTableOption(\"langs\", {});\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.langList = Helpers.deepClone(Localize.langs);\r\n\r\n\t\tif(this.table.options.columnDefaults.headerFilterPlaceholder !== false){\r\n\t\t\tthis.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder);\r\n\t\t}\r\n\r\n\t\tfor(let locale in this.table.options.langs){\r\n\t\t\tthis.installLang(locale, this.table.options.langs[locale]);\r\n\t\t}\r\n\r\n\t\tthis.setLocale(this.table.options.locale);\r\n\r\n\t\tthis.registerTableFunction(\"setLocale\", this.setLocale.bind(this));\r\n\t\tthis.registerTableFunction(\"getLocale\", this.getLocale.bind(this));\r\n\t\tthis.registerTableFunction(\"getLang\", this.getLang.bind(this));\r\n\t}\r\n\r\n\t//set header placehoder\r\n\tsetHeaderFilterPlaceholder(placeholder){\r\n\t\tthis.langList.default.headerFilters.default = placeholder;\r\n\t}\r\n\r\n\t//set header filter placeholder by column\r\n\tsetHeaderFilterColumnPlaceholder(column, placeholder){\r\n\t\tthis.langList.default.headerFilters.columns[column] = placeholder;\r\n\r\n\t\tif(this.lang && !this.lang.headerFilters.columns[column]){\r\n\t\t\tthis.lang.headerFilters.columns[column] = placeholder;\r\n\t\t}\r\n\t}\r\n\r\n\t//setup a lang description object\r\n\tinstallLang(locale, lang){\r\n\t\tif(this.langList[locale]){\r\n\t\t\tthis._setLangProp(this.langList[locale], lang);\r\n\t\t}else{\r\n\t\t\tthis.langList[locale] = lang;\r\n\t\t}\r\n\t}\r\n\r\n\t_setLangProp(lang, values){\r\n\t\tfor(let key in values){\r\n\t\t\tif(lang[key] && typeof lang[key] == \"object\"){\r\n\t\t\t\tthis._setLangProp(lang[key], values[key])\r\n\t\t\t}else{\r\n\t\t\t\tlang[key] = values[key];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//set current locale\r\n\tsetLocale(desiredLocale){\r\n\t\tdesiredLocale = desiredLocale || \"default\";\r\n\r\n\t\t//fill in any matching languge values\r\n\t\tfunction traverseLang(trans, path){\r\n\t\t\tfor(var prop in trans){\r\n\t\t\t\tif(typeof trans[prop] == \"object\"){\r\n\t\t\t\t\tif(!path[prop]){\r\n\t\t\t\t\t\tpath[prop] = {};\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttraverseLang(trans[prop], path[prop]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tpath[prop] = trans[prop];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//determing correct locale to load\r\n\t\tif(desiredLocale === true && navigator.language){\r\n\t\t\t//get local from system\r\n\t\t\tdesiredLocale = navigator.language.toLowerCase();\r\n\t\t}\r\n\r\n\t\tif(desiredLocale){\r\n\t\t\t//if locale is not set, check for matching top level locale else use default\r\n\t\t\tif(!this.langList[desiredLocale]){\r\n\t\t\t\tlet prefix = desiredLocale.split(\"-\")[0];\r\n\r\n\t\t\t\tif(this.langList[prefix]){\r\n\t\t\t\t\tconsole.warn(\"Localization Error - Exact matching locale not found, using closest match: \", desiredLocale, prefix);\r\n\t\t\t\t\tdesiredLocale = prefix;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Localization Error - Matching locale not found, using default: \", desiredLocale);\r\n\t\t\t\t\tdesiredLocale = \"default\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.locale = desiredLocale;\r\n\r\n\t\t//load default lang template\r\n\t\tthis.lang = Helpers.deepClone(this.langList.default || {});\r\n\r\n\t\tif(desiredLocale != \"default\"){\r\n\t\t\ttraverseLang(this.langList[desiredLocale], this.lang);\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(\"localized\", this.locale, this.lang);\r\n\r\n\t\tthis._executeBindings();\r\n\t}\r\n\r\n\t//get current locale\r\n\tgetLocale(locale){\r\n\t\treturn this.locale;\r\n\t}\r\n\r\n\t//get lang object for given local or current if none provided\r\n\tgetLang(locale){\r\n\t\treturn locale ? this.langList[locale] : this.lang;\r\n\t}\r\n\r\n\t//get text for current locale\r\n\tgetText(path, value){\r\n\t\tvar path = value ? path + \"|\" + value : path,\r\n\t\tpathArray = path.split(\"|\"),\r\n\t\ttext = this._getLangElement(pathArray, this.locale);\r\n\r\n\t\t// if(text === false){\r\n\t\t// \tconsole.warn(\"Localization Error - Matching localized text not found for given path: \", path);\r\n\t\t// }\r\n\r\n\t\treturn text || \"\";\r\n\t}\r\n\r\n\t//traverse langs object and find localized copy\r\n\t_getLangElement(path, locale){\r\n\t\tvar root = this.lang;\r\n\r\n\t\tpath.forEach(function(level){\r\n\t\t\tvar rootPath;\r\n\r\n\t\t\tif(root){\r\n\t\t\t\trootPath = root[level];\r\n\r\n\t\t\t\tif(typeof rootPath != \"undefined\"){\r\n\t\t\t\t\troot = rootPath;\r\n\t\t\t\t}else{\r\n\t\t\t\t\troot = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn root;\r\n\t}\r\n\r\n\t//set update binding\r\n\tbind(path, callback){\r\n\t\tif(!this.bindings[path]){\r\n\t\t\tthis.bindings[path] = [];\r\n\t\t}\r\n\r\n\t\tthis.bindings[path].push(callback);\r\n\r\n\t\tcallback(this.getText(path), this.lang);\r\n\t}\r\n\r\n\t//itterate through bindings and trigger updates\r\n\t_executeBindings(){\r\n\t\tfor(let path in this.bindings){\r\n\t\t\tthis.bindings[path].forEach((binding) => {\r\n\t\t\t\tbinding(this.getText(path), this.lang);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n}\r\n\r\nLocalize.moduleName = \"localize\";\r\n\r\n//load defaults\r\nLocalize.langs = defaultLangs;\r\n\r\nexport default Localize;","import Module from '../../core/Module.js';\r\nimport TableRegistry from '../../core/tools/TableRegistry.js';\r\n\r\nclass Comms extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"tableComms\", this.receive.bind(this));\r\n\t}\r\n\r\n\tgetConnections(selectors){\r\n\t\tvar connections = [],\r\n\t\tconnection;\r\n\r\n\t\tconnection = TableRegistry.lookupTable(selectors);\r\n\r\n\t\tconnection.forEach((con) =>{\r\n\t\t\tif(this.table !== con){\r\n\t\t\t\tconnections.push(con);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn connections;\r\n\t}\r\n\r\n\tsend(selectors, module, action, data){\r\n\t\tvar connections = this.getConnections(selectors);\r\n\r\n\t\tconnections.forEach((connection) => {\r\n\t\t\tconnection.tableComms(this.table.element, module, action, data);\r\n\t\t});\r\n\r\n\t\tif(!connections.length && selectors){\r\n\t\t\tconsole.warn(\"Table Connection Error - No tables matching selector found\", selectors);\r\n\t\t}\r\n\t}\r\n\r\n\treceive(table, module, action, data){\r\n\t\tif(this.table.modExists(module)){\r\n\t\t\treturn this.table.modules[module].commsReceived(table, action, data);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Inter-table Comms Error - no such module:\", module);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nComms.moduleName = \"comms\";\r\n\r\nexport default Comms;","import * as coreModules from '../modules/core.js';\r\nimport TableRegistry from './TableRegistry.js';\r\n\r\nexport default class ModuleBinder {\r\n\t\r\n\tconstructor(tabulator, modules){\r\n\t\tthis.bindStaticFuctionality(tabulator);\r\n\t\tthis.bindModules(tabulator, coreModules, true);\r\n\t\t\r\n\t\tif(modules){\r\n\t\t\tthis.bindModules(tabulator, modules);\r\n\t\t}\r\n\t}\r\n\t\r\n\tbindStaticFuctionality(tabulator){\r\n\t\ttabulator.moduleBindings = {};\r\n\t\t\r\n\t\ttabulator.extendModule = function(name, property, values){\r\n\t\t\tif(tabulator.moduleBindings[name]){\r\n\t\t\t\tvar source = tabulator.moduleBindings[name][property];\r\n\t\t\t\t\r\n\t\t\t\tif(source){\r\n\t\t\t\t\tif(typeof values == \"object\"){\r\n\t\t\t\t\t\tfor(let key in values){\r\n\t\t\t\t\t\t\tsource[key] = values[key];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Module Error - Invalid value type, it must be an object\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Module Error - property does not exist:\", property);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Module Error - module does not exist:\", name);\r\n\t\t\t}\r\n\t\t};\r\n\t\t\r\n\t\ttabulator.registerModule = function(modules){\r\n\t\t\tif(!Array.isArray(modules)){\r\n\t\t\t\tmodules = [modules];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmodules.forEach((mod) => {\r\n\t\t\t\ttabulator.registerModuleBinding(mod)\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\ttabulator.registerModuleBinding = function(mod){\r\n\t\t\ttabulator.moduleBindings[mod.moduleName] = mod;\r\n\t\t};\r\n\t\t\r\n\t\ttabulator.findTable = function(query){\r\n\t\t\tvar results = TableRegistry.lookupTable(query, true);\r\n\t\t\treturn Array.isArray(results) && !results.length ? false : results;\r\n\t\t}\r\n\t\t\r\n\t\t//ensure that module are bound to instantiated function\r\n\t\ttabulator.prototype.bindModules = function(){\r\n\t\t\tvar orderedStartMods = [],\r\n\t\t\torderedEndMods = [],\r\n\t\t\tunOrderedMods = [];\r\n\t\t\t\r\n\t\t\tthis.modules = {};\r\n\t\t\t\r\n\t\t\tfor(var name in tabulator.moduleBindings){\r\n\t\t\t\tlet mod = tabulator.moduleBindings[name];\r\n\t\t\t\tlet module = new mod(this);\r\n\t\t\t\t\r\n\t\t\t\tthis.modules[name] = module;\r\n\t\t\t\t\r\n\t\t\t\tif(mod.prototype.moduleCore){\r\n\t\t\t\t\tthis.modulesCore.push(module);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(mod.moduleInitOrder){\r\n\t\t\t\t\t\tif(mod.moduleInitOrder < 0){\r\n\t\t\t\t\t\t\torderedStartMods.push(module);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\torderedEndMods.push(module);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tunOrderedMods.push(module);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\torderedStartMods.sort((a, b) => a.moduleInitOrder > b.moduleInitOrder ? 1 : -1);\r\n\t\t\torderedEndMods.sort((a, b) => a.moduleInitOrder > b.moduleInitOrder ? 1 : -1);\r\n\t\t\t\r\n\t\t\tthis.modulesRegular = orderedStartMods.concat(unOrderedMods.concat(orderedEndMods));\r\n\t\t}\r\n\t}\r\n\t\r\n\tbindModules(tabulator, modules, core){\r\n\t\tvar mods = Object.values(modules);\r\n\t\t\r\n\t\tif(core){\r\n\t\t\tmods.forEach((mod) => {\r\n\t\t\t\tmod.prototype.moduleCore = true;\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\ttabulator.registerModule(mods);\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from './Helpers.js';\r\n\r\nexport default class Alert extends CoreFeature{\r\n constructor(table){\r\n super(table);\r\n \r\n this.element = this._createAlertElement();\r\n this.msgElement = this._createMsgElement();\r\n this.type = null;\r\n \r\n this.element.appendChild(this.msgElement);\r\n }\r\n \r\n _createAlertElement(){\r\n var el = document.createElement(\"div\");\r\n el.classList.add(\"tabulator-alert\");\r\n return el;\r\n }\r\n \r\n _createMsgElement(){\r\n var el = document.createElement(\"div\");\r\n el.classList.add(\"tabulator-alert-msg\");\r\n el.setAttribute(\"role\", \"alert\");\r\n return el;\r\n }\r\n \r\n _typeClass(){\r\n return \"tabulator-alert-state-\" + this.type;\r\n }\r\n \r\n alert(content, type = \"msg\"){\r\n if(content){\r\n this.clear();\r\n \r\n this.type = type;\r\n \r\n while(this.msgElement.firstChild) this.msgElement.removeChild(this.msgElement.firstChild);\r\n \r\n this.msgElement.classList.add(this._typeClass());\r\n \r\n if(typeof content === \"function\"){\r\n content = content();\r\n }\r\n \r\n if(content instanceof HTMLElement){\r\n this.msgElement.appendChild(content);\r\n }else{\r\n this.msgElement.innerHTML = content;\r\n }\r\n \r\n this.table.element.appendChild(this.element);\r\n }\r\n }\r\n \r\n clear(){\r\n if(this.element.parentNode){\r\n this.element.parentNode.removeChild(this.element);\r\n }\r\n \r\n this.msgElement.classList.remove(this._typeClass());\r\n }\r\n}","'use strict';\r\n\r\nimport defaultOptions from './defaults/options.js';\r\n\r\nimport ColumnManager from './ColumnManager.js';\r\nimport RowManager from './RowManager.js';\r\nimport FooterManager from './FooterManager.js';\r\n\r\nimport InteractionMonitor from './tools/InteractionMonitor.js';\r\nimport ComponentFunctionBinder from './tools/ComponentFunctionBinder.js';\r\nimport DataLoader from './tools/DataLoader.js';\r\n\r\nimport ExternalEventBus from './tools/ExternalEventBus.js';\r\nimport InternalEventBus from './tools/InternalEventBus.js';\r\n\r\nimport TableRegistry from './tools/TableRegistry.js';\r\nimport ModuleBinder from './tools/ModuleBinder.js';\r\n\r\nimport OptionsList from './tools/OptionsList.js';\r\n\r\nimport Alert from './tools/Alert.js';\r\n\r\nclass Tabulator {\r\n\t\r\n\tconstructor(element, options){\r\n\t\t\r\n\t\tthis.options = {};\r\n\t\t\r\n\t\tthis.columnManager = null; // hold Column Manager\r\n\t\tthis.rowManager = null; //hold Row Manager\r\n\t\tthis.footerManager = null; //holder Footer Manager\r\n\t\tthis.alertManager = null; //hold Alert Manager\r\n\t\tthis.vdomHoz = null; //holder horizontal virtual dom\r\n\t\tthis.externalEvents = null; //handle external event messaging\r\n\t\tthis.eventBus = null; //handle internal event messaging\r\n\t\tthis.interactionMonitor = false; //track user interaction\r\n\t\tthis.browser = \"\"; //hold current browser type\r\n\t\tthis.browserSlow = false; //handle reduced functionality for slower browsers\r\n\t\tthis.browserMobile = false; //check if running on mobile, prevent resize cancelling edit on keyboard appearance\r\n\t\tthis.rtl = false; //check if the table is in RTL mode\r\n\t\tthis.originalElement = null; //hold original table element if it has been replaced\r\n\t\t\r\n\t\tthis.componentFunctionBinder = new ComponentFunctionBinder(this); //bind component functions\r\n\t\tthis.dataLoader = false; //bind component functions\r\n\t\t\r\n\t\tthis.modules = {}; //hold all modules bound to this table\r\n\t\tthis.modulesCore = []; //hold core modules bound to this table (for initialization purposes)\r\n\t\tthis.modulesRegular = []; //hold regular modules bound to this table (for initialization purposes)\r\n\t\t\r\n\t\tthis.optionsList = new OptionsList(this, \"table constructor\");\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\t\r\n\t\tif(this.initializeElement(element)){\r\n\t\t\t\r\n\t\t\tthis.initializeCoreSystems(options);\r\n\t\t\t\r\n\t\t\t//delay table creation to allow event bindings immediately after the constructor\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tthis._create();\r\n\t\t\t})\r\n\t\t}\r\n\t\t\r\n\t\tTableRegistry.register(this); //register table for inter-device communication\r\n\t}\r\n\t\r\n\tinitializeElement(element){\r\n\t\tif(typeof HTMLElement !== \"undefined\" && element instanceof HTMLElement){\r\n\t\t\tthis.element = element;\r\n\t\t\treturn true;\r\n\t\t}else if(typeof element === \"string\"){\r\n\t\t\tthis.element = document.querySelector(element);\r\n\t\t\t\r\n\t\t\tif(this.element){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Tabulator Creation Error - no element found matching selector: \", element);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Tabulator Creation Error - Invalid element provided:\", element);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeCoreSystems(options){\r\n\t\tthis.columnManager = new ColumnManager(this);\r\n\t\tthis.rowManager = new RowManager(this);\r\n\t\tthis.footerManager = new FooterManager(this);\r\n\t\tthis.dataLoader = new DataLoader(this);\r\n\t\tthis.alertManager = new Alert(this);\r\n\t\t\r\n\t\tthis.bindModules();\r\n\t\t\r\n\t\tthis.options = this.optionsList.generate(Tabulator.defaultOptions, options)\r\n\t\t\r\n\t\tthis._clearObjectPointers();\r\n\t\t\r\n\t\tthis._mapDeprecatedFunctionality();\r\n\t\t\r\n\t\tthis.externalEvents = new ExternalEventBus(this, this.options, this.options.debugEventsExternal);\r\n\t\tthis.eventBus = new InternalEventBus(this.options.debugEventsInternal);\r\n\t\t\r\n\t\tthis.interactionMonitor = new InteractionMonitor(this);\r\n\t\t\r\n\t\tthis.dataLoader.initialize();\r\n\t\t// this.columnManager.initialize();\r\n\t\t// this.rowManager.initialize();\r\n\t\tthis.footerManager.initialize();\r\n\t}\r\n\t\r\n\t//convert deprecated functionality to new functions\r\n\t_mapDeprecatedFunctionality(){\r\n\t\t//all previously deprecated functionality removed in the 5.0 release\r\n\t}\r\n\t\r\n\t_clearSelection(){\r\n\t\t\r\n\t\tthis.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\tif (window.getSelection) {\r\n\t\t\tif (window.getSelection().empty) { // Chrome\r\n\t\t\t\twindow.getSelection().empty();\r\n\t\t\t} else if (window.getSelection().removeAllRanges) { // Firefox\r\n\t\t\t\twindow.getSelection().removeAllRanges();\r\n\t\t\t}\r\n\t\t} else if (document.selection) { // IE?\r\n\t\t\tdocument.selection.empty();\r\n\t\t}\r\n\t\t\r\n\t\tthis.element.classList.remove(\"tabulator-block-select\");\r\n\t}\r\n\t\r\n\t//create table\r\n\t_create(){\r\n\t\tthis.externalEvents.dispatch(\"tableBuilding\");\r\n\t\tthis.eventBus.dispatch(\"table-building\");\r\n\t\t\r\n\t\tthis._rtlCheck();\r\n\t\t\r\n\t\tthis._buildElement();\r\n\t\t\r\n\t\tthis._initializeTable();\r\n\t\t\r\n\t\tthis._loadInitialData();\r\n\t\t\r\n\t\tthis.initialized = true;\r\n\t\t\r\n\t\tthis.externalEvents.dispatch(\"tableBuilt\");\r\n\t}\r\n\t\r\n\t_rtlCheck(){\r\n\t\tvar style = window.getComputedStyle(this.element);\r\n\t\t\r\n\t\tswitch(this.options.textDirection){\r\n\t\t\tcase\"auto\":\r\n\t\t\tif(style.direction !== \"rtl\"){\r\n\t\t\t\tbreak;\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tcase \"rtl\":\r\n\t\t\tthis.element.classList.add(\"tabulator-rtl\");\r\n\t\t\tthis.rtl = true;\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"ltr\":\r\n\t\t\tthis.element.classList.add(\"tabulator-ltr\");\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\tthis.rtl = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//clear pointers to objects in default config object\r\n\t_clearObjectPointers(){\r\n\t\tthis.options.columns = this.options.columns.slice(0);\r\n\t\t\r\n\t\tif(Array.isArray(this.options.data) && !this.options.reactiveData){\r\n\t\t\tthis.options.data = this.options.data.slice(0);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//build tabulator element\r\n\t_buildElement(){\r\n\t\tvar element = this.element,\r\n\t\toptions = this.options,\r\n\t\tnewElement;\r\n\t\t\r\n\t\tif(element.tagName === \"TABLE\"){\r\n\t\t\tthis.originalElement = this.element;\r\n\t\t\tnewElement = document.createElement(\"div\");\r\n\t\t\t\r\n\t\t\t//transfer attributes to new element\r\n\t\t\tvar attributes = element.attributes;\r\n\t\t\t\r\n\t\t\t// loop through attributes and apply them on div\r\n\t\t\tfor(var i in attributes){\r\n\t\t\t\tif(typeof attributes[i] == \"object\"){\r\n\t\t\t\t\tnewElement.setAttribute(attributes[i].name, attributes[i].value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// replace table with div element\r\n\t\t\telement.parentNode.replaceChild(newElement, element);\r\n\t\t\t\r\n\t\t\tthis.element = element = newElement;\r\n\t\t}\r\n\t\t\r\n\t\telement.classList.add(\"tabulator\");\r\n\t\telement.setAttribute(\"role\", \"grid\");\r\n\t\t\r\n\t\t//empty element\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\t\r\n\t\t//set table height\r\n\t\tif(options.height){\r\n\t\t\toptions.height = isNaN(options.height) ? options.height : options.height + \"px\";\r\n\t\t\telement.style.height = options.height;\r\n\t\t}\r\n\t\t\r\n\t\t//set table min height\r\n\t\tif(options.minHeight !== false){\r\n\t\t\toptions.minHeight = isNaN(options.minHeight) ? options.minHeight : options.minHeight + \"px\";\r\n\t\t\telement.style.minHeight = options.minHeight;\r\n\t\t}\r\n\t\t\r\n\t\t//set table maxHeight\r\n\t\tif(options.maxHeight !== false){\r\n\t\t\toptions.maxHeight = isNaN(options.maxHeight) ? options.maxHeight : options.maxHeight + \"px\";\r\n\t\t\telement.style.maxHeight = options.maxHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//initialize core systems and modules\r\n\t_initializeTable(){\r\n\t\tvar element = this.element,\r\n\t\toptions = this.options;\r\n\t\t\r\n\t\tthis.interactionMonitor.initialize();\r\n\t\t\r\n\t\tthis.columnManager.initialize();\r\n\t\tthis.rowManager.initialize();\r\n\t\t\r\n\t\tthis._detectBrowser();\r\n\t\t\r\n\t\t//initialize core modules\r\n\t\tthis.modulesCore.forEach((mod) => {\r\n\t\t\tmod.initialize();\r\n\t\t})\r\n\t\t\r\n\t\t//build table elements\r\n\t\telement.appendChild(this.columnManager.getElement());\r\n\t\telement.appendChild(this.rowManager.getElement());\r\n\t\t\r\n\t\tif(options.footerElement){\r\n\t\t\tthis.footerManager.activate();\r\n\t\t}\r\n\t\t\r\n\t\tif(options.autoColumns && options.data){\r\n\t\t\t\r\n\t\t\tthis.columnManager.generateColumnsFromRowData(this.options.data);\r\n\t\t}\r\n\t\t\r\n\t\t//initialize regular modules\r\n\t\tthis.modulesRegular.forEach((mod) => {\r\n\t\t\tmod.initialize();\r\n\t\t});\r\n\t\t\r\n\t\tthis.columnManager.setColumns(options.columns);\r\n\t\t\r\n\t\tthis.eventBus.dispatch(\"table-built\");\r\n\t}\r\n\t\r\n\t_loadInitialData(){\r\n\t\tthis.dataLoader.load(this.options.data);\r\n\t}\r\n\t\r\n\t//deconstructor\r\n\tdestroy(){\r\n\t\tvar element = this.element;\r\n\t\t\r\n\t\tTableRegistry.deregister(this); //deregister table from inter-device communication\r\n\t\t\r\n\t\tthis.eventBus.dispatch(\"table-destroy\");\r\n\t\t\r\n\t\t//clear row data\r\n\t\tthis.rowManager.rows.forEach(function(row){\r\n\t\t\trow.wipe();\r\n\t\t});\r\n\t\t\r\n\t\tthis.rowManager.rows = [];\r\n\t\tthis.rowManager.activeRows = [];\r\n\t\tthis.rowManager.displayRows = [];\r\n\t\t\r\n\t\t//clear DOM\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\telement.classList.remove(\"tabulator\");\r\n\t}\r\n\t\r\n\t_detectBrowser(){\r\n\t\tvar ua = navigator.userAgent||navigator.vendor||window.opera;\r\n\t\t\r\n\t\tif(ua.indexOf(\"Trident\") > -1){\r\n\t\t\tthis.browser = \"ie\";\r\n\t\t\tthis.browserSlow = true;\r\n\t\t}else if(ua.indexOf(\"Edge\") > -1){\r\n\t\t\tthis.browser = \"edge\";\r\n\t\t\tthis.browserSlow = true;\r\n\t\t}else if(ua.indexOf(\"Firefox\") > -1){\r\n\t\t\tthis.browser = \"firefox\";\r\n\t\t\tthis.browserSlow = false;\r\n\t\t}else{\r\n\t\t\tthis.browser = \"other\";\r\n\t\t\tthis.browserSlow = false;\r\n\t\t}\r\n\t\t\r\n\t\tthis.browserMobile = /(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ua)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(ua.slice(0,4));\r\n\t}\r\n\t\r\n\tinitGuard(func, msg){\r\n\t\tvar stack, line;\r\n\t\t\r\n\t\tif(this.options.debugInitialization && !this.initialized){\r\n\t\t\tif(!func){\r\n\t\t\t\tstack = new Error().stack.split(\"\\n\");\r\n\t\t\t\t\r\n\t\t\t\tline = stack[0] == \"Error\" ? stack[2] : stack[1];\r\n\t\t\t\t\r\n\t\t\t\tif(line[0] == \" \"){\r\n\t\t\t\t\tfunc = line.trim().split(\" \")[1].split(\".\")[1];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfunc = line.trim().split(\"@\")[0];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconsole.warn(\"Table Not Initialized - Calling the \" + func + \" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function.\" + (msg ? \" \" + msg : \"\"));\r\n\t\t}\r\n\t\t\r\n\t\treturn this.initialized;\r\n\t}\r\n\t\r\n\t////////////////// Data Handling //////////////////\r\n\t//block table redrawing\r\n\tblockRedraw(){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.rowManager.blockRedraw();\r\n\t}\r\n\t\r\n\t//restore table redrawing\r\n\trestoreRedraw(){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.rowManager.restoreRedraw();\r\n\t}\r\n\t\r\n\t//load data\r\n\tsetData(data, params, config){\r\n\t\tthis.initGuard(false, \"To set initial data please use the 'data' property in the table constructor.\");\r\n\t\t\r\n\t\treturn this.dataLoader.load(data, params, config, false);\r\n\t}\r\n\t\r\n\t//clear data\r\n\tclearData(){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tthis.dataLoader.blockActiveLoad();\r\n\t\tthis.rowManager.clearData();\r\n\t}\r\n\t\r\n\t//get table data array\r\n\tgetData(active){\r\n\t\treturn this.rowManager.getData(active);\r\n\t}\r\n\t\r\n\t//get table data array count\r\n\tgetDataCount(active){\r\n\t\treturn this.rowManager.getDataCount(active);\r\n\t}\r\n\t\r\n\t//replace data, keeping table in position with same sort\r\n\treplaceData(data, params, config){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.dataLoader.load(data, params, config, true, true);\r\n\t}\r\n\t\r\n\t//update table data\r\n\tupdateData(data){\r\n\t\tvar responses = 0;\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data){\r\n\t\t\t\tdata.forEach((item) => {\r\n\t\t\t\t\tvar row = this.rowManager.findRow(item[this.options.index]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(row){\r\n\t\t\t\t\t\tresponses++;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trow.updateData(item)\r\n\t\t\t\t\t\t.then(()=>{\r\n\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\tresolve();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\taddData(data, pos, index){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data){\r\n\t\t\t\tthis.rowManager.addRows(data, pos, index)\r\n\t\t\t\t.then((rows) => {\r\n\t\t\t\t\tvar output = [];\r\n\t\t\t\t\t\r\n\t\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\t\toutput.push(row.getComponent());\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tresolve(output);\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//update table data\r\n\tupdateOrAddData(data){\r\n\t\tvar rows = [],\r\n\t\tresponses = 0;\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data){\r\n\t\t\t\tdata.forEach((item) => {\r\n\t\t\t\t\tvar row = this.rowManager.findRow(item[this.options.index]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tresponses++;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(row){\r\n\t\t\t\t\t\trow.updateData(item)\r\n\t\t\t\t\t\t.then(()=>{\r\n\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\trows.push(row.getComponent());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\tresolve(rows);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.rowManager.addRows(item)\r\n\t\t\t\t\t\t.then((newRows)=>{\r\n\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\trows.push(newRows[0].getComponent());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\tresolve(rows);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//get row object\r\n\tgetRow(index){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching row found:\", index);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//get row object\r\n\tgetRowFromPosition(position, active){\r\n\t\tvar row = this.rowManager.getRowFromPosition(position, active);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching row found:\", position);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//delete row from table\r\n\tdeleteRow(index){\r\n\t\tvar foundRows = [];\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(!Array.isArray(index)){\r\n\t\t\tindex = [index];\r\n\t\t}\r\n\t\t\r\n\t\t//find matching rows\r\n\t\tfor(let item of index){\r\n\t\t\tlet row = this.rowManager.findRow(item, true);\r\n\t\t\t\r\n\t\t\tif(row){\r\n\t\t\t\tfoundRows.push(row);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Delete Error - No matching row found:\", item);\r\n\t\t\t\treturn Promise.reject(\"Delete Error - No matching row found\")\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//sort rows into correct order to ensure smooth delete from table\r\n\t\tfoundRows.sort((a, b) => {\r\n\t\t\treturn this.rowManager.rows.indexOf(a) > this.rowManager.rows.indexOf(b) ? 1 : -1;\r\n\t\t});\r\n\t\t\r\n\t\t//delete rows\r\n\t\tfoundRows.forEach((row) =>{\r\n\t\t\trow.delete()\r\n\t\t});\r\n\t\t\r\n\t\tthis.rowManager.reRenderInPosition();\r\n\t\t\r\n\t\treturn Promise.resolve();\r\n\t}\r\n\t\r\n\t//add row to table\r\n\taddRow(data, pos, index){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.rowManager.addRows(data, pos, index)\r\n\t\t.then((rows)=>{\r\n\t\t\treturn rows[0].getComponent();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//update a row if it exitsts otherwise create it\r\n\tupdateOrAddRow(index, data){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.updateData(data)\r\n\t\t\t.then(()=>{\r\n\t\t\t\treturn row.getComponent();\r\n\t\t\t})\r\n\t\t}else{\r\n\t\t\treturn this.rowManager.addRows(data)\r\n\t\t\t.then((rows)=>{\r\n\t\t\t\treturn rows[0].getComponent();\r\n\t\t\t})\r\n\t\t}\r\n\t}\r\n\t\r\n\t//update row data\r\n\tupdateRow(index, data){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.updateData(data)\r\n\t\t\t.then(()=>{\r\n\t\t\t\treturn Promise.resolve(row.getComponent());\r\n\t\t\t})\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Update Error - No matching row found:\", index);\r\n\t\t\treturn Promise.reject(\"Update Error - No matching row found\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t//scroll to row in DOM\r\n\tscrollToRow(index, position, ifVisible){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn this.rowManager.scrollToRow(row, position, ifVisible)\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Scroll Error - No matching row found:\", index);\r\n\t\t\treturn Promise.reject(\"Scroll Error - No matching row found\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveRow(from, to, after){\r\n\t\tvar fromRow = this.rowManager.findRow(from);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(fromRow){\r\n\t\t\tfromRow.moveToRow(to, after);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching row found:\", from);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRows(active){\r\n\t\treturn this.rowManager.getComponents(active);\t\r\n\t}\r\n\t\r\n\t//get position of row in table\r\n\tgetRowPosition(index, active){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn this.rowManager.getRowPosition(row, active);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Position Error - No matching row found:\", index);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t/////////////// Column Functions ///////////////\r\n\tsetColumns(definition){\r\n\t\tthis.initGuard(false, \"To set initial columns please use the 'columns' property in the table constructor\");\r\n\t\t\r\n\t\tthis.columnManager.setColumns(definition);\r\n\t}\r\n\t\r\n\tgetColumns(structured){\r\n\t\treturn this.columnManager.getComponents(structured);\r\n\t}\r\n\t\r\n\tgetColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetColumnDefinitions(){\r\n\t\treturn this.columnManager.getDefinitionTree();\r\n\t}\r\n\t\r\n\tshowColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tcolumn.show();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Show Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\thideColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field); \r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tcolumn.hide();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Hide Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\ttoggleColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tif(column.visible){\r\n\t\t\t\tcolumn.hide();\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.show();\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Visibility Toggle Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColumn(definition, before, field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.columnManager.addColumn(definition, before, column)\r\n\t\t.then((column) => {\r\n\t\t\treturn column.getComponent();\r\n\t\t});\r\n\t}\r\n\t\r\n\tdeleteColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.delete();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Delete Error - No matching column found:\", field);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tupdateColumnDefinition(field, definition){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.updateDefinition(definition)\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Update Error - No matching column found:\", field);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveColumn(from, to, after){\r\n\t\tvar fromColumn = this.columnManager.findColumn(from),\r\n\t\ttoColumn = this.columnManager.findColumn(to);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(fromColumn){\r\n\t\t\tif(toColumn){\r\n\t\t\t\tthis.columnManager.moveColumn(fromColumn, toColumn, after)\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Move Error - No matching column found:\", toColumn);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching column found:\", from);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//scroll to column in DOM\r\n\tscrollToColumn(field, position, ifVisible){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\treturn this.columnManager.scrollToColumn(column, position, ifVisible)\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - No matching column found:\", field);\r\n\t\t\t\treturn Promise.reject(\"Scroll Error - No matching column found\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//////////// General Public Functions ////////////\r\n\t//redraw list without updating data\r\n\tredraw(force){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.columnManager.redraw(force);\r\n\t\tthis.rowManager.redraw(force);\r\n\t}\r\n\t\r\n\tsetHeight(height){\r\n\t\tthis.options.height = isNaN(height) ? height : height + \"px\";\r\n\t\tthis.element.style.height = this.options.height;\r\n\t\tthis.rowManager.initializeRenderer();\r\n\t\tthis.rowManager.redraw();\r\n\t}\r\n\t\r\n\t//////////////////// Event Bus ///////////////////\r\n\t\r\n\ton(key, callback){\r\n\t\tthis.externalEvents.subscribe(key, callback);\r\n\t}\r\n\t\r\n\toff(key, callback){\r\n\t\tthis.externalEvents.unsubscribe(key, callback);\r\n\t}\r\n\t\r\n\tdispatchEvent(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args.shift();\r\n\t\t\r\n\t\tthis.externalEvents.dispatch(...arguments)\r\n\t}\r\n\r\n\t//////////////////// Alerts ///////////////////\r\n\r\n\talert(contents, type){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.alertManager.alert(contents, type);\r\n\t}\r\n\r\n\tclearAlert(){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.alertManager.clear();\r\n\t}\r\n\t\r\n\t////////////// Extension Management //////////////\r\n\tmodExists(plugin, required){\r\n\t\tif(this.modules[plugin]){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tif(required){\r\n\t\t\t\tconsole.error(\"Tabulator Module Not Installed: \" + plugin);\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tmodule(key){\r\n\t\tvar mod = this.modules[key];\r\n\t\t\r\n\t\tif(!mod){\r\n\t\t\tconsole.error(\"Tabulator module not installed: \" + key);\r\n\t\t}\r\n\t\t\r\n\t\treturn mod;\r\n\t}\r\n}\r\n\r\n//default setup options\r\nTabulator.defaultOptions = defaultOptions;\r\n\r\n//bind modules and static functionality\r\nnew ModuleBinder(Tabulator);\r\n\r\nexport default Tabulator;\r\n","export default class PseudoRow {\r\n\r\n\tconstructor (type){\r\n\t\tthis.type = type;\r\n\t\tthis.element = this._createElement();\r\n\t}\r\n\r\n\t_createElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tel.classList.add(\"tabulator-row\");\r\n\t\treturn el;\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\tgetComponent(){\r\n\t\treturn false;\r\n\t}\r\n\r\n\tgetData(){\r\n\t\treturn {};\r\n\t}\r\n\r\n\tgetHeight(){\r\n\t\treturn this.element.outerHeight;\r\n\t}\r\n\r\n\tinitialize(){}\r\n\r\n\treinitialize(){}\r\n\r\n\tnormalizeHeight(){}\r\n\r\n\tgenerateCells(){}\r\n\r\n\treinitializeHeight(){}\r\n\r\n\tcalcHeight(){}\r\n\r\n\tsetCellHeight(){}\r\n\r\n\tclearCellHeight(){}\r\n}"],"names":["CoreFeature","[object Object]","table","this","data","silent","columnsChanged","dataLoader","load","undefined","modules","localize","getText","arguments","bind","getLocale","comms","getConnections","send","layout","getMode","eventBus","subscribe","unsubscribe","key","subscribed","subscriptionChange","dispatch","chain","confirm","externalEvents","options","value","module","Helpers","el","offsetWidth","offsetHeight","box","getBoundingClientRect","top","window","pageYOffset","document","documentElement","clientTop","left","pageXOffset","clientLeft","obj","clone","list","objectProto","__proto__","arrayProto","i","Object","assign","Array","isArray","match","copy","subject","findIndex","item","unshift","deepClone","Popup","element","parent","super","container","_lookupContainer","reversedX","childPopup","blurable","blurCallback","renderedCallback","visible","classList","add","blurEvent","hide","escEvent","_escapeCheck","popupContainer","querySelector","console","warn","_checkContainerIsParent","body","parentNode","callback","e","touch","MouseEvent","x","touches","pageX","y","pageY","parentOffset","elOffset","position","containerOffset","offset","origin","parentEl","coords","HTMLElement","elementPositionCoords","containerEventCoords","style","appendChild","_fitToScreen","scrollTop","right","Math","max","scrollHeight","parseInt","setTimeout","rowManager","addEventListener","keyCode","removeEventListener","removeChild","Module","name","_handler","optionsList","register","columnManager","func","args","initGuard","component","handler","componentFunctionBinder","priority","registerDataPipelineHandler","registerDisplayPipelineHandler","renderInPosition","refreshActiveData","footerManager","append","prepend","remove","menuEl","menuContainer","content","type","alertManager","alert","clear","Accessor","allowedTypes","registerColumnOption","initializeColumn","transformRow","column","config","forEach","accessor","charAt","toUpperCase","slice","definition","lookupAccessor","params","accessors","row","rowComponent","getComponent","traverse","colCompnent","getFieldValue","setFieldValue","moduleName","generateParamsList","prefix","output","concat","push","serializeParams","encoded","encodeURIComponent","join","url","keys","length","method","toLowerCase","includes","json","headers","Content-Type","JSON","stringify","form","FormData","Ajax","urlGenerator","loaderPromise","registerTableOption","contentTypeFormatters","ajaxRequestFunc","defaultLoaderPromise","ajaxURLGenerator","defaultURLGenerator","ajaxURL","setUrl","setDefaultConfig","ajaxConfig","registerTableFunction","getUrl","requestDataCheck","requestParams","requestData","ajaxParams","call","previousData","generateConfig","sendRequest","defaultConfig","ajaxRequesting","then","ajaxResponse","Promise","reject","contentType","resolve","ajaxContentType","Accept","mode","location","credentials","fetch","response","ok","catch","error","status","statusText","defaultContentTypeFormatters","Clipboard","pasteParser","pasteAction","customSelection","rowRange","blocked","clipboard","clipboardCopyRowRange","plain","html","preventDefault","clipboardCopyFormatter","export","generateExportList","clipboardCopyConfig","clipboardCopyStyled","genereateHTMLTable","generatePlainContent","clipboardData","setData","originalEvent","dispatchExternal","reset","paste","setPasteParser","clipboardPasteParser","setPasteAction","clipboardPasteAction","rowData","columns","col","getKey","range","internal","sel","textRange","getSelection","createRange","selectNodeContents","toString","removeAllRanges","addRange","selection","createTextRange","moveToElementText","select","execCommand","action","pasteActions","parser","pasteParsers","rows","checkPaseOrigin","getPasteData","modExists","mutateData","mutator","valid","target","tagName","edit","currentCell","getData","replace","update","updateOrAddData","insert","addData","headerFindSuccess","columnMap","split","find","title","trim","field","columnsByIndex","shift","CalcComponent","_row","Proxy","get","receiver","handle","transform","getElement","cells","getCells","cell","getCell","CellComponent","_cell","getValue","getOldValue","initialValue","getField","mutate","setValue","setValueActual","checkHeight","Cell","oldValue","height","width","minWidth","loaded","build","generateElement","setWidth","_configureCell","createElement","className","setAttribute","textAlign","hozAlign","vertAlign","display","alignItems","bottom","middle","justifyContent","center","cssClass","val","innerHTML","Node","firstChild","containerOnly","layoutElement","force","setValueProcessData","cellRendered","cellEdited","subscribedExternal","changed","_generateContents","widthStyled","minWidthStyled","maxWidth","maxWidthStyled","reinitializeHeight","heightStyled","redrawBlock","deleteCell","calcs","getCellIndex","ColumnComponent","_column","getDefinition","getTitleDownload","isGroup","show","delete","Column","scrollToColumn","to","after","toColumn","findColumn","moveColumn","nextCol","nextColumn","prevCol","prevColumn","updates","updateDefinition","getWidth","result","reinitializeWidth","renderer","rerenderColumns","maxInitialWidth","variableHeight","headerVertical","headerHozAlign","editableTitle","def","contentElement","titleHolderElement","titleElement","groupElement","createGroupElement","fieldStructure","titleDownload","titleFormatterRendered","mapDefinitions","setField","widthFixed","newCol","attachColumn","checkColumnVisibility","registerColumnField","_initialize","bindModuleColumns","defaults","columnDefaults","generate","defaultOptionList","indexOf","nestedFieldSeparator","_getNestedData","_getFlatData","_setNestedData","_setFlatData","registerColumnPosition","reRegisterPosition","_bindEvents","_buildColumnHeaderContent","_buildGroupHeader","_buildColumnHeader","dblTap","tapHold","tap","headerClick","headerDblClick","headerContext","passive","headerTap","clearTimeout","headerDblTap","headerTapHold","setMinWidth","setMaxWidth","_buildColumnHeaderTitle","langBind","contents","structure","dataObj","paddingTop","colDefs","childWidth","heightInitialized","index","setTo","active","manualHeight","outerHeight","initialized","created","maxHeight","tempData","updatedData","findCell","moveRowActual","blockRedraw","detatchModules","values","topCalcs","botCalcs","genColumn","topElement","botElement","topRow","botRow","topInitialized","initializeColumnCheck","tableRedraw","recalcRowGroup","recalcAll","groupBy","columnCalcs","topCalcParams","botCalcParams","calculations","botInitialized","footerPrepend","generateRow","group","updateData","dataTreeChildColumnCalcs","children","pos","format","formatter","paramKey","results","subGroups","getSubGroups","subGroupResults","groupObj","ColumnCalcs","indent","collapseEl","expandEl","branchEl","registerComponentFunction","expandRow","dataTreeChildField","dummyEl","dataTreeCollapseElement","tabIndex","dataTreeExpandElement","rowDelete","layoutRow","childArray","dataTree","open","controlEl","child","cloneNode","stopPropagation","oldControl","create","allChildren","childData","childRow","collapseRow","Row","initializeRow","defaultDownloaders","csv","setFileContents","fileContents","depth","jsonLines","pdf","header","autoTableParams","fontStyle","fontSize","cellPadding","fillColor","jsPDFParams","colSpan","rowSpan","doc","head","xlsx","sheetName","workbook","utils","tableFeatures","generateSheet","merges","worksheet","SheetNames","sheet","buf","s","Uint8Array","download","downloadFunc","triggerDownload","interceptCallback","groupHeader","blob","Blob","navigator","maskInput","maskLetter","maskLetterChar","maskNumber","symbol","char","isNaN","Download","editor","displayItems","focusedItem","listEl","initialValues","isFilter","filterTimeout","typing","popup","listIteration","cellEl","input","padding","autocomplete","attribs","valueCheck","verticalNavigation","placeholderLoading","filterDelay","emptyValue","stopImmediatePropagation","_focusItem","_chooseItem","_generateOptions","_sortOptions","itteration","_ajaxRequest","valuesURL","placeholder","label","itemParams","elementAttributes","selected","level","sorter","as","bs","a","String","b","rd","rx","L","a1","isFinite","emptyAlign","filtered","matches","option","term","_clearList","itemFormatter","_groupClick","_styleItem","currentItems","onRendered","editorParams","cellValue","cancel","vertNav","boxSizing","onChange","blurFunc","star","maxStars","size","stars","starChange","nextStar","success","starsHolder","whiteSpace","verticalAlign","getAttribute","progress","min","percent","bar","calcVal","backgroundColor","mouseDrag","mouseDragWidth","updateValue","tristate","indetermValue","indetermState","falseValueSet","checkedValue","trueValue","falseValue","browser","mouseClick","recursionBlock","editedCells","editors","navigatePrev","navigateNext","keybindingNavigateNext","newRow","addRow","nextCell","prevRow","nextRow","allowEdit","elVisible","prevCell","clearEditor","button","self","forceEdit","getRenderMode","bottomEdge","rowEl","rightEdge","leftEdge","renderHorizontal","scrollLeft","rendered","cancelEdit","editIndex","Edit$1","ExportRow","ExportColumn","colVisProp","cloneTableStyle","getDisplayRows","groupData","maxDepth","exportRows","headerDepth","headerEl","bodyEl","styles","setup","rowFormatter","oddRow","evenRow","calcRow","styleCells","getElementsByClassName","mapElementStyles","treeElementField","holder","genereateTableElement","background-color","color","font-weight","font-family","font-size","text-align","border-top","border-left","border-right","border-bottom","padding-top","padding-left","padding-right","getComputedStyle","Export","filterParams","rowVal","filterVal","filterList","headerFilterColumns","prevHeaderFilterChangeCheck","tableInitialized","userSetFilter","userSetHeaderFilterFocus","userRemoveFilter","initialHeaderFilter","getHeaderFilterValue","filterChangeCheck","filter","prevSuccess","Filter","filterFunc","attrType","filterElement","getColumn","normalizeHeight","typingTimer","headerFilterLiveFilterDelay","headerFilter","editorElement","filterMode","ajax","headerFilters","activeRows","getFilters","plaintext","textarea","money","number","sign","decimalSym","thousandSym","negativeSign","integer","link","urlPrefix","formatterParams","image","tickCross","empty","truthy","tick","tickElement","datetime","DT","inputFormat","newDatetime","setZone","invalid","datetimediff","invalidPlaceholder","suffix","unit","lookup","traffic","percentValue","round","colors","floor","legend","legendColor","barEl","barContainer","legendEl","legendAlign","holderEl","buttonTick","buttonCross","rownum","checkbox","selectRow","Format","formatters","entityMap","&","<",">","\"","'","/","leftColumns","rightColumns","leftMargin","rightMargin","rightPadding","initializationMode","layoutCell","groups","leftParents","headersElement","frozen","margin","allCells","calcMargins","paddingLeft","FrozenColumns","refreshData","FrozenRows","GroupComponent","_group","Group","groupManager","hasSubGroups","old","groupList","generator","elementContents","createElements","createValueGroups","arrow","groupKey","groupID","toIndex","generateGroupHeaderContents","marginLeft","noCalc","_visSet","getHeadersAndRows","prev","compoment","groupIDLookups","startOpen","headerGenerator","displayHandler","userGetGroupedData","configureGroupSetup","wipe","rowMoving","groupStartOpen","prevValue","groupRows","moveRowInArray","prevDisplayRow","from","generateGroups","updateGroupRows","groupComponents","headerContent","groupListData","oldGroups","oldRowGroup","groupId","GroupRows","cellUpdated","rowMoved","getRowPosition","history","History","oldRow","rowAdd","deleteActual","_rebindRow","rowMove","hasIndex","originalElement","_extractOptions","fieldIndex","HtmlTableImport","inQuote","importFormat","importer","extension","pickFile","importData","onerror","parsedData","Import","rowClick","rowDblClick","rowContext","rowMouseEnter","rowMouseLeave","rowMouseMove","rowTap","rowDblTap","rowTapHold","cellClick","cellDblClick","cellContext","cellMouseEnter","cellMouseLeave","cellMouseMove","cellTap","cellDblTap","cellTapHold","headerMouseEnter","headerMouseLeave","headerMouseMove","groupClick","groupDblClick","groupContext","groupMouseEnter","groupMouseLeave","subscribers","touchSubscribers","touchWatchers","tapDbl","added","eventMap","subscribeTouchEvents","subscriptionChanged","watchers","Interaction","Keybindings","watchKeys","pressedKeys","mergedBindings","actions","bindings","meta","binding","navPrev","navNext","navUp","navDown","scrollPageUp","scrollPageDown","undo","scrollToRow","focus","Menu","rootPopup","columnSubscribers","rowClickMenu","headerContextMenu","initializeColumnHeaderMenu","contextMenu","icon","headerMenu","menu","loadMenu","parentPopup","nestedMenuBlock","itemEl","MoveColumns","placeholderElement","hoverElement","checkTimeout","checkPeriod","moving","toCol","startX","autoScrollMargin","autoScrollTimeout","colEl","nextColWidthLast","prevColWidth","startXMove","moveToCol","nextColWidth","headerElement","clientHeight","toColAfter","_unbindMouseMove","xPos","MoveRows","toRow","toRowAfter","hasHandle","moveHover","endMove","tableRowDropEvent","touchMove","connection","connectionSelectorsTables","connectionElements","connections","connectedTable","connectedRow","movableRowsConnectedTables","connectionSelectorsElements","mousemove","insertBefore","nextSibling","moveRow","tableRowDrop","which","rowHandle","nextRowHeight","diff","startYMove","moveToRow","nextRowHeightLast","setStartPosition","yPos","connectionTables","commsConnections","prototype","fromRow","Mutator","enabled","transformCell","linkCell","ofEl","showingEl","rowsEl","totalRows","valueEl","totalEl","Page","progressiveLoad","pageCounterElement","page","count","displayIndex","initialLoad","dataChanging","pageSizes","setMaxPage","calculatePageSizes","registerDisplayHandler","initializePageCounter","remotePageParams","dispRows","paginationSize","testElRow","testElCell","setPageToRow","firstBut","nextBut","paginationSizeSelector","pageCounter","pageSelectLabel","prevBut","setPage","previousPage","nextPage","paginationElement","pageSizeSelect","lastBut","rowCount","currentRow","rightSize","disabled","end","_setPageButtons","actualStartRow","scrollHorizontal","cookie","cookiePos","localStorage","expireDate","setDate","Persistence","id","defWatcherBlock","persistence","readers","readFunc","persistenceWriterFunc","retreiveData","retreivedData","sort","sorters","initialSort","props","mergeDefinition","current","oldCols","parseColumns","validateSorters","writeFunc","definitions","defStore","moduleInitOrder","Popup$1","initializeRowWatchers","initializeGroupWatchers","headerPopupEl","contentsEl","Print","manualBlock","scrollY","tableEl","printHeader","footerContent","scrollX","ReactiveData","origFuncs","currentVersion","version","defineProperty","pop","splice","childField","configurable","apply","getOwnPropertyDescriptor","ResizeColumns","startColumn","startWidth","deInitializeComponent","resize","nearestColumn","initialNextColumn","handleDown","parentElement","mouseMove","mouseUp","ResizeRows","prevHandle","observer","autoResize","containerHeight","containerWidth","tableHeight","browserMobile","ResizeTable","ResponsiveLayout","hiddenColumns","collapseStartOpen","responsiveLayout","collapseHandleColumn","generateCollapsedRowContent","colCount","working","titleHighlight","text","SelectRow","selecting","lastClickedRow","selectPrev","headerCheckboxElement","toggleRow","shiftKey","rowIdx","fromRowIdx","deselectRows","toggledRows","_rowSelectionChanged","_selectRow","rowInfo","selectedRows","datetime$1","DateTime","isDateTime","fromISO","fromFormat","decimalSeparator","thousandSeparator","string","langLocale","boolean","d","c","calc","alignEmptyValues","aRow","b1","sortList","tableBuilt","setSort","dir","startingDir","columnHeaderSortMulti","rowComponents","sortMode","sortObj","_sortItems","el1Comp","el2","Sort","Tooltip","tooltipSubscriber","headerSubscriber","tooltip","clearPopup","popupInstance","Number","float","parameters","ends","Validate","clearValidation","columnValidate","validate","_buildValidator","validators","validationMode","invalidIndex","invalidCells","ResponsiveLayoutModule","SelectRowModule","SortModule","TooltipModule","ifVisible","rowIndex","elementVertical","VirtualDomHorizontal","rightCol","vDomScrollPosRight","vDomPadLeft","vDomPadRight","fitDataColAvg","visibleRows","isFitData","scroll","cols","colPos","reinitChanged","change","layoutRefresh","removeColRight","fitDataColActualWidthCheck","changes","widthDiff","newWidth","ColumnManager","blockHozScrollEvent","renderClass","renderers","redraw","nextToColumn","parentIndex","nextEl","minHeight","verticalAlignHeaders","updateRows","fromIndex","adjust","offsetLeft","reinitialize","BaiscVertical","VirtualDomVertical","vDomRowHeight","vDomTop","vDomScrollPosBottom","vDomBottomPad","paddingBottom","topOffset","deinitializeHeight","_addBottomRow","bottomDiff","topPad","heightOccupied","vDomWindowBuffer","fillableSpace","getHeight","vDomScrollPosTop","removableRows","vDomBottom","RowManager","tableElement","heightFixer","placeholderContents","firstRender","renderMode","displayRows","displayRowsCount","rowNumColumn","initializePlaceholder","initializeRenderer","_positionPlaceholder","activeIndex","displayRowIterator","regenerateRowNumbers","_clearPlaceholder","setActiveRows","findRowIndex","getRows","skipStage","stage","renderColumns","dataPipeline","displayPipeline","basic","fixedHeight","_clearTable","renderEmptyScroll","_showPlaceholder","otherHeight","redrawBlockRestoreConfig","renderTable","containerElement","InteractionManager","tabulator-cell","subscriber","listenerMap","components","pseudoTrackers","pseudoMouseEnter","pseudoMouseLeave","linkedKeys","listeners","listener","targets","previousTargets","funcName","DataLoader","debug","subscriptionNotifiers","events","_notifiySubscriptionChange","confirmed","notifiers","_confirm","TableRegistry","lastCol","flexGrowUnits","remainingSpace","changeUnits","calcShrink","remainingFlexGrowUnits","shrinkCols","oversizeCols","oversizeSpace","freeSpace","fixedWidth","fixedShrinkColumns","flexColWidth","flexColumns","Layout","Localize","lang","_setLangProp","langList","desiredLocale","locale","path","trans","root","rootPath","items","loading","page_size","next","next_title","all","Comms","con","coreModules","tabulator","registerModule","bindModules","moduleBindings","mod","orderedStartMods","msgElement","Tabulator","vdomHoz","interactionMonitor","ComponentFunctionBinder","initialize","_loadInitialData","attributes","setColumns","ua","Error","responses","parse","findRow","foundRows","plugin","debugEventsExternal","debugInvalidOptions","columnHeaderVertAlign","autoColumns","addRowPos","headerVisible","renderVerticalBuffer","scrollToRowPosition","scrollToColumnIfVisible","rowFormatterPrint","rowFormatterClipboard","rowFormatterHtmlOutput","rowHeight","dataLoaderError","ModuleBinder"],"mappings":";AAAe,MAAMA,EAEpBC,YAAYC,GACXC,KAAKD,MAAQA,EAOdD,WAAWG,EAAMC,EAAQC,GACxB,OAAOH,KAAKD,MAAMK,WAAWC,KAAKJ,OAAMK,OAAWA,OAAWA,EAAWJ,EAAQC,GAOlFL,WACC,OAAOE,KAAKD,MAAMQ,QAAQC,SAASC,WAAWC,WAG/CZ,WACC,OAAOE,KAAKD,MAAMQ,QAAQC,SAASG,QAAQD,WAG5CZ,aACC,OAAOE,KAAKD,MAAMQ,QAAQC,SAASI,aAAaF,WAQjDZ,mBACC,OAAOE,KAAKD,MAAMQ,QAAQM,MAAMC,kBAAkBJ,WAGnDZ,YACC,OAAOE,KAAKD,MAAMQ,QAAQM,MAAME,QAAQL,WAOzCZ,aACC,OAAOE,KAAKD,MAAMQ,QAAQS,OAAOC,UAGlCnB,gBACC,OAAOE,KAAKD,MAAMQ,QAAQS,OAAOA,SAQlClB,YACC,OAAOE,KAAKD,MAAMmB,SAASC,aAAaT,WAGzCZ,cACC,OAAOE,KAAKD,MAAMmB,SAASE,eAAeV,WAG3CZ,WAAWuB,GACV,OAAOrB,KAAKD,MAAMmB,SAASI,WAAWD,GAGvCvB,qBACC,OAAOE,KAAKD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yCAINmF,wDACO6I,wDAKTnO,YAAY2d,OACX,IAAIjT,6BAEJ,6CAGCpF,QAAQC,6HAMKrF,2BAEdA,+BAGmB4Y,wIAYT5Y,kJAWAoK,wIAGoBA,4DAO/BtK,aACC,oCAA2C8T,cAG5BlJ,uMAgBf,GAFA1K,oBAMC,OADAoF,aAAa,oHAUd,GAFApF,2BAKCoF,iEACO,iCAKKpF,wDAYZ,OADAoF,8EACO,8BAITtF,iBACC,IAAI+J,EAAS7J,KAAKiI,cAAc8Q,WAAWnF,GAI3C,OAFA5T,KAAKoI,gDAGJ2F,mFAUD,OAFA/N,+BAKCoF,aAAa,iJAQdpF,uDAKc,mKASdA,0BAIOiI,yPAeOA,wKAWdjI,yKASAA,KAAKuH,gCACLvH,iCAMAA,KAAK2B,eAAeR,mFAQH22B,+FAWjB93B,wBAAwBkd,6DAUzBpd,UAAUu4C,KACT,6IAce,yCCz2BFd,mB5BWde,8CAEAC,qBAAoB,yBAGpBhjC,uBAEAyI,WAAU,EAEVw6B,yDAKAp9B,kBAEAnb,MAAK,EAELw4C,mFAOAh7B,gCAIAi7B,mBAEAC,0CAGAnsB,yBACAosB,uBAEAC,gFAIAC,2BAEAnrB,gBACAorB,kBAAkB,KAClBC,2BACAC,uBAAuB,KAEvBC,eAEAjyB,kDC5DAkyB,sF2BED,WAIA,qBAEA,IAAIC,UAEJ,SAECt5C,eACCE,UAAYoJ,EACZpJ,oDAIA"} \ No newline at end of file +{"version":3,"file":"tabulator_esm.min.js","sources":["../../src/js/core/CoreFeature.js","../../src/js/core/tools/Helpers.js","../../src/js/core/tools/Popup.js","../../src/js/core/Module.js","../../src/js/modules/Accessor/Accessor.js","../../src/js/modules/Accessor/defaults/accessors.js","../../src/js/modules/Ajax/defaults/urlGenerator.js","../../src/js/modules/Ajax/defaults/contentTypeFormatters.js","../../src/js/modules/Ajax/Ajax.js","../../src/js/modules/Ajax/defaults/config.js","../../src/js/modules/Ajax/defaults/loaderPromise.js","../../src/js/modules/Clipboard/Clipboard.js","../../src/js/modules/Clipboard/defaults/pasteActions.js","../../src/js/modules/Clipboard/defaults/pasteParsers.js","../../src/js/modules/ColumnCalcs/CalcComponent.js","../../src/js/core/cell/CellComponent.js","../../src/js/core/cell/Cell.js","../../src/js/core/column/ColumnComponent.js","../../src/js/core/column/defaults/options.js","../../src/js/core/column/Column.js","../../src/js/core/row/RowComponent.js","../../src/js/core/row/Row.js","../../src/js/modules/ColumnCalcs/defaults/calculations.js","../../src/js/modules/ColumnCalcs/ColumnCalcs.js","../../src/js/modules/DataTree/DataTree.js","../../src/js/modules/Download/defaults/downloaders.js","../../src/js/modules/Download/defaults/downloaders/csv.js","../../src/js/modules/Download/defaults/downloaders/json.js","../../src/js/modules/Download/defaults/downloaders/jsonLines.js","../../src/js/modules/Download/defaults/downloaders/pdf.js","../../src/js/modules/Download/defaults/downloaders/xlsx.js","../../src/js/modules/Download/defaults/downloaders/html.js","../../src/js/modules/Download/Download.js","../../src/js/modules/Edit/inputMask.js","../../src/js/modules/Edit/List.js","../../src/js/modules/Edit/defaults/editors.js","../../src/js/modules/Edit/defaults/editors/input.js","../../src/js/modules/Edit/defaults/editors/textarea.js","../../src/js/modules/Edit/defaults/editors/number.js","../../src/js/modules/Edit/defaults/editors/range.js","../../src/js/modules/Edit/defaults/editors/select.js","../../src/js/modules/Edit/defaults/editors/list.js","../../src/js/modules/Edit/defaults/editors/autocomplete.js","../../src/js/modules/Edit/defaults/editors/star.js","../../src/js/modules/Edit/defaults/editors/progress.js","../../src/js/modules/Edit/defaults/editors/tickCross.js","../../src/js/modules/Edit/Edit.js","../../src/js/modules/Export/ExportRow.js","../../src/js/modules/Export/ExportColumn.js","../../src/js/modules/Export/Export.js","../../src/js/modules/Filter/defaults/filters.js","../../src/js/modules/Filter/Filter.js","../../src/js/modules/Format/defaults/formatters/plaintext.js","../../src/js/modules/Format/defaults/formatters.js","../../src/js/modules/Format/defaults/formatters/html.js","../../src/js/modules/Format/defaults/formatters/textarea.js","../../src/js/modules/Format/defaults/formatters/money.js","../../src/js/modules/Format/defaults/formatters/link.js","../../src/js/modules/Format/defaults/formatters/image.js","../../src/js/modules/Format/defaults/formatters/tickCross.js","../../src/js/modules/Format/defaults/formatters/datetime.js","../../src/js/modules/Format/defaults/formatters/datetimediff.js","../../src/js/modules/Format/defaults/formatters/lookup.js","../../src/js/modules/Format/defaults/formatters/star.js","../../src/js/modules/Format/defaults/formatters/traffic.js","../../src/js/modules/Format/defaults/formatters/progress.js","../../src/js/modules/Format/defaults/formatters/color.js","../../src/js/modules/Format/defaults/formatters/handle.js","../../src/js/modules/Format/defaults/formatters/responsiveCollapse.js","../../src/js/modules/Format/defaults/formatters/rowSelection.js","../../src/js/modules/Format/Format.js","../../src/js/modules/FrozenColumns/FrozenColumns.js","../../src/js/modules/FrozenRows/FrozenRows.js","../../src/js/modules/GroupRows/GroupComponent.js","../../src/js/modules/GroupRows/Group.js","../../src/js/modules/GroupRows/GroupRows.js","../../src/js/modules/History/defaults/undoers.js","../../src/js/modules/History/History.js","../../src/js/modules/HtmlTableImport/HtmlTableImport.js","../../src/js/modules/History/defaults/redoers.js","../../src/js/modules/Import/defaults/importers/csv.js","../../src/js/modules/Import/Import.js","../../src/js/modules/Import/defaults/importers/json.js","../../src/js/modules/Interaction/Interaction.js","../../src/js/modules/Keybindings/defaults/bindings.js","../../src/js/modules/Keybindings/Keybindings.js","../../src/js/modules/Menu/Menu.js","../../src/js/modules/Keybindings/defaults/actions.js","../../src/js/modules/MoveColumns/MoveColumns.js","../../src/js/modules/MoveRows/MoveRows.js","../../src/js/modules/Mutator/defaults/mutators.js","../../src/js/modules/Mutator/Mutator.js","../../src/js/modules/Page/defaults/pageCounters/rows.js","../../src/js/modules/Page/Page.js","../../src/js/modules/Page/defaults/pageCounters/pages.js","../../src/js/modules/Page/defaults/pageCounters.js","../../src/js/modules/Persistence/defaults/readers.js","../../src/js/modules/Persistence/defaults/writers.js","../../src/js/modules/Persistence/Persistence.js","../../src/js/modules/Popup/Popup.js","../../src/js/modules/Print/Print.js","../../src/js/modules/ReactiveData/ReactiveData.js","../../src/js/modules/ResizeColumns/ResizeColumns.js","../../src/js/modules/ResizeRows/ResizeRows.js","../../src/js/modules/ResizeTable/ResizeTable.js","../../src/js/modules/ResponsiveLayout/ResponsiveLayout.js","../../src/js/modules/SelectRow/SelectRow.js","../../src/js/modules/Sort/defaults/sorters/datetime.js","../../src/js/modules/Sort/defaults/sorters/date.js","../../src/js/modules/Sort/defaults/sorters/number.js","../../src/js/modules/Sort/defaults/sorters.js","../../src/js/modules/Sort/defaults/sorters/string.js","../../src/js/modules/Sort/defaults/sorters/time.js","../../src/js/modules/Sort/defaults/sorters/boolean.js","../../src/js/modules/Sort/Sort.js","../../src/js/modules/Sort/defaults/sorters/array.js","../../src/js/modules/Sort/defaults/sorters/exists.js","../../src/js/modules/Sort/defaults/sorters/alphanum.js","../../src/js/modules/Tooltip/Tooltip.js","../../src/js/modules/Validate/defaults/validators.js","../../src/js/modules/Validate/Validate.js","../../src/js/core/defaults/options.js","../../src/js/core/tools/OptionsList.js","../../src/js/core/rendering/Renderer.js","../../src/js/core/rendering/renderers/BasicHorizontal.js","../../src/js/core/rendering/renderers/VirtualDomHorizontal.js","../../src/js/core/ColumnManager.js","../../src/js/core/rendering/renderers/BasicVertical.js","../../src/js/core/rendering/renderers/VirtualDomVertical.js","../../src/js/core/RowManager.js","../../src/js/core/FooterManager.js","../../src/js/core/tools/InteractionMonitor.js","../../src/js/core/tools/ComponentFunctionBinder.js","../../src/js/core/tools/DataLoader.js","../../src/js/core/tools/ExternalEventBus.js","../../src/js/core/tools/InternalEventBus.js","../../src/js/core/tools/TableRegistry.js","../../src/js/modules/Layout/defaults/modes/fitData.js","../../src/js/modules/Layout/defaults/modes/fitDataStretch.js","../../src/js/modules/Layout/defaults/modes/fitDataGeneral.js","../../src/js/modules/Layout/Layout.js","../../src/js/modules/Layout/defaults/modes/fitColumns.js","../../src/js/modules/Layout/defaults/modes.js","../../src/js/modules/Localize/defaults/langs.js","../../src/js/modules/Localize/Localize.js","../../src/js/modules/Comms/Comms.js","../../src/js/core/tools/ModuleBinder.js","../../src/js/core/tools/Alert.js","../../src/js/core/Tabulator.js","../../src/js/core/row/PseudoRow.js"],"sourcesContent":["export default class CoreFeature{\r\n\r\n\tconstructor(table){\r\n\t\tthis.table = table;\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t/////////////// DataLoad /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\treloadData(data, silent, columnsChanged){\r\n\t\treturn this.table.dataLoader.load(data, undefined, undefined, undefined, silent, columnsChanged);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t///////////// Localization ///////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tlangText(){\r\n\t\treturn this.table.modules.localize.getText(...arguments);\r\n\t}\r\n\r\n\tlangBind(){\r\n\t\treturn this.table.modules.localize.bind(...arguments);\r\n\t}\r\n\r\n\tlangLocale(){\r\n\t\treturn this.table.modules.localize.getLocale(...arguments);\r\n\t}\r\n\r\n\r\n\t//////////////////////////////////////////\r\n\t////////// Inter Table Comms /////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tcommsConnections(){\r\n\t\treturn this.table.modules.comms.getConnections(...arguments);\r\n\t}\r\n\r\n\tcommsSend(){\r\n\t\treturn this.table.modules.comms.send(...arguments);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t//////////////// Layout /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tlayoutMode(){\r\n\t\treturn this.table.modules.layout.getMode();\r\n\t}\r\n\r\n\tlayoutRefresh(){\r\n\t\treturn this.table.modules.layout.layout();\r\n\t}\r\n\r\n\r\n\t//////////////////////////////////////////\r\n\t/////////////// Event Bus ////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tsubscribe(){\r\n\t\treturn this.table.eventBus.subscribe(...arguments);\r\n\t}\r\n\r\n\tunsubscribe(){\r\n\t\treturn this.table.eventBus.unsubscribe(...arguments);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.table.eventBus.subscribed(key);\r\n\t}\r\n\r\n\tsubscriptionChange(){\r\n\t\treturn this.table.eventBus.subscriptionChange(...arguments);\r\n\t}\r\n\r\n\tdispatch(){\r\n\t\treturn this.table.eventBus.dispatch(...arguments);\r\n\t}\r\n\r\n\tchain(){\r\n\t\treturn this.table.eventBus.chain(...arguments);\r\n\t}\r\n\r\n\tconfirm(){\r\n\t\treturn this.table.eventBus.confirm(...arguments);\r\n\t}\r\n\r\n\tdispatchExternal(){\r\n\t\treturn this.table.externalEvents.dispatch(...arguments);\r\n\t}\r\n\r\n\tsubscribedExternal(key){\r\n\t\treturn this.table.externalEvents.subscribed(key);\r\n\t}\r\n\r\n\tsubscriptionChangeExternal(){\r\n\t\treturn this.table.externalEvents.subscriptionChange(...arguments);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t//////////////// Options /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\toptions(key){\r\n\t\treturn this.table.options[key];\r\n\t}\r\n\r\n\tsetOption(key, value){\r\n\t\tif(typeof value !== \"undefined\"){\r\n\t\t\tthis.table.options[key] = value;\r\n\t\t}\r\n\r\n\t\treturn this.table.options[key];\r\n\t}\r\n\r\n\r\n\t//////////////////////////////////////////\r\n\t//////////////// Modules /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tmodule(key){\r\n\t\treturn this.table.module(key);\r\n\t}\r\n}","export default class Helpers{\r\n\r\n\tstatic elVisible(el){\r\n\t\treturn !(el.offsetWidth <= 0 && el.offsetHeight <= 0);\r\n\t}\r\n\r\n\tstatic elOffset(el){\r\n\t\tvar box = el.getBoundingClientRect();\r\n\r\n\t\treturn {\r\n\t\t\ttop: box.top + window.pageYOffset - document.documentElement.clientTop,\r\n\t\t\tleft: box.left + window.pageXOffset - document.documentElement.clientLeft\r\n\t\t};\r\n\t}\r\n\r\n\tstatic deepClone(obj, clone, list = []){\r\n\t\tvar objectProto = {}.__proto__,\r\n\t\tarrayProto = [].__proto__;\r\n\r\n\t\tif (!clone){\r\n\t\t\tclone = Object.assign(Array.isArray(obj) ? [] : {}, obj);\r\n\t\t}\r\n\r\n\t\tfor(var i in obj) {\r\n\t\t\tlet subject = obj[i],\r\n\t\t\tmatch, copy;\r\n\r\n\t\t\tif(subject != null && typeof subject === \"object\" && (subject.__proto__ === objectProto || subject.__proto__ === arrayProto)){\r\n\t\t\t\tmatch = list.findIndex((item) => {\r\n\t\t\t\t\treturn item.subject === subject;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(match > -1){\r\n\t\t\t\t\tclone[i] = list[match].copy;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcopy = Object.assign(Array.isArray(subject) ? [] : {}, subject);\r\n\r\n\t\t\t\t\tlist.unshift({subject, copy});\r\n\r\n\t\t\t\t\tclone[i] = this.deepClone(subject, copy, list);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn clone;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from './Helpers.js';\r\n\r\nexport default class Popup extends CoreFeature{\r\n constructor(table, element, parent){\r\n super(table);\r\n \r\n this.element = element;\r\n this.container = this._lookupContainer();\r\n \r\n this.parent = parent;\r\n \r\n this.reversedX = false;\r\n this.childPopup = null;\r\n this.blurable = false;\r\n this.blurCallback = null;\r\n this.renderedCallback = null;\r\n \r\n this.visible = false;\r\n \r\n this.element.classList.add(\"tabulator-popup-container\");\r\n \r\n this.blurEvent = this.hide.bind(this, false);\r\n this.escEvent = this._escapeCheck.bind(this);\r\n\r\n this.destroyBinding = this.hide.bind(this, true);\r\n }\r\n \r\n _lookupContainer(){\r\n var container = this.table.options.popupContainer;\r\n \r\n if(typeof container === \"string\"){\r\n container = document.querySelector(container);\r\n \r\n if(!container){\r\n console.warn(\"Menu Error - no container element found matching selector:\", this.table.options.popupContainer , \"(defaulting to document body)\");\r\n }\r\n }else if (container === true){\r\n container = this.table.element;\r\n }\r\n \r\n if(container && !this._checkContainerIsParent(container)){\r\n container = false;\r\n console.warn(\"Menu Error - container element does not contain this table:\", this.table.options.popupContainer , \"(defaulting to document body)\");\r\n }\r\n \r\n if(!container){\r\n container = document.body;\r\n }\r\n \r\n return container;\r\n }\r\n \r\n _checkContainerIsParent(container, element = this.table.element){\r\n if(container === element){\r\n return true;\r\n }else{\r\n return element.parentNode ? this._checkContainerIsParent(container, element.parentNode) : false;\r\n }\r\n }\r\n \r\n renderCallback(callback){\r\n this.renderedCallback = callback;\r\n }\r\n \r\n containerEventCoords(e){\r\n var touch = !(e instanceof MouseEvent);\r\n \r\n var x = touch ? e.touches[0].pageX : e.pageX;\r\n var y = touch ? e.touches[0].pageY : e.pageY;\r\n \r\n if(this.container !== document.body){\r\n let parentOffset = Helpers.elOffset(this.container);\r\n \r\n x -= parentOffset.left;\r\n y -= parentOffset.top;\r\n }\r\n \r\n return {x, y};\r\n }\r\n \r\n elementPositionCoords(element, position = \"right\"){\r\n var offset = Helpers.elOffset(element),\r\n containerOffset, x, y;\r\n \r\n if(this.container !== document.body){\r\n containerOffset = Helpers.elOffset(this.container);\r\n \r\n offset.left -= containerOffset.left;\r\n offset.top -= containerOffset.top;\r\n }\r\n \r\n switch(position){\r\n case \"right\":\r\n x = offset.left + element.offsetWidth;\r\n y = offset.top - 1;\r\n break;\r\n \r\n case \"bottom\":\r\n x = offset.left;\r\n y = offset.top + element.offsetHeight;\r\n break;\r\n }\r\n \r\n return {x, y, offset};\r\n }\r\n \r\n show(origin, position){\r\n var x, y, parentEl, parentOffset, containerOffset, coords;\r\n \r\n if(origin instanceof HTMLElement){\r\n parentEl = origin;\r\n coords = this.elementPositionCoords(origin, position);\r\n \r\n parentOffset = coords.offset;\r\n x = coords.x;\r\n y = coords.y;\r\n \r\n }else if(typeof origin === \"number\"){\r\n parentOffset = {top:0, left:0};\r\n x = origin;\r\n y = position;\r\n }else{\r\n coords = this.containerEventCoords(origin);\r\n \r\n x = coords.x;\r\n y = coords.y;\r\n \r\n this.reversedX = false;\r\n }\r\n \r\n this.element.style.top = y + \"px\";\r\n this.element.style.left = x + \"px\";\r\n \r\n this.container.appendChild(this.element);\r\n \r\n if(typeof this.renderedCallback === \"function\"){\r\n this.renderedCallback();\r\n }\r\n \r\n this._fitToScreen(x, y, parentEl, parentOffset, position);\r\n \r\n this.visible = true;\r\n\r\n this.subscribe(\"table-destroy\", this.destroyBinding);\r\n \r\n return this;\r\n }\r\n \r\n _fitToScreen(x, y, parentEl, parentOffset, position){\r\n var scrollTop = this.container === document.body ? document.documentElement.scrollTop : this.container.scrollTop;\r\n\r\n //move menu to start on right edge if it is too close to the edge of the screen\r\n if((x + this.element.offsetWidth) >= this.container.offsetWidth || this.reversedX){\r\n this.element.style.left = \"\";\r\n \r\n if(parentEl){\r\n this.element.style.right = (this.container.offsetWidth - parentOffset.left) + \"px\";\r\n }else{\r\n this.element.style.right = (this.container.offsetWidth - x) + \"px\";\r\n }\r\n \r\n this.reversedX = true;\r\n }\r\n\r\n //move menu to start on bottom edge if it is too close to the edge of the screen\r\n if((y + this.element.offsetHeight) > Math.max(this.container.offsetHeight, scrollTop ? this.container.scrollHeight : 0)) {\r\n if(parentEl){\r\n switch(position){\r\n case \"bottom\":\r\n this.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight - parentEl.offsetHeight - 1) + \"px\";\r\n break;\r\n\r\n default:\r\n this.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight + parentEl.offsetHeight + 1) + \"px\";\r\n }\r\n \r\n }else{\r\n this.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight) + \"px\";\r\n }\r\n }\r\n }\r\n \r\n isVisible(){\r\n return this.visible;\r\n }\r\n \r\n hideOnBlur(callback){\r\n this.blurable = true;\r\n \r\n if(this.visible){\r\n setTimeout(() => {\r\n this.table.rowManager.element.addEventListener(\"scroll\", this.blurEvent);\r\n this.subscribe(\"cell-editing\", this.blurEvent);\r\n document.body.addEventListener(\"click\", this.blurEvent);\r\n document.body.addEventListener(\"contextmenu\", this.blurEvent);\r\n window.addEventListener(\"resize\", this.blurEvent);\r\n document.body.addEventListener(\"keydown\", this.escEvent);\r\n }, 100);\r\n \r\n this.blurCallback = callback;\r\n }\r\n \r\n return this;\r\n }\r\n \r\n _escapeCheck(e){\r\n if(e.keyCode == 27){\r\n this.hide();\r\n }\r\n }\r\n \r\n hide(silent = false){\r\n if(this.visible){\r\n if(this.blurable){\r\n document.body.removeEventListener(\"keydown\", this.escEvent);\r\n document.body.removeEventListener(\"click\", this.blurEvent);\r\n document.body.removeEventListener(\"contextmenu\", this.blurEvent);\r\n window.removeEventListener(\"resize\", this.blurEvent);\r\n this.table.rowManager.element.removeEventListener(\"scroll\", this.blurEvent);\r\n this.unsubscribe(\"cell-editing\", this.blurEvent);\r\n }\r\n \r\n if(this.childPopup){\r\n this.childPopup.hide();\r\n }\r\n \r\n if(this.parent){\r\n this.parent.childPopup = null;\r\n }\r\n \r\n if(this.element.parentNode){\r\n this.element.parentNode.removeChild(this.element);\r\n }\r\n\r\n this.visible = false;\r\n\r\n if(this.blurCallback && !silent){\r\n this.blurCallback();\r\n }\r\n\r\n this.unsubscribe(\"table-destroy\", this.destroyBinding);\r\n }\r\n \r\n return this;\r\n }\r\n \r\n child(element){\r\n if(this.childPopup){\r\n this.childPopup.hide();\r\n }\r\n \r\n this.childPopup = new Popup(this.table, element, this);\r\n \r\n return this.childPopup;\r\n }\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Popup from './tools/Popup.js';\r\n\r\nclass Module extends CoreFeature{\r\n\r\n\tconstructor(table, name){\r\n\t\tsuper(table);\r\n\r\n\t\tthis._handler = null;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\t// setup module when table is initialized, to be overriden in module\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t////// Options Registration ///////\r\n\t///////////////////////////////////\r\n\r\n\tregisterTableOption(key, value){\r\n\t\tthis.table.optionsList.register(key, value);\r\n\t}\r\n\r\n\tregisterColumnOption(key, value){\r\n\t\tthis.table.columnManager.optionsList.register(key, value);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t/// Public Function Registration ///\r\n\t///////////////////////////////////\r\n\r\n\tregisterTableFunction(name, func){\r\n\t\tif(typeof this.table[name] === \"undefined\"){\r\n\t\t\tthis.table[name] = (...args) => {\r\n\t\t\t\tthis.table.initGuard(name);\r\n\r\n\t\t\t\treturn func(...args);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Unable to bind table function, name already in use\", name)\r\n\t\t}\r\n\t}\r\n\r\n\tregisterComponentFunction(component, func, handler){\r\n\t\treturn this.table.componentFunctionBinder.bind(component, func, handler);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t////////// Data Pipeline //////////\r\n\t///////////////////////////////////\r\n\r\n\tregisterDataHandler(handler, priority){\r\n\t\tthis.table.rowManager.registerDataPipelineHandler(handler, priority)\r\n\t\tthis._handler = handler;\r\n\t}\r\n\r\n\tregisterDisplayHandler(handler, priority){\r\n\t\tthis.table.rowManager.registerDisplayPipelineHandler(handler, priority)\r\n\t\tthis._handler = handler;\r\n\t}\r\n\r\n\trefreshData(renderInPosition, handler){\r\n\t\tif(!handler){\r\n\t\t\thandler = this._handler;\r\n\t\t}\r\n\r\n\t\tif(handler){\r\n\t\t\tthis.table.rowManager.refreshActiveData(handler, false, renderInPosition);\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t//////// Footer Management ////////\r\n\t///////////////////////////////////\r\n\r\n\tfooterAppend(element){\r\n\t\treturn this.table.footerManager.append(element)\r\n\t}\r\n\r\n\tfooterPrepend(element){\r\n\t\treturn this.table.footerManager.prepend(element)\r\n\t}\r\n\r\n\tfooterRemove(element){\r\n\t\treturn this.table.footerManager.remove(element)\r\n\t} \r\n\r\n\t///////////////////////////////////\r\n\t//////// Popups Management ////////\r\n\t///////////////////////////////////\r\n\t\r\n\tpopup(menuEl, menuContainer){\r\n\t\treturn new Popup(this.table, menuEl, menuContainer);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t//////// Alert Management ////////\r\n\t///////////////////////////////////\r\n\r\n\talert(content, type){\r\n\t\treturn this.table.alertManager.alert(content, type);\r\n\t}\r\n\r\n\tclearAlert(){\r\n\t\treturn this.table.alertManager.clear();\r\n\t}\r\n\t\r\n}\r\n\r\nexport default Module;","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defautlAccessors from './defaults/accessors.js';\r\n\r\nclass Accessor extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.allowedTypes = [\"\", \"data\", \"download\", \"clipboard\", \"print\", \"htmlOutput\"] //list of accessor types\r\n\r\n\t\tthis.registerColumnOption(\"accessor\");\r\n\t\tthis.registerColumnOption(\"accessorParams\");\r\n\t\tthis.registerColumnOption(\"accessorData\");\r\n\t\tthis.registerColumnOption(\"accessorDataParams\");\r\n\t\tthis.registerColumnOption(\"accessorDownload\");\r\n\t\tthis.registerColumnOption(\"accessorDownloadParams\");\r\n\t\tthis.registerColumnOption(\"accessorClipboard\");\r\n\t\tthis.registerColumnOption(\"accessorClipboardParams\");\r\n\t\tthis.registerColumnOption(\"accessorPrint\");\r\n\t\tthis.registerColumnOption(\"accessorPrintParams\");\r\n\t\tthis.registerColumnOption(\"accessorHtmlOutput\");\r\n\t\tthis.registerColumnOption(\"accessorHtmlOutputParams\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"row-data-retrieve\", this.transformRow.bind(this));\r\n\t}\r\n\r\n\t//initialize column accessor\r\n\tinitializeColumn(column){\r\n\t\tvar match = false,\r\n\t\tconfig = {};\r\n\r\n\t\tthis.allowedTypes.forEach((type) => {\r\n\t\t\tvar key = \"accessor\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\t\taccessor;\r\n\r\n\t\t\tif(column.definition[key]){\r\n\t\t\t\taccessor = this.lookupAccessor(column.definition[key]);\r\n\r\n\t\t\t\tif(accessor){\r\n\t\t\t\t\tmatch = true;\r\n\r\n\t\t\t\t\tconfig[key] = {\r\n\t\t\t\t\t\taccessor:accessor,\r\n\t\t\t\t\t\tparams: column.definition[key + \"Params\"] || {},\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(match){\r\n\t\t\tcolumn.modules.accessor = config;\r\n\t\t}\r\n\t}\r\n\r\n\tlookupAccessor(value){\r\n\t\tvar accessor = false;\r\n\r\n\t\t//set column accessor\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(Accessor.accessors[value]){\r\n\t\t\t\taccessor = Accessor.accessors[value]\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Accessor Error - No such accessor found, ignoring: \", value);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\taccessor = value;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn accessor;\r\n\t}\r\n\r\n\t//apply accessor to row\r\n\ttransformRow(row, type){\r\n\t\tvar key = \"accessor\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\trowComponent = row.getComponent();\r\n\r\n\t\t//clone data object with deep copy to isolate internal data from returned result\r\n\t\tvar data = Helpers.deepClone(row.data || {});\r\n\r\n\t\tthis.table.columnManager.traverse(function(column){\r\n\t\t\tvar value, accessor, params, colCompnent;\r\n\r\n\t\t\tif(column.modules.accessor){\r\n\r\n\t\t\t\taccessor = column.modules.accessor[key] || column.modules.accessor.accessor || false;\r\n\r\n\t\t\t\tif(accessor){\r\n\t\t\t\t\tvalue = column.getFieldValue(data);\r\n\r\n\t\t\t\t\tif(value != \"undefined\"){\r\n\t\t\t\t\t\tcolCompnent = column.getComponent();\r\n\t\t\t\t\t\tparams = typeof accessor.params === \"function\" ? accessor.params(value, data, type, colCompnent, rowComponent) : accessor.params;\r\n\t\t\t\t\t\tcolumn.setFieldValue(data, accessor.accessor(value, data, type, params, colCompnent, rowComponent));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n}\r\n\r\n//load defaults\r\nAccessor.moduleName = \"accessor\";\r\nAccessor.accessors = defautlAccessors;\r\n\r\nexport default Accessor;","export default {}","function generateParamsList(data, prefix){\r\n\tvar output = [];\r\n\r\n\tprefix = prefix || \"\";\r\n\r\n\tif(Array.isArray(data)){\r\n\t\tdata.forEach((item, i) => {\r\n\t\t\toutput = output.concat(generateParamsList(item, prefix ? prefix + \"[\" + i + \"]\" : i));\r\n\t\t});\r\n\t}else if (typeof data === \"object\"){\r\n\t\tfor (var key in data){\r\n\t\t\toutput = output.concat(generateParamsList(data[key], prefix ? prefix + \"[\" + key + \"]\" : key));\r\n\t\t}\r\n\t}else{\r\n\t\toutput.push({key:prefix, value:data});\r\n\t}\r\n\r\n\treturn output;\r\n}\r\n\r\nfunction serializeParams(params){\r\n\tvar output = generateParamsList(params),\r\n\tencoded = [];\r\n\r\n\toutput.forEach(function(item){\r\n\t\tencoded.push(encodeURIComponent(item.key) + \"=\" + encodeURIComponent(item.value));\r\n\t});\r\n\r\n\treturn encoded.join(\"&\");\r\n}\r\n\r\nexport default function(url, config, params){\r\n\tif(url){\r\n\t\tif(params && Object.keys(params).length){\r\n\t\t\tif(!config.method || config.method.toLowerCase() == \"get\"){\r\n\t\t\t\tconfig.method = \"get\";\r\n\r\n\t\t\t\turl += (url.includes(\"?\") ? \"&\" : \"?\") + serializeParams(params);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn url;\r\n};","function generateParamsList(data, prefix){\r\n\tvar output = [];\r\n\r\n\tprefix = prefix || \"\";\r\n\r\n\tif(Array.isArray(data)){\r\n\t\tdata.forEach((item, i) => {\r\n\t\t\toutput = output.concat(generateParamsList(item, prefix ? prefix + \"[\" + i + \"]\" : i));\r\n\t\t});\r\n\t}else if (typeof data === \"object\"){\r\n\t\tfor (var key in data){\r\n\t\t\toutput = output.concat(generateParamsList(data[key], prefix ? prefix + \"[\" + key + \"]\" : key));\r\n\t\t}\r\n\t}else{\r\n\t\toutput.push({key:prefix, value:data});\r\n\t}\r\n\r\n\treturn output;\r\n}\r\n\r\nexport default {\r\n\t\"json\":{\r\n\t\theaders:{\r\n\t\t\t'Content-Type': 'application/json',\r\n\t\t},\r\n\t\tbody:function(url, config, params){\r\n\t\t\treturn JSON.stringify(params);\r\n\t\t},\r\n\t},\r\n\t\"form\":{\r\n\t\theaders:{\r\n\t\t},\r\n\t\tbody:function(url, config, params){\r\n\r\n\t\t\tvar output = generateParamsList(params),\r\n\t\t\tform = new FormData();\r\n\r\n\t\t\toutput.forEach(function(item){\r\n\t\t\t\tform.append(item.key, item.value);\r\n\t\t\t});\r\n\r\n\t\t\treturn form;\r\n\t\t},\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultConfig from './defaults/config.js';\r\nimport defaultURLGenerator from './defaults/urlGenerator.js';\r\nimport defaultLoaderPromise from './defaults/loaderPromise.js';\r\nimport defaultContentTypeFormatters from './defaults/contentTypeFormatters.js';\r\n\r\nclass Ajax extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.config = {}; //hold config object for ajax request\r\n\t\tthis.url = \"\"; //request URL\r\n\t\tthis.urlGenerator = false;\r\n\t\tthis.params = false; //request parameters\r\n\t\t\r\n\t\tthis.loaderPromise = false;\r\n\t\t\r\n\t\tthis.registerTableOption(\"ajaxURL\", false); //url for ajax loading\r\n\t\tthis.registerTableOption(\"ajaxURLGenerator\", false);\r\n\t\tthis.registerTableOption(\"ajaxParams\", {}); //params for ajax loading\r\n\t\tthis.registerTableOption(\"ajaxConfig\", \"get\"); //ajax request type\r\n\t\tthis.registerTableOption(\"ajaxContentType\", \"form\"); //ajax request type\r\n\t\tthis.registerTableOption(\"ajaxRequestFunc\", false); //promise function\r\n\t\t\r\n\t\tthis.registerTableOption(\"ajaxRequesting\", function(){});\r\n\t\tthis.registerTableOption(\"ajaxResponse\", false);\r\n\t\t\r\n\t\tthis.contentTypeFormatters = Ajax.contentTypeFormatters;\r\n\t}\r\n\t\r\n\t//initialize setup options\r\n\tinitialize(){\r\n\t\tthis.loaderPromise = this.table.options.ajaxRequestFunc || Ajax.defaultLoaderPromise;\r\n\t\tthis.urlGenerator = this.table.options.ajaxURLGenerator || Ajax.defaultURLGenerator;\r\n\t\t\r\n\t\tif(this.table.options.ajaxURL){\r\n\t\t\tthis.setUrl(this.table.options.ajaxURL);\r\n\t\t}\r\n\r\n\r\n\t\tthis.setDefaultConfig(this.table.options.ajaxConfig);\r\n\t\t\r\n\t\tthis.registerTableFunction(\"getAjaxUrl\", this.getUrl.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"data-loading\", this.requestDataCheck.bind(this));\r\n\t\tthis.subscribe(\"data-params\", this.requestParams.bind(this));\r\n\t\tthis.subscribe(\"data-load\", this.requestData.bind(this));\r\n\t}\r\n\t\r\n\trequestParams(data, config, silent, params){\r\n\t\tvar ajaxParams = this.table.options.ajaxParams;\r\n\t\t\r\n\t\tif(ajaxParams){\r\n\t\t\tif(typeof ajaxParams === \"function\"){\r\n\t\t\t\tajaxParams = ajaxParams.call(this.table);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tparams = Object.assign(params, ajaxParams);\r\n\t\t}\t\t\r\n\t\t\r\n\t\treturn params;\r\n\t}\r\n\t\r\n\trequestDataCheck(data, params, config, silent){\r\n\t\treturn !!((!data && this.url) || typeof data === \"string\");\r\n\t}\r\n\t\r\n\trequestData(url, params, config, silent, previousData){\r\n\t\tvar ajaxConfig;\r\n\t\t\r\n\t\tif(!previousData && this.requestDataCheck(url)){\r\n\t\t\tif(url){\r\n\t\t\t\tthis.setUrl(url);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tajaxConfig = this.generateConfig(config);\r\n\t\t\t\r\n\t\t\treturn this.sendRequest(this.url, params, ajaxConfig);\r\n\t\t}else{\r\n\t\t\treturn previousData;\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetDefaultConfig(config = {}){\r\n\t\tthis.config = Object.assign({}, Ajax.defaultConfig);\r\n\r\n\t\tif(typeof config == \"string\"){\r\n\t\t\tthis.config.method = config;\r\n\t\t}else{\r\n\t\t\tObject.assign(this.config, config);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//load config object\r\n\tgenerateConfig(config = {}){\r\n\t\tvar ajaxConfig = Object.assign({}, this.config)\r\n\t\t\r\n\t\tif(typeof config == \"string\"){\r\n\t\t\tajaxConfig.method = config;\r\n\t\t}else{\r\n\t\t\tObject.assign(ajaxConfig, config);\r\n\t\t}\r\n\t\t\r\n\t\treturn ajaxConfig;\r\n\t}\r\n\t\r\n\t//set request url\r\n\tsetUrl(url){\r\n\t\tthis.url = url;\r\n\t}\r\n\t\r\n\t//get request url\r\n\tgetUrl(){\r\n\t\treturn this.url;\r\n\t}\r\n\t\r\n\t//send ajax request\r\n\tsendRequest(url, params, config){\r\n\t\tif(this.table.options.ajaxRequesting.call(this.table, url, params) !== false){\r\n\t\t\treturn this.loaderPromise(url, config, params)\r\n\t\t\t.then((data)=>{\r\n\t\t\t\tif(this.table.options.ajaxResponse){\r\n\t\t\t\t\tdata = this.table.options.ajaxResponse.call(this.table, url, params, data);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn data;\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n}\r\n\r\nAjax.moduleName = \"ajax\";\r\n\r\n//load defaults\r\nAjax.defaultConfig = defaultConfig;\r\nAjax.defaultURLGenerator = defaultURLGenerator;\r\nAjax.defaultLoaderPromise = defaultLoaderPromise;\r\nAjax.contentTypeFormatters = defaultContentTypeFormatters;\r\n\r\nexport default Ajax;","export default {\r\n\tmethod: \"GET\",\r\n};","export default function(url, config, params){\r\n\tvar contentType;\r\n\r\n\treturn new Promise((resolve, reject) => {\r\n\t\t//set url\r\n\t\turl = this.urlGenerator.call(this.table, url, config, params);\r\n\r\n\t\t//set body content if not GET request\r\n\t\tif(config.method.toUpperCase() != \"GET\"){\r\n\t\t\tcontentType = typeof this.table.options.ajaxContentType === \"object\" ? this.table.options.ajaxContentType : this.contentTypeFormatters[this.table.options.ajaxContentType];\r\n\t\t\tif(contentType){\r\n\r\n\t\t\t\tfor(var key in contentType.headers){\r\n\t\t\t\t\tif(!config.headers){\r\n\t\t\t\t\t\tconfig.headers = {};\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(typeof config.headers[key] === \"undefined\"){\r\n\t\t\t\t\t\tconfig.headers[key] = contentType.headers[key];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconfig.body = contentType.body.call(this, url, config, params);\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Ajax Error - Invalid ajaxContentType value:\", this.table.options.ajaxContentType);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(url){\r\n\t\t\t//configure headers\r\n\t\t\tif(typeof config.headers === \"undefined\"){\r\n\t\t\t\tconfig.headers = {};\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.headers.Accept === \"undefined\"){\r\n\t\t\t\tconfig.headers.Accept = \"application/json\";\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.headers[\"X-Requested-With\"] === \"undefined\"){\r\n\t\t\t\tconfig.headers[\"X-Requested-With\"] = \"XMLHttpRequest\";\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.mode === \"undefined\"){\r\n\t\t\t\tconfig.mode = \"cors\";\r\n\t\t\t}\r\n\r\n\t\t\tif(config.mode == \"cors\"){\r\n\t\t\t\tif(typeof config.headers[\"Origin\"] === \"undefined\"){\r\n\t\t\t\t\tconfig.headers[\"Origin\"] = window.location.origin;\r\n\t\t\t\t}\r\n \r\n\t\t\t\tif(typeof config.credentials === \"undefined\"){\r\n\t\t\t\t\tconfig.credentials = 'same-origin';\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(typeof config.credentials === \"undefined\"){\r\n\t\t\t\t\tconfig.credentials = 'include';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//send request\r\n\t\t\tfetch(url, config)\r\n\t\t\t.then((response)=>{\r\n\t\t\t\tif(response.ok) {\r\n\t\t\t\t\tresponse.json()\r\n\t\t\t\t\t.then((data)=>{\r\n\t\t\t\t\t\tresolve(data);\r\n\t\t\t\t\t}).catch((error)=>{\r\n\t\t\t\t\t\treject(error);\r\n\t\t\t\t\t\tconsole.warn(\"Ajax Load Error - Invalid JSON returned\", error);\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.error(\"Ajax Load Error - Connection Error: \" + response.status, response.statusText);\r\n\t\t\t\t\treject(response);\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.catch((error)=>{\r\n\t\t\t\tconsole.error(\"Ajax Load Error - Connection Error: \", error);\r\n\t\t\t\treject(error);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Ajax Load Error - No URL Set\");\r\n\t\t\tresolve([]);\r\n\t\t}\r\n\t});\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultPasteActions from './defaults/pasteActions.js';\r\nimport defaultPasteParsers from './defaults/pasteParsers.js';\r\n\r\nclass Clipboard extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.mode = true;\r\n\t\tthis.pasteParser = function(){};\r\n\t\tthis.pasteAction = function(){};\r\n\t\tthis.customSelection = false;\r\n\t\tthis.rowRange = false;\r\n\t\tthis.blocked = true; //block copy actions not originating from this command\r\n\r\n\t\tthis.registerTableOption(\"clipboard\", false); //enable clipboard\r\n\t\tthis.registerTableOption(\"clipboardCopyStyled\", true); //formatted table data\r\n\t\tthis.registerTableOption(\"clipboardCopyConfig\", false); //clipboard config\r\n\t\tthis.registerTableOption(\"clipboardCopyFormatter\", false); //DEPRICATED - REMOVE in 5.0\r\n\t\tthis.registerTableOption(\"clipboardCopyRowRange\", \"active\"); //restrict clipboard to visible rows only\r\n\t\tthis.registerTableOption(\"clipboardPasteParser\", \"table\"); //convert pasted clipboard data to rows\r\n\t\tthis.registerTableOption(\"clipboardPasteAction\", \"insert\"); //how to insert pasted data into the table\r\n\r\n\t\tthis.registerColumnOption(\"clipboard\");\r\n\t\tthis.registerColumnOption(\"titleClipboard\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.mode = this.table.options.clipboard;\r\n\r\n\t\tthis.rowRange = this.table.options.clipboardCopyRowRange;\r\n\r\n\t\tif(this.mode === true || this.mode === \"copy\"){\r\n\t\t\tthis.table.element.addEventListener(\"copy\", (e) => {\r\n\t\t\t\tvar plain, html, list;\r\n\r\n\t\t\t\tif(!this.blocked){\r\n\t\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\t\tif(this.customSelection){\r\n\t\t\t\t\t\tplain = this.customSelection;\r\n\r\n\t\t\t\t\t\tif(this.table.options.clipboardCopyFormatter){\r\n\t\t\t\t\t\t\tplain = this.table.options.clipboardCopyFormatter(\"plain\", plain);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\r\n\t\t\t\t\t\tvar list = this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig, this.table.options.clipboardCopyStyled, this.rowRange, \"clipboard\");\r\n\r\n\t\t\t\t\t\thtml = this.table.modules.export.genereateHTMLTable(list);\r\n\t\t\t\t\t\tplain = html ? this.generatePlainContent(list) : \"\";\r\n\r\n\t\t\t\t\t\tif(this.table.options.clipboardCopyFormatter){\r\n\t\t\t\t\t\t\tplain = this.table.options.clipboardCopyFormatter(\"plain\", plain);\r\n\t\t\t\t\t\t\thtml = this.table.options.clipboardCopyFormatter(\"html\", html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (window.clipboardData && window.clipboardData.setData) {\r\n\t\t\t\t\t\twindow.clipboardData.setData('Text', plain);\r\n\t\t\t\t\t} else if (e.clipboardData && e.clipboardData.setData) {\r\n\t\t\t\t\t\te.clipboardData.setData('text/plain', plain);\r\n\t\t\t\t\t\tif(html){\r\n\t\t\t\t\t\t\te.clipboardData.setData('text/html', html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (e.originalEvent && e.originalEvent.clipboardData.setData) {\r\n\t\t\t\t\t\te.originalEvent.clipboardData.setData('text/plain', plain);\r\n\t\t\t\t\t\tif(html){\r\n\t\t\t\t\t\t\te.originalEvent.clipboardData.setData('text/html', html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.dispatchExternal(\"clipboardCopied\", plain, html);\r\n\r\n\t\t\t\t\tthis.reset();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.mode === true || this.mode === \"paste\"){\r\n\t\t\tthis.table.element.addEventListener(\"paste\", (e) => {\r\n\t\t\t\tthis.paste(e);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.setPasteParser(this.table.options.clipboardPasteParser);\r\n\t\tthis.setPasteAction(this.table.options.clipboardPasteAction);\r\n\r\n\t\tthis.registerTableFunction(\"copyToClipboard\", this.copy.bind(this));\r\n\t}\r\n\r\n\treset(){\r\n\t\tthis.blocked = true;\r\n\t\tthis.customSelection = false;\r\n\t}\r\n\r\n\tgeneratePlainContent (list) {\r\n\t\tvar output = [];\r\n\r\n\t\tlist.forEach((row) => {\r\n\t\t\tvar rowData = [];\r\n\r\n\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\tvar value = \"\";\r\n\r\n\t\t\t\tif(col){\r\n\r\n\t\t\t\t\tif(row.type === \"group\"){\r\n\t\t\t\t\t\tcol.value = col.component.getKey();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(col.value === null){\r\n\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\t\tvalue = JSON.stringify(col.value);\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tvalue = col.value;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowData.push(value);\r\n\t\t\t});\r\n\r\n\t\t\toutput.push(rowData.join(\"\\t\"));\r\n\t\t});\r\n\r\n\t\treturn output.join(\"\\n\");\r\n\t}\r\n\r\n\tcopy (range, internal) {\r\n\t\tvar range, sel, textRange;\r\n\t\tthis.blocked = false;\r\n\t\tthis.customSelection = false;\r\n\r\n\t\tif (this.mode === true || this.mode === \"copy\") {\r\n\r\n\t\t\tthis.rowRange = range || this.table.options.clipboardCopyRowRange;\r\n\r\n\t\t\tif (typeof window.getSelection != \"undefined\" && typeof document.createRange != \"undefined\") {\r\n\t\t\t\trange = document.createRange();\r\n\t\t\t\trange.selectNodeContents(this.table.element);\r\n\t\t\t\tsel = window.getSelection();\r\n\r\n\t\t\t\tif (sel.toString() && internal) {\r\n\t\t\t\t\tthis.customSelection = sel.toString();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tsel.removeAllRanges();\r\n\t\t\t\tsel.addRange(range);\r\n\t\t\t} else if (typeof document.selection != \"undefined\" && typeof document.body.createTextRange != \"undefined\") {\r\n\t\t\t\ttextRange = document.body.createTextRange();\r\n\t\t\t\ttextRange.moveToElementText(this.table.element);\r\n\t\t\t\ttextRange.select();\r\n\t\t\t}\r\n\r\n\t\t\tdocument.execCommand('copy');\r\n\r\n\t\t\tif (sel) {\r\n\t\t\t\tsel.removeAllRanges();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//PASTE EVENT HANDLING\r\n\tsetPasteAction(action){\r\n\r\n\t\tswitch(typeof action){\r\n\t\t\tcase \"string\":\r\n\t\t\tthis.pasteAction = Clipboard.pasteActions[action];\r\n\r\n\t\t\tif(!this.pasteAction){\r\n\t\t\t\tconsole.warn(\"Clipboard Error - No such paste action found:\", action);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tthis.pasteAction = action;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tsetPasteParser(parser){\r\n\t\tswitch(typeof parser){\r\n\t\t\tcase \"string\":\r\n\t\t\tthis.pasteParser = Clipboard.pasteParsers[parser];\r\n\r\n\t\t\tif(!this.pasteParser){\r\n\t\t\t\tconsole.warn(\"Clipboard Error - No such paste parser found:\", parser);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tthis.pasteParser = parser;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tpaste(e){\r\n\t\tvar data, rowData, rows;\r\n\r\n\t\tif(this.checkPaseOrigin(e)){\r\n\r\n\t\t\tdata = this.getPasteData(e);\r\n\r\n\t\t\trowData = this.pasteParser.call(this, data);\r\n\r\n\t\t\tif(rowData){\r\n\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\t\t\trowData = this.mutateData(rowData);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trows = this.pasteAction.call(this, rowData);\r\n\r\n\t\t\t\tthis.dispatchExternal(\"clipboardPasted\", data, rowData, rows);\r\n\t\t\t}else{\r\n\t\t\t\tthis.dispatchExternal(\"clipboardPasteError\", data);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmutateData(data){\r\n\t\tvar output = [];\r\n\r\n\t\tif(Array.isArray(data)){\r\n\t\t\tdata.forEach((row) => {\r\n\t\t\t\toutput.push(this.table.modules.mutator.transformRow(row, \"clipboard\"));\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\toutput = data;\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\r\n\tcheckPaseOrigin(e){\r\n\t\tvar valid = true;\r\n\r\n\t\tif(e.target.tagName != \"DIV\" || this.table.modules.edit.currentCell){\r\n\t\t\tvalid = false;\r\n\t\t}\r\n\r\n\t\treturn valid;\r\n\t}\r\n\r\n\tgetPasteData(e){\r\n\t\tvar data;\r\n\r\n\t\tif (window.clipboardData && window.clipboardData.getData) {\r\n\t\t\tdata = window.clipboardData.getData('Text');\r\n\t\t} else if (e.clipboardData && e.clipboardData.getData) {\r\n\t\t\tdata = e.clipboardData.getData('text/plain');\r\n\t\t} else if (e.originalEvent && e.originalEvent.clipboardData.getData) {\r\n\t\t\tdata = e.originalEvent.clipboardData.getData('text/plain');\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n}\r\n\r\nClipboard.moduleName = \"clipboard\";\r\n\r\n//load defaults\r\nClipboard.pasteActions = defaultPasteActions;\r\nClipboard.pasteParsers = defaultPasteParsers;\r\n\r\nexport default Clipboard;","export default {\r\n\treplace:function(rows){\r\n\t\treturn this.table.setData(rows);\r\n\t},\r\n\tupdate:function(rows){\r\n\t\treturn this.table.updateOrAddData(rows);\r\n\t},\r\n\tinsert:function(rows){\r\n\t\treturn this.table.addData(rows);\r\n\t},\r\n};","export default {\r\n\ttable:function(clipboard){\r\n\t\tvar data = [],\r\n\t\tsuccess = false,\r\n\t\theaderFindSuccess = true,\r\n\t\tcolumns = this.table.columnManager.columns,\r\n\t\tcolumnMap = [],\r\n\t\trows = [];\r\n\r\n\t\t//get data from clipboard into array of columns and rows.\r\n\t\tclipboard = clipboard.split(\"\\n\");\r\n\r\n\t\tclipboard.forEach(function(row){\r\n\t\t\tdata.push(row.split(\"\\t\"));\r\n\t\t});\r\n\r\n\t\tif(data.length && !(data.length === 1 && data[0].length < 2)){\r\n\t\t\tsuccess = true;\r\n\r\n\t\t\t//check if headers are present by title\r\n\t\t\tdata[0].forEach(function(value){\r\n\t\t\t\tvar column = columns.find(function(column){\r\n\t\t\t\t\treturn value && column.definition.title && value.trim() && column.definition.title.trim() === value.trim();\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tcolumnMap.push(column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\theaderFindSuccess = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t//check if column headers are present by field\r\n\t\t\tif(!headerFindSuccess){\r\n\t\t\t\theaderFindSuccess = true;\r\n\t\t\t\tcolumnMap = [];\r\n\r\n\t\t\t\tdata[0].forEach(function(value){\r\n\t\t\t\t\tvar column = columns.find(function(column){\r\n\t\t\t\t\t\treturn value && column.field && value.trim() && column.field.trim() === value.trim();\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(column){\r\n\t\t\t\t\t\tcolumnMap.push(column);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\theaderFindSuccess = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(!headerFindSuccess){\r\n\t\t\t\t\tcolumnMap = this.table.columnManager.columnsByIndex;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//remove header row if found\r\n\t\t\tif(headerFindSuccess){\r\n\t\t\t\tdata.shift();\r\n\t\t\t}\r\n\r\n\t\t\tdata.forEach(function(item){\r\n\t\t\t\tvar row = {};\r\n\r\n\t\t\t\titem.forEach(function(value, i){\r\n\t\t\t\t\tif(columnMap[i]){\r\n\t\t\t\t\t\trow[columnMap[i].field] = value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\trows.push(row);\r\n\t\t\t});\r\n\r\n\t\t\treturn rows;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n};","class CalcComponent{\r\n\tconstructor (row){\r\n\t\tthis._row = row;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._row.table.componentFunctionBinder.handle(\"row\", target._row, name)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\tgetData(transform){\r\n\t\treturn this._row.getData(transform);\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._row.getElement();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._row.table;\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._row.getCells().forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tgetCell(column){\r\n\t\tvar cell = this._row.getCell(column);\r\n\t\treturn cell ? cell.getComponent() : false;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._row;\r\n\t}\r\n}\r\n\r\nexport default CalcComponent;","//public cell object\r\nexport default class CellComponent {\r\n\r\n\tconstructor (cell){\r\n\t\tthis._cell = cell;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._cell.table.componentFunctionBinder.handle(\"cell\", target._cell, name)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\tgetValue(){\r\n\t\treturn this._cell.getValue();\r\n\t}\r\n\r\n\tgetOldValue(){\r\n\t\treturn this._cell.getOldValue();\r\n\t}\r\n\r\n\tgetInitialValue(){\r\n\t\treturn this._cell.initialValue;\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._cell.getElement();\r\n\t}\r\n\r\n\tgetRow(){\r\n\t\treturn this._cell.row.getComponent();\r\n\t}\r\n\r\n\tgetData(){\r\n\t\treturn this._cell.row.getData();\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._cell.column.getField();\r\n\t}\r\n\r\n\tgetColumn(){\r\n\t\treturn this._cell.column.getComponent();\r\n\t}\r\n\r\n\tsetValue(value, mutate){\r\n\t\tif(typeof mutate == \"undefined\"){\r\n\t\t\tmutate = true;\r\n\t\t}\r\n\r\n\t\tthis._cell.setValue(value, mutate);\r\n\t}\r\n\r\n\trestoreOldValue(){\r\n\t\tthis._cell.setValueActual(this._cell.getOldValue());\r\n\t}\r\n\r\n\trestoreInitialValue(){\r\n\t\tthis._cell.setValueActual(this._cell.initialValue);\r\n\t}\r\n\r\n\tcheckHeight(){\r\n\t\tthis._cell.checkHeight();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._cell.table;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._cell;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport CellComponent from './CellComponent.js';\r\n\r\nexport default class Cell extends CoreFeature{\r\n\tconstructor(column, row){\r\n\t\tsuper(column.table);\r\n\r\n\t\tthis.table = column.table;\r\n\t\tthis.column = column;\r\n\t\tthis.row = row;\r\n\t\tthis.element = null;\r\n\t\tthis.value = null;\r\n\t\tthis.initialValue;\r\n\t\tthis.oldValue = null;\r\n\t\tthis.modules = {};\r\n\r\n\t\tthis.height = null;\r\n\t\tthis.width = null;\r\n\t\tthis.minWidth = null;\r\n\r\n\t\tthis.component = null;\r\n\r\n\t\tthis.loaded = false; //track if the cell has been added to the DOM yet\r\n\r\n\t\tthis.build();\r\n\t}\r\n\r\n\t//////////////// Setup Functions /////////////////\r\n\t//generate element\r\n\tbuild(){\r\n\t\tthis.generateElement();\r\n\r\n\t\tthis.setWidth();\r\n\r\n\t\tthis._configureCell();\r\n\r\n\t\tthis.setValueActual(this.column.getFieldValue(this.row.data));\r\n\r\n\t\tthis.initialValue = this.value;\r\n\t}\r\n\r\n\tgenerateElement(){\r\n\t\tthis.element = document.createElement('div');\r\n\t\tthis.element.className = \"tabulator-cell\";\r\n\t\tthis.element.setAttribute(\"role\", \"gridcell\");\r\n\t\tthis.element = this.element;\r\n\t}\r\n\r\n\t_configureCell(){\r\n\t\tvar element = this.element,\r\n\t\tfield = this.column.getField(),\r\n\t\tvertAligns = {\r\n\t\t\ttop:\"flex-start\",\r\n\t\t\tbottom:\"flex-end\",\r\n\t\t\tmiddle:\"center\",\r\n\t\t},\r\n\t\thozAligns = {\r\n\t\t\tleft:\"flex-start\",\r\n\t\t\tright:\"flex-end\",\r\n\t\t\tcenter:\"center\",\r\n\t\t};\r\n\r\n\t\t//set text alignment\r\n\t\telement.style.textAlign = this.column.hozAlign;\r\n\r\n\t\tif(this.column.vertAlign){\r\n\t\t\telement.style.display = \"inline-flex\";\r\n\r\n\t\t\telement.style.alignItems = vertAligns[this.column.vertAlign] || \"\";\r\n\r\n\t\t\tif(this.column.hozAlign){\r\n\t\t\t\telement.style.justifyContent = hozAligns[this.column.hozAlign] || \"\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(field){\r\n\t\t\telement.setAttribute(\"tabulator-field\", field);\r\n\t\t}\r\n\r\n\t\t//add class to cell if needed\r\n\t\tif(this.column.definition.cssClass){\r\n\t\t\tvar classNames = this.column.definition.cssClass.split(\" \")\r\n\t\t\tclassNames.forEach((className) => {\r\n\t\t\t\telement.classList.add(className)\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"cell-init\", this);\r\n\r\n\t\t//hide cell if not visible\r\n\t\tif(!this.column.visible){\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\t//generate cell contents\r\n\t_generateContents(){\r\n\t\tvar val;\r\n\r\n\t\tval = this.chain(\"cell-format\", this, null, () => {\r\n\t\t\treturn this.element.innerHTML = this.value;\r\n\t\t});\r\n\r\n\t\tswitch(typeof val){\r\n\t\t\tcase \"object\":\r\n\t\t\tif(val instanceof Node){\r\n\r\n\t\t\t\t//clear previous cell contents\r\n\t\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\r\n\t\t\t\tthis.element.appendChild(val);\r\n\t\t\t}else{\r\n\t\t\t\tthis.element.innerHTML = \"\";\r\n\r\n\t\t\t\tif(val != null){\r\n\t\t\t\t\tconsole.warn(\"Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:\", val);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\tcase \"undefined\":\r\n\t\t\tthis.element.innerHTML = \"\";\r\n\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\tthis.element.innerHTML = val;\r\n\t\t}\r\n\t}\r\n\r\n\tcellRendered(){\r\n\t\tthis.dispatch(\"cell-rendered\", this);\r\n\t}\r\n\r\n\t//////////////////// Getters ////////////////////\r\n\tgetElement(containerOnly){\r\n\t\tif(!this.loaded){\r\n\t\t\tthis.loaded = true;\r\n\t\t\tif(!containerOnly){\r\n\t\t\t\tthis.layoutElement();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\tgetValue(){\r\n\t\treturn this.value;\r\n\t}\r\n\r\n\tgetOldValue(){\r\n\t\treturn this.oldValue;\r\n\t}\r\n\r\n\t//////////////////// Actions ////////////////////\r\n\tsetValue(value, mutate, force){\r\n\t\tvar changed = this.setValueProcessData(value, mutate, force);\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.dispatch(\"cell-value-updated\", this);\r\n\r\n\t\t\tthis.cellRendered();\r\n\r\n\t\t\tif(this.column.definition.cellEdited){\r\n\t\t\t\tthis.column.definition.cellEdited.call(this.table, this.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"cellEdited\", this.getComponent());\r\n\r\n\t\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tsetValueProcessData(value, mutate, force){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(this.value !== value || force){\r\n\r\n\t\t\tchanged = true;\r\n\r\n\t\t\tif(mutate){\r\n\t\t\t\tvalue = this.chain(\"cell-value-changing\", [this, value], null, value);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.setValueActual(value);\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.dispatch(\"cell-value-changed\", this);\r\n\t\t}\r\n\r\n\t\treturn changed;\r\n\t}\r\n\r\n\tsetValueActual(value){\r\n\t\tthis.oldValue = this.value;\r\n\r\n\t\tthis.value = value;\r\n\r\n\t\tthis.dispatch(\"cell-value-save-before\", this);\r\n\r\n\t\tthis.column.setFieldValue(this.row.data, value);\r\n\r\n\t\tthis.dispatch(\"cell-value-save-after\", this);\r\n\r\n\t\tif(this.loaded){\r\n\t\t\tthis.layoutElement();\r\n\t\t}\r\n\t}\r\n\r\n\tlayoutElement(){\r\n\t\tthis._generateContents();\r\n\r\n\t\tthis.dispatch(\"cell-layout\", this);\r\n\t}\r\n\r\n\tsetWidth(){\r\n\t\tthis.width = this.column.width;\r\n\t\tthis.element.style.width = this.column.widthStyled;\r\n\t}\r\n\r\n\tclearWidth(){\r\n\t\tthis.width = \"\";\r\n\t\tthis.element.style.width = \"\";\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\treturn this.width || this.element.offsetWidth;\r\n\t}\r\n\r\n\tsetMinWidth(){\r\n\t\tthis.minWidth = this.column.minWidth;\r\n\t\tthis.element.style.minWidth = this.column.minWidthStyled;\r\n\t}\r\n\r\n\tsetMaxWidth(){\r\n\t\tthis.maxWidth = this.column.maxWidth;\r\n\t\tthis.element.style.maxWidth = this.column.maxWidthStyled;\r\n\t}\r\n\r\n\tcheckHeight(){\r\n\t\t// var height = this.element.css(\"height\");\r\n\t\tthis.row.reinitializeHeight();\r\n\t}\r\n\r\n\tclearHeight(){\r\n\t\tthis.element.style.height = \"\";\r\n\t\tthis.height = null;\r\n\r\n\t\tthis.dispatch(\"cell-height\", this, \"\");\r\n\t}\r\n\r\n\tsetHeight(){\r\n\t\tthis.height = this.row.height;\r\n\t\tthis.element.style.height = this.row.heightStyled;\r\n\r\n\t\tthis.dispatch(\"cell-height\", this, this.row.heightStyled);\r\n\t}\r\n\r\n\tgetHeight(){\r\n\t\treturn this.height || this.element.offsetHeight;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tthis.element.style.display = this.column.vertAlign ? \"inline-flex\" : \"\";\r\n\t}\r\n\r\n\thide(){\r\n\t\tthis.element.style.display = \"none\";\r\n\t}\r\n\r\n\tdelete(){\r\n\t\tthis.dispatch(\"cell-delete\", this);\r\n\r\n\t\tif(!this.table.rowManager.redrawBlock && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\r\n\t\tthis.element = false;\r\n\t\tthis.column.deleteCell(this);\r\n\t\tthis.row.deleteCell(this);\r\n\t\tthis.calcs = {};\r\n\t}\r\n\r\n\tgetIndex(){\r\n\t\treturn this.row.getCellIndex(this);\r\n\t}\r\n\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new CellComponent(this);\r\n\t\t}\r\n\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n","import Column from './Column.js';\r\n\r\n//public column object\r\nexport default class ColumnComponent {\r\n\tconstructor (column){\r\n\t\tthis._column = column;\r\n\t\tthis.type = \"ColumnComponent\";\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._column.table.componentFunctionBinder.handle(\"column\", target._column, name)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._column.getElement();\r\n\t}\r\n\r\n\tgetDefinition(){\r\n\t\treturn this._column.getDefinition();\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._column.getField();\r\n\t}\r\n\r\n\tgetTitleDownload() {\r\n\t\treturn this._column.getTitleDownload();\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._column.cells.forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tisVisible(){\r\n\t\treturn this._column.visible;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tif(this._column.isGroup){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\tcolumn.show();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis._column.show();\r\n\t\t}\r\n\t}\r\n\r\n\thide(){\r\n\t\tif(this._column.isGroup){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\tcolumn.hide();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis._column.hide();\r\n\t\t}\r\n\t}\r\n\r\n\ttoggle(){\r\n\t\tif(this._column.visible){\r\n\t\t\tthis.hide();\r\n\t\t}else{\r\n\t\t\tthis.show();\r\n\t\t}\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn this._column.delete();\r\n\t}\r\n\r\n\tgetSubColumns(){\r\n\t\tvar output = [];\r\n\r\n\t\tif(this._column.columns.length){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\toutput.push(column.getComponent());\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetParentColumn(){\r\n\t\treturn this._column.parent instanceof Column ? this._column.parent.getComponent() : false;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._column;\r\n\t}\r\n\r\n\tscrollTo(){\r\n\t\treturn this._column.table.columnManager.scrollToColumn(this._column);\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._column.table;\r\n\t}\r\n\r\n\tmove(to, after){\r\n\t\tvar toColumn = this._column.table.columnManager.findColumn(to);\r\n\r\n\t\tif(toColumn){\r\n\t\t\tthis._column.table.columnManager.moveColumn(this._column, toColumn, after)\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching column found:\", toColumn);\r\n\t\t}\r\n\t}\r\n\r\n\tgetNextColumn(){\r\n\t\tvar nextCol = this._column.nextColumn();\r\n\r\n\t\treturn nextCol ? nextCol.getComponent() : false;\r\n\t}\r\n\r\n\tgetPrevColumn(){\r\n\t\tvar prevCol = this._column.prevColumn();\r\n\r\n\t\treturn prevCol ? prevCol.getComponent() : false;\r\n\t}\r\n\r\n\tupdateDefinition(updates){\r\n\t\treturn this._column.updateDefinition(updates);\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\treturn this._column.getWidth();\r\n\t}\r\n\r\n\tsetWidth(width){\r\n\t\tvar result;\r\n\r\n\t\tif(width === true){\r\n\t\t\tresult = this._column.reinitializeWidth(true);\r\n\t\t}else{\r\n\t\t\tresult = this._column.setWidth(width);\r\n\t\t}\r\n\r\n\t\tthis._column.table.columnManager.renderer.rerenderColumns(true);\r\n\r\n\t\treturn result;\r\n\t}\r\n}","export default {\r\n\t\"title\": undefined,\r\n\t\"field\": undefined,\r\n\t\"columns\": undefined,\r\n\t\"visible\": undefined,\r\n\t\"hozAlign\": undefined,\r\n\t\"vertAlign\": undefined,\r\n\t\"width\": undefined,\r\n\t\"minWidth\": 40,\r\n\t\"maxWidth\": undefined,\r\n\t\"maxInitialWidth\": undefined,\r\n\t\"cssClass\": undefined,\r\n\t\"variableHeight\": undefined,\r\n\t\"headerVertical\": undefined,\r\n\t\"headerHozAlign\": undefined,\r\n\t\"editableTitle\": undefined,\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport ColumnComponent from './ColumnComponent.js';\r\nimport defaultOptions from './defaults/options.js';\r\n\r\nimport Cell from '../cell/Cell.js';\r\n\r\nclass Column extends CoreFeature{\r\n\r\n\tconstructor(def, parent){\r\n\t\tsuper(parent.table);\r\n\r\n\t\tthis.definition = def; //column definition\r\n\t\tthis.parent = parent; //hold parent object\r\n\t\tthis.type = \"column\"; //type of element\r\n\t\tthis.columns = []; //child columns\r\n\t\tthis.cells = []; //cells bound to this column\r\n\t\tthis.element = this.createElement(); //column header element\r\n\t\tthis.contentElement = false;\r\n\t\tthis.titleHolderElement = false;\r\n\t\tthis.titleElement = false;\r\n\t\tthis.groupElement = this.createGroupElement(); //column group holder element\r\n\t\tthis.isGroup = false;\r\n\t\tthis.hozAlign = \"\"; //horizontal text alignment\r\n\t\tthis.vertAlign = \"\"; //vert text alignment\r\n\r\n\t\t//multi dimensional filed handling\r\n\t\tthis.field =\"\";\r\n\t\tthis.fieldStructure = \"\";\r\n\t\tthis.getFieldValue = \"\";\r\n\t\tthis.setFieldValue = \"\";\r\n\r\n\t\tthis.titleDownload = null;\r\n\t\tthis.titleFormatterRendered = false;\r\n\r\n\t\tthis.mapDefinitions();\r\n\r\n\t\tthis.setField(this.definition.field);\r\n\r\n\t\tthis.modules = {}; //hold module variables;\r\n\r\n\t\tthis.width = null; //column width\r\n\t\tthis.widthStyled = \"\"; //column width prestyled to improve render efficiency\r\n\t\tthis.maxWidth = null; //column maximum width\r\n\t\tthis.maxWidthStyled = \"\"; //column maximum prestyled to improve render efficiency\r\n\t\tthis.maxInitialWidth = null;\r\n\t\tthis.minWidth = null; //column minimum width\r\n\t\tthis.minWidthStyled = \"\"; //column minimum prestyled to improve render efficiency\r\n\t\tthis.widthFixed = false; //user has specified a width for this column\r\n\r\n\t\tthis.visible = true; //default visible state\r\n\r\n\t\tthis.component = null;\r\n\r\n\t\t//initialize column\r\n\t\tif(this.definition.columns){\r\n\r\n\t\t\tthis.isGroup = true;\r\n\r\n\t\t\tthis.definition.columns.forEach((def, i) => {\r\n\t\t\t\tvar newCol = new Column(def, this);\r\n\t\t\t\tthis.attachColumn(newCol);\r\n\t\t\t});\r\n\r\n\t\t\tthis.checkColumnVisibility();\r\n\t\t}else{\r\n\t\t\tparent.registerColumnField(this);\r\n\t\t}\r\n\r\n\t\tthis._initialize();\r\n\r\n\t\tthis.bindModuleColumns();\r\n\t}\r\n\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-col\");\r\n\t\tel.setAttribute(\"role\", \"columnheader\");\r\n\t\tel.setAttribute(\"aria-sort\", \"none\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tcreateGroupElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-col-group-cols\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tmapDefinitions(){\r\n\t\tvar defaults = this.table.options.columnDefaults;\r\n\r\n\t\t//map columnDefaults onto column definitions\r\n\t\tif(defaults){\r\n\t\t\tfor(let key in defaults){\r\n\t\t\t\tif(typeof this.definition[key] === \"undefined\"){\r\n\t\t\t\t\tthis.definition[key] = defaults[key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.definition = this.table.columnManager.optionsList.generate(Column.defaultOptionList, this.definition)\r\n\t}\r\n\r\n\tcheckDefinition(){\r\n\t\tObject.keys(this.definition).forEach((key) => {\r\n\t\t\tif(Column.defaultOptionList.indexOf(key) === -1){\r\n\t\t\t\tconsole.warn(\"Invalid column definition option in '\" + (this.field || this.definition.title) + \"' column:\", key)\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tsetField(field){\r\n\t\tthis.field = field;\r\n\t\tthis.fieldStructure = field ? (this.table.options.nestedFieldSeparator ? field.split(this.table.options.nestedFieldSeparator) : [field]) : [];\r\n\t\tthis.getFieldValue = this.fieldStructure.length > 1 ? this._getNestedData : this._getFlatData;\r\n\t\tthis.setFieldValue = this.fieldStructure.length > 1 ? this._setNestedData : this._setFlatData;\r\n\t}\r\n\r\n\t//register column position with column manager\r\n\tregisterColumnPosition(column){\r\n\t\tthis.parent.registerColumnPosition(column);\r\n\t}\r\n\r\n\t//register column position with column manager\r\n\tregisterColumnField(column){\r\n\t\tthis.parent.registerColumnField(column);\r\n\t}\r\n\r\n\t//trigger position registration\r\n\treRegisterPosition(){\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tcolumn.reRegisterPosition();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.registerColumnPosition(this);\r\n\t\t}\r\n\t}\r\n\r\n\t_mapDepricatedFunctionality(){\r\n\t\t//all previously deprecated functionality removed in the 5.0 release\r\n\t}\r\n\r\n\t//build header element\r\n\t_initialize(){\r\n\t\tvar def = this.definition;\r\n\r\n\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\r\n\t\tif(def.headerVertical){\r\n\t\t\tthis.element.classList.add(\"tabulator-col-vertical\");\r\n\r\n\t\t\tif(def.headerVertical === \"flip\"){\r\n\t\t\t\tthis.element.classList.add(\"tabulator-col-vertical-flip\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.contentElement = this._buildColumnHeaderContent();\r\n\r\n\t\tthis.element.appendChild(this.contentElement);\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis._buildGroupHeader();\r\n\t\t}else{\r\n\t\t\tthis._buildColumnHeader();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-init\", this);\r\n\t}\r\n\r\n\t//build header element for header\r\n\t_buildColumnHeader(){\r\n\t\tvar def = this.definition,\r\n\t\ttable = this.table;\r\n\r\n\t\tthis.dispatch(\"column-layout\", this);\r\n\r\n\t\t//set column visibility\r\n\t\tif(typeof def.visible != \"undefined\"){\r\n\t\t\tif(def.visible){\r\n\t\t\t\tthis.show(true);\r\n\t\t\t}else{\r\n\t\t\t\tthis.hide(true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//asign additional css classes to column header\r\n\t\tif(def.cssClass){\r\n\t\t\tvar classeNames = def.cssClass.split(\" \");\r\n\t\t\tclasseNames.forEach((className) => {\r\n\t\t\t\tthis.element.classList.add(className);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(def.field){\r\n\t\t\tthis.element.setAttribute(\"tabulator-field\", def.field);\r\n\t\t}\r\n\r\n\t\t//set min width if present\r\n\t\tthis.setMinWidth(parseInt(def.minWidth));\r\n\r\n\t\tif (def.maxInitialWidth) {\r\n\t\t\tthis.maxInitialWidth = parseInt(def.maxInitialWidth);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.maxWidth){\r\n\t\t\tthis.setMaxWidth(parseInt(def.maxWidth));\r\n\t\t}\r\n\r\n\t\tthis.reinitializeWidth();\r\n\r\n\t\t//set orizontal text alignment\r\n\t\tthis.hozAlign = this.definition.hozAlign;\r\n\t\tthis.vertAlign = this.definition.vertAlign;\r\n\r\n\t\tthis.titleElement.style.textAlign = this.definition.headerHozAlign;\r\n\t}\r\n\r\n\t_buildColumnHeaderContent(){\r\n\t\tvar def = this.definition,\r\n\t\ttable = this.table;\r\n\r\n\t\tvar contentElement = document.createElement(\"div\");\r\n\t\tcontentElement.classList.add(\"tabulator-col-content\");\r\n\r\n\t\tthis.titleHolderElement = document.createElement(\"div\");\r\n\t\tthis.titleHolderElement.classList.add(\"tabulator-col-title-holder\");\r\n\r\n\t\tcontentElement.appendChild(this.titleHolderElement);\r\n\r\n\t\tthis.titleElement = this._buildColumnHeaderTitle();\r\n\r\n\t\tthis.titleHolderElement.appendChild(this.titleElement);\r\n\r\n\t\treturn contentElement;\r\n\t}\r\n\r\n\t//build title element of column\r\n\t_buildColumnHeaderTitle(){\r\n\t\tvar def = this.definition,\r\n\t\ttitle;\r\n\r\n\t\tvar titleHolderElement = document.createElement(\"div\");\r\n\t\ttitleHolderElement.classList.add(\"tabulator-col-title\");\r\n\r\n\t\tif(def.editableTitle){\r\n\t\t\tvar titleElement = document.createElement(\"input\");\r\n\t\t\ttitleElement.classList.add(\"tabulator-title-editor\");\r\n\r\n\t\t\ttitleElement.addEventListener(\"click\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\ttitleElement.focus();\r\n\t\t\t});\r\n\r\n\t\t\ttitleElement.addEventListener(\"change\", () => {\r\n\t\t\t\tdef.title = titleElement.value;\r\n\t\t\t\tthis.dispatchExternal(\"columnTitleChanged\", this.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\ttitleHolderElement.appendChild(titleElement);\r\n\r\n\t\t\tif(def.field){\r\n\t\t\t\tthis.langBind(\"columns|\" + def.field, (text) => {\r\n\t\t\t\t\ttitleElement.value = text || (def.title || \" \");\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\ttitleElement.value = def.title || \" \";\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tif(def.field){\r\n\t\t\t\tthis.langBind(\"columns|\" + def.field, (text) => {\r\n\t\t\t\t\tthis._formatColumnHeaderTitle(titleHolderElement, text || (def.title || \" \"));\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tthis._formatColumnHeaderTitle(titleHolderElement, def.title || \" \");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn titleHolderElement;\r\n\t}\r\n\r\n\t_formatColumnHeaderTitle(el, title){\r\n\t\tvar contents = this.chain(\"column-format\", [this, title, el], null, () => {\r\n\t\t\treturn title;\r\n\t\t});\r\n\r\n\t\tswitch(typeof contents){\r\n\t\t\tcase \"object\":\r\n\t\t\tif(contents instanceof Node){\r\n\t\t\t\tel.appendChild(contents);\r\n\t\t\t}else{\r\n\t\t\t\tel.innerHTML = \"\";\r\n\t\t\t\tconsole.warn(\"Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:\", contents);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\tcase \"undefined\":\r\n\t\t\tel.innerHTML = \"\";\r\n\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\tel.innerHTML = contents;\r\n\t\t}\r\n\t}\r\n\r\n\t//build header element for column group\r\n\t_buildGroupHeader(){\r\n\t\tthis.element.classList.add(\"tabulator-col-group\");\r\n\t\tthis.element.setAttribute(\"role\", \"columngroup\");\r\n\t\tthis.element.setAttribute(\"aria-title\", this.definition.title);\r\n\r\n\t\t//asign additional css classes to column header\r\n\t\tif(this.definition.cssClass){\r\n\t\t\tvar classeNames = this.definition.cssClass.split(\" \");\r\n\t\t\tclasseNames.forEach((className) => {\r\n\t\t\t\tthis.element.classList.add(className);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.titleElement.style.textAlign = this.definition.headerHozAlign;\r\n\r\n\t\tthis.element.appendChild(this.groupElement);\r\n\t}\r\n\r\n\t//flat field lookup\r\n\t_getFlatData(data){\r\n\t\treturn data[this.field];\r\n\t}\r\n\r\n\t//nested field lookup\r\n\t_getNestedData(data){\r\n\t\tvar dataObj = data,\r\n\t\tstructure = this.fieldStructure,\r\n\t\tlength = structure.length,\r\n\t\toutput;\r\n\r\n\t\tfor(let i = 0; i < length; i++){\r\n\r\n\t\t\tdataObj = dataObj[structure[i]];\r\n\r\n\t\t\toutput = dataObj;\r\n\r\n\t\t\tif(!dataObj){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//flat field set\r\n\t_setFlatData(data, value){\r\n\t\tif(this.field){\r\n\t\t\tdata[this.field] = value;\r\n\t\t}\r\n\t}\r\n\r\n\t//nested field set\r\n\t_setNestedData(data, value){\r\n\t\tvar dataObj = data,\r\n\t\tstructure = this.fieldStructure,\r\n\t\tlength = structure.length;\r\n\r\n\t\tfor(let i = 0; i < length; i++){\r\n\r\n\t\t\tif(i == length -1){\r\n\t\t\t\tdataObj[structure[i]] = value;\r\n\t\t\t}else{\r\n\t\t\t\tif(!dataObj[structure[i]]){\r\n\t\t\t\t\tif(typeof value !== \"undefined\"){\r\n\t\t\t\t\t\tdataObj[structure[i]] = {};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdataObj = dataObj[structure[i]];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//attach column to this group\r\n\tattachColumn(column){\r\n\t\tif(this.groupElement){\r\n\t\t\tthis.columns.push(column);\r\n\t\t\tthis.groupElement.appendChild(column.getElement());\r\n\r\n\t\t\tcolumn.columnRendered();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Warning - Column being attached to another column instead of column group\");\r\n\t\t}\r\n\t}\r\n\r\n\t//vertically align header in column\r\n\tverticalAlign(alignment, height){\r\n\r\n\t\t//calculate height of column header and group holder element\r\n\t\tvar parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : (height || this.parent.getHeadersElement().clientHeight);\r\n\t\t// var parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : this.parent.getHeadersElement().clientHeight;\r\n\r\n\t\tthis.element.style.height = parentHeight + \"px\";\r\n\r\n\t\tthis.dispatch(\"column-height\", this, this.element.style.height);\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.groupElement.style.minHeight = (parentHeight - this.contentElement.offsetHeight) + \"px\";\r\n\t\t}\r\n\r\n\t\t//vertically align cell contents\r\n\t\tif(!this.isGroup && alignment !== \"top\"){\r\n\t\t\tif(alignment === \"bottom\"){\r\n\t\t\t\tthis.element.style.paddingTop = (this.element.clientHeight - this.contentElement.offsetHeight) + \"px\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.element.style.paddingTop = ((this.element.clientHeight - this.contentElement.offsetHeight) / 2) + \"px\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.verticalAlign(alignment);\r\n\t\t});\r\n\t}\r\n\r\n\t//clear vertical alignmenet\r\n\tclearVerticalAlign(){\r\n\t\tthis.element.style.paddingTop = \"\";\r\n\t\tthis.element.style.height = \"\";\r\n\t\tthis.element.style.minHeight = \"\";\r\n\t\tthis.groupElement.style.minHeight = \"\";\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.clearVerticalAlign();\r\n\t\t});\r\n\r\n\t\tthis.dispatch(\"column-height\", this, \"\");\r\n\t}\r\n\r\n\tbindModuleColumns (){\r\n\t\t//check if rownum formatter is being used on a column\r\n\t\tif(this.definition.formatter == \"rownum\"){\r\n\t\t\tthis.table.rowManager.rowNumColumn = this;\r\n\t\t}\r\n\t}\r\n\r\n\t//// Retreive Column Information ////\r\n\t//return column header element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\t//return colunm group element\r\n\tgetGroupElement(){\r\n\t\treturn this.groupElement;\r\n\t}\r\n\r\n\t//return field name\r\n\tgetField(){\r\n\t\treturn this.field;\r\n\t}\r\n\r\n\tgetTitleDownload() {\r\n\t\treturn this.titleDownload;\r\n\t}\r\n\r\n\t//return the first column in a group\r\n\tgetFirstColumn(){\r\n\t\tif(!this.isGroup){\r\n\t\t\treturn this;\r\n\t\t}else{\r\n\t\t\tif(this.columns.length){\r\n\t\t\t\treturn this.columns[0].getFirstColumn();\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//return the last column in a group\r\n\tgetLastColumn(){\r\n\t\tif(!this.isGroup){\r\n\t\t\treturn this;\r\n\t\t}else{\r\n\t\t\tif(this.columns.length){\r\n\t\t\t\treturn this.columns[this.columns.length -1].getLastColumn();\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//return all columns in a group\r\n\tgetColumns(){\r\n\t\treturn this.columns;\r\n\t}\r\n\r\n\t//return all columns in a group\r\n\tgetCells(){\r\n\t\treturn this.cells;\r\n\t}\r\n\r\n\t//retreive the top column in a group of columns\r\n\tgetTopColumn(){\r\n\t\tif(this.parent.isGroup){\r\n\t\t\treturn this.parent.getTopColumn();\r\n\t\t}else{\r\n\t\t\treturn this;\r\n\t\t}\r\n\t}\r\n\r\n\t//return column definition object\r\n\tgetDefinition(updateBranches){\r\n\t\tvar colDefs = [];\r\n\r\n\t\tif(this.isGroup && updateBranches){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tcolDefs.push(column.getDefinition(true));\r\n\t\t\t});\r\n\r\n\t\t\tthis.definition.columns = colDefs;\r\n\t\t}\r\n\r\n\t\treturn this.definition;\r\n\t}\r\n\r\n\t//////////////////// Actions ////////////////////\r\n\tcheckColumnVisibility(){\r\n\t\tvar visible = false;\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvisible = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(visible){\r\n\t\t\tthis.show();\r\n\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), false);\r\n\t\t}else{\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\t//show column\r\n\tshow(silent, responsiveToggle){\r\n\t\tif(!this.visible){\r\n\t\t\tthis.visible = true;\r\n\r\n\t\t\tthis.element.style.display = \"\";\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.checkColumnVisibility();\r\n\t\t\t}\r\n\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.show();\r\n\t\t\t});\r\n\r\n\t\t\tif(!this.isGroup && this.width === null){\r\n\t\t\t\tthis.reinitializeWidth();\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.columnManager.verticalAlignHeaders();\r\n\r\n\t\t\tthis.dispatch(\"column-show\", this, responsiveToggle);\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), true);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\r\n\t\t\tif(!this.silent){\r\n\t\t\t\tthis.table.columnManager.renderer.rerenderColumns();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//hide column\r\n\thide(silent, responsiveToggle){\r\n\t\tif(this.visible){\r\n\t\t\tthis.visible = false;\r\n\r\n\t\t\tthis.element.style.display = \"none\";\r\n\r\n\t\t\tthis.table.columnManager.verticalAlignHeaders();\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.checkColumnVisibility();\r\n\t\t\t}\r\n\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.hide();\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatch(\"column-hide\", this, responsiveToggle);\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), false);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\r\n\t\t\tif(!this.silent){\r\n\t\t\t\tthis.table.columnManager.renderer.rerenderColumns();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmatchChildWidths(){\r\n\t\tvar childWidth = 0;\r\n\r\n\t\tif(this.contentElement && this.columns.length){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tif(column.visible){\r\n\t\t\t\t\tchildWidth += column.getWidth();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.contentElement.style.maxWidth = (childWidth - 1) + \"px\";\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tremoveChild(child){\r\n\t\tvar index = this.columns.indexOf(child);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.columns.splice(index, 1);\r\n\t\t}\r\n\r\n\t\tif(!this.columns.length){\r\n\t\t\tthis.delete();\r\n\t\t}\r\n\t}\r\n\r\n\tsetWidth(width){\r\n\t\tthis.widthFixed = true;\r\n\t\tthis.setWidthActual(width);\r\n\t}\r\n\r\n\tsetWidthActual(width){\r\n\t\tif(isNaN(width)){\r\n\t\t\twidth = Math.floor((this.table.element.clientWidth/100) * parseInt(width));\r\n\t\t}\r\n\r\n\t\twidth = Math.max(this.minWidth, width);\r\n\r\n\t\tif(this.maxWidth){\r\n\t\t\twidth = Math.min(this.maxWidth, width);\r\n\t\t}\r\n\r\n\t\tthis.width = width;\r\n\t\tthis.widthStyled = width ? width + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.width = this.widthStyled;\r\n\r\n\t\tif(!this.isGroup){\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.setWidth();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.parent.isGroup){\r\n\t\t\tthis.parent.matchChildWidths();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-width\", this);\r\n\t}\r\n\r\n\tcheckCellHeights(){\r\n\t\tvar rows = [];\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tif(cell.row.heightInitialized){\r\n\t\t\t\tif(cell.row.getElement().offsetParent !== null){\r\n\t\t\t\t\trows.push(cell.row);\r\n\t\t\t\t\tcell.row.clearCellHeight();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcell.row.heightInitialized = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\trow.calcHeight();\r\n\t\t});\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\trow.setCellHeight();\r\n\t\t});\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\tvar width = 0;\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tif(column.visible){\r\n\t\t\t\t\twidth += column.getWidth();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\twidth = this.width;\r\n\t\t}\r\n\r\n\t\treturn width;\r\n\t}\r\n\r\n\tgetHeight(){\r\n\t\treturn Math.ceil(this.element.getBoundingClientRect().height);\r\n\t}\r\n\r\n\tsetMinWidth(minWidth){\r\n\t\tthis.minWidth = minWidth;\r\n\t\tthis.minWidthStyled = minWidth ? minWidth + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.minWidth = this.minWidthStyled;\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setMinWidth();\r\n\t\t});\r\n\t}\r\n\r\n\tsetMaxWidth(maxWidth){\r\n\t\tthis.maxWidth = maxWidth;\r\n\t\tthis.maxWidthStyled = maxWidth ? maxWidth + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.maxWidth = this.maxWidthStyled;\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setMaxWidth();\r\n\t\t});\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar index;\r\n\r\n\t\t\tif(this.isGroup){\r\n\t\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\t\tcolumn.delete();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatch(\"column-delete\", this);\r\n\r\n\t\t\tvar cellCount = this.cells.length;\r\n\r\n\t\t\tfor(let i = 0; i < cellCount; i++){\r\n\t\t\t\tthis.cells[0].delete();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.element.parentNode){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element = false;\r\n\t\t\tthis.contentElement = false;\r\n\t\t\tthis.titleElement = false;\r\n\t\t\tthis.groupElement = false;\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.removeChild(this);\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.columnManager.deregisterColumn(this);\r\n\r\n\t\t\tthis.table.columnManager.renderer.rerenderColumns(true);\r\n\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\r\n\tcolumnRendered(){\r\n\t\tif(this.titleFormatterRendered){\r\n\t\t\tthis.titleFormatterRendered();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-rendered\", this);\r\n\t}\r\n\r\n\t//////////////// Cell Management /////////////////\r\n\t//generate cell for this column\r\n\tgenerateCell(row){\r\n\t\tvar cell = new Cell(this, row);\r\n\r\n\t\tthis.cells.push(cell);\r\n\r\n\t\treturn cell;\r\n\t}\r\n\r\n\tnextColumn(){\r\n\t\tvar index = this.table.columnManager.findColumnIndex(this);\r\n\t\treturn index > -1 ? this._nextVisibleColumn(index + 1) : false;\r\n\t}\r\n\r\n\t_nextVisibleColumn(index){\r\n\t\tvar column = this.table.columnManager.getColumnByIndex(index);\r\n\t\treturn !column || column.visible ? column : this._nextVisibleColumn(index + 1);\r\n\t}\r\n\r\n\tprevColumn(){\r\n\t\tvar index = this.table.columnManager.findColumnIndex(this);\r\n\t\treturn index > -1 ? this._prevVisibleColumn(index - 1) : false;\r\n\t}\r\n\r\n\t_prevVisibleColumn(index){\r\n\t\tvar column = this.table.columnManager.getColumnByIndex(index);\r\n\t\treturn !column || column.visible ? column : this._prevVisibleColumn(index - 1);\r\n\t}\r\n\r\n\treinitializeWidth(force){\r\n\t\tthis.widthFixed = false;\r\n\r\n\t\t//set width if present\r\n\t\tif(typeof this.definition.width !== \"undefined\" && !force){\r\n\t\t\t// maxInitialWidth ignored here as width specified\r\n\t\t\tthis.setWidth(this.definition.width);\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-width-fit-before\", this);\r\n\r\n\t\tthis.fitToData(force);\r\n\r\n\t\tthis.dispatch(\"column-width-fit-after\", this);\r\n\t}\r\n\r\n\t//set column width to maximum cell width for non group columns\r\n\tfitToData(force){\r\n\t\tif(this.isGroup){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(!this.widthFixed){\r\n\t\t\tthis.element.style.width = \"\";\r\n\r\n\t\t\tthis.cells.forEach((cell) => {\r\n\t\t\t\tcell.clearWidth();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tvar maxWidth = this.element.offsetWidth;\r\n\r\n\t\tif(!this.width || !this.widthFixed){\r\n\t\t\tthis.cells.forEach((cell) => {\r\n\t\t\t\tvar width = cell.getWidth();\r\n\r\n\t\t\t\tif(width > maxWidth){\r\n\t\t\t\t\tmaxWidth = width;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(maxWidth){\r\n\t\t\t\tvar setTo = maxWidth + 1;\r\n\t\t\t\tif (this.maxInitialWidth && !force) {\r\n\t\t\t\t\tsetTo = Math.min(setTo, this.maxInitialWidth);\r\n\t\t\t\t}\r\n\t\t\t\tthis.setWidthActual(setTo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdateDefinition(updates){\r\n\t\tvar definition;\r\n\r\n\t\tif(!this.isGroup){\r\n\t\t\tif(!this.parent.isGroup){\r\n\t\t\t\tdefinition = Object.assign({}, this.getDefinition());\r\n\t\t\t\tdefinition = Object.assign(definition, updates);\r\n\r\n\t\t\t\treturn this.table.columnManager.addColumn(definition, false, this)\r\n\t\t\t\t.then((column) => {\r\n\r\n\t\t\t\t\tif(definition.field == this.field){\r\n\t\t\t\t\t\tthis.field = false; //cleair field name to prevent deletion of duplicate column from arrays\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn this.delete()\r\n\t\t\t\t\t.then(() => {\r\n\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Column Update Error - The updateDefinition function is only available on ungrouped columns\");\r\n\t\t\t\treturn Promise.reject(\"Column Update Error - The updateDefinition function is only available on columns, not column groups\");\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Column Update Error - The updateDefinition function is only available on ungrouped columns\");\r\n\t\t\treturn Promise.reject(\"Column Update Error - The updateDefinition function is only available on columns, not column groups\");\r\n\t\t}\r\n\t}\r\n\r\n\tdeleteCell(cell){\r\n\t\tvar index = this.cells.indexOf(cell);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.cells.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new ColumnComponent(this);\r\n\t\t}\r\n\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n\r\nColumn.defaultOptionList = defaultOptions;\r\n\r\nexport default Column;\r\n","//public row object\r\nexport default class RowComponent {\r\n\r\n\tconstructor (row){\r\n\t\tthis._row = row;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._row.table.componentFunctionBinder.handle(\"row\", target._row, name)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\tgetData(transform){\r\n\t\treturn this._row.getData(transform);\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._row.getElement();\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._row.getCells().forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tgetCell(column){\r\n\t\tvar cell = this._row.getCell(column);\r\n\t\treturn cell ? cell.getComponent() : false;\r\n\t}\r\n\r\n\tgetIndex(){\r\n\t\treturn this._row.getData(\"data\")[this._row.table.options.index];\r\n\t}\r\n\r\n\tgetPosition(active){\r\n\t\treturn this._row.table.rowManager.getRowPosition(this._row, active);\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn this._row.delete();\r\n\t}\r\n\r\n\tscrollTo(){\r\n\t\treturn this._row.table.rowManager.scrollToRow(this._row);\r\n\t}\r\n\r\n\tmove(to, after){\r\n\t\tthis._row.moveToRow(to, after);\r\n\t}\r\n\r\n\tupdate(data){\r\n\t\treturn this._row.updateData(data);\r\n\t}\r\n\r\n\tnormalizeHeight(){\r\n\t\tthis._row.normalizeHeight(true);\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._row;\r\n\t}\r\n\r\n\treformat(){\r\n\t\treturn this._row.reinitialize();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._row.table;\r\n\t}\r\n\r\n\tgetNextRow(){\r\n\t\tvar row = this._row.nextRow();\r\n\t\treturn row ? row.getComponent() : row;\r\n\t}\r\n\r\n\tgetPrevRow(){\r\n\t\tvar row = this._row.prevRow();\r\n\t\treturn row ? row.getComponent() : row;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport RowComponent from './RowComponent.js';\r\nimport Helpers from '../tools/Helpers.js';\r\n\r\nexport default class Row extends CoreFeature{\r\n\tconstructor (data, parent, type = \"row\"){\r\n\t\tsuper(parent.table);\r\n\t\t\r\n\t\tthis.parent = parent;\r\n\t\tthis.data = {};\r\n\t\tthis.type = type; //type of element\r\n\t\tthis.element = false;\r\n\t\tthis.modules = {}; //hold module variables;\r\n\t\tthis.cells = [];\r\n\t\tthis.height = 0; //hold element height\r\n\t\tthis.heightStyled = \"\"; //hold element height prestyled to improve render efficiency\r\n\t\tthis.manualHeight = false; //user has manually set row height\r\n\t\tthis.outerHeight = 0; //hold elements outer height\r\n\t\tthis.initialized = false; //element has been rendered\r\n\t\tthis.heightInitialized = false; //element has resized cells to fit\r\n\t\t\r\n\t\tthis.component = null;\r\n\t\t\r\n\t\tthis.created = false;\r\n\t\t\r\n\t\tthis.setData(data);\r\n\t}\r\n\t\r\n\tcreate(){\r\n\t\tif(!this.created){\r\n\t\t\tthis.created = true;\r\n\t\t\tthis.generateElement();\r\n\t\t}\r\n\t}\r\n\t\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-row\");\r\n\t\tel.setAttribute(\"role\", \"row\");\r\n\t\t\r\n\t\tthis.element = el;\r\n\t}\r\n\t\r\n\tgetElement(){\r\n\t\tthis.create();\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\tdetachElement(){\r\n\t\tif (this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgenerateElement(){\r\n\t\tthis.createElement();\r\n\t\tthis.dispatch(\"row-init\", this);\r\n\t}\r\n\t\r\n\tgenerateCells(){\r\n\t\tthis.cells = this.table.columnManager.generateCells(this);\r\n\t}\r\n\t\r\n\t//functions to setup on first render\r\n\tinitialize(force){\r\n\t\tthis.create();\r\n\t\t\r\n\t\tif(!this.initialized || force){\r\n\t\t\t\r\n\t\t\tthis.deleteCells();\r\n\t\t\t\r\n\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout-before\", this);\r\n\t\t\t\r\n\t\t\tthis.generateCells();\r\n\t\t\t\r\n\t\t\tthis.initialized = true;\r\n\t\t\t\r\n\t\t\tthis.table.columnManager.renderer.renderRowCells(this);\r\n\t\t\t\r\n\t\t\tif(force){\r\n\t\t\t\tthis.normalizeHeight();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout\", this);\r\n\t\t\t\r\n\t\t\tif(this.table.options.rowFormatter){\r\n\t\t\t\tthis.table.options.rowFormatter(this.getComponent());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout-after\", this);\r\n\t\t}else{\r\n\t\t\tthis.table.columnManager.renderer.rerenderRowCells(this);\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeHeight(){\r\n\t\tthis.heightInitialized = false;\r\n\t\t\r\n\t\tif(this.element && this.element.offsetParent !== null){\r\n\t\t\tthis.normalizeHeight(true);\r\n\t\t}\r\n\t}\r\n\r\n\tdeinitialize(){\r\n\t\tthis.initialized = false;\r\n\t}\r\n\t\r\n\tdeinitializeHeight(){\r\n\t\tthis.heightInitialized = false;\r\n\t}\r\n\t\r\n\treinitialize(children){\r\n\t\tthis.initialized = false;\r\n\t\tthis.heightInitialized = false;\r\n\t\t\r\n\t\tif(!this.manualHeight){\r\n\t\t\tthis.height = 0;\r\n\t\t\tthis.heightStyled = \"\";\r\n\t\t}\r\n\t\t\r\n\t\tif(this.element && this.element.offsetParent !== null){\r\n\t\t\tthis.initialize(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatch(\"row-relayout\", this);\r\n\t}\r\n\t\r\n\t//get heights when doing bulk row style calcs in virtual DOM\r\n\tcalcHeight(force){\r\n\t\tvar maxHeight = 0,\r\n\t\tminHeight;\r\n\t\t\r\n\t\tif(this.table.options.rowHeight){\r\n\t\t\tthis.height = this.table.options.rowHeight;\r\n\t\t}else{\r\n\t\t\tminHeight = this.table.options.resizableRows ? this.element.clientHeight : 0;\r\n\t\t\t\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tvar height = cell.getHeight();\r\n\t\t\t\tif(height > maxHeight){\r\n\t\t\t\t\tmaxHeight = height;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(force){\r\n\t\t\t\tthis.height = Math.max(maxHeight, minHeight);\r\n\t\t\t}else{\r\n\t\t\t\tthis.height = this.manualHeight ? this.height : Math.max(maxHeight, minHeight);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.heightStyled = this.height ? this.height + \"px\" : \"\";\r\n\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t}\r\n\t\r\n\t//set of cells\r\n\tsetCellHeight(){\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setHeight();\r\n\t\t});\r\n\t\t\r\n\t\tthis.heightInitialized = true;\r\n\t}\r\n\t\r\n\tclearCellHeight(){\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.clearHeight();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//normalize the height of elements in the row\r\n\tnormalizeHeight(force){\r\n\t\tif(force && !this.table.options.rowHeight){\r\n\t\t\tthis.clearCellHeight();\r\n\t\t}\r\n\t\t\r\n\t\tthis.calcHeight(force);\r\n\t\t\r\n\t\tthis.setCellHeight();\r\n\t}\r\n\t\r\n\t//set height of rows\r\n\tsetHeight(height, force){\r\n\t\tif(this.height != height || force){\r\n\t\t\t\r\n\t\t\tthis.manualHeight = true;\r\n\t\t\t\r\n\t\t\tthis.height = height;\r\n\t\t\tthis.heightStyled = height ? height + \"px\" : \"\";\r\n\t\t\t\r\n\t\t\tthis.setCellHeight();\r\n\t\t\t\r\n\t\t\t// this.outerHeight = this.element.outerHeight();\r\n\t\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return rows outer height\r\n\tgetHeight(){\r\n\t\treturn this.outerHeight;\r\n\t}\r\n\t\r\n\t//return rows outer Width\r\n\tgetWidth(){\r\n\t\treturn this.element.offsetWidth;\r\n\t}\r\n\t\r\n\t//////////////// Cell Management /////////////////\r\n\tdeleteCell(cell){\r\n\t\tvar index = this.cells.indexOf(cell);\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.cells.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////// Data Management /////////////////\r\n\tsetData(data){\r\n\t\tthis.data = this.chain(\"row-data-init-before\", [this, data], undefined, data);\r\n\t\t\r\n\t\tthis.dispatch(\"row-data-init-after\", this);\r\n\t}\r\n\t\r\n\t//update the rows data\r\n\tupdateData(updatedData){\r\n\t\tvar visible = this.element && Helpers.elVisible(this.element),\r\n\t\ttempData = {},\r\n\t\tnewRowData;\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\r\n\t\t\tif(typeof updatedData === \"string\"){\r\n\t\t\t\tupdatedData = JSON.parse(updatedData);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-save-before\", this);\r\n\t\t\t\r\n\t\t\tif(this.subscribed(\"row-data-changing\")){\r\n\t\t\t\ttempData = Object.assign(tempData, this.data);\r\n\t\t\t\ttempData = Object.assign(tempData, updatedData);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tnewRowData = this.chain(\"row-data-changing\", [this, tempData, updatedData], null, updatedData);\r\n\t\t\t\r\n\t\t\t//set data\r\n\t\t\tfor (var attrname in newRowData) {\r\n\t\t\t\tthis.data[attrname] = newRowData[attrname];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-save-after\", this);\r\n\t\t\t\r\n\t\t\t//update affected cells only\r\n\t\t\tfor (var attrname in updatedData) {\r\n\t\t\t\t\r\n\t\t\t\tlet columns = this.table.columnManager.getColumnsByFieldRoot(attrname);\r\n\t\t\t\t\r\n\t\t\t\tcolumns.forEach((column) => {\r\n\t\t\t\t\tlet cell = this.getCell(column.getField());\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(cell){\r\n\t\t\t\t\t\tlet value = column.getFieldValue(newRowData);\r\n\t\t\t\t\t\tif(cell.getValue() != value){\r\n\t\t\t\t\t\t\tcell.setValueProcessData(value);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(visible){\r\n\t\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Partial reinitialization if visible\r\n\t\t\tif(visible){\r\n\t\t\t\tthis.normalizeHeight(true);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.rowFormatter){\r\n\t\t\t\t\tthis.table.options.rowFormatter(this.getComponent());\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.initialized = false;\r\n\t\t\t\tthis.height = 0;\r\n\t\t\t\tthis.heightStyled = \"\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-changed\", this, visible, updatedData);\r\n\t\t\t\r\n\t\t\t//this.reinitialize();\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"rowUpdated\", this.getComponent());\r\n\t\t\t\r\n\t\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetData(transform){\r\n\t\tif(transform){\r\n\t\t\treturn this.chain(\"row-data-retrieve\", [this, transform], null, this.data);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.data;\r\n\t}\r\n\t\r\n\tgetCell(column){\r\n\t\tvar match = false;\r\n\t\t\r\n\t\tcolumn = this.table.columnManager.findColumn(column);\r\n\t\t\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.generateCells();\r\n\t\t}\r\n\t\t\r\n\t\tmatch = this.cells.find(function(cell){\r\n\t\t\treturn cell.column === column;\r\n\t\t});\r\n\t\t\r\n\t\treturn match;\r\n\t}\r\n\t\r\n\tgetCellIndex(findCell){\r\n\t\treturn this.cells.findIndex(function(cell){\r\n\t\t\treturn cell === findCell;\r\n\t\t});\r\n\t}\r\n\t\r\n\tfindCell(subject){\r\n\t\treturn this.cells.find((cell) => {\r\n\t\t\treturn cell.element === subject;\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetCells(){\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.generateCells();\r\n\t\t}\r\n\t\t\r\n\t\treturn this.cells;\r\n\t}\r\n\t\r\n\tnextRow(){\r\n\t\tvar row = this.table.rowManager.nextDisplayRow(this, true);\r\n\t\treturn row || false;\r\n\t}\r\n\t\r\n\tprevRow(){\r\n\t\tvar row = this.table.rowManager.prevDisplayRow(this, true);\r\n\t\treturn row || false;\r\n\t}\r\n\t\r\n\tmoveToRow(to, before){\r\n\t\tvar toRow = this.table.rowManager.findRow(to);\r\n\t\t\r\n\t\tif(toRow){\r\n\t\t\tthis.table.rowManager.moveRowActual(this, toRow, !before);\r\n\t\t\tthis.table.rowManager.refreshActiveData(\"display\", false, true);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching row found:\", to);\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////// Actions /////////////////////\r\n\tdelete(){\r\n\t\tthis.dispatch(\"row-delete\", this);\r\n\t\t\r\n\t\tthis.deleteActual();\r\n\t\t\r\n\t\treturn Promise.resolve();\r\n\t}\r\n\t\r\n\tdeleteActual(blockRedraw){\r\n\t\tvar index = this.table.rowManager.getRowIndex(this);\r\n\t\t\r\n\t\tthis.detatchModules();\r\n\t\t\r\n\t\tthis.table.rowManager.deleteRow(this, blockRedraw);\r\n\t\t\r\n\t\tthis.deleteCells();\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.heightInitialized = false;\r\n\t\tthis.element = false;\r\n\t\t\r\n\t\tthis.dispatch(\"row-deleted\", this);\r\n\t}\r\n\t\r\n\tdetatchModules(){\r\n\t\tthis.dispatch(\"row-deleting\", this);\r\n\t}\r\n\t\r\n\tdeleteCells(){\r\n\t\tvar cellCount = this.cells.length;\r\n\t\t\r\n\t\tfor(let i = 0; i < cellCount; i++){\r\n\t\t\tthis.cells[0].delete();\r\n\t\t}\r\n\t}\r\n\t\r\n\twipe(){\r\n\t\tthis.detatchModules();\r\n\t\tthis.deleteCells();\r\n\t\t\r\n\t\tif(this.element){\r\n\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\t\r\n\t\t\tif(this.element.parentNode){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.element = false;\r\n\t\tthis.modules = {};\r\n\t}\r\n\t\r\n\tgetGroup(){\r\n\t\treturn this.modules.group || false;\r\n\t}\r\n\t\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new RowComponent(this);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.component;\r\n\t}\r\n}","export default {\r\n\t\"avg\":function(values, data, calcParams){\r\n\t\tvar output = 0,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : 2\r\n\r\n\t\tif(values.length){\r\n\t\t\toutput = values.reduce(function(sum, value){\r\n\t\t\t\treturn Number(sum) + Number(value);\r\n\t\t\t});\r\n\r\n\t\t\toutput = output / values.length;\r\n\r\n\t\t\toutput = precision !== false ? output.toFixed(precision) : output;\r\n\t\t}\r\n\r\n\t\treturn parseFloat(output).toString();\r\n\t},\r\n\t\"max\":function(values, data, calcParams){\r\n\t\tvar output = null,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tvalues.forEach(function(value){\r\n\r\n\t\t\tvalue = Number(value);\r\n\r\n\t\t\tif(value > output || output === null){\r\n\t\t\t\toutput = value;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output !== null ? (precision !== false ? output.toFixed(precision) : output) : \"\";\r\n\t},\r\n\t\"min\":function(values, data, calcParams){\r\n\t\tvar output = null,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tvalues.forEach(function(value){\r\n\r\n\t\t\tvalue = Number(value);\r\n\r\n\t\t\tif(value < output || output === null){\r\n\t\t\t\toutput = value;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output !== null ? (precision !== false ? output.toFixed(precision) : output) : \"\";\r\n\t},\r\n\t\"sum\":function(values, data, calcParams){\r\n\t\tvar output = 0,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tif(values.length){\r\n\t\t\tvalues.forEach(function(value){\r\n\t\t\t\tvalue = Number(value);\r\n\r\n\t\t\t\toutput += !isNaN(value) ? Number(value) : 0;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn precision !== false ? output.toFixed(precision) : output;\r\n\t},\r\n\t\"concat\":function(values, data, calcParams){\r\n\t\tvar output = 0;\r\n\r\n\t\tif(values.length){\r\n\t\t\toutput = values.reduce(function(sum, value){\r\n\t\t\t\treturn String(sum) + String(value);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t},\r\n\t\"count\":function(values, data, calcParams){\r\n\t\tvar output = 0;\r\n\r\n\t\tif(values.length){\r\n\t\t\tvalues.forEach(function(value){\r\n\t\t\t\tif(value){\r\n\t\t\t\t\toutput ++;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport CalcComponent from './CalcComponent.js';\r\n\r\nimport Cell from '../../core/cell/Cell.js';\r\nimport Column from '../../core/column/Column.js';\r\nimport Row from '../../core/row/Row.js';\r\n\r\nimport defaultCalculations from './defaults/calculations.js';\r\n\r\nclass ColumnCalcs extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.topCalcs = [];\r\n\t\tthis.botCalcs = [];\r\n\t\tthis.genColumn = false;\r\n\t\tthis.topElement = this.createElement();\r\n\t\tthis.botElement = this.createElement();\r\n\t\tthis.topRow = false;\r\n\t\tthis.botRow = false;\r\n\t\tthis.topInitialized = false;\r\n\t\tthis.botInitialized = false;\r\n\r\n\t\tthis.registerTableOption(\"columnCalcs\", true);\r\n\r\n\t\tthis.registerColumnOption(\"topCalc\");\r\n\t\tthis.registerColumnOption(\"topCalcParams\");\r\n\t\tthis.registerColumnOption(\"topCalcFormatter\");\r\n\t\tthis.registerColumnOption(\"topCalcFormatterParams\");\r\n\t\tthis.registerColumnOption(\"bottomCalc\");\r\n\t\tthis.registerColumnOption(\"bottomCalcParams\");\r\n\t\tthis.registerColumnOption(\"bottomCalcFormatter\");\r\n\t\tthis.registerColumnOption(\"bottomCalcFormatterParams\");\r\n\t}\r\n\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tel.classList.add(\"tabulator-calcs-holder\");\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.genColumn = new Column({field:\"value\"}, this);\r\n\r\n\t\tthis.subscribe(\"cell-value-changed\", this.cellValueChanged.bind(this));\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumnCheck.bind(this));\r\n\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"row-added\", this.rowsUpdated.bind(this));\r\n\t\tthis.subscribe(\"column-moved\", this.recalcActiveRows.bind(this));\r\n\t\tthis.subscribe(\"column-add\", this.recalcActiveRows.bind(this));\r\n\t\tthis.subscribe(\"data-refreshed\", this.recalcActiveRowsRefresh.bind(this));\r\n\t\tthis.subscribe(\"table-redraw\", this.tableRedraw.bind(this));\r\n\t\tthis.subscribe(\"rows-visible\", this.visibleRows.bind(this));\r\n\r\n\t\tthis.registerTableFunction(\"getCalcResults\", this.getResults.bind(this));\r\n\t\tthis.registerTableFunction(\"recalc\", this.userRecalc.bind(this));\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\r\n\t\tif(force){\r\n\t\t\tthis.redraw();\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\tuserRecalc(){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tvisibleRows(viewable, rows){\r\n\t\tif(this.topRow){\r\n\t\t\trows.unshift(this.topRow);\r\n\t\t}\r\n\r\n\t\tif(this.botRow){\r\n\t\t\trows.push(this.botRow);\r\n\t\t}\r\n\t\r\n\t\treturn rows;\r\n\t}\r\n\r\n\trowsUpdated(row){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.recalcRowGroup(this);\r\n\t\t}else{\r\n\t\t\tthis.recalcActiveRows();\r\n\t\t}\r\n\t}\r\n\r\n\trecalcActiveRowsRefresh(){\r\n\t\tif(this.table.options.groupBy && this.table.options.dataTreeStartExpanded && this.table.options.dataTree){\r\n\t\t\tthis.recalcAll();\r\n\t\t}else{\r\n\t\t\tthis.recalcActiveRows();\r\n\t\t}\r\n\t}\r\n\r\n\trecalcActiveRows(){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\t}\r\n\r\n\tcellValueChanged(cell){\r\n\t\tif(cell.column.definition.topCalc || cell.column.definition.bottomCalc){\r\n\t\t\tif(this.table.options.groupBy){\r\n\t\t\t\tif(this.table.options.columnCalcs == \"table\" || this.table.options.columnCalcs == \"both\"){\r\n\t\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"table\"){\r\n\t\t\t\t\tthis.recalcRowGroup(cell.row);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeColumnCheck(column){\r\n\t\tif(column.definition.topCalc || column.definition.bottomCalc){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\r\n\t//initialize column calcs\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.definition\r\n\r\n\t\tvar config = {\r\n\t\t\ttopCalcParams:def.topCalcParams || {},\r\n\t\t\tbotCalcParams:def.bottomCalcParams || {},\r\n\t\t};\r\n\r\n\t\tif(def.topCalc){\r\n\r\n\t\t\tswitch(typeof def.topCalc){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tif(ColumnCalcs.calculations[def.topCalc]){\r\n\t\t\t\t\tconfig.topCalc = ColumnCalcs.calculations[def.topCalc]\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Column Calc Error - No such calculation found, ignoring: \", def.topCalc);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tconfig.topCalc = def.topCalc;\r\n\t\t\t\tbreak\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(config.topCalc){\r\n\t\t\t\tcolumn.modules.columnCalcs = config;\r\n\t\t\t\tthis.topCalcs.push(column);\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"group\"){\r\n\t\t\t\t\tthis.initializeTopRow();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tif(def.bottomCalc){\r\n\t\t\tswitch(typeof def.bottomCalc){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tif(ColumnCalcs.calculations[def.bottomCalc]){\r\n\t\t\t\t\tconfig.botCalc = ColumnCalcs.calculations[def.bottomCalc]\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Column Calc Error - No such calculation found, ignoring: \", def.bottomCalc);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tconfig.botCalc = def.bottomCalc;\r\n\t\t\t\tbreak\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(config.botCalc){\r\n\t\t\t\tcolumn.modules.columnCalcs = config;\r\n\t\t\t\tthis.botCalcs.push(column);\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"group\"){\r\n\t\t\t\t\tthis.initializeBottomRow();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t//dummy functions to handle being mock column manager\r\n\tregisterColumnField(){};\r\n\r\n\tremoveCalcs(){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(this.topInitialized){\r\n\t\t\tthis.topInitialized = false;\r\n\t\t\tthis.topElement.parentNode.removeChild(this.topElement);\r\n\t\t\tchanged = true;\r\n\t\t}\r\n\r\n\t\tif(this.botInitialized){\r\n\t\t\tthis.botInitialized = false;\r\n\t\t\tthis.footerRemove(this.botElement);\r\n\t\t\tchanged = true;\r\n\t\t}\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeTopRow(){\r\n\t\tif(!this.topInitialized){\r\n\t\t\tthis.table.columnManager.getElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling);\r\n\t\t\tthis.topInitialized = true;\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeBottomRow(){\r\n\t\tif(!this.botInitialized){\r\n\t\t\tthis.footerPrepend(this.botElement);\r\n\t\t\tthis.botInitialized = true;\r\n\t\t}\r\n\t}\r\n\r\n\tscrollHorizontal(left){\r\n\t\tif(this.botInitialized && this.botRow){\r\n\t\t\tthis.botRow.getElement().style.marginLeft = (-left) + \"px\";\r\n\t\t}\r\n\t}\r\n\r\n\trecalc(rows){\r\n\t\tvar data, row;\r\n\r\n\t\tif(this.topInitialized || this.botInitialized){\r\n\t\t\tdata = this.rowsToData(rows);\r\n\r\n\t\t\tif(this.topInitialized){\r\n\t\t\t\tif(this.topRow){\r\n\t\t\t\t\tthis.topRow.deleteCells();\r\n\t\t\t\t}\r\n\r\n\t\t\t\trow = this.generateRow(\"top\", this.rowsToData(rows))\r\n\t\t\t\tthis.topRow = row;\r\n\t\t\t\twhile(this.topElement.firstChild) this.topElement.removeChild(this.topElement.firstChild);\r\n\t\t\t\tthis.topElement.appendChild(row.getElement());\r\n\t\t\t\trow.initialize(true);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.botInitialized){\r\n\t\t\t\tif(this.botRow){\r\n\t\t\t\t\tthis.botRow.deleteCells();\r\n\t\t\t\t}\r\n\r\n\t\t\t\trow = this.generateRow(\"bottom\", this.rowsToData(rows))\r\n\t\t\t\tthis.botRow = row;\r\n\t\t\t\twhile(this.botElement.firstChild) this.botElement.removeChild(this.botElement.firstChild);\r\n\t\t\t\tthis.botElement.appendChild(row.getElement());\r\n\t\t\t\trow.initialize(true);\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\t//set resizable handles\r\n\t\t\tif(this.table.modExists(\"frozenColumns\")){\r\n\t\t\t\tthis.table.modules.frozenColumns.layout();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trecalcRowGroup(row){\r\n\t\tthis.recalcGroup(this.table.modules.groupRows.getRowGroup(row));\r\n\t}\r\n\r\n\trecalcAll(){\r\n\t\tif(this.topCalcs.length || this.botCalcs.length){\r\n\t\t\tif(this.table.options.columnCalcs !== \"group\"){\r\n\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.options.groupBy && this.table.options.columnCalcs !== \"table\"){\r\n\r\n\t\t\t\tvar groups = this.table.modules.groupRows.getChildGroups();\r\n\r\n\t\t\t\tgroups.forEach((group) => {\r\n\t\t\t\t\tthis.recalcGroup(group);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trecalcGroup(group){\r\n\t\tvar data, rowData;\r\n\r\n\t\tif(group){\r\n\t\t\tif(group.calcs){\r\n\t\t\t\tif(group.calcs.bottom){\r\n\t\t\t\t\tdata = this.rowsToData(group.rows);\r\n\t\t\t\t\trowData = this.generateRowData(\"bottom\", data);\r\n\r\n\t\t\t\t\tgroup.calcs.bottom.updateData(rowData);\r\n\t\t\t\t\tgroup.calcs.bottom.reinitialize();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(group.calcs.top){\r\n\t\t\t\t\tdata = this.rowsToData(group.rows);\r\n\t\t\t\t\trowData = this.generateRowData(\"top\", data);\r\n\r\n\t\t\t\t\tgroup.calcs.top.updateData(rowData);\r\n\t\t\t\t\tgroup.calcs.top.reinitialize();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//generate top stats row\r\n\tgenerateTopRow(rows){\r\n\t\treturn this.generateRow(\"top\", this.rowsToData(rows));\r\n\t}\r\n\t//generate bottom stats row\r\n\tgenerateBottomRow(rows){\r\n\t\treturn this.generateRow(\"bottom\", this.rowsToData(rows));\r\n\t}\r\n\r\n\trowsToData(rows){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\trows.forEach((row) => {\r\n\t\t\tdata.push(row.getData());\r\n\r\n\t\t\tif(this.table.options.dataTree && this.table.options.dataTreeChildColumnCalcs){\r\n\t\t\t\tif(row.modules.dataTree && row.modules.dataTree.open){\r\n\t\t\t\t\tvar children = this.rowsToData(this.table.modules.dataTree.getFilteredTreeChildren(row));\r\n\t\t\t\t\tdata = data.concat(children);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//generate stats row\r\n\tgenerateRow(pos, data){\r\n\t\tvar rowData = this.generateRowData(pos, data),\r\n\t\trow;\r\n\r\n\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\tthis.table.modules.mutator.disable();\r\n\t\t}\r\n\r\n\t\trow = new Row(rowData, this, \"calc\");\r\n\r\n\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\tthis.table.modules.mutator.enable();\r\n\t\t}\r\n\r\n\t\trow.getElement().classList.add(\"tabulator-calcs\", \"tabulator-calcs-\" + pos);\r\n\r\n\t\trow.component = false;\r\n\r\n\t\trow.getComponent = () => {\r\n\t\t\tif(!row.component){\r\n\t\t\t\trow.component = new CalcComponent(row);\r\n\t\t\t}\r\n\r\n\t\t\treturn row.component;\r\n\t\t};\r\n\r\n\t\trow.generateCells = () => {\r\n\r\n\t\t\tvar cells = [];\r\n\r\n\t\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\r\n\t\t\t\t\t//set field name of mock column\r\n\t\t\t\t\tthis.genColumn.setField(column.getField());\r\n\t\t\t\t\tthis.genColumn.hozAlign = column.hozAlign;\r\n\r\n\t\t\t\t\tif(column.definition[pos + \"CalcFormatter\"] && this.table.modExists(\"format\")){\r\n\t\t\t\t\t\tthis.genColumn.modules.format = {\r\n\t\t\t\t\t\t\tformatter: this.table.modules.format.getFormatter(column.definition[pos + \"CalcFormatter\"]),\r\n\t\t\t\t\t\t\tparams: column.definition[pos + \"CalcFormatterParams\"] || {},\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.genColumn.modules.format = {\r\n\t\t\t\t\t\t\tformatter: this.table.modules.format.getFormatter(\"plaintext\"),\r\n\t\t\t\t\t\t\tparams:{}\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//ensure css class defintion is replicated to calculation cell\r\n\t\t\t\t\tthis.genColumn.definition.cssClass = column.definition.cssClass;\r\n\r\n\t\t\t\t\t//generate cell and assign to correct column\r\n\t\t\t\t\tvar cell = new Cell(this.genColumn, row);\r\n\t\t\t\t\tcell.getElement();\r\n\t\t\t\t\tcell.column = column;\r\n\t\t\t\t\tcell.setWidth();\r\n\r\n\t\t\t\t\tcolumn.cells.push(cell);\r\n\t\t\t\t\tcells.push(cell);\r\n\r\n\t\t\t\t\tif(!column.visible){\r\n\t\t\t\t\t\tcell.hide();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\trow.cells = cells;\r\n\t\t};\r\n\r\n\t\treturn row;\r\n\t}\r\n\r\n\t//generate stats row\r\n\tgenerateRowData(pos, data){\r\n\t\tvar rowData = {},\r\n\t\tcalcs = pos == \"top\" ? this.topCalcs : this.botCalcs,\r\n\t\ttype = pos == \"top\" ? \"topCalc\" : \"botCalc\",\r\n\t\tparams, paramKey;\r\n\r\n\t\tcalcs.forEach(function(column){\r\n\t\t\tvar values = [];\r\n\r\n\t\t\tif(column.modules.columnCalcs && column.modules.columnCalcs[type]){\r\n\t\t\t\tdata.forEach(function(item){\r\n\t\t\t\t\tvalues.push(column.getFieldValue(item));\r\n\t\t\t\t});\r\n\r\n\t\t\t\tparamKey = type + \"Params\";\r\n\t\t\t\tparams = typeof column.modules.columnCalcs[paramKey] === \"function\" ? column.modules.columnCalcs[paramKey](values, data) : column.modules.columnCalcs[paramKey];\r\n\r\n\t\t\t\tcolumn.setFieldValue(rowData, column.modules.columnCalcs[type](values, data, params));\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowData;\r\n\t}\r\n\r\n\thasTopCalcs(){\r\n\t\treturn\t!!(this.topCalcs.length);\r\n\t}\r\n\r\n\thasBottomCalcs(){\r\n\t\treturn\t!!(this.botCalcs.length);\r\n\t}\r\n\r\n\t//handle table redraw\r\n\tredraw(){\r\n\t\tif(this.topRow){\r\n\t\t\tthis.topRow.normalizeHeight(true);\r\n\t\t}\r\n\t\tif(this.botRow){\r\n\t\t\tthis.botRow.normalizeHeight(true);\r\n\t\t}\r\n\t}\r\n\r\n\t//return the calculated\r\n\tgetResults(){\r\n\t\tvar results = {},\r\n\t\tgroups;\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tgroups = this.table.modules.groupRows.getGroups(true);\r\n\r\n\t\t\tgroups.forEach((group) => {\r\n\t\t\t\tresults[group.getKey()] = this.getGroupResults(group);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tresults = {\r\n\t\t\t\ttop: this.topRow ? this.topRow.getData() : {},\r\n\t\t\t\tbottom: this.botRow ? this.botRow.getData() : {},\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\t//get results from a group\r\n\tgetGroupResults(group){\r\n\t\tvar groupObj = group._getSelf(),\r\n\t\tsubGroups = group.getSubGroups(),\r\n\t\tsubGroupResults = {},\r\n\t\tresults = {};\r\n\r\n\t\tsubGroups.forEach((subgroup) => {\r\n\t\t\tsubGroupResults[subgroup.getKey()] = this.getGroupResults(subgroup);\r\n\t\t});\r\n\r\n\t\tresults = {\r\n\t\t\ttop: groupObj.calcs.top ? groupObj.calcs.top.getData() : {},\r\n\t\t\tbottom: groupObj.calcs.bottom ? groupObj.calcs.bottom.getData() : {},\r\n\t\t\tgroups: subGroupResults,\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n}\r\n\r\nColumnCalcs.moduleName = \"columnCalcs\";\r\n\r\n//load defaults\r\nColumnCalcs.calculations = defaultCalculations;\r\n\r\nexport default ColumnCalcs;","import Module from '../../core/Module.js';\r\n\r\nimport Row from '../../core/row/Row.js';\r\n\r\nclass DataTree extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.indent = 10;\r\n\t\tthis.field = \"\";\r\n\t\tthis.collapseEl = null;\r\n\t\tthis.expandEl = null;\r\n\t\tthis.branchEl = null;\r\n\t\tthis.elementField = false;\r\n\r\n\t\tthis.startOpen = function(){};\r\n\r\n\t\tthis.displayIndex = 0;\r\n\r\n\t\tthis.registerTableOption(\"dataTree\", false); //enable data tree\r\n\t\tthis.registerTableOption(\"dataTreeFilter\", true); //filter child rows\r\n\t\tthis.registerTableOption(\"dataTreeSort\", true); //sort child rows\r\n\t\tthis.registerTableOption(\"dataTreeElementColumn\", false);\r\n\t\tthis.registerTableOption(\"dataTreeBranchElement\", true);//show data tree branch element\r\n\t\tthis.registerTableOption(\"dataTreeChildIndent\", 9); //data tree child indent in px\r\n\t\tthis.registerTableOption(\"dataTreeChildField\", \"_children\");//data tre column field to look for child rows\r\n\t\tthis.registerTableOption(\"dataTreeCollapseElement\", false);//data tree row collapse element\r\n\t\tthis.registerTableOption(\"dataTreeExpandElement\", false);//data tree row expand element\r\n\t\tthis.registerTableOption(\"dataTreeStartExpanded\", false);\r\n\t\tthis.registerTableOption(\"dataTreeChildColumnCalcs\", false);//include visible data tree rows in column calculations\r\n\t\tthis.registerTableOption(\"dataTreeSelectPropagate\", false);//seleccting a parent row selects its children\r\n\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"treeCollapse\", this.collapseRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"treeExpand\", this.expandRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"treeToggle\", this.toggleRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"getTreeParent\", this.getTreeParent.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"getTreeChildren\", this.getRowChildren.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"addTreeChild\", this.addTreeChildRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isTreeExpanded\", this.isRowExpanded.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.dataTree){\r\n\t\t\tvar dummyEl = null,\r\n\t\t\toptions = this.table.options;\r\n\r\n\t\t\tthis.field = options.dataTreeChildField;\r\n\t\t\tthis.indent = options.dataTreeChildIndent;\r\n\r\n\t\t\tif(options.dataTreeBranchElement){\r\n\r\n\t\t\t\tif(options.dataTreeBranchElement === true){\r\n\t\t\t\t\tthis.branchEl = document.createElement(\"div\");\r\n\t\t\t\t\tthis.branchEl.classList.add(\"tabulator-data-tree-branch\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(typeof options.dataTreeBranchElement === \"string\"){\r\n\t\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\t\tdummyEl.innerHTML = options.dataTreeBranchElement;\r\n\t\t\t\t\t\tthis.branchEl = dummyEl.firstChild;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.branchEl = options.dataTreeBranchElement;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(options.dataTreeCollapseElement){\r\n\t\t\t\tif(typeof options.dataTreeCollapseElement === \"string\"){\r\n\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\tdummyEl.innerHTML = options.dataTreeCollapseElement;\r\n\t\t\t\t\tthis.collapseEl = dummyEl.firstChild;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.collapseEl = options.dataTreeCollapseElement;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.collapseEl = document.createElement(\"div\");\r\n\t\t\t\tthis.collapseEl.classList.add(\"tabulator-data-tree-control\");\r\n\t\t\t\tthis.collapseEl.tabIndex = 0;\r\n\t\t\t\tthis.collapseEl.innerHTML = \"
\";\r\n\t\t\t}\r\n\r\n\t\t\tif(options.dataTreeExpandElement){\r\n\t\t\t\tif(typeof options.dataTreeExpandElement === \"string\"){\r\n\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\tdummyEl.innerHTML = options.dataTreeExpandElement;\r\n\t\t\t\t\tthis.expandEl = dummyEl.firstChild;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.expandEl = options.dataTreeExpandElement;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.expandEl = document.createElement(\"div\");\r\n\t\t\t\tthis.expandEl.classList.add(\"tabulator-data-tree-control\");\r\n\t\t\t\tthis.expandEl.tabIndex = 0;\r\n\t\t\t\tthis.expandEl.innerHTML = \"
\";\r\n\t\t\t}\r\n\r\n\r\n\t\t\tswitch(typeof options.dataTreeStartExpanded){\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\tthis.startOpen = function(row, index){\r\n\t\t\t\t\treturn options.dataTreeStartExpanded;\r\n\t\t\t\t};\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tthis.startOpen = options.dataTreeStartExpanded;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\tthis.startOpen = function(row, index){\r\n\t\t\t\t\treturn options.dataTreeStartExpanded[index];\r\n\t\t\t\t};\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-layout-after\", this.layoutRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowDelete.bind(this),0);\r\n\t\t\tthis.subscribe(\"row-data-changed\", this.rowDataChanged.bind(this), 10);\r\n\t\t\tthis.subscribe(\"cell-value-updated\", this.cellValueChanged.bind(this));\r\n\t\t\tthis.subscribe(\"edit-cancelled\", this.cellValueChanged.bind(this));\r\n\t\t\tthis.subscribe(\"column-moving-rows\", this.columnMoving.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.initializeElementField.bind(this));\r\n\t\t\tthis.subscribe(\"table-redrawing\", this.tableRedrawing.bind(this));\r\n\r\n\t\t\tthis.registerDisplayHandler(this.getRows.bind(this), 30);\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedrawing(force){\r\n\t\tvar rows;\r\n\r\n\t\tif(force){\r\n\t\t\trows = this.table.rowManager.getRows();\r\n\t\t\t\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.reinitializeRowChildren(row);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeElementField(){\r\n\t\tvar firstCol = this.table.columnManager.getFirstVisibleColumn();\r\n\r\n\t\tthis.elementField = this.table.options.dataTreeElementColumn || (firstCol ? firstCol.field : false);\r\n\t}\r\n\t\r\n\tgetRowChildren(row){\r\n\t\treturn this.getTreeChildren(row, true);\r\n\t}\r\n\r\n\tcolumnMoving(){\r\n\t\tvar rows = [];\r\n\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\trows = rows.concat(this.getTreeChildren(row, false, true));\r\n\t\t});\r\n\r\n\t\treturn rows;\r\n\t}\r\n\r\n\trowDataChanged(row, visible, updatedData){\r\n\t\tif(this.redrawNeeded(updatedData)){\r\n\t\t\tthis.initializeRow(row);\r\n\r\n\t\t\tif(visible){\r\n\t\t\t\tthis.layoutRow(row);\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tcellValueChanged(cell){\r\n\t\tvar field = cell.column.getField();\r\n\r\n\t\tif(field === this.elementField){\r\n\t\t\tthis.layoutRow(cell.row);\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar childArray = row.getData()[this.field];\r\n\t\tvar isArray = Array.isArray(childArray);\r\n\r\n\t\tvar children = isArray || (!isArray && typeof childArray === \"object\" && childArray !== null);\r\n\r\n\t\tif(!children && row.modules.dataTree && row.modules.dataTree.branchEl){\r\n\t\t\trow.modules.dataTree.branchEl.parentNode.removeChild(row.modules.dataTree.branchEl);\r\n\t\t}\r\n\r\n\t\tif(!children && row.modules.dataTree && row.modules.dataTree.controlEl){\r\n\t\t\trow.modules.dataTree.controlEl.parentNode.removeChild(row.modules.dataTree.controlEl);\r\n\t\t}\r\n\r\n\t\trow.modules.dataTree = {\r\n\t\t\tindex: row.modules.dataTree ? row.modules.dataTree.index : 0,\r\n\t\t\topen: children ? (row.modules.dataTree ? row.modules.dataTree.open : this.startOpen(row.getComponent(), 0)) : false,\r\n\t\t\tcontrolEl: row.modules.dataTree && children ? row.modules.dataTree.controlEl : false,\r\n\t\t\tbranchEl: row.modules.dataTree && children ? row.modules.dataTree.branchEl : false,\r\n\t\t\tparent: row.modules.dataTree ? row.modules.dataTree.parent : false,\r\n\t\t\tchildren:children,\r\n\t\t};\r\n\t}\r\n\r\n\treinitializeRowChildren(row){\r\n\t\tvar children = this.getTreeChildren(row, false, true);\r\n\r\n\t\tchildren.forEach(function(child){\r\n\t\t\tchild.reinitialize(true);\r\n\t\t});\r\n\t}\r\n\r\n\tlayoutRow(row){\r\n\t\tvar cell = this.elementField ? row.getCell(this.elementField) : row.getCells()[0],\r\n\t\tel = cell.getElement(),\r\n\t\tconfig = row.modules.dataTree;\r\n\r\n\t\tif(config.branchEl){\r\n\t\t\tif(config.branchEl.parentNode){\r\n\t\t\t\tconfig.branchEl.parentNode.removeChild(config.branchEl);\r\n\t\t\t}\r\n\t\t\tconfig.branchEl = false;\r\n\t\t}\r\n\r\n\t\tif(config.controlEl){\r\n\t\t\tif(config.controlEl.parentNode){\r\n\t\t\t\tconfig.controlEl.parentNode.removeChild(config.controlEl);\r\n\t\t\t}\r\n\t\t\tconfig.controlEl = false;\r\n\t\t}\r\n\r\n\t\tthis.generateControlElement(row, el);\r\n\r\n\t\trow.getElement().classList.add(\"tabulator-tree-level-\" + config.index);\r\n\r\n\t\tif(config.index){\r\n\t\t\tif(this.branchEl){\r\n\t\t\t\tconfig.branchEl = this.branchEl.cloneNode(true);\r\n\t\t\t\tel.insertBefore(config.branchEl, el.firstChild);\r\n\r\n\t\t\t\tif(this.table.rtl){\r\n\t\t\t\t\tconfig.branchEl.style.marginRight = (((config.branchEl.offsetWidth + config.branchEl.style.marginLeft) * (config.index - 1)) + (config.index * this.indent)) + \"px\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconfig.branchEl.style.marginLeft = (((config.branchEl.offsetWidth + config.branchEl.style.marginRight) * (config.index - 1)) + (config.index * this.indent)) + \"px\";\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\r\n\t\t\t\tif(this.table.rtl){\r\n\t\t\t\t\tel.style.paddingRight = parseInt(window.getComputedStyle(el, null).getPropertyValue('padding-right')) + (config.index * this.indent) + \"px\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.style.paddingLeft = parseInt(window.getComputedStyle(el, null).getPropertyValue('padding-left')) + (config.index * this.indent) + \"px\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateControlElement(row, el){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\tel = el || row.getCells()[0].getElement(),\r\n\t\toldControl = config.controlEl;\r\n\r\n\t\tif(config.children !== false){\r\n\r\n\t\t\tif(config.open){\r\n\t\t\t\tconfig.controlEl = this.collapseEl.cloneNode(true);\r\n\t\t\t\tconfig.controlEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\tthis.collapseRow(row);\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconfig.controlEl = this.expandEl.cloneNode(true);\r\n\t\t\t\tconfig.controlEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\tthis.expandRow(row);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tconfig.controlEl.addEventListener(\"mousedown\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t});\r\n\r\n\t\t\tif(oldControl && oldControl.parentNode === el){\r\n\t\t\t\toldControl.parentNode.replaceChild(config.controlEl,oldControl);\r\n\t\t\t}else{\r\n\t\t\t\tel.insertBefore(config.controlEl, el.firstChild);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tsetDisplayIndex (index) {\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\r\n\tgetDisplayIndex () {\r\n\t\treturn this.displayIndex;\r\n\t}\r\n\r\n\tgetRows(rows){\r\n\t\tvar output = [];\r\n\r\n\t\trows.forEach((row, i) => {\r\n\t\t\tvar config, children;\r\n\r\n\t\t\toutput.push(row);\r\n\r\n\t\t\tif(row instanceof Row){\r\n\r\n\t\t\t\trow.create();\r\n\r\n\t\t\t\tconfig = row.modules.dataTree.children;\r\n\r\n\t\t\t\tif(!config.index && config.children !== false){\r\n\t\t\t\t\tchildren = this.getChildren(row);\r\n\r\n\t\t\t\t\tchildren.forEach((child) => {\r\n\t\t\t\t\t\tchild.create();\r\n\t\t\t\t\t\toutput.push(child);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetChildren(row, allChildren){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\tchildren = [],\r\n\t\toutput = [];\r\n\r\n\t\tif(config.children !== false && (config.open || allChildren)){\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"filter\") && this.table.options.dataTreeFilter){\r\n\t\t\t\tchildren = this.table.modules.filter.filter(config.children);\r\n\t\t\t}else{\r\n\t\t\t\tchildren = config.children;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"sort\") && this.table.options.dataTreeSort){\r\n\t\t\t\tthis.table.modules.sort.sort(children);\r\n\t\t\t}\r\n\r\n\t\t\tchildren.forEach((child) => {\r\n\t\t\t\toutput.push(child);\r\n\r\n\t\t\t\tvar subChildren = this.getChildren(child);\r\n\r\n\t\t\t\tsubChildren.forEach((sub) => {\r\n\t\t\t\t\toutput.push(sub);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgenerateChildren(row){\r\n\t\tvar children = [];\r\n\r\n\t\tvar childArray = row.getData()[this.field];\r\n\r\n\t\tif(!Array.isArray(childArray)){\r\n\t\t\tchildArray = [childArray];\r\n\t\t}\r\n\r\n\t\tchildArray.forEach((childData) => {\r\n\t\t\tvar childRow = new Row(childData || {}, this.table.rowManager);\r\n\r\n\t\t\tchildRow.create();\r\n\r\n\t\t\tchildRow.modules.dataTree.index = row.modules.dataTree.index + 1;\r\n\t\t\tchildRow.modules.dataTree.parent = row;\r\n\r\n\t\t\tif(childRow.modules.dataTree.children){\r\n\t\t\t\tchildRow.modules.dataTree.open = this.startOpen(childRow.getComponent(), childRow.modules.dataTree.index);\r\n\t\t\t}\r\n\t\t\tchildren.push(childRow);\r\n\t\t});\r\n\r\n\t\treturn children;\r\n\t}\r\n\r\n\texpandRow(row, silent){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tconfig.open = true;\r\n\r\n\t\t\trow.reinitialize();\r\n\r\n\t\t\tthis.refreshData(true);\r\n\r\n\t\t\tthis.dispatchExternal(\"dataTreeRowExpanded\", row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\t}\r\n\r\n\tcollapseRow(row){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tconfig.open = false;\r\n\r\n\t\t\trow.reinitialize();\r\n\r\n\t\t\tthis.refreshData(true);\r\n\r\n\t\t\tthis.dispatchExternal(\"dataTreeRowCollapsed\", row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\t}\r\n\r\n\ttoggleRow(row){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tif(config.open){\r\n\t\t\t\tthis.collapseRow(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.expandRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tisRowExpanded(row){\r\n\t\treturn row.modules.dataTree.open;\r\n\t}\r\n\r\n\tgetTreeParent(row){\r\n\t\treturn row.modules.dataTree.parent ? row.modules.dataTree.parent.getComponent() : false;\r\n\t}\r\n\r\n\tgetTreeParentRoot(row){\r\n\t\treturn row.modules.dataTree.parent ? this.getTreeParentRoot(row.modules.dataTree.parent) : row;\r\n\t}\r\n\r\n\tgetFilteredTreeChildren(row){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\toutput = [], children;\r\n\r\n\t\tif(config.children){\r\n\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"filter\") && this.table.options.dataTreeFilter){\r\n\t\t\t\tchildren = this.table.modules.filter.filter(config.children);\r\n\t\t\t}else{\r\n\t\t\t\tchildren = config.children;\r\n\t\t\t}\r\n\r\n\t\t\tchildren.forEach((childRow) => {\r\n\t\t\t\tif(childRow instanceof Row){\r\n\t\t\t\t\toutput.push(childRow);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\trowDelete(row){\r\n\t\tvar parent = row.modules.dataTree.parent,\r\n\t\tchildIndex;\r\n\r\n\t\tif(parent){\r\n\t\t\tchildIndex = this.findChildIndex(row, parent);\r\n\r\n\t\t\tif(childIndex !== false){\r\n\t\t\t\tparent.data[this.field].splice(childIndex, 1);\r\n\t\t\t}\r\n\r\n\t\t\tif(!parent.data[this.field].length){\r\n\t\t\t\tdelete parent.data[this.field];\r\n\t\t\t}\r\n\r\n\t\t\tthis.initializeRow(parent);\r\n\t\t\tthis.layoutRow(parent);\r\n\t\t}\r\n\r\n\t\tthis.refreshData(true);\r\n\t}\r\n\r\n\taddTreeChildRow(row, data, top, index){\r\n\t\tvar childIndex = false;\r\n\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\r\n\t\tif(!Array.isArray(row.data[this.field])){\r\n\t\t\trow.data[this.field] = [];\r\n\r\n\t\t\trow.modules.dataTree.open = this.startOpen(row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\r\n\t\tif(typeof index !== \"undefined\"){\r\n\t\t\tchildIndex = this.findChildIndex(index, row);\r\n\r\n\t\t\tif(childIndex !== false){\r\n\t\t\t\trow.data[this.field].splice((top ? childIndex : childIndex + 1), 0, data);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(childIndex === false){\r\n\t\t\tif(top){\r\n\t\t\t\trow.data[this.field].unshift(data);\r\n\t\t\t}else{\r\n\t\t\t\trow.data[this.field].push(data);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.initializeRow(row);\r\n\t\tthis.layoutRow(row);\r\n\r\n\t\tthis.refreshData(true);\r\n\t}\r\n\r\n\tfindChildIndex(subject, parent){\r\n\t\tvar match = false;\r\n\r\n\t\tif(typeof subject == \"object\"){\r\n\r\n\t\t\tif(subject instanceof Row){\r\n\t\t\t\t//subject is row element\r\n\t\t\t\tmatch = subject.data;\r\n\t\t\t}else if(subject instanceof RowComponent){\r\n\t\t\t\t//subject is public row component\r\n\t\t\t\tmatch = subject._getSelf().data;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\t\t\t\tif(parent.modules.dataTree){\r\n\t\t\t\t\tmatch = parent.modules.dataTree.children.find((childRow) => {\r\n\t\t\t\t\t\treturn childRow instanceof Row ? childRow.element === subject : false;\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(match){\r\n\t\t\t\t\t\tmatch = match.data;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}else if(typeof subject == \"undefined\" || subject === null){\r\n\t\t\tmatch = false\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the index of the row\r\n\t\t\tmatch = parent.data[this.field].find((row) => {\r\n\t\t\t\treturn row.data[this.table.options.index] == subject;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(match){\r\n\r\n\t\t\tif(Array.isArray(parent.data[this.field])){\r\n\t\t\t\tmatch = parent.data[this.field].indexOf(match);\r\n\t\t\t}\r\n\r\n\t\t\tif(match == -1){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//catch all for any other type of input\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tgetTreeChildren(row, component, recurse){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\toutput = [];\r\n\r\n\t\tif(config.children){\r\n\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tconfig.children.forEach((childRow) => {\r\n\t\t\t\tif(childRow instanceof Row){\r\n\t\t\t\t\toutput.push(component ? childRow.getComponent() : childRow);\r\n\r\n\t\t\t\t\tif(recurse){\r\n\t\t\t\t\t\toutput = output.concat(this.getTreeChildren(childRow, component, recurse));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetChildField(){\r\n\t\treturn this.field;\r\n\t}\r\n\r\n\tredrawNeeded(data){\r\n\t\treturn (this.field ? typeof data[this.field] !== \"undefined\" : false) || (this.elementField ? typeof data[this.elementField] !== \"undefined\" : false);\r\n\t}\r\n}\r\n\r\nDataTree.moduleName = \"dataTree\";\r\n\r\nexport default DataTree;","import csv from './downloaders/csv.js';\r\nimport json from './downloaders/json.js';\r\nimport pdf from './downloaders/pdf.js';\r\nimport xlsx from './downloaders/xlsx.js';\r\nimport html from './downloaders/html.js';\r\nimport jsonLines from './downloaders/jsonLines.js';\r\n\r\nexport default {\r\n\tcsv:csv,\r\n\tjson:json,\r\n\tjsonLines:jsonLines,\r\n\tpdf:pdf,\r\n\txlsx:xlsx,\r\n\thtml:html,\r\n};","export default function(list, options, setFileContents){\r\n\tvar delimiter = options && options.delimiter ? options.delimiter : \",\",\r\n\tfileContents = [],\r\n\theaders = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tvar item = [];\r\n\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"group\":\r\n\t\t\tconsole.warn(\"Download Warning - CSV downloader cannot process row groups\");\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\tconsole.warn(\"Download Warning - CSV downloader cannot process column calculations\");\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"header\":\r\n\t\t\trow.columns.forEach((col, i) => {\r\n\t\t\t\tif(col && col.depth === 1){\r\n\t\t\t\t\theaders[i] = typeof col.value == \"undefined\" || col.value === null ? \"\" : ('\"' + String(col.value).split('\"').join('\"\"') + '\"');\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\trow.columns.forEach((col) => {\r\n\r\n\t\t\t\tif(col){\r\n\r\n\t\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\tcol.value = col.value !== null ? JSON.stringify(col.value) : \"\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\tcol.value = \"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\titem.push('\"' + String(col.value).split('\"').join('\"\"') + '\"');\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tfileContents.push(item.join(delimiter));\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(headers.length){\r\n\t\tfileContents.unshift(headers.join(delimiter));\r\n\t}\r\n\r\n\tfileContents = fileContents.join(\"\\n\");\r\n\r\n\tif(options.bom){\r\n\t\tfileContents = \"\\ufeff\" + fileContents;\r\n\t}\r\n\r\n\tsetFileContents(fileContents, \"text/csv\");\r\n};\r\n","export default function(list, options, setFileContents){\r\n\tvar fileContents = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tvar item = {};\r\n\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"header\":\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process row groups\");\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process column calculations\");\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\tif(col){\r\n\t\t\t\t\titem[col.component.getTitleDownload() || col.component.getField()] = col.value;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tfileContents.push(item);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tfileContents = JSON.stringify(fileContents, null, '\\t');\r\n\r\n\tsetFileContents(fileContents, \"application/json\");\r\n};","export default function (list, options, setFileContents) {\r\n\tconst fileContents = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tconst item = {};\r\n\r\n\t\tswitch (row.type) {\r\n\t\t\tcase \"header\":\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process row groups\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process column calculations\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\t\tif (col) {\r\n\t\t\t\t\t\titem[col.component.getTitleDownload() || col.component.getField()] = col.value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tfileContents.push(JSON.stringify(item));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tsetFileContents(fileContents.join(\"\\n\"), \"application/x-ndjson\");\r\n};","export default function(list, options, setFileContents){\r\n\tvar header = [],\r\n\tbody = [],\r\n\tautoTableParams = {},\r\n\trowGroupStyles = options.rowGroupStyles || {\r\n\t\tfontStyle: \"bold\",\r\n\t\tfontSize: 12,\r\n\t\tcellPadding: 6,\r\n\t\tfillColor: 220,\r\n\t},\r\n\trowCalcStyles = options.rowCalcStyles || {\r\n\t\tfontStyle: \"bold\",\r\n\t\tfontSize: 10,\r\n\t\tcellPadding: 4,\r\n\t\tfillColor: 232,\r\n\t},\r\n\tjsPDFParams = options.jsPDF || {},\r\n\ttitle = options && options.title ? options.title : \"\";\r\n\r\n\tif(!jsPDFParams.orientation){\r\n\t\tjsPDFParams.orientation = options.orientation || \"landscape\";\r\n\t}\r\n\r\n\tif(!jsPDFParams.unit){\r\n\t\tjsPDFParams.unit = \"pt\";\r\n\t}\r\n\r\n\t//parse row list\r\n\tlist.forEach((row) => {\r\n\t\tvar item = {};\r\n\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"header\":\r\n\t\t\theader.push(parseRow(row));\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\tbody.push(parseRow(row, rowGroupStyles));\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\tbody.push(parseRow(row, rowCalcStyles));\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\tbody.push(parseRow(row));\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tfunction parseRow(row, styles){\r\n\t\tvar rowData = [];\r\n\r\n\t\trow.columns.forEach((col) =>{\r\n\t\t\tvar cell;\r\n\r\n\t\t\tif(col){\r\n\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\tcol.value = col.value !== null ? JSON.stringify(col.value) : \"\";\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\tcol.value = \"\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcell = {\r\n\t\t\t\t\tcontent:col.value,\r\n\t\t\t\t\tcolSpan:col.width,\r\n\t\t\t\t\trowSpan:col.height,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tif(styles){\r\n\t\t\t\t\tcell.styles = styles;\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowData.push(cell);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowData;\r\n\t}\r\n\r\n\r\n\t//configure PDF\r\n\tvar doc = new jspdf.jsPDF(jsPDFParams); //set document to landscape, better for most tables\r\n\r\n\tif(options && options.autoTable){\r\n\t\tif(typeof options.autoTable === \"function\"){\r\n\t\t\tautoTableParams = options.autoTable(doc) || {};\r\n\t\t}else{\r\n\t\t\tautoTableParams = options.autoTable;\r\n\t\t}\r\n\t}\r\n\r\n\tif(title){\r\n\t\tautoTableParams.didDrawPage = function(data) {\r\n\t\t\tdoc.text(title, 40, 30);\r\n\t\t};\r\n\t}\r\n\r\n\tautoTableParams.head = header;\r\n\tautoTableParams.body = body;\r\n\r\n\tdoc.autoTable(autoTableParams);\r\n\r\n\tif(options && options.documentProcessing){\r\n\t\toptions.documentProcessing(doc);\r\n\t}\r\n\r\n\tsetFileContents(doc.output(\"arraybuffer\"), \"application/pdf\");\r\n};\r\n","import CoreFeature from '../../../../core/CoreFeature.js';\r\n\r\nexport default function(list, options, setFileContents){\r\n\tvar self = this,\r\n\tsheetName = options.sheetName || \"Sheet1\",\r\n\tworkbook = XLSX.utils.book_new(),\r\n\ttableFeatures = new CoreFeature(this),\r\n\toutput;\r\n\r\n\tworkbook.SheetNames = [];\r\n\tworkbook.Sheets = {};\r\n\r\n\tfunction generateSheet(){\r\n\t\tvar rows = [],\r\n\t\tmerges = [],\r\n\t\tworksheet = {},\r\n\t\trange = {s: {c:0, r:0}, e: {c:(list[0] ? list[0].columns.reduce((a, b) => a + (b && b.width ? b.width : 1), 0) : 0), r:list.length }};\r\n\r\n\t\t//parse row list\r\n\t\tlist.forEach((row, i) => {\r\n\t\t\tvar rowData = [];\r\n\r\n\t\t\trow.columns.forEach(function(col, j){\r\n\r\n\t\t\t\tif(col){\r\n\t\t\t\t\trowData.push(!(col.value instanceof Date) && typeof col.value === \"object\" ? JSON.stringify(col.value) : col.value);\r\n\r\n\t\t\t\t\tif(col.width > 1 || col.height > -1){\r\n\t\t\t\t\t\tif(col.height > 1 || col.width > 1){\r\n\t\t\t\t\t\t\tmerges.push({s:{r:i,c:j},e:{r:i + col.height - 1,c:j + col.width - 1}});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\trowData.push(\"\");\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trows.push(rowData);\r\n\t\t});\r\n\r\n\t\t//convert rows to worksheet\r\n\t\tXLSX.utils.sheet_add_aoa(worksheet, rows);\r\n\r\n\t\tworksheet['!ref'] = XLSX.utils.encode_range(range);\r\n\r\n\t\tif(merges.length){\r\n\t\t\tworksheet[\"!merges\"] = merges;\r\n\t\t}\r\n\r\n\t\treturn worksheet;\r\n\t}\r\n\r\n\tif(options.sheetOnly){\r\n\t\tsetFileContents(generateSheet());\r\n\t\treturn;\r\n\t}\r\n\r\n\tif(options.sheets){\r\n\t\tfor(var sheet in options.sheets){\r\n\r\n\t\t\tif(options.sheets[sheet] === true){\r\n\t\t\t\tworkbook.SheetNames.push(sheet);\r\n\t\t\t\tworkbook.Sheets[sheet] = generateSheet();\r\n\t\t\t}else{\r\n\r\n\t\t\t\tworkbook.SheetNames.push(sheet);\r\n\r\n\t\t\t\ttableFeatures.commsSend(options.sheets[sheet], \"download\", \"intercept\",{\r\n\t\t\t\t\ttype:\"xlsx\",\r\n\t\t\t\t\toptions:{sheetOnly:true},\r\n\t\t\t\t\tactive:self.active,\r\n\t\t\t\t\tintercept:function(data){\r\n\t\t\t\t\t\tworkbook.Sheets[sheet] = data;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tworkbook.SheetNames.push(sheetName);\r\n\t\tworkbook.Sheets[sheetName] = generateSheet();\r\n\t}\r\n\r\n\tif(options.documentProcessing){\r\n\t\tworkbook = options.documentProcessing(workbook);\r\n\t}\r\n\r\n\t//convert workbook to binary array\r\n\tfunction s2ab(s) {\r\n\t\tvar buf = new ArrayBuffer(s.length);\r\n\t\tvar view = new Uint8Array(buf);\r\n\t\tfor (var i=0; i!=s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;\r\n\t\t\treturn buf;\r\n\t}\r\n\r\n\toutput = XLSX.write(workbook, {bookType:'xlsx', bookSST:true, type: 'binary'});\r\n\r\n\tsetFileContents(s2ab(output), \"application/octet-stream\");\r\n};","export default function(list, options, setFileContents){\r\n\tif(this.modExists(\"export\", true)){\r\n\t\tsetFileContents(this.modules.export.genereateHTMLTable(list), \"text/html\");\r\n\t}\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultDownloaders from './defaults/downloaders.js';\r\n\r\nclass Download extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.registerTableOption(\"downloadReady\", function(data, blob){return blob;}); //function to manipulate download data\r\n\t\tthis.registerTableOption(\"downloadConfig\", {}); //download config\r\n\t\tthis.registerTableOption(\"downloadRowRange\", \"active\"); //restrict download to active rows only\r\n\r\n\t\tthis.registerColumnOption(\"download\");\r\n\t\tthis.registerColumnOption(\"titleDownload\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"download\", this.download.bind(this));\r\n\t\tthis.registerTableFunction(\"downloadToTab\", this.downloadToTab.bind(this));\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tdownloadToTab(type, filename, options, active){\r\n\t\tthis.download(type, filename, options, active, true);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\t//trigger file download\r\n\tdownload(type, filename, options, range, interceptCallback){\r\n\t\tvar downloadFunc = false;\r\n\r\n\t\tfunction buildLink(data, mime){\r\n\t\t\tif(interceptCallback){\r\n\t\t\t\tif(interceptCallback === true){\r\n\t\t\t\t\tthis.triggerDownload(data, mime, type, filename, true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tinterceptCallback(data);\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tthis.triggerDownload(data, mime, type, filename);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(typeof type == \"function\"){\r\n\t\t\tdownloadFunc = type;\r\n\t\t}else{\r\n\t\t\tif(Download.downloaders[type]){\r\n\t\t\t\tdownloadFunc = Download.downloaders[type];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Download Error - No such download type found: \", type);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(downloadFunc){\r\n\t\t\tvar list = this.generateExportList(range);\r\n\r\n\t\t\tdownloadFunc.call(this.table, list , options || {}, buildLink.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateExportList(range){\r\n\t\tvar list = this.table.modules.export.generateExportList(this.table.options.downloadConfig, false, range || this.table.options.downloadRowRange, \"download\");\r\n\r\n\t\t//assign group header formatter\r\n\t\tvar groupHeader = this.table.options.groupHeaderDownload;\r\n\r\n\t\tif(groupHeader && !Array.isArray(groupHeader)){\r\n\t\t\tgroupHeader = [groupHeader];\r\n\t\t}\r\n\r\n\t\tlist.forEach((row) => {\r\n\t\t\tvar group;\r\n\r\n\t\t\tif(row.type === \"group\"){\r\n\t\t\t\tgroup = row.columns[0];\r\n\r\n\t\t\t\tif(groupHeader && groupHeader[row.indent]){\r\n\t\t\t\t\tgroup.value = groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn list;\r\n\t}\r\n\r\n\ttriggerDownload(data, mime, type, filename, newTab){\r\n\t\tvar element = document.createElement('a'),\r\n\t\tblob = new Blob([data],{type:mime}),\r\n\t\tfilename = filename || \"Tabulator.\" + (typeof type === \"function\" ? \"txt\" : type);\r\n\r\n\t\tblob = this.table.options.downloadReady(data, blob);\r\n\r\n\t\tif(blob){\r\n\r\n\t\t\tif(newTab){\r\n\t\t\t\twindow.open(window.URL.createObjectURL(blob));\r\n\t\t\t}else{\r\n\t\t\t\tif(navigator.msSaveOrOpenBlob){\r\n\t\t\t\t\tnavigator.msSaveOrOpenBlob(blob, filename);\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.setAttribute('href', window.URL.createObjectURL(blob));\r\n\r\n\t\t\t\t\t//set file title\r\n\t\t\t\t\telement.setAttribute('download', filename);\r\n\r\n\t\t\t\t\t//trigger download\r\n\t\t\t\t\telement.style.display = 'none';\r\n\t\t\t\t\tdocument.body.appendChild(element);\r\n\t\t\t\t\telement.click();\r\n\r\n\t\t\t\t\t//remove temporary link element\r\n\t\t\t\t\tdocument.body.removeChild(element);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"downloadComplete\");\r\n\t\t}\r\n\t}\r\n\r\n\tcommsReceived(table, action, data){\r\n\t\tswitch(action){\r\n\t\t\tcase \"intercept\":\r\n\t\t\tthis.download(data.type, \"\", data.options, data.active, data.intercept);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nDownload.moduleName = \"download\";\r\n\r\n//load defaults\r\nDownload.downloaders = defaultDownloaders;\r\n\r\nexport default Download;","export default function maskInput(el, options){\r\n\tvar mask = options.mask,\r\n\tmaskLetter = typeof options.maskLetterChar !== \"undefined\" ? options.maskLetterChar : \"A\",\r\n\tmaskNumber = typeof options.maskNumberChar !== \"undefined\" ? options.maskNumberChar : \"9\",\r\n\tmaskWildcard = typeof options.maskWildcardChar !== \"undefined\" ? options.maskWildcardChar : \"*\",\r\n\tsuccess = false;\r\n\r\n\tfunction fillSymbols(index){\r\n\t\tvar symbol = mask[index];\r\n\t\tif(typeof symbol !== \"undefined\" && symbol !== maskWildcard && symbol !== maskLetter && symbol !== maskNumber){\r\n\t\t\tel.value = el.value + \"\" + symbol;\r\n\t\t\tfillSymbols(index+1);\r\n\t\t}\r\n\t}\r\n\r\n\tel.addEventListener(\"keydown\", (e) => {\r\n\t\tvar index = el.value.length,\r\n\t\tchar = e.key;\r\n\r\n\t\tif(e.keyCode > 46){\r\n\t\t\tif(index >= mask.length){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tsuccess = false;\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\tswitch(mask[index]){\r\n\t\t\t\t\tcase maskLetter:\r\n\t\t\t\t\tif(char.toUpperCase() == char.toLowerCase()){\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\tsuccess = false;\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase maskNumber:\r\n\t\t\t\t\tif(isNaN(char)){\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\tsuccess = false;\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase maskWildcard:\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\tif(char !== mask[index]){\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\tsuccess = false;\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tsuccess = true;\r\n\t\t}\r\n\r\n\t\treturn;\r\n\t});\r\n\r\n\tel.addEventListener(\"keyup\", (e) => {\r\n\t\tif(e.keyCode > 46){\r\n\t\t\tif(options.maskAutoFill){\r\n\t\t\t\tfillSymbols(el.value.length);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\r\n\tif(!el.placeholder){\r\n\t\tel.placeholder = mask;\r\n\t}\r\n\r\n\tif(options.maskAutoFill){\r\n\t\tfillSymbols(el.value.length);\r\n\t}\r\n}","import maskInput from './inputMask.js';\r\nimport urlBuilder from '../Ajax/defaults/urlGenerator.js';\r\n\r\nexport default class Edit{\r\n constructor(editor, cell, onRendered, success, cancel, editorParams){\r\n this.edit = editor;\r\n this.table = editor.table;\r\n this.cell = cell;\r\n this.params = this._initializeParams(editorParams);\r\n \r\n this.data = [];\r\n this.displayItems = [];\r\n this.currentItems = [];\r\n this.focusedItem = null;\r\n \r\n this.input = this._createInputElement();\r\n this.listEl = this._createListElement();\r\n \r\n this.initialValues = null; \r\n \r\n this.isFilter = !cell._getSelf;\r\n \r\n this.filterTimeout = null;\r\n this.filtered = false;\r\n this.typing = false;\r\n \r\n this.values = []; \r\n this.popup = null; \r\n \r\n this.listIteration = 0;\r\n \r\n this.blurable = true;\r\n \r\n this.actions = {\r\n success:success,\r\n cancel:cancel\r\n }\r\n \r\n this._deprecationCheck();\r\n this._initializeValue();\r\n \r\n onRendered(this._onRendered.bind(this));\r\n }\r\n \r\n _deprecationCheck(){\r\n if(this.params.listItemFormatter){\r\n console.warn(\"The listItemFormatter editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n }\r\n \r\n if(this.params.sortValuesList){\r\n console.warn(\"The sortValuesList editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n }\r\n \r\n if(this.params.searchFunc){\r\n console.warn(\"The searchFunc editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n }\r\n \r\n if(this.params.searchingPlaceholder){\r\n console.warn(\"The searchingPlaceholder editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n }\r\n }\r\n \r\n _initializeValue(){\r\n var initialValue = this.cell.getValue();\r\n \r\n if(typeof initialValue === \"undefined\" && typeof this.params.defaultValue !== \"undefined\"){\r\n initialValue = this.params.defaultValue;\r\n }\r\n \r\n this.initialValues = this.params.multiselect ? initialValue : [initialValue];\r\n \r\n if(this.isFilter){\r\n this.input.value = this.initialValues ? this.initialValues.join(\",\") : \"\";\r\n this.headerFilterInitialListGen(); \r\n }\r\n }\r\n \r\n _onRendered(){\r\n var cellEl = this.cell.getElement();\r\n \r\n function clickStop(e){\r\n e.stopPropagation();\r\n }\r\n \r\n this.input.style.height = \"100%\";\r\n this.input.focus({preventScroll: true});\r\n \r\n \r\n cellEl.addEventListener(\"click\", clickStop);\r\n \r\n setTimeout(() => {\r\n cellEl.removeEventListener(\"click\", clickStop);\r\n }, 1000)\r\n }\r\n \r\n _createListElement(){\r\n var listEl = document.createElement(\"div\");\r\n listEl.classList.add(\"tabulator-edit-list\");\r\n \r\n listEl.addEventListener(\"mousedown\", this._preventBlur.bind(this));\r\n listEl.addEventListener(\"keydown\", this._inputKeyDown.bind(this))\r\n \r\n return listEl;\r\n }\r\n \r\n _setListWidth(){\r\n var element = this.isFilter ? this.input : this.cell.getElement();\r\n \r\n this.listEl.style.minWidth = element.offsetWidth + \"px\";\r\n \r\n if(this.params.maxWidth){\r\n if(this.params.maxWidth === true){\r\n this.listEl.style.maxWidth = element.offsetWidth + \"px\";\r\n }else if(typeof this.params.maxWidth === \"number\"){\r\n this.listEl.style.maxWidth = this.params.maxWidth + \"px\";\r\n }else{\r\n this.listEl.style.maxWidth = this.params.maxWidth;\r\n }\r\n }\r\n \r\n }\r\n \r\n _createInputElement(){\r\n var attribs = this.params.elementAttributes;\r\n var input = document.createElement(\"input\");\r\n \r\n input.setAttribute(\"type\", this.params.clearable ? \"search\" : \"text\");\r\n \r\n input.style.padding = \"4px\";\r\n input.style.width = \"100%\";\r\n input.style.boxSizing = \"border-box\";\r\n \r\n if(!this.params.autocomplete){\r\n input.style.cursor = \"default\";\r\n input.style.caretColor = \"transparent\";\r\n // input.readOnly = (this.edit.currentCell != false);\r\n }\r\n \r\n if(attribs && typeof attribs == \"object\"){\r\n for (let key in attribs){\r\n if(key.charAt(0) == \"+\"){\r\n key = key.slice(1);\r\n input.setAttribute(key, input.getAttribute(key) + attribs[\"+\" + key]);\r\n }else{\r\n input.setAttribute(key, attribs[key]);\r\n }\r\n }\r\n }\r\n \r\n if(this.params.mask){\r\n maskInput(input, this.params);\r\n }\r\n \r\n this._bindInputEvents(input);\r\n \r\n return input;\r\n }\r\n \r\n _initializeParams(params){\r\n var valueKeys = [\"values\", \"valuesURL\", \"valuesLookup\"],\r\n valueCheck;\r\n\r\n params = Object.assign({}, params);\r\n \r\n params.verticalNavigation = params.verticalNavigation || \"editor\";\r\n params.placeholderLoading = typeof params.placeholderLoading === \"undefined\" ? \"Searching ...\" : params.placeholderLoading;\r\n params.placeholderEmpty = typeof params.placeholderEmpty === \"undefined\" ? \"No Results Found\" : params.placeholderEmpty;\r\n params.filterDelay = typeof params.filterDelay === \"undefined\" ? 300 : params.filterDelay;\r\n \r\n params.emptyValue = Object.keys(params).includes(\"emptyValue\") ? params.emptyValue : \"\";\r\n\r\n valueCheck = Object.keys(params).filter(key => valueKeys.includes(key)).length;\r\n\r\n if(!valueCheck){\r\n console.warn(\"list editor config error - either the values, valuesURL, or valuesLookup option must be set\")\r\n }else if(valueCheck > 1){\r\n console.warn(\"list editor config error - only one of the values, valuesURL, or valuesLookup options can be set on the same editor\")\r\n }\r\n \r\n if(params.autocomplete){\r\n if(params.multiselect){\r\n params.multiselect = false;\r\n console.warn(\"list editor config error - multiselect option is not available when autocomplete is enabled\")\r\n }\r\n }else{\r\n if(params.freetext){\r\n params.freetext = false;\r\n console.warn(\"list editor config error - freetext option is only available when autocomplete is enabled\");\r\n }\r\n \r\n if(params.filterFunc){\r\n params.filterFunc = false;\r\n console.warn(\"list editor config error - filterFunc option is only available when autocomplete is enabled\");\r\n }\r\n \r\n if(params.filterRemote){\r\n params.filterRemote = false;\r\n console.warn(\"list editor config error - filterRemote option is only available when autocomplete is enabled\");\r\n }\r\n \r\n if(params.mask){\r\n params.mask = false;\r\n console.warn(\"list editor config error - mask option is only available when autocomplete is enabled\");\r\n }\r\n \r\n if(params.allowEmpty){\r\n params.allowEmpty = false;\r\n console.warn(\"list editor config error - allowEmpty option is only available when autocomplete is enabled\");\r\n }\r\n \r\n if(params.listOnEmpty){\r\n params.listOnEmpty = false;\r\n console.warn(\"list editor config error - listOnEmpty option is only available when autocomplete is enabled\");\r\n }\r\n }\r\n \r\n if(params.filterRemote && !(typeof params.valuesLookup === \"function\" || typeof params.valuesURL)){\r\n params.filterRemote = false;\r\n console.warn(\"list editor config error - filterRemote option should only be used when values list is populated from a remote source\");\r\n }\r\n return params;\r\n }\r\n //////////////////////////////////////\r\n ////////// Event Handling ////////////\r\n //////////////////////////////////////\r\n \r\n _bindInputEvents(input){\r\n input.addEventListener(\"focus\", this._inputFocus.bind(this))\r\n input.addEventListener(\"click\", this._inputClick.bind(this))\r\n input.addEventListener(\"blur\", this._inputBlur.bind(this))\r\n input.addEventListener(\"keydown\", this._inputKeyDown.bind(this))\r\n input.addEventListener(\"search\", this._inputSearch.bind(this))\r\n \r\n if(this.params.autocomplete){\r\n input.addEventListener(\"keyup\", this._inputKeyUp.bind(this))\r\n }\r\n }\r\n \r\n \r\n _inputFocus(e){\r\n this.rebuildOptionsList();\r\n }\r\n \r\n _filter(){\r\n if(this.params.filterRemote){\r\n clearTimeout(this.filterTimeout);\r\n \r\n this.filterTimeout = setTimeout(() => {\r\n this.rebuildOptionsList();\r\n }, this.params.filterDelay);\r\n }else{\r\n this._filterList();\r\n }\r\n }\r\n \r\n _inputClick(e){\r\n e.stopPropagation();\r\n }\r\n \r\n _inputBlur(e){\r\n if(this.blurable && this.popup){\r\n this.popup.hide();\r\n }\r\n }\r\n \r\n _inputSearch(){\r\n this._clearChoices();\r\n }\r\n \r\n _inputKeyDown(e){\r\n switch(e.keyCode){\r\n \r\n case 38: //up arrow\r\n this._keyUp(e);\r\n break\r\n \r\n case 40: //down arrow\r\n this._keyDown(e);\r\n break;\r\n \r\n case 37: //left arrow\r\n case 39: //right arrow\r\n this._keySide(e);\r\n break;\r\n \r\n case 13: //enter\r\n this._keyEnter();\r\n break;\r\n \r\n case 27: //escape\r\n this._keyEsc();\r\n break;\r\n \r\n case 36: //home\r\n case 35: //end\r\n this._keyHomeEnd(e);\r\n break;\r\n \r\n case 9: //tab\r\n break;\r\n \r\n default:\r\n this._keySelectLetter(e);\r\n }\r\n }\r\n \r\n _inputKeyUp(e){\r\n switch(e.keyCode){\r\n case 38: //up arrow\r\n case 37: //left arrow\r\n case 39: //up arrow\r\n case 40: //right arrow\r\n case 13: //enter\r\n case 27: //escape\r\n break;\r\n \r\n default:\r\n this._keyAutoCompLetter(e);\r\n }\r\n }\r\n \r\n _preventBlur(){\r\n this.blurable = false;\r\n \r\n setTimeout(function(){\r\n this.blurable = true;\r\n }, 10);\r\n }\r\n \r\n //////////////////////////////////////\r\n //////// Keyboard Navigation /////////\r\n //////////////////////////////////////\r\n \r\n _keyUp(e){\r\n var index = this.displayItems.indexOf(this.focusedItem);\r\n \r\n if(this.params.verticalNavigation == \"editor\" || (this.params.verticalNavigation == \"hybrid\" && index)){\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n e.preventDefault();\r\n \r\n if(index > 0){\r\n this._focusItem(this.displayItems[index - 1]);\r\n }\r\n }\r\n }\r\n \r\n _keyDown(e){\r\n var index = this.displayItems.indexOf(this.focusedItem);\r\n \r\n if(this.params.verticalNavigation == \"editor\" || (this.params.verticalNavigation == \"hybrid\" && index < this.displayItems.length - 1)){\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n e.preventDefault();\r\n \r\n if(index < this.displayItems.length - 1){\r\n if(index == -1){\r\n this._focusItem(this.displayItems[0]);\r\n }else{\r\n this._focusItem(this.displayItems[index + 1]);\r\n }\r\n }\r\n }\r\n }\r\n \r\n _keySide(e){\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n e.preventDefault();\r\n }\r\n \r\n _keyEnter(e){\r\n if(this.focusedItem){\r\n this._chooseItem(this.focusedItem);\r\n }else{\r\n this._cancel();\r\n }\r\n }\r\n \r\n _keyEsc(e){\r\n this._cancel();\r\n }\r\n \r\n _keyHomeEnd(e){\r\n if(this.params.autocomplete){\r\n //prevent table navigation while using input element\r\n e.stopImmediatePropagation();\r\n }\r\n }\r\n \r\n _keySelectLetter(e){\r\n if(!this.params.autocomplete){\r\n // if(this.edit.currentCell === false){\r\n e.preventDefault();\r\n // }\r\n \r\n if(e.keyCode >= 38 && e.keyCode <= 90){\r\n this._scrollToValue(e.keyCode);\r\n }\r\n }\r\n }\r\n \r\n _keyAutoCompLetter(e){\r\n this._filter();\r\n this.typing = true;\r\n }\r\n \r\n \r\n _scrollToValue(char){\r\n clearTimeout(this.filterTimeout);\r\n \r\n var character = String.fromCharCode(char).toLowerCase();\r\n this.filterTerm += character.toLowerCase();\r\n \r\n var match = this.displayItems.find((item) => {\r\n return typeof item.label !== \"undefined\" && item.label.toLowerCase().startsWith(this.filterTerm);\r\n });\r\n \r\n if(match){\r\n this._focusItem(match);\r\n }\r\n \r\n this.filterTimeout = setTimeout(() => {\r\n this.filterTerm = \"\";\r\n }, 800)\r\n }\r\n \r\n _focusItem(item){\r\n if(this.focusedItem && this.focusedItem.element){\r\n this.focusedItem.element.classList.remove(\"focused\");\r\n }\r\n \r\n this.focusedItem = item;\r\n \r\n if(item && item.element){\r\n item.element.classList.add(\"focused\");\r\n item.element.scrollIntoView({behavior: 'smooth', block: 'nearest', inline: 'start'});\r\n }\r\n }\r\n \r\n \r\n //////////////////////////////////////\r\n /////// Data List Generation /////////\r\n //////////////////////////////////////\r\n headerFilterInitialListGen(){\r\n this._generateOptions(true);\r\n }\r\n \r\n rebuildOptionsList(){\r\n this._generateOptions()\r\n .then(this._sortOptions.bind(this))\r\n .then(this._buildList.bind(this))\r\n .then(this._showList.bind(this))\r\n .catch((e) => {\r\n if(!Number.isInteger(e)){\r\n console.error(\"List generation error\", e);\r\n }\r\n })\r\n }\r\n \r\n _filterList(){\r\n this._buildList(this._filterOptions());\r\n this._showList();\r\n }\r\n \r\n _generateOptions(silent){\r\n var values = [];\r\n var itteration = ++ this.listIteration;\r\n \r\n this.filtered = false;\r\n \r\n if(this.params.values){\r\n values = this.params.values;\r\n }else if (this.params.valuesURL){\r\n values = this._ajaxRequest(this.params.valuesURL, this.input.value);\r\n }else{\r\n if(typeof this.params.valuesLookup === \"function\"){\r\n values = this.params.valuesLookup(this.cell, this.input.value);\r\n }else if(this.params.valuesLookup){\r\n values = this._uniqueColumnValues(this.params.valuesLookupField);\r\n }\r\n }\r\n \r\n if(values instanceof Promise){\r\n if(!silent){\r\n this._addPlaceholder(this.params.placeholderLoading);\r\n }\r\n \r\n return values.then()\r\n .then((responseValues) => {\r\n if(this.listIteration === itteration){\r\n return this._parseList(responseValues);\r\n }else{\r\n return Promise.reject(itteration);\r\n }\r\n });\r\n }else{\r\n return Promise.resolve(this._parseList(values))\r\n }\r\n }\r\n \r\n _addPlaceholder(contents){\r\n var placeholder = document.createElement(\"div\");\r\n \r\n if(typeof contents === \"function\"){\r\n contents = contents(cell.getComponent(), this.listEl);\r\n }\r\n \r\n if(contents){\r\n this._clearList();\r\n \r\n if(contents instanceof HTMLElement){\r\n placeholder = contents;\r\n }else{\r\n placeholder.classList.add(\"tabulator-edit-list-placeholder\")\r\n placeholder.innerHTML = contents;\r\n }\r\n \r\n this.listEl.appendChild(placeholder);\r\n \r\n this._showList();\r\n }\r\n }\r\n \r\n _ajaxRequest(url, term){\r\n var params = this.params.filterRemote ? {term:term} : {};\r\n url = urlBuilder(url, {}, params);\r\n \r\n return fetch(url)\r\n .then((response)=>{\r\n if(response.ok) {\r\n return response.json()\r\n .catch((error)=>{\r\n console.warn(\"List Ajax Load Error - Invalid JSON returned\", error);\r\n return Promise.reject(error);\r\n });\r\n }else{\r\n console.error(\"List Ajax Load Error - Connection Error: \" + response.status, response.statusText);\r\n return Promise.reject(response);\r\n }\r\n })\r\n .catch((error)=>{\r\n console.error(\"List Ajax Load Error - Connection Error: \", error);\r\n return Promise.reject(error);\r\n });\r\n }\r\n \r\n _uniqueColumnValues(field){\r\n var output = {},\r\n data = this.table.getData(this.params.valuesLookup),\r\n column;\r\n \r\n if(field){\r\n column = this.table.columnManager.getColumnByField(field);\r\n }else{\r\n column = this.cell.getColumn()._getSelf();\r\n }\r\n \r\n if(column){\r\n data.forEach((row) => {\r\n var val = column.getFieldValue(row);\r\n \r\n if(val !== null && typeof val !== \"undefined\" && val !== \"\"){\r\n output[val] = true;\r\n }\r\n });\r\n }else{\r\n console.warn(\"unable to find matching column to create select lookup list:\", field);\r\n output = [];\r\n }\r\n \r\n return Object.keys(output);\r\n }\r\n \r\n \r\n _parseList(inputValues){\r\n var data = [];\r\n \r\n if(!Array.isArray(inputValues)){\r\n inputValues = Object.entries(inputValues).map(([key, value]) => {\r\n return {\r\n label:value,\r\n value:key,\r\n };\r\n });\r\n }\r\n \r\n inputValues.forEach((value) => {\r\n if(typeof value !== \"object\"){\r\n value = {\r\n label:value,\r\n value:value,\r\n };\r\n }\r\n \r\n this._parseListItem(value, data, 0);\r\n });\r\n \r\n this.data = data;\r\n \r\n return data; \r\n }\r\n \r\n _parseListItem(option, data, level){\r\n var item = {};\r\n \r\n if(option.options){\r\n item = this._parseListGroup(option, level + 1);\r\n }else{\r\n item = {\r\n label:option.label,\r\n value:option.value,\r\n itemParams:option.itemParams,\r\n elementAttributes: option.elementAttributes,\r\n element:false,\r\n selected:false,\r\n visible:true,\r\n level:level,\r\n original:option,\r\n };\r\n \r\n if(this.initialValues && this.initialValues.indexOf(option.value) > -1){\r\n this._chooseItem(item, true);\r\n }\r\n }\r\n \r\n data.push(item);\r\n }\r\n \r\n _parseListGroup(option, level){\r\n var item = {\r\n label:option.label,\r\n group:true,\r\n itemParams:option.itemParams,\r\n elementAttributes:option.elementAttributes,\r\n element:false,\r\n visible:true,\r\n level:level,\r\n options:[],\r\n original:option,\r\n };\r\n \r\n option.options.forEach((child) => {\r\n this._parseListItem(child, item.options, level);\r\n });\r\n \r\n return item;\r\n }\r\n \r\n _sortOptions(options){\r\n var sorter;\r\n \r\n if(this.params.sort){\r\n sorter = typeof this.params.sort === \"function\" ? this.params.sort : this._defaultSortFunction.bind(this);\r\n \r\n this._sortGroup(sorter, options);\r\n }\r\n \r\n return options;\r\n }\r\n \r\n _sortGroup(sorter, options){\r\n options.sort((a,b) => {\r\n return sorter(a.label, b.label, a.value, b.value, a.original, b.original);\r\n });\r\n \r\n options.forEach((option) => {\r\n if(option.group){\r\n this._sortGroup(sorter, option.options);\r\n }\r\n })\r\n }\r\n \r\n _defaultSortFunction(as, bs){\r\n var a, b, a1, b1, i= 0, L, rx = /(\\d+)|(\\D+)/g, rd = /\\d/;\r\n var emptyAlign = 0;\r\n \r\n if(this.params.sort === \"desc\"){\r\n [as, bs] = [bs, as];\r\n }\r\n \r\n //handle empty values\r\n if(!as && as!== 0){\r\n emptyAlign = !bs && bs!== 0 ? 0 : -1;\r\n }else if(!bs && bs!== 0){\r\n emptyAlign = 1;\r\n }else{\r\n if(isFinite(as) && isFinite(bs)) return as - bs;\r\n a = String(as).toLowerCase();\r\n b = String(bs).toLowerCase();\r\n if(a === b) return 0;\r\n if(!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1;\r\n a = a.match(rx);\r\n b = b.match(rx);\r\n L = a.length > b.length ? b.length : a.length;\r\n while(i < L){\r\n a1= a[i];\r\n b1= b[i++];\r\n if(a1 !== b1){\r\n if(isFinite(a1) && isFinite(b1)){\r\n if(a1.charAt(0) === \"0\") a1 = \".\" + a1;\r\n if(b1.charAt(0) === \"0\") b1 = \".\" + b1;\r\n return a1 - b1;\r\n }\r\n else return a1 > b1 ? 1 : -1;\r\n }\r\n }\r\n \r\n return a.length > b.length;\r\n }\r\n \r\n return emptyAlign;\r\n }\r\n \r\n _filterOptions(){\r\n var filterFunc = this.params.filterFunc || this._defaultFilterFunc;\r\n var term = this.input.value;\r\n var results = [];\r\n \r\n if(term){\r\n this.filtered = true;\r\n \r\n this.data.forEach((item) => {\r\n this._filterItem(filterFunc, term, item);\r\n });\r\n }else{\r\n this.filtered = false;\r\n }\r\n \r\n return this.data;\r\n }\r\n \r\n _filterItem(func, term, item){\r\n var matches = false;\r\n \r\n if(!item.group){\r\n item.visible = func(term, item.label, item.value, item.original);\r\n }else{\r\n item.options.forEach((option) => {\r\n if(this._filterItem(func, term, option)){\r\n matches = true;\r\n }\r\n });\r\n \r\n item.visible = matches;\r\n }\r\n \r\n return item.visible;\r\n }\r\n \r\n _defaultFilterFunc(term, label, value, item){\r\n var term = String(term).toLowerCase();\r\n \r\n if(label !== null || typeof label !== \"undefined\"){\r\n if(String(label).toLowerCase().indexOf(term) > -1 || String(value).toLowerCase(term).indexOf() > -1){\r\n return true;\r\n }\r\n }\r\n \r\n return false;\r\n }\r\n \r\n //////////////////////////////////////\r\n /////////// Display List /////////////\r\n //////////////////////////////////////\r\n \r\n _clearList(){\r\n while(this.listEl.firstChild) this.listEl.removeChild(this.listEl.firstChild);\r\n \r\n this.displayItems = [];\r\n }\r\n \r\n _buildList(data){\r\n this._clearList();\r\n \r\n data.forEach((option) => {\r\n this._buildItem(option);\r\n });\r\n \r\n if(!this.displayItems.length){\r\n this._addPlaceholder(this.params.placeholderEmpty);\r\n } \r\n }\r\n \r\n _buildItem(item){\r\n var el = item.element,\r\n contents;\r\n \r\n if(!this.filtered || item.visible){\r\n \r\n if(!el){\r\n el = document.createElement(\"div\");\r\n el.tabIndex = 0;\r\n \r\n contents = this.params.itemFormatter ? this.params.itemFormatter(item.label, item.value, item.original, el) : item.label;\r\n \r\n if(contents instanceof HTMLElement){\r\n el.appendChild(contents)\r\n }else{\r\n el.innerHTML = contents;\r\n }\r\n \r\n if(item.group){\r\n el.classList.add(\"tabulator-edit-list-group\");\r\n }else{\r\n el.classList.add(\"tabulator-edit-list-item\");\r\n }\r\n \r\n el.classList.add(\"tabulator-edit-list-group-level-\" + item.level);\r\n \r\n if(item.elementAttributes && typeof item.elementAttributes == \"object\"){\r\n for (let key in item.elementAttributes){\r\n if(key.charAt(0) == \"+\"){\r\n key = key.slice(1);\r\n el.setAttribute(key, this.input.getAttribute(key) + item.elementAttributes[\"+\" + key]);\r\n }else{\r\n el.setAttribute(key, item.elementAttributes[key]);\r\n }\r\n }\r\n }\r\n \r\n if(item.group){\r\n el.addEventListener(\"click\", this._groupClick.bind(this, item));\r\n }else{\r\n el.addEventListener(\"click\", this._itemClick.bind(this, item));\r\n }\r\n \r\n el.addEventListener(\"mousedown\", this._preventBlur.bind(this));\r\n \r\n item.element = el;\r\n }\r\n \r\n this._styleItem(item);\r\n \r\n this.listEl.appendChild(el);\r\n \r\n if(item.group){\r\n item.options.forEach((option) => {\r\n this._buildItem(option);\r\n });\r\n }else{\r\n this.displayItems.push(item);\r\n }\r\n }\r\n }\r\n \r\n _showList(){\r\n var startVis = this.popup && this.popup.isVisible();\r\n \r\n if(this.input.parentNode){\r\n if(this.params.autocomplete && this.input.value === \"\" && !this.params.listOnEmpty){\r\n if(this.popup){\r\n this.popup.hide(true);\r\n return;\r\n }\r\n }\r\n \r\n this._setListWidth();\r\n \r\n if(!this.popup){\r\n this.popup = this.edit.popup(this.listEl);\r\n }\r\n \r\n this.popup.show(this.cell.getElement(), \"bottom\")\r\n \r\n if(!startVis){\r\n this.popup.hideOnBlur(this._resolveValue.bind(this, true));\r\n }\r\n }\r\n }\r\n \r\n _styleItem(item){\r\n if(item && item.element){\r\n if(item.selected){\r\n item.element.classList.add(\"active\");\r\n }else{\r\n item.element.classList.remove(\"active\");\r\n }\r\n }\r\n }\r\n \r\n //////////////////////////////////////\r\n ///////// User Interaction ///////////\r\n //////////////////////////////////////\r\n \r\n _itemClick(item, e){\r\n e.stopPropagation();\r\n \r\n this._chooseItem(item);\r\n }\r\n \r\n _groupClick(item, e){\r\n e.stopPropagation();\r\n }\r\n \r\n \r\n //////////////////////////////////////\r\n ////// Current Item Management ///////\r\n //////////////////////////////////////\r\n \r\n _cancel(){\r\n this.popup.hide(true);\r\n this.actions.cancel();\r\n }\r\n \r\n _clearChoices(){\r\n this.typing = true;\r\n \r\n this.currentItems.forEach((item) => {\r\n item.selected = false;\r\n this._styleItem(item);\r\n });\r\n \r\n this.currentItems = [];\r\n \r\n this.focusedItem = null;\r\n }\r\n \r\n _chooseItem(item, silent){\r\n var index;\r\n \r\n this.typing = false;\r\n \r\n if(this.params.multiselect){\r\n index = this.currentItems.indexOf(item);\r\n \r\n if(index > -1){\r\n this.currentItems.splice(index, 1);\r\n item.selected = false;\r\n }else{\r\n this.currentItems.push(item);\r\n item.selected = true;\r\n }\r\n \r\n this.input.value = this.currentItems.map(item => item.label).join(\",\");\r\n \r\n this._styleItem(item);\r\n \r\n }else{\r\n this.currentItems = [item];\r\n item.selected = true;\r\n \r\n this.input.value = item.label;\r\n \r\n this._styleItem(item);\r\n \r\n if(!silent){\r\n this._resolveValue();\r\n }\r\n }\r\n \r\n this._focusItem(item);\r\n }\r\n \r\n _resolveValue(blur){\r\n var output, initialValue;\r\n \r\n this.popup.hide(true);\r\n \r\n if(this.params.multiselect){\r\n output = this.currentItems.map(item => item.value);\r\n }else{\r\n if(blur && this.params.autocomplete && this.typing){\r\n if(this.params.freetext || (this.params.allowEmpty && this.input.value === \"\")){\r\n output = this.input.value;\r\n }else{\r\n this.actions.cancel();\r\n return;\r\n }\r\n }else{\r\n if(this.currentItems[0]){\r\n output = this.currentItems[0].value;\r\n }else{\r\n initialValue = this.initialValues[0];\r\n \r\n if(initialValue === null || typeof initialValue === \"undefined\" || initialValue === \"\"){\r\n output = initialValue;\r\n }else{\r\n output = this.params.emptyValue;\r\n }\r\n }\r\n \r\n }\r\n }\r\n \r\n if(output === \"\"){\r\n output = this.params.emptyValue;\r\n }\r\n \r\n this.actions.success(output);\r\n \r\n if(this.isFilter){\r\n this.initialValues = output && !Array.isArray[output] ? [output] : output;\r\n }\r\n }\r\n \r\n}\r\n","import input from './editors/input.js';\r\nimport textarea from './editors/textarea.js';\r\nimport number from './editors/number.js';\r\nimport range from './editors/range.js';\r\nimport select from './editors/select.js';\r\nimport list from './editors/list.js';\r\nimport autocomplete from './editors/autocomplete.js';\r\nimport star from './editors/star.js';\r\nimport progress from './editors/progress.js';\r\nimport tickCross from './editors/tickCross.js';\r\n\r\nexport default {\r\n\tinput:input,\r\n\ttextarea:textarea,\r\n number:number,\r\n range:range,\r\n\tselect:select,\r\n\tlist:list,\r\n\tautocomplete:autocomplete,\r\n\tstar:star,\r\n\tprogress:progress,\r\n\ttickCross:tickCross,\r\n};","import maskInput from '../../inputMask.js';\r\n\r\n//input element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\t//create and style input\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", editorParams.search ? \"search\" : \"text\");\r\n\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = typeof cellValue !== \"undefined\" ? cellValue : \"\";\r\n\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\r\n\tfunction onChange(e){\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && input.value !== \"\") || input.value !== cellValue){\r\n\t\t\tif(success(input.value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t// case 9:\r\n\t\t\tcase 13:\r\n\t\t\tonChange(e);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\tcancel();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\te.stopPropagation();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(editorParams.mask){\r\n\t\tmaskInput(input, editorParams);\r\n\t}\r\n\r\n\treturn input;\r\n};","import maskInput from '../../inputMask.js';\r\n\r\n//resizable text area element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n var self = this,\r\n cellValue = cell.getValue(),\r\n vertNav = editorParams.verticalNavigation || \"hybrid\",\r\n value = String(cellValue !== null && typeof cellValue !== \"undefined\" ? cellValue : \"\"),\r\n count = (value.match(/(?:\\r\\n|\\r|\\n)/g) || []).length + 1,\r\n input = document.createElement(\"textarea\"),\r\n scrollHeight = 0;\r\n\r\n //create and style input\r\n input.style.display = \"block\";\r\n input.style.padding = \"2px\";\r\n input.style.height = \"100%\";\r\n input.style.width = \"100%\";\r\n input.style.boxSizing = \"border-box\";\r\n input.style.whiteSpace = \"pre-wrap\";\r\n input.style.resize = \"none\";\r\n\r\n if(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n for (let key in editorParams.elementAttributes){\r\n if(key.charAt(0) == \"+\"){\r\n key = key.slice(1);\r\n input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n }else{\r\n input.setAttribute(key, editorParams.elementAttributes[key]);\r\n }\r\n }\r\n }\r\n\r\n input.value = value;\r\n\r\n onRendered(function(){\r\n input.focus({preventScroll: true});\r\n input.style.height = \"100%\";\r\n\r\n input.scrollHeight;\r\n input.style.height = input.scrollHeight + \"px\";\r\n cell.getRow().normalizeHeight();\r\n\r\n if(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n });\r\n\r\n function onChange(e){\r\n\r\n if(((cellValue === null || typeof cellValue === \"undefined\") && input.value !== \"\") || input.value !== cellValue){\r\n\r\n if(success(input.value)){\r\n cellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n }\r\n\r\n setTimeout(function(){\r\n cell.getRow().normalizeHeight();\r\n },300)\r\n }else{\r\n cancel();\r\n }\r\n }\r\n\r\n //submit new value on blur or change\r\n input.addEventListener(\"change\", onChange);\r\n input.addEventListener(\"blur\", onChange);\r\n\r\n input.addEventListener(\"keyup\", function(){\r\n\r\n input.style.height = \"\";\r\n\r\n var heightNow = input.scrollHeight;\r\n\r\n input.style.height = heightNow + \"px\";\r\n\r\n if(heightNow != scrollHeight){\r\n scrollHeight = heightNow;\r\n cell.getRow().normalizeHeight();\r\n }\r\n });\r\n\r\n input.addEventListener(\"keydown\", function(e){\r\n\r\n switch(e.keyCode){\r\n case 27:\r\n cancel();\r\n break;\r\n\r\n case 38: //up arrow\r\n if(vertNav == \"editor\" || (vertNav == \"hybrid\" && input.selectionStart)){\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n }\r\n\r\n break;\r\n\r\n case 40: //down arrow\r\n if(vertNav == \"editor\" || (vertNav == \"hybrid\" && input.selectionStart !== input.value.length)){\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n }\r\n break;\r\n\r\n case 35:\r\n case 36:\r\n e.stopPropagation();\r\n break;\r\n }\r\n });\r\n\r\n if(editorParams.mask){\r\n maskInput(input, editorParams);\r\n }\r\n\r\n return input;\r\n};","import maskInput from '../../inputMask.js';\r\n\r\n//input element with type of number\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar cellValue = cell.getValue(),\r\n\tvertNav = editorParams.verticalNavigation || \"editor\",\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", \"number\");\r\n\r\n\tif(typeof editorParams.max != \"undefined\"){\r\n\t\tinput.setAttribute(\"max\", editorParams.max);\r\n\t}\r\n\r\n\tif(typeof editorParams.min != \"undefined\"){\r\n\t\tinput.setAttribute(\"min\", editorParams.min);\r\n\t}\r\n\r\n\tif(typeof editorParams.step != \"undefined\"){\r\n\t\tinput.setAttribute(\"step\", editorParams.step);\r\n\t}\r\n\r\n\t//create and style input\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\r\n\tvar blurFunc = function(e){\r\n\t\tonChange();\r\n\t};\r\n\r\n\tonRendered(function () {\r\n\t\t//submit new value on blur\r\n\t\tinput.removeEventListener(\"blur\", blurFunc);\r\n\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\r\n\t\t//submit new value on blur\r\n\t\tinput.addEventListener(\"blur\", blurFunc);\r\n\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\r\n\tfunction onChange(){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(!isNaN(value) && value !==\"\"){\r\n\t\t\tvalue = Number(value);\r\n\t\t}\r\n\r\n\t\tif(value !== cellValue){\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 13:\r\n\t\t\t// case 9:\r\n\t\t\tonChange();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\tcancel();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 38: //up arrow\r\n\t\t\tcase 40: //down arrow\r\n\t\t\tif(vertNav == \"editor\"){\r\n\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\te.stopPropagation();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(editorParams.mask){\r\n\t\tmaskInput(input, editorParams);\r\n\t}\r\n\r\n\treturn input;\r\n};","//input element with type of number\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", \"range\");\r\n\r\n\tif (typeof editorParams.max != \"undefined\") {\r\n\t\tinput.setAttribute(\"max\", editorParams.max);\r\n\t}\r\n\r\n\tif (typeof editorParams.min != \"undefined\") {\r\n\t\tinput.setAttribute(\"min\", editorParams.min);\r\n\t}\r\n\r\n\tif (typeof editorParams.step != \"undefined\") {\r\n\t\tinput.setAttribute(\"step\", editorParams.step);\r\n\t}\r\n\r\n\t//create and style input\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\r\n\tonRendered(function () {\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\t});\r\n\r\n\tfunction onChange(){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(!isNaN(value) && value !==\"\"){\r\n\t\t\tvalue = Number(value);\r\n\t\t}\r\n\r\n\t\tif(value != cellValue){\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur\r\n\tinput.addEventListener(\"blur\", function(e){\r\n\t\tonChange();\r\n\t});\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 13:\r\n\t\t\t// case 9:\r\n\t\t\tonChange();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\tcancel();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\treturn input;\r\n};","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\r\n\t console.warn(\"The select editor has been deprecated, please use the new list editor\");\r\n\r\n var list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n return list.input;\r\n}","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n var list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n return list.input;\r\n}","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\r\n\tconsole.warn(\"The autocomplete editor has been deprecated, please use the new list editor with the 'autocomplete' editorParam\");\r\n\r\n\teditorParams.autocomplete = true;\r\n\r\n var list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n return list.input;\r\n}","//star rating\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar self = this,\r\n\telement = cell.getElement(),\r\n\tvalue = cell.getValue(),\r\n\tmaxStars = element.getElementsByTagName(\"svg\").length || 5,\r\n\tsize = element.getElementsByTagName(\"svg\")[0] ? element.getElementsByTagName(\"svg\")[0].getAttribute(\"width\") : 14,\r\n\tstars = [],\r\n\tstarsHolder = document.createElement(\"div\"),\r\n\tstar = document.createElementNS('http://www.w3.org/2000/svg', \"svg\");\r\n\r\n\r\n\t//change star type\r\n\tfunction starChange(val){\r\n\t\tstars.forEach(function(star, i){\r\n\t\t\tif(i < val){\r\n\t\t\t\tif(self.table.browser == \"ie\"){\r\n\t\t\t\t\tstar.setAttribute(\"class\", \"tabulator-star-active\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tstar.classList.replace(\"tabulator-star-inactive\", \"tabulator-star-active\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstar.innerHTML = '';\r\n\t\t\t}else{\r\n\t\t\t\tif(self.table.browser == \"ie\"){\r\n\t\t\t\t\tstar.setAttribute(\"class\", \"tabulator-star-inactive\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tstar.classList.replace(\"tabulator-star-active\", \"tabulator-star-inactive\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstar.innerHTML = '';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//build stars\r\n\tfunction buildStar(i){\r\n\r\n\t\tvar starHolder = document.createElement(\"span\");\r\n\t\tvar nextStar = star.cloneNode(true);\r\n\r\n\t\tstars.push(nextStar);\r\n\r\n\t\tstarHolder.addEventListener(\"mouseenter\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\tstarChange(i);\r\n\t\t});\r\n\r\n\t\tstarHolder.addEventListener(\"mousemove\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t});\r\n\r\n\t\tstarHolder.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\tsuccess(i);\r\n\t\t\telement.blur();\r\n\t\t});\r\n\r\n\t\tstarHolder.appendChild(nextStar);\r\n\t\tstarsHolder.appendChild(starHolder);\r\n\r\n\t}\r\n\r\n\t//handle keyboard navigation value change\r\n\tfunction changeValue(val){\r\n\t\tvalue = val;\r\n\t\tstarChange(val);\r\n\t}\r\n\r\n\t//style cell\r\n\telement.style.whiteSpace = \"nowrap\";\r\n\telement.style.overflow = \"hidden\";\r\n\telement.style.textOverflow = \"ellipsis\";\r\n\r\n\t//style holding element\r\n\tstarsHolder.style.verticalAlign = \"middle\";\r\n\tstarsHolder.style.display = \"inline-block\";\r\n\tstarsHolder.style.padding = \"4px\";\r\n\r\n\t//style star\r\n\tstar.setAttribute(\"width\", size);\r\n\tstar.setAttribute(\"height\", size);\r\n\tstar.setAttribute(\"viewBox\", \"0 0 512 512\");\r\n\tstar.setAttribute(\"xml:space\", \"preserve\");\r\n\tstar.style.padding = \"0 1px\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tstarsHolder.setAttribute(key, starsHolder.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tstarsHolder.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//create correct number of stars\r\n\tfor(var i=1;i<= maxStars;i++){\r\n\t\tbuildStar(i);\r\n\t}\r\n\r\n\t//ensure value does not exceed number of stars\r\n\tvalue = Math.min(parseInt(value), maxStars);\r\n\r\n\t// set initial styling of stars\r\n\tstarChange(value);\r\n\r\n\tstarsHolder.addEventListener(\"mousemove\", function(e){\r\n\t\tstarChange(0);\r\n\t});\r\n\r\n\tstarsHolder.addEventListener(\"click\", function(e){\r\n\t\tsuccess(0);\r\n\t});\r\n\r\n\telement.addEventListener(\"blur\", function(e){\r\n\t\tcancel();\r\n\t});\r\n\r\n\t//allow key based navigation\r\n\telement.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 39: //right arrow\r\n\t\t\tchangeValue(value + 1);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 37: //left arrow\r\n\t\t\tchangeValue(value - 1);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 13: //enter\r\n\t\t\tsuccess(value);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 27: //escape\r\n\t\t\tcancel();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\treturn starsHolder;\r\n};","//draggable progress bar\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar element = cell.getElement(),\r\n\tmax = typeof editorParams.max === \"undefined\" ? ((element.getElementsByTagName(\"div\")[0] && element.getElementsByTagName(\"div\")[0].getAttribute(\"max\")) || 100) : editorParams.max,\r\n\tmin = typeof editorParams.min === \"undefined\" ? ((element.getElementsByTagName(\"div\")[0] && element.getElementsByTagName(\"div\")[0].getAttribute(\"min\")) || 0) : editorParams.min,\r\n\tpercent = (max - min) / 100,\r\n\tvalue = cell.getValue() || 0,\r\n\thandle = document.createElement(\"div\"),\r\n\tbar = document.createElement(\"div\"),\r\n\tmouseDrag, mouseDragWidth;\r\n\r\n\t//set new value\r\n\tfunction updateValue(){\r\n\t\tvar style = window.getComputedStyle(element, null);\r\n\r\n\t\tvar calcVal = (percent * Math.round(bar.offsetWidth / ((element.clientWidth - parseInt(style.getPropertyValue(\"padding-left\")) - parseInt(style.getPropertyValue(\"padding-right\")))/100))) + min;\r\n\t\tsuccess(calcVal);\r\n\t\telement.setAttribute(\"aria-valuenow\", calcVal);\r\n\t\telement.setAttribute(\"aria-label\", value);\r\n\t}\r\n\r\n\t//style handle\r\n\thandle.style.position = \"absolute\";\r\n\thandle.style.right = \"0\";\r\n\thandle.style.top = \"0\";\r\n\thandle.style.bottom = \"0\";\r\n\thandle.style.width = \"5px\";\r\n\thandle.classList.add(\"tabulator-progress-handle\");\r\n\r\n\t//style bar\r\n\tbar.style.display = \"inline-block\";\r\n\tbar.style.position = \"relative\";\r\n\t// bar.style.top = \"8px\";\r\n\t// bar.style.bottom = \"8px\";\r\n\t// bar.style.left = \"4px\";\r\n\t// bar.style.marginRight = \"4px\";\r\n\tbar.style.height = \"100%\";\r\n\tbar.style.backgroundColor = \"#488CE9\";\r\n\tbar.style.maxWidth = \"100%\";\r\n\tbar.style.minWidth = \"0%\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tbar.setAttribute(key, bar.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tbar.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//style cell\r\n\telement.style.padding = \"4px 4px\";\r\n\r\n\t//make sure value is in range\r\n\tvalue = Math.min(parseFloat(value), max);\r\n\tvalue = Math.max(parseFloat(value), min);\r\n\r\n\t//workout percentage\r\n\tvalue = Math.round((value - min) / percent);\r\n\t// bar.style.right = value + \"%\";\r\n\tbar.style.width = value + \"%\";\r\n\r\n\telement.setAttribute(\"aria-valuemin\", min);\r\n\telement.setAttribute(\"aria-valuemax\", max);\r\n\r\n\tbar.appendChild(handle);\r\n\r\n\thandle.addEventListener(\"mousedown\", function(e){\r\n\t\tmouseDrag = e.screenX;\r\n\t\tmouseDragWidth = bar.offsetWidth;\r\n\t});\r\n\r\n\thandle.addEventListener(\"mouseover\", function(){\r\n\t\thandle.style.cursor = \"ew-resize\";\r\n\t});\r\n\r\n\telement.addEventListener(\"mousemove\", function(e){\r\n\t\tif(mouseDrag){\r\n\t\t\tbar.style.width = (mouseDragWidth + e.screenX - mouseDrag) + \"px\";\r\n\t\t}\r\n\t});\r\n\r\n\telement.addEventListener(\"mouseup\", function(e){\r\n\t\tif(mouseDrag){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\r\n\t\t\tmouseDrag = false;\r\n\t\t\tmouseDragWidth = false;\r\n\r\n\t\t\tupdateValue();\r\n\t\t}\r\n\t});\r\n\r\n\t//allow key based navigation\r\n\telement.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 39: //right arrow\r\n\t\t\te.preventDefault();\r\n\t\t\tbar.style.width = (bar.clientWidth + element.clientWidth/100) + \"px\";\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 37: //left arrow\r\n\t\t\te.preventDefault();\r\n\t\t\tbar.style.width = (bar.clientWidth - element.clientWidth/100) + \"px\";\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 9: //tab\r\n\t\t\tcase 13: //enter\r\n\t\t\tupdateValue();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 27: //escape\r\n\t\t\tcancel();\r\n\t\t\tbreak;\r\n\r\n\t\t}\r\n\t});\r\n\r\n\telement.addEventListener(\"blur\", function(){\r\n\t\tcancel();\r\n\t});\r\n\r\n\treturn bar;\r\n};","//checkbox\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar value = cell.getValue(),\r\n\tinput = document.createElement(\"input\"),\r\n\ttristate = editorParams.tristate,\r\n\tindetermValue = typeof editorParams.indeterminateValue === \"undefined\" ? null : editorParams.indeterminateValue,\r\n\tindetermState = false,\r\n\ttrueValueSet = Object.keys(editorParams).includes(\"trueValue\"),\r\n\tfalseValueSet = Object.keys(editorParams).includes(\"falseValue\");\r\n\r\n\tinput.setAttribute(\"type\", \"checkbox\");\r\n\tinput.style.marginTop = \"5px\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = value;\r\n\r\n\tif(tristate && (typeof value === \"undefined\" || value === indetermValue || value === \"\")){\r\n\t\tindetermState = true;\r\n\t\tinput.indeterminate = true;\r\n\t}\r\n\r\n\tif(this.table.browser != \"firefox\"){ //prevent blur issue on mac firefox\r\n\t\tonRendered(function(){\r\n\t\t\tinput.focus({preventScroll: true});\r\n\t\t});\r\n\t}\r\n\r\n\tinput.checked = trueValueSet ? value === editorParams.trueValue : (value === true || value === \"true\" || value === \"True\" || value === 1);\r\n\r\n\tonRendered(function(){\r\n\t\tinput.focus();\r\n\t});\r\n\r\n\tfunction setValue(blur){\r\n\t\tvar checkedValue = input.checked;\r\n\r\n\t\tif(trueValueSet && checkedValue){\r\n\t\t\tcheckedValue = editorParams.trueValue;\r\n\t\t}else if(falseValueSet && !checkedValue){\r\n\t\t\tcheckedValue = editorParams.falseValue;\r\n\t\t}else{\r\n\t\t\tcheckedValue = checkedValue;\r\n\t\t}\r\n\r\n\t\tif(tristate){\r\n\t\t\tif(!blur){\r\n\t\t\t\tif(input.checked && !indetermState){\r\n\t\t\t\t\tinput.checked = false;\r\n\t\t\t\t\tinput.indeterminate = true;\r\n\t\t\t\t\tindetermState = true;\r\n\t\t\t\t\treturn indetermValue;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tindetermState = false;\r\n\t\t\t\t\treturn checkedValue;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(indetermState){\r\n\t\t\t\t\treturn indetermValue;\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn checkedValue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn checkedValue;\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur\r\n\tinput.addEventListener(\"change\", function(e){\r\n\t\tsuccess(setValue());\r\n\t});\r\n\r\n\tinput.addEventListener(\"blur\", function(e){\r\n\t\tsuccess(setValue(true));\r\n\t});\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tif(e.keyCode == 13){\r\n\t\t\tsuccess(setValue());\r\n\t\t}\r\n\t\tif(e.keyCode == 27){\r\n\t\t\tcancel();\r\n\t\t}\r\n\t});\r\n\r\n\treturn input;\r\n};","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defaultEditors from './defaults/editors.js';\r\n\r\nclass Edit extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.currentCell = false; //hold currently editing cell\r\n\t\tthis.mouseClick = false; //hold mousedown state to prevent click binding being overriden by editor opening\r\n\t\tthis.recursionBlock = false; //prevent focus recursion\r\n\t\tthis.invalidEdit = false;\r\n\t\tthis.editedCells = [];\r\n\r\n\t\tthis.editors = Edit.editors;\r\n\r\n\t\tthis.registerColumnOption(\"editable\");\r\n\t\tthis.registerColumnOption(\"editor\");\r\n\t\tthis.registerColumnOption(\"editorParams\");\r\n\r\n\t\tthis.registerColumnOption(\"cellEditing\");\r\n\t\tthis.registerColumnOption(\"cellEdited\");\r\n\t\tthis.registerColumnOption(\"cellEditCancelled\");\r\n\r\n\t\tthis.registerTableFunction(\"getEditedCells\", this.getEditedCells.bind(this));\r\n\t\tthis.registerTableFunction(\"clearCellEdited\", this.clearCellEdited.bind(this));\r\n\t\tthis.registerTableFunction(\"navigatePrev\", this.navigatePrev.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateNext\", this.navigateNext.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateLeft\", this.navigateLeft.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateRight\", this.navigateRight.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateUp\", this.navigateUp.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateDown\", this.navigateDown.bind(this));\r\n\r\n\t\tthis.registerComponentFunction(\"cell\", \"isEdited\", this.cellisEdited.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"clearEdited\", this.clearEdited.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"edit\", this.editCell.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"cancelEdit\", this.cellCancelEdit.bind(this));\r\n\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigatePrev\", this.navigatePrev.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateNext\", this.navigateNext.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateLeft\", this.navigateLeft.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateRight\", this.navigateRight.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateUp\", this.navigateUp.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateDown\", this.navigateDown.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-init\", this.bindEditor.bind(this));\r\n\t\tthis.subscribe(\"cell-delete\", this.clearEdited.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumnCheck.bind(this));\r\n\t\tthis.subscribe(\"column-delete\", this.columnDeleteCheck.bind(this));\r\n\t\tthis.subscribe(\"row-deleting\", this.rowDeleteCheck.bind(this));\r\n\t\tthis.subscribe(\"data-refreshing\", this.cancelEdit.bind(this));\r\n\r\n\t\tthis.subscribe(\"keybinding-nav-prev\", this.navigatePrev.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-next\", this.keybindingNavigateNext.bind(this));\r\n\t\tthis.subscribe(\"keybinding-nav-left\", this.navigateLeft.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-right\", this.navigateRight.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-up\", this.navigateUp.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-down\", this.navigateDown.bind(this, undefined));\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t////// Keybinding Functions ///////\r\n\t///////////////////////////////////\r\n\r\n\tkeybindingNavigateNext(e){\r\n\t\tvar cell = this.currentCell,\r\n\t\tnewRow = this.options(\"tabEndNewRow\");\r\n\r\n\t\tif(cell){\r\n\t\t\tif(!this.navigateNext(cell, e)){\r\n\t\t\t\tif(newRow){\r\n\t\t\t\t\tcell.getElement().firstChild.blur();\r\n\r\n\t\t\t\t\tif(newRow === true){\r\n\t\t\t\t\t\tnewRow = this.table.addRow({})\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(typeof newRow == \"function\"){\r\n\t\t\t\t\t\t\tnewRow = this.table.addRow(newRow(cell.row.getComponent()))\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnewRow = this.table.addRow(Object.assign({}, newRow));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tnewRow.then(() => {\r\n\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\tcell.getComponent().navigateNext();\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Cell Functions //////////\r\n\t///////////////////////////////////\r\n\r\n\tcellisEdited(cell){\r\n\t\treturn !! cell.modules.edit && cell.modules.edit.edited;\r\n\t}\r\n\r\n\tcellCancelEdit(cell){\r\n\t\tif(cell === this.currentCell){\r\n\t\t\tthis.table.modules.edit.cancelEdit();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cancel Editor Error - This cell is not currently being edited \");\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\tclearCellEdited(cells){\r\n\t\tif(!cells){\r\n\t\t\tcells = this.table.modules.edit.getEditedCells();\r\n\t\t}\r\n\r\n\t\tif(!Array.isArray(cells)){\r\n\t\t\tcells = [cells];\r\n\t\t}\r\n\r\n\t\tcells.forEach((cell) => {\r\n\t\t\tthis.table.modules.edit.clearEdited(cell._getSelf());\r\n\t\t});\r\n\t}\r\n\r\n\tnavigatePrev(cell = this.currentCell, e){\r\n\t\tvar nextCell, prevRow;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tnextCell = this.navigateLeft();\r\n\r\n\t\t\tif(nextCell){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tprevRow = this.table.rowManager.prevDisplayRow(cell.row, true);\r\n\r\n\t\t\t\tif(prevRow){\r\n\t\t\t\t\tnextCell = this.findNextEditableCell(prevRow, prevRow.cells.length);\r\n\r\n\t\t\t\t\tif(nextCell){\r\n\t\t\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tnavigateNext(cell = this.currentCell, e){\r\n\t\tvar nextCell, nextRow;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tnextCell = this.navigateRight();\r\n\r\n\t\t\tif(nextCell){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tnextRow = this.table.rowManager.nextDisplayRow(cell.row, true);\r\n\r\n\t\t\t\tif(nextRow){\r\n\t\t\t\t\tnextCell = this.findNextEditableCell(nextRow, -1);\r\n\r\n\t\t\t\t\tif(nextCell){\r\n\t\t\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tnavigateLeft(cell = this.currentCell, e){\r\n\t\tvar index, nextCell;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextCell = this.findPrevEditableCell(cell.row, index);\r\n\r\n\t\t\tif(nextCell){\r\n\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tnavigateRight(cell = this.currentCell, e){\r\n\t\tvar index, nextCell;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextCell = this.findNextEditableCell(cell.row, index);\r\n\r\n\t\t\tif(nextCell){\r\n\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tnavigateUp(cell = this.currentCell, e){\r\n\t\tvar index, nextRow;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextRow = this.table.rowManager.prevDisplayRow(cell.row, true);\r\n\r\n\t\t\tif(nextRow){\r\n\t\t\t\tnextRow.cells[index].getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tnavigateDown(cell = this.currentCell, e){\r\n\t\tvar index, nextRow;\r\n\r\n\t\tif(cell){\r\n\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextRow = this.table.rowManager.nextDisplayRow(cell.row, true);\r\n\r\n\t\t\tif(nextRow){\r\n\t\t\t\tnextRow.cells[index].getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfindNextEditableCell(row, index){\r\n\t\tvar nextCell = false;\r\n\r\n\t\tif(index < row.cells.length-1){\r\n\t\t\tfor(var i = index+1; i < row.cells.length; i++){\r\n\t\t\t\tlet cell = row.cells[i];\r\n\r\n\t\t\t\tif(cell.column.modules.edit && Helpers.elVisible(cell.getElement())){\r\n\t\t\t\t\tlet allowEdit = true;\r\n\r\n\t\t\t\t\tif(typeof cell.column.modules.edit.check == \"function\"){\r\n\t\t\t\t\t\tallowEdit = cell.column.modules.edit.check(cell.getComponent());\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(allowEdit){\r\n\t\t\t\t\t\tnextCell = cell;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn nextCell;\r\n\t}\r\n\r\n\tfindPrevEditableCell(row, index){\r\n\t\tvar prevCell = false;\r\n\r\n\t\tif(index > 0){\r\n\t\t\tfor(var i = index-1; i >= 0; i--){\r\n\t\t\t\tlet cell = row.cells[i],\r\n\t\t\t\tallowEdit = true;\r\n\r\n\t\t\t\tif(cell.column.modules.edit && Helpers.elVisible(cell.getElement())){\r\n\t\t\t\t\tif(typeof cell.column.modules.edit.check == \"function\"){\r\n\t\t\t\t\t\tallowEdit = cell.column.modules.edit.check(cell.getComponent());\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(allowEdit){\r\n\t\t\t\t\t\tprevCell = cell;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn prevCell;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tinitializeColumnCheck(column){\r\n\t\tif(typeof column.definition.editor !== \"undefined\"){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\r\n\tcolumnDeleteCheck(column){\r\n\t\tif(this.currentCell && this.currentCell.column === column){\r\n\t\t\tthis.cancelEdit();\r\n\t\t}\r\n\t}\r\n\r\n\trowDeleteCheck(row){\r\n\t\tif(this.currentCell && this.currentCell.row === row){\r\n\t\t\tthis.cancelEdit();\r\n\t\t}\r\n\t}\r\n\r\n\t//initialize column editor\r\n\tinitializeColumn(column){\r\n\t\tvar self = this,\r\n\t\tconfig = {\r\n\t\t\teditor:false,\r\n\t\t\tblocked:false,\r\n\t\t\tcheck:column.definition.editable,\r\n\t\t\tparams:column.definition.editorParams || {}\r\n\t\t};\r\n\r\n\t\t//set column editor\r\n\t\tswitch(typeof column.definition.editor){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(this.editors[column.definition.editor]){\r\n\t\t\t\tconfig.editor = this.editors[column.definition.editor];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Editor Error - No such editor found: \", column.definition.editor);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tconfig.editor = column.definition.editor;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"boolean\":\r\n\t\t\tif(column.definition.editor === true){\r\n\t\t\t\tif(typeof column.definition.formatter !== \"function\"){\r\n\t\t\t\t\tif(this.editors[column.definition.formatter]){\r\n\t\t\t\t\t\tconfig.editor = this.editors[column.definition.formatter];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconfig.editor = this.editors[\"input\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Editor Error - Cannot auto lookup editor for a custom formatter: \", column.definition.formatter);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(config.editor){\r\n\t\t\tcolumn.modules.edit = config;\r\n\t\t}\r\n\t}\r\n\r\n\tgetCurrentCell(){\r\n\t\treturn this.currentCell ? this.currentCell.getComponent() : false;\r\n\t}\r\n\r\n\tclearEditor(cancel){\r\n\t\tvar cell = this.currentCell,\r\n\t\tcellEl;\r\n\r\n\t\tthis.invalidEdit = false;\r\n\r\n\t\tif(cell){\r\n\t\t\tthis.currentCell = false;\r\n\r\n\t\t\tcellEl = cell.getElement();\r\n\r\n\t\t\tthis.dispatch(\"edit-editor-clear\", cell, cancel);\r\n\r\n\t\t\tcellEl.classList.remove(\"tabulator-editing\");\r\n\r\n\t\t\twhile(cellEl.firstChild) cellEl.removeChild(cellEl.firstChild);\r\n\r\n\t\t\tcell.row.getElement().classList.remove(\"tabulator-row-editing\");\r\n\t\t}\r\n\t}\r\n\r\n\tcancelEdit(){\r\n\t\tif(this.currentCell){\r\n\t\t\tvar cell = this.currentCell;\r\n\t\t\tvar component = this.currentCell.getComponent();\r\n\r\n\t\t\tthis.clearEditor(true);\r\n\t\t\tcell.setValueActual(cell.getValue());\r\n\t\t\tcell.cellRendered();\r\n\r\n\t\t\tif(cell.column.definition.editor == \"textarea\" || cell.column.definition.variableHeight){\r\n\t\t\t\tcell.row.normalizeHeight(true);\r\n\t\t\t}\r\n\r\n\t\t\tif(cell.column.definition.cellEditCancelled){\r\n\t\t\t\tcell.column.definition.cellEditCancelled.call(this.table, component);\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatch(\"edit-cancelled\", cell);\r\n\t\t\tthis.dispatchExternal(\"cellEditCancelled\", component);\r\n\t\t}\r\n\t}\r\n\r\n\t//return a formatted value for a cell\r\n\tbindEditor(cell){\r\n\t\tif(cell.column.modules.edit){\r\n\t\t\tvar self = this,\r\n\t\t\telement = cell.getElement(true);\r\n\r\n\t\t\telement.setAttribute(\"tabindex\", 0);\r\n\r\n\t\t\telement.addEventListener(\"click\", function(e){\r\n\t\t\t\tif(!element.classList.contains(\"tabulator-editing\")){\r\n\t\t\t\t\telement.focus({preventScroll: true});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\telement.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif (e.button === 2) {\r\n\t\t\t\t\te.preventDefault();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself.mouseClick = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\telement.addEventListener(\"focus\", function(e){\r\n\t\t\t\tif(!self.recursionBlock){\r\n\t\t\t\t\tself.edit(cell, e, false);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tfocusCellNoEvent(cell, block){\r\n\t\tthis.recursionBlock = true;\r\n\r\n\t\tif(!(block && this.table.browser === \"ie\")){\r\n\t\t\tcell.getElement().focus({preventScroll: true});\r\n\t\t}\r\n\r\n\t\tthis.recursionBlock = false;\r\n\t}\r\n\r\n\teditCell(cell, forceEdit){\r\n\t\tthis.focusCellNoEvent(cell);\r\n\t\tthis.edit(cell, false, forceEdit);\r\n\t}\r\n\r\n\tfocusScrollAdjust(cell){\r\n\t\tif(this.table.rowManager.getRenderMode() == \"virtual\"){\r\n\t\t\tvar topEdge = this.table.rowManager.element.scrollTop,\r\n\t\t\tbottomEdge = this.table.rowManager.element.clientHeight + this.table.rowManager.element.scrollTop,\r\n\t\t\trowEl = cell.row.getElement(),\r\n\t\t\toffset = rowEl.offsetTop;\r\n\r\n\t\t\tif(rowEl.offsetTop < topEdge){\r\n\t\t\t\tthis.table.rowManager.element.scrollTop -= (topEdge - rowEl.offsetTop);\r\n\t\t\t}else{\r\n\t\t\t\tif(rowEl.offsetTop + rowEl.offsetHeight > bottomEdge){\r\n\t\t\t\t\tthis.table.rowManager.element.scrollTop += (rowEl.offsetTop + rowEl.offsetHeight - bottomEdge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar leftEdge = this.table.rowManager.element.scrollLeft,\r\n\t\t\trightEdge = this.table.rowManager.element.clientWidth + this.table.rowManager.element.scrollLeft,\r\n\t\t\tcellEl = cell.getElement(),\r\n\t\t\toffset = cellEl.offsetLeft;\r\n\r\n\t\t\tif(this.table.modExists(\"frozenColumns\")){\r\n\t\t\t\tleftEdge += parseInt(this.table.modules.frozenColumns.leftMargin);\r\n\t\t\t\trightEdge -= parseInt(this.table.modules.frozenColumns.rightMargin);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.options.renderHorizontal === \"virtual\"){\r\n\t\t\t\tleftEdge -= parseInt(this.table.columnManager.renderer.vDomPadLeft);\r\n\t\t\t\trightEdge -= parseInt(this.table.columnManager.renderer.vDomPadLeft);\r\n\t\t\t}\r\n\r\n\t\t\tif(cellEl.offsetLeft < leftEdge){\r\n\r\n\t\t\t\tthis.table.rowManager.element.scrollLeft -= (leftEdge - cellEl.offsetLeft);\r\n\t\t\t}else{\r\n\t\t\t\tif(cellEl.offsetLeft + cellEl.offsetWidth > rightEdge){\r\n\t\t\t\t\tthis.table.rowManager.element.scrollLeft += (cellEl.offsetLeft + cellEl.offsetWidth - rightEdge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tedit(cell, e, forceEdit){\r\n\t\tvar self = this,\r\n\t\tallowEdit = true,\r\n\t\trendered = function(){},\r\n\t\telement = cell.getElement(),\r\n\t\tcellEditor, component, params;\r\n\r\n\t\t//prevent editing if another cell is refusing to leave focus (eg. validation fail)\r\n\t\tif(this.currentCell){\r\n\t\t\tif(!this.invalidEdit){\r\n\t\t\t\tthis.cancelEdit();\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//handle successful value change\r\n\t\tfunction success(value){\r\n\t\t\tif(self.currentCell === cell){\r\n\t\t\t\tvar valid = self.chain(\"edit-success\", [cell, value], true, true);\r\n\r\n\t\t\t\tif(valid === true || self.table.options.validationMode === \"highlight\"){\r\n\t\t\t\t\tself.clearEditor();\r\n\r\n\r\n\t\t\t\t\tif(!cell.modules.edit){\r\n\t\t\t\t\t\tcell.modules.edit = {};\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tcell.modules.edit.edited = true;\r\n\r\n\t\t\t\t\tif(self.editedCells.indexOf(cell) == -1){\r\n\t\t\t\t\t\tself.editedCells.push(cell);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tcell.setValue(value, true);\r\n\r\n\t\t\t\t\treturn valid === true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself.invalidEdit = true;\r\n\t\t\t\t\tself.focusCellNoEvent(cell, true);\r\n\t\t\t\t\trendered();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t// console.warn(\"Edit Success Error - cannot call success on a cell that is no longer being edited\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//handle aborted edit\r\n\t\tfunction cancel(){\r\n\t\t\tif(self.currentCell === cell){\r\n\t\t\t\tself.cancelEdit();\r\n\t\t\t}else{\r\n\t\t\t\t// console.warn(\"Edit Success Error - cannot call cancel on a cell that is no longer being edited\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\trendered = callback;\r\n\t\t}\r\n\r\n\t\tif(!cell.column.modules.edit.blocked){\r\n\t\t\tif(e){\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t}\r\n\r\n\t\t\tswitch(typeof cell.column.modules.edit.check){\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tallowEdit = cell.column.modules.edit.check(cell.getComponent());\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\tallowEdit = cell.column.modules.edit.check;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(allowEdit || forceEdit){\r\n\r\n\t\t\t\tself.cancelEdit();\r\n\r\n\t\t\t\tself.currentCell = cell;\r\n\r\n\t\t\t\tthis.focusScrollAdjust(cell);\r\n\r\n\t\t\t\tcomponent = cell.getComponent();\r\n\r\n\t\t\t\tif(this.mouseClick){\r\n\t\t\t\t\tthis.mouseClick = false;\r\n\r\n\t\t\t\t\tif(cell.column.definition.cellClick){\r\n\t\t\t\t\t\tcell.column.definition.cellClick.call(this.table, e, component);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(cell.column.definition.cellEditing){\r\n\t\t\t\t\tcell.column.definition.cellEditing.call(this.table, component);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.dispatch(\"cell-editing\", cell);\r\n\t\t\t\tthis.dispatchExternal(\"cellEditing\", component);\r\n\r\n\t\t\t\tparams = typeof cell.column.modules.edit.params === \"function\" ? cell.column.modules.edit.params(component) : cell.column.modules.edit.params;\r\n\r\n\t\t\t\tcellEditor = cell.column.modules.edit.editor.call(self, component, onRendered, success, cancel, params);\r\n\r\n\t\t\t\t//if editor returned, add to DOM, if false, abort edit\r\n\t\t\t\tif(cellEditor !== false){\r\n\r\n\t\t\t\t\tif(cellEditor instanceof Node){\r\n\t\t\t\t\t\telement.classList.add(\"tabulator-editing\");\r\n\t\t\t\t\t\tcell.row.getElement().classList.add(\"tabulator-row-editing\");\r\n\t\t\t\t\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\t\t\t\t\telement.appendChild(cellEditor);\r\n\r\n\t\t\t\t\t\t//trigger onRendered Callback\r\n\t\t\t\t\t\trendered();\r\n\r\n\t\t\t\t\t\t//prevent editing from triggering rowClick event\r\n\t\t\t\t\t\tvar children = element.children;\r\n\r\n\t\t\t\t\t\tfor (var i = 0; i < children.length; i++) {\r\n\t\t\t\t\t\t\tchildren[i].addEventListener(\"click\", function(e){\r\n\t\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Edit Error - Editor should return an instance of Node, the editor returned:\", cellEditor);\r\n\t\t\t\t\t\telement.blur();\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.blur();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tthis.mouseClick = false;\r\n\t\t\t\telement.blur();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.mouseClick = false;\r\n\t\t\telement.blur();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tgetEditedCells(){\r\n\t\tvar output = [];\r\n\r\n\t\tthis.editedCells.forEach((cell) => {\r\n\t\t\toutput.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tclearEdited(cell){\r\n\t\tvar editIndex;\r\n\r\n\t\tif(cell.modules.edit && cell.modules.edit.edited){\r\n\t\t\tcell.modules.edit.edited = false;\r\n\r\n\t\t\tthis.dispatch(\"edit-edited-clear\", cell);\r\n\t\t}\r\n\r\n\t\teditIndex = this.editedCells.indexOf(cell);\r\n\r\n\t\tif(editIndex > -1){\r\n\t\t\tthis.editedCells.splice(editIndex, 1);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nEdit.moduleName = \"edit\";\r\n\r\n//load defaults\r\nEdit.editors = defaultEditors;\r\n\r\n\r\nexport default Edit;\r\n","class ExportRow{\r\n\tconstructor(type, columns, component, indent){\r\n\t\tthis.type = type;\r\n\t\tthis.columns = columns;\r\n\t\tthis.component = component || false;\r\n\t\tthis.indent = indent || 0;\r\n\t}\r\n}\r\n\r\nexport default ExportRow;","class ExportColumn{\r\n\tconstructor(value, component, width, height, depth){\r\n\t\tthis.value = value;\r\n\t\tthis.component = component || false;\r\n\t\tthis.width = width;\r\n\t\tthis.height = height;\r\n\t\tthis.depth = depth;\r\n\t}\r\n}\r\n\r\nexport default ExportColumn;","import Module from '../../core/Module.js';\r\n\r\nimport ExportRow from './ExportRow.js';\r\nimport ExportColumn from './ExportColumn.js';\r\n\r\nclass Export extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.config = {};\r\n\t\tthis.cloneTableStyle = true;\r\n\t\tthis.colVisProp = \"\";\r\n\r\n\t\tthis.registerTableOption(\"htmlOutputConfig\", false); //html outypu config\r\n\r\n\t\tthis.registerColumnOption(\"htmlOutput\");\r\n\t\tthis.registerColumnOption(\"titleHtmlOutput\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"getHtml\", this.getHtml.bind(this));\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tgenerateExportList(config, style, range, colVisProp){\r\n\t\tthis.cloneTableStyle = style;\r\n\t\tthis.config = config || {};\r\n\t\tthis.colVisProp = colVisProp;\r\n\r\n\t\tvar headers = this.config.columnHeaders !== false ? this.headersToExportRows(this.generateColumnGroupHeaders()) : [];\r\n\t\tvar body = this.bodyToExportRows(this.rowLookup(range));\r\n\r\n\t\treturn headers.concat(body);\r\n\t}\r\n\r\n\tgenereateTable(config, style, range, colVisProp){\r\n\t\tvar list = this.generateExportList(config, style, range, colVisProp);\r\n\r\n\t\treturn this.genereateTableElement(list);\r\n\t}\r\n\r\n\trowLookup(range){\r\n\t\tvar rows = [];\r\n\r\n\t\tif(typeof range == \"function\"){\r\n\t\t\trange.call(this.table).forEach((row) =>{\r\n\t\t\t\trow = this.table.rowManager.findRow(row);\r\n\r\n\t\t\t\tif(row){\r\n\t\t\t\t\trows.push(row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tswitch(range){\r\n\t\t\t\tcase true:\r\n\t\t\t\tcase \"visible\":\r\n\t\t\t\trows = this.table.rowManager.getVisibleRows(false, true);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"all\":\r\n\t\t\t\trows = this.table.rowManager.rows;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"selected\":\r\n\t\t\t\trows = this.table.modules.selectRow.selectedRows;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"active\":\r\n\t\t\t\tdefault:\r\n\t\t\t\tif(this.table.options.pagination){\r\n\t\t\t\t\trows = this.table.rowManager.getDisplayRows(this.table.rowManager.displayRows.length - 2);\r\n\t\t\t\t}else{\r\n\t\t\t\t\trows = this.table.rowManager.getDisplayRows();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Object.assign([], rows);\r\n\t}\r\n\r\n\tgenerateColumnGroupHeaders(){\r\n\t\tvar output = [];\r\n\r\n\t\tvar columns = this.config.columnGroups !== false ? this.table.columnManager.columns : this.table.columnManager.columnsByIndex;\r\n\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\tvar colData = this.processColumnGroup(column);\r\n\r\n\t\t\tif(colData){\r\n\t\t\t\toutput.push(colData);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tprocessColumnGroup(column){\r\n\t\tvar subGroups = column.columns,\r\n\t\tmaxDepth = 0,\r\n\t\ttitle = column.definition[\"title\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))] || column.definition.title;\r\n\r\n\t\tvar groupData = {\r\n\t\t\ttitle:title,\r\n\t\t\tcolumn:column,\r\n\t\t\tdepth:1,\r\n\t\t};\r\n\r\n\t\tif(subGroups.length){\r\n\t\t\tgroupData.subGroups = [];\r\n\t\t\tgroupData.width = 0;\r\n\r\n\t\t\tsubGroups.forEach((subGroup) => {\r\n\t\t\t\tvar subGroupData = this.processColumnGroup(subGroup);\r\n\r\n\t\t\t\tif(subGroupData){\r\n\t\t\t\t\tgroupData.width += subGroupData.width;\r\n\t\t\t\t\tgroupData.subGroups.push(subGroupData);\r\n\r\n\t\t\t\t\tif(subGroupData.depth > maxDepth){\r\n\t\t\t\t\t\tmaxDepth = subGroupData.depth;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tgroupData.depth += maxDepth;\r\n\r\n\t\t\tif(!groupData.width){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.columnVisCheck(column)){\r\n\t\t\t\tgroupData.width = 1;\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn groupData;\r\n\t}\r\n\r\n\tcolumnVisCheck(column){\r\n\t\treturn column.definition[this.colVisProp] !== false && (column.visible || (!column.visible && column.definition[this.colVisProp]));\r\n\t}\r\n\r\n\theadersToExportRows(columns){\r\n\t\tvar headers = [],\r\n\t\theaderDepth = 0,\r\n\t\texportRows = [];\r\n\r\n\t\tfunction parseColumnGroup(column, level){\r\n\r\n\t\t\tvar depth = headerDepth - level;\r\n\r\n\t\t\tif(typeof headers[level] === \"undefined\"){\r\n\t\t\t\theaders[level] = [];\r\n\t\t\t}\r\n\r\n\t\t\tcolumn.height = column.subGroups ? 1 : (depth - column.depth) + 1;\r\n\r\n\t\t\theaders[level].push(column);\r\n\r\n\t\t\tif(column.height > 1){\r\n\t\t\t\tfor(let i = 1; i < column.height; i ++){\r\n\r\n\t\t\t\t\tif(typeof headers[level + i] === \"undefined\"){\r\n\t\t\t\t\t\theaders[level + i] = [];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\theaders[level + i].push(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(column.width > 1){\r\n\t\t\t\tfor(let i = 1; i < column.width; i ++){\r\n\t\t\t\t\theaders[level].push(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(column.subGroups){\r\n\t\t\t\tcolumn.subGroups.forEach(function(subGroup){\r\n\t\t\t\t\tparseColumnGroup(subGroup, level+1);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//calculate maximum header debth\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tif(column.depth > headerDepth){\r\n\t\t\t\theaderDepth = column.depth;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tparseColumnGroup(column,0);\r\n\t\t});\r\n\r\n\t\theaders.forEach((header) => {\r\n\t\t\tvar columns = [];\r\n\r\n\t\t\theader.forEach((col) => {\r\n\t\t\t\tif(col){\r\n\t\t\t\t\tlet title = typeof col.title === \"undefined\" ? \"\" : col.title;\r\n\t\t\t\t\tcolumns.push(new ExportColumn(title, col.column.getComponent(), col.width, col.height, col.depth));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolumns.push(null);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\texportRows.push(new ExportRow(\"header\", columns));\r\n\t\t});\r\n\r\n\t\treturn exportRows;\r\n\t}\r\n\r\n\tbodyToExportRows(rows){\r\n\r\n\t\tvar columns = [];\r\n\t\tvar exportRows = [];\r\n\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tif (this.columnVisCheck(column)) {\r\n\t\t\t\tcolumns.push(column.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(this.config.columnCalcs !== false && this.table.modExists(\"columnCalcs\")){\r\n\t\t\tif(this.table.modules.columnCalcs.topInitialized){\r\n\t\t\t\trows.unshift(this.table.modules.columnCalcs.topRow);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modules.columnCalcs.botInitialized){\r\n\t\t\t\trows.push(this.table.modules.columnCalcs.botRow);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\trows = rows.filter((row) => {\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\treturn this.config.rowGroups !== false;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"calc\":\r\n\t\t\t\treturn this.config.columnCalcs !== false;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"row\":\r\n\t\t\t\treturn !(this.table.options.dataTree && this.config.dataTree === false && row.modules.dataTree.parent);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\trows.forEach((row, i) => {\r\n\t\t\tvar rowData = row.getData(this.colVisProp);\r\n\t\t\tvar exportCols = [];\r\n\t\t\tvar indent = 0;\r\n\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\tindent = row.level;\r\n\t\t\t\texportCols.push(new ExportColumn(row.key, row.getComponent(), columns.length, 1));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"calc\" :\r\n\t\t\t\tcase \"row\" :\r\n\t\t\t\tcolumns.forEach((col) => {\r\n\t\t\t\t\texportCols.push(new ExportColumn(col._column.getFieldValue(rowData), col, 1, 1));\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(this.table.options.dataTree && this.config.dataTree !== false){\r\n\t\t\t\t\tindent = row.modules.dataTree.index;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\texportRows.push(new ExportRow(row.type, exportCols, row.getComponent(), indent));\r\n\t\t});\r\n\r\n\t\treturn exportRows;\r\n\t}\r\n\r\n\tgenereateTableElement(list){\r\n\t\tvar table = document.createElement(\"table\"),\r\n\t\theaderEl = document.createElement(\"thead\"),\r\n\t\tbodyEl = document.createElement(\"tbody\"),\r\n\t\tstyles = this.lookupTableStyles(),\r\n\t\trowFormatter = this.table.options[\"rowFormatter\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))],\r\n\t\tsetup = {};\r\n\r\n\t\tsetup.rowFormatter = rowFormatter !== null ? rowFormatter : this.table.options.rowFormatter;\r\n\r\n\t\tif(this.table.options.dataTree &&this.config.dataTree !== false && this.table.modExists(\"columnCalcs\")){\r\n\t\t\tsetup.treeElementField = this.table.modules.dataTree.elementField;\r\n\t\t}\r\n\r\n\t\t//assign group header formatter\r\n\t\tsetup.groupHeader = this.table.options[\"groupHeader\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))];\r\n\r\n\t\tif(setup.groupHeader && !Array.isArray(setup.groupHeader)){\r\n\t\t\tsetup.groupHeader = [setup.groupHeader];\r\n\t\t}\r\n\r\n\t\ttable.classList.add(\"tabulator-print-table\");\r\n\r\n\t\tthis.mapElementStyles(this.table.columnManager.getHeadersElement(), headerEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"background-color\", \"color\", \"font-weight\", \"font-family\", \"font-size\"]);\r\n\r\n\r\n\t\tif(list.length > 1000){\r\n\t\t\tconsole.warn(\"It may take a long time to render an HTML table with more than 1000 rows\");\r\n\t\t}\r\n\r\n\t\tlist.forEach((row, i) => {\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"header\":\r\n\t\t\t\theaderEl.appendChild(this.genereateHeaderElement(row, setup, styles));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\tbodyEl.appendChild(this.genereateGroupElement(row, setup, styles));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"calc\":\r\n\t\t\t\tbodyEl.appendChild(this.genereateCalcElement(row, setup, styles));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"row\":\r\n\t\t\t\tlet rowEl = this.genereateRowElement(row, setup, styles);\r\n\t\t\t\tthis.mapElementStyles(((i % 2) && styles.evenRow) ? styles.evenRow : styles.oddRow, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\t\t\t\tbodyEl.appendChild(rowEl);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(headerEl.innerHTML){\r\n\t\t\ttable.appendChild(headerEl);\r\n\t\t}\r\n\r\n\t\ttable.appendChild(bodyEl);\r\n\r\n\r\n\t\tthis.mapElementStyles(this.table.element, table, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\"]);\r\n\t\treturn table;\r\n\t}\r\n\r\n\tlookupTableStyles(){\r\n\t\tvar styles = {};\r\n\r\n\t\t//lookup row styles\r\n\t\tif(this.cloneTableStyle && window.getComputedStyle){\r\n\t\t\tstyles.oddRow = this.table.element.querySelector(\".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.evenRow = this.table.element.querySelector(\".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.calcRow = this.table.element.querySelector(\".tabulator-row.tabulator-calcs\");\r\n\t\t\tstyles.firstRow = this.table.element.querySelector(\".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.firstGroup = this.table.element.getElementsByClassName(\"tabulator-group\")[0];\r\n\r\n\t\t\tif(styles.firstRow){\r\n\t\t\t\tstyles.styleCells = styles.firstRow.getElementsByClassName(\"tabulator-cell\");\r\n\t\t\t\tstyles.firstCell = styles.styleCells[0];\r\n\t\t\t\tstyles.lastCell = styles.styleCells[styles.styleCells.length - 1];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn styles;\r\n\t}\r\n\r\n\tgenereateHeaderElement(row, setup, styles){\r\n\t\tvar rowEl = document.createElement(\"tr\");\r\n\r\n\t\trow.columns.forEach((column) => {\r\n\t\t\tif(column){\r\n\t\t\t\tvar cellEl = document.createElement(\"th\");\r\n\t\t\t\tvar classNames = column.component._column.definition.cssClass ? column.component._column.definition.cssClass.split(\" \") : [];\r\n\r\n\t\t\t\tcellEl.colSpan = column.width;\r\n\t\t\t\tcellEl.rowSpan = column.height;\r\n\r\n\t\t\t\tcellEl.innerHTML = column.value;\r\n\r\n\t\t\t\tif(this.cloneTableStyle){\r\n\t\t\t\t\tcellEl.style.boxSizing = \"border-box\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\tclassNames.forEach(function(className) {\r\n\t\t\t\t\tcellEl.classList.add(className);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.mapElementStyles(column.component.getElement(), cellEl, [\"text-align\", \"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"background-color\", \"color\", \"font-weight\", \"font-family\", \"font-size\"]);\r\n\t\t\t\tthis.mapElementStyles(column.component._column.contentElement, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\"]);\r\n\r\n\t\t\t\tif(column.component._column.visible){\r\n\t\t\t\t\tthis.mapElementStyles(column.component.getElement(), cellEl, [\"width\"]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(column.component._column.definition.width){\r\n\t\t\t\t\t\tcellEl.style.width = column.component._column.definition.width + \"px\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(column.component._column.parent){\r\n\t\t\t\t\tthis.mapElementStyles(column.component._column.parent.groupElement, cellEl, [\"border-top\"]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowEl.appendChild(cellEl);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenereateGroupElement(row, setup, styles){\r\n\r\n\t\tvar rowEl = document.createElement(\"tr\"),\r\n\t\tcellEl = document.createElement(\"td\"),\r\n\t\tgroup = row.columns[0];\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-row\");\r\n\r\n\t\tif(setup.groupHeader && setup.groupHeader[row.indent]){\r\n\t\t\tgroup.value = setup.groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t}else{\r\n\t\t\tif(setup.groupHeader === false){\r\n\t\t\t\tgroup.value = group.value;\r\n\t\t\t}else{\r\n\t\t\t\tgroup.value = row.component._group.generator(group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcellEl.colSpan = group.width;\r\n\t\tcellEl.innerHTML = group.value;\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-group\");\r\n\t\trowEl.classList.add(\"tabulator-group-level-\" + row.indent);\r\n\r\n\t\tif(group.component.isVisible()){\r\n\t\t\trowEl.classList.add(\"tabulator-group-visible\");\r\n\t\t}\r\n\r\n\t\tthis.mapElementStyles(styles.firstGroup, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\t\tthis.mapElementStyles(styles.firstGroup, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\"]);\r\n\r\n\t\trowEl.appendChild(cellEl);\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenereateCalcElement(row, setup, styles){\r\n\t\tvar rowEl = this.genereateRowElement(row, setup, styles);\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-calcs\");\r\n\t\tthis.mapElementStyles(styles.calcRow, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenereateRowElement(row, setup, styles){\r\n\t\tvar rowEl = document.createElement(\"tr\");\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-row\");\r\n\r\n\t\trow.columns.forEach((col) => {\r\n\t\t\tif(col){\r\n\t\t\t\tvar cellEl = document.createElement(\"td\"),\r\n\t\t\t\tcolumn = col.component._column,\r\n\t\t\t\tindex = this.table.columnManager.findColumnIndex(column),\r\n\t\t\t\tvalue = col.value;\r\n\r\n\t\t\t\tvar cellWrapper = {\r\n\t\t\t\t\tmodules:{},\r\n\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetField:function(){\r\n\t\t\t\t\t\treturn column.definition.field;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\treturn cellEl;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetData:function(){\r\n\t\t\t\t\t\treturn row.component.getData();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\treturn row.component;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetComponent:function(){\r\n\t\t\t\t\t\treturn cellWrapper;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tcolumn:column,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tvar classNames = column.definition.cssClass ? column.definition.cssClass.split(\" \") : [];\r\n\r\n\t\t\t\tclassNames.forEach(function(className) {\r\n\t\t\t\t\tcellEl.classList.add(className);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(this.table.modExists(\"format\") && this.config.formatCells !== false){\r\n\t\t\t\t\tvalue = this.table.modules.format.formatExportValue(cellWrapper, this.colVisProp);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\tvalue = value !== null ? JSON.stringify(value) : \"\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tvalue = value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(value instanceof Node){\r\n\t\t\t\t\tcellEl.appendChild(value);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcellEl.innerHTML = value;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(styles.styleCells[index] || styles.firstCell){\r\n\t\t\t\t\tthis.mapElementStyles(styles.styleCells[index] || styles.firstCell, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\", \"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"text-align\"]);\r\n\r\n\t\t\t\t\tif(column.definition.align){\r\n\t\t\t\t\t\tcellEl.style.textAlign = column.definition.align;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(this.table.options.dataTree && this.config.dataTree !== false){\r\n\t\t\t\t\tif((setup.treeElementField && setup.treeElementField == column.field) || (!setup.treeElementField && i == 0)){\r\n\t\t\t\t\t\tif(row.component._row.modules.dataTree.controlEl){\r\n\t\t\t\t\t\t\tcellEl.insertBefore(row.component._row.modules.dataTree.controlEl.cloneNode(true), cellEl.firstChild);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(row.component._row.modules.dataTree.branchEl){\r\n\t\t\t\t\t\t\tcellEl.insertBefore(row.component._row.modules.dataTree.branchEl.cloneNode(true), cellEl.firstChild);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowEl.appendChild(cellEl);\r\n\r\n\t\t\t\tif(cellWrapper.modules.format && cellWrapper.modules.format.renderedCallback){\r\n\t\t\t\t\tcellWrapper.modules.format.renderedCallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(setup.rowFormatter && this.config.formatCells !== false){\r\n\t\t\t\t\tsetup.rowFormatter(row.component);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenereateHTMLTable(list){\r\n\t\tvar holder = document.createElement(\"div\");\r\n\r\n\t\tholder.appendChild(this.genereateTableElement(list));\r\n\r\n\t\treturn holder.innerHTML;\r\n\t}\r\n\r\n\tgetHtml(visible, style, config, colVisProp){\r\n\t\tvar list = this.generateExportList(config || this.table.options.htmlOutputConfig, style, visible, colVisProp || \"htmlOutput\");\r\n\r\n\t\treturn this.genereateHTMLTable(list);\r\n\t}\r\n\r\n\tmapElementStyles(from, to, props){\r\n\t\tif(this.cloneTableStyle && from && to){\r\n\r\n\t\t\tvar lookup = {\r\n\t\t\t\t\"background-color\" : \"backgroundColor\",\r\n\t\t\t\t\"color\" : \"fontColor\",\r\n\t\t\t\t\"width\" : \"width\",\r\n\t\t\t\t\"font-weight\" : \"fontWeight\",\r\n\t\t\t\t\"font-family\" : \"fontFamily\",\r\n\t\t\t\t\"font-size\" : \"fontSize\",\r\n\t\t\t\t\"text-align\" : \"textAlign\",\r\n\t\t\t\t\"border-top\" : \"borderTop\",\r\n\t\t\t\t\"border-left\" : \"borderLeft\",\r\n\t\t\t\t\"border-right\" : \"borderRight\",\r\n\t\t\t\t\"border-bottom\" : \"borderBottom\",\r\n\t\t\t\t\"padding-top\" : \"paddingTop\",\r\n\t\t\t\t\"padding-left\" : \"paddingLeft\",\r\n\t\t\t\t\"padding-right\" : \"paddingRight\",\r\n\t\t\t\t\"padding-bottom\" : \"paddingBottom\",\r\n\t\t\t};\r\n\r\n\t\t\tif(window.getComputedStyle){\r\n\t\t\t\tvar fromStyle = window.getComputedStyle(from);\r\n\r\n\t\t\t\tprops.forEach(function(prop){\r\n\t\t\t\t\tto.style[lookup[prop]] = fromStyle.getPropertyValue(prop);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nExport.moduleName = \"export\";\r\n\r\nexport default Export;\r\n","export default {\r\n\r\n\t//equal to\r\n\t\"=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal == filterVal ? true : false;\r\n\t},\r\n\r\n\t//less than\r\n\t\"<\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal < filterVal ? true : false;\r\n\t},\r\n\r\n\t//less than or equal to\r\n\t\"<=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal <= filterVal ? true : false;\r\n\t},\r\n\r\n\t//greater than\r\n\t\">\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal > filterVal ? true : false;\r\n\t},\r\n\r\n\t//greater than or equal to\r\n\t\">=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal >= filterVal ? true : false;\r\n\t},\r\n\r\n\t//not equal to\r\n\t\"!=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal != filterVal ? true : false;\r\n\t},\r\n\r\n\t\"regex\":function(filterVal, rowVal, rowData, filterParams){\r\n\r\n\t\tif(typeof filterVal == \"string\"){\r\n\t\t\tfilterVal = new RegExp(filterVal);\r\n\t\t}\r\n\r\n\t\treturn filterVal.test(rowVal);\r\n\t},\r\n\r\n\t//contains the string\r\n\t\"like\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().indexOf(filterVal.toLowerCase()) > -1;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//contains the keywords\r\n\t\"keywords\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tvar keywords = filterVal.toLowerCase().split(typeof filterParams.separator === \"undefined\" ? \" \" : filterParams.separator),\r\n\t\tvalue = String(rowVal === null || typeof rowVal === \"undefined\" ? \"\" : rowVal).toLowerCase(),\r\n\t\tmatches = [];\r\n\r\n\t\tkeywords.forEach((keyword) =>{\r\n\t\t\tif(value.includes(keyword)){\r\n\t\t\t\tmatches.push(true);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn filterParams.matchAll ? matches.length === keywords.length : !!matches.length;\r\n\t},\r\n\r\n\t//starts with the string\r\n\t\"starts\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().startsWith(filterVal.toLowerCase());\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//ends with the string\r\n\t\"ends\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().endsWith(filterVal.toLowerCase());\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//in array\r\n\t\"in\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(Array.isArray(filterVal)){\r\n\t\t\treturn filterVal.length ? filterVal.indexOf(rowVal) > -1 : true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Filter Error - filter value is not an array:\", filterVal);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultFilters from './defaults/filters.js';\r\n\r\nclass Filter extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.filterList = []; //hold filter list\r\n\t\tthis.headerFilters = {}; //hold column filters\r\n\t\tthis.headerFilterColumns = []; //hold columns that use header filters\r\n\r\n\t\tthis.prevHeaderFilterChangeCheck = \"\";\r\n\t\tthis.prevHeaderFilterChangeCheck = \"{}\";\r\n\r\n\t\tthis.changed = false; //has filtering changed since last render\r\n\t\tthis.tableInitialized = false;\r\n\r\n\t\tthis.registerTableOption(\"filterMode\", \"local\"); //local or remote filtering\r\n\r\n\t\tthis.registerTableOption(\"initialFilter\", false); //initial filtering criteria\r\n\t\tthis.registerTableOption(\"initialHeaderFilter\", false); //initial header filtering criteria\r\n\t\tthis.registerTableOption(\"headerFilterLiveFilterDelay\", 300); //delay before updating column after user types in header filter\r\n\r\n\t\tthis.registerColumnOption(\"headerFilter\");\r\n\t\tthis.registerColumnOption(\"headerFilterPlaceholder\");\r\n\t\tthis.registerColumnOption(\"headerFilterParams\");\r\n\t\tthis.registerColumnOption(\"headerFilterEmptyCheck\");\r\n\t\tthis.registerColumnOption(\"headerFilterFunc\");\r\n\t\tthis.registerColumnOption(\"headerFilterFuncParams\");\r\n\t\tthis.registerColumnOption(\"headerFilterLiveFilter\");\r\n\r\n\t\tthis.registerTableFunction(\"searchRows\", this.searchRows.bind(this));\r\n\t\tthis.registerTableFunction(\"searchData\", this.searchData.bind(this));\r\n\r\n\t\tthis.registerTableFunction(\"setFilter\", this.userSetFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"refreshFilter\", this.userRefreshFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"addFilter\", this.userAddFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"getFilters\", this.getFilters.bind(this));\r\n\t\tthis.registerTableFunction(\"setHeaderFilterFocus\", this.userSetHeaderFilterFocus.bind(this));\r\n\t\tthis.registerTableFunction(\"getHeaderFilterValue\", this.userGetHeaderFilterValue.bind(this));\r\n\t\tthis.registerTableFunction(\"setHeaderFilterValue\", this.userSetHeaderFilterValue.bind(this));\r\n\t\tthis.registerTableFunction(\"getHeaderFilters\", this.getHeaderFilters.bind(this));\r\n\t\tthis.registerTableFunction(\"removeFilter\", this.userRemoveFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"clearFilter\", this.userClearFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"clearHeaderFilter\", this.userClearHeaderFilter.bind(this));\r\n\r\n\t\tthis.registerComponentFunction(\"column\", \"headerFilterFocus\", this.setHeaderFilterFocus.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"reloadHeaderFilter\", this.reloadHeaderFilter.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"getHeaderFilterValue\", this.getHeaderFilterValue.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"setHeaderFilterValue\", this.setHeaderFilterValue.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumnHeaderFilter.bind(this));\r\n\t\tthis.subscribe(\"column-width-fit-before\", this.hideHeaderFilterElements.bind(this));\r\n\t\tthis.subscribe(\"column-width-fit-after\", this.showHeaderFilterElements.bind(this));\r\n\t\tthis.subscribe(\"table-built\", this.tableBuilt.bind(this));\r\n\r\n\t\tif(this.table.options.filterMode === \"remote\"){\r\n\t\t\tthis.subscribe(\"data-params\", this.remoteFilterParams.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerDataHandler(this.filter.bind(this), 10);\r\n\t}\r\n\r\n\ttableBuilt(){\r\n\t\tif(this.table.options.initialFilter){\r\n\t\t\tthis.setFilter(this.table.options.initialFilter);\r\n\t\t}\r\n\r\n\t\tif(this.table.options.initialHeaderFilter){\r\n\t\t\tthis.table.options.initialHeaderFilter.forEach((item) => {\r\n\r\n\t\t\t\tvar column = this.table.columnManager.findColumn(item.field);\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tthis.setHeaderFilterValue(column, item.value);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", item.field);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.tableInitialized = true;\r\n\t}\r\n\r\n\tremoteFilterParams(data, config, silent, params){\r\n\t\tparams.filter = this.getFilters(true, true);\r\n\t\treturn params;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\t//set standard filters\r\n\tuserSetFilter(field, type, value, params){\r\n\t\tthis.setFilter(field, type, value, params);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//set standard filters\r\n\tuserRefreshFilter(){\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//add filter to array\r\n\tuserAddFilter(field, type, value, params){\r\n\t\tthis.addFilter(field, type, value, params);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\tuserSetHeaderFilterFocus(field){\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\tthis.setHeaderFilterFocus(column);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Focus Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tuserGetHeaderFilterValue(field) {\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\treturn this.getHeaderFilterValue(column);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", field);\r\n\t\t}\r\n\t}\r\n\r\n\tuserSetHeaderFilterValue(field, value){\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\tthis.setHeaderFilterValue(column, value);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//remove filter from array\r\n\tuserRemoveFilter(field, type, value){\r\n\t\tthis.removeFilter(field, type, value);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//clear filters\r\n\tuserClearFilter(all){\r\n\t\tthis.clearFilter(all);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//clear header filters\r\n\tuserClearHeaderFilter(){\r\n\t\tthis.clearHeaderFilter();\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\r\n\t//search for specific row components\r\n\tsearchRows(field, type, value){\r\n\t\treturn this.search(\"rows\", field, type, value);\r\n\t}\r\n\r\n\t//search for specific data\r\n\tsearchData(field, type, value){\r\n\t\treturn this.search(\"data\", field, type, value);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tinitializeColumnHeaderFilter(column){\r\n\t\tvar def = column.definition;\r\n\r\n\t\tif(def.headerFilter){\r\n\r\n\t\t\tif(typeof def.headerFilterPlaceholder !== \"undefined\" && def.field){\r\n\t\t\t\tthis.module(\"localize\").setHeaderFilterColumnPlaceholder(def.field, def.headerFilterPlaceholder);\r\n\t\t\t}\r\n\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\r\n\t//initialize column header filter\r\n\tinitializeColumn(column, value){\r\n\t\tvar self = this,\r\n\t\tfield = column.getField(),\r\n\t\tparams;\r\n\r\n\t\t//handle successfull value change\r\n\t\tfunction success(value){\r\n\t\t\tvar filterType = (column.modules.filter.tagType == \"input\" && column.modules.filter.attrType == \"text\") || column.modules.filter.tagType == \"textarea\" ? \"partial\" : \"match\",\r\n\t\t\ttype = \"\",\r\n\t\t\tfilterChangeCheck = \"\",\r\n\t\t\tfilterFunc;\r\n\r\n\t\t\tif(typeof column.modules.filter.prevSuccess === \"undefined\" || column.modules.filter.prevSuccess !== value){\r\n\r\n\t\t\t\tcolumn.modules.filter.prevSuccess = value;\r\n\r\n\t\t\t\tif(!column.modules.filter.emptyFunc(value)){\r\n\t\t\t\t\tcolumn.modules.filter.value = value;\r\n\r\n\t\t\t\t\tswitch(typeof column.definition.headerFilterFunc){\r\n\t\t\t\t\t\tcase \"string\":\r\n\t\t\t\t\t\tif(Filter.filters[column.definition.headerFilterFunc]){\r\n\t\t\t\t\t\t\ttype = column.definition.headerFilterFunc;\r\n\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\tvar params = column.definition.headerFilterFuncParams || {};\r\n\t\t\t\t\t\t\t\tvar fieldVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\t\tparams = typeof params === \"function\" ? params(value, fieldVal, data) : params;\r\n\r\n\t\t\t\t\t\t\t\treturn Filter.filters[column.definition.headerFilterFunc](value, fieldVal, data, params);\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tconsole.warn(\"Header Filter Error - Matching filter function not found: \", column.definition.headerFilterFunc);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"function\":\r\n\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\tvar params = column.definition.headerFilterFuncParams || {};\r\n\t\t\t\t\t\t\tvar fieldVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\tparams = typeof params === \"function\" ? params(value, fieldVal, data) : params;\r\n\r\n\t\t\t\t\t\t\treturn column.definition.headerFilterFunc(value, fieldVal, data, params);\r\n\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\ttype = filterFunc;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(!filterFunc){\r\n\t\t\t\t\t\tswitch(filterType){\r\n\t\t\t\t\t\t\tcase \"partial\":\r\n\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\tvar colVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\t\tif(typeof colVal !== 'undefined' && colVal !== null){\r\n\t\t\t\t\t\t\t\t\treturn String(colVal).toLowerCase().indexOf(String(value).toLowerCase()) > -1;\r\n\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\ttype = \"like\";\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\treturn column.getFieldValue(data) == value;\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\ttype = \"=\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tself.headerFilters[field] = {value:value, func:filterFunc, type:type, params:params || {}};\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdelete self.headerFilters[field];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcolumn.modules.filter.value = value;\r\n\r\n\t\t\t\tfilterChangeCheck = JSON.stringify(self.headerFilters);\r\n\r\n\t\t\t\tif(self.prevHeaderFilterChangeCheck !== filterChangeCheck){\r\n\t\t\t\t\tself.prevHeaderFilterChangeCheck = filterChangeCheck;\r\n\r\n\t\t\t\t\tself.trackChanges();\r\n\t\t\t\t\tself.refreshFilter();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tcolumn.modules.filter = {\r\n\t\t\tsuccess:success,\r\n\t\t\tattrType:false,\r\n\t\t\ttagType:false,\r\n\t\t\temptyFunc:false,\r\n\t\t};\r\n\r\n\t\tthis.generateHeaderFilterElement(column);\r\n\t}\r\n\r\n\tgenerateHeaderFilterElement(column, initialValue, reinitialize){\r\n\t\tvar self = this,\r\n\t\tsuccess = column.modules.filter.success,\r\n\t\tfield = column.getField(),\r\n\t\tfilterElement, editor, editorElement, cellWrapper, typingTimer, searchTrigger, params;\r\n\r\n\t\tcolumn.modules.filter.value = initialValue;\r\n\r\n\t\t//handle aborted edit\r\n\t\tfunction cancel(){}\r\n\r\n\t\tif(column.modules.filter.headerElement && column.modules.filter.headerElement.parentNode){\r\n\t\t\tcolumn.contentElement.removeChild(column.modules.filter.headerElement.parentNode);\r\n\t\t}\r\n\r\n\t\tif(field){\r\n\r\n\t\t\t//set empty value function\r\n\t\t\tcolumn.modules.filter.emptyFunc = column.definition.headerFilterEmptyCheck || function(value){\r\n\t\t\t\treturn !value && value !== \"0\" && value !== 0;\r\n\t\t\t};\r\n\r\n\t\t\tfilterElement = document.createElement(\"div\");\r\n\t\t\tfilterElement.classList.add(\"tabulator-header-filter\");\r\n\r\n\t\t\t//set column editor\r\n\t\t\tswitch(typeof column.definition.headerFilter){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tif(self.table.modules.edit.editors[column.definition.headerFilter]){\r\n\t\t\t\t\teditor = self.table.modules.edit.editors[column.definition.headerFilter];\r\n\r\n\t\t\t\t\tif((column.definition.headerFilter === \"tick\" || column.definition.headerFilter === \"tickCross\") && !column.definition.headerFilterEmptyCheck){\r\n\t\t\t\t\t\tcolumn.modules.filter.emptyFunc = function(value){\r\n\t\t\t\t\t\t\treturn value !== true && value !== false;\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Filter Error - Cannot build header filter, No such editor found: \", column.definition.editor);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\teditor = column.definition.headerFilter;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\tif(column.modules.edit && column.modules.edit.editor){\r\n\t\t\t\t\teditor = column.modules.edit.editor;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(column.definition.formatter && self.table.modules.edit.editors[column.definition.formatter]){\r\n\t\t\t\t\t\teditor = self.table.modules.edit.editors[column.definition.formatter];\r\n\r\n\t\t\t\t\t\tif((column.definition.formatter === \"tick\" || column.definition.formatter === \"tickCross\") && !column.definition.headerFilterEmptyCheck){\r\n\t\t\t\t\t\t\tcolumn.modules.filter.emptyFunc = function(value){\r\n\t\t\t\t\t\t\t\treturn value !== true && value !== false;\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\teditor = self.table.modules.edit.editors[\"input\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(editor){\r\n\r\n\t\t\t\tcellWrapper = {\r\n\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\treturn typeof initialValue !== \"undefined\" ? initialValue : \"\";\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetField:function(){\r\n\t\t\t\t\t\treturn column.definition.field;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\treturn filterElement;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tnormalizeHeight:function(){\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\r\n\t\t\t\tparams = column.definition.headerFilterParams || {};\r\n\r\n\t\t\t\tparams = typeof params === \"function\" ? params.call(self.table, cellWrapper) : params;\r\n\r\n\t\t\t\teditorElement = editor.call(this.table.modules.edit, cellWrapper, function(){}, success, cancel, params);\r\n\r\n\t\t\t\tif(!editorElement){\r\n\t\t\t\t\tconsole.warn(\"Filter Error - Cannot add filter to \" + field + \" column, editor returned a value of false\");\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!(editorElement instanceof Node)){\r\n\t\t\t\t\tconsole.warn(\"Filter Error - Cannot add filter to \" + field + \" column, editor should return an instance of Node, the editor returned:\", editorElement);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//set Placeholder Text\r\n\t\t\t\tif(field){\r\n\t\t\t\t\tself.langBind(\"headerFilters|columns|\" + column.definition.field, function(value){\r\n\t\t\t\t\t\teditorElement.setAttribute(\"placeholder\", typeof value !== \"undefined\" && value ? value : self.langText(\"headerFilters|default\"));\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself.langBind(\"headerFilters|default\", function(value){\r\n\t\t\t\t\t\teditorElement.setAttribute(\"placeholder\", value);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//focus on element on click\r\n\t\t\t\teditorElement.addEventListener(\"click\", function(e){\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\teditorElement.focus();\r\n\t\t\t\t});\r\n\r\n\t\t\t\teditorElement.addEventListener(\"focus\", (e) => {\r\n\t\t\t\t\tvar left = this.table.columnManager.element.scrollLeft;\r\n\r\n\t\t\t\t\tvar headerPos = this.table.rowManager.element.scrollLeft + parseInt(this.table.columnManager.element.style.marginLeft);\r\n\r\n\t\t\t\t\tif(left !== headerPos){\r\n\t\t\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\t\t\tthis.table.columnManager.scrollHorizontal(left);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\t//live update filters as user types\r\n\t\t\t\ttypingTimer = false;\r\n\r\n\t\t\t\tsearchTrigger = function(e){\r\n\t\t\t\t\tif(typingTimer){\r\n\t\t\t\t\t\tclearTimeout(typingTimer);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\ttypingTimer = setTimeout(function(){\r\n\t\t\t\t\t\tsuccess(editorElement.value);\r\n\t\t\t\t\t},self.table.options.headerFilterLiveFilterDelay);\r\n\t\t\t\t};\r\n\r\n\t\t\t\tcolumn.modules.filter.headerElement = editorElement;\r\n\t\t\t\tcolumn.modules.filter.attrType = editorElement.hasAttribute(\"type\") ? editorElement.getAttribute(\"type\").toLowerCase() : \"\" ;\r\n\t\t\t\tcolumn.modules.filter.tagType = editorElement.tagName.toLowerCase();\r\n\r\n\t\t\t\tif(column.definition.headerFilterLiveFilter !== false){\r\n\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\t!(\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === 'autocomplete' ||\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === 'tickCross' ||\r\n\t\t\t\t\t\t\t((column.definition.editor === 'autocomplete' ||\r\n\t\t\t\t\t\t\t\tcolumn.definition.editor === 'tickCross') &&\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === true)\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t) {\r\n\t\t\t\t\t\teditorElement.addEventListener(\"keyup\", searchTrigger);\r\n\t\t\t\t\teditorElement.addEventListener(\"search\", searchTrigger);\r\n\r\n\r\n\t\t\t\t\t//update number filtered columns on change\r\n\t\t\t\t\tif(column.modules.filter.attrType == \"number\"){\r\n\t\t\t\t\t\teditorElement.addEventListener(\"change\", function(e){\r\n\t\t\t\t\t\t\tsuccess(editorElement.value);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//change text inputs to search inputs to allow for clearing of field\r\n\t\t\t\t\tif(column.modules.filter.attrType == \"text\" && this.table.browser !== \"ie\"){\r\n\t\t\t\t\t\teditorElement.setAttribute(\"type\", \"search\");\r\n\t\t\t\t\t\t// editorElement.off(\"change blur\"); //prevent blur from triggering filter and preventing selection click\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t\t//prevent input and select elements from propegating click to column sorters etc\r\n\t\t\t\t\tif(column.modules.filter.tagType == \"input\" || column.modules.filter.tagType == \"select\" || column.modules.filter.tagType == \"textarea\"){\r\n\t\t\t\t\t\teditorElement.addEventListener(\"mousedown\",function(e){\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfilterElement.appendChild(editorElement);\r\n\r\n\t\t\t\tcolumn.contentElement.appendChild(filterElement);\r\n\r\n\t\t\t\tif(!reinitialize){\r\n\t\t\t\t\tself.headerFilterColumns.push(column);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Filter Error - Cannot add header filter, column has no field set:\", column.definition.title);\r\n\t\t}\r\n\t}\r\n\r\n\t//hide all header filter elements (used to ensure correct column widths in \"fitData\" layout mode)\r\n\thideHeaderFilterElements(){\r\n\t\tthis.headerFilterColumns.forEach(function(column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tcolumn.modules.filter.headerElement.style.display = 'none';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//show all header filter elements (used to ensure correct column widths in \"fitData\" layout mode)\r\n\tshowHeaderFilterElements(){\r\n\t\tthis.headerFilterColumns.forEach(function(column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tcolumn.modules.filter.headerElement.style.display = '';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//programatically set focus of header filter\r\n\tsetHeaderFilterFocus(column){\r\n\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\tcolumn.modules.filter.headerElement.focus();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Focus Error - No header filter set on column:\", column.getField());\r\n\t\t}\r\n\t}\r\n\r\n\t//programmatically get value of header filter\r\n\tgetHeaderFilterValue(column){\r\n\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\treturn column.modules.filter.value;\r\n\t\t} else {\r\n\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t}\r\n\t}\r\n\r\n\t//programatically set value of header filter\r\n\tsetHeaderFilterValue(column, value){\r\n\t\tif (column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tthis.generateHeaderFilterElement(column, value, true);\r\n\t\t\t\tcolumn.modules.filter.success(value);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treloadHeaderFilter(column){\r\n\t\tif (column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tthis.generateHeaderFilterElement(column, column.modules.filter.value, true);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trefreshFilter(){\r\n\t\tif(this.tableInitialized){\r\n\t\t\tif(this.table.options.filterMode === \"remote\"){\r\n\t\t\t\tthis.reloadData(null, false, false);\r\n\t\t\t}else{\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//TODO - Persist left position of row manager\r\n\t\t// left = this.scrollLeft;\r\n\t\t// this.scrollHorizontal(left);\r\n\t}\r\n\r\n\t//check if the filters has changed since last use\r\n\ttrackChanges(){\r\n\t\tthis.changed = true;\r\n\t\tthis.dispatch(\"filter-changed\");\r\n\t}\r\n\r\n\t//check if the filters has changed since last use\r\n\thasChanged(){\r\n\t\tvar changed = this.changed;\r\n\t\tthis.changed = false;\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t//set standard filters\r\n\tsetFilter(field, type, value, params){\r\n\t\tthis.filterList = [];\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value, params:params}];\r\n\t\t}\r\n\r\n\t\tthis.addFilter(field);\r\n\t}\r\n\r\n\t//add filter to array\r\n\taddFilter(field, type, value, params){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value, params:params}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\tthis.filterList.push(filter);\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.trackChanges();\r\n\t\t}\r\n\t}\r\n\r\n\tfindFilter(filter){\r\n\t\tvar column;\r\n\r\n\t\tif(Array.isArray(filter)){\r\n\t\t\treturn this.findSubFilters(filter);\r\n\t\t}\r\n\r\n\t\tvar filterFunc = false;\r\n\r\n\t\tif(typeof filter.field == \"function\"){\r\n\t\t\tfilterFunc = function(data){\r\n\t\t\t\treturn filter.field(data, filter.type || {})// pass params to custom filter function\r\n\t\t\t};\r\n\t\t}else{\r\n\r\n\t\t\tif(Filter.filters[filter.type]){\r\n\r\n\t\t\t\tcolumn = this.table.columnManager.getColumnByField(filter.field);\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\treturn Filter.filters[filter.type](filter.value, column.getFieldValue(data), data, filter.params || {});\r\n\t\t\t\t\t};\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\treturn Filter.filters[filter.type](filter.value, data[filter.field], data, filter.params || {});\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Filter Error - No such filter type found, ignoring: \", filter.type);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfilter.func = filterFunc;\r\n\r\n\t\treturn filter.func ? filter : false;\r\n\t}\r\n\r\n\tfindSubFilters(filters){\r\n\t\tvar output = [];\r\n\r\n\t\tfilters.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\toutput.push(filter);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output.length ? output : false;\r\n\t}\r\n\r\n\t//get all filters\r\n\tgetFilters(all, ajax){\r\n\t\tvar output = [];\r\n\r\n\t\tif(all){\r\n\t\t\toutput = this.getHeaderFilters();\r\n\t\t}\r\n\r\n\t\tif(ajax){\r\n\t\t\toutput.forEach(function(item){\r\n\t\t\t\tif(typeof item.type == \"function\"){\r\n\t\t\t\t\titem.type = \"function\";\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\toutput = output.concat(this.filtersToArray(this.filterList, ajax));\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//filter to Object\r\n\tfiltersToArray(filterList, ajax){\r\n\t\tvar output = [];\r\n\r\n\t\tfilterList.forEach((filter) => {\r\n\t\t\tvar item;\r\n\r\n\t\t\tif(Array.isArray(filter)){\r\n\t\t\t\toutput.push(this.filtersToArray(filter, ajax));\r\n\t\t\t}else{\r\n\t\t\t\titem = {field:filter.field, type:filter.type, value:filter.value}\r\n\r\n\t\t\t\tif(ajax){\r\n\t\t\t\t\tif(typeof item.type == \"function\"){\r\n\t\t\t\t\t\titem.type = \"function\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\toutput.push(item);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//get all filters\r\n\tgetHeaderFilters(){\r\n\t\tvar output = [];\r\n\r\n\t\tfor(var key in this.headerFilters){\r\n\t\t\toutput.push({field:key, type:this.headerFilters[key].type, value:this.headerFilters[key].value});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//remove filter from array\r\n\tremoveFilter(field, type, value){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tvar index = -1;\r\n\r\n\t\t\tif(typeof filter.field == \"object\"){\r\n\t\t\t\tindex = this.filterList.findIndex((element) => {\r\n\t\t\t\t\treturn filter === element;\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tindex = this.filterList.findIndex((element) => {\r\n\t\t\t\t\treturn filter.field === element.field && filter.type === element.type && filter.value === element.value;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.filterList.splice(index, 1);\r\n\t\t\t\tchanged = true;\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Filter Error - No matching filter type found, ignoring: \", filter.type);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//clear filters\r\n\tclearFilter(all){\r\n\t\tthis.filterList = [];\r\n\r\n\t\tif(all){\r\n\t\t\tthis.clearHeaderFilter();\r\n\t\t}\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//clear header filters\r\n\tclearHeaderFilter(){\r\n\t\tthis.headerFilters = {};\r\n\t\tthis.prevHeaderFilterChangeCheck = \"{}\";\r\n\r\n\t\tthis.headerFilterColumns.forEach((column) => {\r\n\t\t\tif(typeof column.modules.filter.value !== \"undefined\"){\r\n\t\t\t\tdelete column.modules.filter.value;\r\n\t\t\t}\r\n\t\t\tcolumn.modules.filter.prevSuccess = undefined;\r\n\t\t\tthis.reloadHeaderFilter(column);\r\n\t\t});\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//search data and return matching rows\r\n\tsearch (searchType, field, type, value){\r\n\t\tvar activeRows = [],\r\n\t\tfilterList = [];\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\tfilterList.push(filter);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\tvar match = true;\r\n\r\n\t\t\tfilterList.forEach((filter) => {\r\n\t\t\t\tif(!this.filterRecurse(filter, row.getData())){\r\n\t\t\t\t\tmatch = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tactiveRows.push(searchType === \"data\" ? row.getData(\"data\") : row.getComponent());\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t\treturn activeRows;\r\n\t}\r\n\r\n\t//filter row array\r\n\tfilter(rowList, filters){\r\n\t\tvar activeRows = [],\r\n\t\tactiveRowComponents = [];\r\n\r\n\t\tif(this.subscribedExternal(\"dataFiltering\")){\r\n\t\t\tthis.dispatchExternal(\"dataFiltering\", this.getFilters(true));\r\n\t\t}\r\n\r\n\t\tif(this.table.options.filterMode !== \"remote\" && (this.filterList.length || Object.keys(this.headerFilters).length)){\r\n\r\n\t\t\trowList.forEach((row) => {\r\n\t\t\t\tif(this.filterRow(row)){\r\n\t\t\t\t\tactiveRows.push(row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t}else{\r\n\t\t\tactiveRows = rowList.slice(0);\r\n\t\t}\r\n\r\n\t\tif(this.subscribedExternal(\"dataFiltered\")){\r\n\r\n\t\t\tactiveRows.forEach((row) => {\r\n\t\t\t\tactiveRowComponents.push(row.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatchExternal(\"dataFiltered\", this.getFilters(true), activeRowComponents);\r\n\t\t}\r\n\r\n\t\treturn activeRows;\r\n\t}\r\n\r\n\t//filter individual row\r\n\tfilterRow(row, filters){\r\n\t\tvar match = true,\r\n\t\tdata = row.getData();\r\n\r\n\t\tthis.filterList.forEach((filter) => {\r\n\t\t\tif(!this.filterRecurse(filter, data)){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\tfor(var field in this.headerFilters){\r\n\t\t\tif(!this.headerFilters[field].func(data)){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tfilterRecurse(filter, data){\r\n\t\tvar match = false;\r\n\r\n\t\tif(Array.isArray(filter)){\r\n\t\t\tfilter.forEach((subFilter) => {\r\n\t\t\t\tif(this.filterRecurse(subFilter, data)){\r\n\t\t\t\t\tmatch = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tmatch = filter.func(data);\r\n\t\t}\r\n\r\n\t\treturn match;\r\n\t}\r\n}\r\n\r\nFilter.moduleName = \"filter\";\r\n\r\n//load defaults\r\nFilter.filters = defaultFilters;\r\n\r\nexport default Filter;","export default function(cell, formatterParams, onRendered){\r\n\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n};","import plaintext from './formatters/plaintext.js';\r\nimport html from './formatters/html.js';\r\nimport textarea from './formatters/textarea.js';\r\nimport money from './formatters/money.js';\r\nimport link from './formatters/link.js';\r\nimport image from './formatters/image.js';\r\nimport tickCross from './formatters/tickCross.js';\r\nimport datetime from './formatters/datetime.js';\r\nimport datetimediff from './formatters/datetimediff.js';\r\nimport lookup from './formatters/lookup.js';\r\nimport star from './formatters/star.js';\r\nimport traffic from './formatters/traffic.js';\r\nimport progress from './formatters/progress.js';\r\nimport color from './formatters/color.js';\r\nimport buttonTick from './formatters/buttonTick.js';\r\nimport buttonCross from './formatters/buttonCross.js';\r\nimport rownum from './formatters/rownum.js';\r\nimport handle from './formatters/handle.js';\r\nimport responsiveCollapse from './formatters/responsiveCollapse.js';\r\nimport rowSelection from './formatters/rowSelection.js';\r\n\r\nexport default {\r\n\tplaintext:plaintext,\r\n\thtml:html,\r\n\ttextarea:textarea,\r\n\tmoney:money,\r\n\tlink:link,\r\n\timage:image,\r\n\ttickCross:tickCross,\r\n\tdatetime:datetime,\r\n\tdatetimediff:datetimediff,\r\n\tlookup:lookup,\r\n\tstar:star,\r\n\ttraffic:traffic,\r\n\tprogress:progress,\r\n\tcolor:color,\r\n\tbuttonTick:buttonTick,\r\n\tbuttonCross:buttonCross,\r\n\trownum:rownum,\r\n\thandle:handle,\r\n\tresponsiveCollapse:responsiveCollapse,\r\n\trowSelection:rowSelection,\r\n};","export default function(cell, formatterParams, onRendered){\r\n\treturn cell.getValue();\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().style.whiteSpace = \"pre-wrap\";\r\n\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar floatVal = parseFloat(cell.getValue()),\r\n\tsign = \"\",\r\n\tnumber, integer, decimal, rgx;\r\n\r\n\tvar decimalSym = formatterParams.decimal || \".\";\r\n\tvar thousandSym = formatterParams.thousand || \",\";\r\n\tvar negativeSign = formatterParams.negativeSign || \"-\";\r\n\tvar symbol = formatterParams.symbol || \"\";\r\n\tvar after = !!formatterParams.symbolAfter;\r\n\tvar precision = typeof formatterParams.precision !== \"undefined\" ? formatterParams.precision : 2;\r\n\r\n\tif(isNaN(floatVal)){\r\n\t\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n\t}\r\n\r\n\tif(floatVal < 0){\r\n\t\tfloatVal = Math.abs(floatVal);\r\n\t\tsign = negativeSign;\r\n\t}\r\n\r\n\tnumber = precision !== false ? floatVal.toFixed(precision) : floatVal;\r\n\tnumber = String(number).split(\".\");\r\n\r\n\tinteger = number[0];\r\n\tdecimal = number.length > 1 ? decimalSym + number[1] : \"\";\r\n\r\n\tif (formatterParams.thousand !== false) {\r\n\t\trgx = /(\\d+)(\\d{3})/;\r\n\r\n\t\twhile (rgx.test(integer)){\r\n\t\t\tinteger = integer.replace(rgx, \"$1\" + thousandSym + \"$2\");\r\n\t\t}\r\n\t}\r\n\r\n\treturn after ? sign + integer + decimal + symbol : sign + symbol + integer + decimal;\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\turlPrefix = formatterParams.urlPrefix || \"\",\r\n\tdownload = formatterParams.download,\r\n\tlabel = value,\r\n\tel = document.createElement(\"a\"),\r\n\tdata;\r\n\r\n\tfunction labelTraverse(path, data){\r\n\t\tvar item = path.shift(),\r\n\t\tvalue = data[item];\r\n\t\t\r\n\t\tif(path.length && typeof value === \"object\"){\r\n\t\t\treturn labelTraverse(path, value);\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t};\r\n\r\n\tif(formatterParams.labelField){\r\n\t\tdata = cell.getData();\r\n\t\tlabel = labelTraverse(formatterParams.labelField.split(this.table.options.nestedFieldSeparator), data);\r\n\t}\r\n\r\n\tif(formatterParams.label){\r\n\t\tswitch(typeof formatterParams.label){\r\n\t\t\tcase \"string\":\r\n\t\t\tlabel = formatterParams.label;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tlabel = formatterParams.label(cell);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif(label){\r\n\t\tif(formatterParams.urlField){\r\n\t\t\tdata = cell.getData();\r\n\t\t\tvalue = data[formatterParams.urlField];\r\n\t\t}\r\n\r\n\t\tif(formatterParams.url){\r\n\t\t\tswitch(typeof formatterParams.url){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tvalue = formatterParams.url;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tvalue = formatterParams.url(cell);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tel.setAttribute(\"href\", urlPrefix + value);\r\n\r\n\t\tif(formatterParams.target){\r\n\t\t\tel.setAttribute(\"target\", formatterParams.target);\r\n\t\t}\r\n\r\n\t\tif(formatterParams.download){\r\n\r\n\t\t\tif(typeof download == \"function\"){\r\n\t\t\t\tdownload = download(cell);\r\n\t\t\t}else{\r\n\t\t\t\tdownload = download === true ? \"\" : download;\r\n\t\t\t}\r\n\r\n\t\t\tel.setAttribute(\"download\", download);\r\n\t\t}\r\n\r\n\t\tel.innerHTML = this.emptyToSpace(this.sanitizeHTML(label));\r\n\r\n\t\treturn el;\r\n\t}else{\r\n\t\treturn \" \";\r\n\t}\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar el = document.createElement(\"img\"),\r\n\tsrc = cell.getValue();\r\n\r\n\tif(formatterParams.urlPrefix){\r\n\t\tsrc = formatterParams.urlPrefix + cell.getValue();\r\n\t}\r\n\r\n\tif(formatterParams.urlSuffix){\r\n\t\tsrc = src + formatterParams.urlSuffix;\r\n\t}\r\n\r\n\tel.setAttribute(\"src\", src);\r\n\r\n\tswitch(typeof formatterParams.height){\r\n\t\tcase \"number\":\r\n\t\tel.style.height = formatterParams.height + \"px\";\r\n\t\tbreak;\r\n\r\n\t\tcase \"string\":\r\n\t\tel.style.height = formatterParams.height;\r\n\t\tbreak;\r\n\t}\r\n\r\n\tswitch(typeof formatterParams.width){\r\n\t\tcase \"number\":\r\n\t\tel.style.width = formatterParams.width + \"px\";\r\n\t\tbreak;\r\n\r\n\t\tcase \"string\":\r\n\t\tel.style.width = formatterParams.width;\r\n\t\tbreak;\r\n\t}\r\n\r\n\tel.addEventListener(\"load\", function(){\r\n\t\tcell.getRow().normalizeHeight();\r\n\t});\r\n\r\n\treturn el;\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\telement = cell.getElement(),\r\n\tempty = formatterParams.allowEmpty,\r\n\ttruthy = formatterParams.allowTruthy,\r\n\ttrueValueSet = Object.keys(formatterParams).includes(\"trueValue\"),\r\n\ttick = typeof formatterParams.tickElement !== \"undefined\" ? formatterParams.tickElement : '',\r\n\tcross = typeof formatterParams.crossElement !== \"undefined\" ? formatterParams.crossElement : '';\r\n\r\n\tif((trueValueSet && value === formatterParams.trueValue) || (!trueValueSet && ((truthy && value) || (value === true || value === \"true\" || value === \"True\" || value === 1 || value === \"1\")))){\r\n\t\telement.setAttribute(\"aria-checked\", true);\r\n\t\treturn tick || \"\";\r\n\t}else{\r\n\t\tif(empty && (value === \"null\" || value === \"\" || value === null || typeof value === \"undefined\")){\r\n\t\t\telement.setAttribute(\"aria-checked\", \"mixed\");\r\n\t\t\treturn \"\";\r\n\t\t}else{\r\n\t\t\telement.setAttribute(\"aria-checked\", false);\r\n\t\t\treturn cross || \"\";\r\n\t\t}\r\n\t}\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar inputFormat = formatterParams.inputFormat || \"yyyy-MM-dd HH:mm:ss\";\r\n\tvar\toutputFormat = formatterParams.outputFormat || \"dd/MM/yyyy HH:mm:ss\";\r\n\tvar\tinvalid = typeof formatterParams.invalidPlaceholder !== \"undefined\" ? formatterParams.invalidPlaceholder : \"\";\r\n\tvar value = cell.getValue();\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tvar newDatetime;\r\n\r\n\t\tif(DT.isDateTime(value)){\r\n\t\t\t newDatetime = value;\r\n\t\t }else if(inputFormat === \"iso\"){\r\n\t\t\t newDatetime = DT.fromISO(String(value));\r\n\t\t }else{\r\n\t\t\t newDatetime = DT.fromFormat(String(value), inputFormat);\r\n\t\t }\r\n\r\n\t\tif(newDatetime.isValid){\r\n\t\t\tif(formatterParams.timezone){\r\n\t\t\t\tnewDatetime = newDatetime.setZone(formatterParams.timezone);\r\n\t\t\t}\r\n\r\n\t\t\treturn newDatetime.toFormat(outputFormat);\r\n\t\t}else{\r\n\t\t\tif(invalid === true || !value){\r\n\t\t\t\treturn value;\r\n\t\t\t}else if(typeof invalid === \"function\"){\r\n\t\t\t\treturn invalid(value);\r\n\t\t\t}else{\r\n\t\t\t\treturn invalid;\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tconsole.error(\"Format Error - 'datetime' formatter is dependant on luxon.js\");\r\n\t}\r\n};","export default function (cell, formatterParams, onRendered) {\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar inputFormat = formatterParams.inputFormat || \"yyyy-MM-dd HH:mm:ss\";\r\n\tvar invalid = typeof formatterParams.invalidPlaceholder !== \"undefined\" ? formatterParams.invalidPlaceholder : \"\";\r\n\tvar suffix = typeof formatterParams.suffix !== \"undefined\" ? formatterParams.suffix : false;\r\n\tvar unit = typeof formatterParams.unit !== \"undefined\" ? formatterParams.unit : \"days\";\r\n\tvar humanize = typeof formatterParams.humanize !== \"undefined\" ? formatterParams.humanize : false;\r\n\tvar date = typeof formatterParams.date !== \"undefined\" ? formatterParams.date : DT.now();\r\n\tvar value = cell.getValue();\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tvar newDatetime;\r\n\r\n\t\tif(DT.isDateTime(value)){\r\n\t\t\t newDatetime = value;\r\n\t\t }else if(inputFormat === \"iso\"){\r\n\t\t\t newDatetime = DT.fromISO(String(value));\r\n\t\t }else{\r\n\t\t\t newDatetime = DT.fromFormat(String(value), inputFormat);\r\n\t\t }\r\n\r\n\t\tif (newDatetime.isValid){\r\n\t\t\tif(humanize){\r\n\t\t\t\treturn newDatetime.diff(date, unit).toHuman() + (suffix ? \" \" + suffix : \"\");\r\n\t\t\t}else{\r\n\t\t\t\treturn parseInt(newDatetime.diff(date, unit)[unit]) + (suffix ? \" \" + suffix : \"\");\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\tif (invalid === true) {\r\n\t\t\t\treturn value;\r\n\t\t\t} else if (typeof invalid === \"function\") {\r\n\t\t\t\treturn invalid(value);\r\n\t\t\t} else {\r\n\t\t\t\treturn invalid;\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tconsole.error(\"Format Error - 'datetimediff' formatter is dependant on luxon.js\");\r\n\t}\r\n};","export default function (cell, formatterParams, onRendered) {\r\n\tvar value = cell.getValue();\r\n\r\n\tif (typeof formatterParams[value] === \"undefined\") {\r\n\t\tconsole.warn('Missing display value for ' + value);\r\n\t\treturn value;\r\n\t}\r\n\r\n\treturn formatterParams[value];\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\telement = cell.getElement(),\r\n\tmaxStars = formatterParams && formatterParams.stars ? formatterParams.stars : 5,\r\n\tstars = document.createElement(\"span\"),\r\n\tstar = document.createElementNS('http://www.w3.org/2000/svg', \"svg\"),\r\n\tstarActive = '',\r\n\tstarInactive = '';\r\n\r\n\t//style stars holder\r\n\tstars.style.verticalAlign = \"middle\";\r\n\r\n\t//style star\r\n\tstar.setAttribute(\"width\", \"14\");\r\n\tstar.setAttribute(\"height\", \"14\");\r\n\tstar.setAttribute(\"viewBox\", \"0 0 512 512\");\r\n\tstar.setAttribute(\"xml:space\", \"preserve\");\r\n\tstar.style.padding = \"0 1px\";\r\n\r\n\tvalue = value && !isNaN(value) ? parseInt(value) : 0;\r\n\r\n\tvalue = Math.max(0, Math.min(value, maxStars));\r\n\r\n\tfor(var i=1;i<= maxStars;i++){\r\n\t\tvar nextStar = star.cloneNode(true);\r\n\t\tnextStar.innerHTML = i <= value ? starActive : starInactive;\r\n\r\n\t\tstars.appendChild(nextStar);\r\n\t}\r\n\r\n\telement.style.whiteSpace = \"nowrap\";\r\n\telement.style.overflow = \"hidden\";\r\n\telement.style.textOverflow = \"ellipsis\";\r\n\r\n\telement.setAttribute(\"aria-label\", value);\r\n\r\n\treturn stars;\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar value = this.sanitizeHTML(cell.getValue()) || 0,\r\n\tel = document.createElement(\"span\"),\r\n\tmax = formatterParams && formatterParams.max ? formatterParams.max : 100,\r\n\tmin = formatterParams && formatterParams.min ? formatterParams.min : 0,\r\n\tcolors = formatterParams && typeof formatterParams.color !== \"undefined\" ? formatterParams.color : [\"red\", \"orange\", \"green\"],\r\n\tcolor = \"#666666\",\r\n\tpercent, percentValue;\r\n\r\n\tif(isNaN(value) || typeof cell.getValue() === \"undefined\"){\r\n\t\treturn;\r\n\t}\r\n\r\n\tel.classList.add(\"tabulator-traffic-light\");\r\n\r\n\t//make sure value is in range\r\n\tpercentValue = parseFloat(value) <= max ? parseFloat(value) : max;\r\n\tpercentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min;\r\n\r\n\t//workout percentage\r\n\tpercent = (max - min) / 100;\r\n\tpercentValue = Math.round((percentValue - min) / percent);\r\n\r\n\t//set color\r\n\tswitch(typeof colors){\r\n\t\tcase \"string\":\r\n\t\tcolor = colors;\r\n\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\tcolor = colors(value);\r\n\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\tif(Array.isArray(colors)){\r\n\t\t\tvar unit = 100 / colors.length;\r\n\t\t\tvar index = Math.floor(percentValue / unit);\r\n\r\n\t\t\tindex = Math.min(index, colors.length - 1);\r\n\t\t\tindex = Math.max(index, 0);\r\n\t\t\tcolor = colors[index];\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tel.style.backgroundColor = color;\r\n\r\n\treturn el;\r\n};","import CellComponent from '../../../../core/cell/CellComponent.js';\r\n\r\nexport default function(cell, formatterParams, onRendered){ //progress bar\r\n\tvar value = this.sanitizeHTML(cell.getValue()) || 0,\r\n\telement = cell.getElement(),\r\n\tmax = formatterParams && formatterParams.max ? formatterParams.max : 100,\r\n\tmin = formatterParams && formatterParams.min ? formatterParams.min : 0,\r\n\tlegendAlign = formatterParams && formatterParams.legendAlign ? formatterParams.legendAlign : \"center\",\r\n\tpercent, percentValue, color, legend, legendColor, top, left, right, bottom;\r\n\r\n\t//make sure value is in range\r\n\tpercentValue = parseFloat(value) <= max ? parseFloat(value) : max;\r\n\tpercentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min;\r\n\r\n\t//workout percentage\r\n\tpercent = (max - min) / 100;\r\n\tpercentValue = Math.round((percentValue - min) / percent);\r\n\r\n\t//set bar color\r\n\tswitch(typeof formatterParams.color){\r\n\t\tcase \"string\":\r\n\t\tcolor = formatterParams.color;\r\n\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\tcolor = formatterParams.color(value);\r\n\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\tif(Array.isArray(formatterParams.color)){\r\n\t\t\tvar unit = 100 / formatterParams.color.length;\r\n\t\t\tvar index = Math.floor(percentValue / unit);\r\n\r\n\t\t\tindex = Math.min(index, formatterParams.color.length - 1);\r\n\t\t\tindex = Math.max(index, 0);\r\n\t\t\tcolor = formatterParams.color[index];\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tdefault:\r\n\t\tcolor = \"#2DC214\";\r\n\t}\r\n\r\n\t//generate legend\r\n\tswitch(typeof formatterParams.legend){\r\n\t\tcase \"string\":\r\n\t\tlegend = formatterParams.legend;\r\n\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\tlegend = formatterParams.legend(value);\r\n\t\tbreak;\r\n\t\tcase \"boolean\":\r\n\t\tlegend = value;\r\n\t\tbreak;\r\n\t\tdefault:\r\n\t\tlegend = false;\r\n\t}\r\n\r\n\t//set legend color\r\n\tswitch(typeof formatterParams.legendColor){\r\n\t\tcase \"string\":\r\n\t\tlegendColor = formatterParams.legendColor;\r\n\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\tlegendColor = formatterParams.legendColor(value);\r\n\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\tif(Array.isArray(formatterParams.legendColor)){\r\n\t\t\tvar unit = 100 / formatterParams.legendColor.length;\r\n\t\t\tvar index = Math.floor(percentValue / unit);\r\n\r\n\t\t\tindex = Math.min(index, formatterParams.legendColor.length - 1);\r\n\t\t\tindex = Math.max(index, 0);\r\n\t\t\tlegendColor = formatterParams.legendColor[index];\r\n\t\t}\r\n\t\tbreak;\r\n\t\tdefault:\r\n\t\tlegendColor = \"#000\";\r\n\t}\r\n\r\n\telement.style.minWidth = \"30px\";\r\n\telement.style.position = \"relative\";\r\n\r\n\telement.setAttribute(\"aria-label\", percentValue);\r\n\r\n\tvar barEl = document.createElement(\"div\");\r\n\tbarEl.style.display = \"inline-block\";\r\n\tbarEl.style.position = \"absolute\";\r\n\tbarEl.style.width = percentValue + \"%\";\r\n\tbarEl.style.backgroundColor = color;\r\n\tbarEl.style.height = \"100%\";\r\n\r\n\tbarEl.setAttribute('data-max', max);\r\n\tbarEl.setAttribute('data-min', min);\r\n\r\n\tvar barContainer = document.createElement(\"div\");\r\n\tbarContainer.style.position = \"relative\";\r\n\tbarContainer.style.width = \"100%\";\r\n\tbarContainer.style.height = \"100%\";\r\n\r\n\tif(legend){\r\n\t\tvar legendEl = document.createElement(\"div\");\r\n\t\tlegendEl.style.position = \"absolute\";\r\n\t\tlegendEl.style.top = 0;\r\n\t\tlegendEl.style.left = 0;\r\n\t\tlegendEl.style.textAlign = legendAlign;\r\n\t\tlegendEl.style.width = \"100%\";\r\n\t\tlegendEl.style.color = legendColor;\r\n\t\tlegendEl.innerHTML = legend;\r\n\t}\r\n\r\n\tonRendered(function(){\r\n\r\n\t\t//handle custom element needed if formatter is to be included in printed/downloaded output\r\n\t\tif(!(cell instanceof CellComponent)){\r\n\t\t\tvar holderEl = document.createElement(\"div\");\r\n\t\t\tholderEl.style.position = \"absolute\";\r\n\t\t\tholderEl.style.top = \"4px\";\r\n\t\t\tholderEl.style.bottom = \"4px\";\r\n\t\t\tholderEl.style.left = \"4px\";\r\n\t\t\tholderEl.style.right = \"4px\";\r\n\r\n\t\t\telement.appendChild(holderEl);\r\n\r\n\t\t\telement = holderEl;\r\n\t\t}\r\n\r\n\t\telement.appendChild(barContainer);\r\n\t\tbarContainer.appendChild(barEl);\r\n\r\n\t\tif(legend){\r\n\t\t\tbarContainer.appendChild(legendEl);\r\n\t\t}\r\n\t});\r\n\r\n\treturn \"\";\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().style.backgroundColor = this.sanitizeHTML(cell.getValue());\r\n\treturn \"\";\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().classList.add(\"tabulator-row-handle\");\r\n\treturn \"
\";\r\n};","export default function(cell, formatterParams, onRendered){\r\n\tvar open = false,\r\n\tel = document.createElement(\"div\"),\r\n\tconfig = cell.getRow()._row.modules.responsiveLayout;\r\n\r\n\tel.classList.add(\"tabulator-responsive-collapse-toggle\");\r\n\tel.innerHTML = \"+-\";\r\n\r\n\tcell.getElement().classList.add(\"tabulator-row-handle\");\r\n\r\n\tfunction toggleList(isOpen){\r\n\t\tvar collapseEl = config.element;\r\n\r\n\t\tconfig.open = isOpen;\r\n\r\n\t\tif(collapseEl){\r\n\r\n\t\t\tif(config.open){\r\n\t\t\t\tel.classList.add(\"open\");\r\n\t\t\t\tcollapseEl.style.display = '';\r\n\t\t\t}else{\r\n\t\t\t\tel.classList.remove(\"open\");\r\n\t\t\t\tcollapseEl.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tel.addEventListener(\"click\", function(e){\r\n\t\te.stopImmediatePropagation();\r\n\t\ttoggleList(!config.open);\r\n\t});\r\n\r\n\ttoggleList(config.open);\r\n\r\n\treturn el;\r\n};","import RowComponent from '../../../../core/row/RowComponent.js';\r\n\r\nexport default function(cell, formatterParams, onRendered){\r\n\tvar checkbox = document.createElement(\"input\");\r\n\tvar blocked = false;\r\n\r\n\tcheckbox.type = 'checkbox';\r\n\r\n\tcheckbox.setAttribute(\"aria-label\", \"Select Row\");\r\n\t\r\n\tif(this.table.modExists(\"selectRow\", true)){\r\n\r\n\t\tcheckbox.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tif(typeof cell.getRow == 'function'){\r\n\t\t\tvar row = cell.getRow();\r\n\r\n\t\t\tif(row instanceof RowComponent){\r\n\r\n\t\t\t\tcheckbox.addEventListener(\"change\", (e) => {\r\n\t\t\t\t\tif(this.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\t\tif(!blocked){\r\n\t\t\t\t\t\t\trow.toggleSelect();\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tblocked = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trow.toggleSelect();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(this.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\tcheckbox.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\tblocked = true;\r\n\t\t\t\t\t\tthis.table.modules.selectRow.handleComplexRowClick(row._row, e);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcheckbox.checked = row.isSelected && row.isSelected();\r\n\t\t\t\tthis.table.modules.selectRow.registerRowSelectCheckbox(row, checkbox);\r\n\t\t\t}else{\r\n\t\t\t\tcheckbox = \"\";\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\tcheckbox.addEventListener(\"change\", (e) => {\r\n\t\t\t\tif(this.table.modules.selectRow.selectedRows.length){\r\n\t\t\t\t\tthis.table.deselectRow();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis.table.selectRow(formatterParams.rowRange);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.table.modules.selectRow.registerHeaderSelectCheckbox(checkbox);\r\n\t\t}\r\n\t}\r\n\r\n\treturn checkbox;\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultFormatters from './defaults/formatters.js';\r\n\r\nclass Format extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.registerColumnOption(\"formatter\");\r\n\t\tthis.registerColumnOption(\"formatterParams\");\r\n\r\n\t\tthis.registerColumnOption(\"formatterPrint\");\r\n\t\tthis.registerColumnOption(\"formatterPrintParams\");\r\n\t\tthis.registerColumnOption(\"formatterClipboard\");\r\n\t\tthis.registerColumnOption(\"formatterClipboardParams\");\r\n\t\tthis.registerColumnOption(\"formatterHtmlOutput\");\r\n\t\tthis.registerColumnOption(\"formatterHtmlOutputParams\");\r\n\t\tthis.registerColumnOption(\"titleFormatter\");\r\n\t\tthis.registerColumnOption(\"titleFormatterParams\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-format\", this.formatValue.bind(this));\r\n\t\tthis.subscribe(\"cell-rendered\", this.cellRendered.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"column-format\", this.formatHeader.bind(this));\r\n\t}\r\n\r\n\t//initialize column formatter\r\n\tinitializeColumn(column){\r\n\t\tcolumn.modules.format = this.lookupFormatter(column, \"\");\r\n\r\n\t\tif(typeof column.definition.formatterPrint !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.print = this.lookupFormatter(column, \"Print\");\r\n\t\t}\r\n\r\n\t\tif(typeof column.definition.formatterClipboard !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.clipboard = this.lookupFormatter(column, \"Clipboard\");\r\n\t\t}\r\n\r\n\t\tif(typeof column.definition.formatterHtmlOutput !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.htmlOutput = this.lookupFormatter(column, \"HtmlOutput\");\r\n\t\t}\r\n\t}\r\n\r\n\tlookupFormatter(column, type){\r\n\t\tvar config = {params:column.definition[\"formatter\" + type + \"Params\"] || {}},\r\n\t\tformatter = column.definition[\"formatter\" + type];\r\n\r\n\t\t//set column formatter\r\n\t\tswitch(typeof formatter){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(Format.formatters[formatter]){\r\n\t\t\t\tconfig.formatter = Format.formatters[formatter];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Formatter Error - No such formatter found: \", formatter);\r\n\t\t\t\tconfig.formatter = Format.formatters.plaintext;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tconfig.formatter = formatter;\r\n\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\tconfig.formatter = Format.formatters.plaintext;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn config;\r\n\t}\r\n\r\n\tcellRendered(cell){\r\n\t\tif(cell.modules.format && cell.modules.format.renderedCallback && !cell.modules.format.rendered){\r\n\t\t\tcell.modules.format.renderedCallback();\r\n\t\t\tcell.modules.format.rendered = true;\r\n\t\t}\r\n\t}\r\n\r\n\t//return a formatted value for a column header\r\n\tformatHeader(column, title, el){\r\n\t\tvar formatter, params, onRendered, mockCell;\r\n\r\n\t\tif(column.definition.titleFormatter){\r\n\t\t\tformatter = this.getFormatter(column.definition.titleFormatter);\r\n\r\n\t\t\tonRendered = (callback) => {\r\n\t\t\t\tcolumn.titleFormatterRendered = callback;\r\n\t\t\t};\r\n\r\n\t\t\tmockCell = {\r\n\t\t\t\tgetValue:function(){\r\n\t\t\t\t\treturn title;\r\n\t\t\t\t},\r\n\t\t\t\tgetElement:function(){\r\n\t\t\t\t\treturn el;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\tparams = column.definition.titleFormatterParams || {};\r\n\r\n\t\t\tparams = typeof params === \"function\" ? params() : params;\r\n\r\n\t\t\treturn formatter.call(this, mockCell, params, onRendered);\r\n\t\t}else{\r\n\t\t\treturn title;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t//return a formatted value for a cell\r\n\tformatValue(cell){\r\n\t\tvar component = cell.getComponent(),\r\n\t\tparams = typeof cell.column.modules.format.params === \"function\" ? cell.column.modules.format.params(component) : cell.column.modules.format.params;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\tif(!cell.modules.format){\r\n\t\t\t\tcell.modules.format = {};\r\n\t\t\t}\r\n\r\n\t\t\tcell.modules.format.renderedCallback = callback;\r\n\t\t\tcell.modules.format.rendered = false;\r\n\t\t}\r\n\r\n\t\treturn cell.column.modules.format.formatter.call(this, component, params, onRendered);\r\n\t}\r\n\r\n\tformatExportValue(cell, type){\r\n\t\tvar formatter = cell.column.modules.format[type],\r\n\t\tparams;\r\n\r\n\t\tif(formatter){\r\n\t\t\tparams = typeof formatter.params === \"function\" ? formatter.params(component) : formatter.params;\r\n\r\n\t\t\tfunction onRendered(callback){\r\n\t\t\t\tif(!cell.modules.format){\r\n\t\t\t\t\tcell.modules.format = {};\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcell.modules.format.renderedCallback = callback;\r\n\t\t\t\tcell.modules.format.rendered = false;\r\n\t\t\t}\r\n\r\n\t\t\treturn formatter.formatter.call(this, cell.getComponent(), params, onRendered);\r\n\r\n\t\t}else{\r\n\t\t\treturn this.formatValue(cell);\r\n\t\t}\r\n\t}\r\n\r\n\tsanitizeHTML(value){\r\n\t\tif(value){\r\n\t\t\tvar entityMap = {\r\n\t\t\t\t'&': '&',\r\n\t\t\t\t'<': '<',\r\n\t\t\t\t'>': '>',\r\n\t\t\t\t'\"': '"',\r\n\t\t\t\t\"'\": ''',\r\n\t\t\t\t'/': '/',\r\n\t\t\t\t'`': '`',\r\n\t\t\t\t'=': '='\r\n\t\t\t};\r\n\r\n\t\t\treturn String(value).replace(/[&<>\"'`=\\/]/g, function (s) {\r\n\t\t\t\treturn entityMap[s];\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn value;\r\n\t\t}\r\n\t}\r\n\r\n\temptyToSpace(value){\r\n\t\treturn value === null || typeof value === \"undefined\" || value === \"\" ? \" \" : value;\r\n\t}\r\n\r\n\t//get formatter for cell\r\n\tgetFormatter(formatter){\r\n\t\tvar formatter;\r\n\r\n\t\tswitch(typeof formatter){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(Format.formatters[formatter]){\r\n\t\t\t\tformatter = Format.formatters[formatter]\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Formatter Error - No such formatter found: \", formatter);\r\n\t\t\t\tformatter = Format.formatters.plaintext;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tformatter = formatter;\r\n\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\tformatter = Format.formatters.plaintext;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn formatter;\r\n\t}\r\n}\r\n\r\nFormat.moduleName = \"format\";\r\n\r\n//load defaults\r\nFormat.formatters = defaultFormatters;\r\n\r\nexport default Format;","import Module from '../../core/Module.js';\r\n\r\nclass FrozenColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.leftColumns = [];\r\n\t\tthis.rightColumns = [];\r\n\t\tthis.leftMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.rightPadding = 0;\r\n\t\tthis.initializationMode = \"left\";\r\n\t\tthis.active = false;\r\n\t\tthis.blocked = true;\r\n\t\t\r\n\t\tthis.registerColumnOption(\"frozen\");\r\n\t}\r\n\t\r\n\t//reset initial state\r\n\treset(){\r\n\t\tthis.initializationMode = \"left\";\r\n\t\tthis.leftColumns = [];\r\n\t\tthis.rightColumns = [];\r\n\t\tthis.leftMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.active = false;\r\n\t\t\r\n\t\tthis.table.columnManager.headersElement.style.marginLeft = 0;\r\n\t\tthis.table.columnManager.element.style.paddingRight = 0;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-layout\", this.layoutCell.bind(this));\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"column-width\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"row-layout-after\", this.layoutRow.bind(this));\r\n\t\tthis.subscribe(\"table-layout\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"columns-loading\", this.reset.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"column-add\", this.reinitializeColumns.bind(this));\r\n\t\tthis.subscribe(\"column-delete\", this.reinitializeColumns.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"table-redraw\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"layout-refreshing\", this.blockLayout.bind(this));\r\n\t\tthis.subscribe(\"layout-refreshed\", this.unblockLayout.bind(this));\r\n\t}\r\n\t\r\n\tblockLayout(){\r\n\t\tthis.blocked = true;\r\n\t}\r\n\t\r\n\tunblockLayout(){\r\n\t\tthis.blocked = false;\r\n\t}\r\n\t\r\n\tlayoutCell(cell){\r\n\t\tthis.layoutElement(cell.element, cell.column)\r\n\t}\r\n\t\r\n\treinitializeColumns(){\r\n\t\tthis.reset();\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//initialize specific column\r\n\tinitializeColumn(column){\r\n\t\tvar config = {margin:0, edge:false};\r\n\t\t\r\n\t\tif(!column.isGroup){\r\n\t\t\t\r\n\t\t\tif(this.frozenCheck(column)){\r\n\t\t\t\t\r\n\t\t\t\tconfig.position = this.initializationMode;\r\n\t\t\t\t\r\n\t\t\t\tif(this.initializationMode == \"left\"){\r\n\t\t\t\t\tthis.leftColumns.push(column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.rightColumns.unshift(column);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.active = true;\r\n\t\t\t\t\r\n\t\t\t\tcolumn.modules.frozen = config;\r\n\t\t\t}else{\r\n\t\t\t\tthis.initializationMode = \"right\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tfrozenCheck(column){\r\n\t\tif(column.parent.isGroup && column.definition.frozen){\r\n\t\t\tconsole.warn(\"Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups\");\r\n\t\t}\r\n\t\t\r\n\t\tif(column.parent.isGroup){\r\n\t\t\treturn this.frozenCheck(column.parent);\r\n\t\t}else{\r\n\t\t\treturn column.definition.frozen;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//quick layout to smooth horizontal scrolling\r\n\tscrollHorizontal(){\r\n\t\tvar rows;\r\n\t\t\r\n\t\tif(this.active){\t\t\r\n\t\t\tthis.calcMargins(true);\r\n\t\t\t\r\n\t\t\tthis.layoutColumnPosition();\r\n\t\t\t\r\n\t\t\tthis.layoutCalcRows();\r\n\t\t\t\r\n\t\t\tthis.reinitializeRows();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//calculate margins for rows\r\n\tcalcMargins(scroll){\r\n\t\t\r\n\t\tif(!scroll){\r\n\t\t\tthis.leftMargin = this._calcSpace(this.leftColumns, this.leftColumns.length) + \"px\";\t\t\t\r\n\t\t\tthis.rightMargin = this._calcSpace(this.rightColumns, this.rightColumns.length) + \"px\";\t\r\n\t\t\tthis.table.rowManager.tableElement.style.marginRight = this.rightMargin;\r\n\t\t}\r\n\t\t\r\n\t\t//calculate right frozen columns\r\n\t\tthis.rightPadding = this.table.rowManager.element.clientWidth + this.table.columnManager.scrollLeft;\r\n\t}\r\n\t\r\n\t//layout calculation rows\r\n\tlayoutCalcRows(){\r\n\t\tif(this.table.modExists(\"columnCalcs\")){\r\n\t\t\tif(this.table.modules.columnCalcs.topInitialized && this.table.modules.columnCalcs.topRow){\r\n\t\t\t\tthis.layoutRow(this.table.modules.columnCalcs.topRow);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.modules.columnCalcs.botInitialized && this.table.modules.columnCalcs.botRow){\r\n\t\t\t\tthis.layoutRow(this.table.modules.columnCalcs.botRow);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.modExists(\"groupRows\")){\r\n\t\t\t\tthis.layoutGroupCalcs(this.table.modules.groupRows.getGroups())\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tlayoutGroupCalcs(groups){\r\n\t\tgroups.forEach((group) => {\r\n\t\t\tif(group.calcs.top){\r\n\t\t\t\tthis.layoutRow(group.calcs.top);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(group.calcs.bottom){\r\n\t\t\t\tthis.layoutRow(group.calcs.bottom);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(group.groupList && group.groupList.length){\r\n\t\t\t\tthis.layoutGroupCalcs(group.groupList && group.groupList);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//calculate column positions and layout headers\r\n\tlayoutColumnPosition(allCells){\r\n\t\tvar leftParents = [];\r\n\t\t\r\n\t\tvar leftMargin = 0;\r\n\t\tvar rightMargin = 0;\r\n\t\t\r\n\t\tthis.table.columnManager.headersElement.style.marginLeft = this.leftMargin;\r\n\t\tthis.table.columnManager.element.style.paddingRight = this.rightMargin;\r\n\t\t\r\n\t\tthis.leftColumns.forEach((column, i) => {\t\r\n\t\t\tcolumn.modules.frozen.marginValue = leftMargin + this.table.columnManager.scrollLeft;\r\n\t\t\tcolumn.modules.frozen.margin = column.modules.frozen.marginValue + \"px\";\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\tleftMargin += column.getWidth();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(i == this.leftColumns.length - 1){\r\n\t\t\t\tcolumn.modules.frozen.edge = true;\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.modules.frozen.edge = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(column.parent.isGroup){\r\n\t\t\t\tvar parentEl = this.getColGroupParentElement(column);\r\n\t\t\t\tif(!leftParents.includes(parentEl)){\r\n\t\t\t\t\tthis.layoutElement(parentEl, column);\r\n\t\t\t\t\tleftParents.push(parentEl);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(column.modules.frozen.edge){\r\n\t\t\t\t\tparentEl.classList.add(\"tabulator-frozen-\" + column.modules.frozen.position);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.layoutElement(column.getElement(), column);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(allCells){\r\n\t\t\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.rightColumns.forEach((column, i) => {\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\trightMargin += column.getWidth();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.frozen.marginValue = this.rightPadding - rightMargin;\r\n\t\t\tcolumn.modules.frozen.margin = column.modules.frozen.marginValue + \"px\";\r\n\t\t\t\r\n\t\t\tif(i == this.rightColumns.length - 1){\r\n\t\t\t\tcolumn.modules.frozen.edge = true;\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.modules.frozen.edge = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif(column.parent.isGroup){\r\n\t\t\t\tthis.layoutElement(this.getColGroupParentElement(column), column);\r\n\t\t\t}else{\r\n\t\t\t\tthis.layoutElement(column.getElement(), column);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(allCells){\r\n\t\t\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetColGroupParentElement(column){\r\n\t\treturn column.parent.isGroup ? this.getColGroupParentElement(column.parent) : column.getElement();\r\n\t}\r\n\t\r\n\t//layout columns appropriately\r\n\tlayout(){\t\r\n\t\tif(this.active && !this.blocked){\r\n\t\t\t//calculate row padding\r\n\t\t\tthis.calcMargins();\r\n\t\t\t\r\n\t\t\t//calculate left columns\r\n\t\t\tthis.layoutColumnPosition();\r\n\r\n\t\t\tthis.reinitializeRows();\r\n\t\t\t\r\n\t\t\tthis.layoutCalcRows();\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeRows(){\r\n\t\tvar visibleRows = this.table.rowManager.getVisibleRows();\r\n\t\tvar otherRows = this.table.rowManager.getRows().filter(row => !visibleRows.includes(row));\r\n\r\n\t\totherRows.forEach((row) =>{\r\n\t\t\trow.deinitialize();\r\n\t\t});\r\n\t\t\r\n\t\tvisibleRows.forEach((row) =>{\r\n\t\t\tif(row.type === \"row\"){\r\n\t\t\t\tthis.layoutRow(row);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tlayoutRow(row){\r\n\t\t// console.trace(\"row\")\r\n\t\tvar rowEl = row.getElement();\r\n\t\t\r\n\t\trowEl.style.paddingLeft = this.leftMargin;\r\n\t\t\r\n\t\tif(this.table.options.layout === \"fitDataFill\" && this.rightColumns.length){\r\n\t\t\tthis.table.rowManager.getTableElement().style.minWidth = \"calc(100% - \" + this.rightMargin + \")\";\r\n\t\t}\r\n\t\t\r\n\t\tthis.leftColumns.forEach((column) => {\r\n\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\r\n\t\t\tif(cell){\r\n\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.rightColumns.forEach((column) => {\r\n\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\r\n\t\t\tif(cell){\r\n\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tlayoutElement(element, column){\r\n\t\t\r\n\t\tif(column.modules.frozen){\r\n\t\t\telement.style.position = \"absolute\";\r\n\t\t\telement.style.left = column.modules.frozen.margin;\r\n\t\t\t\r\n\t\t\telement.classList.add(\"tabulator-frozen\");\r\n\t\t\t\r\n\t\t\tif(column.modules.frozen.edge){\r\n\t\t\t\telement.classList.add(\"tabulator-frozen-\" + column.modules.frozen.position);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_calcSpace(columns, index){\r\n\t\tvar width = 0;\r\n\t\t\r\n\t\tfor (let i = 0; i < index; i++){\r\n\t\t\tif(columns[i].visible){\r\n\t\t\t\twidth += columns[i].getWidth();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn width;\r\n\t}\r\n}\r\n\r\nFrozenColumns.moduleName = \"frozenColumns\";\r\n\r\nexport default FrozenColumns;","import Module from '../../core/Module.js';\r\n\r\nclass FrozenRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.topElement = document.createElement(\"div\");\r\n\t\tthis.rows = [];\r\n\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"freeze\", this.freezeRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"unfreeze\", this.unfreezeRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isFrozen\", this.isRowFrozen.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.rows = [];\r\n\r\n\t\tthis.topElement.classList.add(\"tabulator-frozen-rows-holder\");\r\n\r\n\t\t// this.table.columnManager.element.append(this.topElement);\r\n\t\tthis.table.columnManager.getElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling);\r\n\r\n\t\tthis.subscribe(\"row-deleting\", this.detachRow.bind(this));\r\n\t\tthis.subscribe(\"rows-visible\", this.visibleRows.bind(this));\r\n\r\n\t\tthis.registerDisplayHandler(this.getRows.bind(this), 10);\r\n\t}\r\n\r\n\tisRowFrozen(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\t\treturn index > -1;\r\n\t}\r\n\r\n\tisFrozen(){\r\n\t\treturn !!this.rows.length;\r\n\t}\r\n\r\n\tvisibleRows(viewable, rows){\r\n\t\tthis.rows.forEach((row) => {\r\n\t\t\trows.push(row);\r\n\t\t});\r\n\r\n\t\treturn rows;\r\n\t}\r\n\r\n\t//filter frozen rows out of display data\r\n\tgetRows(rows){\r\n\t\tvar self = this,\r\n\t\tfrozen = [],\r\n\t\toutput = rows.slice(0);\r\n\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\tvar index = output.indexOf(row);\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\toutput.splice(index, 1);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tfreezeRow(row){\r\n\t\tif(!row.modules.frozen){\r\n\t\t\trow.modules.frozen = true;\r\n\t\t\tthis.topElement.appendChild(row.getElement());\r\n\t\t\trow.initialize();\r\n\t\t\trow.normalizeHeight();\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\tthis.rows.push(row);\r\n\r\n\t\t\tthis.refreshData(false, \"display\")\r\n\r\n\t\t\tthis.styleRows();\r\n\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Freeze Error - Row is already frozen\");\r\n\t\t}\r\n\t}\r\n\r\n\tunfreezeRow(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\r\n\t\tif(row.modules.frozen){\r\n\r\n\t\t\trow.modules.frozen = false;\r\n\r\n\t\t\tthis.detachRow(row);\r\n\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\tthis.refreshData(false, \"display\")\r\n\r\n\t\t\tif(this.rows.length){\r\n\t\t\t\tthis.styleRows();\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Freeze Error - Row is already unfrozen\");\r\n\t\t}\r\n\t}\r\n\r\n\tdetachRow(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tvar rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\r\n\t\t\tthis.rows.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\tstyleRows(row){\r\n\t\tthis.rows.forEach((row, i) => {\r\n\t\t\tthis.table.rowManager.styleRow(row, i);\r\n\t\t});\r\n\t}\r\n}\r\n\r\nFrozenRows.moduleName = \"frozenRows\";\r\n\r\nexport default FrozenRows;","//public group object\r\nclass GroupComponent {\r\n\tconstructor (group){\r\n\t\tthis._group = group;\r\n\t\tthis.type = \"GroupComponent\";\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._group.groupManager.table.componentFunctionBinder.handle(\"row\", target._group, name)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\tgetKey(){\r\n\t\treturn this._group.key;\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._group.field;\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._group.element;\r\n\t}\r\n\r\n\tgetRows(){\r\n\t\treturn this._group.getRows(true);\r\n\t}\r\n\r\n\tgetSubGroups(){\r\n\t\treturn this._group.getSubGroups(true);\r\n\t}\r\n\r\n\tgetParentGroup(){\r\n\t\treturn this._group.parent ? this._group.parent.getComponent() : false;\r\n\t}\r\n\r\n\tisVisible(){\r\n\t\treturn this._group.visible;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tthis._group.show();\r\n\t}\r\n\r\n\thide(){\r\n\t\tthis._group.hide();\r\n\t}\r\n\r\n\ttoggle(){\r\n\t\tthis._group.toggleVisibility();\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._group;\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._group.groupManager.table;\r\n\t}\r\n}\r\n\r\nexport default GroupComponent;","import Helpers from '../../core/tools/Helpers.js';\r\nimport GroupComponent from './GroupComponent.js';\r\n\r\n//Group functions\r\nclass Group{\r\n\t\r\n\tconstructor(groupManager, parent, level, key, field, generator, oldGroup){\r\n\t\tthis.groupManager = groupManager;\r\n\t\tthis.parent = parent;\r\n\t\tthis.key = key;\r\n\t\tthis.level = level;\r\n\t\tthis.field = field;\r\n\t\tthis.hasSubGroups = level < (groupManager.groupIDLookups.length - 1);\r\n\t\tthis.addRow = this.hasSubGroups ? this._addRowToGroup : this._addRow;\r\n\t\tthis.type = \"group\"; //type of element\r\n\t\tthis.old = oldGroup;\r\n\t\tthis.rows = [];\r\n\t\tthis.groups = [];\r\n\t\tthis.groupList = [];\r\n\t\tthis.generator = generator;\r\n\t\tthis.element = false;\r\n\t\tthis.elementContents = false;\r\n\t\tthis.height = 0;\r\n\t\tthis.outerHeight = 0;\r\n\t\tthis.initialized = false;\r\n\t\tthis.calcs = {};\r\n\t\tthis.initialized = false;\r\n\t\tthis.modules = {};\r\n\t\tthis.arrowElement = false;\r\n\t\t\r\n\t\tthis.visible = oldGroup ? oldGroup.visible : (typeof groupManager.startOpen[level] !== \"undefined\" ? groupManager.startOpen[level] : groupManager.startOpen[0]);\r\n\t\t\r\n\t\tthis.component = null;\r\n\t\t\r\n\t\tthis.createElements();\r\n\t\tthis.addBindings();\r\n\t\t\r\n\t\tthis.createValueGroups();\r\n\t}\r\n\t\r\n\twipe(){\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\tgroup.wipe();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\tif(row.modules){\r\n\t\t\t\t\tdelete row.modules.group;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tthis.element = false;\r\n\t\tthis.arrowElement = false;\r\n\t\tthis.elementContents = false;\r\n\t}\r\n\t\r\n\tcreateElements(){\r\n\t\tvar arrow = document.createElement(\"div\");\r\n\t\tarrow.classList.add(\"tabulator-arrow\");\r\n\t\t\r\n\t\tthis.element = document.createElement(\"div\");\r\n\t\tthis.element.classList.add(\"tabulator-row\");\r\n\t\tthis.element.classList.add(\"tabulator-group\");\r\n\t\tthis.element.classList.add(\"tabulator-group-level-\" + this.level);\r\n\t\tthis.element.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\tthis.arrowElement = document.createElement(\"div\");\r\n\t\tthis.arrowElement.classList.add(\"tabulator-group-toggle\");\r\n\t\tthis.arrowElement.appendChild(arrow);\r\n\t\t\r\n\t\t//setup movable rows\r\n\t\tif(this.groupManager.table.options.movableRows !== false && this.groupManager.table.modExists(\"moveRow\")){\r\n\t\t\tthis.groupManager.table.modules.moveRow.initializeGroupHeader(this);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcreateValueGroups(){\r\n\t\tvar level = this.level + 1;\r\n\t\tif(this.groupManager.allowedValues && this.groupManager.allowedValues[level]){\r\n\t\t\tthis.groupManager.allowedValues[level].forEach((value) => {\r\n\t\t\t\tthis._createGroup(value, level);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\taddBindings(){\r\n\t\tvar toggleElement;\r\n\t\t\r\n\t\tif(this.groupManager.table.options.groupToggleElement){\r\n\t\t\ttoggleElement = this.groupManager.table.options.groupToggleElement == \"arrow\" ? this.arrowElement : this.element;\r\n\t\t\t\r\n\t\t\ttoggleElement.addEventListener(\"click\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\tthis.toggleVisibility();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\t_createGroup(groupID, level){\r\n\t\tvar groupKey = level + \"_\" + groupID;\r\n\t\tvar group = new Group(this.groupManager, this, level, groupID, this.groupManager.groupIDLookups[level].field, this.groupManager.headerGenerator[level] || this.groupManager.headerGenerator[0], this.old ? this.old.groups[groupKey] : false);\r\n\t\t\r\n\t\tthis.groups[groupKey] = group;\r\n\t\tthis.groupList.push(group);\r\n\t}\r\n\t\r\n\t_addRowToGroup(row){\r\n\t\t\r\n\t\tvar level = this.level + 1;\r\n\t\t\r\n\t\tif(this.hasSubGroups){\r\n\t\t\tvar groupID = this.groupManager.groupIDLookups[level].func(row.getData()),\r\n\t\t\tgroupKey = level + \"_\" + groupID;\r\n\t\t\t\r\n\t\t\tif(this.groupManager.allowedValues && this.groupManager.allowedValues[level]){\r\n\t\t\t\tif(this.groups[groupKey]){\r\n\t\t\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(!this.groups[groupKey]){\r\n\t\t\t\t\tthis._createGroup(groupID, level);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_addRow(row){\r\n\t\tthis.rows.push(row);\r\n\t\trow.modules.group = this;\r\n\t}\r\n\t\r\n\tinsertRow(row, to, after){\r\n\t\tvar data = this.conformRowData({});\r\n\t\t\r\n\t\trow.updateData(data);\r\n\t\t\r\n\t\tvar toIndex = this.rows.indexOf(to);\r\n\t\t\r\n\t\tif(toIndex > -1){\r\n\t\t\tif(after){\r\n\t\t\t\tthis.rows.splice(toIndex+1, 0, row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.splice(toIndex, 0, row);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(after){\r\n\t\t\t\tthis.rows.push(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.unshift(row);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\trow.modules.group = this;\r\n\t\t\r\n\t\tthis.generateGroupHeaderContents();\r\n\t\t\r\n\t\tif(this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\tthis.groupManager.table.modules.columnCalcs.recalcGroup(this);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.updateGroupRows(true);\r\n\t}\r\n\t\r\n\tscrollHeader(left){\r\n\t\tif(this.arrowElement){\r\n\t\t\tthis.arrowElement.style.marginLeft = left;\r\n\t\t\t\r\n\t\t\tthis.groupList.forEach(function(child){\r\n\t\t\t\tchild.scrollHeader(left);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRowIndex(row){}\r\n\t\r\n\t//update row data to match grouping contraints\r\n\tconformRowData(data){\r\n\t\tif(this.field){\r\n\t\t\tdata[this.field] = this.key;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Data Conforming Error - Cannot conform row data to match new group as groupBy is a function\");\r\n\t\t}\r\n\t\t\r\n\t\tif(this.parent){\r\n\t\t\tdata = this.parent.conformRowData(data);\r\n\t\t}\r\n\t\t\r\n\t\treturn data;\r\n\t}\r\n\t\r\n\tremoveRow(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\t\tvar el = row.getElement();\r\n\t\t\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.rows.splice(index, 1);\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.groupManager.table.options.groupValues && !this.rows.length){\r\n\t\t\tif(this.parent){\r\n\t\t\t\tthis.parent.removeGroup(this);\r\n\t\t\t}else{\r\n\t\t\t\tthis.groupManager.removeGroup(this);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tif(el.parentNode){\r\n\t\t\t\tel.parentNode.removeChild(el);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.generateGroupHeaderContents();\r\n\t\t\t\r\n\t\t\tif(this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\t\tthis.groupManager.table.modules.columnCalcs.recalcGroup(this);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveGroup(group){\r\n\t\tvar groupKey = group.level + \"_\" + group.key,\r\n\t\tindex;\r\n\t\t\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tdelete this.groups[groupKey];\r\n\t\t\t\r\n\t\t\tindex = this.groupList.indexOf(group);\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.groupList.splice(index, 1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(!this.groupList.length){\r\n\t\t\t\tif(this.parent){\r\n\t\t\t\t\tthis.parent.removeGroup(this);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.groupManager.removeGroup(this);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetHeadersAndRows(noCalc){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\toutput.push(this);\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(this.visible){\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\t\toutput = output.concat(group.getHeadersAndRows(noCalc));\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tif(!noCalc && this.groupManager.table.options.columnCalcs != \"table\" && this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.modules.columnCalcs.hasTopCalcs()){\r\n\t\t\t\t\tif(this.calcs.top){\r\n\t\t\t\t\t\tthis.calcs.top.detachElement();\r\n\t\t\t\t\t\tthis.calcs.top.deleteCells();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows);\r\n\t\t\t\t\toutput.push(this.calcs.top);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\toutput = output.concat(this.rows);\r\n\t\t\t\t\r\n\t\t\t\tif(!noCalc && this.groupManager.table.options.columnCalcs != \"table\" && this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()){\r\n\t\t\t\t\tif(this.calcs.bottom){\r\n\t\t\t\t\t\tthis.calcs.bottom.detachElement();\r\n\t\t\t\t\t\tthis.calcs.bottom.deleteCells();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows);\r\n\t\t\t\t\toutput.push(this.calcs.bottom);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!this.groupList.length && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\t\t\r\n\t\t\t\tif(this.groupManager.table.modExists(\"columnCalcs\")){\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!noCalc && this.groupManager.table.modules.columnCalcs.hasTopCalcs()){\r\n\t\t\t\t\t\tif(this.calcs.top){\r\n\t\t\t\t\t\t\tthis.calcs.top.detachElement();\r\n\t\t\t\t\t\t\tthis.calcs.top.deleteCells();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.groupManager.table.options.groupClosedShowCalcs){\r\n\t\t\t\t\t\t\tthis.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows);\r\n\t\t\t\t\t\t\toutput.push(this.calcs.top);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!noCalc && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()){\r\n\t\t\t\t\t\tif(this.calcs.bottom){\r\n\t\t\t\t\t\t\tthis.calcs.bottom.detachElement();\r\n\t\t\t\t\t\t\tthis.calcs.bottom.deleteCells();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.groupManager.table.options.groupClosedShowCalcs){\r\n\t\t\t\t\t\t\tthis.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows);\r\n\t\t\t\t\t\t\toutput.push(this.calcs.bottom);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetData(visible, transform){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(!visible || (visible && this.visible)){\r\n\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\toutput.push(row.getData(transform || \"data\"));\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetRowCount(){\r\n\t\tvar count = 0;\r\n\t\t\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\tcount += group.getRowCount();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tcount = this.rows.length;\r\n\t\t}\r\n\t\treturn count;\r\n\t}\r\n\t\r\n\ttoggleVisibility(){\r\n\t\tif(this.visible){\r\n\t\t\tthis.hide();\r\n\t\t}else{\r\n\t\t\tthis.show();\r\n\t\t}\r\n\t}\r\n\t\r\n\thide(){\r\n\t\tthis.visible = false;\r\n\t\t\r\n\t\tif(this.groupManager.table.rowManager.getRenderMode() == \"classic\" && !this.groupManager.table.options.pagination){\r\n\t\t\t\r\n\t\t\tthis.element.classList.remove(\"tabulator-group-visible\");\r\n\t\t\t\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar rows = group.getHeadersAndRows();\r\n\t\t\t\t\t\r\n\t\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\t\trow.detachElement();\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());\r\n\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth();\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.table.externalEvents.dispatch(\"groupVisibilityChanged\", this.getComponent(), false);\r\n\t}\r\n\t\r\n\tshow(){\r\n\t\tthis.visible = true;\r\n\t\t\r\n\t\tif(this.groupManager.table.rowManager.getRenderMode() == \"classic\" && !this.groupManager.table.options.pagination){\r\n\t\t\t\r\n\t\t\tthis.element.classList.add(\"tabulator-group-visible\");\r\n\t\t\t\r\n\t\t\tvar prev = this.generateElement();\r\n\t\t\t\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\t\tvar rows = group.getHeadersAndRows();\r\n\t\t\t\t\t\r\n\t\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\t\tprev.parentNode.insertBefore(rowEl, prev.nextSibling);\r\n\t\t\t\t\t\trow.initialize();\r\n\t\t\t\t\t\tprev = rowEl;\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\tprev.parentNode.insertBefore(rowEl, prev.nextSibling);\r\n\t\t\t\t\trow.initialize();\r\n\t\t\t\t\tprev = rowEl;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());\r\n\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth();\r\n\t\t}else{\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.table.externalEvents.dispatch(\"groupVisibilityChanged\", this.getComponent(), true);\r\n\t}\r\n\t\r\n\t_visSet(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tif(typeof this.visible == \"function\"){\r\n\t\t\t\r\n\t\t\tthis.rows.forEach(function(row){\r\n\t\t\t\tdata.push(row.getData());\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.visible = this.visible(this.key, this.getRowCount(), data, this.getComponent());\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRowGroup(row){\r\n\t\tvar match = false;\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\tvar result = group.getRowGroup(row);\r\n\t\t\t\t\r\n\t\t\t\tif(result){\r\n\t\t\t\t\tmatch = result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tif(this.rows.find(function(item){\r\n\t\t\t\treturn item === row;\r\n\t\t\t})){\r\n\t\t\t\tmatch = this;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn match;\r\n\t}\r\n\t\r\n\tgetSubGroups(component){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.groupList.forEach(function(child){\r\n\t\t\toutput.push(component ? child.getComponent() : child);\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetRows(compoment){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\toutput.push(compoment ? row.getComponent() : row);\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgenerateGroupHeaderContents(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\tdata.push(row.getData());\r\n\t\t});\r\n\t\t\r\n\t\tthis.elementContents = this.generator(this.key, this.getRowCount(), data, this.getComponent());\r\n\t\t\r\n\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\r\n\t\tif(typeof this.elementContents === \"string\"){\r\n\t\t\tthis.element.innerHTML = this.elementContents;\r\n\t\t}else{\r\n\t\t\tthis.element.appendChild(this.elementContents);\r\n\t\t}\r\n\t\t\r\n\t\tthis.element.insertBefore(this.arrowElement, this.element.firstChild);\r\n\t}\r\n\t\r\n\tgetPath(path = []) {\r\n\t\tpath.unshift(this.key);\r\n\t\tif(this.parent) {\r\n\t\t\tthis.parent.getPath(path);\r\n\t\t}\r\n\t\treturn path;\r\n\t}\r\n\t\r\n\t////////////// Standard Row Functions //////////////\r\n\t\r\n\tgetElement(){\r\n\t\treturn this.elementContents ? this.element : this.generateElement();\r\n\t}\r\n\t\r\n\tgenerateElement(){\r\n\t\tthis.addBindings = false;\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(this.visible){\r\n\t\t\tthis.element.classList.add(\"tabulator-group-visible\");\r\n\t\t}else{\r\n\t\t\tthis.element.classList.remove(\"tabulator-group-visible\");\r\n\t\t}\r\n\t\t\r\n\t\tfor(var i = 0; i < this.element.childNodes.length; ++i){\r\n\t\t\tthis.element.childNodes[i].parentNode.removeChild(this.element.childNodes[i]);\r\n\t\t}\r\n\t\t\r\n\t\tthis.generateGroupHeaderContents();\r\n\t\t\r\n\t\t// this.addBindings();\r\n\t\t\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\tdetachElement(){\r\n\t\tif (this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//normalize the height of elements in the row\r\n\tnormalizeHeight(){\r\n\t\tthis.setHeight(this.element.clientHeight);\r\n\t}\r\n\t\r\n\tinitialize(force){\r\n\t\tif(!this.initialized || force){\r\n\t\t\tthis.normalizeHeight();\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitialize(){\r\n\t\tthis.initialized = false;\r\n\t\tthis.height = 0;\r\n\t\t\r\n\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\tthis.initialize(true);\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetHeight(height){\r\n\t\tif(this.height != height){\r\n\t\t\tthis.height = height;\r\n\t\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return rows outer height\r\n\tgetHeight(){\r\n\t\treturn this.outerHeight;\r\n\t}\r\n\t\r\n\tgetGroup(){\r\n\t\treturn this;\r\n\t}\r\n\t\r\n\treinitializeHeight(){}\r\n\t\r\n\tcalcHeight(){}\r\n\t\r\n\tsetCellHeight(){}\r\n\t\r\n\tclearCellHeight(){}\r\n\t\r\n\tdeinitializeHeight(){}\r\n\t\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new GroupComponent(this);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n\r\nexport default Group;","import Module from '../../core/Module.js';\r\n\r\nimport GroupComponent from './GroupComponent.js';\r\nimport Group from './Group.js';\r\n\r\nclass GroupRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.groupIDLookups = false; //enable table grouping and set field to group by\r\n\t\tthis.startOpen = [function(){return false;}]; //starting state of group\r\n\t\tthis.headerGenerator = [function(){return \"\";}];\r\n\t\tthis.groupList = []; //ordered list of groups\r\n\t\tthis.allowedValues = false;\r\n\t\tthis.groups = {}; //hold row groups\r\n\t\tthis.displayIndex = 0; //index in display pipeline\r\n\r\n\t\tthis.displayHandler = this.getRows.bind(this);\r\n\r\n\t\t//register table options\r\n\t\tthis.registerTableOption(\"groupBy\", false); //enable table grouping and set field to group by\r\n\t\tthis.registerTableOption(\"groupStartOpen\", true); //starting state of group\r\n\t\tthis.registerTableOption(\"groupValues\", false);\r\n\t\tthis.registerTableOption(\"groupUpdateOnCellEdit\", false);\r\n\t\tthis.registerTableOption(\"groupHeader\", false); //header generation function\r\n\t\tthis.registerTableOption(\"groupHeaderPrint\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderClipboard\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderHtmlOutput\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderDownload\", null);\r\n\t\tthis.registerTableOption(\"groupToggleElement\", \"arrow\");\r\n\t\tthis.registerTableOption(\"groupClosedShowCalcs\", false);\r\n\r\n\t\t//register table functions\r\n\t\tthis.registerTableFunction(\"setGroupBy\", this.setGroupBy.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupValues\", this.setGroupValues.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupStartOpen\", this.setGroupStartOpen.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupHeader\", this.setGroupHeader.bind(this));\r\n\t\tthis.registerTableFunction(\"getGroups\", this.userGetGroups.bind(this));\r\n\t\tthis.registerTableFunction(\"getGroupedData\", this.userGetGroupedData.bind(this));\r\n\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"getGroup\", this.rowGetGroup.bind(this));\r\n\t}\r\n\r\n\t//initialize group configuration\r\n\tinitialize(){\r\n\t\tif(this.table.options.groupBy){\r\n\r\n\t\t\tif(this.table.options.groupUpdateOnCellEdit){\r\n\t\t\t\tthis.subscribe(\"cell-value-updated\", this.cellUpdated.bind(this));\r\n\t\t\t\tthis.subscribe(\"row-data-changed\", this.reassignRowToGroup.bind(this), 0);\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"table-built\", this.configureGroupSetup.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"row-deleting\", this.rowDeleting.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHeaders.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.wipe.bind(this));\r\n\t\t\tthis.subscribe(\"rows-added\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"row-moving\", this.rowMoving.bind(this));\r\n\t\t\tthis.subscribe(\"row-adding-index\", this.rowAddingIndex.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"rows-sample\", this.rowSample.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"render-virtual-fill\", this.virtualRenderFill.bind(this));\r\n\r\n\t\t\tthis.registerDisplayHandler(this.displayHandler, 20);\r\n\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\r\n\tconfigureGroupSetup(){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tvar groupBy = this.table.options.groupBy,\r\n\t\t\tstartOpen = this.table.options.groupStartOpen,\r\n\t\t\tgroupHeader = this.table.options.groupHeader;\r\n\r\n\t\t\tthis.allowedValues = this.table.options.groupValues;\r\n\r\n\t\t\tif(Array.isArray(groupBy) && Array.isArray(groupHeader) && groupBy.length > groupHeader.length){\r\n\t\t\t\tconsole.warn(\"Error creating group headers, groupHeader array is shorter than groupBy array\");\r\n\t\t\t}\r\n\r\n\t\t\tthis.headerGenerator = [function(){return \"\";}];\r\n\t\t\tthis.startOpen = [function(){return false;}]; //starting state of group\r\n\r\n\t\t\tthis.langBind(\"groups|item\", (langValue, lang) => {\r\n\t\t\t\tthis.headerGenerator[0] = (value, count, data) => { //header layout function\r\n\t\t\t\t\treturn (typeof value === \"undefined\" ? \"\" : value) + \"(\" + count + \" \" + ((count === 1) ? langValue : lang.groups.items) + \")\";\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tthis.groupIDLookups = [];\r\n\r\n\t\t\tif(Array.isArray(groupBy) || groupBy){\r\n\t\t\t\tif(this.table.modExists(\"columnCalcs\") && this.table.options.columnCalcs != \"table\" && this.table.options.columnCalcs != \"both\"){\r\n\t\t\t\t\tthis.table.modules.columnCalcs.removeCalcs();\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.modExists(\"columnCalcs\") && this.table.options.columnCalcs != \"group\"){\r\n\r\n\t\t\t\t\tvar cols = this.table.columnManager.getRealColumns();\r\n\r\n\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\tif(col.definition.topCalc){\r\n\t\t\t\t\t\t\tthis.table.modules.columnCalcs.initializeTopRow();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(col.definition.bottomCalc){\r\n\t\t\t\t\t\t\tthis.table.modules.columnCalcs.initializeBottomRow();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(!Array.isArray(groupBy)){\r\n\t\t\t\tgroupBy = [groupBy];\r\n\t\t\t}\r\n\r\n\t\t\tgroupBy.forEach((group, i) => {\r\n\t\t\t\tvar lookupFunc, column;\r\n\r\n\t\t\t\tif(typeof group == \"function\"){\r\n\t\t\t\t\tlookupFunc = group;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolumn = this.table.columnManager.getColumnByField(group);\r\n\r\n\t\t\t\t\tif(column){\r\n\t\t\t\t\t\tlookupFunc = function(data){\r\n\t\t\t\t\t\t\treturn column.getFieldValue(data);\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tlookupFunc = function(data){\r\n\t\t\t\t\t\t\treturn data[group];\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.groupIDLookups.push({\r\n\t\t\t\t\tfield: typeof group === \"function\" ? false : group,\r\n\t\t\t\t\tfunc:lookupFunc,\r\n\t\t\t\t\tvalues:this.allowedValues ? this.allowedValues[i] : false,\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t\tif(startOpen){\r\n\t\t\t\tif(!Array.isArray(startOpen)){\r\n\t\t\t\t\tstartOpen = [startOpen];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstartOpen.forEach((level) => {\r\n\t\t\t\t\tlevel = typeof level == \"function\" ? level : function(){return true;};\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.startOpen = startOpen;\r\n\t\t\t}\r\n\r\n\t\t\tif(groupHeader){\r\n\t\t\t\tthis.headerGenerator = Array.isArray(groupHeader) ? groupHeader : [groupHeader];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trowSample(rows, prevValue){\r\n\t\tvar group = this.getGroups(false)[0];\r\n\r\n\t\tprevValue.push(group.getRows(false)[0]);\r\n\r\n\t\treturn prevValue;\r\n\t}\r\n\r\n\tvirtualRenderFill(){\r\n\t\tvar el = this.table.rowManager.tableElement;\r\n\t\tvar rows = this.table.rowManager.getVisibleRows();\r\n\r\n\t\trows = rows.filter((row) => {\r\n\t\t\treturn row.type !== \"group\";\r\n\t\t});\r\n\r\n\t\tel.style.minWidth = !rows.length ? this.table.columnManager.getWidth() + \"px\" : \"\";\r\n\r\n\t\t// if(this.table.options.groupBy){\r\n\t\t// \tif(this.layoutMode() != \"fitDataFill\" && rowsCount == this.table.modules.groupRows.countGroups()){\r\n\t\t// \t\tel.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t// \t}\r\n\t\t// }\r\n\t}\r\n\r\n\trowAddingIndex(row, index, top){\r\n\t\tthis.assignRowToGroup(row);\r\n\r\n\t\tvar groupRows = row.modules.group.rows;\r\n\r\n\t\tif(groupRows.length > 1){\r\n\t\t\tif(!index || (index && groupRows.indexOf(index) == -1)){\r\n\t\t\t\tif(top){\r\n\t\t\t\t\tif(groupRows[0] !== row){\r\n\t\t\t\t\t\tindex = groupRows[0];\r\n\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(groupRows[groupRows.length -1] !== row){\r\n\t\t\t\t\t\tindex = groupRows[groupRows.length -1];\r\n\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn index;\r\n\t}\r\n\r\n\ttrackChanges(){\r\n\t\tthis.dispatch(\"group-changed\");\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tsetGroupBy(groups){\r\n\t\tthis.table.options.groupBy = groups;\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.initialize();\r\n\t\t}else{\r\n\t\t\tthis.configureGroupSetup();\r\n\t\t}\r\n\r\n\t\tthis.refreshData();\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\tsetGroupValues(groupValues){\r\n\t\tthis.table.options.groupValues = groupValues;\r\n\t\tthis.configureGroupSetup();\r\n\t\tthis.refreshData();\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\tsetGroupStartOpen(values){\r\n\t\tthis.table.options.groupStartOpen = values;\r\n\t\tthis.configureGroupSetup();\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\r\n\t\t\tthis.trackChanges();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Grouping Update - cant refresh view, no groups have been set\");\r\n\t\t}\r\n\t}\r\n\r\n\tsetGroupHeader(values){\r\n\t\tthis.table.options.groupHeader = values;\r\n\t\tthis.configureGroupSetup();\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\r\n\t\t\tthis.trackChanges();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Grouping Update - cant refresh view, no groups have been set\");\r\n\t\t}\r\n\t}\r\n\r\n\tuserGetGroups(values){\r\n\t\treturn this.getGroups(true);\r\n\t}\r\n\r\n\t// get grouped table data in the same format as getData()\r\n\tuserGetGroupedData(){\r\n\t\treturn this.table.options.groupBy ?\r\n\t\tthis.getGroupedData() : this.getData()\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////////\r\n\t///////// Component Functions /////////\r\n\t///////////////////////////////////////\r\n\r\n\trowGetGroup(row){\r\n\t\treturn row.modules.group ? row.modules.group.getComponent() : false;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\trowMoving(from, to, after){\r\n\t\tif(!after && to instanceof Group){\r\n\t\t\tto = this.table.rowManager.prevDisplayRow(from) || to;\r\n\t\t}\r\n\r\n\t\tvar toGroup = to instanceof Group ? to : to.modules.group;\r\n\t\tvar fromGroup = from instanceof Group ? from : from.modules.group;\r\n\r\n\t\tif(toGroup === fromGroup){\r\n\t\t\tthis.table.rowManager.moveRowInArray(toGroup.rows, from, to, after);\r\n\t\t}else{\r\n\t\t\tif(fromGroup){\r\n\t\t\t\tfromGroup.removeRow(from);\r\n\t\t\t}\r\n\r\n\t\t\ttoGroup.insertRow(from, to, after);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trowDeleting(row){\r\n\t\t//remove from group\r\n\t\tif(row.modules.group){\r\n\t\t\trow.modules.group.removeRow(row);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trowsUpdated(row){\r\n\t\tthis.updateGroupRows(true);\r\n\t}\r\n\r\n\tcellUpdated(cell){\r\n\t\tthis.reassignRowToGroup(cell.row);\r\n\t}\r\n\r\n\r\n\tsetDisplayIndex(index){\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\r\n\tgetDisplayIndex(){\r\n\t\treturn this.displayIndex;\r\n\t}\r\n\r\n\t//return appropriate rows with group headers\r\n\tgetRows(rows){\r\n\t\tif(this.table.options.groupBy && this.groupIDLookups.length){\r\n\r\n\t\t\tthis.dispatchExternal(\"dataGrouping\");\r\n\r\n\t\t\tthis.generateGroups(rows);\r\n\r\n\t\t\tif(this.subscribedExternal(\"dataGrouped\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataGrouped\", this.getGroups(true));\r\n\t\t\t}\r\n\r\n\t\t\treturn this.updateGroupRows();\r\n\r\n\t\t}else{\r\n\t\t\treturn rows.slice(0);\r\n\t\t}\r\n\t}\r\n\r\n\tgetGroups(component){\r\n\t\tvar groupComponents = [];\r\n\r\n\t\tthis.groupList.forEach(function(group){\r\n\t\t\tgroupComponents.push(component ? group.getComponent() : group);\r\n\t\t});\r\n\r\n\t\treturn groupComponents;\r\n\t}\r\n\r\n\tgetChildGroups(group){\r\n\t\tvar groupComponents = [];\r\n\r\n\t\tif(!group){\r\n\t\t\tgroup = this;\r\n\t\t}\r\n\r\n\t\tgroup.groupList.forEach((child) => {\r\n\t\t\tif(child.groupList.length){\r\n\t\t\t\tgroupComponents = groupComponents.concat(this.getChildGroups(child));\r\n\t\t\t}else{\r\n\t\t\t\tgroupComponents.push(child);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn groupComponents;\r\n\t}\r\n\r\n\twipe(){\r\n\t\tthis.groupList.forEach(function(group){\r\n\t\t\tgroup.wipe();\r\n\t\t});\r\n\t}\r\n\r\n\tpullGroupListData(groupList) {\r\n\t\tvar groupListData = [];\r\n\r\n\t\tgroupList.forEach((group) => {\r\n\t\t\tvar groupHeader = {};\r\n\t\t\tgroupHeader.level = 0;\r\n\t\t\tgroupHeader.rowCount = 0;\r\n\t\t\tgroupHeader.headerContent = \"\";\r\n\t\t\tvar childData = [];\r\n\r\n\t\t\tif (group.hasSubGroups) {\r\n\t\t\t\tchildData = this.pullGroupListData(group.groupList);\r\n\r\n\t\t\t\tgroupHeader.level = group.level;\r\n\t\t\t\tgroupHeader.rowCount = childData.length - group.groupList.length; // data length minus number of sub-headers\r\n\t\t\t\tgroupHeader.headerContent = group.generator(group.key, groupHeader.rowCount, group.rows, group);\r\n\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\t\t\t\tgroupListData = groupListData.concat(childData);\r\n\t\t\t}\r\n\r\n\t\t\telse {\r\n\t\t\t\tgroupHeader.level = group.level;\r\n\t\t\t\tgroupHeader.headerContent = group.generator(group.key, group.rows.length, group.rows, group);\r\n\t\t\t\tgroupHeader.rowCount = group.getRows().length;\r\n\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\r\n\t\t\t\tgroup.getRows().forEach((row) => {\r\n\t\t\t\t\tgroupListData.push(row.getData(\"data\"));\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn groupListData\r\n\t}\r\n\r\n\tgetGroupedData(){\r\n\r\n\t\treturn this.pullGroupListData(this.groupList);\r\n\t}\r\n\r\n\tgetRowGroup(row){\r\n\t\tvar match = false;\r\n\r\n\t\tif(this.options(\"dataTree\")){\r\n\t\t\trow = this.table.modules.dataTree.getTreeParentRoot(row);\r\n\t\t}\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\tvar result = group.getRowGroup(row);\r\n\r\n\t\t\tif(result){\r\n\t\t\t\tmatch = result;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tcountGroups(){\r\n\t\treturn this.groupList.length;\r\n\t}\r\n\r\n\tgenerateGroups(rows){\r\n\t\tvar oldGroups = this.groups;\r\n\r\n\t\tthis.groups = {};\r\n\t\tthis.groupList = [];\r\n\r\n\t\tif(this.allowedValues && this.allowedValues[0]){\r\n\t\t\tthis.allowedValues[0].forEach((value) => {\r\n\t\t\t\tthis.createGroup(value, 0, oldGroups);\r\n\t\t\t});\r\n\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.assignRowToExistingGroup(row, oldGroups);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.assignRowToGroup(row, oldGroups);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tcreateGroup(groupID, level, oldGroups){\r\n\t\tvar groupKey = level + \"_\" + groupID,\r\n\t\tgroup;\r\n\r\n\t\toldGroups = oldGroups || [];\r\n\r\n\t\tgroup = new Group(this, false, level, groupID, this.groupIDLookups[0].field, this.headerGenerator[0], oldGroups[groupKey]);\r\n\r\n\t\tthis.groups[groupKey] = group;\r\n\t\tthis.groupList.push(group);\r\n\t}\r\n\r\n\tassignRowToExistingGroup(row, oldGroups){\r\n\t\tvar groupID = this.groupIDLookups[0].func(row.getData()),\r\n\t\tgroupKey = \"0_\" + groupID;\r\n\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t}\r\n\t}\r\n\r\n\tassignRowToGroup(row, oldGroups){\r\n\t\tvar groupID = this.groupIDLookups[0].func(row.getData()),\r\n\t\tnewGroupNeeded = !this.groups[\"0_\" + groupID];\r\n\r\n\t\tif(newGroupNeeded){\r\n\t\t\tthis.createGroup(groupID, 0, oldGroups);\r\n\t\t}\r\n\r\n\t\tthis.groups[\"0_\" + groupID].addRow(row);\r\n\r\n\t\treturn !newGroupNeeded;\r\n\t}\r\n\r\n\treassignRowToGroup(row){\r\n\t\tif(row.type === \"row\"){\r\n\t\t\tvar oldRowGroup = row.modules.group,\r\n\t\t\toldGroupPath = oldRowGroup.getPath(),\r\n\t\t\tnewGroupPath = this.getExpectedPath(row),\r\n\t\t\tsamePath = true;\r\n\r\n\t\t\t// figure out if new group path is the same as old group path\r\n\t\t\tvar samePath = (oldGroupPath.length == newGroupPath.length) && oldGroupPath.every((element, index) => {\r\n\t\t\t\treturn element === newGroupPath[index];\r\n\t\t\t});\r\n\r\n\t\t\t// refresh if they new path and old path aren't the same (aka the row's groupings have changed)\r\n\t\t\tif(!samePath) {\r\n\t\t\t\toldRowGroup.removeRow(row);\r\n\t\t\t\tthis.assignRowToGroup(row, this.groups);\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgetExpectedPath(row) {\r\n\t\tvar groupPath = [], rowData = row.getData();\r\n\r\n\t\tthis.groupIDLookups.forEach((groupId) => {\r\n\t\t\tgroupPath.push(groupId.func(rowData));\r\n\t\t});\r\n\r\n\t\treturn groupPath;\r\n\t}\r\n\r\n\tupdateGroupRows(force){\r\n\t\tvar output = [],\r\n\t\toldRowCount;\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\toutput = output.concat(group.getHeadersAndRows());\r\n\t\t});\r\n\r\n\t\tif(force){\r\n\t\t\tthis.refreshData(true, this.displayHandler);\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tscrollHeaders(left){\r\n\t\tif(this.table.options.renderHorizontal === \"virtual\"){\r\n\t\t\tleft -= this.table.columnManager.renderer.vDomPadLeft;\r\n\t\t}\r\n\r\n\t\tleft = left + \"px\";\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\tgroup.scrollHeader(left);\r\n\t\t});\r\n\t}\r\n\r\n\tremoveGroup(group){\r\n\t\tvar groupKey = group.level + \"_\" + group.key,\r\n\t\tindex;\r\n\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tdelete this.groups[groupKey];\r\n\r\n\t\t\tindex = this.groupList.indexOf(group);\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.groupList.splice(index, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nGroupRows.moduleName = \"groupRows\";\r\n\r\nexport default GroupRows;","export default {\r\n\tcellEdit: function(action){\r\n\t\taction.component.setValueProcessData(action.data.oldValue);\r\n\t\taction.component.cellRendered();\r\n\t},\r\n\r\n\trowAdd: function(action){\r\n\t\taction.component.deleteActual();\r\n\t},\r\n\r\n\trowDelete: function(action){\r\n\t\tvar newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index);\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tthis.table.modules.groupRows.updateGroupRows(true);\r\n\t\t}\r\n\r\n\t\tthis._rebindRow(action.component, newRow);\r\n\t},\r\n\r\n\trowMove: function(action){\r\n\t\tthis.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posFrom], !action.data.after);\r\n\t\tthis.table.rowManager.redraw();\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\nimport Row from '../../core/row/Row.js';\r\nimport Cell from '../../core/cell/Cell.js';\r\n\r\nimport defaultUndoers from './defaults/undoers.js';\r\nimport defaultRedoers from './defaults/redoers.js';\r\n\r\nclass History extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.history = [];\r\n\t\tthis.index = -1;\r\n\r\n\t\tthis.registerTableOption(\"history\", false); //enable edit history\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.history){\r\n\t\t\tthis.subscribe(\"cell-value-updated\", this.cellUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"cell-delete\", this.clearComponentHistory.bind(this));\r\n\t\t\tthis.subscribe(\"row-delete\", this.rowDeleted.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.clear.bind(this));\r\n\t\t\tthis.subscribe(\"row-added\", this.rowAdded.bind(this));\r\n\t\t\tthis.subscribe(\"row-move\", this.rowMoved.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"undo\", this.undo.bind(this));\r\n\t\tthis.registerTableFunction(\"redo\", this.redo.bind(this));\r\n\t\tthis.registerTableFunction(\"getHistoryUndoSize\", this.getHistoryUndoSize.bind(this));\r\n\t\tthis.registerTableFunction(\"getHistoryRedoSize\", this.getHistoryRedoSize.bind(this));\r\n\t\tthis.registerTableFunction(\"clearHistory\", this.clear.bind(this));\r\n\t}\r\n\r\n\trowMoved(from, to, after){\r\n\t\tthis.action(\"rowMove\", from, {posFrom:this.table.rowManager.getRowPosition(from), posTo:this.table.rowManager.getRowPosition(to), to:to, after:after});\r\n\t}\r\n\r\n\trowAdded(row, data, pos, index){\r\n\t\tthis.action(\"rowAdd\", row, {data:data, pos:pos, index:index});\r\n\t}\r\n\r\n\trowDeleted(row){\r\n\t\tvar index, rows;\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\r\n\t\t\trows = row.getComponent().getGroup().rows\r\n\t\t\tindex = rows.indexOf(row);\r\n\r\n\t\t\tif(index){\r\n\t\t\t\tindex = rows[index-1];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tindex = row.table.rowManager.getRowIndex(row);\r\n\r\n\t\t\tif(index){\r\n\t\t\t\tindex = row.table.rowManager.rows[index-1];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.action(\"rowDelete\", row, {data:row.getData(), pos:!index, index:index});\r\n\t}\r\n\r\n\tcellUpdated(cell){\r\n\t\tthis.action(\"cellEdit\", cell, {oldValue:cell.oldValue, newValue:cell.value});\r\n\t}\r\n\r\n\tclear(){\r\n\t\tthis.history = [];\r\n\t\tthis.index = -1;\r\n\t}\r\n\r\n\taction(type, component, data){\r\n\t\tthis.history = this.history.slice(0, this.index + 1);\r\n\r\n\t\tthis.history.push({\r\n\t\t\ttype:type,\r\n\t\t\tcomponent:component,\r\n\t\t\tdata:data,\r\n\t\t});\r\n\r\n\t\tthis.index ++;\r\n\t}\r\n\r\n\tgetHistoryUndoSize(){\r\n\t\treturn this.index + 1;\r\n\t}\r\n\r\n\tgetHistoryRedoSize(){\r\n\t\treturn this.history.length - (this.index + 1);\r\n\t}\r\n\r\n\tclearComponentHistory(component){\r\n\t\tvar index = this.history.findIndex(function(item){\r\n\t\t\treturn item.component === component;\r\n\t\t});\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.history.splice(index, 1);\r\n\t\t\tif(index <= this.index){\r\n\t\t\t\tthis.index--;\r\n\t\t\t}\r\n\r\n\t\t\tthis.clearComponentHistory(component);\r\n\t\t}\r\n\t}\r\n\r\n\tundo(){\r\n\t\tif(this.index > -1){\r\n\t\t\tlet action = this.history[this.index];\r\n\r\n\t\t\tHistory.undoers[action.type].call(this, action);\r\n\r\n\t\t\tthis.index--;\r\n\r\n\t\t\tthis.dispatchExternal(\"historyUndo\", action.type, action.component.getComponent(), action.data);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"History Undo Error - No more history to undo\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tredo(){\r\n\t\tif(this.history.length-1 > this.index){\r\n\r\n\t\t\tthis.index++;\r\n\r\n\t\t\tlet action = this.history[this.index];\r\n\r\n\t\t\tHistory.redoers[action.type].call(this, action);\r\n\r\n\t\t\tthis.dispatchExternal(\"historyRedo\", action.type, action.component.getComponent(), action.data);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"History Redo Error - No more history to redo\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//rebind rows to new element after deletion\r\n\t_rebindRow(oldRow, newRow){\r\n\t\tthis.history.forEach(function(action){\r\n\t\t\tif(action.component instanceof Row){\r\n\t\t\t\tif(action.component === oldRow){\r\n\t\t\t\t\taction.component = newRow;\r\n\t\t\t\t}\r\n\t\t\t}else if(action.component instanceof Cell){\r\n\t\t\t\tif(action.component.row === oldRow){\r\n\t\t\t\t\tvar field = action.component.column.getField();\r\n\r\n\t\t\t\t\tif(field){\r\n\t\t\t\t\t\taction.component = newRow.getCell(field);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n\r\nHistory.moduleName = \"history\";\r\n\r\n//load defaults\r\nHistory.undoers = defaultUndoers;\r\nHistory.redoers = defaultRedoers;\r\n\r\nexport default History;","import Module from '../../core/Module.js';\r\nimport Column from '../../core/column/Column.js';\r\n\r\nclass HtmlTableImport extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.fieldIndex = [];\r\n\t\tthis.hasIndex = false;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.tableElementCheck();\r\n\t}\r\n\r\n\ttableElementCheck(){\r\n\t\tif(this.table.originalElement && this.table.originalElement.tagName === \"TABLE\"){\r\n\t\t\tif(this.table.originalElement.childNodes.length){\r\n\t\t\t\tthis.parseTable();\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Unable to parse data from empty table tag, Tabulator should be initialized on a div tag unless importing data from a table element.\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tparseTable(){\r\n\t\tvar element = this.table.originalElement,\r\n\t\toptions = this.table.options,\r\n\t\tcolumns = options.columns,\r\n\t\theaders = element.getElementsByTagName(\"th\"),\r\n\t\trows = element.getElementsByTagName(\"tbody\")[0],\r\n\t\tdata = [],\r\n\t\tnewTable;\r\n\r\n\t\tthis.hasIndex = false;\r\n\r\n\t\tthis.dispatchExternal(\"htmlImporting\");\r\n\r\n\t\trows = rows ? rows.getElementsByTagName(\"tr\") : [];\r\n\r\n\t\t//check for Tabulator inline options\r\n\t\tthis._extractOptions(element, options);\r\n\r\n\t\tif(headers.length){\r\n\t\t\tthis._extractHeaders(headers, rows);\r\n\t\t}else{\r\n\t\t\tthis._generateBlankHeaders(headers, rows);\r\n\t\t}\r\n\r\n\t\t//iterate through table rows and build data set\r\n\t\tfor(var index = 0; index < rows.length; index++){\r\n\t\t\tvar row = rows[index],\r\n\t\t\tcells = row.getElementsByTagName(\"td\"),\r\n\t\t\titem = {};\r\n\r\n\t\t\t//create index if the dont exist in table\r\n\t\t\tif(!this.hasIndex){\r\n\t\t\t\titem[options.index] = index;\r\n\t\t\t}\r\n\r\n\t\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\t\tvar cell = cells[i];\r\n\t\t\t\tif(typeof this.fieldIndex[i] !== \"undefined\"){\r\n\t\t\t\t\titem[this.fieldIndex[i]] = cell.innerHTML;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//add row data to item\r\n\t\t\tdata.push(item);\r\n\t\t}\r\n\r\n\t\toptions.data = data;\r\n\r\n\t\tthis.dispatchExternal(\"htmlImported\");\r\n\t}\r\n\r\n\t//extract tabulator attribute options\r\n\t_extractOptions(element, options, defaultOptions){\r\n\t\tvar attributes = element.attributes;\r\n\t\tvar optionsArr = defaultOptions ? Object.keys(defaultOptions) : Object.keys(options);\r\n\t\tvar optionsList = {};\r\n\r\n\t\toptionsArr.forEach((item) => {\r\n\t\t\toptionsList[item.toLowerCase()] = item;\r\n\t\t});\r\n\r\n\t\tfor(var index in attributes){\r\n\t\t\tvar attrib = attributes[index];\r\n\t\t\tvar name;\r\n\r\n\t\t\tif(attrib && typeof attrib == \"object\" && attrib.name && attrib.name.indexOf(\"tabulator-\") === 0){\r\n\t\t\t\tname = attrib.name.replace(\"tabulator-\", \"\");\r\n\r\n\t\t\t\tif(typeof optionsList[name] !== \"undefined\"){\r\n\t\t\t\t\toptions[optionsList[name]] = this._attribValue(attrib.value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//get value of attribute\r\n\t_attribValue(value){\r\n\t\tif(value === \"true\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif(value === \"false\"){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\t//find column if it has already been defined\r\n\t_findCol(title){\r\n\t\tvar match = this.table.options.columns.find((column) => {\r\n\t\t\treturn column.title === title;\r\n\t\t});\r\n\r\n\t\treturn match || false;\r\n\t}\r\n\r\n\t//extract column from headers\r\n\t_extractHeaders(headers, rows){\r\n\t\tfor(var index = 0; index < headers.length; index++){\r\n\t\t\tvar header = headers[index],\r\n\t\t\texists = false,\r\n\t\t\tcol = this._findCol(header.textContent),\r\n\t\t\twidth, attributes;\r\n\r\n\t\t\tif(col){\r\n\t\t\t\texists = true;\r\n\t\t\t}else{\r\n\t\t\t\tcol = {title:header.textContent.trim()};\r\n\t\t\t}\r\n\r\n\t\t\tif(!col.field) {\r\n\t\t\t\tcol.field = header.textContent.trim().toLowerCase().replace(\" \", \"_\");\r\n\t\t\t}\r\n\r\n\t\t\twidth = header.getAttribute(\"width\");\r\n\r\n\t\t\tif(width && !col.width)\t{\r\n\t\t\t\tcol.width = width;\r\n\t\t\t}\r\n\r\n\t\t\t//check for Tabulator inline options\r\n\t\t\tthis._extractOptions(header, col, this.table.columnManager.optionsList.registeredDefaults);\r\n\r\n\t\t\tthis.fieldIndex[index] = col.field;\r\n\r\n\t\t\tif(col.field == this.table.options.index){\r\n\t\t\t\tthis.hasIndex = true;\r\n\t\t\t}\r\n\r\n\t\t\tif(!exists){\r\n\t\t\t\tthis.table.options.columns.push(col);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\r\n\t//generate blank headers\r\n\t_generateBlankHeaders(headers, rows){\r\n\t\tfor(var index = 0; index < headers.length; index++){\r\n\t\t\tvar header = headers[index],\r\n\t\t\tcol = {title:\"\", field:\"col\" + index};\r\n\r\n\t\t\tthis.fieldIndex[index] = col.field;\r\n\r\n\t\t\tvar width = header.getAttribute(\"width\");\r\n\r\n\t\t\tif(width){\r\n\t\t\t\tcol.width = width;\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.options.columns.push(col);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nHtmlTableImport.moduleName = \"htmlTableImport\";\r\n\r\nexport default HtmlTableImport;","export default {\r\n\tcellEdit: function(action){\r\n\t\taction.component.setValueProcessData(action.data.newValue);\r\n\t\taction.component.cellRendered();\r\n\t},\r\n\r\n\trowAdd: function(action){\r\n\t\tvar newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index);\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tthis.table.modules.groupRows.updateGroupRows(true);\r\n\t\t}\r\n\r\n\t\tthis._rebindRow(action.component, newRow);\r\n\t},\r\n\r\n\trowDelete:function(action){\r\n\t\taction.component.deleteActual();\r\n\t},\r\n\r\n\trowMove: function(action){\r\n\t\tthis.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posTo], action.data.after);\r\n\t\tthis.table.rowManager.redraw();\r\n\t},\r\n};","function csvImporter(input){\r\n var data = [],\r\n row = 0, \r\n col = 0,\r\n inQuote = false;\r\n \r\n //Iterate over each character\r\n for (let index = 0; index < input.length; index++) {\r\n let char = input[index], \r\n nextChar = input[index+1]; \r\n \r\n //Initialize empty row\r\n if(!data[row]){\r\n data[row] = [];\r\n }\r\n\r\n //Initialize empty column\r\n if(!data[row][col]){\r\n data[row][col] = \"\";\r\n }\r\n \r\n //Handle quotation mark inside string\r\n if (char == '\"' && inQuote && nextChar == '\"') { \r\n data[row][col] += char; \r\n index++;\r\n continue; \r\n }\r\n \r\n //Begin / End Quote\r\n if (char == '\"') { \r\n inQuote = !inQuote;\r\n continue;\r\n }\r\n \r\n //Next column (if not in quote)\r\n if (char == ',' && !inQuote) { \r\n col++;\r\n continue; \r\n }\r\n \r\n //New row if new line and not in quote (CRLF) \r\n if (char == '\\r' && nextChar == '\\n' && !inQuote) { \r\n col = 0; \r\n row++; \r\n index++; \r\n continue; \r\n }\r\n \r\n //New row if new line and not in quote (CR or LF) \r\n if ((char == '\\r' || char == '\\n') && !inQuote) { \r\n col = 0;\r\n row++;\r\n continue; \r\n }\r\n\r\n //Normal Character, append to column\r\n data[row][col] += char;\r\n }\r\n\r\n return data;\r\n}\r\n\r\nexport default csvImporter;","import Module from '../../core/Module.js';\r\n\r\nimport defaultImporters from './defaults/importers.js';\r\n\r\nclass Import extends Module{\r\n \r\n constructor(table){\r\n super(table);\r\n \r\n this.registerTableOption(\"importFormat\");\r\n this.registerTableOption(\"importReader\", \"text\");\r\n }\r\n \r\n initialize(){\r\n this.registerTableFunction(\"import\", this.importFromFile.bind(this));\r\n\r\n if(this.table.options.importFormat){\r\n this.subscribe(\"data-loading\", this.loadDataCheck.bind(this), 10);\r\n this.subscribe(\"data-load\", this.loadData.bind(this), 10);\r\n }\r\n }\r\n\r\n loadDataCheck(data){\r\n return typeof data === \"string\";\r\n }\r\n\r\n loadData(data, params, config, silent, previousData){\r\n return this.importData(this.lookupImporter(), data)\r\n .then(this.structureData.bind(this))\r\n .catch((err) => {\r\n console.error(\"Import Error:\", err || \"Unable to import data\")\r\n return Promise.reject(err);\r\n })\r\n }\r\n\r\n lookupImporter(importFormat){\r\n var importer;\r\n \r\n if(!importFormat){\r\n importFormat = this.table.options.importFormat;\r\n }\r\n \r\n if(typeof importFormat === \"string\"){\r\n importer = Import.importers[importFormat];\r\n }else{\r\n importer = importFormat;\r\n }\r\n\r\n if(!importer){\r\n console.error(\"Import Error - Importer not found:\", importFormat);\r\n }\r\n \r\n return importer;\r\n }\r\n \r\n importFromFile(importFormat, extension){\r\n var importer = this.lookupImporter(importFormat);\r\n \r\n if(importer){\r\n return this.pickFile(extension)\r\n .then(this.importData.bind(this, importer))\r\n .then(this.structureData.bind(this))\r\n .then(this.setData.bind(this))\r\n .catch((err) => {\r\n console.error(\"Import Error:\", err || \"Unable to import file\")\r\n return Promise.reject(err);\r\n })\r\n }\r\n }\r\n \r\n pickFile(extensions){\r\n return new Promise((resolve, reject) => {\r\n var input = document.createElement(\"input\");\r\n input.type = \"file\";\r\n input.accept = extensions;\r\n \r\n input.addEventListener(\"change\", (e) => {\r\n var file = input.files[0],\r\n reader = new FileReader(),\r\n data;\r\n \r\n switch(this.table.options.importReader){\r\n case \"buffer\":\r\n reader.readAsArrayBuffer(file);\r\n break;\r\n\r\n case \"binary\":\r\n reader.readAsBinaryString(file);\r\n break;\r\n\r\n case \"url\":\r\n reader.readAsDataURL(file);\r\n break;\r\n\r\n case \"text\":\r\n default:\r\n reader.readAsText(file);\r\n }\r\n \r\n reader.onload = (e) => {\r\n resolve(reader.result)\r\n };\r\n \r\n reader.onerror = (e) => {\r\n console.warn(\"File Load Error - Unable to read file\");\r\n reject();\r\n };\r\n });\r\n \r\n input.click();\r\n });\r\n }\r\n \r\n importData(importer, fileContents){\r\n var data = importer.call(this.table, fileContents);\r\n \r\n if(data instanceof Promise){\r\n return data;\r\n }else{\r\n return data ? Promise.resolve(data) : Promise.reject();\r\n }\r\n }\r\n\r\n structureData(parsedData){\r\n var data = [];\r\n \r\n if(Array.isArray(parsedData) && parsedData.length && Array.isArray(parsedData[0])){\r\n if(this.table.options.autoColumns){\r\n data = this.structureArrayToObject(parsedData);\r\n }else{\r\n data = this.structureArrayToColumns(parsedData);\r\n }\r\n\r\n return data;\r\n }else{\r\n return parsedData;\r\n }\r\n }\r\n\r\n structureArrayToObject(parsedData){\r\n var columns = parsedData.shift();\r\n\r\n var data = parsedData.map((values) => {\r\n var row = {};\r\n\r\n columns.forEach((key, i) => {\r\n row[key] = values[i];\r\n })\r\n\r\n return row;\r\n })\r\n\r\n return data;\r\n }\r\n\r\n structureArrayToColumns(parsedData){\r\n var data = [],\r\n columns = this.table.getColumns();\r\n\r\n //remove first row if it is the column names\r\n if(columns[0] && parsedData[0][0]){\r\n if(columns[0].getDefinition().title === parsedData[0][0]){\r\n parsedData.shift();\r\n }\r\n }\r\n \r\n //convert row arrays to objects\r\n parsedData.forEach((rowData) => {\r\n var row = {};\r\n\r\n rowData.forEach((value, index) => {\r\n var column = columns[index];\r\n\r\n if(column){\r\n row[column.getField()] = value;\r\n }\r\n })\r\n\r\n data.push(row);\r\n });\r\n\r\n return data;\r\n }\r\n \r\n setData(data){\r\n return this.table.setData(data);\r\n }\r\n}\r\n\r\nImport.moduleName = \"import\";\r\n\r\n//load defaults\r\nImport.importers = defaultImporters;\r\n\r\nexport default Import;","export default function(input){\r\n try {\r\n return JSON.parse(input);\r\n } catch(e) {\r\n console.warn(\"JSON Import Error - File contents is invalid JSON\", e);\r\n return Promise.reject();\r\n }\r\n}","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport Cell from '../../core/cell/Cell.js';\r\nimport Column from '../../core/column/Column.js';\r\n\r\nclass Interaction extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.eventMap = {\r\n\t\t\t//row events\r\n\t\t\trowClick:\"row-click\",\r\n\t\t\trowDblClick:\"row-dblclick\",\r\n\t\t\trowContext:\"row-contextmenu\",\r\n\t\t\trowMouseEnter:\"row-mouseenter\",\r\n\t\t\trowMouseLeave:\"row-mouseleave\",\r\n\t\t\trowMouseOver:\"row-mouseover\",\r\n\t\t\trowMouseOut:\"row-mouseout\",\r\n\t\t\trowMouseMove:\"row-mousemove\",\r\n\t\t\trowTap:\"row\",\r\n\t\t\trowDblTap:\"row\",\r\n\t\t\trowTapHold:\"row\",\r\n\r\n\t\t\t//cell events\r\n\t\t\tcellClick:\"cell-click\",\r\n\t\t\tcellDblClick:\"cell-dblclick\",\r\n\t\t\tcellContext:\"cell-contextmenu\",\r\n\t\t\tcellMouseEnter:\"cell-mouseenter\",\r\n\t\t\tcellMouseLeave:\"cell-mouseleave\",\r\n\t\t\tcellMouseOver:\"cell-mouseover\",\r\n\t\t\tcellMouseOut:\"cell-mouseout\",\r\n\t\t\tcellMouseMove:\"cell-mousemove\",\r\n\t\t\tcellTap:\"cell\",\r\n\t\t\tcellDblTap:\"cell\",\r\n\t\t\tcellTapHold:\"cell\",\r\n\r\n\t\t\t//column header events\r\n\t\t\theaderClick:\"column-click\",\r\n\t\t\theaderDblClick:\"column-dblclick\",\r\n\t\t\theaderContext:\"column-contextmenu\",\r\n\t\t\theaderMouseEnter:\"column-mouseenter\",\r\n\t\t\theaderMouseLeave:\"column-mouseleave\",\r\n\t\t\theaderMouseOver:\"column-mouseover\",\r\n\t\t\theaderMouseOut:\"column-mouseout\",\r\n\t\t\theaderMouseMove:\"column-mousemove\",\r\n\t\t\theaderTap:\"column\",\r\n\t\t\theaderDblTap:\"column\",\r\n\t\t\theaderTapHold:\"column\",\r\n\r\n\t\t\t//group header\r\n\t\t\tgroupClick:\"group-click\",\r\n\t\t\tgroupDblClick:\"group-dblclick\",\r\n\t\t\tgroupContext:\"group-contextmenu\",\r\n\t\t\tgroupMouseEnter:\"group-mouseenter\",\r\n\t\t\tgroupMouseLeave:\"group-mouseleave\",\r\n\t\t\tgroupMouseOver:\"group-mouseover\",\r\n\t\t\tgroupMouseOut:\"group-mouseout\",\r\n\t\t\tgroupMouseMove:\"group-mousemove\",\r\n\t\t\tgroupTap:\"group\",\r\n\t\t\tgroupDblTap:\"group\",\r\n\t\t\tgroupTapHold:\"group\",\r\n\t\t}\r\n\r\n\t\tthis.subscribers = {};\r\n\r\n\t\tthis.touchSubscribers = {};\r\n\r\n\t\tthis.columnSubscribers = {};\r\n\r\n\t\tthis.touchWatchers = {\r\n\t\t\trow:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tcell:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tcolumn:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tgroup:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.registerColumnOption(\"headerClick\");\r\n\t\tthis.registerColumnOption(\"headerDblClick\");\r\n\t\tthis.registerColumnOption(\"headerContext\");\r\n\t\tthis.registerColumnOption(\"headerMouseEnter\");\r\n\t\tthis.registerColumnOption(\"headerMouseLeave\");\r\n\t\tthis.registerColumnOption(\"headerMouseOver\");\r\n\t\tthis.registerColumnOption(\"headerMouseOut\");\r\n\t\tthis.registerColumnOption(\"headerMouseMove\");\r\n\t\tthis.registerColumnOption(\"headerTap\");\r\n\t\tthis.registerColumnOption(\"headerDblTap\");\r\n\t\tthis.registerColumnOption(\"headerTapHold\");\r\n\r\n\t\tthis.registerColumnOption(\"cellClick\");\r\n\t\tthis.registerColumnOption(\"cellDblClick\");\r\n\t\tthis.registerColumnOption(\"cellContext\");\r\n\t\tthis.registerColumnOption(\"cellMouseEnter\");\r\n\t\tthis.registerColumnOption(\"cellMouseLeave\");\r\n\t\tthis.registerColumnOption(\"cellMouseOver\");\r\n\t\tthis.registerColumnOption(\"cellMouseOut\");\r\n\t\tthis.registerColumnOption(\"cellMouseMove\");\r\n\t\tthis.registerColumnOption(\"cellTap\");\r\n\t\tthis.registerColumnOption(\"cellDblTap\");\r\n\t\tthis.registerColumnOption(\"cellTapHold\");\r\n\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.initializeExternalEvents();\r\n\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this))\r\n\t\tthis.subscribe(\"cell-dblclick\", this.cellContentsSelectionFixer.bind(this))\r\n\t}\r\n\r\n\tcellContentsSelectionFixer(e, cell){\r\n\t\tif(this.table.modExists(\"edit\")){\r\n\t\t\tif (this.table.modules.edit.currentCell === this){\r\n\t\t\t\treturn; //prevent instant selection of editor content\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\ttry{\r\n\t\t\tif (document.selection) { // IE\r\n\t\t\t\tvar range = document.body.createTextRange();\r\n\t\t\t\trange.moveToElementText(this.element);\r\n\t\t\t\trange.select();\r\n\t\t\t} else if (window.getSelection) {\r\n\t\t\t\tvar range = document.createRange();\r\n\t\t\t\trange.selectNode(this.element);\r\n\t\t\t\twindow.getSelection().removeAllRanges();\r\n\t\t\t\twindow.getSelection().addRange(range);\r\n\t\t\t}\r\n\t\t}catch(e){}\r\n\t}\r\n\r\n\tinitializeExternalEvents(){\r\n\t\tfor(let key in this.eventMap){\r\n\t\t\tthis.subscriptionChangeExternal(key, this.subscriptionChanged.bind(this, key))\r\n\t\t}\r\n\t}\r\n\r\n\tsubscriptionChanged(key, added){\r\n\t\tvar index;\r\n\r\n\t\tif(added){\r\n\t\t\tif(!this.subscribers[key]){\r\n\t\t\t\tif(this.eventMap[key].includes(\"-\")){\r\n\t\t\t\t\tthis.subscribers[key] = this.handle.bind(this, key);\r\n\t\t\t\t\tthis.subscribe(this.eventMap[key], this.subscribers[key]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.subscribeTouchEvents(key);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.eventMap[key].includes(\"-\")){\r\n\t\t\t\tif(this.subscribers[key] && !this.columnSubscribers[key] && !this.subscribedExternal(key)){\r\n\t\t\t\t\tthis.unsubscribe(this.eventMap[key], this.subscribers[key]);\r\n\t\t\t\t\tdelete this.subscribers[key];\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.unsubscribeTouchEvents(key);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tsubscribeTouchEvents(key){\r\n\t\tvar type = this.eventMap[key];\r\n\r\n\t\tif(!this.touchSubscribers[type + \"-touchstart\"]){\r\n\t\t\tthis.touchSubscribers[type + \"-touchstart\"] = this.handleTouch.bind(this, type, \"start\");\r\n\t\t\tthis.touchSubscribers[type + \"-touchend\"] = this.handleTouch.bind(this, type, \"end\");\r\n\r\n\t\t\tthis.subscribe(type + \"-touchstart\", this.touchSubscribers[type + \"-touchstart\"]);\r\n\t\t\tthis.subscribe(type + \"-touchend\", this.touchSubscribers[type + \"-touchend\"]);\r\n\t\t}\r\n\r\n\t\tthis.subscribers[key] = true;\r\n\t}\r\n\r\n\tunsubscribeTouchEvents(key){\r\n\t\tvar notouch = true,\r\n\t\ttype = this.eventMap[key];\r\n\r\n\t\tif(this.subscribers[key] && !this.subscribedExternal(key)){\r\n\t\t\tdelete this.subscribers[key];\r\n\r\n\t\t\tfor(let i in this.eventMap){\r\n\t\t\t\tif(this.eventMap[i] === type){\r\n\t\t\t\t\tif(this.subscribers[i]){\r\n\t\t\t\t\t\tnotouch = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(notouch){\r\n\t\t\t\tthis.unsubscribe(type + \"-touchstart\", this.touchSubscribers[type + \"-touchstart\"]);\r\n\t\t\t\tthis.unsubscribe(type + \"-touchend\", this.touchSubscribers[type + \"-touchend\"]);\r\n\r\n\t\t\t\tdelete this.touchSubscribers[type + \"-touchstart\"];\r\n\t\t\t\tdelete this.touchSubscribers[type + \"-touchend\"];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.definition;\r\n\r\n\t\tfor(let key in this.eventMap){\r\n\t\t\tif(def[key]){\r\n\t\t\t\tthis.subscriptionChanged(key, true);\r\n\r\n\t\t\t\tif(!this.columnSubscribers[key]){\r\n\t\t\t\t\tthis.columnSubscribers[key] = [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.columnSubscribers[key].push(column);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\thandle(action, e, component){\r\n\t\tthis.dispatchEvent(action, e, component);\r\n\t}\r\n\r\n\thandleTouch(type, action, e, component){\r\n\t\tvar watchers = this.touchWatchers[type];\r\n\r\n\t\tif(type === \"column\"){\r\n\t\t\ttype = \"header\";\r\n\t\t}\r\n\r\n\t\tswitch(action){\r\n\t\t\tcase \"start\":\r\n\t\t\twatchers.tap = true;\r\n\r\n\t\t\tclearTimeout(watchers.tapHold);\r\n\r\n\t\t\twatchers.tapHold = setTimeout(() => {\r\n\t\t\t\tclearTimeout(watchers.tapHold);\r\n\t\t\t\twatchers.tapHold = null;\r\n\r\n\t\t\t\twatchers.tap = null;\r\n\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\twatchers.tapDbl = null;\r\n\r\n\t\t\t\tthis.dispatchEvent(type + \"TapHold\", e, component);\r\n\t\t\t}, 1000);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"end\":\r\n\t\t\tif(watchers.tap){\r\n\r\n\t\t\t\twatchers.tap = null;\r\n\t\t\t\tthis.dispatchEvent(type + \"Tap\", e, component);\r\n\t\t\t}\r\n\r\n\t\t\tif(watchers.tapDbl){\r\n\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\twatchers.tapDbl = null;\r\n\r\n\t\t\t\tthis.dispatchEvent(type + \"DblTap\", e, component);\r\n\t\t\t}else{\r\n\t\t\t\twatchers.tapDbl = setTimeout(() => {\r\n\t\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\t\twatchers.tapDbl = null;\r\n\t\t\t\t}, 300);\r\n\t\t\t}\r\n\r\n\t\t\tclearTimeout(watchers.tapHold);\r\n\t\t\twatchers.tapHold = null;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tdispatchEvent(action, e, component){\r\n\t\tvar componentObj = component.getComponent(),\r\n\t\tcallback;\r\n\r\n\t\tif(this.columnSubscribers[action]){\r\n\r\n\t\t\tif(component instanceof Cell){\r\n\t\t\t\tcallback = component.column.definition[action];\r\n\t\t\t}else if(component instanceof Column){\r\n\t\t\t\tcallback = component.definition[action];\r\n\t\t\t}\r\n\r\n\t\t\tif(callback){\r\n\t\t\t\tcallback(e, componentObj);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(action, e, componentObj);\r\n\t}\r\n}\r\n\r\nInteraction.moduleName = \"interaction\";\r\n\r\nexport default Interaction;\r\n","export default {\r\n\tnavPrev:\"shift + 9\",\r\n\tnavNext:9,\r\n\tnavUp:38,\r\n\tnavDown:40,\r\n\tscrollPageUp:33,\r\n\tscrollPageDown:34,\r\n\tscrollToStart:36,\r\n\tscrollToEnd:35,\r\n\tundo:[\"ctrl + 90\", \"meta + 90\"],\r\n\tredo:[\"ctrl + 89\", \"meta + 89\"],\r\n\tcopyToClipboard:[\"ctrl + 67\", \"meta + 89\"],\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultBindings from './defaults/bindings.js';\r\nimport defaultActions from './defaults/actions.js';\r\n\r\nclass Keybindings extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.watchKeys = null;\r\n\t\tthis.pressedKeys = null;\r\n\t\tthis.keyupBinding = false;\r\n\t\tthis.keydownBinding = false;\r\n\r\n\t\tthis.registerTableOption(\"keybindings\", {}); //array for keybindings\r\n\t\tthis.registerTableOption(\"tabEndNewRow\", false); //create new row when tab to end of table\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tvar bindings = this.table.options.keybindings,\r\n\t\tmergedBindings = {};\r\n\r\n\t\tthis.watchKeys = {};\r\n\t\tthis.pressedKeys = [];\r\n\r\n\t\tif(bindings !== false){\r\n\t\t\tObject.assign(mergedBindings, Keybindings.bindings)\r\n\t\t\tObject.assign(mergedBindings, bindings)\r\n\r\n\t\t\tthis.mapBindings(mergedBindings);\r\n\t\t\tthis.bindEvents();\r\n\t\t}\r\n\r\n\t\tthis.subscribe(\"table-destroy\", this.clearBindings.bind(this));\r\n\t}\r\n\r\n\tmapBindings(bindings){\r\n\t\tfor(let key in bindings){\r\n\t\t\tif(Keybindings.actions[key]){\r\n\t\t\t\tif(bindings[key]){\r\n\t\t\t\t\tif(typeof bindings[key] !== \"object\"){\r\n\t\t\t\t\t\tbindings[key] = [bindings[key]];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbindings[key].forEach((binding) => {\r\n\t\t\t\t\t\tvar bindingList = Array.isArray(binding) ? binding : [binding];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tbindingList.forEach((item) => {\r\n\t\t\t\t\t\t\tthis.mapBinding(key, item);\r\n\t\t\t\t\t\t});\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Key Binding Error - no such action:\", key);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmapBinding(action, symbolsList){\r\n\t\tvar binding = {\r\n\t\t\taction: Keybindings.actions[action],\r\n\t\t\tkeys: [],\r\n\t\t\tctrl: false,\r\n\t\t\tshift: false,\r\n\t\t\tmeta: false,\r\n\t\t};\r\n\r\n\t\tvar symbols = symbolsList.toString().toLowerCase().split(\" \").join(\"\").split(\"+\");\r\n\r\n\t\tsymbols.forEach((symbol) => {\r\n\t\t\tswitch(symbol){\r\n\t\t\t\tcase \"ctrl\":\r\n\t\t\t\tbinding.ctrl = true;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"shift\":\r\n\t\t\t\tbinding.shift = true;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"meta\":\r\n\t\t\t\tbinding.meta = true;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\tsymbol = isNaN(symbol) ? symbol.toUpperCase().charCodeAt(0) : parseInt(symbol);\r\n\t\t\t\tbinding.keys.push(symbol);\r\n\r\n\t\t\t\tif(!this.watchKeys[symbol]){\r\n\t\t\t\t\tthis.watchKeys[symbol] = [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.watchKeys[symbol].push(binding);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tbindEvents(){\r\n\t\tvar self = this;\r\n\r\n\t\tthis.keyupBinding = function(e){\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tvar bindings = self.watchKeys[code];\r\n\r\n\t\t\tif(bindings){\r\n\r\n\t\t\t\tself.pressedKeys.push(code);\r\n\r\n\t\t\t\tbindings.forEach(function(binding){\r\n\t\t\t\t\tself.checkBinding(e, binding);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.keydownBinding = function(e){\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tvar bindings = self.watchKeys[code];\r\n\r\n\t\t\tif(bindings){\r\n\r\n\t\t\t\tvar index = self.pressedKeys.indexOf(code);\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tself.pressedKeys.splice(index, 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.table.element.addEventListener(\"keydown\", this.keyupBinding);\r\n\r\n\t\tthis.table.element.addEventListener(\"keyup\", this.keydownBinding);\r\n\t}\r\n\r\n\tclearBindings(){\r\n\t\tif(this.keyupBinding){\r\n\t\t\tthis.table.element.removeEventListener(\"keydown\", this.keyupBinding);\r\n\t\t}\r\n\r\n\t\tif(this.keydownBinding){\r\n\t\t\tthis.table.element.removeEventListener(\"keyup\", this.keydownBinding);\r\n\t\t}\r\n\t}\r\n\r\n\tcheckBinding(e, binding){\r\n\t\tvar match = true;\r\n\r\n\t\tif(e.ctrlKey == binding.ctrl && e.shiftKey == binding.shift && e.metaKey == binding.meta){\r\n\t\t\tbinding.keys.forEach((key) => {\r\n\t\t\t\tvar index = this.pressedKeys.indexOf(key);\r\n\r\n\t\t\t\tif(index == -1){\r\n\t\t\t\t\tmatch = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tbinding.action.call(this, e);\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\nKeybindings.moduleName = \"keybindings\";\r\n\r\n//load defaults\r\nKeybindings.bindings = defaultBindings;\r\nKeybindings.actions = defaultActions;\r\n\r\nexport default Keybindings;","import Module from '../../core/Module.js';\r\n\r\nclass Menu extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.menuContainer = null;\r\n\t\tthis.nestedMenuBlock = false;\r\n\t\t\r\n\t\tthis.currentComponent = null;\r\n\t\tthis.rootPopup = null;\r\n\t\t\r\n\t\tthis.columnSubscribers = {};\r\n\t\t\r\n\t\tthis.registerTableOption(\"menuContainer\", undefined); //deprecated\r\n\r\n\t\tthis.registerTableOption(\"rowContextMenu\", false);\r\n\t\tthis.registerTableOption(\"rowClickMenu\", false);\r\n\t\tthis.registerTableOption(\"groupContextMenu\", false);\r\n\t\tthis.registerTableOption(\"groupClickMenu\", false);\r\n\t\t\r\n\t\tthis.registerColumnOption(\"headerContextMenu\");\r\n\t\tthis.registerColumnOption(\"headerClickMenu\");\r\n\t\tthis.registerColumnOption(\"headerMenu\");\r\n\t\tthis.registerColumnOption(\"headerMenuIcon\");\r\n\t\tthis.registerColumnOption(\"contextMenu\");\r\n\t\tthis.registerColumnOption(\"clickMenu\");\r\n\t\t\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.deprecationCheck();\r\n\t\tthis.initializeRowWatchers();\r\n\t\tthis.initializeGroupWatchers();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\r\n\tdeprecationCheck(){\r\n\t\tif(typeof this.table.options.menuContainer !== \"undefined\"){\r\n\t\t\tconsole.warn(\"Use of the menuContainer option is now deprecated. Please use the popupContainer option instead\");\r\n\r\n\t\t\tthis.table.options.popupContainer = this.table.options.menuContainer;\r\n\t\t}\r\n\t}\t\r\n\t\r\n\tinitializeRowWatchers(){\r\n\t\tif(this.table.options.rowContextMenu){\r\n\t\t\tthis.subscribe(\"row-contextmenu\", this.loadMenuEvent.bind(this, this.table.options.rowContextMenu));\r\n\t\t\tthis.table.on(\"rowTapHold\", this.loadMenuEvent.bind(this, this.table.options.rowContextMenu));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.rowClickMenu){\r\n\t\t\tthis.subscribe(\"row-click\", this.loadMenuEvent.bind(this, this.table.options.rowClickMenu));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeGroupWatchers(){\r\n\t\tif(this.table.options.groupContextMenu){\r\n\t\t\tthis.subscribe(\"group-contextmenu\", this.loadMenuEvent.bind(this, this.table.options.groupContextMenu));\r\n\t\t\tthis.table.on(\"groupTapHold\", this.loadMenuEvent.bind(this, this.table.options.groupContextMenu));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.groupClickMenu){\r\n\t\t\tthis.subscribe(\"group-click\", this.loadMenuEvent.bind(this, this.table.options.groupClickMenu));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar options = [\"headerContextMenu\", \"headerClickMenu\"],\r\n\t\tdef = column.definition;\r\n\t\t\r\n\t\t//handle column events\r\n\t\tif(def.headerContextMenu && !this.columnSubscribers.headerContextMenu){\r\n\t\t\tthis.columnSubscribers.headerContextMenu = this.loadMenuTableColumnEvent.bind(this, \"headerContextMenu\");\r\n\t\t\tthis.subscribe(\"column-contextmenu\", this.columnSubscribers.headerContextMenu);\r\n\t\t\tthis.table.on(\"headerTapHold\", this.loadMenuTableColumnEvent.bind(this, \"headerContextMenu\"))\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerClickMenu && !this.columnSubscribers.headerClickMenu){\r\n\t\t\tthis.columnSubscribers.headerClickMenu = this.loadMenuTableColumnEvent.bind(this, \"headerClickMenu\");\r\n\t\t\tthis.subscribe(\"column-click\", this.columnSubscribers.headerClickMenu);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerMenu){\r\n\t\t\tthis.initializeColumnHeaderMenu(column);\r\n\t\t}\r\n\t\t\r\n\t\t//handle cell events\r\n\t\tif(def.contextMenu && !this.columnSubscribers.contextMenu){\r\n\t\t\tthis.columnSubscribers.contextMenu = this.loadMenuTableCellEvent.bind(this, \"contextMenu\");\r\n\t\t\tthis.subscribe(\"cell-contextmenu\", this.columnSubscribers.contextMenu);\r\n\t\t\tthis.table.on(\"cellTapHold\", this.loadMenuTableCellEvent.bind(this, \"contextMenu\"))\r\n\t\t}\r\n\t\t\r\n\t\tif(def.clickMenu && !this.columnSubscribers.clickMenu){\r\n\t\t\tthis.columnSubscribers.clickMenu = this.loadMenuTableCellEvent.bind(this, \"clickMenu\");\r\n\t\t\tthis.subscribe(\"cell-click\", this.columnSubscribers.clickMenu);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumnHeaderMenu(column){\r\n\t\tvar icon = column.definition.headerMenuIcon,\r\n\t\theaderMenuEl;\r\n\t\t\r\n\t\theaderMenuEl = document.createElement(\"span\");\r\n\t\theaderMenuEl.classList.add(\"tabulator-header-popup-button\");\r\n\r\n\t\tif(icon){\r\n\t\t\tif(typeof icon === \"function\"){\r\n\t\t\t\ticon = icon(column.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tif(icon instanceof HTMLElement){\r\n\t\t\t\theaderMenuEl.appendChild(icon);\r\n\t\t\t}else{\r\n\t\t\t\theaderMenuEl.innerHTML = icon;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\theaderMenuEl.innerHTML = \"⋮\";\r\n\t\t}\r\n\t\t\r\n\t\theaderMenuEl.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tthis.loadMenuEvent(column.definition.headerMenu, e, column);\r\n\t\t});\r\n\t\t\r\n\t\tcolumn.titleElement.insertBefore(headerMenuEl, column.titleElement.firstChild);\r\n\t}\r\n\t\r\n\tloadMenuTableCellEvent(option, e, cell){\r\n\t\tif(cell._cell){\r\n\t\t\tcell = cell._cell;\r\n\t\t}\r\n\t\t\r\n\t\tif(cell.column.definition[option]){\r\n\t\t\tthis.loadMenuEvent(cell.column.definition[option], e, cell);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadMenuTableColumnEvent(option, e, column){\r\n\t\tif(column._column){\r\n\t\t\tcolumn = column._column;\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition[option]){\r\n\t\t\tthis.loadMenuEvent(column.definition[option], e, column);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadMenuEvent(menu, e, component){\r\n\t\tif(component._group){\r\n\t\t\tcomponent = component._group;\r\n\t\t}else if(component._row){\r\n\t\t\tcomponent = component._row;\r\n\t\t}\r\n\t\t\r\n\t\tmenu = typeof menu == \"function\" ? menu.call(this.table, e, component.getComponent()) : menu;\r\n\t\t\r\n\t\tthis.loadMenu(e, component, menu);\r\n\t}\r\n\t\r\n\tloadMenu(e, component, menu, parentEl, parentPopup){\r\n\t\tvar touch = !(e instanceof MouseEvent),\t\t\r\n\t\tmenuEl = document.createElement(\"div\"),\r\n\t\tpopup;\r\n\t\t\r\n\t\tmenuEl.classList.add(\"tabulator-menu\");\r\n\t\t\r\n\t\tif(!touch){\r\n\t\t\te.preventDefault();\r\n\t\t}\r\n\t\t\r\n\t\t//abort if no menu set\r\n\t\tif(!menu || !menu.length){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif(!parentEl){\r\n\t\t\tif(this.nestedMenuBlock){\r\n\t\t\t\t//abort if child menu already open\r\n\t\t\t\tif(this.rootPopup){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.nestedMenuBlock = setTimeout(() => {\r\n\t\t\t\t\tthis.nestedMenuBlock = false;\r\n\t\t\t\t}, 100)\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.rootPopup){\r\n\t\t\t\tthis.rootPopup.hide();\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.rootPopup = popup = this.popup(menuEl);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tpopup = parentPopup.child(menuEl);\r\n\t\t}\r\n\t\t\r\n\t\tmenu.forEach((item) => {\r\n\t\t\tvar itemEl = document.createElement(\"div\"),\r\n\t\t\tlabel = item.label,\r\n\t\t\tdisabled = item.disabled;\r\n\t\t\t\r\n\t\t\tif(item.separator){\r\n\t\t\t\titemEl.classList.add(\"tabulator-menu-separator\");\r\n\t\t\t}else{\r\n\t\t\t\titemEl.classList.add(\"tabulator-menu-item\");\r\n\t\t\t\t\r\n\t\t\t\tif(typeof label == \"function\"){\r\n\t\t\t\t\tlabel = label.call(this.table, component.getComponent());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(label instanceof Node){\r\n\t\t\t\t\titemEl.appendChild(label);\r\n\t\t\t\t}else{\r\n\t\t\t\t\titemEl.innerHTML = label;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(typeof disabled == \"function\"){\r\n\t\t\t\t\tdisabled = disabled.call(this.table, component.getComponent());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(disabled){\r\n\t\t\t\t\titemEl.classList.add(\"tabulator-menu-item-disabled\");\r\n\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(item.menu && item.menu.length){\r\n\t\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\tthis.loadMenu(e, component, item.menu, itemEl, popup);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(item.action){\r\n\t\t\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\t\t\titem.action(e, component.getComponent());\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(item.menu && item.menu.length){\r\n\t\t\t\t\titemEl.classList.add(\"tabulator-menu-item-submenu\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmenuEl.appendChild(itemEl);\r\n\t\t});\r\n\t\t\r\n\t\tmenuEl.addEventListener(\"click\", (e) => {\r\n\t\t\tthis.rootPopup.hide();\r\n\t\t});\r\n\t\t\r\n\t\tpopup.show(parentEl || e);\r\n\t\t\r\n\t\tif(popup === this.rootPopup){\r\n\t\t\tthis.rootPopup.hideOnBlur(() => {\r\n\t\t\t\tthis.rootPopup = null;\r\n\t\t\t\t\r\n\t\t\t\tif(this.currentComponent){\r\n\t\t\t\t\tthis.dispatchExternal(\"menuClosed\", this.currentComponent.getComponent());\r\n\t\t\t\t\tthis.currentComponent = null;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.currentComponent = component;\r\n\r\n\t\t\tthis.dispatchExternal(\"menuOpened\", component.getComponent())\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMenu.moduleName = \"menu\";\r\n\r\nexport default Menu;\r\n","export default {\r\n\tkeyBlock:function(e){\r\n\t\te.stopPropagation();\r\n\t\te.preventDefault();\r\n\t},\r\n\tscrollPageUp:function(e){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tnewPos = rowManager.scrollTop - rowManager.element.clientHeight,\r\n\t\tscrollMax = rowManager.element.scrollHeight;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\tif(newPos >= 0){\r\n\t\t\t\trowManager.element.scrollTop = newPos;\r\n\t\t\t}else{\r\n\t\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[0]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tscrollPageDown:function(e){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tnewPos = rowManager.scrollTop + rowManager.element.clientHeight,\r\n\t\tscrollMax = rowManager.element.scrollHeight;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\tif(newPos <= scrollMax){\r\n\t\t\t\trowManager.element.scrollTop = newPos;\r\n\t\t\t}else{\r\n\t\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\r\n\t},\r\n\tscrollToStart:function(e){\r\n\t\tvar rowManager = this.table.rowManager;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[0]);\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tscrollToEnd:function(e){\r\n\t\tvar rowManager = this.table.rowManager;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]);\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tnavPrev:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-prev\", e);\r\n\t},\r\n\r\n\tnavNext:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-next\", e);\r\n\t},\r\n\r\n\tnavLeft:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-left\", e);\r\n\t},\r\n\r\n\tnavRight:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-right\", e);\r\n\t},\r\n\r\n\tnavUp:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-up\", e);\r\n\t},\r\n\r\n\tnavDown:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-down\", e);\r\n\t},\r\n\r\n\tundo:function(e){\r\n\t\tvar cell = false;\r\n\t\tif(this.table.options.history && this.table.modExists(\"history\") && this.table.modExists(\"edit\")){\r\n\r\n\t\t\tcell = this.table.modules.edit.currentCell;\r\n\r\n\t\t\tif(!cell){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tthis.table.modules.history.undo();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tredo:function(e){\r\n\t\tvar cell = false;\r\n\t\tif(this.table.options.history && this.table.modExists(\"history\") && this.table.modExists(\"edit\")){\r\n\r\n\t\t\tcell = this.table.modules.edit.currentCell;\r\n\r\n\t\t\tif(!cell){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tthis.table.modules.history.redo();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tcopyToClipboard:function(e){\r\n\t\tif(!this.table.modules.edit.currentCell){\r\n\t\t\tif(this.table.modExists(\"clipboard\", true)){\r\n\t\t\t\tthis.table.modules.clipboard.copy(false, true);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nclass MoveColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.placeholderElement = this.createPlaceholderElement();\r\n\t\tthis.hoverElement = false; //floating column header element\r\n\t\tthis.checkTimeout = false; //click check timeout holder\r\n\t\tthis.checkPeriod = 250; //period to wait on mousedown to consider this a move and not a click\r\n\t\tthis.moving = false; //currently moving column\r\n\t\tthis.toCol = false; //destination column\r\n\t\tthis.toColAfter = false; //position of moving column relative to the desitnation column\r\n\t\tthis.startX = 0; //starting position within header element\r\n\t\tthis.autoScrollMargin = 40; //auto scroll on edge when within margin\r\n\t\tthis.autoScrollStep = 5; //auto scroll distance in pixels\r\n\t\tthis.autoScrollTimeout = false; //auto scroll timeout\r\n\t\tthis.touchMove = false;\r\n\t\t\r\n\t\tthis.moveHover = this.moveHover.bind(this);\r\n\t\tthis.endMove = this.endMove.bind(this);\r\n\t\t\r\n\t\tthis.registerTableOption(\"movableColumns\", false); //enable movable columns\r\n\t}\r\n\t\r\n\tcreatePlaceholderElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-col\");\r\n\t\tel.classList.add(\"tabulator-col-placeholder\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.movableColumns){\r\n\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar self = this,\r\n\t\tconfig = {},\r\n\t\tcolEl;\r\n\t\t\r\n\t\tif(!column.modules.frozen && !column.isGroup){\r\n\t\t\tcolEl = column.getElement();\r\n\t\t\t\r\n\t\t\tconfig.mousemove = function(e){\r\n\t\t\t\tif(column.parent === self.moving.parent){\r\n\t\t\t\t\tif((((self.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(colEl).left) + self.table.columnManager.element.scrollLeft) > (column.getWidth() / 2)){\r\n\t\t\t\t\t\tif(self.toCol !== column || !self.toColAfter){\r\n\t\t\t\t\t\t\tcolEl.parentNode.insertBefore(self.placeholderElement, colEl.nextSibling);\r\n\t\t\t\t\t\t\tself.moveColumn(column, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(self.toCol !== column || self.toColAfter){\r\n\t\t\t\t\t\t\tcolEl.parentNode.insertBefore(self.placeholderElement, colEl);\r\n\t\t\t\t\t\t\tself.moveColumn(column, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}.bind(self);\r\n\t\t\t\r\n\t\t\tcolEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tself.touchMove = false;\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, column);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tcolEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tself.bindTouchEvents(column);\r\n\t\t}\r\n\t\t\r\n\t\tcolumn.modules.moveColumn = config;\r\n\t}\r\n\t\r\n\tbindTouchEvents(column){\r\n\t\tvar colEl = column.getElement(),\r\n\t\tstartXMove = false, //shifting center position of the cell\r\n\t\tdir = false,\r\n\t\tcurrentCol, nextCol, prevCol, nextColWidth, prevColWidth, nextColWidthLast, prevColWidthLast;\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchstart\", (e) => {\r\n\t\t\tthis.checkTimeout = setTimeout(() => {\r\n\t\t\t\tthis.touchMove = true;\r\n\t\t\t\tcurrentCol = column;\r\n\t\t\t\tnextCol = column.nextColumn();\r\n\t\t\t\tnextColWidth = nextCol ? nextCol.getWidth()/2 : 0;\r\n\t\t\t\tprevCol = column.prevColumn();\r\n\t\t\t\tprevColWidth = prevCol ? prevCol.getWidth()/2 : 0;\r\n\t\t\t\tnextColWidthLast = 0;\r\n\t\t\t\tprevColWidthLast = 0;\r\n\t\t\t\tstartXMove = false;\r\n\t\t\t\t\r\n\t\t\t\tthis.startMove(e, column);\r\n\t\t\t}, this.checkPeriod);\r\n\t\t}, {passive: true});\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchmove\", (e) => {\r\n\t\t\tvar halfCol, diff, moveToCol;\r\n\t\t\t\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.moveHover(e);\r\n\t\t\t\t\r\n\t\t\t\tif(!startXMove){\r\n\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tdiff = e.touches[0].pageX - startXMove;\r\n\t\t\t\t\r\n\t\t\t\tif(diff > 0){\r\n\t\t\t\t\tif(nextCol && diff - nextColWidthLast > nextColWidth){\r\n\t\t\t\t\t\tmoveToCol = nextCol;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(moveToCol !== column){\r\n\t\t\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t\t\t\tmoveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement().nextSibling);\r\n\t\t\t\t\t\t\tthis.moveColumn(moveToCol, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(prevCol && -diff - prevColWidthLast > prevColWidth){\r\n\t\t\t\t\t\tmoveToCol = prevCol;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(moveToCol !== column){\r\n\t\t\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t\t\t\tmoveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement());\r\n\t\t\t\t\t\t\tthis.moveColumn(moveToCol, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(moveToCol){\r\n\t\t\t\t\tcurrentCol = moveToCol;\r\n\t\t\t\t\tnextCol = moveToCol.nextColumn();\r\n\t\t\t\t\tnextColWidthLast = nextColWidth;\r\n\t\t\t\t\tnextColWidth = nextCol ? nextCol.getWidth() / 2 : 0;\r\n\t\t\t\t\tprevCol = moveToCol.prevColumn();\r\n\t\t\t\t\tprevColWidthLast = prevColWidth;\r\n\t\t\t\t\tprevColWidth = prevCol ? prevCol.getWidth() / 2 : 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}, {passive: true});\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchend\", (e) => {\r\n\t\t\tif(this.checkTimeout){\r\n\t\t\t\tclearTimeout(this.checkTimeout);\r\n\t\t\t}\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.endMove(e);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tstartMove(e, column){\r\n\t\tvar element = column.getElement(),\r\n\t\theaderElement = this.table.columnManager.getElement(),\r\n\t\theadersElement = this.table.columnManager.getHeadersElement();\r\n\t\t\r\n\t\tthis.moving = column;\r\n\t\tthis.startX = (this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(element).left;\r\n\t\t\r\n\t\tthis.table.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\t//create placeholder\r\n\t\tthis.placeholderElement.style.width = column.getWidth() + \"px\";\r\n\t\tthis.placeholderElement.style.height = column.getHeight() + \"px\";\r\n\t\t\r\n\t\telement.parentNode.insertBefore(this.placeholderElement, element);\r\n\t\telement.parentNode.removeChild(element);\r\n\t\t\r\n\t\t//create hover element\r\n\t\tthis.hoverElement = element.cloneNode(true);\r\n\t\tthis.hoverElement.classList.add(\"tabulator-moving\");\r\n\t\t\r\n\t\tthis.table.columnManager.getElement().appendChild(this.hoverElement);\r\n\t\t\r\n\t\tthis.hoverElement.style.left = \"0\";\r\n\t\tthis.hoverElement.style.bottom = (headerElement.clientHeight - headersElement.offsetHeight) + \"px\";\r\n\t\t\r\n\t\tif(!this.touchMove){\r\n\t\t\tthis._bindMouseMove();\r\n\t\t\t\r\n\t\t\tdocument.body.addEventListener(\"mousemove\", this.moveHover);\r\n\t\t\tdocument.body.addEventListener(\"mouseup\", this.endMove);\r\n\t\t}\r\n\t\t\r\n\t\tthis.moveHover(e);\r\n\t}\r\n\t\r\n\t_bindMouseMove(){\r\n\t\tthis.table.columnManager.columnsByIndex.forEach(function(column){\r\n\t\t\tif(column.modules.moveColumn.mousemove){\r\n\t\t\t\tcolumn.getElement().addEventListener(\"mousemove\", column.modules.moveColumn.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t_unbindMouseMove(){\r\n\t\tthis.table.columnManager.columnsByIndex.forEach(function(column){\r\n\t\t\tif(column.modules.moveColumn.mousemove){\r\n\t\t\t\tcolumn.getElement().removeEventListener(\"mousemove\", column.modules.moveColumn.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tmoveColumn(column, after){\r\n\t\tvar movingCells = this.moving.getCells();\r\n\t\t\r\n\t\tthis.toCol = column;\r\n\t\tthis.toColAfter = after;\r\n\t\t\r\n\t\tif(after){\r\n\t\t\tcolumn.getCells().forEach(function(cell, i){\r\n\t\t\t\tvar cellEl = cell.getElement(true);\r\n\t\t\t\t\r\n\t\t\t\tif(cellEl.parentNode && movingCells[i]){\r\n\t\t\t\t\tcellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl.nextSibling);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tcolumn.getCells().forEach(function(cell, i){\r\n\t\t\t\tvar cellEl = cell.getElement(true);\r\n\t\t\t\t\r\n\t\t\t\tif(cellEl.parentNode && movingCells[i]){\r\n\t\t\t\t\tcellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tendMove(e){\r\n\t\tif(e.which === 1 || this.touchMove){\r\n\t\t\tthis._unbindMouseMove();\r\n\t\t\t\r\n\t\t\tthis.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling);\r\n\t\t\tthis.placeholderElement.parentNode.removeChild(this.placeholderElement);\r\n\t\t\tthis.hoverElement.parentNode.removeChild(this.hoverElement);\r\n\t\t\t\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-block-select\");\r\n\t\t\t\r\n\t\t\tif(this.toCol){\r\n\t\t\t\tthis.table.columnManager.moveColumnActual(this.moving, this.toCol, this.toColAfter);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.moving = false;\r\n\t\t\tthis.toCol = false;\r\n\t\t\tthis.toColAfter = false;\r\n\t\t\t\r\n\t\t\tif(!this.touchMove){\r\n\t\t\t\tdocument.body.removeEventListener(\"mousemove\", this.moveHover);\r\n\t\t\t\tdocument.body.removeEventListener(\"mouseup\", this.endMove);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveHover(e){\r\n\t\tvar columnHolder = this.table.columnManager.getElement(),\r\n\t\tscrollLeft = columnHolder.scrollLeft,\r\n\t\txPos = ((this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(columnHolder).left) + scrollLeft,\r\n\t\tscrollPos;\r\n\t\t\r\n\t\tthis.hoverElement.style.left = (xPos - this.startX) + \"px\";\r\n\t\t\r\n\t\tif(xPos - scrollLeft < this.autoScrollMargin){\r\n\t\t\tif(!this.autoScrollTimeout){\r\n\t\t\t\tthis.autoScrollTimeout = setTimeout(() => {\r\n\t\t\t\t\tscrollPos = Math.max(0,scrollLeft-5);\r\n\t\t\t\t\tthis.table.rowManager.getElement().scrollLeft = scrollPos;\r\n\t\t\t\t\tthis.autoScrollTimeout = false;\r\n\t\t\t\t}, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(scrollLeft + columnHolder.clientWidth - xPos < this.autoScrollMargin){\r\n\t\t\tif(!this.autoScrollTimeout){\r\n\t\t\t\tthis.autoScrollTimeout = setTimeout(() => {\r\n\t\t\t\t\tscrollPos = Math.min(columnHolder.clientWidth, scrollLeft+5);\r\n\t\t\t\t\tthis.table.rowManager.getElement().scrollLeft = scrollPos;\r\n\t\t\t\t\tthis.autoScrollTimeout = false;\r\n\t\t\t\t}, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMoveColumns.moduleName = \"moveColumn\";\r\n\r\nexport default MoveColumns;\r\n","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nclass MoveRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.placeholderElement = this.createPlaceholderElement();\r\n\t\tthis.hoverElement = false; //floating row header element\r\n\t\tthis.checkTimeout = false; //click check timeout holder\r\n\t\tthis.checkPeriod = 150; //period to wait on mousedown to consider this a move and not a click\r\n\t\tthis.moving = false; //currently moving row\r\n\t\tthis.toRow = false; //destination row\r\n\t\tthis.toRowAfter = false; //position of moving row relative to the desitnation row\r\n\t\tthis.hasHandle = false; //row has handle instead of fully movable row\r\n\t\tthis.startY = 0; //starting Y position within header element\r\n\t\tthis.startX = 0; //starting X position within header element\r\n\r\n\t\tthis.moveHover = this.moveHover.bind(this);\r\n\t\tthis.endMove = this.endMove.bind(this);\r\n\t\tthis.tableRowDropEvent = false;\r\n\r\n\t\tthis.touchMove = false;\r\n\r\n\t\tthis.connection = false;\r\n\t\tthis.connectionSelectorsTables = false;\r\n\t\tthis.connectionSelectorsElements = false;\r\n\t\tthis.connectionElements = [];\r\n\t\tthis.connections = [];\r\n\r\n\t\tthis.connectedTable = false;\r\n\t\tthis.connectedRow = false;\r\n\r\n\t\tthis.registerTableOption(\"movableRows\", false); //enable movable rows\r\n\t\tthis.registerTableOption(\"movableRowsConnectedTables\", false); //tables for movable rows to be connected to\r\n\t\tthis.registerTableOption(\"movableRowsConnectedElements\", false); //other elements for movable rows to be connected to\r\n\t\tthis.registerTableOption(\"movableRowsSender\", false);\r\n\t\tthis.registerTableOption(\"movableRowsReceiver\", \"insert\");\r\n\r\n\t\tthis.registerColumnOption(\"rowHandle\");\r\n\t}\r\n\r\n\tcreatePlaceholderElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-row\");\r\n\t\tel.classList.add(\"tabulator-row-placeholder\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.movableRows){\r\n\t\t\tthis.connectionSelectorsTables = this.table.options.movableRowsConnectedTables;\r\n\t\t\tthis.connectionSelectorsElements = this.table.options.movableRowsConnectedElements;\r\n\r\n\t\t\tthis.connection = this.connectionSelectorsTables || this.connectionSelectorsElements;\r\n\r\n\t\t\tthis.subscribe(\"cell-init\", this.initializeCell.bind(this));\r\n\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeGroupHeader(group){\r\n\t\tvar self = this,\r\n\t\tconfig = {},\r\n\t\trowEl;\r\n\r\n\t\t//inter table drag drop\r\n\t\tconfig.mouseup = function(e){\r\n\t\t\tself.tableRowDrop(e, row);\r\n\t\t}.bind(self);\r\n\r\n\t\t//same table drag drop\r\n\t\tconfig.mousemove = function(e){\r\n\t\t\tif(((e.pageY - Helpers.elOffset(group.element).top) + self.table.rowManager.element.scrollTop) > (group.getHeight() / 2)){\r\n\t\t\t\tif(self.toRow !== group || !self.toRowAfter){\r\n\t\t\t\t\tvar rowEl = group.getElement();\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);\r\n\t\t\t\t\tself.moveRow(group, true);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(self.toRow !== group || self.toRowAfter){\r\n\t\t\t\t\tvar rowEl = group.getElement();\r\n\t\t\t\t\tif(rowEl.previousSibling){\r\n\t\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl);\r\n\t\t\t\t\t\tself.moveRow(group, false);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.bind(self);\r\n\r\n\t\tgroup.modules.moveRow = config;\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\tconfig = {},\r\n\t\trowEl;\r\n\r\n\t\t//inter table drag drop\r\n\t\tconfig.mouseup = function(e){\r\n\t\t\tself.tableRowDrop(e, row);\r\n\t\t}.bind(self);\r\n\r\n\t\t//same table drag drop\r\n\t\tconfig.mousemove = function(e){\r\n\t\t\tvar rowEl = row.getElement();\r\n\r\n\t\t\tif(((e.pageY - Helpers.elOffset(rowEl).top) + self.table.rowManager.element.scrollTop) > (row.getHeight() / 2)){\r\n\t\t\t\tif(self.toRow !== row || !self.toRowAfter){\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);\r\n\t\t\t\t\tself.moveRow(row, true);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(self.toRow !== row || self.toRowAfter){\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl);\r\n\t\t\t\t\tself.moveRow(row, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.bind(self);\r\n\r\n\r\n\t\tif(!this.hasHandle){\r\n\r\n\t\t\trowEl = row.getElement();\r\n\r\n\t\t\trowEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, row);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trowEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.bindTouchEvents(row, row.getElement());\r\n\t\t}\r\n\r\n\t\trow.modules.moveRow = config;\r\n\t}\r\n\r\n\tinitializeColumn(column){\r\n\t\tif(column.definition.rowHandle && this.table.options.movableRows !== false){\r\n\t\t\tthis.hasHandle = true;\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeCell(cell){\r\n\t\tif(cell.column.definition.rowHandle && this.table.options.movableRows !== false){\r\n\t\t\tvar self = this,\r\n\t\t\tcellEl = cell.getElement(true);\r\n\r\n\t\t\tcellEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, cell.row);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tcellEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.bindTouchEvents(cell.row, cellEl);\r\n\t\t}\r\n\t}\r\n\r\n\tbindTouchEvents(row, element){\r\n\t\tvar startYMove = false, //shifting center position of the cell\r\n\t\tdir = false,\r\n\t\tcurrentRow, nextRow, prevRow, nextRowHeight, prevRowHeight, nextRowHeightLast, prevRowHeightLast;\r\n\r\n\t\telement.addEventListener(\"touchstart\", (e) => {\r\n\t\t\tthis.checkTimeout = setTimeout(() => {\r\n\t\t\t\tthis.touchMove = true;\r\n\t\t\t\tcurrentRow = row;\r\n\t\t\t\tnextRow = row.nextRow();\r\n\t\t\t\tnextRowHeight = nextRow ? nextRow.getHeight()/2 : 0;\r\n\t\t\t\tprevRow = row.prevRow();\r\n\t\t\t\tprevRowHeight = prevRow ? prevRow.getHeight()/2 : 0;\r\n\t\t\t\tnextRowHeightLast = 0;\r\n\t\t\t\tprevRowHeightLast = 0;\r\n\t\t\t\tstartYMove = false;\r\n\r\n\t\t\t\tthis.startMove(e, row);\r\n\t\t\t}, this.checkPeriod);\r\n\t\t}, {passive: true});\r\n\t\tthis.moving, this.toRow, this.toRowAfter\r\n\t\telement.addEventListener(\"touchmove\", (e) => {\r\n\r\n\t\t\tvar halfCol, diff, moveToRow;\r\n\r\n\t\t\tif(this.moving){\r\n\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\tthis.moveHover(e);\r\n\r\n\t\t\t\tif(!startYMove){\r\n\t\t\t\t\tstartYMove = e.touches[0].pageY;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdiff = e.touches[0].pageY - startYMove;\r\n\r\n\t\t\t\tif(diff > 0){\r\n\t\t\t\t\tif(nextRow && diff - nextRowHeightLast > nextRowHeight){\r\n\t\t\t\t\t\tmoveToRow = nextRow;\r\n\r\n\t\t\t\t\t\tif(moveToRow !== row){\r\n\t\t\t\t\t\t\tstartYMove = e.touches[0].pageY\r\n\t\t\t\t\t\t\tmoveToRow.getElement().parentNode.insertBefore(this.placeholderElement, moveToRow.getElement().nextSibling);\r\n\t\t\t\t\t\t\tthis.moveRow(moveToRow, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(prevRow && -diff - prevRowHeightLast > prevRowHeight){\r\n\t\t\t\t\t\tmoveToRow = prevRow;\r\n\r\n\t\t\t\t\t\tif(moveToRow !== row){\r\n\t\t\t\t\t\t\tstartYMove = e.touches[0].pageY;\r\n\t\t\t\t\t\t\tmoveToRow.getElement().parentNode.insertBefore(this.placeholderElement, moveToRow.getElement());\r\n\t\t\t\t\t\t\tthis.moveRow(moveToRow, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(moveToRow){\r\n\t\t\t\t\tcurrentRow = moveToRow;\r\n\t\t\t\t\tnextRow = moveToRow.nextRow();\r\n\t\t\t\t\tnextRowHeightLast = nextRowHeight;\r\n\t\t\t\t\tnextRowHeight = nextRow ? nextRow.getHeight() / 2 : 0;\r\n\t\t\t\t\tprevRow = moveToRow.prevRow();\r\n\t\t\t\t\tprevRowHeightLast = prevRowHeight;\r\n\t\t\t\t\tprevRowHeight = prevRow ? prevRow.getHeight() / 2 : 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\telement.addEventListener(\"touchend\", (e) => {\r\n\t\t\tif(this.checkTimeout){\r\n\t\t\t\tclearTimeout(this.checkTimeout);\r\n\t\t\t}\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.endMove(e);\r\n\t\t\t\tthis.touchMove = false;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t_bindMouseMove(){\r\n\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\tif((row.type === \"row\" || row.type === \"group\") && row.modules.moveRow && row.modules.moveRow.mousemove){\r\n\t\t\t\trow.getElement().addEventListener(\"mousemove\", row.modules.moveRow.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t_unbindMouseMove(){\r\n\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\tif((row.type === \"row\" || row.type === \"group\") && row.modules.moveRow && row.modules.moveRow.mousemove){\r\n\t\t\t\trow.getElement().removeEventListener(\"mousemove\", row.modules.moveRow.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tstartMove(e, row){\r\n\t\tvar element = row.getElement();\r\n\r\n\t\tthis.setStartPosition(e, row);\r\n\r\n\t\tthis.moving = row;\r\n\r\n\t\tthis.table.element.classList.add(\"tabulator-block-select\");\r\n\r\n\t\t//create placeholder\r\n\t\tthis.placeholderElement.style.width = row.getWidth() + \"px\";\r\n\t\tthis.placeholderElement.style.height = row.getHeight() + \"px\";\r\n\r\n\t\tif(!this.connection){\r\n\t\t\telement.parentNode.insertBefore(this.placeholderElement, element);\r\n\t\t\telement.parentNode.removeChild(element);\r\n\t\t}else{\r\n\t\t\tthis.table.element.classList.add(\"tabulator-movingrow-sending\");\r\n\t\t\tthis.connectToTables(row);\r\n\t\t}\r\n\r\n\t\t//create hover element\r\n\t\tthis.hoverElement = element.cloneNode(true);\r\n\t\tthis.hoverElement.classList.add(\"tabulator-moving\");\r\n\r\n\t\tif(this.connection){\r\n\t\t\tdocument.body.appendChild(this.hoverElement);\r\n\t\t\tthis.hoverElement.style.left = \"0\";\r\n\t\t\tthis.hoverElement.style.top = \"0\";\r\n\t\t\tthis.hoverElement.style.width = this.table.element.clientWidth + \"px\";\r\n\t\t\tthis.hoverElement.style.whiteSpace = \"nowrap\";\r\n\t\t\tthis.hoverElement.style.overflow = \"hidden\";\r\n\t\t\tthis.hoverElement.style.pointerEvents = \"none\";\r\n\t\t}else{\r\n\t\t\tthis.table.rowManager.getTableElement().appendChild(this.hoverElement);\r\n\r\n\t\t\tthis.hoverElement.style.left = \"0\";\r\n\t\t\tthis.hoverElement.style.top = \"0\";\r\n\r\n\t\t\tthis._bindMouseMove();\r\n\t\t}\r\n\r\n\t\tdocument.body.addEventListener(\"mousemove\", this.moveHover);\r\n\t\tdocument.body.addEventListener(\"mouseup\", this.endMove);\r\n\r\n\t\tthis.dispatchExternal(\"rowMoving\", row.getComponent());\r\n\r\n\t\tthis.moveHover(e);\r\n\t}\r\n\r\n\tsetStartPosition(e, row){\r\n\t\tvar pageX = this.touchMove ? e.touches[0].pageX : e.pageX,\r\n\t\tpageY = this.touchMove ? e.touches[0].pageY : e.pageY,\r\n\t\telement, position;\r\n\r\n\t\telement = row.getElement();\r\n\t\tif(this.connection){\r\n\t\t\tposition = element.getBoundingClientRect();\r\n\r\n\t\t\tthis.startX = position.left - pageX + window.pageXOffset;\r\n\t\t\tthis.startY = position.top - pageY + window.pageYOffset;\r\n\t\t}else{\r\n\t\t\tthis.startY = (pageY - element.getBoundingClientRect().top);\r\n\t\t}\r\n\t}\r\n\r\n\tendMove(e){\r\n\t\tif(!e || e.which === 1 || this.touchMove){\r\n\t\t\tthis._unbindMouseMove();\r\n\r\n\t\t\tif(!this.connection){\r\n\t\t\t\tthis.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling);\r\n\t\t\t\tthis.placeholderElement.parentNode.removeChild(this.placeholderElement);\r\n\t\t\t}\r\n\r\n\t\t\tthis.hoverElement.parentNode.removeChild(this.hoverElement);\r\n\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-block-select\");\r\n\r\n\t\t\tif(this.toRow){\r\n\t\t\t\tthis.table.rowManager.moveRow(this.moving, this.toRow, this.toRowAfter);\r\n\t\t\t}else{\r\n\t\t\t\tthis.dispatchExternal(\"rowMoveCancelled\", this.moving.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tthis.moving = false;\r\n\t\t\tthis.toRow = false;\r\n\t\t\tthis.toRowAfter = false;\r\n\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", this.moveHover);\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", this.endMove);\r\n\r\n\t\t\tif(this.connection){\r\n\t\t\t\tthis.table.element.classList.remove(\"tabulator-movingrow-sending\");\r\n\t\t\t\tthis.disconnectFromTables();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmoveRow(row, after){\r\n\t\tthis.toRow = row;\r\n\t\tthis.toRowAfter = after;\r\n\t}\r\n\r\n\tmoveHover(e){\r\n\t\tif(this.connection){\r\n\t\t\tthis.moveHoverConnections.call(this, e);\r\n\t\t}else{\r\n\t\t\tthis.moveHoverTable.call(this, e);\r\n\t\t}\r\n\t}\r\n\r\n\tmoveHoverTable(e){\r\n\t\tvar rowHolder = this.table.rowManager.getElement(),\r\n\t\tscrollTop = rowHolder.scrollTop,\r\n\t\tyPos = ((this.touchMove ? e.touches[0].pageY : e.pageY) - rowHolder.getBoundingClientRect().top) + scrollTop,\r\n\t\tscrollPos;\r\n\r\n\t\tthis.hoverElement.style.top = (yPos - this.startY) + \"px\";\r\n\t}\r\n\r\n\tmoveHoverConnections(e){\r\n\t\tthis.hoverElement.style.left = (this.startX + (this.touchMove ? e.touches[0].pageX : e.pageX)) + \"px\";\r\n\t\tthis.hoverElement.style.top = (this.startY + (this.touchMove ? e.touches[0].pageY : e.pageY)) + \"px\";\r\n\t}\r\n\r\n\telementRowDrop(e, element, row){\r\n\t\tthis.dispatchExternal(\"movableRowsElementDrop\", e, element, row ? row.getComponent() : false);\r\n\t}\r\n\r\n\t//establish connection with other tables\r\n\tconnectToTables(row){\r\n\t\tvar connectionTables;\r\n\r\n\t\tif(this.connectionSelectorsTables){\r\n\t\t\tconnectionTables = this.commsConnections(this.connectionSelectorsTables);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSendingStart\", connectionTables);\r\n\r\n\t\t\tthis.commsSend(this.connectionSelectorsTables, \"moveRow\", \"connect\", {\r\n\t\t\t\trow:row,\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.connectionSelectorsElements){\r\n\r\n\t\t\tthis.connectionElements = [];\r\n\r\n\t\t\tif(!Array.isArray(this.connectionSelectorsElements)){\r\n\t\t\t\tthis.connectionSelectorsElements = [this.connectionSelectorsElements];\r\n\t\t\t}\r\n\r\n\t\t\tthis.connectionSelectorsElements.forEach((query) => {\r\n\t\t\t\tif(typeof query === \"string\"){\r\n\t\t\t\t\tthis.connectionElements = this.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(query)));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.connectionElements.push(query);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.connectionElements.forEach((element) => {\r\n\t\t\t\tvar dropEvent = (e) => {\r\n\t\t\t\t\tthis.elementRowDrop(e, element, this.moving);\r\n\t\t\t\t};\r\n\r\n\t\t\t\telement.addEventListener(\"mouseup\", dropEvent);\r\n\t\t\t\telement.tabulatorElementDropEvent = dropEvent;\r\n\r\n\t\t\t\telement.classList.add(\"tabulator-movingrow-receiving\");\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t//disconnect from other tables\r\n\tdisconnectFromTables(){\r\n\t\tvar connectionTables;\r\n\r\n\t\tif(this.connectionSelectorsTables){\r\n\t\t\tconnectionTables = this.commsConnections(this.connectionSelectorsTables);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSendingStop\", connectionTables);\r\n\r\n\t\t\tthis.commsSend(this.connectionSelectorsTables, \"moveRow\", \"disconnect\");\r\n\t\t}\r\n\r\n\t\tthis.connectionElements.forEach((element) => {\r\n\t\t\telement.classList.remove(\"tabulator-movingrow-receiving\");\r\n\t\t\telement.removeEventListener(\"mouseup\", element.tabulatorElementDropEvent);\r\n\t\t\tdelete element.tabulatorElementDropEvent;\r\n\t\t});\r\n\t}\r\n\r\n\t//accept incomming connection\r\n\tconnect(table, row){\r\n\t\tif(!this.connectedTable){\r\n\t\t\tthis.connectedTable = table;\r\n\t\t\tthis.connectedRow = row;\r\n\r\n\t\t\tthis.table.element.classList.add(\"tabulator-movingrow-receiving\");\r\n\r\n\t\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\t\tif(row.type === \"row\" && row.modules.moveRow && row.modules.moveRow.mouseup){\r\n\t\t\t\t\trow.getElement().addEventListener(\"mouseup\", row.modules.moveRow.mouseup);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.tableRowDropEvent = this.tableRowDrop.bind(this);\r\n\r\n\t\t\tthis.table.element.addEventListener(\"mouseup\", this.tableRowDropEvent);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivingStart\", row, table);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Row Error - Table cannot accept connection, already connected to table:\", this.connectedTable);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//close incomming connection\r\n\tdisconnect(table){\r\n\t\tif(table === this.connectedTable){\r\n\t\t\tthis.connectedTable = false;\r\n\t\t\tthis.connectedRow = false;\r\n\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-movingrow-receiving\");\r\n\r\n\t\t\tthis.table.rowManager.getDisplayRows().forEach((row) =>{\r\n\t\t\t\tif(row.type === \"row\" && row.modules.moveRow && row.modules.moveRow.mouseup){\r\n\t\t\t\t\trow.getElement().removeEventListener(\"mouseup\", row.modules.moveRow.mouseup);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.table.element.removeEventListener(\"mouseup\", this.tableRowDropEvent);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivingStop\", table);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Row Error - trying to disconnect from non connected table\")\r\n\t\t}\r\n\t}\r\n\r\n\tdropComplete(table, row, success){\r\n\t\tvar sender = false;\r\n\r\n\t\tif(success){\r\n\r\n\t\t\tswitch(typeof this.table.options.movableRowsSender){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tsender = this.senders[this.table.options.movableRowsSender];\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\tsender = this.table.options.movableRowsSender;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(sender){\r\n\t\t\t\tsender.call(this, this.moving.getComponent(), row ? row.getComponent() : undefined, table)\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.options.movableRowsSender){\r\n\t\t\t\t\tconsole.warn(\"Mover Row Error - no matching sender found:\", this.table.options.movableRowsSender);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSent\", this.moving.getComponent(), row ? row.getComponent() : undefined, table);\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"movableRowsSentFailed\", this.moving.getComponent(), row ? row.getComponent() : undefined, table);\r\n\t\t}\r\n\r\n\t\tthis.endMove();\r\n\t}\r\n\r\n\ttableRowDrop(e, row){\r\n\t\tvar receiver = false,\r\n\t\tsuccess = false;\r\n\r\n\t\te.stopImmediatePropagation();\r\n\r\n\t\tswitch(typeof this.table.options.movableRowsReceiver){\r\n\t\t\tcase \"string\":\r\n\t\t\treceiver = this.receivers[this.table.options.movableRowsReceiver];\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\treceiver = this.table.options.movableRowsReceiver;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(receiver){\r\n\t\t\tsuccess = receiver.call(this, this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable)\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Mover Row Error - no matching receiver found:\", this.table.options.movableRowsReceiver)\r\n\t\t}\r\n\r\n\t\tif(success){\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceived\", this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivedFailed\", this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);\r\n\t\t}\r\n\r\n\t\tthis.commsSend(this.connectedTable, \"moveRow\", \"dropcomplete\", {\r\n\t\t\trow:row,\r\n\t\t\tsuccess:success,\r\n\t\t});\r\n\t}\r\n\r\n\tcommsReceived(table, action, data){\r\n\t\tswitch(action){\r\n\t\t\tcase \"connect\":\r\n\t\t\treturn this.connect(table, data.row);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"disconnect\":\r\n\t\t\treturn this.disconnect(table);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"dropcomplete\":\r\n\t\t\treturn this.dropComplete(table, data.row, data.success);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMoveRows.prototype.receivers = {\r\n\tinsert:function(fromRow, toRow, fromTable){\r\n\t\tthis.table.addRow(fromRow.getData(), undefined, toRow);\r\n\t\treturn true;\r\n\t},\r\n\r\n\tadd:function(fromRow, toRow, fromTable){\r\n\t\tthis.table.addRow(fromRow.getData());\r\n\t\treturn true;\r\n\t},\r\n\r\n\tupdate:function(fromRow, toRow, fromTable){\r\n\t\tif(toRow){\r\n\t\t\ttoRow.update(fromRow.getData());\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n\r\n\treplace:function(fromRow, toRow, fromTable){\r\n\t\tif(toRow){\r\n\t\t\tthis.table.addRow(fromRow.getData(), undefined, toRow);\r\n\t\t\ttoRow.delete();\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n};\r\n\r\nMoveRows.prototype.senders = {\r\n\tdelete:function(fromRow, toRow, toTable){\r\n\t\tfromRow.delete();\r\n\t}\r\n};\r\n\r\nMoveRows.moduleName = \"moveRow\";\r\n\r\nexport default MoveRows;","export default {};","import Module from '../../core/Module.js';\r\n\r\nimport defaultMutators from './defaults/mutators.js';\r\n\r\nclass Mutator extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.allowedTypes = [\"\", \"data\", \"edit\", \"clipboard\"]; //list of muatation types\r\n\t\tthis.enabled = true;\r\n\r\n\t\tthis.registerColumnOption(\"mutator\");\r\n\t\tthis.registerColumnOption(\"mutatorParams\");\r\n\t\tthis.registerColumnOption(\"mutatorData\");\r\n\t\tthis.registerColumnOption(\"mutatorDataParams\");\r\n\t\tthis.registerColumnOption(\"mutatorEdit\");\r\n\t\tthis.registerColumnOption(\"mutatorEditParams\");\r\n\t\tthis.registerColumnOption(\"mutatorClipboard\");\r\n\t\tthis.registerColumnOption(\"mutatorClipboardParams\");\r\n\t\tthis.registerColumnOption(\"mutateLink\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-value-changing\", this.transformCell.bind(this));\r\n\t\tthis.subscribe(\"cell-value-changed\", this.mutateLink.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"row-data-init-before\", this.rowDataChanged.bind(this));\r\n\t\tthis.subscribe(\"row-data-changing\", this.rowDataChanged.bind(this));\r\n\t}\r\n\r\n\trowDataChanged(row, tempData, updatedData){\r\n\t\treturn this.transformRow(tempData, \"data\", updatedData);\r\n\t}\r\n\r\n\t//initialize column mutator\r\n\tinitializeColumn(column){\r\n\t\tvar match = false,\r\n\t\tconfig = {};\r\n\r\n\t\tthis.allowedTypes.forEach((type) => {\r\n\t\t\tvar key = \"mutator\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\t\tmutator;\r\n\r\n\t\t\tif(column.definition[key]){\r\n\t\t\t\tmutator = this.lookupMutator(column.definition[key]);\r\n\r\n\t\t\t\tif(mutator){\r\n\t\t\t\t\tmatch = true;\r\n\r\n\t\t\t\t\tconfig[key] = {\r\n\t\t\t\t\t\tmutator:mutator,\r\n\t\t\t\t\t\tparams: column.definition[key + \"Params\"] || {},\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(match){\r\n\t\t\tcolumn.modules.mutate = config;\r\n\t\t}\r\n\t}\r\n\r\n\tlookupMutator(value){\r\n\t\tvar mutator = false;\r\n\r\n\t\t//set column mutator\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(Mutator.mutators[value]){\r\n\t\t\t\tmutator = Mutator.mutators[value];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Mutator Error - No such mutator found, ignoring: \", value);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tmutator = value;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn mutator;\r\n\t}\r\n\r\n\t//apply mutator to row\r\n\ttransformRow(data, type, updatedData){\r\n\t\tvar key = \"mutator\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\tvalue;\r\n\r\n\t\tif(this.enabled){\r\n\r\n\t\t\tthis.table.columnManager.traverse((column) => {\r\n\t\t\t\tvar mutator, params, component;\r\n\r\n\t\t\t\tif(column.modules.mutate){\r\n\t\t\t\t\tmutator = column.modules.mutate[key] || column.modules.mutate.mutator || false;\r\n\r\n\t\t\t\t\tif(mutator){\r\n\t\t\t\t\t\tvalue = column.getFieldValue(typeof updatedData !== \"undefined\" ? updatedData : data);\r\n\r\n\t\t\t\t\t\tif(type == \"data\" || typeof value !== \"undefined\"){\r\n\t\t\t\t\t\t\tcomponent = column.getComponent();\r\n\t\t\t\t\t\t\tparams = typeof mutator.params === \"function\" ? mutator.params(value, data, type, component) : mutator.params;\r\n\t\t\t\t\t\t\tcolumn.setFieldValue(data, mutator.mutator(value, data, type, params, component));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//apply mutator to new cell value\r\n\ttransformCell(cell, value){\r\n\t\tif(cell.column.modules.mutate){\r\n\t\t\tvar mutator = cell.column.modules.mutate.mutatorEdit || cell.column.modules.mutate.mutator || false,\r\n\t\t\ttempData = {};\r\n\r\n\t\t\tif(mutator){\r\n\t\t\t\ttempData = Object.assign(tempData, cell.row.getData());\r\n\t\t\t\tcell.column.setFieldValue(tempData, value);\r\n\t\t\t\treturn mutator.mutator(value, tempData, \"edit\", mutator.params, cell.getComponent());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\tmutateLink(cell){\r\n\t\tvar links = cell.column.definition.mutateLink;\r\n\r\n\t\tif(links){\r\n\t\t\tif(!Array.isArray(links)){\r\n\t\t\t\tlinks = [links];\r\n\t\t\t}\r\n\r\n\t\t\tlinks.forEach((link) => {\r\n\t\t\t\tvar linkCell = cell.row.getCell(link);\r\n\r\n\t\t\t\tif(linkCell){\r\n\t\t\t\t\tlinkCell.setValue(linkCell.getValue(), true, true);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tenable(){\r\n\t\tthis.enabled = true;\r\n\t}\r\n\r\n\tdisable(){\r\n\t\tthis.enabled = false;\r\n\t}\r\n}\r\n\r\nMutator.moduleName = \"mutator\";\r\n\r\n//load defaults\r\nMutator.mutators = defaultMutators;\r\n\r\nexport default Mutator;","export default function(pageSize, currentRow, currentPage, totalRows, totalPages){\r\n\tvar el = document.createElement(\"span\"),\r\n\tshowingEl = document.createElement(\"span\"),\r\n\tvalueEl = document.createElement(\"span\"),\r\n\tofEl = document.createElement(\"span\"),\r\n\ttotalEl = document.createElement(\"span\"),\r\n\trowsEl = document.createElement(\"span\");\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|showing\", (value) => {\r\n\t\tshowingEl.innerHTML = value;\r\n\t});\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|of\", (value) => {\r\n\t\tofEl.innerHTML = value;\r\n\t});\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|rows\", (value) => {\r\n\t\trowsEl.innerHTML = value;\r\n\t});\r\n\r\n\tif(totalRows){\r\n\t\tvalueEl.innerHTML = \" \" + currentRow + \"-\" + Math.min((currentRow + pageSize - 1), totalRows) + \" \";\r\n\t\t\r\n\t\ttotalEl.innerHTML = \" \" + totalRows + \" \";\r\n\t\t\r\n\t\tel.appendChild(showingEl);\r\n\t\tel.appendChild(valueEl);\r\n\t\tel.appendChild(ofEl);\r\n\t\tel.appendChild(totalEl);\r\n\t\tel.appendChild(rowsEl);\r\n\t}else{\r\n\t\tvalueEl.innerHTML = \" 0 \";\r\n\r\n\t\tel.appendChild(showingEl);\r\n\t\tel.appendChild(valueEl);\r\n\t\tel.appendChild(rowsEl);\r\n\t}\r\n\t\r\n\treturn el;\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultPageCounters from './defaults/pageCounters.js';\r\n\r\nclass Page extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.mode = \"local\";\r\n\t\tthis.progressiveLoad = false;\r\n\t\t\r\n\t\tthis.element = null;\r\n\t\tthis.pageCounterElement = null;\r\n\t\tthis.pageCounter = null;\r\n\t\t\r\n\t\tthis.size = 0;\r\n\t\tthis.page = 1;\r\n\t\tthis.count = 5;\r\n\t\tthis.max = 1;\r\n\r\n\t\tthis.remoteRowCountEstimate = null;\r\n\t\t\r\n\t\tthis.displayIndex = 0; //index in display pipeline\r\n\t\t\r\n\t\tthis.initialLoad = true;\r\n\t\tthis.dataChanging = false; //flag to check if data is being changed by this module\r\n\t\t\r\n\t\tthis.pageSizes = [];\r\n\t\t\r\n\t\tthis.registerTableOption(\"pagination\", false); //set pagination type\r\n\t\tthis.registerTableOption(\"paginationMode\", \"local\"); //local or remote pagination\r\n\t\tthis.registerTableOption(\"paginationSize\", false); //set number of rows to a page\r\n\t\tthis.registerTableOption(\"paginationInitialPage\", 1); //initial page to show on load\r\n\t\tthis.registerTableOption(\"paginationCounter\", false); // set pagination counter\r\n\t\tthis.registerTableOption(\"paginationCounterElement\", false); // set pagination counter\r\n\t\tthis.registerTableOption(\"paginationButtonCount\", 5); // set count of page button\r\n\t\tthis.registerTableOption(\"paginationSizeSelector\", false); //add pagination size selector element\r\n\t\tthis.registerTableOption(\"paginationElement\", false); //element to hold pagination numbers\r\n\t\t// this.registerTableOption(\"paginationDataSent\", {}); //pagination data sent to the server\r\n\t\t// this.registerTableOption(\"paginationDataReceived\", {}); //pagination data received from the server\r\n\t\tthis.registerTableOption(\"paginationAddRow\", \"page\"); //add rows on table or page\r\n\t\t\r\n\t\tthis.registerTableOption(\"progressiveLoad\", false); //progressive loading\r\n\t\tthis.registerTableOption(\"progressiveLoadDelay\", 0); //delay between requests\r\n\t\tthis.registerTableOption(\"progressiveLoadScrollMargin\", 0); //margin before scroll begins\r\n\t\t\r\n\t\tthis.registerTableFunction(\"setMaxPage\", this.setMaxPage.bind(this));\r\n\t\tthis.registerTableFunction(\"setPage\", this.setPage.bind(this));\r\n\t\tthis.registerTableFunction(\"setPageToRow\", this.userSetPageToRow.bind(this));\r\n\t\tthis.registerTableFunction(\"setPageSize\", this.userSetPageSize.bind(this));\r\n\t\tthis.registerTableFunction(\"getPageSize\", this.getPageSize.bind(this));\r\n\t\tthis.registerTableFunction(\"previousPage\", this.previousPage.bind(this));\r\n\t\tthis.registerTableFunction(\"nextPage\", this.nextPage.bind(this));\r\n\t\tthis.registerTableFunction(\"getPage\", this.getPage.bind(this));\r\n\t\tthis.registerTableFunction(\"getPageMax\", this.getPageMax.bind(this));\r\n\t\t\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"pageTo\", this.setPageToRow.bind(this));\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"row-added\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"data-processed\", this.initialLoadComplete.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.calculatePageSizes.bind(this));\r\n\t\t\tthis.subscribe(\"footer-redraw\", this.footerRedraw.bind(this));\r\n\r\n\t\t\tif(this.table.options.paginationAddRow == \"page\"){\r\n\t\t\t\tthis.subscribe(\"row-adding-position\", this.rowAddingPosition.bind(this));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.options.paginationMode === \"remote\"){\r\n\t\t\t\tthis.subscribe(\"data-params\", this.remotePageParams.bind(this));\r\n\t\t\t\tthis.subscribe(\"data-loaded\", this._parseRemoteData.bind(this));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.options.progressiveLoad){\r\n\t\t\t\tconsole.error(\"Progressive Load Error - Pagination and progressive load cannot be used at the same time\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.registerDisplayHandler(this.restOnRenderBefore.bind(this), 40);\r\n\t\t\tthis.registerDisplayHandler(this.getRows.bind(this), 50);\r\n\t\t\t\r\n\t\t\tthis.createElements();\r\n\t\t\tthis.initializePageCounter();\r\n\t\t\tthis.initializePaginator();\r\n\t\t}else if(this.table.options.progressiveLoad){\r\n\t\t\tthis.subscribe(\"data-params\", this.remotePageParams.bind(this));\r\n\t\t\tthis.subscribe(\"data-loaded\", this._parseRemoteData.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.calculatePageSizes.bind(this));\r\n\t\t\tthis.subscribe(\"data-processed\", this.initialLoadComplete.bind(this));\r\n\t\t\t\r\n\t\t\tthis.initializeProgressive(this.table.options.progressiveLoad)\r\n\t\t\t\r\n\t\t\tif(this.table.options.progressiveLoad === \"scroll\"){\r\n\t\t\t\tthis.subscribe(\"scroll-vertical\", this.scrollVertical.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trowAddingPosition(row, top){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tdispRows = rowManager.getDisplayRows(),\r\n\t\tindex;\r\n\t\t\r\n\t\tif(top){\r\n\t\t\tif(dispRows.length){\r\n\t\t\t\tindex = dispRows[0];\r\n\t\t\t}else{\r\n\t\t\t\tif(rowManager.activeRows.length){\r\n\t\t\t\t\tindex = rowManager.activeRows[rowManager.activeRows.length-1];\r\n\t\t\t\t\ttop = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(dispRows.length){\r\n\t\t\t\tindex = dispRows[dispRows.length - 1];\r\n\t\t\t\ttop = dispRows.length < this.size ? false : true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn {index, top}\r\n\t}\r\n\t\r\n\tcalculatePageSizes(){\r\n\t\tvar testElRow, testElCell;\r\n\t\t\r\n\t\tif(this.table.options.paginationSize){\r\n\t\t\tthis.size = this.table.options.paginationSize;\r\n\t\t}else{\r\n\t\t\ttestElRow = document.createElement(\"div\");\r\n\t\t\ttestElRow.classList.add(\"tabulator-row\");\r\n\t\t\ttestElRow.style.visibility = \"hidden\";\r\n\t\t\t\r\n\t\t\ttestElCell = document.createElement(\"div\");\r\n\t\t\ttestElCell.classList.add(\"tabulator-cell\");\r\n\t\t\ttestElCell.innerHTML = \"Page Row Test\";\r\n\t\t\t\r\n\t\t\ttestElRow.appendChild(testElCell);\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.getTableElement().appendChild(testElRow);\r\n\t\t\t\r\n\t\t\tthis.size = Math.floor(this.table.rowManager.getElement().clientHeight / testElRow.offsetHeight);\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.getTableElement().removeChild(testElRow);\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(\"pageSizeChanged\", this.size);\r\n\t\t\r\n\t\tthis.generatePageSizeSelectList();\r\n\t}\r\n\t\r\n\tinitialLoadComplete(){\r\n\t\tthis.initialLoad = false;\r\n\t}\r\n\t\r\n\tremotePageParams(data, config, silent, params){\r\n\t\tif(!this.initialLoad){\r\n\t\t\tif((this.progressiveLoad && !silent) || (!this.progressiveLoad && !this.dataChanging)){\r\n\t\t\t\tthis.reset(true);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//configure request params\r\n\t\tparams.page = this.page;\r\n\t\t\r\n\t\t//set page size if defined\r\n\t\tif(this.size){\r\n\t\t\tparams.size = this.size;\r\n\t\t}\r\n\t\t\r\n\t\treturn params;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\tuserSetPageToRow(row){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\trow = this.rowManager.findRow(row);\r\n\t\t\t\r\n\t\t\tif(row){\r\n\t\t\t\treturn this.setPageToRow(row)\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn Promise.reject();\r\n\t}\r\n\t\r\n\tuserSetPageSize(size){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\tthis.setPageSize(size);\r\n\t\t\treturn this.setPage(1);\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tscrollVertical(top, dir){\r\n\t\tvar element, diff, margin;\r\n\t\tif(!dir && !this.table.dataLoader.loading){\r\n\t\t\telement = this.table.rowManager.getElement();\r\n\t\t\tdiff = element.scrollHeight - element.clientHeight - top;\r\n\t\t\tmargin = this.table.options.progressiveLoadScrollMargin || (element.clientHeight * 2);\r\n\t\t\t\r\n\t\t\tif(diff < margin){\r\n\t\t\t\tthis.nextPage()\r\n\t\t\t\t.catch(() => {}); //consume the exception thrown when on the last page\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trestOnRenderBefore(rows, renderInPosition){\r\n\t\tif(!renderInPosition){\r\n\t\t\tif(this.mode === \"local\"){\r\n\t\t\t\tthis.reset();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\trowsUpdated(){\r\n\t\tthis.refreshData(true, \"all\");\r\n\t}\r\n\t\r\n\tcreateElements(){\r\n\t\tvar button;\r\n\t\t\r\n\t\tthis.element = document.createElement(\"span\");\r\n\t\tthis.element.classList.add(\"tabulator-paginator\");\r\n\t\t\r\n\t\tthis.pagesElement = document.createElement(\"span\");\r\n\t\tthis.pagesElement.classList.add(\"tabulator-pages\");\r\n\t\t\r\n\t\tbutton = document.createElement(\"button\");\r\n\t\tbutton.classList.add(\"tabulator-page\");\r\n\t\tbutton.setAttribute(\"type\", \"button\");\r\n\t\tbutton.setAttribute(\"role\", \"button\");\r\n\t\tbutton.setAttribute(\"aria-label\", \"\");\r\n\t\tbutton.setAttribute(\"title\", \"\");\r\n\t\t\r\n\t\tthis.firstBut = button.cloneNode(true);\r\n\t\tthis.firstBut.setAttribute(\"data-page\", \"first\");\r\n\t\t\r\n\t\tthis.prevBut = button.cloneNode(true);\r\n\t\tthis.prevBut.setAttribute(\"data-page\", \"prev\");\r\n\t\t\r\n\t\tthis.nextBut = button.cloneNode(true);\r\n\t\tthis.nextBut.setAttribute(\"data-page\", \"next\");\r\n\t\t\r\n\t\tthis.lastBut = button.cloneNode(true);\r\n\t\tthis.lastBut.setAttribute(\"data-page\", \"last\");\r\n\t\t\r\n\t\tif(this.table.options.paginationSizeSelector){\r\n\t\t\tthis.pageSizeSelect = document.createElement(\"select\");\r\n\t\t\tthis.pageSizeSelect.classList.add(\"tabulator-page-size\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tgeneratePageSizeSelectList(){\r\n\t\tvar pageSizes = [];\r\n\t\t\r\n\t\tif(this.pageSizeSelect){\r\n\t\t\t\r\n\t\t\tif(Array.isArray(this.table.options.paginationSizeSelector)){\r\n\t\t\t\tpageSizes = this.table.options.paginationSizeSelector;\r\n\t\t\t\tthis.pageSizes = pageSizes;\r\n\t\t\t\t\r\n\t\t\t\tif(this.pageSizes.indexOf(this.size) == -1){\r\n\t\t\t\t\tpageSizes.unshift(this.size);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t\r\n\t\t\t\tif(this.pageSizes.indexOf(this.size) == -1){\r\n\t\t\t\t\tpageSizes = [];\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (let i = 1; i < 5; i++){\r\n\t\t\t\t\t\tpageSizes.push(this.size * i);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.pageSizes = pageSizes;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tpageSizes = this.pageSizes;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\twhile(this.pageSizeSelect.firstChild) this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);\r\n\t\t\t\r\n\t\t\tpageSizes.forEach((item) => {\r\n\t\t\t\tvar itemEl = document.createElement(\"option\");\r\n\t\t\t\titemEl.value = item;\r\n\t\t\t\t\r\n\t\t\t\tif(item === true){\r\n\t\t\t\t\tthis.langBind(\"pagination|all\", function(value){\r\n\t\t\t\t\t\titemEl.innerHTML = value;\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\titemEl.innerHTML = item;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tthis.pageSizeSelect.appendChild(itemEl);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.pageSizeSelect.value = this.size;\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializePageCounter(){\r\n\t\tvar counter = this.table.options.paginationCounter,\r\n\t\tpageCounter = null;\r\n\t\t\r\n\t\tif(counter){\r\n\t\t\tif(typeof counter === \"function\"){\r\n\t\t\t\tpageCounter = counter;\r\n\t\t\t}else{\r\n\t\t\t\tpageCounter = Page.pageCounters[counter];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(pageCounter){\r\n\t\t\t\tthis.pageCounter = pageCounter;\r\n\t\t\t\t\r\n\t\t\t\tthis.pageCounterElement = document.createElement(\"span\");\r\n\t\t\t\tthis.pageCounterElement.classList.add(\"tabulator-page-counter\");\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Pagination Error - No such page counter found: \", counter);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//setup pagination\r\n\tinitializePaginator(hidden){\r\n\t\tvar pageSelectLabel, paginationCounterHolder;\r\n\t\t\r\n\t\tif(!hidden){\r\n\t\t\t//build pagination element\r\n\t\t\t\r\n\t\t\t//bind localizations\r\n\t\t\tthis.langBind(\"pagination|first\", (value) => {\r\n\t\t\t\tthis.firstBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|first_title\", (value) => {\r\n\t\t\t\tthis.firstBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.firstBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|prev\", (value) => {\r\n\t\t\t\tthis.prevBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|prev_title\", (value) => {\r\n\t\t\t\tthis.prevBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.prevBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|next\", (value) => {\r\n\t\t\t\tthis.nextBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|next_title\", (value) => {\r\n\t\t\t\tthis.nextBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.nextBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|last\", (value) => {\r\n\t\t\t\tthis.lastBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|last_title\", (value) => {\r\n\t\t\t\tthis.lastBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.lastBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t//click bindings\r\n\t\t\tthis.firstBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.setPage(1)\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.prevBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.previousPage()\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.nextBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.nextPage()\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.lastBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.setPage(this.max)\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(this.table.options.paginationElement){\r\n\t\t\t\tthis.element = this.table.options.paginationElement;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.pageSizeSelect){\r\n\t\t\t\tpageSelectLabel = document.createElement(\"label\");\r\n\t\t\t\t\r\n\t\t\t\tthis.langBind(\"pagination|page_size\", (value) => {\r\n\t\t\t\t\tthis.pageSizeSelect.setAttribute(\"aria-label\", value);\r\n\t\t\t\t\tthis.pageSizeSelect.setAttribute(\"title\", value);\r\n\t\t\t\t\tpageSelectLabel.innerHTML = value;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.element.appendChild(pageSelectLabel);\r\n\t\t\t\tthis.element.appendChild(this.pageSizeSelect);\r\n\t\t\t\t\r\n\t\t\t\tthis.pageSizeSelect.addEventListener(\"change\", (e) => {\r\n\t\t\t\t\tthis.setPageSize(this.pageSizeSelect.value == \"true\" ? true : this.pageSizeSelect.value);\r\n\t\t\t\t\tthis.setPage(1)\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//append to DOM\r\n\t\t\tthis.element.appendChild(this.firstBut);\r\n\t\t\tthis.element.appendChild(this.prevBut);\r\n\t\t\tthis.element.appendChild(this.pagesElement);\r\n\t\t\tthis.element.appendChild(this.nextBut);\r\n\t\t\tthis.element.appendChild(this.lastBut);\r\n\t\t\t\r\n\t\t\tif(!this.table.options.paginationElement && !hidden){\r\n\t\t\t\tif(this.table.options.paginationCounter){\r\n\r\n\t\t\t\t\tpaginationCounterHolder \r\n\r\n\t\t\t\t\tif(this.table.options.paginationCounterElement){\r\n\t\t\t\t\t\tif(this.table.options.paginationCounterElement instanceof HTMLElement){\r\n\t\t\t\t\t\t\tthis.table.options.paginationCounterElement.appendChild(this.pageCounterElement);\r\n\t\t\t\t\t\t}else if(typeof this.table.options.paginationCounterElement === \"string\"){\r\n\t\t\t\t\t\t\tpaginationCounterHolder = document.querySelector(this.table.options.paginationCounterElement);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(paginationCounterHolder){\r\n\t\t\t\t\t\t\t\tpaginationCounterHolder.appendChild(this.pageCounterElement);\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Pagination Error - Unable to find element matching paginationCounterElement selector:\", this.table.options.paginationCounterElement);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.footerAppend(this.pageCounterElement);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.footerAppend(this.element);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.page = this.table.options.paginationInitialPage;\r\n\t\t\tthis.count = this.table.options.paginationButtonCount;\r\n\t\t}\r\n\t\t\r\n\t\t//set default values\r\n\t\tthis.mode = this.table.options.paginationMode;\r\n\t}\r\n\t\r\n\tinitializeProgressive(mode){\r\n\t\tthis.initializePaginator(true);\r\n\t\tthis.mode = \"progressive_\" + mode;\r\n\t\tthis.progressiveLoad = true;\r\n\t}\r\n\t\r\n\ttrackChanges(){\r\n\t\tthis.dispatch(\"page-changed\");\r\n\t}\r\n\t\r\n\tsetDisplayIndex(index){\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\t\r\n\tgetDisplayIndex(){\r\n\t\treturn this.displayIndex;\r\n\t}\r\n\t\r\n\t//calculate maximum page from number of rows\r\n\tsetMaxRows(rowCount){\r\n\t\tif(!rowCount){\r\n\t\t\tthis.max = 1;\r\n\t\t}else{\r\n\t\t\tthis.max = this.size === true ? 1 : Math.ceil(rowCount/this.size);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.page > this.max){\r\n\t\t\tthis.page = this.max;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//reset to first page without triggering action\r\n\treset(force){\r\n\t\tif(!this.initialLoad){\r\n\t\t\tif(this.mode == \"local\" || force){\r\n\t\t\t\tthis.page = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set the maximum page\r\n\tsetMaxPage(max){\r\n\t\t\r\n\t\tmax = parseInt(max);\r\n\t\t\r\n\t\tthis.max = max || 1;\r\n\t\t\r\n\t\tif(this.page > this.max){\r\n\t\t\tthis.page = this.max;\r\n\t\t\tthis.trigger();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set current page number\r\n\tsetPage(page){\r\n\t\tswitch(page){\r\n\t\t\tcase \"first\":\r\n\t\t\treturn this.setPage(1);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"prev\":\r\n\t\t\treturn this.previousPage();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"next\":\r\n\t\t\treturn this.nextPage();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"last\":\r\n\t\t\treturn this.setPage(this.max);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\tpage = parseInt(page);\r\n\t\t\r\n\t\tif((page > 0 && page <= this.max) || this.mode !== \"local\"){\r\n\t\t\tthis.page = page;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Requested page is out of range of 1 - \" + this.max + \":\", page);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetPageToRow(row){\r\n\t\tvar rows = this.table.rowManager.getDisplayRows(this.displayIndex - 1);\r\n\t\tvar index = rows.indexOf(row);\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tvar page = this.size === true ? 1 : Math.ceil((index + 1) / this.size);\r\n\t\t\t\r\n\t\t\treturn this.setPage(page)\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Requested row is not visible\");\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetPageSize(size){\r\n\t\tif(size !== true){\r\n\t\t\tsize = parseInt(size);\r\n\t\t}\r\n\r\n\t\tif(size > 0){\r\n\t\t\tthis.size = size;\r\n\t\t\tthis.dispatchExternal(\"pageSizeChanged\", size);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.pageSizeSelect){\r\n\t\t\t// this.pageSizeSelect.value = size;\r\n\t\t\tthis.generatePageSizeSelectList();\r\n\t\t}\r\n\t\t\r\n\t\tthis.trackChanges();\r\n\t}\r\n\t\r\n\t_setPageCounter(totalRows, size, currentRow){\r\n\t\tvar content;\r\n\t\t\r\n\t\tif(this.pageCounter){\r\n\r\n\t\t\tif(this.mode === \"remote\"){\r\n\t\t\t\tsize = this.size;\r\n\t\t\t\tcurrentRow = ((this.page - 1) * this.size) + 1;\r\n\t\t\t\ttotalRows = this.remoteRowCountEstimate;\r\n\t\t\t}\r\n\r\n\t\t\tcontent = this.pageCounter.call(this, size, currentRow, this.page, totalRows, this.max);\r\n\t\t\t\r\n\t\t\tswitch(typeof content){\r\n\t\t\t\tcase \"object\":\r\n\t\t\t\tif(content instanceof Node){\r\n\t\t\t\t\t\r\n\t\t\t\t\t//clear previous cell contents\r\n\t\t\t\t\twhile(this.pageCounterElement.firstChild) this.pageCounterElement.removeChild(this.pageCounterElement.firstChild);\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.pageCounterElement.appendChild(content);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.pageCounterElement.innerHTML = \"\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(content != null){\r\n\t\t\t\t\t\tconsole.warn(\"Page Counter Error - Page Counter has returned a type of object, the only valid page counter object return is an instance of Node, the page counter returned:\", content);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"undefined\":\r\n\t\t\t\tthis.pageCounterElement.innerHTML = \"\";\r\n\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\tthis.pageCounterElement.innerHTML = content;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//setup the pagination buttons\r\n\t_setPageButtons(){\r\n\t\tlet leftSize = Math.floor((this.count-1) / 2);\r\n\t\tlet rightSize = Math.ceil((this.count-1) / 2);\r\n\t\tlet min = this.max - this.page + leftSize + 1 < this.count ? this.max-this.count+1: Math.max(this.page-leftSize,1);\r\n\t\tlet max = this.page <= rightSize? Math.min(this.count, this.max) :Math.min(this.page+rightSize, this.max);\r\n\t\t\r\n\t\twhile(this.pagesElement.firstChild) this.pagesElement.removeChild(this.pagesElement.firstChild);\r\n\t\t\r\n\t\tif(this.page == 1){\r\n\t\t\tthis.firstBut.disabled = true;\r\n\t\t\tthis.prevBut.disabled = true;\r\n\t\t}else{\r\n\t\t\tthis.firstBut.disabled = false;\r\n\t\t\tthis.prevBut.disabled = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.page == this.max){\r\n\t\t\tthis.lastBut.disabled = true;\r\n\t\t\tthis.nextBut.disabled = true;\r\n\t\t}else{\r\n\t\t\tthis.lastBut.disabled = false;\r\n\t\t\tthis.nextBut.disabled = false;\r\n\t\t}\r\n\t\t\r\n\t\tfor(let i = min; i <= max; i++){\r\n\t\t\tif(i>0 && i <= this.max){\r\n\t\t\t\tthis.pagesElement.appendChild(this._generatePageButton(i));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.footerRedraw();\r\n\t}\r\n\t\r\n\t_generatePageButton(page){\r\n\t\tvar button = document.createElement(\"button\");\r\n\t\t\r\n\t\tbutton.classList.add(\"tabulator-page\");\r\n\t\tif(page == this.page){\r\n\t\t\tbutton.classList.add(\"active\");\r\n\t\t}\r\n\t\t\r\n\t\tbutton.setAttribute(\"type\", \"button\");\r\n\t\tbutton.setAttribute(\"role\", \"button\");\r\n\t\t\r\n\t\tthis.langBind(\"pagination|page_title\", (value) => {\r\n\t\t\tbutton.setAttribute(\"aria-label\", value + \" \" + page);\r\n\t\t\tbutton.setAttribute(\"title\", value + \" \" + page);\r\n\t\t});\r\n\t\t\r\n\t\tbutton.setAttribute(\"data-page\", page);\r\n\t\tbutton.textContent = page;\r\n\t\t\r\n\t\tbutton.addEventListener(\"click\", (e) => {\r\n\t\t\tthis.setPage(page)\r\n\t\t});\r\n\t\t\r\n\t\treturn button;\r\n\t}\r\n\t\r\n\t//previous page\r\n\tpreviousPage(){\r\n\t\tif(this.page > 1){\r\n\t\t\tthis.page--;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger()\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Previous page would be less than page 1:\", 0);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//next page\r\n\tnextPage(){\r\n\t\tif(this.page < this.max){\r\n\t\t\tthis.page++;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger();\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tif(!this.progressiveLoad){\r\n\t\t\t\tconsole.warn(\"Pagination Error - Next page would be greater than maximum page of \" + this.max + \":\", this.max + 1);\r\n\t\t\t}\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return current page number\r\n\tgetPage(){\r\n\t\treturn this.page;\r\n\t}\r\n\t\r\n\t//return max page number\r\n\tgetPageMax(){\r\n\t\treturn this.max;\r\n\t}\r\n\t\r\n\tgetPageSize(size){\r\n\t\treturn this.size;\r\n\t}\r\n\t\r\n\tgetMode(){\r\n\t\treturn this.mode;\r\n\t}\r\n\t\r\n\t//return appropriate rows for current page\r\n\tgetRows(data){\r\n\t\tvar actualRowPageSize = 0,\r\n\t\toutput, start, end, actualStartRow;\r\n\r\n\t\tvar actualRows = data.filter((row) => {\r\n\t\t\treturn row.type === \"row\";\r\n\t\t});\r\n\t\t\r\n\t\tif(this.mode == \"local\"){\r\n\t\t\toutput = [];\r\n\t\t\t\r\n\t\t\tthis.setMaxRows(data.length);\r\n\t\t\t\r\n\t\t\tif(this.size === true){\r\n\t\t\t\tstart = 0;\r\n\t\t\t\tend = data.length;\r\n\t\t\t}else{\r\n\t\t\t\tstart = this.size * (this.page - 1);\r\n\t\t\t\tend = start + parseInt(this.size);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._setPageButtons();\r\n\t\t\t\r\n\t\t\tfor(let i = start; i < end; i++){\r\n\t\t\t\tlet row = data[i];\r\n\r\n\t\t\t\tif(row){\r\n\t\t\t\t\toutput.push(row);\r\n\r\n\t\t\t\t\tif(row.type === \"row\"){\r\n\t\t\t\t\t\tif(!actualStartRow){\r\n\t\t\t\t\t\t\tactualStartRow = row;\r\n\t\t\t\t\t\t}\t\r\n\r\n\t\t\t\t\t\tactualRowPageSize++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._setPageCounter(actualRows.length, actualRowPageSize, actualStartRow ? (actualRows.indexOf(actualStartRow) + 1) : 0);\r\n\t\t\t\r\n\t\t\treturn output;\r\n\t\t}else{\r\n\t\t\tthis._setPageButtons();\r\n\t\t\tthis._setPageCounter(actualRows.length);\r\n\t\t\t\r\n\t\t\treturn data.slice(0);\r\n\t\t}\r\n\t}\r\n\t\r\n\ttrigger(){\r\n\t\tvar left;\r\n\t\t\r\n\t\tswitch(this.mode){\r\n\t\t\tcase \"local\":\r\n\t\t\tleft = this.table.rowManager.scrollLeft;\r\n\t\t\t\r\n\t\t\tthis.refreshData();\r\n\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"pageLoaded\", this.getPage());\r\n\t\t\t\r\n\t\t\treturn Promise.resolve();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"remote\":\r\n\t\t\tthis.dataChanging = true;\r\n\t\t\treturn this.reloadData(null)\r\n\t\t\t.finally(() => {\r\n\t\t\t\tthis.dataChanging = false;\r\n\t\t\t})\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"progressive_load\":\r\n\t\t\tcase \"progressive_scroll\":\r\n\t\t\treturn this.reloadData(null, true);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\tconsole.warn(\"Pagination Error - no such pagination mode:\", this.mode);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_parseRemoteData(data){\r\n\t\tvar left, data, margin;\r\n\t\t\r\n\t\tif(typeof data.last_page === \"undefined\"){\r\n\t\t\tconsole.warn(\"Remote Pagination Error - Server response missing '\" + (this.options(\"dataReceiveParams\").last_page || \"last_page\") + \"' property\");\r\n\t\t}\r\n\t\t\r\n\t\tif(data.data){\r\n\t\t\tthis.max = parseInt(data.last_page) || 1;\r\n\r\n\t\t\tthis.remoteRowCountEstimate = typeof data.last_row !== \"undefined\" ? data.last_row : (data.last_page * this.size - (this.page == data.last_page ? (this.size - data.data.length) : 0));\r\n\t\t\t\r\n\t\t\tif(this.progressiveLoad){\r\n\t\t\t\tswitch(this.mode){\r\n\t\t\t\t\tcase \"progressive_load\":\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.page == 1){\r\n\t\t\t\t\t\tthis.table.rowManager.setData(data.data, false, this.page == 1)\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.table.rowManager.addRows(data.data);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.page < this.max){\r\n\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\tthis.nextPage();\r\n\t\t\t\t\t\t}, this.table.options.progressiveLoadDelay);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"progressive_scroll\":\r\n\t\t\t\t\tdata = this.page === 1 ? data.data : this.table.rowManager.getData().concat(data.data);\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.table.rowManager.setData(data, this.page !== 1, this.page == 1);\r\n\t\t\t\t\t\r\n\t\t\t\t\tmargin = this.table.options.progressiveLoadScrollMargin || (this.table.rowManager.element.clientHeight * 2);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.table.rowManager.element.scrollHeight <= (this.table.rowManager.element.clientHeight + margin)){\r\n\t\t\t\t\t\tif(this.page < this.max){\r\n\t\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\t\tthis.nextPage();\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\t// left = this.table.rowManager.scrollLeft;\r\n\t\t\t\tthis.dispatchExternal(\"pageLoaded\", this.getPage());\r\n\t\t\t\t// this.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\t// this.table.columnManager.scrollHorizontal(left);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Remote Pagination Error - Server response missing '\" + (this.options(\"dataReceiveParams\").data || \"data\") + \"' property\");\r\n\t\t}\r\n\t\t\r\n\t\treturn data.data;\r\n\t}\r\n\t\r\n\t//handle the footer element being redrawn\r\n\tfooterRedraw(){\r\n\t\tvar footer = this.table.footerManager.containerElement;\r\n\r\n\t\tif((Math.ceil(footer.clientWidth) - footer.scrollWidth) < 0){\r\n\t\t\tthis.pagesElement.style.display = 'none';\r\n\t\t}else{\r\n\t\t\tthis.pagesElement.style.display = '';\r\n\t\t\t\r\n\t\t\tif((Math.ceil(footer.clientWidth) - footer.scrollWidth) < 0){\r\n\t\t\t\tthis.pagesElement.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nPage.moduleName = \"page\";\r\n\r\n//load defaults\r\nPage.pageCounters = defaultPageCounters;\r\n\r\nexport default Page;\r\n","export default function(pageSize, currentRow, currentPage, totalRows, totalPages){\r\n\r\n var el = document.createElement(\"span\"),\r\n\tshowingEl = document.createElement(\"span\"),\r\n\tvalueEl = document.createElement(\"span\"),\r\n\tofEl = document.createElement(\"span\"),\r\n\ttotalEl = document.createElement(\"span\"),\r\n\trowsEl = document.createElement(\"span\");\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|showing\", (value) => {\r\n\t\tshowingEl.innerHTML = value;\r\n\t});\r\n\t\r\n\tvalueEl.innerHTML = \" \" + currentPage + \" \";\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|of\", (value) => {\r\n\t\tofEl.innerHTML = value;\r\n\t});\r\n\t\r\n\ttotalEl.innerHTML = \" \" + totalPages + \" \";\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|pages\", (value) => {\r\n\t\trowsEl.innerHTML = value;\r\n\t});\r\n\t\r\n\tel.appendChild(showingEl);\r\n\tel.appendChild(valueEl);\r\n\tel.appendChild(ofEl);\r\n\tel.appendChild(totalEl);\r\n\tel.appendChild(rowsEl);\r\n\t\r\n\treturn el;\r\n};","import rows from './pageCounters/rows.js';\r\nimport pages from './pageCounters/pages.js';\r\n\r\n\r\nexport default {\r\n\trows:rows,\r\n\tpages:pages,\r\n};","// read peristence information from storage\r\nexport default {\r\n\tlocal:function(id, type){\r\n\t\tvar data = localStorage.getItem(id + \"-\" + type);\r\n\r\n\t\treturn data ? JSON.parse(data) : false;\r\n\t},\r\n\tcookie:function(id, type){\r\n\t\tvar cookie = document.cookie,\r\n\t\tkey = id + \"-\" + type,\r\n\t\tcookiePos = cookie.indexOf(key + \"=\"),\r\n\t\tend, data;\r\n\r\n\t\t//if cookie exists, decode and load column data into tabulator\r\n\t\tif(cookiePos > -1){\r\n\t\t\tcookie = cookie.slice(cookiePos);\r\n\r\n\t\t\tend = cookie.indexOf(\";\");\r\n\r\n\t\t\tif(end > -1){\r\n\t\t\t\tcookie = cookie.slice(0, end);\r\n\t\t\t}\r\n\r\n\t\t\tdata = cookie.replace(key + \"=\", \"\");\r\n\t\t}\r\n\r\n\t\treturn data ? JSON.parse(data) : false;\r\n\t}\r\n};\r\n","//write persistence information to storage\r\nexport default {\r\n\tlocal:function(id, type, data){\r\n\t\tlocalStorage.setItem(id + \"-\" + type, JSON.stringify(data));\r\n\t},\r\n\tcookie:function(id, type, data){\r\n\t\tvar expireDate = new Date();\r\n\r\n\t\texpireDate.setDate(expireDate.getDate() + 10000);\r\n\r\n\t\tdocument.cookie = id + \"-\" + type + \"=\" + JSON.stringify(data) + \"; expires=\" + expireDate.toUTCString();\r\n\t}\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultReaders from './defaults/readers.js';\r\nimport defaultWriters from './defaults/writers.js';\r\n\r\nclass Persistence extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.mode = \"\";\r\n\t\tthis.id = \"\";\r\n\t\t// this.persistProps = [\"field\", \"width\", \"visible\"];\r\n\t\tthis.defWatcherBlock = false;\r\n\t\tthis.config = {};\r\n\t\tthis.readFunc = false;\r\n\t\tthis.writeFunc = false;\r\n\r\n\t\tthis.registerTableOption(\"persistence\", false);\r\n\t\tthis.registerTableOption(\"persistenceID\", \"\"); //key for persistent storage\r\n\t\tthis.registerTableOption(\"persistenceMode\", true); //mode for storing persistence information\r\n\t\tthis.registerTableOption(\"persistenceReaderFunc\", false); //function for handling persistence data reading\r\n\t\tthis.registerTableOption(\"persistenceWriterFunc\", false); //function for handling persistence data writing\r\n\t}\r\n\r\n\t// Test for whether localStorage is available for use.\r\n\tlocalStorageTest() {\r\n\t\tvar testKey = \"_tabulator_test\";\r\n\r\n\t\ttry {\r\n\t\t\twindow.localStorage.setItem( testKey, testKey);\r\n\t\t\twindow.localStorage.removeItem( testKey );\r\n\t\t\treturn true;\r\n\t\t} catch(e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//setup parameters\r\n\tinitialize(){\r\n\t\tif(this.table.options.persistence){\r\n\t\t\t//determine persistent layout storage type\r\n\t\t\tvar mode = this.table.options.persistenceMode,\r\n\t\t\tid = this.table.options.persistenceID,\r\n\t\t\tretreivedData;\r\n\r\n\t\t\tthis.mode = mode !== true ? mode : (this.localStorageTest() ? \"local\" : \"cookie\");\r\n\r\n\t\t\tif(this.table.options.persistenceReaderFunc){\r\n\t\t\t\tif(typeof this.table.options.persistenceReaderFunc === \"function\"){\r\n\t\t\t\t\tthis.readFunc = this.table.options.persistenceReaderFunc;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(Persistence.readers[this.table.options.persistenceReaderFunc]){\r\n\t\t\t\t\t\tthis.readFunc = Persistence.readers[this.table.options.persistenceReaderFunc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Persistence Read Error - invalid reader set\", this.table.options.persistenceReaderFunc);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(Persistence.readers[this.mode]){\r\n\t\t\t\t\tthis.readFunc = Persistence.readers[this.mode];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Persistence Read Error - invalid reader set\", this.mode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.options.persistenceWriterFunc){\r\n\t\t\t\tif(typeof this.table.options.persistenceWriterFunc === \"function\"){\r\n\t\t\t\t\tthis.writeFunc = this.table.options.persistenceWriterFunc;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(Persistence.writers[this.table.options.persistenceWriterFunc]){\r\n\t\t\t\t\t\tthis.writeFunc = Persistence.writers[this.table.options.persistenceWriterFunc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Persistence Write Error - invalid reader set\", this.table.options.persistenceWriterFunc);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(Persistence.writers[this.mode]){\r\n\t\t\t\t\tthis.writeFunc = Persistence.writers[this.mode];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Persistence Write Error - invalid writer set\", this.mode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//set storage tag\r\n\t\t\tthis.id = \"tabulator-\" + (id || (this.table.element.getAttribute(\"id\") || \"\"));\r\n\r\n\t\t\tthis.config = {\r\n\t\t\t\tsort:this.table.options.persistence === true || this.table.options.persistence.sort,\r\n\t\t\t\tfilter:this.table.options.persistence === true || this.table.options.persistence.filter,\r\n\t\t\t\tgroup:this.table.options.persistence === true || this.table.options.persistence.group,\r\n\t\t\t\tpage:this.table.options.persistence === true || this.table.options.persistence.page,\r\n\t\t\t\tcolumns:this.table.options.persistence === true ? [\"title\", \"width\", \"visible\"] : this.table.options.persistence.columns,\r\n\t\t\t};\r\n\r\n\t\t\t//load pagination data if needed\r\n\t\t\tif(this.config.page){\r\n\t\t\t\tretreivedData = this.retreiveData(\"page\");\r\n\r\n\t\t\t\tif(retreivedData){\r\n\t\t\t\t\tif(typeof retreivedData.paginationSize !== \"undefined\" && (this.config.page === true || this.config.page.size)){\r\n\t\t\t\t\t\tthis.table.options.paginationSize = retreivedData.paginationSize;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(typeof retreivedData.paginationInitialPage !== \"undefined\" && (this.config.page === true || this.config.page.page)){\r\n\t\t\t\t\t\tthis.table.options.paginationInitialPage = retreivedData.paginationInitialPage;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//load group data if needed\r\n\t\t\tif(this.config.group){\r\n\t\t\t\tretreivedData = this.retreiveData(\"group\");\r\n\r\n\t\t\t\tif(retreivedData){\r\n\t\t\t\t\tif(typeof retreivedData.groupBy !== \"undefined\" && (this.config.group === true || this.config.group.groupBy)){\r\n\t\t\t\t\t\tthis.table.options.groupBy = retreivedData.groupBy;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(typeof retreivedData.groupStartOpen !== \"undefined\" && (this.config.group === true || this.config.group.groupStartOpen)){\r\n\t\t\t\t\t\tthis.table.options.groupStartOpen = retreivedData.groupStartOpen;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(typeof retreivedData.groupHeader !== \"undefined\" && (this.config.group === true || this.config.group.groupHeader)){\r\n\t\t\t\t\t\tthis.table.options.groupHeader = retreivedData.groupHeader;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.columns){\r\n\t\t\t\tthis.table.options.columns = this.load(\"columns\", this.table.options.columns);\r\n\t\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t\t\tthis.subscribe(\"column-show\", this.save.bind(this, \"columns\"));\r\n\t\t\t\tthis.subscribe(\"column-hide\", this.save.bind(this, \"columns\"));\r\n\t\t\t\tthis.subscribe(\"column-moved\", this.save.bind(this, \"columns\"));\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"table-built\", this.tableBuilt.bind(this), 0);\r\n\r\n\t\t\tthis.subscribe(\"table-redraw\", this.tableRedraw.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"filter-changed\", this.eventSave.bind(this, \"filter\"));\r\n\t\t\tthis.subscribe(\"sort-changed\", this.eventSave.bind(this, \"sort\"));\r\n\t\t\tthis.subscribe(\"group-changed\", this.eventSave.bind(this, \"group\"));\r\n\t\t\tthis.subscribe(\"page-changed\", this.eventSave.bind(this, \"page\"));\r\n\t\t\tthis.subscribe(\"column-resized\", this.eventSave.bind(this, \"columns\"));\r\n\t\t\tthis.subscribe(\"layout-refreshed\", this.eventSave.bind(this, \"columns\"));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"getColumnLayout\", this.getColumnLayout.bind(this));\r\n\t\tthis.registerTableFunction(\"setColumnLayout\", this.setColumnLayout.bind(this));\r\n\t}\r\n\r\n\teventSave(type){\r\n\t\tif(this.config[type]){\r\n\t\t\tthis.save(type);\r\n\t\t}\r\n\t}\r\n\r\n\ttableBuilt(){\r\n\t\tvar options = this.table.options,\r\n\t\tsorters, filters;\r\n\r\n\t\tif(this.config.sort){\r\n\t\t\tsorters = this.load(\"sort\");\r\n\r\n\t\t\tif(!sorters === false){\r\n\t\t\t\tthis.table.options.initialSort = sorters;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this.config.filter){\r\n\t\t\tfilters = this.load(\"filter\");\r\n\r\n\t\t\tif(!filters === false){\r\n\t\t\t\tthis.table.options.initialFilter = filters;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tif(force && this.config.columns){\r\n\t\t\tthis.save(\"columns\");\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tgetColumnLayout(){\r\n\t\treturn this.parseColumns(this.table.columnManager.getColumns());\r\n\t}\r\n\r\n\tsetColumnLayout(layout){\r\n\t\tthis.table.columnManager.setColumns(this.mergeDefinition(this.table.options.columns, layout))\r\n\t\treturn true;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tinitializeColumn(column){\r\n\t\tvar def, keys;\r\n\r\n\t\tif(this.config.columns){\r\n\t\t\tthis.defWatcherBlock = true;\r\n\r\n\t\t\tdef = column.getDefinition();\r\n\r\n\t\t\tkeys = this.config.columns === true ? Object.keys(def) : this.config.columns;\r\n\r\n\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\tvar props = Object.getOwnPropertyDescriptor(def, key);\r\n\t\t\t\tvar value = def[key];\r\n\t\t\t\tif(props){\r\n\t\t\t\t\tObject.defineProperty(def, key, {\r\n\t\t\t\t\t\tset: function(newValue){\r\n\t\t\t\t\t\t\tvalue = newValue;\r\n\r\n\t\t\t\t\t\t\tif(!this.defWatcherBlock){\r\n\t\t\t\t\t\t\t\tthis.save(\"columns\");\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif(props.set){\r\n\t\t\t\t\t\t\t\tprops.set(newValue);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tget:function(){\r\n\t\t\t\t\t\t\tif(props.get){\r\n\t\t\t\t\t\t\t\tprops.get();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.defWatcherBlock = false;\r\n\t\t}\r\n\t}\r\n\r\n\t//load saved definitions\r\n\tload(type, current){\r\n\t\tvar data = this.retreiveData(type);\r\n\r\n\t\tif(current){\r\n\t\t\tdata = data ? this.mergeDefinition(current, data) : current;\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//retreive data from memory\r\n\tretreiveData(type){\r\n\t\treturn this.readFunc ? this.readFunc(this.id, type) : false;\r\n\t}\r\n\r\n\t//merge old and new column definitions\r\n\tmergeDefinition(oldCols, newCols){\r\n\t\tvar output = [];\r\n\r\n\t\tnewCols = newCols || [];\r\n\r\n\t\tnewCols.forEach((column, to) => {\r\n\t\t\tvar from = this._findColumn(oldCols, column),\r\n\t\t\tkeys;\r\n\r\n\t\t\tif(from){\r\n\t\t\t\tif(this.config.columns === true || this.config.columns == undefined){\r\n\t\t\t\t\tkeys = Object.keys(from);\r\n\t\t\t\t\tkeys.push(\"width\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tkeys = this.config.columns;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\t\tif(key !== \"columns\" && typeof column[key] !== \"undefined\"){\r\n\t\t\t\t\t\tfrom[key] = column[key];\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(from.columns){\r\n\t\t\t\t\tfrom.columns = this.mergeDefinition(from.columns, column.columns);\r\n\t\t\t\t}\r\n\r\n\t\t\t\toutput.push(from);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\toldCols.forEach((column, i) => {\r\n\t\t\tvar from = this._findColumn(newCols, column);\r\n\r\n\t\t\tif (!from) {\r\n\t\t\t\tif(output.length>i){\r\n\t\t\t\t\toutput.splice(i, 0, column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\toutput.push(column);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//find matching columns\r\n\t_findColumn(columns, subject){\r\n\t\tvar type = subject.columns ? \"group\" : (subject.field ? \"field\" : \"object\");\r\n\r\n\t\treturn columns.find(function(col){\r\n\t\t\tswitch(type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\treturn col.title === subject.title && col.columns.length === subject.columns.length;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"field\":\r\n\t\t\t\treturn col.field === subject.field;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"object\":\r\n\t\t\t\treturn col === subject;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//save data\r\n\tsave(type){\r\n\t\tvar data = {};\r\n\r\n\t\tswitch(type){\r\n\t\t\tcase \"columns\":\r\n\t\t\tdata = this.parseColumns(this.table.columnManager.getColumns())\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"filter\":\r\n\t\t\tdata = this.table.modules.filter.getFilters();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"sort\":\r\n\t\t\tdata = this.validateSorters(this.table.modules.sort.getSort());\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\tdata = this.getGroupConfig();\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"page\":\r\n\t\t\tdata = this.getPageConfig();\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(this.writeFunc){\r\n\t\t\tthis.writeFunc(this.id, type, data);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t//ensure sorters contain no function data\r\n\tvalidateSorters(data){\r\n\t\tdata.forEach(function(item){\r\n\t\t\titem.column = item.field;\r\n\t\t\tdelete item.field;\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tgetGroupConfig(){\r\n\t\tvar data = {};\r\n\r\n\t\tif(this.config.group){\r\n\t\t\tif(this.config.group === true || this.config.group.groupBy){\r\n\t\t\t\tdata.groupBy = this.table.options.groupBy;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.group === true || this.config.group.groupStartOpen){\r\n\t\t\t\tdata.groupStartOpen = this.table.options.groupStartOpen;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.group === true || this.config.group.groupHeader){\r\n\t\t\t\tdata.groupHeader = this.table.options.groupHeader;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tgetPageConfig(){\r\n\t\tvar data = {};\r\n\r\n\t\tif(this.config.page){\r\n\t\t\tif(this.config.page === true || this.config.page.size){\r\n\t\t\t\tdata.paginationSize = this.table.modules.page.getPageSize();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.page === true || this.config.page.page){\r\n\t\t\t\tdata.paginationInitialPage = this.table.modules.page.getPage();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\r\n\t//parse columns for data to store\r\n\tparseColumns(columns){\r\n\t\tvar definitions = [],\r\n\t\texcludedKeys = [\"headerContextMenu\", \"headerMenu\", \"contextMenu\", \"clickMenu\"];\r\n\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\tvar defStore = {},\r\n\t\t\tcolDef = column.getDefinition(),\r\n\t\t\tkeys;\r\n\r\n\t\t\tif(column.isGroup){\r\n\t\t\t\tdefStore.title = colDef.title;\r\n\t\t\t\tdefStore.columns = this.parseColumns(column.getColumns());\r\n\t\t\t}else{\r\n\t\t\t\tdefStore.field = column.getField();\r\n\r\n\t\t\t\tif(this.config.columns === true || this.config.columns == undefined){\r\n\t\t\t\t\tkeys = Object.keys(colDef);\r\n\t\t\t\t\tkeys.push(\"width\");\r\n\t\t\t\t\tkeys.push(\"visible\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tkeys = this.config.columns;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\t\tswitch(key){\r\n\t\t\t\t\t\tcase \"width\":\r\n\t\t\t\t\t\tdefStore.width = column.getWidth();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"visible\":\r\n\t\t\t\t\t\tdefStore.visible = column.visible;\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tif(typeof colDef[key] !== \"function\" && excludedKeys.indexOf(key) === -1){\r\n\t\t\t\t\t\t\tdefStore[key] = colDef[key];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tdefinitions.push(defStore);\r\n\t\t});\r\n\r\n\t\treturn definitions;\r\n\t}\r\n}\r\n\r\nPersistence.moduleName = \"persistence\";\r\n\r\nPersistence.moduleInitOrder = -10;\r\n\r\n//load defaults\r\nPersistence.readers = defaultReaders;\r\nPersistence.writers = defaultWriters;\r\n\r\nexport default Persistence;","import Module from '../../core/Module.js';\r\n\r\nclass Popup extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.columnSubscribers = {};\r\n\t\t\r\n\t\tthis.registerTableOption(\"rowContextPopup\", false);\r\n\t\tthis.registerTableOption(\"rowClickPopup\", false);\r\n\t\tthis.registerTableOption(\"groupContextPopup\", false);\r\n\t\tthis.registerTableOption(\"groupClickPopup\", false);\r\n\t\t\r\n\t\tthis.registerColumnOption(\"headerContextPopup\");\r\n\t\tthis.registerColumnOption(\"headerClickPopup\");\r\n\t\tthis.registerColumnOption(\"headerPopup\");\r\n\t\tthis.registerColumnOption(\"headerPopupIcon\");\r\n\t\tthis.registerColumnOption(\"contextPopup\");\r\n\t\tthis.registerColumnOption(\"clickPopup\");\r\n\t\t\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.initializeRowWatchers();\r\n\t\tthis.initializeGroupWatchers();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\t\r\n\tinitializeRowWatchers(){\r\n\t\tif(this.table.options.rowContextPopup){\r\n\t\t\tthis.subscribe(\"row-contextmenu\", this.loadPopupEvent.bind(this, this.table.options.rowContextPopup));\r\n\t\t\tthis.table.on(\"rowTapHold\", this.loadPopupEvent.bind(this, this.table.options.rowContextPopup));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.rowClickPopup){\r\n\t\t\tthis.subscribe(\"row-click\", this.loadPopupEvent.bind(this, this.table.options.rowClickPopup));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeGroupWatchers(){\r\n\t\tif(this.table.options.groupContextPopup){\r\n\t\t\tthis.subscribe(\"group-contextmenu\", this.loadPopupEvent.bind(this, this.table.options.groupContextPopup));\r\n\t\t\tthis.table.on(\"groupTapHold\", this.loadPopupEvent.bind(this, this.table.options.groupContextPopup));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.groupClickPopup){\r\n\t\t\tthis.subscribe(\"group-click\", this.loadPopupEvent.bind(this, this.table.options.groupClickPopup));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar options = [\"headerContextPopup\", \"headerClickPopup\"],\r\n\t\tdef = column.definition;\r\n\t\t\r\n\t\t//handle column events\r\n\t\tif(def.headerContextPopup && !this.columnSubscribers.headerContextPopup){\r\n\t\t\tthis.columnSubscribers.headerContextPopup = this.loadPopupTableColumnEvent.bind(this, \"headerContextPopup\");\r\n\t\t\tthis.subscribe(\"column-contextmenu\", this.columnSubscribers.headerContextPopup);\r\n\t\t\tthis.table.on(\"headerTapHold\", this.loadPopupTableColumnEvent.bind(this, \"headerContextPopup\"))\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerClickPopup && !this.columnSubscribers.headerClickPopup){\r\n\t\t\tthis.columnSubscribers.headerClickPopup = this.loadPopupTableColumnEvent.bind(this, \"headerClickPopup\");\r\n\t\t\tthis.subscribe(\"column-click\", this.columnSubscribers.headerClickPopup);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerPopup){\r\n\t\t\tthis.initializeColumnHeaderPopup(column);\r\n\t\t}\r\n\t\t\r\n\t\t//handle cell events\r\n\t\tif(def.contextPopup && !this.columnSubscribers.contextPopup){\r\n\t\t\tthis.columnSubscribers.contextPopup = this.loadPopupTableCellEvent.bind(this, \"contextPopup\");\r\n\t\t\tthis.subscribe(\"cell-contextmenu\", this.columnSubscribers.contextPopup);\r\n\t\t\tthis.table.on(\"cellTapHold\", this.loadPopupTableCellEvent.bind(this, \"contextPopup\"))\r\n\t\t}\r\n\t\t\r\n\t\tif(def.clickPopup && !this.columnSubscribers.clickPopup){\r\n\t\t\tthis.columnSubscribers.clickPopup = this.loadPopupTableCellEvent.bind(this, \"clickPopup\");\r\n\t\t\tthis.subscribe(\"cell-click\", this.columnSubscribers.clickPopup);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumnHeaderPopup(column){\r\n\t\tvar icon = column.definition.headerPopupIcon,\r\n\t\theaderPopupEl;\r\n\t\t\r\n\t\theaderPopupEl = document.createElement(\"span\");\r\n\t\theaderPopupEl.classList.add(\"tabulator-header-popup-button\");\r\n\r\n\t\tif(icon){\r\n\t\t\tif(typeof icon === \"function\"){\r\n\t\t\t\ticon = icon(column.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tif(icon instanceof HTMLElement){\r\n\t\t\t\theaderPopupEl.appendChild(icon);\r\n\t\t\t}else{\r\n\t\t\t\theaderPopupEl.innerHTML = icon;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\theaderPopupEl.innerHTML = \"⋮\";\r\n\t\t}\r\n\t\t\r\n\t\theaderPopupEl.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tthis.loadPopupEvent(column.definition.headerPopup, e, column);\r\n\t\t});\r\n\t\t\r\n\t\tcolumn.titleElement.insertBefore(headerPopupEl, column.titleElement.firstChild);\r\n\t}\r\n\t\r\n\tloadPopupTableCellEvent(option, e, cell){\r\n\t\tif(cell._cell){\r\n\t\t\tcell = cell._cell;\r\n\t\t}\r\n\t\t\r\n\t\tif(cell.column.definition[option]){\r\n\t\t\tthis.loadPopupEvent(cell.column.definition[option], e, cell);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadPopupTableColumnEvent(option, e, column){\r\n\t\tif(column._column){\r\n\t\t\tcolumn = column._column;\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition[option]){\r\n\t\t\tthis.loadPopupEvent(column.definition[option], e, column);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadPopupEvent(contents, e, component){\r\n\t\tvar renderedCallback;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\trenderedCallback = callback;\r\n\t\t}\r\n\t\t\r\n\t\tif(component._group){\r\n\t\t\tcomponent = component._group;\r\n\t\t}else if(component._row){\r\n\t\t\tcomponent = component._row;\r\n\t\t}\r\n\t\t\r\n\t\tcontents = typeof contents == \"function\" ? contents.call(this.table, e, component.getComponent(), onRendered) : contents;\r\n\t\t\r\n\t\tthis.loadPopup(e, component, contents, renderedCallback);\r\n\t}\r\n\t\r\n\tloadPopup(e, component, contents, renderedCallback){\r\n\t\tvar touch = !(e instanceof MouseEvent),\r\n\t\tcontentsEl, popup;\r\n\t\t\r\n\t\tif(contents instanceof HTMLElement){\r\n\t\t\tcontentsEl = contents;\r\n\t\t}else{\r\n\t\t\tcontentsEl = document.createElement(\"div\");\r\n\t\t\tcontentsEl.innerHTML = contents;\r\n\t\t}\r\n\t\t\r\n\t\tcontentsEl.classList.add(\"tabulator-popup\");\r\n\r\n\t\tcontentsEl.addEventListener(\"click\", (e) =>{\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tif(!touch){\r\n\t\t\te.preventDefault();\r\n\t\t}\r\n\t\t\r\n\t\tpopup = this.popup(contentsEl);\r\n\r\n\t\tif(typeof renderedCallback === \"function\"){\r\n\t\t\tpopup.renderCallback(renderedCallback);\r\n\t\t}\r\n\t\t\r\n\t\tpopup.show(e).hideOnBlur(() => {\r\n\t\t\tthis.dispatchExternal(\"popupClosed\", component.getComponent());\r\n\t\t});\r\n\r\n\r\n\r\n\t\tthis.dispatchExternal(\"popupOpened\", component.getComponent())\r\n\t}\r\n}\r\n\r\nPopup.moduleName = \"popup\";\r\n\r\nexport default Popup;\r\n","import Module from '../../core/Module.js';\r\n\r\nclass Print extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.element = false;\r\n\t\tthis.manualBlock = false;\r\n\r\n\t\tthis.registerTableOption(\"printAsHtml\", false); //enable print as html\r\n\t\tthis.registerTableOption(\"printFormatter\", false); //printing page formatter\r\n\t\tthis.registerTableOption(\"printHeader\", false); //page header contents\r\n\t\tthis.registerTableOption(\"printFooter\", false); //page footer contents\r\n\t\tthis.registerTableOption(\"printStyled\", true); //enable print as html styling\r\n\t\tthis.registerTableOption(\"printRowRange\", \"visible\"); //restrict print to visible rows only\r\n\t\tthis.registerTableOption(\"printConfig\", {}); //print config options\r\n\r\n\t\tthis.registerColumnOption(\"print\");\r\n\t\tthis.registerColumnOption(\"titlePrint\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.printAsHtml){\r\n\t\t\twindow.addEventListener(\"beforeprint\", this.replaceTable.bind(this));\r\n\t\t\twindow.addEventListener(\"afterprint\", this.cleanup.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"print\", this.printFullscreen.bind(this));\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\treplaceTable(){\r\n\t\tif(!this.manualBlock){\r\n\t\t\tthis.element = document.createElement(\"div\");\r\n\t\t\tthis.element.classList.add(\"tabulator-print-table\");\r\n\r\n\t\t\tthis.element.appendChild(this.table.modules.export.genereateTable(this.table.options.printConfig, this.table.options.printStyled, this.table.options.printRowRange, \"print\"));\r\n\r\n\t\t\tthis.table.element.style.display = \"none\";\r\n\r\n\t\t\tthis.table.element.parentNode.insertBefore(this.element, this.table.element);\r\n\t\t}\r\n\t}\r\n\r\n\tcleanup(){\r\n\t\tdocument.body.classList.remove(\"tabulator-print-fullscreen-hide\");\r\n\r\n\t\tif(this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\tthis.table.element.style.display = \"\";\r\n\t\t}\r\n\t}\r\n\r\n\tprintFullscreen(visible, style, config){\r\n\t\tvar scrollX = window.scrollX,\r\n\t\tscrollY = window.scrollY,\r\n\t\theaderEl = document.createElement(\"div\"),\r\n\t\tfooterEl = document.createElement(\"div\"),\r\n\t\ttableEl = this.table.modules.export.genereateTable(typeof config != \"undefined\" ? config : this.table.options.printConfig, typeof style != \"undefined\" ? style : this.table.options.printStyled, visible || this.table.options.printRowRange, \"print\"),\r\n\t\theaderContent, footerContent;\r\n\r\n\t\tthis.manualBlock = true;\r\n\r\n\t\tthis.element = document.createElement(\"div\");\r\n\t\tthis.element.classList.add(\"tabulator-print-fullscreen\");\r\n\r\n\t\tif(this.table.options.printHeader){\r\n\t\t\theaderEl.classList.add(\"tabulator-print-header\");\r\n\r\n\t\t\theaderContent = typeof this.table.options.printHeader == \"function\" ? this.table.options.printHeader.call(this.table) : this.table.options.printHeader;\r\n\r\n\t\t\tif(typeof headerContent == \"string\"){\r\n\t\t\t\theaderEl.innerHTML = headerContent;\r\n\t\t\t}else{\r\n\t\t\t\theaderEl.appendChild(headerContent);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element.appendChild(headerEl);\r\n\t\t}\r\n\r\n\t\tthis.element.appendChild(tableEl);\r\n\r\n\t\tif(this.table.options.printFooter){\r\n\t\t\tfooterEl.classList.add(\"tabulator-print-footer\");\r\n\r\n\t\t\tfooterContent = typeof this.table.options.printFooter == \"function\" ? this.table.options.printFooter.call(this.table) : this.table.options.printFooter;\r\n\r\n\r\n\t\t\tif(typeof footerContent == \"string\"){\r\n\t\t\t\tfooterEl.innerHTML = footerContent;\r\n\t\t\t}else{\r\n\t\t\t\tfooterEl.appendChild(footerContent);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element.appendChild(footerEl);\r\n\t\t}\r\n\r\n\t\tdocument.body.classList.add(\"tabulator-print-fullscreen-hide\");\r\n\t\tdocument.body.appendChild(this.element);\r\n\r\n\t\tif(this.table.options.printFormatter){\r\n\t\t\tthis.table.options.printFormatter(this.element, tableEl);\r\n\t\t}\r\n\r\n\t\twindow.print();\r\n\r\n\t\tthis.cleanup();\r\n\r\n\t\twindow.scrollTo(scrollX, scrollY);\r\n\r\n\t\tthis.manualBlock = false;\r\n\t}\r\n}\r\n\r\nPrint.moduleName = \"print\";\r\n\r\nexport default Print;","import Module from '../../core/Module.js';\r\n\r\nclass ReactiveData extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.data = false;\r\n\t\tthis.blocked = false; //block reactivity while performing update\r\n\t\tthis.origFuncs = {}; // hold original data array functions to allow replacement after data is done with\r\n\t\tthis.currentVersion = 0;\r\n\r\n\t\tthis.registerTableOption(\"reactiveData\", false); //enable data reactivity\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.reactiveData){\r\n\t\t\tthis.subscribe(\"cell-value-save-before\", this.block.bind(this));\r\n\t\t\tthis.subscribe(\"cell-value-save-after\", this.unblock.bind(this));\r\n\t\t\tthis.subscribe(\"row-data-save-before\", this.block.bind(this));\r\n\t\t\tthis.subscribe(\"row-data-save-after\", this.unblock.bind(this));\r\n\t\t\tthis.subscribe(\"row-data-init-after\", this.watchRow.bind(this));\r\n\t\t\tthis.subscribe(\"data-processing\", this.watchData.bind(this));\r\n\t\t\tthis.subscribe(\"table-destroy\", this.unwatchData.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\twatchData(data){\r\n\t\tvar self = this,\r\n\t\tpushFunc, version;\r\n\r\n\t\tthis.currentVersion ++;\r\n\r\n\t\tversion = this.currentVersion;\r\n\r\n\t\tthis.unwatchData();\r\n\r\n\t\tthis.data = data;\r\n\r\n\t\t//override array push function\r\n\t\tthis.origFuncs.push = data.push;\r\n\r\n\t\tObject.defineProperty(this.data, \"push\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments);\r\n\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\targs.forEach((arg) => {\r\n\t\t\t\t\t\tself.table.rowManager.addRowActual(arg, false);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.origFuncs.push.apply(data, arguments);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t//override array unshift function\r\n\t\tthis.origFuncs.unshift = data.unshift;\r\n\r\n\t\tObject.defineProperty(this.data, \"unshift\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments);\r\n\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\targs.forEach((arg) => {\r\n\t\t\t\t\t\tself.table.rowManager.addRowActual(arg, true);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.origFuncs.unshift.apply(data, arguments);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\t//override array shift function\r\n\t\tthis.origFuncs.shift = data.shift;\r\n\r\n\t\tObject.defineProperty(this.data, \"shift\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar row;\r\n\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tif(self.data.length){\r\n\t\t\t\t\t\trow = self.table.rowManager.getRowFromDataObject(self.data[0]);\r\n\r\n\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\trow.deleteActual();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.origFuncs.shift.call(data);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t//override array pop function\r\n\t\tthis.origFuncs.pop = data.pop;\r\n\r\n\t\tObject.defineProperty(this.data, \"pop\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar row;\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tif(self.data.length){\r\n\t\t\t\t\t\trow = self.table.rowManager.getRowFromDataObject(self.data[self.data.length - 1]);\r\n\r\n\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\trow.deleteActual();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn self.origFuncs.pop.call(data);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\t//override array splice function\r\n\t\tthis.origFuncs.splice = data.splice;\r\n\r\n\t\tObject.defineProperty(this.data, \"splice\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments),\r\n\t\t\t\tstart = args[0] < 0 ? data.length + args[0] : args[0],\r\n\t\t\t\tend = args[1],\r\n\t\t\t\tnewRows = args[2] ? args.slice(2) : false,\r\n\t\t\t\tstartRow;\r\n\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\r\n\t\t\t\t\t//add new rows\r\n\t\t\t\t\tif(newRows){\r\n\t\t\t\t\t\tstartRow = data[start] ? self.table.rowManager.getRowFromDataObject(data[start]) : false;\r\n\r\n\t\t\t\t\t\tif(startRow){\r\n\t\t\t\t\t\t\tnewRows.forEach((rowData) => {\r\n\t\t\t\t\t\t\t\tself.table.rowManager.addRowActual(rowData, true, startRow, true);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnewRows = newRows.slice().reverse();\r\n\r\n\t\t\t\t\t\t\tnewRows.forEach((rowData) => {\r\n\t\t\t\t\t\t\t\tself.table.rowManager.addRowActual(rowData, true, false, true);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//delete removed rows\r\n\t\t\t\t\tif(end !== 0){\r\n\t\t\t\t\t\tvar oldRows = data.slice(start, typeof args[1] === \"undefined\" ? args[1] : start + end);\r\n\r\n\t\t\t\t\t\toldRows.forEach((rowData, i) => {\r\n\t\t\t\t\t\t\tvar row = self.table.rowManager.getRowFromDataObject(rowData);\r\n\r\n\t\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\t\trow.deleteActual(i !== oldRows.length - 1);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(newRows || end !== 0){\r\n\t\t\t\t\t\tself.table.rowManager.reRenderInPosition();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.origFuncs.splice.apply(data, arguments);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tunwatchData(){\r\n\t\tif(this.data !== false){\r\n\t\t\tfor(var key in this.origFuncs){\r\n\t\t\t\tObject.defineProperty(this.data, key, {\r\n\t\t\t\t\tenumerable: true,\r\n\t\t\t\t\tconfigurable:true,\r\n\t\t\t\t\twritable:true,\r\n\t\t\t\t\tvalue: this.origFuncs.key,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\twatchRow(row){\r\n\t\tvar data = row.getData();\r\n\r\n\t\tthis.blocked = true;\r\n\r\n\t\tfor(var key in data){\r\n\t\t\tthis.watchKey(row, data, key);\r\n\t\t}\r\n\r\n\t\tif(this.table.options.dataTree){\r\n\t\t\tthis.watchTreeChildren(row);\r\n\t\t}\r\n\r\n\t\tthis.blocked = false;\r\n\t}\r\n\r\n\twatchTreeChildren (row){\r\n\t\tvar childField = row.getData()[this.table.options.dataTreeChildField],\r\n\t\torigFuncs = {};\r\n\r\n\t\tfunction rebuildTree(){\r\n\t\t\tthis.table.modules.dataTree.initializeRow(row);\r\n\t\t\tthis.table.modules.dataTree.layoutRow(row);\r\n\t\t\tthis.table.rowManager.refreshActiveData(\"tree\", false, true);\r\n\t\t}\r\n\r\n\t\tif(childField){\r\n\r\n\t\t\torigFuncs.push = childField.push;\r\n\r\n\t\t\tObject.defineProperty(childField, \"push\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tvar result = origFuncs.push.apply(childField, arguments);\r\n\r\n\t\t\t\t\trebuildTree();\r\n\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\torigFuncs.unshift = childField.unshift;\r\n\r\n\t\t\tObject.defineProperty(childField, \"unshift\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tvar result = origFuncs.unshift.apply(childField, arguments);\r\n\r\n\t\t\t\t\trebuildTree();\r\n\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\torigFuncs.shift = childField.shift;\r\n\r\n\t\t\tObject.defineProperty(childField, \"shift\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tvar result = origFuncs.shift.call(childField);\r\n\r\n\t\t\t\t\trebuildTree();\r\n\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\torigFuncs.pop = childField.pop;\r\n\r\n\t\t\tObject.defineProperty(childField, \"pop\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tvar result = origFuncs.pop.call(childField);\r\n\r\n\t\t\t\t\trebuildTree();\r\n\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\torigFuncs.splice = childField.splice;\r\n\r\n\t\t\tObject.defineProperty(childField, \"splice\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tvar result = origFuncs.splice.apply(childField, arguments);\r\n\r\n\t\t\t\t\trebuildTree();\r\n\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\twatchKey(row, data, key){\r\n\t\tvar props = Object.getOwnPropertyDescriptor(data, key),\r\n\t\tvalue = data[key],\r\n\t\tversion = this.currentVersion;\r\n\r\n\t\tObject.defineProperty(data, key, {\r\n\t\t\tset: (newValue) => {\r\n\t\t\t\tvalue = newValue;\r\n\t\t\t\tif(!this.blocked && version === this.currentVersion){\r\n\t\t\t\t\tvar update = {};\r\n\t\t\t\t\tupdate[key] = newValue;\r\n\t\t\t\t\trow.updateData(update);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(props.set){\r\n\t\t\t\t\tprops.set(newValue);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tget:() => {\r\n\r\n\t\t\t\tif(props.get){\r\n\t\t\t\t\tprops.get();\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn value;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tunwatchRow(row){\r\n\t\tvar data = row.getData();\r\n\r\n\t\tfor(var key in data){\r\n\t\t\tObject.defineProperty(data, key, {\r\n\t\t\t\tvalue:data[key],\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tblock(){\r\n\t\tthis.blocked = true;\r\n\t}\r\n\r\n\tunblock(){\r\n\t\tthis.blocked = false;\r\n\t}\r\n}\r\n\r\nReactiveData.moduleName = \"reactiveData\";\r\n\r\nexport default ReactiveData;\r\n\r\n\r\n\r\n","import Module from '../../core/Module.js';\r\n\r\nclass ResizeColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.startColumn = false;\r\n\t\tthis.startX = false;\r\n\t\tthis.startWidth = false;\r\n\t\tthis.latestX = false;\r\n\t\tthis.handle = null;\r\n\t\tthis.initialNextColumn = null;\r\n\t\tthis.nextColumn = null;\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.registerColumnOption(\"resizable\", true);\r\n\t\tthis.registerTableOption(\"resizableColumnFit\", false);\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-rendered\", this.layoutColumnHeader.bind(this));\r\n\t}\r\n\t\r\n\tinitializeEventWatchers(){\r\n\t\tif(!this.initialized){\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-rendered\", this.layoutCellHandles.bind(this));\r\n\t\t\tthis.subscribe(\"cell-delete\", this.deInitializeComponent.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-height\", this.resizeHandle.bind(this));\r\n\t\t\tthis.subscribe(\"column-moved\", this.columnLayoutUpdated.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-hide\", this.deInitializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"column-show\", this.columnLayoutUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"column-width\", this.columnWidthUpdated.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-delete\", this.deInitializeComponent.bind(this));\r\n\t\t\tthis.subscribe(\"column-height\", this.resizeHandle.bind(this));\r\n\t\t\t\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\tlayoutCellHandles(cell){\r\n\t\tif(cell.row.type === \"row\"){\r\n\t\t\tthis.deInitializeComponent(cell);\r\n\t\t\tthis.initializeColumn(\"cell\", cell, cell.column, cell.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tlayoutColumnHeader(column){\r\n\t\tif(column.definition.resizable){\r\n\t\t\tthis.initializeEventWatchers();\r\n\t\t\tthis.deInitializeComponent(column);\r\n\t\t\tthis.initializeColumn(\"header\", column, column, column.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolumnLayoutUpdated(column){\r\n\t\tvar prev = column.prevColumn();\r\n\t\t\r\n\t\tthis.reinitializeColumn(column);\r\n\t\t\r\n\t\tif(prev){\r\n\t\t\tthis.reinitializeColumn(prev);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolumnWidthUpdated(column){\r\n\t\tif(column.modules.frozen){\r\n\t\t\tif(this.table.modules.frozenColumns.leftColumns.includes(column)){\r\n\t\t\t\tthis.table.modules.frozenColumns.leftColumns.forEach((col) => {\r\n\t\t\t\t\tthis.reinitializeColumn(col);\r\n\t\t\t\t});\r\n\t\t\t}else if(this.table.modules.frozenColumns.rightColumns.includes(column)){\r\n\t\t\t\tthis.table.modules.frozenColumns.rightColumns.forEach((col) => {\r\n\t\t\t\t\tthis.reinitializeColumn(col);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeColumn(column){\r\n\t\tvar frozenOffset = column.modules.frozen ? (column.modules.frozen.marginValue + column.getWidth() + \"px\") : false;\r\n\t\t;\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tif(cell.modules.resize && cell.modules.resize.handleEl){\r\n\t\t\t\tif(frozenOffset){\r\n\t\t\t\t\tcell.modules.resize.handleEl.style.left = frozenOffset;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcell.element.after(cell.modules.resize.handleEl);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(column.modules.resize && column.modules.resize.handleEl){\r\n\t\t\tif(frozenOffset){\r\n\t\t\t\tcolumn.modules.resize.handleEl.style.left = frozenOffset;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.element.after(column.modules.resize.handleEl);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(type, component, column, element){\r\n\t\tvar self = this,\r\n\t\tvariableHeight = false,\r\n\t\tmode = column.definition.resizable,\r\n\t\tconfig = {},\r\n\t\tnearestColumn = column.getLastColumn();\r\n\t\t\r\n\t\t//set column resize mode\r\n\t\tif(type === \"header\"){\r\n\t\t\tvariableHeight = column.definition.formatter == \"textarea\" || column.definition.variableHeight;\r\n\t\t\tconfig = {variableHeight:variableHeight};\r\n\t\t}\r\n\t\t\r\n\t\tif((mode === true || mode == type) && this._checkResizability(nearestColumn)){\r\n\t\t\t\r\n\t\t\tvar handle = document.createElement('span');\r\n\t\t\thandle.className = \"tabulator-col-resize-handle\";\r\n\t\t\t\r\n\t\t\thandle.addEventListener(\"click\", function(e){\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tvar handleDown = function(e){\r\n\t\t\t\tself.startColumn = column;\r\n\t\t\t\tself.initialNextColumn = self.nextColumn = nearestColumn.nextColumn();\r\n\t\t\t\tself._mouseDown(e, nearestColumn, handle);\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\thandle.addEventListener(\"mousedown\", handleDown);\r\n\t\t\thandle.addEventListener(\"touchstart\", handleDown, {passive: true});\r\n\t\t\t\r\n\t\t\t//resize column on double click\r\n\t\t\thandle.addEventListener(\"dblclick\", (e) => {\r\n\t\t\t\tvar oldWidth = nearestColumn.getWidth();\r\n\t\t\t\t\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tnearestColumn.reinitializeWidth(true);\r\n\t\t\t\t\r\n\t\t\t\tif(oldWidth !== nearestColumn.getWidth()){\r\n\t\t\t\t\tself.dispatch(\"column-resized\", nearestColumn);\r\n\t\t\t\t\tself.table.externalEvents.dispatch(\"columnResized\", nearestColumn.getComponent());\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(column.modules.frozen){\r\n\t\t\t\thandle.style.position = \"absolute\";\r\n\t\t\t\thandle.style.left = column.modules.frozen.marginValue + column.getWidth() + \"px\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconfig.handleEl = handle;\r\n\t\t\t\r\n\t\t\tif(element.parentNode && column.visible){\r\n\t\t\t\telement.after(handle);\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcomponent.modules.resize = config;\r\n\t}\r\n\t\r\n\tdeInitializeColumn(column){\r\n\t\tthis.deInitializeComponent(column);\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tthis.deInitializeComponent(cell);\r\n\t\t});\r\n\t}\r\n\t\r\n\tdeInitializeComponent(component){\r\n\t\tvar handleEl;\r\n\t\t\r\n\t\tif(component.modules.resize){\r\n\t\t\thandleEl = component.modules.resize.handleEl;\r\n\t\t\t\r\n\t\t\tif(handleEl && handleEl.parentElement){\r\n\t\t\t\thandleEl.parentElement.removeChild(handleEl);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tresizeHandle(component, height){\r\n\t\tif(component.modules.resize && component.modules.resize.handleEl){\r\n\t\t\tcomponent.modules.resize.handleEl.style.height = height;\r\n\t\t}\r\n\t}\r\n\t\r\n\t_checkResizability(column){\r\n\t\treturn column.definition.resizable;\r\n\t}\r\n\t\r\n\t_mouseDown(e, column, handle){\r\n\t\tvar self = this;\r\n\t\t\r\n\t\tself.table.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\tfunction mouseMove(e){\r\n\t\t\tvar x = typeof e.screenX === \"undefined\" ? e.touches[0].screenX : e.screenX,\r\n\t\t\tstartDiff = x - self.startX,\r\n\t\t\tmoveDiff = x - self.latestX,\r\n\t\t\tblockedBefore, blockedAfter;\r\n\t\t\t\r\n\t\t\tself.latestX = x;\r\n\t\t\t\r\n\t\t\tif(self.table.rtl){\r\n\t\t\t\tstartDiff = -startDiff;\r\n\t\t\t\tmoveDiff = -moveDiff;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tblockedBefore = column.width == column.minWidth || column.width == column.maxWidth;\r\n\t\t\t\r\n\t\t\tcolumn.setWidth(self.startWidth + startDiff);\r\n\t\t\t\r\n\t\t\tblockedAfter = column.width == column.minWidth || column.width == column.maxWidth;\r\n\t\t\t\r\n\t\t\tif(moveDiff < 0){\r\n\t\t\t\tself.nextColumn = self.initialNextColumn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(self.table.options.resizableColumnFit && self.nextColumn && !(blockedBefore && blockedAfter)){\r\n\t\t\t\tlet colWidth = self.nextColumn.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tif(moveDiff > 0){\r\n\t\t\t\t\tif(colWidth <= self.nextColumn.minWidth){\r\n\t\t\t\t\t\tself.nextColumn = self.nextColumn.nextColumn();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(self.nextColumn){\r\n\t\t\t\t\tself.nextColumn.setWidth(self.nextColumn.getWidth() - moveDiff);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tself.table.columnManager.renderer.rerenderColumns(true);\r\n\t\t\t\r\n\t\t\tif(!self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight){\r\n\t\t\t\tcolumn.checkCellHeights();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfunction mouseUp(e){\r\n\t\t\t\r\n\t\t\t//block editor from taking action while resizing is taking place\r\n\t\t\tif(self.startColumn.modules.edit){\r\n\t\t\t\tself.startColumn.modules.edit.blocked = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight){\r\n\t\t\t\tcolumn.checkCellHeights();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", mouseUp);\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", mouseMove);\r\n\t\t\t\r\n\t\t\thandle.removeEventListener(\"touchmove\", mouseMove);\r\n\t\t\thandle.removeEventListener(\"touchend\", mouseUp);\r\n\t\t\t\r\n\t\t\tself.table.element.classList.remove(\"tabulator-block-select\");\r\n\t\t\t\r\n\t\t\tif(self.startWidth !== column.getWidth()){\r\n\t\t\t\tself.dispatch(\"column-resized\", column);\r\n\t\t\t\tself.table.externalEvents.dispatch(\"columnResized\", column.getComponent());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\te.stopPropagation(); //prevent resize from interfereing with movable columns\r\n\t\t\r\n\t\t//block editor from taking action while resizing is taking place\r\n\t\tif(self.startColumn.modules.edit){\r\n\t\t\tself.startColumn.modules.edit.blocked = true;\r\n\t\t}\r\n\t\t\r\n\t\tself.startX = typeof e.screenX === \"undefined\" ? e.touches[0].screenX : e.screenX;\r\n\t\tself.latestX = self.startX;\r\n\t\tself.startWidth = column.getWidth();\r\n\t\t\r\n\t\tdocument.body.addEventListener(\"mousemove\", mouseMove);\r\n\t\tdocument.body.addEventListener(\"mouseup\", mouseUp);\r\n\t\thandle.addEventListener(\"touchmove\", mouseMove, {passive: true});\r\n\t\thandle.addEventListener(\"touchend\", mouseUp);\r\n\t}\r\n}\r\n\r\nResizeColumns.moduleName = \"resizeColumns\";\r\n\r\nexport default ResizeColumns;","import Module from '../../core/Module.js';\r\n\r\nclass ResizeRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.startColumn = false;\r\n\t\tthis.startY = false;\r\n\t\tthis.startHeight = false;\r\n\t\tthis.handle = null;\r\n\t\tthis.prevHandle = null;\r\n\r\n\t\tthis.registerTableOption(\"resizableRows\", false); //resizable rows\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.resizableRows){\r\n\t\t\tthis.subscribe(\"row-layout-after\", this.initializeRow.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\trowEl = row.getElement();\r\n\r\n\t\tvar handle = document.createElement('div');\r\n\t\thandle.className = \"tabulator-row-resize-handle\";\r\n\r\n\t\tvar prevHandle = document.createElement('div');\r\n\t\tprevHandle.className = \"tabulator-row-resize-handle prev\";\r\n\r\n\t\thandle.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tvar handleDown = function(e){\r\n\t\t\tself.startRow = row;\r\n\t\t\tself._mouseDown(e, row, handle);\r\n\t\t};\r\n\r\n\t\thandle.addEventListener(\"mousedown\", handleDown);\r\n\t\thandle.addEventListener(\"touchstart\", handleDown, {passive: true});\r\n\r\n\t\tprevHandle.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tvar prevHandleDown = function(e){\r\n\t\t\tvar prevRow = self.table.rowManager.prevDisplayRow(row);\r\n\r\n\t\t\tif(prevRow){\r\n\t\t\t\tself.startRow = prevRow;\r\n\t\t\t\tself._mouseDown(e, prevRow, prevHandle);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tprevHandle.addEventListener(\"mousedown\",prevHandleDown);\r\n\t\tprevHandle.addEventListener(\"touchstart\",prevHandleDown, {passive: true});\r\n\r\n\t\trowEl.appendChild(handle);\r\n\t\trowEl.appendChild(prevHandle);\r\n\t}\r\n\r\n\t_mouseDown(e, row, handle){\r\n\t\tvar self = this;\r\n\r\n\t\tself.table.element.classList.add(\"tabulator-block-select\");\r\n\r\n\t\tfunction mouseMove(e){\r\n\t\t\trow.setHeight(self.startHeight + ((typeof e.screenY === \"undefined\" ? e.touches[0].screenY : e.screenY) - self.startY));\r\n\t\t}\r\n\r\n\t\tfunction mouseUp(e){\r\n\r\n\t\t\t// //block editor from taking action while resizing is taking place\r\n\t\t\t// if(self.startColumn.modules.edit){\r\n\t\t\t// \tself.startColumn.modules.edit.blocked = false;\r\n\t\t\t// }\r\n\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", mouseMove);\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", mouseMove);\r\n\r\n\t\t\thandle.removeEventListener(\"touchmove\", mouseMove);\r\n\t\t\thandle.removeEventListener(\"touchend\", mouseUp);\r\n\r\n\t\t\tself.table.element.classList.remove(\"tabulator-block-select\");\r\n\r\n\t\t\tself.dispatchExternal(\"rowResized\", row.getComponent());\r\n\t\t}\r\n\r\n\t\te.stopPropagation(); //prevent resize from interfereing with movable columns\r\n\r\n\t\t//block editor from taking action while resizing is taking place\r\n\t\t// if(self.startColumn.modules.edit){\r\n\t\t// \tself.startColumn.modules.edit.blocked = true;\r\n\t\t// }\r\n\r\n\t\tself.startY = typeof e.screenY === \"undefined\" ? e.touches[0].screenY : e.screenY;\r\n\t\tself.startHeight = row.getHeight();\r\n\r\n\t\tdocument.body.addEventListener(\"mousemove\", mouseMove);\r\n\t\tdocument.body.addEventListener(\"mouseup\", mouseUp);\r\n\r\n\t\thandle.addEventListener(\"touchmove\", mouseMove, {passive: true});\r\n\t\thandle.addEventListener(\"touchend\", mouseUp);\r\n\t}\r\n}\r\n\r\nResizeRows.moduleName = \"resizeRows\";\r\n\r\nexport default ResizeRows;","import Module from '../../core/Module.js';\r\n\r\nclass ResizeTable extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.binding = false;\r\n\t\tthis.observer = false;\r\n\t\tthis.containerObserver = false;\r\n\r\n\t\tthis.tableHeight = 0;\r\n\t\tthis.tableWidth = 0;\r\n\t\tthis.containerHeight = 0;\r\n\t\tthis.containerWidth = 0;\r\n\r\n\t\tthis.autoResize = false;\r\n\r\n\t\tthis.registerTableOption(\"autoResize\", true); //auto resize table\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.autoResize){\r\n\t\t\tvar table = this.table,\r\n\t\t\ttableStyle;\r\n\r\n\t\t\tthis.tableHeight = table.element.clientHeight;\r\n\t\t\tthis.tableWidth = table.element.clientWidth;\r\n\r\n\t\t\tif(table.element.parentNode){\r\n\t\t\t\tthis.containerHeight = table.element.parentNode.clientHeight;\r\n\t\t\t\tthis.containerWidth = table.element.parentNode.clientWidth;\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof ResizeObserver !== \"undefined\" && table.rowManager.getRenderMode() === \"virtual\"){\r\n\r\n\t\t\t\tthis.autoResize = true;\r\n\r\n\t\t\t\tthis.observer = new ResizeObserver((entry) => {\r\n\t\t\t\t\tif(!table.browserMobile || (table.browserMobile &&!table.modules.edit.currentCell)){\r\n\r\n\t\t\t\t\t\tvar nodeHeight = Math.floor(entry[0].contentRect.height);\r\n\t\t\t\t\t\tvar nodeWidth = Math.floor(entry[0].contentRect.width);\r\n\r\n\t\t\t\t\t\tif(this.tableHeight != nodeHeight || this.tableWidth != nodeWidth){\r\n\t\t\t\t\t\t\tthis.tableHeight = nodeHeight;\r\n\t\t\t\t\t\t\tthis.tableWidth = nodeWidth;\r\n\r\n\t\t\t\t\t\t\tif(table.element.parentNode){\r\n\t\t\t\t\t\t\t\tthis.containerHeight = table.element.parentNode.clientHeight;\r\n\t\t\t\t\t\t\t\tthis.containerWidth = table.element.parentNode.clientWidth;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tthis.table.columnManager.renderer.rerenderColumns(true);\r\n\r\n\t\t\t\t\t\t\ttable.redraw();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.observer.observe(table.element);\r\n\r\n\t\t\t\ttableStyle = window.getComputedStyle(table.element);\r\n\r\n\t\t\t\tif(this.table.element.parentNode && !this.table.rowManager.fixedHeight && (tableStyle.getPropertyValue(\"max-height\") || tableStyle.getPropertyValue(\"min-height\"))){\r\n\r\n\t\t\t\t\tthis.containerObserver = new ResizeObserver((entry) => {\r\n\t\t\t\t\t\tif(!table.browserMobile || (table.browserMobile &&!table.modules.edit.currentCell)){\r\n\r\n\t\t\t\t\t\t\tvar nodeHeight = Math.floor(entry[0].contentRect.height);\r\n\t\t\t\t\t\t\tvar nodeWidth = Math.floor(entry[0].contentRect.width);\r\n\r\n\t\t\t\t\t\t\tif(this.containerHeight != nodeHeight || this.containerWidth != nodeWidth){\r\n\t\t\t\t\t\t\t\tthis.containerHeight = nodeHeight;\r\n\t\t\t\t\t\t\t\tthis.containerWidth = nodeWidth;\r\n\t\t\t\t\t\t\t\tthis.tableHeight = table.element.clientHeight;\r\n\t\t\t\t\t\t\t\tthis.tableWidth = table.element.clientWidth;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\ttable.columnManager.renderer.rerenderColumns(true);\r\n\r\n\t\t\t\t\t\t\ttable.redraw();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tthis.containerObserver.observe(this.table.element.parentNode);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.subscribe(\"table-resize\", this.tableResized.bind(this));\r\n\r\n\t\t\t}else{\r\n\t\t\t\tthis.binding = function(){\r\n\t\t\t\t\tif(!table.browserMobile || (table.browserMobile && !table.modules.edit.currentCell)){\r\n\r\n\t\t\t\t\t\ttable.columnManager.renderer.rerenderColumns(true);\r\n\r\n\t\t\t\t\t\ttable.redraw();\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\r\n\t\t\t\twindow.addEventListener(\"resize\", this.binding);\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"table-destroy\", this.clearBindings.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\ttableResized(){\r\n\t\tthis.table.rowManager.redraw();\r\n\t}\r\n\r\n\tclearBindings(){\r\n\t\tif(this.binding){\r\n\t\t\twindow.removeEventListener(\"resize\", this.binding);\r\n\t\t}\r\n\r\n\t\tif(this.observer){\r\n\t\t\tthis.observer.unobserve(this.table.element);\r\n\t\t}\r\n\r\n\t\tif(this.containerObserver){\r\n\t\t\tthis.containerObserver.unobserve(this.table.element.parentNode);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nResizeTable.moduleName = \"resizeTable\";\r\n\r\nexport default ResizeTable;","import Module from '../../core/Module.js';\r\n\r\nclass ResponsiveLayout extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.columns = [];\r\n\t\tthis.hiddenColumns = [];\r\n\t\tthis.mode = \"\";\r\n\t\tthis.index = 0;\r\n\t\tthis.collapseFormatter = [];\r\n\t\tthis.collapseStartOpen = true;\r\n\t\tthis.collapseHandleColumn = false;\r\n\r\n\t\tthis.registerTableOption(\"responsiveLayout\", false); //responsive layout flags\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseStartOpen\", true); //start showing collapsed data\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseUseFormatters\", true); //responsive layout collapse formatter\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseFormatter\", false); //responsive layout collapse formatter\r\n\r\n\t\tthis.registerColumnOption(\"responsive\");\r\n\t}\r\n\r\n\t//generate responsive columns list\r\n\tinitialize(){\r\n\t\tvar self = this,\r\n\t\tcolumns = [];\r\n\r\n\t\tif(this.table.options.responsiveLayout){\r\n\t\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"column-show\", this.updateColumnVisibility.bind(this));\r\n\t\t\tthis.subscribe(\"column-hide\", this.updateColumnVisibility.bind(this));\r\n\t\t\tthis.subscribe(\"columns-loaded\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-moved\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-add\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-delete\", this.initializeResponsivity.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"table-redrawing\", this.tableRedraw.bind(this));\r\n\r\n\t\t\tif(this.table.options.responsiveLayout === \"collapse\"){\r\n\t\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\t\tthis.subscribe(\"row-layout\", this.layoutRow.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tif([\"fitColumns\", \"fitDataStretch\"].indexOf(this.layoutMode()) === -1){\r\n\t\t\tif(!force){\r\n\t\t\t\tthis.update();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeResponsivity(){\r\n\t\tvar columns = [];\r\n\r\n\t\tthis.mode = this.table.options.responsiveLayout;\r\n\t\tthis.collapseFormatter = this.table.options.responsiveLayoutCollapseFormatter || this.formatCollapsedData;\r\n\t\tthis.collapseStartOpen = this.table.options.responsiveLayoutCollapseStartOpen;\r\n\t\tthis.hiddenColumns = [];\r\n\r\n\t\t//determine level of responsivity for each column\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column, i) => {\r\n\t\t\tif(column.modules.responsive){\r\n\t\t\t\tif(column.modules.responsive.order && column.modules.responsive.visible){\r\n\t\t\t\t\tcolumn.modules.responsive.index = i;\r\n\t\t\t\t\tcolumns.push(column);\r\n\r\n\t\t\t\t\tif(!column.visible && this.mode === \"collapse\"){\r\n\t\t\t\t\t\tthis.hiddenColumns.push(column);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t//sort list by responsivity\r\n\t\tcolumns = columns.reverse();\r\n\t\tcolumns = columns.sort((a, b) => {\r\n\t\t\tvar diff = b.modules.responsive.order - a.modules.responsive.order;\r\n\t\t\treturn diff || (b.modules.responsive.index - a.modules.responsive.index);\r\n\t\t});\r\n\r\n\t\tthis.columns = columns;\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tthis.generateCollapsedContent();\r\n\t\t}\r\n\r\n\t\t//assign collapse column\r\n\t\tfor (let col of this.table.columnManager.columnsByIndex){\r\n\t\t\tif(col.definition.formatter == \"responsiveCollapse\"){\r\n\t\t\t\tthis.collapseHandleColumn = col;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this.collapseHandleColumn){\r\n\t\t\tif(this.hiddenColumns.length){\r\n\t\t\t\tthis.collapseHandleColumn.show();\r\n\t\t\t}else{\r\n\t\t\t\tthis.collapseHandleColumn.hide();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//define layout information\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.getDefinition();\r\n\r\n\t\tcolumn.modules.responsive = {order: typeof def.responsive === \"undefined\" ? 1 : def.responsive, visible:def.visible === false ? false : true};\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar el;\r\n\r\n\t\tif(row.type !== \"calc\"){\r\n\t\t\tel = document.createElement(\"div\");\r\n\t\t\tel.classList.add(\"tabulator-responsive-collapse\");\r\n\r\n\t\t\trow.modules.responsiveLayout = {\r\n\t\t\t\telement:el,\r\n\t\t\t\topen:this.collapseStartOpen,\r\n\t\t\t};\r\n\r\n\t\t\tif(!this.collapseStartOpen){\r\n\t\t\t\tel.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tlayoutRow(row){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tif(row.modules.responsiveLayout){\r\n\t\t\trowEl.appendChild(row.modules.responsiveLayout.element);\r\n\t\t\tthis.generateCollapsedRowContent(row);\r\n\t\t}\r\n\t}\r\n\r\n\t//update column visibility\r\n\tupdateColumnVisibility(column, responsiveToggle){\r\n\t\tif(!responsiveToggle && column.modules.responsive){\r\n\t\t\tcolumn.modules.responsive.visible = column.visible;\r\n\t\t\tthis.initializeResponsivity();\r\n\t\t}\r\n\t}\r\n\r\n\thideColumn(column){\r\n\t\tvar colCount = this.hiddenColumns.length;\r\n\r\n\t\tcolumn.hide(false, true);\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tthis.hiddenColumns.unshift(column);\r\n\t\t\tthis.generateCollapsedContent();\r\n\r\n\t\t\tif(this.collapseHandleColumn && !colCount){\r\n\t\t\t\tthis.collapseHandleColumn.show();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tshowColumn(column){\r\n\t\tvar index;\r\n\r\n\t\tcolumn.show(false, true);\r\n\t\t//set column width to prevent calculation loops on uninitialized columns\r\n\t\tcolumn.setWidth(column.getWidth());\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tindex = this.hiddenColumns.indexOf(column);\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.hiddenColumns.splice(index, 1);\r\n\t\t\t}\r\n\r\n\t\t\tthis.generateCollapsedContent();\r\n\r\n\t\t\tif(this.collapseHandleColumn && !this.hiddenColumns.length){\r\n\t\t\t\tthis.collapseHandleColumn.hide();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//redraw columns to fit space\r\n\tupdate(){\r\n\t\tvar self = this,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\r\n\t\t\tlet width = self.table.modules.layout.getMode() == \"fitColumns\" ? self.table.columnManager.getFlexBaseWidth() : self.table.columnManager.getWidth();\r\n\r\n\t\t\tlet diff = (self.table.options.headerVisible ? self.table.columnManager.element.clientWidth : self.table.element.clientWidth) - width;\r\n\r\n\t\t\tif(diff < 0){\r\n\t\t\t\t//table is too wide\r\n\t\t\t\tlet column = self.columns[self.index];\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tself.hideColumn(column);\r\n\t\t\t\t\tself.index ++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\r\n\t\t\t\t//table has spare space\r\n\t\t\t\tlet column = self.columns[self.index -1];\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tif(diff > 0){\r\n\t\t\t\t\t\tif(diff >= column.getWidth()){\r\n\t\t\t\t\t\t\tself.showColumn(column);\r\n\t\t\t\t\t\t\tself.index --;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tworking = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tworking = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(!self.table.rowManager.activeRowsCount){\r\n\t\t\t\tself.table.rowManager.renderEmptyScroll();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateCollapsedContent(){\r\n\t\tvar self = this,\r\n\t\trows = this.table.rowManager.getDisplayRows();\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\tself.generateCollapsedRowContent(row);\r\n\t\t});\r\n\t}\r\n\r\n\tgenerateCollapsedRowContent(row){\r\n\t\tvar el, contents;\r\n\r\n\t\tif(row.modules.responsiveLayout){\r\n\t\t\tel = row.modules.responsiveLayout.element;\r\n\r\n\t\t\twhile(el.firstChild) el.removeChild(el.firstChild);\r\n\r\n\t\t\tcontents = this.collapseFormatter(this.generateCollapsedRowData(row));\r\n\t\t\tif(contents){\r\n\t\t\t\tel.appendChild(contents);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateCollapsedRowData(row){\r\n\t\tvar self = this,\r\n\t\tdata = row.getData(),\r\n\t\toutput = [],\r\n\t\tmockCellComponent;\r\n\r\n\t\tthis.hiddenColumns.forEach(function(column){\r\n\t\t\tvar value = column.getFieldValue(data);\r\n\r\n\t\t\tif(column.definition.title && column.field){\r\n\t\t\t\tif(column.modules.format && self.table.options.responsiveLayoutCollapseUseFormatters){\r\n\r\n\t\t\t\t\tmockCellComponent = {\r\n\t\t\t\t\t\tvalue:false,\r\n\t\t\t\t\t\tdata:{},\r\n\t\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetData:function(){\r\n\t\t\t\t\t\t\treturn data;\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\t\treturn document.createElement(\"div\");\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\t\treturn row.getComponent();\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tfunction onRendered(callback){\r\n\t\t\t\t\t\tcallback();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\toutput.push({\r\n\t\t\t\t\t\tfield: column.field,\r\n\t\t\t\t\t\ttitle: column.definition.title,\r\n\t\t\t\t\t\tvalue: column.modules.format.formatter.call(self.table.modules.format, mockCellComponent, column.modules.format.params, onRendered)\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\toutput.push({\r\n\t\t\t\t\t\tfield: column.field,\r\n\t\t\t\t\t\ttitle: column.definition.title,\r\n\t\t\t\t\t\tvalue: value\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tformatCollapsedData(data){\r\n\t\tvar list = document.createElement(\"table\");\r\n\r\n\t\tdata.forEach(function(item){\r\n\t\t\tvar row = document.createElement(\"tr\");\r\n\t\t\tvar titleData = document.createElement(\"td\");\r\n\t\t\tvar valueData = document.createElement(\"td\");\r\n\t\t\tvar node_content;\r\n\r\n\t\t\tvar titleHighlight = document.createElement(\"strong\");\r\n\t\t\ttitleData.appendChild(titleHighlight);\r\n\t\t\tthis.langBind(\"columns|\" + item.field, function(text){\r\n\t\t\t\ttitleHighlight.innerHTML = text || item.title;\r\n\t\t\t});\r\n\r\n\t\t\tif(item.value instanceof Node){\r\n\t\t\t\tnode_content = document.createElement(\"div\");\r\n\t\t\t\tnode_content.appendChild(item.value);\r\n\t\t\t\tvalueData.appendChild(node_content);\r\n\t\t\t}else{\r\n\t\t\t\tvalueData.innerHTML = item.value;\r\n\t\t\t}\r\n\r\n\t\t\trow.appendChild(titleData);\r\n\t\t\trow.appendChild(valueData);\r\n\t\t\tlist.appendChild(row);\r\n\t\t}, this);\r\n\r\n\t\treturn Object.keys(data).length ? list : \"\";\r\n\t}\r\n}\r\n\r\nResponsiveLayout.moduleName = \"responsiveLayout\";\r\n\r\nexport default ResponsiveLayout;","import Module from '../../core/Module.js';\r\n\r\nclass SelectRow extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.selecting = false; //flag selecting in progress\r\n\t\tthis.lastClickedRow = false; //last clicked row\r\n\t\tthis.selectPrev = []; //hold previously selected element for drag drop selection\r\n\t\tthis.selectedRows = []; //hold selected rows\r\n\t\tthis.headerCheckboxElement = null; // hold header select element\r\n\t\t\r\n\t\tthis.registerTableOption(\"selectable\", \"highlight\"); //highlight rows on hover\r\n\t\tthis.registerTableOption(\"selectableRangeMode\", \"drag\"); //highlight rows on hover\r\n\t\tthis.registerTableOption(\"selectableRollingSelection\", true); //roll selection once maximum number of selectable rows is reached\r\n\t\tthis.registerTableOption(\"selectablePersistence\", true); // maintain selection when table view is updated\r\n\t\tthis.registerTableOption(\"selectableCheck\", function(data, row){return true;}); //check wheather row is selectable\r\n\t\t\r\n\t\tthis.registerTableFunction(\"selectRow\", this.selectRows.bind(this));\r\n\t\tthis.registerTableFunction(\"deselectRow\", this.deselectRows.bind(this));\r\n\t\tthis.registerTableFunction(\"toggleSelectRow\", this.toggleRow.bind(this));\r\n\t\tthis.registerTableFunction(\"getSelectedRows\", this.getSelectedRows.bind(this));\r\n\t\tthis.registerTableFunction(\"getSelectedData\", this.getSelectedData.bind(this));\r\n\t\t\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"select\", this.selectRows.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"deselect\", this.deselectRows.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"toggleSelect\", this.toggleRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isSelected\", this.isRowSelected.bind(this));\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.selectable !== false){\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleting\", this.rowDeleted.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.clearSelectionData.bind(this));\r\n\t\t\tthis.subscribe(\"rows-retrieve\", this.rowRetrieve.bind(this));\r\n\t\t\t\r\n\t\t\tif(this.table.options.selectable && !this.table.options.selectablePersistence){\r\n\t\t\t\tthis.subscribe(\"data-refreshing\", this.deselectRows.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trowRetrieve(type, prevValue){\r\n\t\treturn type === \"selected\" ? this.selectedRows : prevValue;\r\n\t}\r\n\t\r\n\trowDeleted(row){\r\n\t\tthis._deselectRow(row, true);\r\n\t}\r\n\t\r\n\tclearSelectionData(silent){\r\n\t\tthis.selecting = false;\r\n\t\tthis.lastClickedRow = false;\r\n\t\tthis.selectPrev = [];\r\n\t\tthis.selectedRows = [];\r\n\t\t\r\n\t\tif(silent !== true){\r\n\t\t\tthis._rowSelectionChanged();\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\telement = row.getElement();\r\n\t\t\r\n\t\t// trigger end of row selection\r\n\t\tvar endSelect = function(){\r\n\t\t\t\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tself.selecting = false;\r\n\t\t\t}, 50);\r\n\t\t\t\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", endSelect);\r\n\t\t};\r\n\t\t\r\n\t\trow.modules.select = {selected:false};\r\n\t\t\r\n\t\t//set row selection class\r\n\t\tif(self.table.options.selectableCheck.call(this.table, row.getComponent())){\r\n\t\t\telement.classList.add(\"tabulator-selectable\");\r\n\t\t\telement.classList.remove(\"tabulator-unselectable\");\r\n\t\t\t\r\n\t\t\tif(self.table.options.selectable && self.table.options.selectable != \"highlight\"){\r\n\t\t\t\tif(self.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\telement.addEventListener(\"click\", this.handleComplexRowClick.bind(this, row));\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.addEventListener(\"click\", function(e){\r\n\t\t\t\t\t\tif(!self.table.modExists(\"edit\") || !self.table.modules.edit.getCurrentCell()){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!self.selecting){\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\t\t\tif(e.shiftKey){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.selecting = true;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.selectPrev = [];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tdocument.body.addEventListener(\"mouseup\", endSelect);\r\n\t\t\t\t\t\t\tdocument.body.addEventListener(\"keyup\", endSelect);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mouseenter\", function(e){\r\n\t\t\t\t\t\tif(self.selecting){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(self.selectPrev[1] == row){\r\n\t\t\t\t\t\t\t\tself.toggleRow(self.selectPrev[0]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mouseout\", function(e){\r\n\t\t\t\t\t\tif(self.selecting){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\tself.selectPrev.unshift(row);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\telement.classList.add(\"tabulator-unselectable\");\r\n\t\t\telement.classList.remove(\"tabulator-selectable\");\r\n\t\t}\r\n\t}\r\n\t\r\n\thandleComplexRowClick(row, e){\r\n\t\tif(e.shiftKey){\r\n\t\t\tthis.table._clearSelection();\r\n\t\t\tthis.lastClickedRow = this.lastClickedRow || row;\r\n\t\t\t\r\n\t\t\tvar lastClickedRowIdx = this.table.rowManager.getDisplayRowIndex(this.lastClickedRow);\r\n\t\t\tvar rowIdx = this.table.rowManager.getDisplayRowIndex(row);\r\n\t\t\t\r\n\t\t\tvar fromRowIdx = lastClickedRowIdx <= rowIdx ? lastClickedRowIdx : rowIdx;\r\n\t\t\tvar toRowIdx = lastClickedRowIdx >= rowIdx ? lastClickedRowIdx : rowIdx;\r\n\t\t\t\r\n\t\t\tvar rows = this.table.rowManager.getDisplayRows().slice(0);\r\n\t\t\tvar toggledRows = rows.splice(fromRowIdx, toRowIdx - fromRowIdx + 1);\r\n\t\t\t\r\n\t\t\tif(e.ctrlKey || e.metaKey){\r\n\t\t\t\ttoggledRows.forEach((toggledRow)=>{\r\n\t\t\t\t\tif(toggledRow !== this.lastClickedRow){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.table.options.selectable !== true && !this.isRowSelected(row)){\r\n\t\t\t\t\t\t\tif(this.selectedRows.length < this.table.options.selectable){\r\n\t\t\t\t\t\t\t\tthis.toggleRow(toggledRow);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.toggleRow(toggledRow);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tthis.lastClickedRow = row;\r\n\t\t\t}else{\r\n\t\t\t\tthis.deselectRows(undefined, true);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.selectable !== true){\r\n\t\t\t\t\tif(toggledRows.length > this.table.options.selectable){\r\n\t\t\t\t\t\ttoggledRows = toggledRows.slice(0, this.table.options.selectable)\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.selectRows(toggledRows);\r\n\t\t\t}\r\n\t\t\tthis.table._clearSelection();\r\n\t\t}\r\n\t\telse if(e.ctrlKey || e.metaKey){\r\n\t\t\tthis.toggleRow(row);\r\n\t\t\tthis.lastClickedRow = row;\r\n\t\t}else{\r\n\t\t\tthis.deselectRows(undefined, true);\r\n\t\t\tthis.selectRows(row);\r\n\t\t\tthis.lastClickedRow = row;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//toggle row selection\r\n\ttoggleRow(row){\r\n\t\tif(this.table.options.selectableCheck.call(this.table, row.getComponent())){\r\n\t\t\tif(row.modules.select && row.modules.select.selected){\r\n\t\t\t\tthis._deselectRow(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis._selectRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//select a number of rows\r\n\tselectRows(rows){\r\n\t\tvar rowMatch;\r\n\t\t\r\n\t\tswitch(typeof rows){\r\n\t\t\tcase \"undefined\":\r\n\t\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis._rowSelectionChanged();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"string\":\r\n\t\t\t\r\n\t\t\trowMatch = this.table.rowManager.findRow(rows);\r\n\t\t\t\r\n\t\t\tif(rowMatch){\r\n\t\t\t\tthis._selectRow(rowMatch, true, true);\r\n\t\t\t}else{\r\n\t\t\t\tthis.table.rowManager.getRows(rows).forEach((row) => {\r\n\t\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._rowSelectionChanged();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\tif(Array.isArray(rows)){\r\n\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis._rowSelectionChanged();\r\n\t\t\t}else{\r\n\t\t\t\tthis._selectRow(rows, false, true);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//select an individual row\r\n\t_selectRow(rowInfo, silent, force){\r\n\t\tvar index;\r\n\t\t\r\n\t\t//handle max row count\r\n\t\tif(!isNaN(this.table.options.selectable) && this.table.options.selectable !== true && !force){\r\n\t\t\tif(this.selectedRows.length >= this.table.options.selectable){\r\n\t\t\t\tif(this.table.options.selectableRollingSelection){\r\n\t\t\t\t\tthis._deselectRow(this.selectedRows[0]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tvar row = this.table.rowManager.findRow(rowInfo);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\tif(this.selectedRows.indexOf(row) == -1){\r\n\t\t\t\trow.getElement().classList.add(\"tabulator-selected\");\r\n\t\t\t\tif(!row.modules.select){\r\n\t\t\t\t\trow.modules.select = {};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\trow.modules.select.selected = true;\r\n\t\t\t\tif(row.modules.select.checkboxEl){\r\n\t\t\t\t\trow.modules.select.checkboxEl.checked = true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.selectedRows.push(row);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.dataTreeSelectPropagate){\r\n\t\t\t\t\tthis.childRowSelection(row, true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatchExternal(\"rowSelected\", row.getComponent());\r\n\t\t\t\t\r\n\t\t\t\tthis._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Selection Error - No such row found, ignoring selection:\" + rowInfo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tisRowSelected(row){\r\n\t\treturn this.selectedRows.indexOf(row) !== -1;\r\n\t}\r\n\t\r\n\t//deselect a number of rows\r\n\tdeselectRows(rows, silent){\r\n\t\tvar self = this,\r\n\t\trowCount;\r\n\t\t\r\n\t\tif(typeof rows == \"undefined\"){\r\n\t\t\t\r\n\t\t\trowCount = self.selectedRows.length;\r\n\t\t\t\r\n\t\t\tfor(let i = 0; i < rowCount; i++){\r\n\t\t\t\tself._deselectRow(self.selectedRows[0], true);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(rowCount){\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tif(Array.isArray(rows)){\r\n\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\tself._deselectRow(row, true);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}else{\r\n\t\t\t\tself._deselectRow(rows, silent);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//deselect an individual row\r\n\t_deselectRow(rowInfo, silent){\r\n\t\tvar self = this,\r\n\t\trow = self.table.rowManager.findRow(rowInfo),\r\n\t\tindex;\r\n\t\t\r\n\t\tif(row){\r\n\t\t\tindex = self.selectedRows.findIndex(function(selectedRow){\r\n\t\t\t\treturn selectedRow == row;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\t\r\n\t\t\t\trow.getElement().classList.remove(\"tabulator-selected\");\r\n\t\t\t\tif(!row.modules.select){\r\n\t\t\t\t\trow.modules.select = {};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\trow.modules.select.selected = false;\r\n\t\t\t\tif(row.modules.select.checkboxEl){\r\n\t\t\t\t\trow.modules.select.checkboxEl.checked = false;\r\n\t\t\t\t}\r\n\t\t\t\tself.selectedRows.splice(index, 1);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.dataTreeSelectPropagate){\r\n\t\t\t\t\tthis.childRowSelection(row, false);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatchExternal(\"rowDeselected\", row.getComponent());\r\n\t\t\t\t\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Deselection Error - No such row found, ignoring selection:\" + rowInfo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetSelectedData(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tthis.selectedRows.forEach(function(row){\r\n\t\t\tdata.push(row.getData());\r\n\t\t});\r\n\t\t\r\n\t\treturn data;\r\n\t}\r\n\t\r\n\tgetSelectedRows(){\r\n\t\t\r\n\t\tvar rows = [];\r\n\t\t\r\n\t\tthis.selectedRows.forEach(function(row){\r\n\t\t\trows.push(row.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t_rowSelectionChanged(silent){\r\n\t\tif(this.headerCheckboxElement){\r\n\t\t\tif(this.selectedRows.length === 0){\r\n\t\t\t\tthis.headerCheckboxElement.checked = false;\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = false;\r\n\t\t\t} else if(this.table.rowManager.rows.length === this.selectedRows.length){\r\n\t\t\t\tthis.headerCheckboxElement.checked = true;\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = false;\r\n\t\t\t} else {\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = true;\r\n\t\t\t\tthis.headerCheckboxElement.checked = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(!silent){\r\n\t\t\tthis.dispatchExternal(\"rowSelectionChanged\", this.getSelectedData(), this.getSelectedRows());\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterRowSelectCheckbox (row, element) {\r\n\t\tif(!row._row.modules.select){\r\n\t\t\trow._row.modules.select = {};\r\n\t\t}\r\n\t\t\r\n\t\trow._row.modules.select.checkboxEl = element;\r\n\t}\r\n\t\r\n\tregisterHeaderSelectCheckbox (element) {\r\n\t\tthis.headerCheckboxElement = element;\r\n\t}\r\n\t\r\n\tchildRowSelection(row, select){\r\n\t\tvar children = this.table.modules.dataTree.getChildren(row, true);\r\n\t\t\r\n\t\tif(select){\r\n\t\t\tfor(let child of children){\r\n\t\t\t\tthis._selectRow(child, true);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tfor(let child of children){\r\n\t\t\t\tthis._deselectRow(child, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nSelectRow.moduleName = \"selectRow\";\r\n\r\nexport default SelectRow;","//sort datetime\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar format = params.format || \"dd/MM/yyyy HH:mm:ss\",\r\n\talignEmptyValues = params.alignEmptyValues,\r\n\temptyAlign = 0;\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tif(DT.isDateTime(a)){\r\n\t\t\t a = a;\r\n\t\t}else if(format === \"iso\"){\r\n\t\t\t a = DT.fromISO(String(a));\r\n\t\t}else{\r\n\t\t\t a = DT.fromFormat(String(a), format);\r\n\t\t}\r\n\r\n\t\tif(DT.isDateTime(b)){\r\n\t\t\t b = b;\r\n\t\t}else if(format === \"iso\"){\r\n\t\t\t b = DT.fromISO(String(b));\r\n\t\t}else{\r\n\t\t\t b = DT.fromFormat(String(b), format);\r\n\t\t}\r\n\r\n\t\tif(!a.isValid){\r\n\t\t\temptyAlign = !b.isValid ? 0 : -1;\r\n\t\t}else if(!b.isValid){\r\n\t\t\temptyAlign = 1;\r\n\t\t}else{\r\n\t\t\t//compare valid values\r\n\t\t\treturn a - b;\r\n\t\t}\r\n\r\n\t\t//fix empty values in position\r\n\t\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\t\temptyAlign *= -1;\r\n\t\t}\r\n\r\n\t\treturn emptyAlign;\r\n\r\n\t}else{\r\n\t\tconsole.error(\"Sort Error - 'datetime' sorter is dependant on luxon.js\");\r\n\t}\r\n};","import datetime from './datetime.js';\r\n\r\n//sort date\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tif(!params.format){\r\n\t\tparams.format = \"dd/MM/yyyy\";\r\n\t}\r\n\r\n\treturn datetime.call(this, a, b, aRow, bRow, column, dir, params);\r\n};","//sort numbers\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar decimal = params.decimalSeparator;\r\n\tvar thousand = params.thousandSeparator;\r\n\tvar emptyAlign = 0;\r\n\r\n\ta = String(a);\r\n\tb = String(b);\r\n\r\n\tif(thousand){\r\n\t\ta = a.split(thousand).join(\"\");\r\n\t\tb = b.split(thousand).join(\"\");\r\n\t}\r\n\r\n\tif(decimal){\r\n\t\ta = a.split(decimal).join(\".\");\r\n\t\tb = b.split(decimal).join(\".\");\r\n\t}\r\n\r\n\ta = parseFloat(a);\r\n\tb = parseFloat(b);\r\n\r\n\t//handle non numeric values\r\n\tif(isNaN(a)){\r\n\t\temptyAlign = isNaN(b) ? 0 : -1;\r\n\t}else if(isNaN(b)){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\t\t//compare valid values\r\n\t\treturn a - b;\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n};","import number from './sorters/number.js';\r\nimport string from './sorters/string.js';\r\nimport date from './sorters/date.js';\r\nimport time from './sorters/time.js';\r\nimport datetime from './sorters/datetime.js';\r\nimport boolean from './sorters/boolean.js';\r\nimport array from './sorters/array.js';\r\nimport exists from './sorters/exists.js';\r\nimport alphanum from './sorters/alphanum.js';\r\n\r\nexport default {\r\n\tnumber:number,\r\n\tstring:string,\r\n\tdate:date,\r\n\ttime:time,\r\n\tdatetime:datetime,\r\n\tboolean:boolean,\r\n\tarray:array,\r\n\texists:exists,\r\n\talphanum:alphanum\r\n};","//sort strings\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar emptyAlign = 0;\r\n\tvar locale;\r\n\r\n\t//handle empty values\r\n\tif(!a){\r\n\t\temptyAlign = !b ? 0 : -1;\r\n\t}else if(!b){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\t\t//compare valid values\r\n\t\tswitch(typeof params.locale){\r\n\t\t\tcase \"boolean\":\r\n\t\t\tif(params.locale){\r\n\t\t\t\tlocale = this.langLocale();\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\tcase \"string\":\r\n\t\t\tlocale = params.locale;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn String(a).toLowerCase().localeCompare(String(b).toLowerCase(), locale);\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n};","import datetime from './datetime.js';\r\n\r\n//sort times\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tif(!params.format){\r\n\t\tparams.format = \"HH:mm\";\r\n\t}\r\n\r\n\treturn datetime.call(this, a, b, aRow, bRow, column, dir, params);\r\n};","//sort booleans\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar el1 = a === true || a === \"true\" || a === \"True\" || a === 1 ? 1 : 0;\r\n\tvar el2 = b === true || b === \"true\" || b === \"True\" || b === 1 ? 1 : 0;\r\n\r\n\treturn el1 - el2;\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultSorters from './defaults/sorters.js';\r\n\r\nclass Sort extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t \tthis.sortList = []; //holder current sort\r\n\t \tthis.changed = false; //has the sort changed since last render\r\n\r\n\t \tthis.registerTableOption(\"sortMode\", \"local\"); //local or remote sorting\r\n\r\n\t \tthis.registerTableOption(\"initialSort\", false); //initial sorting criteria\r\n\t \tthis.registerTableOption(\"columnHeaderSortMulti\", true); //multiple or single column sorting\r\n\t \tthis.registerTableOption(\"sortOrderReverse\", false); //reverse internal sort ordering\r\n\t \tthis.registerTableOption(\"headerSortElement\", \"
\"); //header sort element\r\n\r\n\t \tthis.registerColumnOption(\"sorter\");\r\n\t \tthis.registerColumnOption(\"sorterParams\");\r\n\r\n\t \tthis.registerColumnOption(\"headerSort\", true);\r\n\t \tthis.registerColumnOption(\"headerSortStartingDir\");\r\n\t \tthis.registerColumnOption(\"headerSortTristate\");\r\n\r\n\t }\r\n\r\n\t initialize(){\r\n\t \tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t \tthis.subscribe(\"table-built\", this.tableBuilt.bind(this));\r\n\t \tthis.registerDataHandler(this.sort.bind(this), 20);\r\n\r\n\t \tthis.registerTableFunction(\"setSort\", this.userSetSort.bind(this));\r\n\t \tthis.registerTableFunction(\"getSorters\", this.getSort.bind(this));\r\n\t \tthis.registerTableFunction(\"clearSort\", this.clearSort.bind(this));\r\n\r\n\t \tif(this.table.options.sortMode === \"remote\"){\r\n\t \t\tthis.subscribe(\"data-params\", this.remoteSortParams.bind(this));\r\n\t \t}\r\n\t }\r\n\r\n\t tableBuilt(){\r\n\t \tif(this.table.options.initialSort){\r\n\t \t\tthis.setSort(this.table.options.initialSort);\r\n\t \t}\r\n\t }\r\n\r\n\t remoteSortParams(data, config, silent, params){\r\n\t \tvar sorters = this.getSort();\r\n\r\n\t \tsorters.forEach((item) => {\r\n\t \t\tdelete item.column;\r\n\t \t});\r\n\r\n\t \tparams.sort = sorters;\r\n\r\n\t \treturn params;\r\n\t }\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tuserSetSort(sortList, dir){\r\n\t\tthis.setSort(sortList, dir);\r\n\t\t// this.table.rowManager.sorterRefresh();\r\n\t\tthis.refreshSort();\r\n\t}\r\n\r\n\tclearSort(){\r\n\t\tthis.clear();\r\n\t\t// this.table.rowManager.sorterRefresh();\r\n\t\tthis.refreshSort();\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\t//initialize column header for sorting\r\n\tinitializeColumn(column){\r\n\t\tvar sorter = false,\r\n\t\tcolEl,\r\n\t\tarrowEl;\r\n\r\n\t\tswitch(typeof column.definition.sorter){\r\n\t\t\tcase \"string\":\r\n\t\t\tif(Sort.sorters[column.definition.sorter]){\r\n\t\t\t\tsorter = Sort.sorters[column.definition.sorter];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Sort Error - No such sorter found: \", column.definition.sorter);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\tsorter = column.definition.sorter;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcolumn.modules.sort = {\r\n\t\t\tsorter:sorter, dir:\"none\",\r\n\t\t\tparams:column.definition.sorterParams || {},\r\n\t\t\tstartingDir:column.definition.headerSortStartingDir || \"asc\",\r\n\t\t\ttristate: column.definition.headerSortTristate,\r\n\t\t};\r\n\r\n\t\tif(column.definition.headerSort !== false){\r\n\r\n\t\t\tcolEl = column.getElement();\r\n\r\n\t\t\tcolEl.classList.add(\"tabulator-sortable\");\r\n\r\n\r\n\t\t\tarrowEl = document.createElement(\"div\");\r\n\t\t\tarrowEl.classList.add(\"tabulator-col-sorter\");\r\n\r\n\t\t\tif(typeof this.table.options.headerSortElement == \"object\"){\r\n\t\t\t\tarrowEl.appendChild(this.table.options.headerSortElement);\r\n\t\t\t}else{\r\n\t\t\t\tarrowEl.innerHTML = this.table.options.headerSortElement;\r\n\t\t\t}\r\n\r\n\t\t\t//create sorter arrow\r\n\t\t\tcolumn.titleHolderElement.appendChild(arrowEl);\r\n\r\n\t\t\tcolumn.modules.sort.element = arrowEl;\r\n\r\n\t\t\t//sort on click\r\n\t\t\tcolEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\tvar dir = \"\",\r\n\t\t\t\tsorters=[],\r\n\t\t\t\tmatch = false;\r\n\r\n\t\t\t\tif(column.modules.sort){\r\n\t\t\t\t\tif(column.modules.sort.tristate){\r\n\t\t\t\t\t\tif(column.modules.sort.dir == \"none\"){\r\n\t\t\t\t\t\t\tdir = column.modules.sort.startingDir;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(column.modules.sort.dir == column.modules.sort.startingDir){\r\n\t\t\t\t\t\t\t\tdir = column.modules.sort.dir == \"asc\" ? \"desc\" : \"asc\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tdir = \"none\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tswitch(column.modules.sort.dir){\r\n\t\t\t\t\t\t\tcase \"asc\":\r\n\t\t\t\t\t\t\tdir = \"desc\";\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase \"desc\":\r\n\t\t\t\t\t\t\tdir = \"asc\";\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tdir = column.modules.sort.startingDir;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\tif (this.table.options.columnHeaderSortMulti && (e.shiftKey || e.ctrlKey)) {\r\n\t\t\t\t\t\tsorters = this.getSort();\r\n\r\n\t\t\t\t\t\tmatch = sorters.findIndex((sorter) => {\r\n\t\t\t\t\t\t\treturn sorter.field === column.getField();\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\tif(match > -1){\r\n\t\t\t\t\t\t\tsorters[match].dir = dir;\r\n\r\n\t\t\t\t\t\t\tif(match != sorters.length -1){\r\n\t\t\t\t\t\t\t\tmatch = sorters.splice(match, 1)[0];\r\n\t\t\t\t\t\t\t\tif(dir != \"none\"){\r\n\t\t\t\t\t\t\t\t\tsorters.push(match);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(dir != \"none\"){\r\n\t\t\t\t\t\t\t\tsorters.push({column:column, dir:dir});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t//add to existing sort\r\n\t\t\t\t\t\tthis.setSort(sorters);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(dir == \"none\"){\r\n\t\t\t\t\t\t\tthis.clear();\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t//sort by column only\r\n\t\t\t\t\t\t\tthis.setSort(column, dir);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// this.table.rowManager.sorterRefresh(!this.sortList.length);\r\n\t\t\t\t\tthis.refreshSort();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\trefreshSort(){\r\n\t\tif(this.table.options.sortMode === \"remote\"){\r\n\t\t\tthis.reloadData(null, false, false);\r\n\t\t}else{\r\n\t\t\tthis.refreshData(true);\r\n\t\t}\r\n\r\n\t\t//TODO - Persist left position of row manager\r\n\t\t// left = this.scrollLeft;\r\n\t\t// this.scrollHorizontal(left);\r\n\t}\r\n\r\n\t//check if the sorters have changed since last use\r\n\thasChanged(){\r\n\t\tvar changed = this.changed;\r\n\t\tthis.changed = false;\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t//return current sorters\r\n\tgetSort(){\r\n\t\tvar self = this,\r\n\t\tsorters = [];\r\n\r\n\t\tself.sortList.forEach(function(item){\r\n\t\t\tif(item.column){\r\n\t\t\t\tsorters.push({column:item.column.getComponent(), field:item.column.getField(), dir:item.dir});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn sorters;\r\n\t}\r\n\r\n\t//change sort list and trigger sort\r\n\tsetSort(sortList, dir){\r\n\t\tvar self = this,\r\n\t\tnewSortList = [];\r\n\r\n\t\tif(!Array.isArray(sortList)){\r\n\t\t\tsortList = [{column: sortList, dir:dir}];\r\n\t\t}\r\n\r\n\t\tsortList.forEach(function(item){\r\n\t\t\tvar column;\r\n\r\n\t\t\tcolumn = self.table.columnManager.findColumn(item.column);\r\n\r\n\t\t\tif(column){\r\n\t\t\t\titem.column = column;\r\n\t\t\t\tnewSortList.push(item);\r\n\t\t\t\tself.changed = true;\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Sort Warning - Sort field does not exist and is being ignored: \", item.column);\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t\tself.sortList = newSortList;\r\n\r\n\t\tthis.dispatch(\"sort-changed\");\r\n\t}\r\n\r\n\t//clear sorters\r\n\tclear(){\r\n\t\tthis.setSort([]);\r\n\t}\r\n\r\n\t//find appropriate sorter for column\r\n\tfindSorter(column){\r\n\t\tvar row = this.table.rowManager.activeRows[0],\r\n\t\tsorter = \"string\",\r\n\t\tfield, value;\r\n\r\n\t\tif(row){\r\n\t\t\trow = row.getData();\r\n\t\t\tfield = column.getField();\r\n\r\n\t\t\tif(field){\r\n\r\n\t\t\t\tvalue = column.getFieldValue(row);\r\n\r\n\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\tsorter = \"boolean\";\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\tif(!isNaN(value) && value !== \"\"){\r\n\t\t\t\t\t\tsorter = \"number\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)){\r\n\t\t\t\t\t\t\tsorter = \"alphanum\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Sort.sorters[sorter];\r\n\t}\r\n\r\n\t//work through sort list sorting data\r\n\tsort(data){\r\n\t\tvar self = this,\r\n\t\tsortList = this.table.options.sortOrderReverse ? self.sortList.slice().reverse() : self.sortList,\r\n\t\tsortListActual = [],\r\n\t\trowComponents = [],\r\n\t\tlastSort;\r\n\r\n\t\tif(this.subscribedExternal(\"dataSorting\")){\r\n\t\t\tthis.dispatchExternal(\"dataSorting\", self.getSort());\r\n\t\t}\r\n\r\n\t\tself.clearColumnHeaders();\r\n\r\n\t\tif(this.table.options.sortMode !== \"remote\"){\r\n\r\n\t\t\t//build list of valid sorters and trigger column specific callbacks before sort begins\r\n\t\t\tsortList.forEach(function(item, i){\r\n\t\t\t\tvar sortObj = item.column.modules.sort;\r\n\r\n\t\t\t\tif(item.column && sortObj){\r\n\r\n\t\t\t\t\t//if no sorter has been defined, take a guess\r\n\t\t\t\t\tif(!sortObj.sorter){\r\n\t\t\t\t\t\tsortObj.sorter = self.findSorter(item.column);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\titem.params = typeof sortObj.params === \"function\" ? sortObj.params(item.column.getComponent(), item.dir) : sortObj.params;\r\n\r\n\t\t\t\t\tsortListActual.push(item);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tself.setColumnHeader(item.column, item.dir);\r\n\t\t\t});\r\n\r\n\t\t\t//sort data\r\n\t\t\tif (sortListActual.length) {\r\n\t\t\t\tself._sortItems(data, sortListActual);\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tsortList.forEach(function(item, i){\r\n\t\t\t\tself.setColumnHeader(item.column, item.dir);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.subscribedExternal(\"dataSorted\")){\r\n\t\t\tdata.forEach((row) => {\r\n\t\t\t\trowComponents.push(row.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatchExternal(\"dataSorted\", self.getSort(), rowComponents);\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//clear sort arrows on columns\r\n\tclearColumnHeaders(){\r\n\t\tthis.table.columnManager.getRealColumns().forEach(function(column){\r\n\t\t\tif(column.modules.sort){\r\n\t\t\t\tcolumn.modules.sort.dir = \"none\";\r\n\t\t\t\tcolumn.getElement().setAttribute(\"aria-sort\", \"none\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//set the column header sort direction\r\n\tsetColumnHeader(column, dir){\r\n\t\tcolumn.modules.sort.dir = dir;\r\n\t\tcolumn.getElement().setAttribute(\"aria-sort\", dir === \"asc\" ? \"ascending\" : \"descending\");\r\n\t}\r\n\r\n\t//sort each item in sort list\r\n\t_sortItems(data, sortList){\r\n\t\tvar sorterCount = sortList.length - 1;\r\n\r\n\t\tdata.sort((a, b) => {\r\n\t\t\tvar result;\r\n\r\n\t\t\tfor(var i = sorterCount; i>= 0; i--){\r\n\t\t\t\tlet sortItem = sortList[i];\r\n\r\n\t\t\t\tresult = this._sortRow(a, b, sortItem.column, sortItem.dir, sortItem.params);\r\n\r\n\t\t\t\tif(result !== 0){\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn result;\r\n\t\t});\r\n\t}\r\n\r\n\t//process individual rows for a sort function on active data\r\n\t_sortRow(a, b, column, dir, params){\r\n\t\tvar el1Comp, el2Comp, colComp;\r\n\r\n\t\t//switch elements depending on search direction\r\n\t\tvar el1 = dir == \"asc\" ? a : b;\r\n\t\tvar el2 = dir == \"asc\" ? b : a;\r\n\r\n\t\ta = column.getFieldValue(el1.getData());\r\n\t\tb = column.getFieldValue(el2.getData());\r\n\r\n\t\ta = typeof a !== \"undefined\" ? a : \"\";\r\n\t\tb = typeof b !== \"undefined\" ? b : \"\";\r\n\r\n\t\tel1Comp = el1.getComponent();\r\n\t\tel2Comp = el2.getComponent();\r\n\r\n\t\treturn column.modules.sort.sorter.call(this, a, b, el1Comp, el2Comp, column.getComponent(), dir, params);\r\n\t}\r\n}\r\n\r\nSort.moduleName = \"sort\";\r\n\r\n//load defaults\r\nSort.sorters = defaultSorters;\r\n\r\nexport default Sort;","//sort if element contains any data\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar el1 = 0;\r\n\tvar el2 = 0;\r\n\tvar type = params.type || \"length\";\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar emptyAlign = 0;\r\n\r\n\tfunction calc(value){\r\n\r\n\t\tswitch(type){\r\n\t\t\tcase \"length\":\r\n\t\t\treturn value.length;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"sum\":\r\n\t\t\treturn value.reduce(function(c, d){\r\n\t\t\t\treturn c + d;\r\n\t\t\t});\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"max\":\r\n\t\t\treturn Math.max.apply(null, value) ;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"min\":\r\n\t\t\treturn Math.min.apply(null, value) ;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase \"avg\":\r\n\t\t\treturn value.reduce(function(c, d){\r\n\t\t\t\treturn c + d;\r\n\t\t\t}) / value.length;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\t//handle non array values\r\n\tif(!Array.isArray(a)){\r\n\t\talignEmptyValues = !Array.isArray(b) ? 0 : -1;\r\n\t}else if(!Array.isArray(b)){\r\n\t\talignEmptyValues = 1;\r\n\t}else{\r\n\r\n\t\t//compare valid values\r\n\t\tel1 = a ? calc(a) : 0;\r\n\t\tel2 = b ? calc(b) : 0;\r\n\r\n\t\treturn el1 - el2;\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n};","//sort if element contains any data\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar el1 = typeof a == \"undefined\" ? 0 : 1;\r\n\tvar el2 = typeof b == \"undefined\" ? 0 : 1;\r\n\r\n\treturn el1 - el2;\r\n};","//sort alpha numeric strings\r\nexport default function(as, bs, aRow, bRow, column, dir, params){\r\n\tvar a, b, a1, b1, i= 0, L, rx = /(\\d+)|(\\D+)/g, rd = /\\d/;\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar emptyAlign = 0;\r\n\r\n\t//handle empty values\r\n\tif(!as && as!== 0){\r\n\t\temptyAlign = !bs && bs!== 0 ? 0 : -1;\r\n\t}else if(!bs && bs!== 0){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\r\n\t\tif(isFinite(as) && isFinite(bs)) return as - bs;\r\n\t\ta = String(as).toLowerCase();\r\n\t\tb = String(bs).toLowerCase();\r\n\t\tif(a === b) return 0;\r\n\t\tif(!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1;\r\n\t\ta = a.match(rx);\r\n\t\tb = b.match(rx);\r\n\t\tL = a.length > b.length ? b.length : a.length;\r\n\t\twhile(i < L){\r\n\t\t\ta1= a[i];\r\n\t\t\tb1= b[i++];\r\n\t\t\tif(a1 !== b1){\r\n\t\t\t\tif(isFinite(a1) && isFinite(b1)){\r\n\t\t\t\t\tif(a1.charAt(0) === \"0\") a1 = \".\" + a1;\r\n\t\t\t\t\tif(b1.charAt(0) === \"0\") b1 = \".\" + b1;\r\n\t\t\t\t\treturn a1 - b1;\r\n\t\t\t\t}\r\n\t\t\t\telse return a1 > b1 ? 1 : -1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn a.length > b.length;\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n};","import Module from '../../core/Module.js';\r\nimport Cell from '../../core/cell/Cell.js';\r\n\r\nclass Tooltip extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.tooltipSubscriber = null,\r\n\t\tthis.headerSubscriber = null,\r\n\t\t\r\n\t\tthis.timeout = null;\r\n\t\tthis.popupInstance = null;\r\n\t\t\r\n\t\tthis.registerTableOption(\"tooltipGenerationMode\", undefined); //deprecated\r\n\t\tthis.registerTableOption(\"tooltipDelay\", 300); \r\n\t\t\r\n\t\tthis.registerColumnOption(\"tooltip\");\r\n\t\tthis.registerColumnOption(\"headerTooltip\");\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.deprecationCheck();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\t\r\n\tdeprecationCheck(){\r\n\t\tif(typeof this.table.options.tooltipGenerationMode !== \"undefined\"){\r\n\t\t\tconsole.warn(\"Use of the tooltipGenerationMode option is now deprecated. This option is no longer needed as tooltips are always generated on hover now\");\r\n\t\t}\r\n\t}\t\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tif(column.definition.headerTooltip && !this.headerSubscriber){\r\n\t\t\tthis.headerSubscriber = true;\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-mousemove\", this.mousemoveCheck.bind(this, \"headerTooltip\"));\r\n\t\t\tthis.subscribe(\"column-mouseout\", this.mouseoutCheck.bind(this, \"headerTooltip\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition.tooltip && !this.tooltipSubscriber){\r\n\t\t\tthis.tooltipSubscriber = true;\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-mousemove\", this.mousemoveCheck.bind(this, \"tooltip\"));\r\n\t\t\tthis.subscribe(\"cell-mouseout\", this.mouseoutCheck.bind(this, \"tooltip\"));\r\n\t\t}\r\n\t}\r\n\t\r\n\tmousemoveCheck(action, e, component){\r\n\t\tvar tooltip = action === \"tooltip\" ? component.column.definition.tooltip : component.definition.headerTooltip;\r\n\t\t\r\n\t\tif(tooltip){\r\n\t\t\tthis.clearPopup();\r\n\t\t\tthis.timeout = setTimeout(this.loadTooltip.bind(this, e, component, tooltip), this.table.options.tooltipDelay);\r\n\t\t}\r\n\t}\r\n\r\n\tmouseoutCheck(action, e, component){\r\n\t\tif(!this.popupInstance){\r\n\t\t\tthis.clearPopup();\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearPopup(action, e, component){\r\n\t\tclearTimeout(this.timeout);\r\n\t\tthis.timeout = null;\r\n\t\t\r\n\t\tif(this.popupInstance){\r\n\t\t\tthis.popupInstance.hide();\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadTooltip(e, component, tooltip){\r\n\t\tvar contentsEl, renderedCallback, coords;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\trenderedCallback = callback;\r\n\t\t}\r\n\t\t\r\n\t\tif(typeof tooltip === \"function\"){\r\n\t\t\ttooltip = tooltip(e, component.getComponent(), onRendered);\r\n\t\t}\r\n\t\t\r\n\t\tif(tooltip instanceof HTMLElement){\r\n\t\t\tcontentsEl = tooltip;\r\n\t\t}else{\r\n\t\t\tcontentsEl = document.createElement(\"div\");\r\n\t\t\t\r\n\t\t\tif(tooltip === true){\r\n\t\t\t\tif(component instanceof Cell){\r\n\t\t\t\t\ttooltip = component.value;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(component.definition.field){\r\n\t\t\t\t\t\tthis.langBind(\"columns|\" + component.definition.field, (value) => {\r\n\t\t\t\t\t\t\tcontentsEl.innerHTML = tooltip = value || component.definition.title;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\ttooltip = component.definition.title;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcontentsEl.innerHTML = tooltip;\r\n\t\t}\r\n\t\t\r\n\t\tif(tooltip || tooltip === 0 || tooltip === \"0\" || tooltip === false){\r\n\t\t\tcontentsEl.classList.add(\"tabulator-tooltip\");\r\n\r\n\t\t\tcontentsEl.addEventListener(\"mousemove\", e => e.preventDefault())\r\n\t\t\t\r\n\t\t\tthis.popupInstance = this.popup(contentsEl);\r\n\t\t\t\r\n\t\t\tif(typeof renderedCallback === \"function\"){\r\n\t\t\t\tthis.popupInstance.renderCallback(renderedCallback);\r\n\t\t\t}\r\n\r\n\t\t\tcoords = this.popupInstance.containerEventCoords(e);\r\n\t\t\t\r\n\t\t\tthis.popupInstance.show(coords.x + 15, coords.y + 15).hideOnBlur(() => {\r\n\t\t\t\tthis.dispatchExternal(\"TooltipClosed\", component.getComponent());\r\n\t\t\t\tthis.popupInstance = null;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"TooltipOpened\", component.getComponent());\r\n\t\t}\r\n\t}\r\n}\r\n\r\nTooltip.moduleName = \"tooltip\";\r\n\r\nexport default Tooltip;\r\n","export default {\r\n\t//is integer\r\n\tinteger: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvalue = Number(value);\r\n\t\treturn typeof value === 'number' && isFinite(value) && Math.floor(value) === value;\r\n\t},\r\n\r\n\t//is float\r\n\tfloat: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvalue = Number(value);\r\n\t\treturn typeof value === 'number' && isFinite(value) && value % 1 !== 0;\r\n\t},\r\n\r\n\t//must be a number\r\n\tnumeric: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn !isNaN(value);\r\n\t},\r\n\r\n\t//must be a string\r\n\tstring: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn isNaN(value);\r\n\t},\r\n\r\n\t//maximum value\r\n\tmax: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn parseFloat(value) <= parameters;\r\n\t},\r\n\r\n\t//minimum value\r\n\tmin: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn parseFloat(value) >= parameters;\r\n\t},\r\n\r\n\t//starts with value\r\n\tstarts: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).toLowerCase().startsWith(String(parameters).toLowerCase());\r\n\t},\r\n\r\n\t//ends with value\r\n\tends: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).toLowerCase().endsWith(String(parameters).toLowerCase());\r\n\t},\r\n\r\n\r\n\t//minimum string length\r\n\tminLength: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).length >= parameters;\r\n\t},\r\n\r\n\t//maximum string length\r\n\tmaxLength: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).length <= parameters;\r\n\t},\r\n\r\n\t//in provided value list\r\n\tin: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif(typeof parameters == \"string\"){\r\n\t\t\tparameters = parameters.split(\"|\");\r\n\t\t}\r\n\r\n\t\treturn value === \"\" || parameters.indexOf(value) > -1;\r\n\t},\r\n\r\n\t//must match provided regex\r\n\tregex: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar reg = new RegExp(parameters);\r\n\r\n\t\treturn reg.test(value);\r\n\t},\r\n\r\n\t//value must be unique in this column\r\n\tunique: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar unique = true;\r\n\r\n\t\tvar cellData = cell.getData();\r\n\t\tvar column = cell.getColumn()._getSelf();\r\n\r\n\t\tthis.table.rowManager.rows.forEach(function(row){\r\n\t\t\tvar data = row.getData();\r\n\r\n\t\t\tif(data !== cellData){\r\n\t\t\t\tif(value == column.getFieldValue(data)){\r\n\t\t\t\t\tunique = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn unique;\r\n\t},\r\n\r\n\t//must have a value\r\n\trequired:function(cell, value, parameters){\r\n\t\treturn value !== \"\" && value !== null && typeof value !== \"undefined\";\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultValidators from './defaults/validators.js';\r\n\r\nclass Validate extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.invalidCells = [];\r\n\t\t\r\n\t\tthis.registerTableOption(\"validationMode\", \"blocking\");\r\n\t\t\r\n\t\tthis.registerColumnOption(\"validator\");\r\n\t\t\r\n\t\tthis.registerTableFunction(\"getInvalidCells\", this.getInvalidCells.bind(this));\r\n\t\tthis.registerTableFunction(\"clearCellValidation\", this.userClearCellValidation.bind(this));\r\n\t\tthis.registerTableFunction(\"validate\", this.userValidate.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"cell\", \"isValid\", this.cellIsValid.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"clearValidation\", this.clearValidation.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"validate\", this.cellValidate.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"column\", \"validate\", this.columnValidate.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"validate\", this.rowValidate.bind(this));\r\n\t}\r\n\t\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-delete\", this.clearValidation.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumnCheck.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"edit-success\", this.editValidate.bind(this));\r\n\t\tthis.subscribe(\"edit-editor-clear\", this.editorClear.bind(this));\r\n\t\tthis.subscribe(\"edit-edited-clear\", this.editedClear.bind(this));\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Event Handling //////////\r\n\t///////////////////////////////////\r\n\t\r\n\teditValidate(cell, value, previousValue){\r\n\t\tvar valid = this.table.options.validationMode !== \"manual\" ? this.validate(cell.column.modules.validate, cell, value) : true;\r\n\t\t\r\n\t\t// allow time for editor to make render changes then style cell\r\n\t\tif(valid !== true){\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tcell.getElement().classList.add(\"tabulator-validation-fail\");\r\n\t\t\t\tthis.dispatchExternal(\"validationFailed\", cell.getComponent(), value, valid);\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\treturn valid;\r\n\t}\r\n\t\r\n\teditorClear(cell, cancelled){\r\n\t\tif(cancelled){\r\n\t\t\tif(cell.column.modules.validate){\r\n\t\t\t\tthis.cellValidate(cell);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t}\r\n\t\r\n\teditedClear(cell){\r\n\t\tif(cell.modules.validate){\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t////////// Cell Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\tcellIsValid(cell){\r\n\t\treturn cell.modules.validate ? (cell.modules.validate.invalid || true) : true;\r\n\t}\r\n\t\r\n\tcellValidate(cell){\r\n\t\treturn this.validate(cell.column.modules.validate, cell, cell.getValue());\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Column Functions ////////\r\n\t///////////////////////////////////\r\n\t\r\n\tcolumnValidate(column){\r\n\t\tvar invalid = [];\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tif(this.cellValidate(cell) !== true){\r\n\t\t\t\tinvalid.push(cell.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn invalid.length ? invalid : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t////////// Row Functions //////////\r\n\t///////////////////////////////////\r\n\t\r\n\trowValidate(row){\r\n\t\tvar invalid = [];\r\n\t\t\r\n\t\trow.cells.forEach((cell) => {\r\n\t\t\tif(this.cellValidate(cell) !== true){\r\n\t\t\t\tinvalid.push(cell.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn invalid.length ? invalid : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\t\r\n\tuserClearCellValidation(cells){\r\n\t\tif(!cells){\r\n\t\t\tcells = this.getInvalidCells();\r\n\t\t}\r\n\t\t\r\n\t\tif(!Array.isArray(cells)){\r\n\t\t\tcells = [cells];\r\n\t\t}\r\n\t\t\r\n\t\tcells.forEach((cell) => {\r\n\t\t\tthis.clearValidation(cell._getSelf());\r\n\t\t});\r\n\t}\r\n\t\r\n\tuserValidate(cells){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\t//clear row data\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\trow = row.getComponent();\r\n\t\t\t\r\n\t\t\tvar valid = row.validate();\r\n\t\t\t\r\n\t\t\tif(valid !== true){\r\n\t\t\t\toutput = output.concat(valid);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn output.length ? output : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tinitializeColumnCheck(column){\r\n\t\tif(typeof column.definition.validator !== \"undefined\"){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//validate\r\n\tinitializeColumn(column){\r\n\t\tvar self = this,\r\n\t\tconfig = [],\r\n\t\tvalidator;\r\n\t\t\r\n\t\tif(column.definition.validator){\r\n\t\t\t\r\n\t\t\tif(Array.isArray(column.definition.validator)){\r\n\t\t\t\tcolumn.definition.validator.forEach((item) => {\r\n\t\t\t\t\tvalidator = self._extractValidator(item);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(validator){\r\n\t\t\t\t\t\tconfig.push(validator);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tvalidator = this._extractValidator(column.definition.validator);\r\n\t\t\t\t\r\n\t\t\t\tif(validator){\r\n\t\t\t\t\tconfig.push(validator);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.validate = config.length ? config : false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t_extractValidator(value){\r\n\t\tvar type, params, pos;\r\n\t\t\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\tpos = value.indexOf(':');\r\n\t\t\t\r\n\t\t\tif(pos > -1){\r\n\t\t\t\ttype = value.substring(0,pos);\r\n\t\t\t\tparams = value.substring(pos+1);\r\n\t\t\t}else{\r\n\t\t\t\ttype = value;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn this._buildValidator(type, params);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"function\":\r\n\t\t\treturn this._buildValidator(value);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"object\":\r\n\t\t\treturn this._buildValidator(value.type, value.parameters);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t\r\n\t_buildValidator(type, params){\r\n\t\t\r\n\t\tvar func = typeof type == \"function\" ? type : Validate.validators[type];\r\n\t\t\r\n\t\tif(!func){\r\n\t\t\tconsole.warn(\"Validator Setup Error - No matching validator found:\", type);\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn {\r\n\t\t\t\ttype:typeof type == \"function\" ? \"function\" : type,\r\n\t\t\t\tfunc:func,\r\n\t\t\t\tparams:params,\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n\t\r\n\tvalidate(validators, cell, value){\r\n\t\tvar self = this,\r\n\t\tfailedValidators = [],\r\n\t\tinvalidIndex = this.invalidCells.indexOf(cell);\r\n\t\t\r\n\t\tif(validators){\r\n\t\t\tvalidators.forEach((item) => {\r\n\t\t\t\tif(!item.func.call(self, cell.getComponent(), value, item.params)){\r\n\t\t\t\t\tfailedValidators.push({\r\n\t\t\t\t\t\ttype:item.type,\r\n\t\t\t\t\t\tparameters:item.params\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tif(!cell.modules.validate){\r\n\t\t\tcell.modules.validate = {};\r\n\t\t}\r\n\t\t\r\n\t\tif(!failedValidators.length){\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t\t\t\r\n\t\t\tif(invalidIndex > -1){\r\n\t\t\t\tthis.invalidCells.splice(invalidIndex, 1);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcell.modules.validate.invalid = failedValidators;\r\n\t\t\t\r\n\t\t\tif(this.table.options.validationMode !== \"manual\"){\r\n\t\t\t\tcell.getElement().classList.add(\"tabulator-validation-fail\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(invalidIndex == -1){\r\n\t\t\t\tthis.invalidCells.push(cell);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn failedValidators.length ? failedValidators : true;\r\n\t}\r\n\t\r\n\tgetInvalidCells(){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.invalidCells.forEach((cell) => {\r\n\t\t\toutput.push(cell.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tclearValidation(cell){\r\n\t\tvar invalidIndex;\r\n\t\t\r\n\t\tif(cell.modules.validate && cell.modules.validate.invalid){\r\n\t\t\t\r\n\t\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t\t\r\n\t\t\tinvalidIndex = this.invalidCells.indexOf(cell);\r\n\t\t\t\r\n\t\t\tif(invalidIndex > -1){\r\n\t\t\t\tthis.invalidCells.splice(invalidIndex, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nValidate.moduleName = \"validate\";\r\n\r\n//load defaults\r\nValidate.validators = defaultValidators;\r\n\r\nexport default Validate;\r\n","export default {\r\n\r\n\tdebugEventsExternal:false, //flag to console log events\r\n\tdebugEventsInternal:false, //flag to console log events\r\n\tdebugInvalidOptions:true, //allow toggling of invalid option warnings\r\n\tdebugInitialization:true, //allow toggling of invalid option warnings\r\n\r\n\theight:false, //height of tabulator\r\n\tminHeight:false, //minimum height of tabulator\r\n\tmaxHeight:false, //maximum height of tabulator\r\n\r\n\tcolumnHeaderVertAlign:\"top\", //vertical alignment of column headers\r\n\r\n\tpopupContainer:false,\r\n\r\n\tcolumns:[],//store for colum header info\r\n\tcolumnDefaults:{}, //store column default props\r\n\r\n\tdata:false, //default starting data\r\n\r\n\tautoColumns:false, //build columns from data row structure\r\n\tautoColumnsDefinitions:false,\r\n\r\n\tnestedFieldSeparator:\".\", //separator for nested data\r\n\r\n\tfooterElement:false, //hold footer element\r\n\r\n\tindex:\"id\", //filed for row index\r\n\r\n\ttextDirection:\"auto\",\r\n\r\n\taddRowPos:\"bottom\", //position to insert blank rows, top|bottom\r\n\r\n\theaderVisible:true, //hide header\r\n\r\n\trenderVertical:\"virtual\",\r\n\trenderHorizontal:\"basic\",\r\n\trenderVerticalBuffer:0, // set virtual DOM buffer size\r\n\r\n\tscrollToRowPosition:\"top\",\r\n\tscrollToRowIfVisible:true,\r\n\r\n\tscrollToColumnPosition:\"left\",\r\n\tscrollToColumnIfVisible:true,\r\n\r\n\trowFormatter:false,\r\n\trowFormatterPrint:null,\r\n\trowFormatterClipboard:null,\r\n\trowFormatterHtmlOutput:null,\r\n\r\n\trowHeight:null,\r\n\r\n\tplaceholder:false,\r\n\r\n\tdataLoader:true,\r\n\tdataLoaderLoading:false,\r\n\tdataLoaderError:false,\r\n\tdataLoaderErrorTimeout:3000,\r\n\r\n\tdataSendParams:{},\r\n\r\n\tdataReceiveParams:{},\r\n}\r\n","export default class OptionsList {\r\n\tconstructor(table, msgType, defaults = {}){\r\n\t\tthis.table = table;\r\n\t\tthis.msgType = msgType;\r\n\t\tthis.registeredDefaults = Object.assign({}, defaults)\r\n\t}\r\n\r\n\tregister(option, value){\r\n\t\tthis.registeredDefaults[option] = value;\r\n\t}\r\n\r\n\tgenerate(defaultOptions, userOptions = {}){\r\n\t\tvar output = Object.assign({}, this.registeredDefaults);\r\n\r\n\t\tObject.assign(output, defaultOptions);\r\n\r\n\t\tif(userOptions.debugInvalidOptions !== false || this.table.options.debugInvalidOptions){\r\n\t\t\tfor (var key in userOptions){\r\n\t\t\t\tif(!output.hasOwnProperty(key)){\r\n\t\t\t\t\tconsole.warn(\"Invalid \" + this.msgType + \" option:\", key)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (var key in output){\r\n\t\t\tif(key in userOptions){\r\n\t\t\t\toutput[key] = userOptions[key];\r\n\t\t\t}else{\r\n\t\t\t\tif(Array.isArray(output[key])){\r\n\t\t\t\t\toutput[key] = Object.assign([], output[key]);\r\n\t\t\t\t}else if(typeof output[key] === \"object\" && output[key] !== null){\r\n\t\t\t\t\toutput[key] = Object.assign({}, output[key]);\r\n\t\t\t\t}else if (typeof output[key] === \"undefined\"){\r\n\t\t\t\t\tdelete output[key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from '../tools/Helpers.js';\r\n\r\nexport default class Renderer extends CoreFeature{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.elementVertical = table.rowManager.element;\r\n\t\tthis.elementHorizontal = table.columnManager.element;\r\n\t\tthis.tableElement = table.rowManager.tableElement;\r\n\r\n\t\tthis.verticalFillMode = \"fit\"; // used by row manager to determin how to size the render area (\"fit\" - fits container to the contents, \"fill\" - fills the contianer without resizing it)\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t/////// Internal Bindings /////////\r\n\t///////////////////////////////////\r\n\r\n\tinitialize(){\r\n\t\t//initialize core functionality\r\n\t}\r\n\r\n\tclearRows(){\r\n\t\t//clear down existing rows layout\r\n\t}\r\n\r\n\tclearColumns(){\r\n\t\t//clear down existing columns layout\r\n\t}\r\n\r\n\r\n\treinitializeColumnWidths(columns){\r\n\t\t//resize columns to fit data\r\n\t}\r\n\r\n\r\n\trenderRows(){\r\n\t\t//render rows from a clean slate\r\n\t}\r\n\r\n\trenderColumns(){\r\n\t\t//render columns from a clean slate\r\n\t}\r\n\r\n\trerenderRows(callback){\r\n\t\t// rerender rows and keep position\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\t}\r\n\r\n\trerenderColumns(update, blockRedraw){\r\n\t\t//rerender columns\r\n\t}\r\n\r\n\trenderRowCells(row){\r\n\t\t//render the cells in a row\r\n\t}\r\n\r\n\trerenderRowCells(row, force){\r\n\t\t//rerender the cells in a row\r\n\t}\r\n\r\n\tscrollColumns(left, dir){\r\n\t\t//handle horizontal scrolling\r\n\t}\r\n\r\n\tscrollRows(top, dir){\r\n\t\t//handle vertical scolling\r\n\t}\r\n\r\n\tresize(){\r\n\t\t//container has rezied, carry out any needed recalculations (DO NOT RERENDER IN THIS FUNCTION)\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\t//scroll to a specific row\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\t//determine weather the row is nearest the top or bottom of the table, retur true for top or false for bottom\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\t//return the visible rows\r\n\t\treturn [];\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t//////// Helper Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\trows(){\r\n\t\treturn this.table.rowManager.getDisplayRows();\r\n\t}\r\n\r\n\tstyleRow(row, index){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tif(index % 2){\r\n\t\t\trowEl.classList.add(\"tabulator-row-even\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-odd\");\r\n\t\t}else{\r\n\t\t\trowEl.classList.add(\"tabulator-row-odd\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-even\");\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t/////// External Triggers /////////\r\n\t/////// (DO NOT OVERRIDE) /////////\r\n\t///////////////////////////////////\r\n\r\n\tclear(){\r\n\t\t//clear down existing layout\r\n\t\tthis.clearRows();\r\n\t\tthis.clearColumns();\r\n\t}\r\n\r\n\trender(){\r\n\t\t//render from a clean slate\r\n\t\tthis.renderRows();\r\n\t\tthis.renderColumns();\r\n\t}\r\n\r\n\trerender(callback){\r\n\t\t// rerender and keep position\r\n\t\tthis.rerenderRows();\r\n\t\tthis.rerenderColumns();\r\n\t}\r\n\r\n\tscrollToRowPosition(row, position, ifVisible){\r\n\t\tvar rowIndex = this.rows().indexOf(row),\r\n\t\trowEl = row.getElement(),\r\n\t\toffset = 0;\r\n\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tif(rowIndex > -1){\r\n\r\n\t\t\t\tif(typeof ifVisible === \"undefined\"){\r\n\t\t\t\t\tifVisible = this.table.options.scrollToRowIfVisible;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//check row visibility\r\n\t\t\t\tif(!ifVisible){\r\n\t\t\t\t\tif(Helpers.elVisible(rowEl)){\r\n\t\t\t\t\t\toffset = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(offset > 0 && offset < this.elementVertical.clientHeight - rowEl.offsetHeight){\r\n\t\t\t\t\t\t\tresolve();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(typeof position === \"undefined\"){\r\n\t\t\t\t\tposition = this.table.options.scrollToRowPosition;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(position === \"nearest\"){\r\n\t\t\t\t\tposition = this.scrollToRowNearestTop(row) ? \"top\" : \"bottom\"\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//scroll to row\r\n\t\t\t\tthis.scrollToRow(row);\r\n\r\n\t\t\t\t//align to correct position\r\n\t\t\t\tswitch(position){\r\n\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\tcase \"center\":\r\n\r\n\t\t\t\t\tif(this.elementVertical.scrollHeight - this.elementVertical.scrollTop == this.elementVertical.clientHeight){\r\n\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop + (rowEl.offsetTop - this.elementVertical.scrollTop) - ((this.elementVertical.scrollHeight - rowEl.offsetTop) / 2);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - (this.elementVertical.clientHeight / 2);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"bottom\":\r\n\r\n\t\t\t\t\tif(this.elementVertical.scrollHeight - this.elementVertical.scrollTop == this.elementVertical.clientHeight){\r\n\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - (this.elementVertical.scrollHeight - rowEl.offsetTop) + rowEl.offsetHeight;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - this.elementVertical.clientHeight + rowEl.offsetHeight;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"top\":\r\n\t\t\t\t\tthis.elementVertical.scrollTop = rowEl.offsetTop;\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tresolve();\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - Row not visible\");\r\n\t\t\t\treject(\"Scroll Error - Row not visible\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class BaiscHorizontal extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t}\r\n\r\n\trenderRowCells(row){\r\n\t\trow.cells.forEach((cell) => {\r\n\t\t\trow.element.appendChild(cell.getElement());\r\n\t\t\tcell.cellRendered();\r\n\t\t});\r\n\t}\r\n\r\n\treinitializeColumnWidths(columns){\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t});\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class VirtualDomHorizontal extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.leftCol = 0;\r\n\t\tthis.rightCol = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = 0;\r\n\t\tthis.vDomScrollPosRight = 0;\r\n\t\t\r\n\t\tthis.vDomPadLeft = 0;\r\n\t\tthis.vDomPadRight = 0;\r\n\t\t\r\n\t\tthis.fitDataColAvg = 0;\r\n\t\t\r\n\t\tthis.windowBuffer = 200; //pixel margin to make column visible before it is shown on screen\r\n\t\t\r\n\t\tthis.visibleRows = null;\r\n\r\n\t\tthis.initialized = false;\r\n\t\tthis.isFitData = false;\r\n\t\t\r\n\t\tthis.columns = [];\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.compatibilityCheck();\r\n\t\tthis.layoutCheck();\r\n\t\tthis.vertScrollListen();\r\n\t}\r\n\t\r\n\tcompatibilityCheck(){\r\n\t\tvar columns = this.options(\"columns\"),\r\n\t\tfrozen = false,\r\n\t\tok = true;\r\n\t\t\r\n\t\tif(this.options(\"layout\") == \"fitDataTable\"){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with fitDataTable layout mode\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.options(\"responsiveLayout\")){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with responsive columns\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.options(\"rtl\")){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not currently compatible with RTL text direction\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(columns){\r\n\t\t\tfrozen = columns.find((col) => {\r\n\t\t\t\treturn col.frozen;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(frozen){\r\n\t\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with frozen columns\");\r\n\t\t\t\tok = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// if(!ok){\r\n\t\t// \toptions.virtualDomHoz = false;\r\n\t\t// }\r\n\t\t\r\n\t\treturn ok;\r\n\t}\r\n\t\r\n\tlayoutCheck(){\r\n\t\tthis.isFitData = this.options(\"layout\").startsWith('fitData');\r\n\t}\r\n\r\n\tvertScrollListen(){\r\n\t\tthis.subscribe(\"scroll-vertical\", this.clearVisRowCache.bind(this));\r\n\t\tthis.subscribe(\"data-refreshed\", this.clearVisRowCache.bind(this));\r\n\t}\r\n\r\n\tclearVisRowCache(){\r\n\t\tthis.visibleRows = null;\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t///////// Public Functions ///////////\r\n\t//////////////////////////////////////\r\n\t\r\n\trenderColumns(row, force){\r\n\t\tthis.dataChange();\r\n\t}\r\n\r\n\t\r\n\tscrollColumns(left, dir){\r\n\t\tif(this.scrollLeft != left){\r\n\t\t\tthis.scrollLeft = left;\r\n\t\t\t\r\n\t\t\tthis.scroll(left - (this.vDomScrollPosLeft + this.windowBuffer));\r\n\t\t}\r\n\t}\r\n\t\r\n\tcalcWindowBuffer(){\r\n\t\tvar buffer = this.elementVertical.clientWidth;\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvar width = column.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tif(width > buffer){\r\n\t\t\t\t\tbuffer = width;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.windowBuffer = buffer * 2;\r\n\t}\r\n\t\r\n\trerenderColumns(update, blockRedraw){\t\t\r\n\t\tvar old = {\r\n\t\t\tcols:this.columns,\r\n\t\t\tleftCol:this.leftCol,\r\n\t\t\trightCol:this.rightCol,\r\n\t\t},\r\n\t\tcolPos = 0;\r\n\t\t\r\n\t\t\r\n\t\tif(update && !this.initialized){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tthis.clear();\r\n\t\t\r\n\t\tthis.calcWindowBuffer();\r\n\t\t\r\n\t\tthis.scrollLeft = this.elementVertical.scrollLeft;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = this.scrollLeft - this.windowBuffer;\r\n\t\tthis.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.windowBuffer;\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tvar config = {};\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvar width = column.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tconfig.leftPos = colPos;\r\n\t\t\t\tconfig.rightPos = colPos + width;\r\n\t\t\t\t\r\n\t\t\t\tconfig.width = width;\r\n\t\t\t\t\r\n\t\t\t\tif (this.isFitData) {\r\n\t\t\t\t\tconfig.fitDataCheck = column.modules.vdomHoz ? column.modules.vdomHoz.fitDataCheck : true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif((colPos + width > this.vDomScrollPosLeft) && (colPos < this.vDomScrollPosRight)){\r\n\t\t\t\t\t//column is visible\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.leftCol == -1){\r\n\t\t\t\t\t\tthis.leftCol = this.columns.length;\r\n\t\t\t\t\t\tthis.vDomPadLeft = colPos;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.rightCol = this.columns.length;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t// column is hidden\r\n\t\t\t\t\tif(this.leftCol !== -1){\r\n\t\t\t\t\t\tthis.vDomPadRight += width;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.columns.push(column);\r\n\t\t\t\t\r\n\t\t\t\tcolumn.modules.vdomHoz = config;\r\n\t\t\t\t\r\n\t\t\t\tcolPos += width;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t\r\n\t\tthis.initialized = true;\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tif(!update || this.reinitChanged(old)){\r\n\t\t\t\tthis.reinitializeRows();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.elementVertical.scrollLeft = this.scrollLeft;\r\n\t}\r\n\t\r\n\trenderRowCells(row){\r\n\t\tif(this.initialized){\r\n\t\t\tthis.initializeRow(row);\r\n\t\t}else{\r\n\t\t\trow.cells.forEach((cell) => {\r\n\t\t\t\trow.element.appendChild(cell.getElement());\r\n\t\t\t\tcell.cellRendered();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\trerenderRowCells(row, force){\r\n\t\tthis.reinitializeRow(row, force);\r\n\t}\r\n\t\r\n\treinitializeColumnWidths(columns){\r\n\t\tfor(let i = this.leftCol; i <= this.rightCol; i++){\r\n\t\t\tthis.columns[i].reinitializeWidth();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t//////// Internal Rendering //////////\r\n\t//////////////////////////////////////\r\n\t\r\n\tdeinitialize(){\r\n\t\tthis.initialized = false;\r\n\t}\r\n\t\r\n\tclear(){\r\n\t\tthis.columns = [];\r\n\t\t\r\n\t\tthis.leftCol = -1;\r\n\t\tthis.rightCol = 0;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = 0;\r\n\t\tthis.vDomScrollPosRight = 0;\r\n\t\tthis.vDomPadLeft = 0;\r\n\t\tthis.vDomPadRight = 0;\r\n\t}\r\n\t\r\n\tdataChange(){\r\n\t\tvar change = false,\r\n\t\tcollsWidth = 0,\r\n\t\tcolEnd = 0,\r\n\t\tgroup, row, rowEl;\r\n\t\t\r\n\t\tif(this.isFitData){\r\n\t\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\t\tif(!column.definition.width && column.visible){\r\n\t\t\t\t\tchange = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(change){\r\n\t\t\t\tif(change && this.table.rowManager.getDisplayRows().length){\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.windowBuffer;\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar row = this.chain(\"rows-sample\", [1], [], () => {\r\n\t\t\t\t\t\treturn this.table.rowManager.getDisplayRows();\r\n\t\t\t\t\t})[0];\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trowEl = row.getElement();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trow.generateCells();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.tableElement.appendChild(rowEl);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor(var colEnd = 0; colEnd < row.cells.length; colEnd++){\r\n\t\t\t\t\t\t\tlet cell = row.cells[colEnd];\r\n\t\t\t\t\t\t\trowEl.appendChild(cell.getElement());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcell.column.reinitializeWidth();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcollsWidth += cell.column.getWidth();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// if(collsWidth > this.vDomScrollPosRight){\r\n\t\t\t\t\t\t\t// \tbreak;\r\n\t\t\t\t\t\t\t// }\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// this.fitDataColAvg = Math.floor(collsWidth / (colEnd + 1));\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// for(colEnd; colEnd < this.table.columnManager.columnsByIndex.length; colEnd++){\r\n\t\t\t\t\t\t// \tthis.table.columnManager.columnsByIndex[colEnd].setWidth(this.fitDataColAvg);\r\n\t\t\t\t\t\t// }\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.rerenderColumns(false, true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.options(\"layout\") === \"fitColumns\"){\r\n\t\t\t\tthis.layoutRefresh();\r\n\t\t\t\tthis.rerenderColumns(false, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitChanged(old){\r\n\t\tvar match = true;\r\n\t\t\r\n\t\tif(old.cols.length !== this.columns.length || old.leftCol !== this.leftCol || old.rightCol !== this.rightCol){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\told.cols.forEach((col, i) => {\r\n\t\t\tif(col !== this.columns[i]){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn !match;\r\n\t}\r\n\t\r\n\treinitializeRows(){\r\n\t\tvar rows = this.getVisibleRows();\r\n\t\trows.forEach((row) => {\r\n\t\t\tthis.reinitializeRow(row, true);\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetVisibleRows(){\r\n\t\tif (!this.visibleRows){\r\n\t\t\tthis.visibleRows = this.table.rowManager.getVisibleRows();\r\n\t\t}\r\n\r\n\t\treturn this.visibleRows;\t\r\n\t}\r\n\t\r\n\tscroll(diff){\r\n\t\tthis.vDomScrollPosLeft += diff;\r\n\t\tthis.vDomScrollPosRight += diff;\r\n\r\n\t\tif(Math.abs(diff) > (this.windowBuffer / 2)){\r\n\t\t\tthis.rerenderColumns();\r\n\t\t}else{\r\n\t\t\tif(diff > 0){\r\n\t\t\t\t//scroll right\r\n\t\t\t\tthis.addColRight();\r\n\t\t\t\tthis.removeColLeft();\r\n\t\t\t}else{\r\n\t\t\t\t//scroll left\r\n\t\t\t\tthis.addColLeft();\r\n\t\t\t\tthis.removeColRight();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolPositionAdjust (start, end, diff){\r\n\t\tfor(let i = start; i < end; i++){\r\n\t\t\tlet column = this.columns[i];\r\n\t\t\t\r\n\t\t\tcolumn.modules.vdomHoz.leftPos += diff;\r\n\t\t\tcolumn.modules.vdomHoz.rightPos += diff;\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColRight(){\r\n\t\tvar changes = false;\r\n\t\t\r\n\t\twhile(true){\r\n\t\t\t\r\n\t\t\tlet column = this.columns[this.rightCol + 1];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.leftPos <= this.vDomScrollPosRight){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\trow.getElement().appendChild(cell.getElement());\r\n\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.fitDataColActualWidthCheck(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.rightCol++; // Don't move this below the >= check below\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.rightCol >= (this.columns.length - 1)){\r\n\t\t\t\t\t\tthis.vDomPadRight = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomPadRight -= column.getWidth();\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColLeft(){\r\n\t\tvar changes = false;\r\n\t\t\r\n\t\twhile(true){\r\n\t\t\tlet column = this.columns[this.leftCol - 1];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.rightPos >= this.vDomScrollPosLeft){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\trow.getElement().prepend(cell.getElement());\r\n\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.leftCol--; // don't move this below the <= check below\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.leftCol <= 0){ // replicating logic in addColRight\r\n\t\t\t\t\t\tthis.vDomPadLeft = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomPadLeft -= column.getWidth();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tlet diff = this.fitDataColActualWidthCheck(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(diff){\r\n\t\t\t\t\t\tthis.scrollLeft = this.elementVertical.scrollLeft = this.elementVertical.scrollLeft + diff;\r\n\t\t\t\t\t\tthis.vDomPadRight -= diff;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveColRight(){\r\n\t\tvar changes = false;\r\n\t\t\r\n\t\twhile(true){\r\n\t\t\tlet column = this.columns[this.rightCol];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.leftPos > this.vDomScrollPosRight){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\trow.getElement().removeChild(cell.getElement());\r\n\t\t\t\t\t\t\t} catch (ex) {\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Could not removeColRight\", ex.message)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.vDomPadRight += column.getWidth();\r\n\t\t\t\t\tthis.rightCol --;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveColLeft(){\r\n\t\tvar changes = false;\r\n\t\t\r\n\t\twhile(true){\r\n\t\t\tlet column = this.columns[this.leftCol];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.rightPos < this.vDomScrollPosLeft){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\t\t\t\t\t\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\trow.getElement().removeChild(cell.getElement());\r\n\t\t\t\t\t\t\t} catch (ex) {\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Could not removeColLeft\", ex.message)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.vDomPadLeft += column.getWidth();\r\n\t\t\t\t\tthis.leftCol ++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\tfitDataColActualWidthCheck(column){\r\n\t\tvar newWidth, widthDiff;\r\n\t\t\r\n\t\tif(column.modules.vdomHoz.fitDataCheck){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t\t\r\n\t\t\tnewWidth = column.getWidth();\r\n\t\t\twidthDiff = newWidth - column.modules.vdomHoz.width;\r\n\t\t\t\r\n\t\t\tif(widthDiff){\r\n\t\t\t\tcolumn.modules.vdomHoz.rightPos += widthDiff;\r\n\t\t\t\tcolumn.modules.vdomHoz.width = newWidth;\r\n\t\t\t\tthis.colPositionAdjust(this.columns.indexOf(column) + 1, this.columns.length, widthDiff);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.vdomHoz.fitDataCheck = false;\r\n\t\t}\r\n\t\t\r\n\t\treturn widthDiff;\r\n\t}\r\n\t\r\n\tinitializeRow(row){\r\n\t\tif(row.type !== \"group\"){\r\n\t\t\trow.modules.vdomHoz = {\r\n\t\t\t\tleftCol:this.leftCol,\r\n\t\t\t\trightCol:this.rightCol,\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tfor(let i = this.leftCol; i <= this.rightCol; i++){\r\n\t\t\t\tlet column = this.columns[i];\r\n\t\t\t\t\r\n\t\t\t\tif(column && column.visible){\r\n\t\t\t\t\tlet cell = row.getCell(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\trow.getElement().appendChild(cell.getElement());\r\n\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeRow(row, force){\r\n\t\tif(row.type !== \"group\"){\r\n\t\t\tif(force || !row.modules.vdomHoz || row.modules.vdomHoz.leftCol !== this.leftCol || row.modules.vdomHoz.rightCol !== this.rightCol){\r\n\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\twhile(rowEl.firstChild) rowEl.removeChild(rowEl.firstChild);\r\n\t\t\t\t\r\n\t\t\t\tthis.initializeRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Column from './column/Column.js';\r\nimport ColumnComponent from './column/ColumnComponent.js';\r\nimport Helpers from './tools/Helpers.js';\r\nimport OptionsList from './tools/OptionsList.js';\r\n\r\nimport RendererBasicHorizontal from './rendering/renderers/BasicHorizontal.js';\r\nimport RendererVirtualDomHorizontal from './rendering/renderers/VirtualDomHorizontal.js';\r\n\r\nimport defaultColumnOptions from './column/defaults/options.js';\r\n\r\nexport default class ColumnManager extends CoreFeature {\r\n\r\n\tconstructor (table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.blockHozScrollEvent = false;\r\n\t\tthis.headersElement = null;\r\n\t\tthis.element = null ; //containing element\r\n\t\tthis.columns = []; // column definition object\r\n\t\tthis.columnsByIndex = []; //columns by index\r\n\t\tthis.columnsByField = {}; //columns by field\r\n\t\tthis.scrollLeft = 0;\r\n\t\tthis.optionsList = new OptionsList(this.table, \"column definition\", defaultColumnOptions);\r\n\r\n\t\tthis.renderer = null;\r\n\t}\r\n\r\n\t////////////// Setup Functions /////////////////\r\n\r\n\tinitialize(){\r\n\t\tthis.initializeRenderer();\r\n\r\n\t\tthis.headersElement = this.createHeadersElement();\r\n\t\tthis.element = this.createHeaderElement();\r\n\r\n\t\tthis.element.insertBefore(this.headersElement, this.element.firstChild);\r\n\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t}\r\n\r\n\tinitializeRenderer(){\r\n\t\tvar renderClass;\r\n\r\n\t\tvar renderers = {\r\n\t\t\t\"virtual\": RendererVirtualDomHorizontal,\r\n\t\t\t\"basic\": RendererBasicHorizontal,\r\n\t\t};\r\n\r\n\t\tif(typeof this.table.options.renderHorizontal === \"string\"){\r\n\t\t\trenderClass = renderers[this.table.options.renderHorizontal];\r\n\t\t}else{\r\n\t\t\trenderClass = this.table.options.renderHorizontal;\r\n\t\t}\r\n\r\n\t\tif(renderClass){\r\n\t\t\tthis.renderer = new renderClass(this.table, this.element, this.tableElement);\r\n\t\t\tthis.renderer.initialize();\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Unable to find matching renderer:\", table.options.renderHorizontal);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tcreateHeadersElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-headers\");\r\n\t\tel.setAttribute(\"role\", \"row\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tcreateHeaderElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-header\");\r\n\t\tel.setAttribute(\"role\", \"rowgroup\");\r\n\r\n\t\tif(!this.table.options.headerVisible){\r\n\t\t\tel.classList.add(\"tabulator-header-hidden\");\r\n\t\t}\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\t//return containing element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\t//return header containing element\r\n\tgetHeadersElement(){\r\n\t\treturn this.headersElement;\r\n\t}\r\n\r\n\t//scroll horizontally to match table body\r\n\tscrollHorizontal(left){\r\n\t\tvar hozAdjust = 0,\r\n\t\tscrollWidth = this.element.scrollWidth - this.table.element.clientWidth;\r\n\r\n\t\t// this.tempScrollBlock();\r\n\t\tthis.element.scrollLeft = left;\r\n\r\n\t\t//adjust for vertical scrollbar moving table when present\r\n\t\tif(left > scrollWidth){\r\n\t\t\thozAdjust = left - scrollWidth;\r\n\t\t\tthis.element.style.marginLeft = (-(hozAdjust)) + \"px\";\r\n\t\t}else{\r\n\t\t\tthis.element.style.marginLeft = 0;\r\n\t\t}\r\n\r\n\t\tthis.scrollLeft = left;\r\n\r\n\t\tthis.renderer.scrollColumns(left);\r\n\t}\r\n\r\n\t///////////// Column Setup Functions /////////////\r\n\tgenerateColumnsFromRowData(data){\r\n\t\tvar cols = [],\r\n\t\tdefinitions = this.table.options.autoColumnsDefinitions,\r\n\t\trow, sorter;\r\n\r\n\t\tif(data && data.length){\r\n\r\n\t\t\trow = data[0];\r\n\r\n\t\t\tfor(var key in row){\r\n\t\t\t\tlet col = {\r\n\t\t\t\t\tfield:key,\r\n\t\t\t\t\ttitle:key,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tlet value = row[key];\r\n\r\n\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\tsorter = \"boolean\";\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\tif(Array.isArray(value)){\r\n\t\t\t\t\t\tsorter = \"array\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\tif(!isNaN(value) && value !== \"\"){\r\n\t\t\t\t\t\tsorter = \"number\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)){\r\n\t\t\t\t\t\t\tsorter = \"alphanum\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcol.sorter = sorter;\r\n\r\n\t\t\t\tcols.push(col);\r\n\t\t\t}\r\n\r\n\t\t\tif(definitions){\r\n\r\n\t\t\t\tswitch(typeof definitions){\r\n\t\t\t\t\tcase \"function\":\r\n\t\t\t\t\tthis.table.options.columns = definitions.call(this.table, cols);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\tif(Array.isArray(definitions)){\r\n\t\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\t\tvar match = definitions.find((def) => {\r\n\t\t\t\t\t\t\t\treturn def.field === col.field;\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\tif(match){\r\n\t\t\t\t\t\t\t\tObject.assign(col, match);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\t\tif(definitions[col.field]){\r\n\t\t\t\t\t\t\t\tObject.assign(col, definitions[col.field]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.table.options.columns = cols;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.table.options.columns = cols;\r\n\t\t\t}\r\n\r\n\t\t\tthis.setColumns(this.table.options.columns);\r\n\t\t}\r\n\t}\r\n\r\n\tsetColumns(cols, row){\r\n\t\twhile(this.headersElement.firstChild) this.headersElement.removeChild(this.headersElement.firstChild);\r\n\r\n\t\tthis.columns = [];\r\n\t\tthis.columnsByIndex = [];\r\n\t\tthis.columnsByField = {};\r\n\r\n\t\tthis.dispatch(\"columns-loading\");\r\n\r\n\t\tcols.forEach((def, i) => {\r\n\t\t\tthis._addColumn(def);\r\n\t\t});\r\n\r\n\t\tthis._reIndexColumns();\r\n\r\n\t\tthis.dispatch(\"columns-loaded\");\r\n\r\n\t\tthis.renderer.rerenderColumns(false, true);\r\n\r\n\t\tthis.redraw(true);\r\n\t}\r\n\r\n\t_addColumn(definition, before, nextToColumn){\r\n\t\tvar column = new Column(definition, this),\r\n\t\tcolEl = column.getElement(),\r\n\t\tindex = nextToColumn ? this.findColumnIndex(nextToColumn) : nextToColumn;\r\n\r\n\t\tif(nextToColumn && index > -1){\r\n\t\t\tvar topColumn = nextToColumn.getTopColumn()\r\n\t\t\tvar parentIndex = this.columns.indexOf(topColumn);\r\n\t\t\tvar nextEl = topColumn.getElement();\r\n\r\n\t\t\tif(before){\r\n\t\t\t\tthis.columns.splice(parentIndex, 0, column);\r\n\t\t\t\tnextEl.parentNode.insertBefore(colEl, nextEl);\r\n\t\t\t}else{\r\n\t\t\t\tthis.columns.splice(parentIndex + 1, 0, column);\r\n\t\t\t\tnextEl.parentNode.insertBefore(colEl, nextEl.nextSibling);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(before){\r\n\t\t\t\tthis.columns.unshift(column);\r\n\t\t\t\tthis.headersElement.insertBefore(column.getElement(), this.headersElement.firstChild);\r\n\t\t\t}else{\r\n\t\t\t\tthis.columns.push(column);\r\n\t\t\t\tthis.headersElement.appendChild(column.getElement());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcolumn.columnRendered();\r\n\r\n\t\treturn column;\r\n\t}\r\n\r\n\tregisterColumnField(col){\r\n\t\tif(col.definition.field){\r\n\t\t\tthis.columnsByField[col.definition.field] = col;\r\n\t\t}\r\n\t}\r\n\r\n\tregisterColumnPosition(col){\r\n\t\tthis.columnsByIndex.push(col);\r\n\t}\r\n\r\n\t_reIndexColumns(){\r\n\t\tthis.columnsByIndex = [];\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.reRegisterPosition();\r\n\t\t});\r\n\t}\r\n\r\n\t//ensure column headers take up the correct amount of space in column groups\r\n\tverticalAlignHeaders(){\r\n\t\tvar minHeight = 0;\r\n\r\n\t\tthis.columns.forEach((column) => {\r\n\t\t\tvar height;\r\n\r\n\t\t\tcolumn.clearVerticalAlign();\r\n\r\n\t\t\theight = column.getHeight();\r\n\r\n\t\t\tif(height > minHeight){\r\n\t\t\t\tminHeight = height;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.columns.forEach((column) => {\r\n\t\t\tcolumn.verticalAlign(this.table.options.columnHeaderVertAlign, minHeight);\r\n\t\t});\r\n\r\n\t\tthis.table.rowManager.adjustTableSize();\r\n\t}\r\n\r\n\t//////////////// Column Details /////////////////\r\n\tfindColumn(subject){\r\n\t\tif(typeof subject == \"object\"){\r\n\r\n\t\t\tif(subject instanceof Column){\r\n\t\t\t\t//subject is column element\r\n\t\t\t\treturn subject;\r\n\t\t\t}else if(subject instanceof ColumnComponent){\r\n\t\t\t\t//subject is public column component\r\n\t\t\t\treturn subject._getSelf() || false;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\t\t\t\t//subject is a HTML element of the column header\r\n\t\t\t\tlet match = this.columns.find((column) => {\r\n\t\t\t\t\treturn column.element === subject;\r\n\t\t\t\t});\r\n\r\n\t\t\t\treturn match || false;\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the field name of the column\r\n\t\t\treturn this.columnsByField[subject] || false;\r\n\t\t}\r\n\r\n\t\t//catch all for any other type of input\r\n\t\treturn false;\r\n\t}\r\n\r\n\tgetColumnByField(field){\r\n\t\treturn this.columnsByField[field];\r\n\t}\r\n\r\n\tgetColumnsByFieldRoot(root){\r\n\t\tvar matches = [];\r\n\r\n\t\tObject.keys(this.columnsByField).forEach((field) => {\r\n\t\t\tvar fieldRoot = field.split(\".\")[0];\r\n\t\t\tif(fieldRoot === root){\r\n\t\t\t\tmatches.push(this.columnsByField[field]);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn matches;\r\n\t}\r\n\r\n\tgetColumnByIndex(index){\r\n\t\treturn this.columnsByIndex[index];\r\n\t}\r\n\r\n\tgetFirstVisibleColumn(index){\r\n\t\tvar index = this.columnsByIndex.findIndex((col) => {\r\n\t\t\treturn col.visible;\r\n\t\t});\r\n\r\n\t\treturn index > -1 ? this.columnsByIndex[index] : false;\r\n\t}\r\n\r\n\tgetColumns(){\r\n\t\treturn this.columns;\r\n\t}\r\n\r\n\tfindColumnIndex(column){\r\n\t\treturn this.columnsByIndex.findIndex((col) => {\r\n\t\t\treturn column === col;\r\n\t\t});\r\n\t}\r\n\r\n\t//return all columns that are not groups\r\n\tgetRealColumns(){\r\n\t\treturn this.columnsByIndex;\r\n\t}\r\n\r\n\t//travers across columns and call action\r\n\ttraverse(callback){\r\n\t\tthis.columnsByIndex.forEach((column,i) =>{\r\n\t\t\tcallback(column, i);\r\n\t\t});\r\n\t}\r\n\r\n\t//get defintions of actual columns\r\n\tgetDefinitions(active){\r\n\t\tvar output = [];\r\n\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tif(!active || (active && column.visible)){\r\n\t\t\t\toutput.push(column.getDefinition());\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//get full nested definition tree\r\n\tgetDefinitionTree(){\r\n\t\tvar output = [];\r\n\r\n\t\tthis.columns.forEach((column) => {\r\n\t\t\toutput.push(column.getDefinition(true));\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetComponents(structured){\r\n\t\tvar output = [],\r\n\t\tcolumns = structured ? this.columns : this.columnsByIndex;\r\n\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\toutput.push(column.getComponent());\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\tvar width = 0;\r\n\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tif(column.visible){\r\n\t\t\t\twidth += column.getWidth();\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn width;\r\n\t}\r\n\r\n\tmoveColumn(from, to, after){\r\n\t\tthis.moveColumnActual(from, to, after);\r\n\r\n\t\tto.element.parentNode.insertBefore(from.element, to.element);\r\n\r\n\t\tif(after){\r\n\t\t\tto.element.parentNode.insertBefore(to.element, from.element);\r\n\t\t}\r\n\r\n\t\tthis.verticalAlignHeaders();\r\n\r\n\t\tthis.table.rowManager.reinitialize();\r\n\t}\r\n\r\n\tmoveColumnActual(from, to, after){\r\n\t\tif(from.parent.isGroup){\r\n\t\t\tthis._moveColumnInArray(from.parent.columns, from, to, after);\r\n\t\t}else{\r\n\t\t\tthis._moveColumnInArray(this.columns, from, to, after);\r\n\t\t}\r\n\r\n\t\tthis._moveColumnInArray(this.columnsByIndex, from, to, after, true);\r\n\r\n\t\tthis.renderer.rerenderColumns(true);\r\n\r\n\t\tthis.dispatch(\"column-moved\", from, to, after);\r\n\r\n\t\tif(this.subscribedExternal(\"columnMoved\")){\r\n\t\t\tthis.dispatchExternal(\"columnMoved\", from.getComponent(), this.table.columnManager.getComponents());\r\n\t\t}\r\n\t}\r\n\r\n\t_moveColumnInArray(columns, from, to, after, updateRows){\r\n\t\tvar\tfromIndex = columns.indexOf(from),\r\n\t\ttoIndex, rows = [];\r\n\r\n\t\tif (fromIndex > -1) {\r\n\r\n\t\t\tcolumns.splice(fromIndex, 1);\r\n\r\n\t\t\ttoIndex = columns.indexOf(to);\r\n\r\n\t\t\tif (toIndex > -1) {\r\n\r\n\t\t\t\tif(after){\r\n\t\t\t\t\ttoIndex = toIndex+1;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\ttoIndex = fromIndex;\r\n\t\t\t}\r\n\r\n\t\t\tcolumns.splice(toIndex, 0, from);\r\n\r\n\t\t\tif(updateRows){\r\n\r\n\t\t\t\trows = this.chain(\"column-moving-rows\", [from, to, after], null, []) || [];\r\n\r\n\t\t\t\trows = rows.concat(this.table.rowManager.rows);\r\n\r\n\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\tif(row.cells.length){\r\n\t\t\t\t\t\tvar cell = row.cells.splice(fromIndex, 1)[0];\r\n\t\t\t\t\t\trow.cells.splice(toIndex, 0, cell);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tscrollToColumn(column, position, ifVisible){\r\n\t\tvar left = 0,\r\n\t\toffset = 0,\r\n\t\tadjust = 0,\r\n\t\tcolEl = column.getElement();\r\n\r\n\t\treturn new Promise((resolve, reject) => {\r\n\r\n\t\t\tif(typeof position === \"undefined\"){\r\n\t\t\t\tposition = this.table.options.scrollToColumnPosition;\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof ifVisible === \"undefined\"){\r\n\t\t\t\tifVisible = this.table.options.scrollToColumnIfVisible;\r\n\t\t\t}\r\n\r\n\t\t\tif(column.visible){\r\n\r\n\t\t\t\t//align to correct position\r\n\t\t\t\tswitch(position){\r\n\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\tcase \"center\":\r\n\t\t\t\t\tadjust = -this.element.clientWidth / 2;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"right\":\r\n\t\t\t\t\tadjust = colEl.clientWidth - this.headersElement.clientWidth;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//check column visibility\r\n\t\t\t\tif(!ifVisible){\r\n\r\n\t\t\t\t\toffset = colEl.offsetLeft;\r\n\r\n\t\t\t\t\tif(offset > 0 && offset + colEl.offsetWidth < this.element.clientWidth){\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//calculate scroll position\r\n\t\t\t\tleft = colEl.offsetLeft + adjust;\r\n\r\n\t\t\t\tleft = Math.max(Math.min(left, this.table.rowManager.element.scrollWidth - this.table.rowManager.element.clientWidth),0);\r\n\r\n\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\tthis.scrollHorizontal(left);\r\n\r\n\t\t\t\tresolve();\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - Column not visible\");\r\n\t\t\t\treject(\"Scroll Error - Column not visible\");\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t}\r\n\r\n\t//////////////// Cell Management /////////////////\r\n\tgenerateCells(row){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tcells.push(column.generateCell(row));\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\t//////////////// Column Management /////////////////\r\n\tgetFlexBaseWidth(){\r\n\t\tvar totalWidth = this.table.element.clientWidth, //table element width\r\n\t\tfixedWidth = 0;\r\n\r\n\t\t//adjust for vertical scrollbar if present\r\n\t\tif(this.table.rowManager.element.scrollHeight > this.table.rowManager.element.clientHeight){\r\n\t\t\ttotalWidth -= this.table.rowManager.element.offsetWidth - this.table.rowManager.element.clientWidth;\r\n\t\t}\r\n\r\n\t\tthis.columnsByIndex.forEach(function(column){\r\n\t\t\tvar width, minWidth, colWidth;\r\n\r\n\t\t\tif(column.visible){\r\n\r\n\t\t\t\twidth = column.definition.width || 0;\r\n\r\n\t\t\t\tminWidth = parseInt(column.minWidth);\r\n\r\n\t\t\t\tif(typeof(width) == \"string\"){\r\n\t\t\t\t\tif(width.indexOf(\"%\") > -1){\r\n\t\t\t\t\t\tcolWidth = (totalWidth / 100) * parseInt(width) ;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tcolWidth = parseInt(width);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolWidth = width;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfixedWidth += colWidth > minWidth ? colWidth : minWidth;\r\n\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn fixedWidth;\r\n\t}\r\n\r\n\taddColumn(definition, before, nextToColumn){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar column = this._addColumn(definition, before, nextToColumn);\r\n\r\n\t\t\tthis._reIndexColumns();\r\n\r\n\t\t\tthis.dispatch(\"column-add\", definition, before, nextToColumn);\r\n\r\n\t\t\tif(this.layoutMode() != \"fitColumns\"){\r\n\t\t\t\tcolumn.reinitializeWidth();\r\n\t\t\t}\r\n\r\n\t\t\tthis.redraw(true);\r\n\r\n\t\t\tthis.table.rowManager.reinitialize();\r\n\r\n\t\t\tthis.renderer.rerenderColumns();\r\n\r\n\t\t\tresolve(column);\r\n\t\t});\r\n\t}\r\n\r\n\t//remove column from system\r\n\tderegisterColumn(column){\r\n\t\tvar field = column.getField(),\r\n\t\tindex;\r\n\r\n\t\t//remove from field list\r\n\t\tif(field){\r\n\t\t\tdelete this.columnsByField[field];\r\n\t\t}\r\n\r\n\t\t//remove from index list\r\n\t\tindex = this.columnsByIndex.indexOf(column);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.columnsByIndex.splice(index, 1);\r\n\t\t}\r\n\r\n\t\t//remove from column list\r\n\t\tindex = this.columns.indexOf(column);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.columns.splice(index, 1);\r\n\t\t}\r\n\r\n\t\tthis.verticalAlignHeaders();\r\n\r\n\t\tthis.redraw();\r\n\t}\r\n\r\n\t//redraw columns\r\n\tredraw(force){\r\n\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\tthis.verticalAlignHeaders();\r\n\t\t}\r\n\r\n\t\tif(force){\r\n\t\t\tthis.table.rowManager.resetScroll();\r\n\t\t\tthis.table.rowManager.reinitialize();\r\n\t\t}\r\n\r\n\t\tif(!this.confirm(\"table-redrawing\", force)){\r\n\t\t\tthis.layoutRefresh();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"table-redraw\", force);\r\n\r\n\t\tthis.table.footerManager.redraw();\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class BaiscVertical extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.verticalFillMode = \"fill\";\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t}\r\n\r\n\tclearRows(){\r\n\t\tvar element = this.tableElement;\r\n\r\n\t\t// element.children.detach();\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\telement.scrollTop = 0;\r\n\t\telement.scrollLeft = 0;\r\n\r\n\t\telement.style.minWidth = \"\";\r\n\t\telement.style.minHeight = \"\";\r\n\t\telement.style.display = \"\";\r\n\t\telement.style.visibility = \"\";\r\n\t}\r\n\r\n\trenderRows(){\r\n\t\tvar element = this.tableElement,\r\n\t\tonlyGroupHeaders = true;\r\n\r\n\t\tthis.rows().forEach((row, index) => {\r\n\t\t\tthis.styleRow(row, index);\r\n\t\t\telement.appendChild(row.getElement());\r\n\t\t\trow.initialize(true);\r\n\r\n\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\tonlyGroupHeaders = false;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(onlyGroupHeaders){\r\n\t\t\telement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t}else{\r\n\t\t\telement.style.minWidth = \"\";\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trerenderRows(callback){\r\n\t\tthis.clearRows();\r\n\t\tthis.renderRows();\r\n\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\tvar rowTop = Helpers.elOffset(row.getElement()).top;\r\n\r\n\t\treturn !(Math.abs(this.elementVertical.scrollTop - rowTop) > Math.abs(this.elementVertical.scrollTop + this.elementVertical.clientHeight - rowTop));\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tthis.elementVertical.scrollTop = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top + this.elementVertical.scrollTop;\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\treturn this.rows();\r\n\t}\r\n\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class VirtualDomVertical extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.verticalFillMode = \"fill\";\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.vDomRowHeight = 20; //approximation of row heights for padding\r\n\r\n\t\tthis.vDomTop = 0; //hold position for first rendered row in the virtual DOM\r\n\t\tthis.vDomBottom = 0; //hold possition for last rendered row in the virtual DOM\r\n\r\n\t\tthis.vDomScrollPosTop = 0; //last scroll position of the vDom top;\r\n\t\tthis.vDomScrollPosBottom = 0; //last scroll position of the vDom bottom;\r\n\r\n\t\tthis.vDomTopPad = 0; //hold value of padding for top of virtual DOM\r\n\t\tthis.vDomBottomPad = 0; //hold value of padding for bottom of virtual DOM\r\n\r\n\t\tthis.vDomMaxRenderChain = 90; //the maximum number of dom elements that can be rendered in 1 go\r\n\r\n\t\tthis.vDomWindowBuffer = 0; //window row buffer before removing elements, to smooth scrolling\r\n\r\n\t\tthis.vDomWindowMinTotalRows = 20; //minimum number of rows to be generated in virtual dom (prevent buffering issues on tables with tall rows)\r\n\t\tthis.vDomWindowMinMarginRows = 5; //minimum number of rows to be generated in virtual dom margin\r\n\r\n\t\tthis.vDomTopNewRows = []; //rows to normalize after appending to optimize render speed\r\n\t\tthis.vDomBottomNewRows = []; //rows to normalize after appending to optimize render speed\r\n\t}\r\n\r\n\t//////////////////////////////////////\r\n\t///////// Public Functions ///////////\r\n\t//////////////////////////////////////\r\n\r\n\tclearRows(){\r\n\t\tvar element = this.tableElement;\r\n\r\n\t\t// element.children.detach();\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\telement.style.paddingTop = \"\";\r\n\t\telement.style.paddingBottom = \"\";\r\n\t\t// element.style.minWidth = \"\";\r\n\t\telement.style.minHeight = \"\";\r\n\t\telement.style.display = \"\";\r\n\t\telement.style.visibility = \"\";\r\n\r\n\t\tthis.elementVertical.scrollTop = 0;\r\n\t\tthis.elementVertical.scrollLeft = 0;\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.vDomTop = 0;\r\n\t\tthis.vDomBottom = 0;\r\n\t\tthis.vDomTopPad = 0;\r\n\t\tthis.vDomBottomPad = 0;\r\n\t\tthis.vDomScrollPosTop = 0;\r\n\t\tthis.vDomScrollPosBottom = 0;\r\n\t}\r\n\r\n\trenderRows(){\r\n\t\tthis._virtualRenderFill();\r\n\t}\r\n\r\n\trerenderRows(callback){\r\n\t\tvar scrollTop = this.elementVertical.scrollTop;\r\n\t\tvar topRow = false;\r\n\t\tvar topOffset = false;\r\n\r\n\t\tvar left = this.table.rowManager.scrollLeft;\r\n\r\n\t\tvar rows = this.rows();\r\n\r\n\t\tfor(var i = this.vDomTop; i <= this.vDomBottom; i++){\r\n\r\n\t\t\tif(rows[i]){\r\n\t\t\t\tvar diff = scrollTop - rows[i].getElement().offsetTop;\r\n\r\n\t\t\t\tif(topOffset === false || Math.abs(diff) < topOffset){\r\n\t\t\t\t\ttopOffset = diff;\r\n\t\t\t\t\ttopRow = i;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\trows.forEach((row) => {\r\n\t\t\trow.deinitializeHeight();\r\n\t\t});\r\n\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\r\n\t\tthis._virtualRenderFill((topRow === false ? this.rows.length - 1 : topRow), true, topOffset || 0);\r\n\r\n\t\tthis.scrollColumns(left);\r\n\t}\r\n\r\n\tscrollColumns(left){\r\n\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t}\r\n\r\n\tscrollRows(top, dir){\r\n\t\tvar topDiff = top - this.vDomScrollPosTop;\r\n\t\tvar bottomDiff = top - this.vDomScrollPosBottom;\r\n\t\tvar margin = this.vDomWindowBuffer * 2;\r\n\t\tvar rows = this.rows();\r\n\r\n\t\tthis.scrollTop = top;\r\n\r\n\t\tif(-topDiff > margin || bottomDiff > margin){\r\n\t\t\t//if big scroll redraw table;\r\n\t\t\tvar left = this.table.rowManager.scrollLeft;\r\n\t\t\tthis._virtualRenderFill(Math.floor((this.elementVertical.scrollTop / this.elementVertical.scrollHeight) * rows.length));\r\n\t\t\tthis.scrollColumns(left);\r\n\t\t}else{\r\n\r\n\t\t\tif(dir){\r\n\t\t\t\t//scrolling up\r\n\t\t\t\tif(topDiff < 0){\r\n\t\t\t\t\tthis._addTopRow(rows, -topDiff);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(bottomDiff < 0){\r\n\t\t\t\t\t//hide bottom row if needed\r\n\t\t\t\t\tif(this.vDomScrollHeight - this.scrollTop > this.vDomWindowBuffer){\r\n\t\t\t\t\t\tthis._removeBottomRow(rows, -bottomDiff);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomScrollPosBottom = this.scrollTop;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\r\n\t\t\t\tif(bottomDiff >= 0){\r\n\t\t\t\t\tthis._addBottomRow(rows, bottomDiff);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//scrolling down\r\n\t\t\t\tif(topDiff >= 0){\r\n\t\t\t\t\t//hide top row if needed\r\n\t\t\t\t\tif(this.scrollTop > this.vDomWindowBuffer){\r\n\t\t\t\t\t\tthis._removeTopRow(rows, topDiff);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomScrollPosTop = this.scrollTop;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tresize(){\r\n\t\tthis.vDomWindowBuffer = this.table.options.renderVerticalBuffer || this.elementVertical.clientHeight;\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\tvar rowIndex = this.rows().indexOf(row);\r\n\r\n\t\treturn !(Math.abs(this.vDomTop - rowIndex) > Math.abs(this.vDomBottom - rowIndex));\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\tvar index = this.rows().indexOf(row);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis._virtualRenderFill(index, true);\r\n\t\t}\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\tvar topEdge = this.elementVertical.scrollTop,\r\n\t\tbottomEdge = this.elementVertical.clientHeight + topEdge,\r\n\t\ttopFound = false,\r\n\t\ttopRow = 0,\r\n\t\tbottomRow = 0,\r\n\t\trows = this.rows();\r\n\r\n\t\tif(includingBuffer){\r\n\t\t\ttopRow = this.vDomTop;\r\n\t\t\tbottomRow = this.vDomBottom;\r\n\t\t}else{\r\n\t\t\tfor(var i = this.vDomTop; i <= this.vDomBottom; i++){\r\n\t\t\t\tif(rows[i]){\r\n\t\t\t\t\tif(!topFound){\r\n\t\t\t\t\t\tif((topEdge - rows[i].getElement().offsetTop) >= 0){\r\n\t\t\t\t\t\t\ttopRow = i;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\ttopFound = true;\r\n\r\n\t\t\t\t\t\t\tif(bottomEdge - rows[i].getElement().offsetTop >= 0){\r\n\t\t\t\t\t\t\t\tbottomRow = i;\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(bottomEdge - rows[i].getElement().offsetTop >= 0){\r\n\t\t\t\t\t\t\tbottomRow = i;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn rows.slice(topRow, bottomRow + 1);\r\n\t}\r\n\r\n\t//////////////////////////////////////\r\n\t//////// Internal Rendering //////////\r\n\t//////////////////////////////////////\r\n\r\n\t//full virtual render\r\n\t_virtualRenderFill(position, forceMove, offset){\r\n\t\tvar\telement = this.tableElement,\r\n\t\tholder = this.elementVertical,\r\n\t\ttopPad = 0,\r\n\t\trowsHeight = 0,\r\n\t\theightOccupied = 0,\r\n\t\ttopPadHeight = 0,\r\n\t\ti = 0,\r\n\t\trows = this.rows(),\r\n\t\trowsCount = rows.length,\r\n\t\tcontainerHeight = this.elementVertical.clientHeight;\r\n\r\n\t\tposition = position || 0;\r\n\r\n\t\toffset = offset || 0;\r\n\r\n\t\tif(!position){\r\n\t\t\tthis.clear();\r\n\t\t}else{\r\n\t\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\t\t//check if position is too close to bottom of table\r\n\t\t\theightOccupied = (rowsCount - position + 1) * this.vDomRowHeight;\r\n\r\n\t\t\tif(heightOccupied < containerHeight){\r\n\t\t\t\tposition -= Math.ceil((containerHeight - heightOccupied) / this.vDomRowHeight);\r\n\t\t\t\tif(position < 0){\r\n\t\t\t\t\tposition = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//calculate initial pad\r\n\t\t\ttopPad = Math.min(Math.max(Math.floor(this.vDomWindowBuffer / this.vDomRowHeight), this.vDomWindowMinMarginRows), position);\r\n\t\t\tposition -= topPad;\r\n\t\t}\r\n\r\n\t\tif(rowsCount && Helpers.elVisible(this.elementVertical)){\r\n\t\t\tthis.vDomTop = position;\r\n\r\n\t\t\tthis.vDomBottom = position -1;\r\n\r\n\t\t\twhile ((rowsHeight <= containerHeight + this.vDomWindowBuffer || i < this.vDomWindowMinTotalRows) && this.vDomBottom < rowsCount -1){\r\n\t\t\t\tvar index = this.vDomBottom + 1,\r\n\t\t\t\trow = rows[index],\r\n\t\t\t\trowHeight = 0;\r\n\r\n\t\t\t\tthis.styleRow(row, index);\r\n\r\n\t\t\t\telement.appendChild(row.getElement());\r\n\r\n\t\t\t\trow.initialize();\r\n\r\n\t\t\t\tif(!row.heightInitialized){\r\n\t\t\t\t\trow.normalizeHeight(true);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowHeight = row.getHeight();\r\n\r\n\t\t\t\tif(i < topPad){\r\n\t\t\t\t\ttopPadHeight += rowHeight;\r\n\t\t\t\t}else{\r\n\t\t\t\t\trowsHeight += rowHeight;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.vDomBottom ++;\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\r\n\t\t\tif(!position){\r\n\t\t\t\tthis.vDomTopPad = 0;\r\n\t\t\t\t//adjust rowheight to match average of rendered elements\r\n\t\t\t\tthis.vDomRowHeight = Math.floor((rowsHeight + topPadHeight) / i);\r\n\t\t\t\tthis.vDomBottomPad = this.vDomRowHeight * (rowsCount - this.vDomBottom -1);\r\n\r\n\t\t\t\tthis.vDomScrollHeight = topPadHeight + rowsHeight + this.vDomBottomPad - containerHeight;\r\n\t\t\t}else{\r\n\t\t\t\tthis.vDomTopPad = !forceMove ? this.scrollTop - topPadHeight : (this.vDomRowHeight * this.vDomTop) + offset;\r\n\t\t\t\tthis.vDomBottomPad = this.vDomBottom == rowsCount-1 ? 0 : Math.max(this.vDomScrollHeight - this.vDomTopPad - rowsHeight - topPadHeight, 0);\r\n\t\t\t}\r\n\r\n\t\t\telement.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\telement.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\r\n\t\t\tif(forceMove){\r\n\t\t\t\tthis.scrollTop = this.vDomTopPad + (topPadHeight) + offset - (this.elementVertical.scrollWidth > this.elementVertical.clientWidth ? this.elementVertical.offsetHeight - containerHeight : 0);\r\n\t\t\t}\r\n\r\n\t\t\tthis.scrollTop = Math.min(this.scrollTop, this.elementVertical.scrollHeight - containerHeight);\r\n\r\n\t\t\t//adjust for horizontal scrollbar if present (and not at top of table)\r\n\t\t\tif(this.elementVertical.scrollWidth > this.elementVertical.offsetWidth && forceMove){\r\n\t\t\t\tthis.scrollTop += this.elementVertical.offsetHeight - containerHeight;\r\n\t\t\t}\r\n\r\n\t\t\tthis.vDomScrollPosTop = this.scrollTop;\r\n\t\t\tthis.vDomScrollPosBottom = this.scrollTop;\r\n\r\n\t\t\tholder.scrollTop = this.scrollTop;\r\n\r\n\t\t\tthis.dispatch(\"render-virtual-fill\");\r\n\t\t}\r\n\t}\r\n\r\n\t_addTopRow(rows, fillableSpace){\r\n\t\tvar table = this.tableElement,\r\n\t\taddedRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\tindex = this.vDomTop -1,\r\n\t\ti = 0;\r\n\r\n\t\twhile(true){\r\n\t\t\tif(this.vDomTop){\r\n\t\t\t\tlet row = rows[index],\r\n\t\t\t\trowHeight, initialized;\r\n\r\n\t\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\t\t\t\t\tinitialized = row.initialized;\r\n\r\n\t\t\t\t\tif(fillableSpace >= rowHeight){\r\n\r\n\t\t\t\t\t\tthis.styleRow(row, index);\r\n\t\t\t\t\t\ttable.insertBefore(row.getElement(), table.firstChild);\r\n\r\n\t\t\t\t\t\tif(!row.initialized || !row.heightInitialized){\r\n\t\t\t\t\t\t\taddedRows.push(row);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\trow.initialize();\r\n\r\n\t\t\t\t\t\tif(!initialized){\r\n\t\t\t\t\t\t\trowHeight = row.getElement().offsetHeight;\r\n\r\n\t\t\t\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\t\tthis.vDomTop--;\r\n\t\t\t\t\t\tindex--;\r\n\t\t\t\t\t\ti++;\r\n\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of addedRows){\r\n\t\t\trow.clearCellHeight();\r\n\t\t}\r\n\r\n\t\tthis._quickNormalizeRowHeight(addedRows);\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomTopPad -= paddingAdjust;\r\n\r\n\t\t\tif(this.vDomTopPad < 0){\r\n\t\t\t\tthis.vDomTopPad = index * this.vDomRowHeight;\r\n\t\t\t}\r\n\r\n\t\t\tif(index < 1){\r\n\t\t\t\tthis.vDomTopPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\ttable.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\tthis.vDomScrollPosTop -= paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_removeTopRow(rows, fillableSpace){\r\n\t\tvar removableRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\ti = 0;\r\n\r\n\t\twhile(true){\r\n\t\t\tlet row = rows[this.vDomTop],\r\n\t\t\trowHeight, diff;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\t\t\t\t\tthis.vDomTop++;\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tremovableRows.push(row);\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of removableRows){\r\n\t\t\tlet rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomTopPad += paddingAdjust;\r\n\t\t\tthis.tableElement.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\tthis.vDomScrollPosTop += this.vDomTop ? paddingAdjust : paddingAdjust + this.vDomWindowBuffer;\r\n\t\t}\r\n\t}\r\n\r\n\t_addBottomRow(rows, fillableSpace){\r\n\t\tvar table = this.tableElement,\r\n\t\taddedRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\tindex = this.vDomBottom + 1,\r\n\t\ti = 0;\r\n\r\n\t\twhile(true){\r\n\t\t\tlet row = rows[index],\r\n\t\t\trowHeight, initialized;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\t\t\t\tinitialized = row.initialized;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\r\n\t\t\t\t\tthis.styleRow(row, index);\r\n\t\t\t\t\ttable.appendChild(row.getElement());\r\n\r\n\t\t\t\t\tif(!row.initialized || !row.heightInitialized){\r\n\t\t\t\t\t\taddedRows.push(row);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\trow.initialize();\r\n\r\n\t\t\t\t\tif(!initialized){\r\n\t\t\t\t\t\trowHeight = row.getElement().offsetHeight;\r\n\r\n\t\t\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tthis.vDomBottom++;\r\n\t\t\t\t\tindex++;\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of addedRows){\r\n\t\t\trow.clearCellHeight();\r\n\t\t}\r\n\r\n\t\tthis._quickNormalizeRowHeight(addedRows);\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomBottomPad -= paddingAdjust;\r\n\r\n\t\t\tif(this.vDomBottomPad < 0 || index == rows.length -1){\r\n\t\t\t\tthis.vDomBottomPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\ttable.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\t\t\tthis.vDomScrollPosBottom += paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_removeBottomRow(rows, fillableSpace){\r\n\t\tvar removableRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\ti = 0;\r\n\r\n\t\twhile(true){\r\n\t\t\tlet row = rows[this.vDomBottom],\r\n\t\t\trowHeight, diff;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\t\t\t\t\tthis.vDomBottom --;\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tremovableRows.push(row);\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of removableRows){\r\n\t\t\tlet rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomBottomPad += paddingAdjust;\r\n\r\n\t\t\tif(this.vDomBottomPad < 0){\r\n\t\t\t\tthis.vDomBottomPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\tthis.tableElement.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\t\t\tthis.vDomScrollPosBottom -= paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_quickNormalizeRowHeight(rows){\r\n\t\tfor(let row of rows){\r\n\t\t\trow.calcHeight();\r\n\t\t}\r\n\r\n\t\tfor(let row of rows){\r\n\t\t\trow.setCellHeight();\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Row from './row/Row.js';\r\nimport RowComponent from './row/RowComponent.js';\r\nimport Helpers from './tools/Helpers.js';\r\n\r\nimport RendererBasicVertical from './rendering/renderers/BasicVertical.js';\r\nimport RendererVirtualDomVertical from './rendering/renderers/VirtualDomVertical.js';\r\n\r\nexport default class RowManager extends CoreFeature{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.element = this.createHolderElement(); //containing element\r\n\t\tthis.tableElement = this.createTableElement(); //table element\r\n\t\tthis.heightFixer = this.createTableElement(); //table element\r\n\t\tthis.placeholder = null; //placeholder element\r\n\t\tthis.placeholderContents = null; //placeholder element\r\n\t\t\r\n\t\tthis.firstRender = false; //handle first render\r\n\t\tthis.renderMode = \"virtual\"; //current rendering mode\r\n\t\tthis.fixedHeight = false; //current rendering mode\r\n\t\t\r\n\t\tthis.rows = []; //hold row data objects\r\n\t\tthis.activeRowsPipeline = []; //hold calculation of active rows\r\n\t\tthis.activeRows = []; //rows currently available to on display in the table\r\n\t\tthis.activeRowsCount = 0; //count of active rows\r\n\t\t\r\n\t\tthis.displayRows = []; //rows currently on display in the table\r\n\t\tthis.displayRowsCount = 0; //count of display rows\r\n\t\t\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.rowNumColumn = false; //hold column component for row number column\r\n\t\t\r\n\t\tthis.redrawBlock = false; //prevent redraws to allow multiple data manipulations before continuing\r\n\t\tthis.redrawBlockRestoreConfig = false; //store latest redraw function calls for when redraw is needed\r\n\t\tthis.redrawBlockRenderInPosition = false; //store latest redraw function calls for when redraw is needed\r\n\t\t\r\n\t\tthis.dataPipeline = []; //hold data pipeline tasks\r\n\t\tthis.displayPipeline = []; //hold data display pipeline tasks\r\n\t\t\r\n\t\tthis.renderer = null;\r\n\t}\r\n\t\r\n\t//////////////// Setup Functions /////////////////\r\n\t\r\n\tcreateHolderElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-tableholder\");\r\n\t\tel.setAttribute(\"tabindex\", 0);\r\n\t\t// el.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tcreateTableElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-table\");\r\n\t\tel.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tinitializePlaceholder(){\r\n\t\t//configure placeholder element\r\n\t\tif(typeof this.table.options.placeholder == \"string\"){\r\n\t\t\tlet el = document.createElement(\"div\");\r\n\t\t\tel.classList.add(\"tabulator-placeholder\");\r\n\t\t\t\r\n\t\t\tlet contents = document.createElement(\"div\");\r\n\t\t\tcontents.classList.add(\"tabulator-placeholder-contents\");\r\n\t\t\tcontents.innerHTML = this.table.options.placeholder;\r\n\t\t\t\r\n\t\t\tel.appendChild(contents);\r\n\t\t\t\r\n\t\t\tthis.placeholderContents = contents;\r\n\t\t\tthis.placeholder = el;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return containing element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\t//return table element\r\n\tgetTableElement(){\r\n\t\treturn this.tableElement;\r\n\t}\r\n\t\r\n\t//return position of row in table\r\n\tgetRowPosition(row, active){\r\n\t\tif(active){\r\n\t\t\treturn this.activeRows.indexOf(row);\r\n\t\t}else{\r\n\t\t\treturn this.rows.indexOf(row);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.initializePlaceholder()\r\n\t\tthis.initializeRenderer();\r\n\t\t\r\n\t\t//initialize manager\r\n\t\tthis.element.appendChild(this.tableElement);\r\n\t\t\r\n\t\tthis.firstRender = true;\r\n\t\t\r\n\t\t//scroll header along with table body\r\n\t\tthis.element.addEventListener(\"scroll\", () => {\r\n\t\t\tvar left = this.element.scrollLeft,\r\n\t\t\tleftDir = this.scrollLeft > left,\r\n\t\t\ttop = this.element.scrollTop,\r\n\t\t\ttopDir = this.scrollTop > top;\r\n\t\t\t\r\n\t\t\t//handle horizontal scrolling\r\n\t\t\tif(this.scrollLeft != left){\r\n\t\t\t\tthis.scrollLeft = left;\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"scroll-horizontal\", left, leftDir);\r\n\t\t\t\tthis.dispatchExternal(\"scrollHorizontal\", left, leftDir);\r\n\r\n\t\t\t\tthis._positionPlaceholder();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//handle vertical scrolling\r\n\t\t\tif(this.scrollTop != top){\r\n\t\t\t\tthis.scrollTop = top;\r\n\t\t\t\t\r\n\t\t\t\tthis.renderer.scrollRows(top, topDir);\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"scroll-vertical\", top, topDir);\r\n\t\t\t\tthis.dispatchExternal(\"scrollVertical\", top, topDir);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t////////////////// Row Manipulation //////////////////\r\n\tfindRow(subject){\r\n\t\tif(typeof subject == \"object\"){\r\n\t\t\tif(subject instanceof Row){\r\n\t\t\t\t//subject is row element\r\n\t\t\t\treturn subject;\r\n\t\t\t}else if(subject instanceof RowComponent){\r\n\t\t\t\t//subject is public row component\r\n\t\t\t\treturn subject._getSelf() || false;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\t\t\t\t//subject is a HTML element of the row\r\n\t\t\t\tlet match = this.rows.find((row) => {\r\n\t\t\t\t\treturn row.getElement() === subject;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\treturn match || false;\r\n\t\t\t}\r\n\t\t}else if(typeof subject == \"undefined\" || subject === null){\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the index of the row\r\n\t\t\tlet match = this.rows.find((row) => {\r\n\t\t\t\treturn row.data[this.table.options.index] == subject;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\treturn match || false;\r\n\t\t}\r\n\t\t\r\n\t\t//catch all for any other type of input\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tgetRowFromDataObject(data){\r\n\t\tvar match = this.rows.find((row) => {\r\n\t\t\treturn row.data === data;\r\n\t\t});\r\n\t\t\r\n\t\treturn match || false;\r\n\t}\r\n\t\r\n\tgetRowFromPosition(position, active){\r\n\t\tif(active){\r\n\t\t\treturn this.activeRows[position];\r\n\t\t}else{\r\n\t\t\treturn this.rows[position];\r\n\t\t}\r\n\t}\r\n\t\r\n\tscrollToRow(row, position, ifVisible){\r\n\t\treturn this.renderer.scrollToRowPosition(row, position, ifVisible);\r\n\t}\r\n\t\r\n\t////////////////// Data Handling //////////////////\r\n\tsetData(data, renderInPosition, columnsChanged){\r\n\t\treturn new Promise((resolve, reject)=>{\r\n\t\t\tif(renderInPosition && this.getDisplayRows().length){\r\n\t\t\t\tif(this.table.options.pagination){\r\n\t\t\t\t\tthis._setDataActual(data, true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.reRenderInPosition(() => {\r\n\t\t\t\t\t\tthis._setDataActual(data);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.options.autoColumns && columnsChanged && this.table.initialized){\r\n\t\t\t\t\tthis.table.columnManager.generateColumnsFromRowData(data);\r\n\t\t\t\t}\r\n\t\t\t\tthis.resetScroll();\r\n\t\t\t\t\r\n\t\t\t\tthis._setDataActual(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\t\r\n\t_setDataActual(data, renderInPosition){\r\n\t\tthis.dispatchExternal(\"dataProcessing\", data);\r\n\t\t\r\n\t\tthis._wipeElements();\r\n\t\t\r\n\t\tif(Array.isArray(data)){\r\n\t\t\tthis.dispatch(\"data-processing\", data);\r\n\t\t\t\r\n\t\t\tdata.forEach((def, i) => {\r\n\t\t\t\tif(def && typeof def === \"object\"){\r\n\t\t\t\t\tvar row = new Row(def, this);\r\n\t\t\t\t\tthis.rows.push(row);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Data Loading Warning - Invalid row data detected and ignored, expecting object but received:\", def);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.refreshActiveData(false, false, renderInPosition);\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"data-processed\", data);\r\n\t\t\tthis.dispatchExternal(\"dataProcessed\", data);\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Data Loading Error - Unable to process data due to invalid data type \\nExpecting: array \\nReceived: \", typeof data, \"\\nData: \", data);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_wipeElements(){\r\n\t\tthis.dispatch(\"rows-wipe\");\r\n\t\t\r\n\t\tthis.rows.forEach((row) => {\r\n\t\t\trow.wipe();\r\n\t\t});\r\n\t\t\r\n\t\tthis.rows = [];\r\n\t\tthis.activeRows = [];\r\n\t\tthis.activeRowsPipeline = [];\r\n\t\tthis.activeRowsCount = 0;\r\n\t\tthis.displayRows = [];\r\n\t\tthis.displayRowsCount = 0;\r\n\t\t\r\n\t\tthis.adjustTableSize();\r\n\t}\r\n\t\r\n\tdeleteRow(row, blockRedraw){\r\n\t\tvar allIndex = this.rows.indexOf(row),\r\n\t\tactiveIndex = this.activeRows.indexOf(row);\r\n\t\t\r\n\t\tif(activeIndex > -1){\r\n\t\t\tthis.activeRows.splice(activeIndex, 1);\r\n\t\t}\r\n\t\t\r\n\t\tif(allIndex > -1){\r\n\t\t\tthis.rows.splice(allIndex, 1);\r\n\t\t}\r\n\t\t\r\n\t\tthis.setActiveRows(this.activeRows);\r\n\t\t\r\n\t\tthis.displayRowIterator((rows) => {\r\n\t\t\tvar displayIndex = rows.indexOf(row);\r\n\t\t\t\r\n\t\t\tif(displayIndex > -1){\r\n\t\t\t\trows.splice(displayIndex, 1);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t}\r\n\t\t\r\n\t\tthis.regenerateRowNumbers();\r\n\t\t\r\n\t\tthis.dispatchExternal(\"rowDeleted\", row.getComponent());\r\n\t\t\r\n\t\tif(!this.displayRowsCount){\r\n\t\t\tthis._showPlaceholder();\r\n\t\t}\r\n\t\t\r\n\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\tthis.dispatchExternal(\"dataChanged\", this.getData());\r\n\t\t}\r\n\t}\r\n\t\r\n\taddRow(data, pos, index, blockRedraw){\r\n\t\tvar row = this.addRowActual(data, pos, index, blockRedraw);\r\n\t\treturn row;\r\n\t}\r\n\t\r\n\t//add multiple rows\r\n\taddRows(data, pos, index){\r\n\t\tvar length = 0,\r\n\t\trows = [];\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tpos = this.findAddRowPos(pos);\r\n\t\t\t\r\n\t\t\tif(!Array.isArray(data)){\r\n\t\t\t\tdata = [data];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tlength = data.length - 1;\r\n\t\t\t\r\n\t\t\tif((typeof index == \"undefined\" && pos) || (typeof index !== \"undefined\" && !pos)){\r\n\t\t\t\tdata.reverse();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdata.forEach((item, i) => {\r\n\t\t\t\tvar row = this.addRow(item, pos, index, true);\r\n\t\t\t\trows.push(row);\r\n\t\t\t\tthis.dispatch(\"row-added\", row, data, pos, index);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.refreshActiveData(false, false, true);\r\n\t\t\t\r\n\t\t\tthis.regenerateRowNumbers();\r\n\t\t\t\r\n\t\t\tif(rows.length){\r\n\t\t\t\tthis._clearPlaceholder();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve(rows);\r\n\t\t});\r\n\t}\r\n\t\r\n\tfindAddRowPos(pos){\r\n\t\tif(typeof pos === \"undefined\"){\r\n\t\t\tpos = this.table.options.addRowPos;\r\n\t\t}\r\n\t\t\r\n\t\tif(pos === \"pos\"){\r\n\t\t\tpos = true;\r\n\t\t}\r\n\t\t\r\n\t\tif(pos === \"bottom\"){\r\n\t\t\tpos = false;\r\n\t\t}\r\n\t\t\r\n\t\treturn pos;\r\n\t}\r\n\t\r\n\taddRowActual(data, pos, index, blockRedraw){\r\n\t\tvar row = data instanceof Row ? data : new Row(data || {}, this),\r\n\t\ttop = this.findAddRowPos(pos),\r\n\t\tallIndex = -1,\r\n\t\tactiveIndex, chainResult;\r\n\t\t\r\n\t\tif(!index){\r\n\t\t\tchainResult = this.chain(\"row-adding-position\", [row, top], null, {index, top});\r\n\t\t\t\r\n\t\t\tindex = chainResult.index;\r\n\t\t\ttop = chainResult.top;\r\n\t\t}\r\n\t\t\r\n\t\tif(typeof index !== \"undefined\"){\r\n\t\t\tindex = this.findRow(index);\r\n\t\t}\r\n\t\t\r\n\t\tindex = this.chain(\"row-adding-index\", [row, index, top], null, index);\r\n\t\t\r\n\t\tif(index){\r\n\t\t\tallIndex = this.rows.indexOf(index);\r\n\t\t}\r\n\t\t\r\n\t\tif(index && allIndex > -1){\r\n\t\t\tactiveIndex = this.activeRows.indexOf(index);\r\n\t\t\t\r\n\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\tvar displayIndex = rows.indexOf(index);\r\n\t\t\t\t\r\n\t\t\t\tif(displayIndex > -1){\r\n\t\t\t\t\trows.splice((top ? displayIndex : displayIndex + 1), 0, row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(activeIndex > -1){\r\n\t\t\t\tthis.activeRows.splice((top ? activeIndex : activeIndex + 1), 0, row);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.rows.splice((top ? allIndex : allIndex + 1), 0, row);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tif(top){\r\n\t\t\t\t\r\n\t\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\t\trows.unshift(row);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.activeRows.unshift(row);\r\n\t\t\t\tthis.rows.unshift(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\t\trows.push(row);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.activeRows.push(row);\r\n\t\t\t\tthis.rows.push(row);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.setActiveRows(this.activeRows);\r\n\t\t\r\n\t\tthis.dispatchExternal(\"rowAdded\", row.getComponent());\r\n\t\t\r\n\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t}\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t}\r\n\t\t\r\n\t\treturn row;\r\n\t}\r\n\t\r\n\tmoveRow(from, to, after){\r\n\t\tthis.dispatch(\"row-move\", from, to, after);\r\n\t\t\r\n\t\tthis.moveRowActual(from, to, after);\r\n\t\t\r\n\t\tthis.regenerateRowNumbers();\r\n\t\t\r\n\t\tthis.dispatch(\"row-moved\", from, to, after);\r\n\t\tthis.dispatchExternal(\"rowMoved\", from.getComponent());\r\n\t}\r\n\t\r\n\tmoveRowActual(from, to, after){\r\n\t\tthis.moveRowInArray(this.rows, from, to, after);\r\n\t\tthis.moveRowInArray(this.activeRows, from, to, after);\r\n\t\t\r\n\t\tthis.displayRowIterator((rows) => {\r\n\t\t\tthis.moveRowInArray(rows, from, to, after);\r\n\t\t});\r\n\t\t\r\n\t\tthis.dispatch(\"row-moving\", from, to, after);\r\n\t}\r\n\t\r\n\tmoveRowInArray(rows, from, to, after){\r\n\t\tvar\tfromIndex, toIndex, start, end;\r\n\t\t\r\n\t\tif(from !== to){\r\n\t\t\t\r\n\t\t\tfromIndex = rows.indexOf(from);\r\n\t\t\t\r\n\t\t\tif (fromIndex > -1) {\r\n\t\t\t\t\r\n\t\t\t\trows.splice(fromIndex, 1);\r\n\t\t\t\t\r\n\t\t\t\ttoIndex = rows.indexOf(to);\r\n\t\t\t\t\r\n\t\t\t\tif (toIndex > -1) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(after){\r\n\t\t\t\t\t\trows.splice(toIndex+1, 0, from);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trows.splice(toIndex, 0, from);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\trows.splice(fromIndex, 0, from);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//restyle rows\r\n\t\t\tif(rows === this.getDisplayRows()){\r\n\t\t\t\t\r\n\t\t\t\tstart = fromIndex < toIndex ? fromIndex : toIndex;\r\n\t\t\t\tend = toIndex > fromIndex ? toIndex : fromIndex +1;\r\n\t\t\t\t\r\n\t\t\t\tfor(let i = start; i <= end; i++){\r\n\t\t\t\t\tif(rows[i]){\r\n\t\t\t\t\t\tthis.styleRow(rows[i], i);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearData(){\r\n\t\tthis.setData([]);\r\n\t}\r\n\t\r\n\tgetRowIndex(row){\r\n\t\treturn this.findRowIndex(row, this.rows);\r\n\t}\r\n\t\r\n\tgetDisplayRowIndex(row){\r\n\t\tvar index = this.getDisplayRows().indexOf(row);\r\n\t\treturn index > -1 ? index : false;\r\n\t}\r\n\t\r\n\tnextDisplayRow(row, rowOnly){\r\n\t\tvar index = this.getDisplayRowIndex(row),\r\n\t\tnextRow = false;\r\n\t\t\r\n\t\t\r\n\t\tif(index !== false && index < this.displayRowsCount -1){\r\n\t\t\tnextRow = this.getDisplayRows()[index+1];\r\n\t\t}\r\n\t\t\r\n\t\tif(nextRow && (!(nextRow instanceof Row) || nextRow.type != \"row\")){\r\n\t\t\treturn this.nextDisplayRow(nextRow, rowOnly);\r\n\t\t}\r\n\t\t\r\n\t\treturn nextRow;\r\n\t}\r\n\t\r\n\tprevDisplayRow(row, rowOnly){\r\n\t\tvar index = this.getDisplayRowIndex(row),\r\n\t\tprevRow = false;\r\n\t\t\r\n\t\tif(index){\r\n\t\t\tprevRow = this.getDisplayRows()[index-1];\r\n\t\t}\r\n\t\t\r\n\t\tif(rowOnly && prevRow && (!(prevRow instanceof Row) || prevRow.type != \"row\")){\r\n\t\t\treturn this.prevDisplayRow(prevRow, rowOnly);\r\n\t\t}\r\n\t\t\r\n\t\treturn prevRow;\r\n\t}\r\n\t\r\n\tfindRowIndex(row, list){\r\n\t\tvar rowIndex;\r\n\t\t\r\n\t\trow = this.findRow(row);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\trowIndex = list.indexOf(row);\r\n\t\t\t\r\n\t\t\tif(rowIndex > -1){\r\n\t\t\t\treturn rowIndex;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tgetData(active, transform){\r\n\t\tvar output = [],\r\n\t\trows = this.getRows(active);\r\n\t\t\r\n\t\trows.forEach(function(row){\r\n\t\t\tif(row.type == \"row\"){\r\n\t\t\t\toutput.push(row.getData(transform || \"data\"));\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetComponents(active){\r\n\t\tvar\toutput = [],\r\n\t\trows = this.getRows(active);\r\n\t\t\r\n\t\trows.forEach(function(row){\r\n\t\t\toutput.push(row.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetDataCount(active){\r\n\t\tvar rows = this.getRows(active);\r\n\t\t\r\n\t\treturn rows.length;\r\n\t}\r\n\t\r\n\tscrollHorizontal(left){\r\n\t\tthis.scrollLeft = left;\r\n\t\tthis.element.scrollLeft = left;\r\n\t\t\r\n\t\tthis.dispatch(\"scroll-horizontal\", left);\r\n\t}\r\n\t\r\n\tregisterDataPipelineHandler(handler, priority){\r\n\t\tif(typeof priority !== \"undefined\"){\r\n\t\t\tthis.dataPipeline.push({handler, priority})\r\n\t\t\tthis.dataPipeline.sort((a, b) => {\r\n\t\t\t\treturn a.priority - b.priority;\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Data pipeline handlers must have a priority in order to be registered\")\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterDisplayPipelineHandler(handler, priority){\r\n\t\tif(typeof priority !== \"undefined\"){\r\n\t\t\tthis.displayPipeline.push({handler, priority})\r\n\t\t\tthis.displayPipeline.sort((a, b) => {\r\n\t\t\t\treturn a.priority - b.priority;\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Display pipeline handlers must have a priority in order to be registered\")\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set active data set\r\n\trefreshActiveData(handler, skipStage, renderInPosition){\r\n\t\tvar table = this.table,\r\n\t\tstage = \"\",\r\n\t\tindex = 0,\r\n\t\tcascadeOrder = [\"all\", \"dataPipeline\", \"display\", \"displayPipeline\", \"end\"],\r\n\t\tdisplayIndex;\r\n\t\t\r\n\t\t\r\n\t\tif(typeof handler === \"function\"){\r\n\t\t\tindex = this.dataPipeline.findIndex((item) => {\r\n\t\t\t\treturn item.handler === handler;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tstage = \"dataPipeline\";\r\n\t\t\t\t\r\n\t\t\t\tif(skipStage){\r\n\t\t\t\t\tif(index == this.dataPipeline.length - 1){\r\n\t\t\t\t\t\tstage = \"display\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tindex = this.displayPipeline.findIndex((item) => {\r\n\t\t\t\t\treturn item.handler === handler;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tstage = \"displayPipeline\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(skipStage){\r\n\t\t\t\t\t\tif(index == this.displayPipeline.length - 1){\r\n\t\t\t\t\t\t\tstage = \"end\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.error(\"Unable to refresh data, invalid handler provided\", handler)\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tstage = handler || \"all\";\r\n\t\t\tindex = 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.redrawBlock){\r\n\t\t\tif(!this.redrawBlockRestoreConfig || (this.redrawBlockRestoreConfig && ((this.redrawBlockRestoreConfig.stage === stage && index < this.redrawBlockRestoreConfig.index) || (cascadeOrder.indexOf(stage) < cascadeOrder.indexOf(this.redrawBlockRestoreConfig.stage))))){\r\n\t\t\t\tthis.redrawBlockRestoreConfig = {\r\n\t\t\t\t\thandler: handler,\r\n\t\t\t\t\tskipStage: skipStage,\r\n\t\t\t\t\trenderInPosition: renderInPosition,\r\n\t\t\t\t\tstage:stage,\r\n\t\t\t\t\tindex:index,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn;\r\n\t\t}else{\r\n\t\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\t\tif(renderInPosition){\r\n\t\t\t\t\tthis.reRenderInPosition(this.refreshPipelines.bind(this, handler, stage, index, renderInPosition));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!handler){\r\n\t\t\t\t\t\tthis.table.columnManager.renderer.renderColumns();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.renderTable();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(table.options.layoutColumnsOnNewData){\r\n\t\t\t\t\t\tthis.table.columnManager.redraw(true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"data-refreshed\");\r\n\t\t}\r\n\t}\r\n\t\r\n\trefreshPipelines(handler, stage, index, renderInPosition){\r\n\t\tthis.dispatch(\"data-refreshing\");\r\n\t\t\r\n\t\tif(!handler){\r\n\t\t\tthis.activeRowsPipeline[0] = this.rows.slice(0);\r\n\t\t}\r\n\t\t\r\n\t\t//cascade through data refresh stages\r\n\t\tswitch(stage){\r\n\t\t\tcase \"all\":\r\n\t\t\t//handle case where alldata needs refreshing\r\n\t\t\t\r\n\t\t\tcase \"dataPipeline\":\r\n\t\t\t\r\n\t\t\tfor(let i = index; i < this.dataPipeline.length; i++){\r\n\t\t\t\tlet result = this.dataPipeline[i].handler(this.activeRowsPipeline[i].slice(0));\r\n\t\t\t\t\r\n\t\t\t\tthis.activeRowsPipeline[i + 1] = result || this.activeRowsPipeline[i].slice(0);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.setActiveRows(this.activeRowsPipeline[this.dataPipeline.length]);\r\n\t\t\t\r\n\t\t\tthis.regenerateRowNumbers();\r\n\t\t\t\r\n\t\t\tcase \"display\":\r\n\t\t\tindex = 0;\r\n\t\t\tthis.resetDisplayRows();\r\n\t\t\t\r\n\t\t\tcase \"displayPipeline\":\r\n\t\t\tfor(let i = index; i < this.displayPipeline.length; i++){\r\n\t\t\t\tlet result = this.displayPipeline[i].handler((i ? this.getDisplayRows(i - 1) : this.activeRows).slice(0), renderInPosition);\r\n\t\t\t\t\r\n\t\t\t\tthis.setDisplayRows(result || this.getDisplayRows(i - 1).slice(0), i);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase \"end\":\r\n\t\t\t//case to handle scenario when trying to skip past end stage\r\n\t\t}\r\n\t}\r\n\t\r\n\t//regenerate row numbers for row number formatter if in use\r\n\tregenerateRowNumbers(){\r\n\t\tif(this.rowNumColumn){\r\n\t\t\tthis.activeRows.forEach((row) => {\r\n\t\t\t\tvar cell = row.getCell(this.rowNumColumn);\r\n\t\t\t\t\r\n\t\t\t\tif(cell){\r\n\t\t\t\t\tcell._generateContents();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetActiveRows(activeRows){\r\n\t\tthis.activeRows = activeRows;\r\n\t\tthis.activeRowsCount = this.activeRows.length;\r\n\t}\r\n\t\r\n\t//reset display rows array\r\n\tresetDisplayRows(){\r\n\t\tthis.displayRows = [];\r\n\t\t\r\n\t\tthis.displayRows.push(this.activeRows.slice(0));\r\n\t\t\r\n\t\tthis.displayRowsCount = this.displayRows[0].length;\r\n\t}\r\n\t\r\n\tgetNextDisplayIndex(){\r\n\t\treturn this.displayRows.length;\r\n\t}\r\n\t\r\n\t//set display row pipeline data\r\n\tsetDisplayRows(displayRows, index){\r\n\t\t\r\n\t\tvar output = true;\r\n\t\t\r\n\t\tif(index && typeof this.displayRows[index] != \"undefined\"){\r\n\t\t\tthis.displayRows[index] = displayRows;\r\n\t\t\toutput = true;\r\n\t\t}else{\r\n\t\t\tthis.displayRows.push(displayRows)\r\n\t\t\toutput = index = this.displayRows.length -1;\r\n\t\t}\r\n\t\t\r\n\t\tif(index == this.displayRows.length -1){\r\n\t\t\tthis.displayRowsCount = this.displayRows[this.displayRows.length -1].length;\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetDisplayRows(index){\r\n\t\tif(typeof index == \"undefined\"){\r\n\t\t\treturn this.displayRows.length ? this.displayRows[this.displayRows.length -1] : [];\r\n\t\t}else{\r\n\t\t\treturn this.displayRows[index] || [];\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetVisibleRows(chain, viewable){\r\n\t\tvar rows = Object.assign([], this.renderer.visibleRows(!viewable));\r\n\t\t\r\n\t\tif(chain){\r\n\t\t\trows = this.chain(\"rows-visible\", [viewable], rows, rows);\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t//repeat action accross display rows\r\n\tdisplayRowIterator(callback){\r\n\t\tthis.activeRowsPipeline.forEach(callback);\r\n\t\tthis.displayRows.forEach(callback);\r\n\t\t\r\n\t\tthis.displayRowsCount = this.displayRows[this.displayRows.length -1].length;\r\n\t}\r\n\t\r\n\t//return only actual rows (not group headers etc)\r\n\tgetRows(type){\r\n\t\tvar rows;\r\n\t\t\r\n\t\tswitch(type){\r\n\t\t\tcase \"active\":\r\n\t\t\trows = this.activeRows;\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"display\":\r\n\t\t\trows = this.table.rowManager.getDisplayRows();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"visible\":\r\n\t\t\trows = this.getVisibleRows(false, true);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\trows = this.chain(\"rows-retrieve\", type, null, this.rows) || this.rows;\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t///////////////// Table Rendering /////////////////\r\n\t//trigger rerender of table in current position\r\n\treRenderInPosition(callback){\r\n\t\tif(this.redrawBlock){\r\n\t\t\tif(callback){\r\n\t\t\t\tcallback();\r\n\t\t\t}else{\r\n\t\t\t\tthis.redrawBlockRenderInPosition = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"renderStarted\");\r\n\t\t\tthis.renderer.rerenderRows(callback);\r\n\t\t\tthis.dispatchExternal(\"renderComplete\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeRenderer(){\r\n\t\tvar renderClass;\r\n\t\t\r\n\t\tvar renderers = {\r\n\t\t\t\"virtual\": RendererVirtualDomVertical,\r\n\t\t\t\"basic\": RendererBasicVertical,\r\n\t\t};\r\n\t\t\r\n\t\tif(typeof this.table.options.renderVertical === \"string\"){\r\n\t\t\trenderClass = renderers[this.table.options.renderVertical];\r\n\t\t}else{\r\n\t\t\trenderClass = this.table.options.renderVertical;\r\n\t\t}\r\n\t\t\r\n\t\tif(renderClass){\r\n\t\t\tthis.renderer = new renderClass(this.table, this.element, this.tableElement);\r\n\t\t\tthis.renderer.initialize();\r\n\t\t\t\r\n\t\t\tif((this.table.element.clientHeight || this.table.options.height)){\r\n\t\t\t\tthis.fixedHeight = true;\r\n\t\t\t}else{\r\n\t\t\t\tthis.fixedHeight = false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Unable to find matching renderer:\", table.options.renderVertical);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRenderMode(){\r\n\t\treturn this.renderMode;\r\n\t}\r\n\t\r\n\trenderTable(){\r\n\t\tthis.dispatchExternal(\"renderStarted\");\r\n\t\t\r\n\t\tthis.element.scrollTop = 0;\r\n\t\t\r\n\t\tthis._clearTable();\r\n\t\t\r\n\t\tif(this.displayRowsCount){\r\n\t\t\tthis.renderer.renderRows();\r\n\t\t\t\r\n\t\t\tif(this.firstRender){\r\n\t\t\t\tthis.firstRender = false;\r\n\t\t\t\tthis.layoutRefresh();\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.renderEmptyScroll();\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.fixedHeight){\r\n\t\t\tthis.adjustTableSize();\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatch(\"table-layout\");\r\n\t\t\r\n\t\tif(!this.displayRowsCount){\r\n\t\t\tthis._showPlaceholder();\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatchExternal(\"renderComplete\");\r\n\t}\r\n\t\r\n\t//show scrollbars on empty table div\r\n\trenderEmptyScroll(){\r\n\t\tif(this.placeholder){\r\n\t\t\tthis.tableElement.style.display = \"none\";\r\n\t\t}else{\r\n\t\t\tthis.tableElement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t\t// this.tableElement.style.minHeight = \"1px\";\r\n\t\t\t// this.tableElement.style.visibility = \"hidden\";\r\n\t\t}\r\n\t}\r\n\t\r\n\t_clearTable(){\r\n\t\tvar element = this.tableElement;\r\n\t\t\r\n\t\tthis._clearPlaceholder();\r\n\t\t\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.renderer.clearRows();\r\n\t}\r\n\t\r\n\t_showPlaceholder(){\r\n\t\tif(this.placeholder){\r\n\t\t\tthis.placeholder.setAttribute(\"tabulator-render-mode\", this.renderMode);\r\n\t\t\t\r\n\t\t\tthis.getElement().appendChild(this.placeholder);\r\n\t\t\tthis._positionPlaceholder();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_clearPlaceholder(){\r\n\t\tif(this.placeholder && this.placeholder.parentNode){\r\n\t\t\tthis.placeholder.parentNode.removeChild(this.placeholder);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_positionPlaceholder(){\r\n\t\tif(this.placeholder && this.placeholder.parentNode){\r\n\t\t\tthis.placeholder.style.width = this.table.columnManager.getWidth() + \"px\";\r\n\t\t\tthis.placeholderContents.style.width = this.table.rowManager.element.clientWidth + \"px\";\r\n\t\t\tthis.placeholderContents.style.marginLeft = this.scrollLeft + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tstyleRow(row, index){\r\n\t\tvar rowEl = row.getElement();\r\n\t\t\r\n\t\tif(index % 2){\r\n\t\t\trowEl.classList.add(\"tabulator-row-even\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-odd\");\r\n\t\t}else{\r\n\t\t\trowEl.classList.add(\"tabulator-row-odd\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-even\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t//normalize height of active rows\r\n\tnormalizeHeight(){\r\n\t\tthis.activeRows.forEach(function(row){\r\n\t\t\trow.normalizeHeight();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//adjust the height of the table holder to fit in the Tabulator element\r\n\tadjustTableSize(){\r\n\t\tvar initialHeight = this.element.clientHeight,\r\n\t\tmodExists;\r\n\t\t\r\n\t\tif(this.renderer.verticalFillMode === \"fill\"){\r\n\t\t\tlet otherHeight = Math.floor(this.table.columnManager.getElement().getBoundingClientRect().height + (this.table.footerManager && this.table.footerManager.active && !this.table.footerManager.external ? this.table.footerManager.getElement().getBoundingClientRect().height : 0));\r\n\t\t\t\r\n\t\t\tif(this.fixedHeight){\r\n\t\t\t\tthis.element.style.minHeight = \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t\tthis.element.style.height = \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t\tthis.element.style.maxHeight = \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.element.style.height = \"\";\r\n\t\t\t\tthis.element.style.height = (this.table.element.clientHeight - otherHeight) + \"px\";\r\n\t\t\t\tthis.element.scrollTop = this.scrollTop;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.renderer.resize();\r\n\t\t\t\r\n\t\t\t//check if the table has changed size when dealing with variable height tables\r\n\t\t\tif(!this.fixedHeight && initialHeight != this.element.clientHeight){\r\n\t\t\t\tif(this.subscribed(\"table-resize\")){\r\n\t\t\t\t\tthis.dispatch(\"table-resize\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.redraw();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis._positionPlaceholder();\r\n\t}\r\n\t\r\n\t//renitialize all rows\r\n\treinitialize(){\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\trow.reinitialize(true);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//prevent table from being redrawn\r\n\tblockRedraw (){\r\n\t\tthis.redrawBlock = true;\r\n\t\tthis.redrawBlockRestoreConfig = false;\r\n\t}\r\n\t\r\n\t//restore table redrawing\r\n\trestoreRedraw (){\r\n\t\tthis.redrawBlock = false;\r\n\t\t\r\n\t\tif(this.redrawBlockRestoreConfig){\r\n\t\t\tthis.refreshActiveData(this.redrawBlockRestoreConfig.handler, this.redrawBlockRestoreConfig.skipStage, this.redrawBlockRestoreConfig.renderInPosition)\r\n\t\t\t\r\n\t\t\tthis.redrawBlockRestoreConfig = false;\r\n\t\t}else{\r\n\t\t\tif(this.redrawBlockRenderInPosition){\r\n\t\t\t\tthis.reRenderInPosition();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.redrawBlockRenderInPosition = false;\r\n\t}\r\n\t\r\n\t//redraw table\r\n\tredraw (force){\r\n\t\tvar pos = 0,\r\n\t\tleft = this.scrollLeft;\r\n\t\t\r\n\t\tthis.adjustTableSize();\r\n\t\t\r\n\t\tthis.table.tableWidth = this.table.element.clientWidth;\r\n\t\t\r\n\t\tif(!force){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t\tthis.scrollHorizontal(left);\r\n\t\t}else{\r\n\t\t\tthis.renderTable();\r\n\t\t}\r\n\t}\r\n\t\r\n\tresetScroll(){\r\n\t\tthis.element.scrollLeft = 0;\r\n\t\tthis.element.scrollTop = 0;\r\n\t\t\r\n\t\tif(this.table.browser === \"ie\"){\r\n\t\t\tvar event = document.createEvent(\"Event\");\r\n\t\t\tevent.initEvent(\"scroll\", false, true);\r\n\t\t\tthis.element.dispatchEvent(event);\r\n\t\t}else{\r\n\t\t\tthis.element.dispatchEvent(new Event('scroll'));\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\n\r\nexport default class FooterManager extends CoreFeature{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.active = false;\r\n\t\tthis.element = this.createElement(); //containing element\r\n\t\tthis.containerElement = this.createContainerElement(); //containing element\r\n\t\tthis.external = false;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.initializeElement();\r\n\t}\r\n\r\n\tcreateElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-footer\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\t\r\n\tcreateContainerElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-footer-contents\");\r\n\r\n\t\tthis.element.appendChild(el);\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitializeElement(){\r\n\t\tif(this.table.options.footerElement){\r\n\r\n\t\t\tswitch(typeof this.table.options.footerElement){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\tif(this.table.options.footerElement[0] === \"<\"){\r\n\t\t\t\t\tthis.containerElement.innerHTML = this.table.options.footerElement;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.external = true;\r\n\t\t\t\t\tthis.containerElement = document.querySelector(this.table.options.footerElement);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\tthis.element = this.table.options.footerElement;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\tappend(element){\r\n\t\tthis.activate();\r\n\r\n\t\tthis.containerElement.appendChild(element);\r\n\t\tthis.table.rowManager.adjustTableSize();\r\n\t}\r\n\r\n\tprepend(element){\r\n\t\tthis.activate();\r\n\r\n\t\tthis.element.insertBefore(element, this.element.firstChild);\r\n\t\tthis.table.rowManager.adjustTableSize();\r\n\t}\r\n\r\n\tremove(element){\r\n\t\telement.parentNode.removeChild(element);\r\n\t\tthis.deactivate();\r\n\t}\r\n\r\n\tdeactivate(force){\r\n\t\tif(!this.element.firstChild || force){\r\n\t\t\tif(!this.external){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\t\t\tthis.active = false;\r\n\t\t}\r\n\t}\r\n\r\n\tactivate(){\r\n\t\tif(!this.active){\r\n\t\t\tthis.active = true;\r\n\t\t\tif(!this.external){\r\n\t\t\t\tthis.table.element.appendChild(this.getElement());\r\n\t\t\t\tthis.table.element.style.display = '';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tredraw(){\r\n\t\tthis.dispatch(\"footer-redraw\")\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from './Helpers.js';\r\nimport Row from '../row/Row.js';\r\n\r\nexport default class InteractionManager extends CoreFeature {\r\n\t\r\n\tconstructor (table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.el = null;\r\n\t\t\r\n\t\tthis.abortClasses = [\"tabulator-headers\", \"tabulator-table\"];\r\n\t\t\r\n\t\tthis.previousTargets = {};\r\n\t\t\r\n\t\tthis.listeners = [\r\n\t\t\t\"click\",\r\n\t\t\t\"dblclick\",\r\n\t\t\t\"contextmenu\",\r\n\t\t\t\"mouseenter\",\r\n\t\t\t\"mouseleave\",\r\n\t\t\t\"mouseover\",\r\n\t\t\t\"mouseout\",\r\n\t\t\t\"mousemove\",\r\n\t\t\t\"touchstart\",\r\n\t\t\t\"touchend\",\r\n\t\t];\r\n\t\t\r\n\t\tthis.componentMap = {\r\n\t\t\t\"tabulator-cell\":\"cell\",\r\n\t\t\t\"tabulator-row\":\"row\",\r\n\t\t\t\"tabulator-group\":\"group\",\r\n\t\t\t\"tabulator-col\":\"column\",\r\n\t\t};\r\n\t\t\r\n\t\tthis.pseudoTrackers = {\r\n\t\t\t\"row\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"cell\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"group\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"column\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t}\r\n\t\t\r\n\t\tthis.pseudoTracking = false;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.el = this.table.element;\r\n\t\t\r\n\t\tthis.buildListenerMap();\r\n\t\tthis.bindSubscriptionWatchers();\r\n\t}\r\n\t\r\n\tbuildListenerMap(){\r\n\t\tvar listenerMap = {};\r\n\t\t\r\n\t\tthis.listeners.forEach((listener) => {\r\n\t\t\tlistenerMap[listener] = {\r\n\t\t\t\thandler:null,\r\n\t\t\t\tcomponents:[],\r\n\t\t\t}\r\n\t\t})\r\n\t\t\r\n\t\tthis.listeners = listenerMap;\r\n\t}\r\n\t\r\n\tbindPseudoEvents(){\r\n\t\tObject.keys(this.pseudoTrackers).forEach((key) => {\r\n\t\t\tthis.pseudoTrackers[key].subscriber = this.pseudoMouseEnter.bind(this, key);\r\n\t\t\tthis.subscribe(key + \"-mouseover\", this.pseudoTrackers[key].subscriber);\r\n\t\t});\r\n\t\t\r\n\t\tthis.pseudoTracking = true;\r\n\t}\r\n\t\r\n\tpseudoMouseEnter(key, e, target){\r\n\t\tif(this.pseudoTrackers[key].target !== target){\r\n\t\t\t\r\n\t\t\tif(this.pseudoTrackers[key].target){\r\n\t\t\t\tthis.dispatch(key + \"-mouseleave\", e, this.pseudoTrackers[key].target);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.pseudoMouseLeave(key, e);\r\n\t\t\t\r\n\t\t\tthis.pseudoTrackers[key].target = target;\r\n\t\t\t\r\n\t\t\tthis.dispatch(key + \"-mouseenter\", e, target);\r\n\t\t}\r\n\t}\r\n\t\r\n\tpseudoMouseLeave(key, e){\r\n\t\tvar leaveList = Object.keys(this.pseudoTrackers),\r\n\t\tlinkedKeys = {\r\n\t\t\t\"row\":[\"cell\"],\r\n\t\t\t\"cell\":[\"row\"],\r\n\t\t};\r\n\t\t\r\n\t\tleaveList = leaveList.filter((item) => {\r\n\t\t\tvar links = linkedKeys[key];\r\n\t\t\treturn item !== key && (!links || (links && !links.includes(item)));\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\tleaveList.forEach((key) => {\r\n\t\t\tvar target = this.pseudoTrackers[key].target;\r\n\t\t\t\r\n\t\t\tif(this.pseudoTrackers[key].target){\r\n\t\t\t\tthis.dispatch(key + \"-mouseleave\", e, target);\r\n\t\t\t\t\r\n\t\t\t\tthis.pseudoTrackers[key].target = null;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t\r\n\tbindSubscriptionWatchers(){\r\n\t\tvar listeners = Object.keys(this.listeners),\r\n\t\tcomponents = Object.values(this.componentMap);\r\n\t\t\r\n\t\tfor(let comp of components){\r\n\t\t\tfor(let listener of listeners){\r\n\t\t\t\tlet key = comp + \"-\" + listener;\r\n\t\t\t\t\r\n\t\t\t\tthis.subscriptionChange(key, this.subscriptionChanged.bind(this, comp, listener));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.subscribe(\"table-destroy\", this.clearWatchers.bind(this))\r\n\t}\r\n\t\r\n\tsubscriptionChanged(component, key, added){\r\n\t\tvar listener = this.listeners[key].components,\r\n\t\tindex = listener.indexOf(component),\r\n\t\tchanged = false;\r\n\t\t\r\n\t\tif(added){\r\n\t\t\tif(index === -1){\r\n\t\t\t\tlistener.push(component);\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!this.subscribed(component + \"-\" + key)){\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tlistener.splice(index, 1);\r\n\t\t\t\t\tchanged = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif((key === \"mouseenter\" || key === \"mouseleave\") && !this.pseudoTracking){\r\n\t\t\tthis.bindPseudoEvents();\r\n\t\t}\r\n\t\t\r\n\t\tif(changed){\r\n\t\t\tthis.updateEventListeners();\r\n\t\t}\r\n\t}\r\n\t\r\n\tupdateEventListeners(){\r\n\t\tfor(let key in this.listeners){\r\n\t\t\tlet listener = this.listeners[key];\r\n\t\t\t\r\n\t\t\tif(listener.components.length){\r\n\t\t\t\tif(!listener.handler){\r\n\t\t\t\t\tlistener.handler = this.track.bind(this, key);\r\n\t\t\t\t\tthis.el.addEventListener(key, listener.handler)\r\n\t\t\t\t\t// this.el.addEventListener(key, listener.handler, {passive: true})\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(listener.handler){\r\n\t\t\t\t\tthis.el.removeEventListener(key, listener.handler)\r\n\t\t\t\t\tlistener.handler = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\ttrack(type, e){\r\n\t\tvar path = (e.composedPath && e.composedPath()) || e.path;\r\n\t\t\r\n\t\tvar targets = this.findTargets(path);\r\n\t\ttargets = this.bindComponents(type, targets);\r\n\t\t\r\n\t\tthis.triggerEvents(type, e, targets);\r\n\t\t\r\n\t\tif(this.pseudoTracking && (type == \"mouseover\" || type == \"mouseleave\") && !Object.keys(targets).length){\r\n\t\t\tthis.pseudoMouseLeave(\"none\", e);\r\n\t\t}\r\n\t}\r\n\t\r\n\tfindTargets(path){\r\n\t\tvar targets = {};\r\n\t\t\r\n\t\tlet componentMap = Object.keys(this.componentMap);\r\n\t\t\r\n\t\tfor (let el of path) {\r\n\t\t\tlet classList = el.classList ? [...el.classList] : [];\r\n\t\t\t\r\n\t\t\tlet abort = classList.filter((item) => {\r\n\t\t\t\treturn this.abortClasses.includes(item);\r\n\t\t\t})\r\n\t\t\t\r\n\t\t\tif(abort.length){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tlet elTargets = classList.filter((item) => {\r\n\t\t\t\treturn componentMap.includes(item);\r\n\t\t\t})\r\n\t\t\t\r\n\t\t\tfor (let target of elTargets) {\r\n\t\t\t\ttargets[this.componentMap[target]] = el;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(targets.group && targets.group === targets.row){\r\n\t\t\tdelete targets.row;\r\n\t\t}\r\n\t\t\r\n\t\treturn targets;\r\n\t}\r\n\t\r\n\tbindComponents(type, targets){\r\n\t\t//ensure row component is looked up before cell\r\n\t\tvar keys = Object.keys(targets).reverse(),\r\n\t\tlistener = this.listeners[type],\r\n\t\ttargetMatches = {};\r\n\t\t\r\n\t\tfor(let key of keys){\r\n\t\t\tlet component;\r\n\t\t\tlet target = targets[key];\r\n\t\t\tlet previousTarget = this.previousTargets[key];\r\n\t\t\t\r\n\t\t\tif(previousTarget && previousTarget.target === target){\r\n\t\t\t\tcomponent = previousTarget.component;\r\n\t\t\t}else{\r\n\t\t\t\tswitch(key){\r\n\t\t\t\t\tcase \"row\":\r\n\t\t\t\t\tcase \"group\":\r\n\t\t\t\t\tif(listener.components.includes(\"row\") || listener.components.includes(\"cell\") || listener.components.includes(\"group\")){\r\n\t\t\t\t\t\tlet rows = this.table.rowManager.getVisibleRows(true);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcomponent = rows.find((row) => {\r\n\t\t\t\t\t\t\treturn row.getElement() === target;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(targets[\"row\"] && targets[\"row\"].parentNode && targets[\"row\"].parentNode.closest(\".tabulator-row\")){\r\n\t\t\t\t\t\t\ttargets[key] = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"column\":\r\n\t\t\t\t\tif(listener.components.includes(\"column\")){\r\n\t\t\t\t\t\tcomponent = this.table.columnManager.findColumn(target);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"cell\":\r\n\t\t\t\t\tif(listener.components.includes(\"cell\")){\r\n\t\t\t\t\t\tif(targets[\"row\"] instanceof Row){\r\n\t\t\t\t\t\t\tcomponent = targets[\"row\"].findCell(target);\r\n\t\t\t\t\t\t}else{\t\r\n\t\t\t\t\t\t\tif(targets[\"row\"]){\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?\")\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(component){\r\n\t\t\t\ttargets[key] = component;\r\n\t\t\t\ttargetMatches[key] = {\r\n\t\t\t\t\ttarget:target,\r\n\t\t\t\t\tcomponent:component,\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.previousTargets = targetMatches;\r\n\t\t\r\n\t\treturn targets;\r\n\t}\r\n\t\r\n\ttriggerEvents(type, e, targets){\r\n\t\tvar listener = this.listeners[type];\r\n\t\t\r\n\t\tfor(let key in targets){\r\n\t\t\tif(targets[key] && listener.components.includes(key)){\r\n\t\t\t\tthis.dispatch(key + \"-\" + type, e, targets[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearWatchers(){\r\n\t\tfor(let key in this.listeners){\r\n\t\t\tlet listener = this.listeners[key];\r\n\t\t\t\r\n\t\t\tif(listener.handler){\r\n\t\t\t\tthis.el.removeEventListener(key, listener.handler)\r\n\t\t\t\tlistener.handler = null;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}","export default class ComponentFunctionBinder{\r\n\r\n\tconstructor(table){\r\n\t\tthis.table = table;\r\n\r\n\t\tthis.bindings = {};\r\n\t}\r\n\r\n\tbind(type, funcName, handler){\r\n\t\tif(!this.bindings[type]){\r\n\t\t\tthis.bindings[type] = {};\r\n\t\t}\r\n\r\n\t\tif(this.bindings[type][funcName]){\r\n\t\t\tconsole.warn(\"Unable to bind component handler, a matching function name is already bound\", type, funcName, handler)\r\n\t\t}else{\r\n\t\t\tthis.bindings[type][funcName] = handler;\r\n\t\t}\r\n\t}\r\n\r\n\thandle(type, component, name){\r\n\t\tif(this.bindings[type] && this.bindings[type][name] && typeof this.bindings[type][name].bind === 'function'){\r\n\t\t\treturn this.bindings[type][name].bind(null, component);\r\n\t\t}else{\r\n\t\t\tif(name !== \"then\" && typeof name === \"string\" && !name.startsWith(\"_\")){\r\n\t\t\t\t\tconsole.error(\"The \" + type + \" component does not have a \" + name + \" function, have you checked that you have the correct Tabulator module installed?\")\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n","import CoreFeature from '../CoreFeature.js';\r\n\r\nexport default class DataLoader extends CoreFeature{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.requestOrder = 0; //prevent requests coming out of sequence if overridden by another load request\r\n\t\tthis.loading = false;\r\n\t}\r\n\r\n\tinitialize(){}\r\n\r\n\tload(data, params, config, replace, silent, columnsChanged){\r\n\t\tvar requestNo = ++this.requestOrder;\r\n\r\n\t\tthis.dispatchExternal(\"dataLoading\", data);\r\n\r\n\t\t//parse json data to array\r\n\t\tif (data && (data.indexOf(\"{\") == 0 || data.indexOf(\"[\") == 0)){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\r\n\t\tif(this.confirm(\"data-loading\", [data, params, config, silent])){\r\n\t\t\tthis.loading = true;\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.alertLoader();\r\n\t\t\t}\r\n\r\n\t\t\t//get params for request\r\n\t\t\tparams = this.chain(\"data-params\", [data, config, silent], params || {}, params || {});\r\n\r\n\t\t\tparams = this.mapParams(params, this.table.options.dataSendParams);\r\n\r\n\t\t\tvar result = this.chain(\"data-load\", [data, params, config, silent], false, Promise.resolve([]));\r\n\t\t\t\r\n\t\t\treturn result.then((response) => {\r\n\t\t\t\tif(!Array.isArray(response) && typeof response == \"object\"){\r\n\t\t\t\t\tresponse = this.mapParams(response, this.objectInvert(this.table.options.dataReceiveParams));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar rowData = this.chain(\"data-loaded\", response, null, response);\r\n\r\n\t\t\t\tif(requestNo == this.requestOrder){\r\n\t\t\t\t\tthis.clearAlert();\r\n\r\n\t\t\t\t\tif(rowData !== false){\r\n\t\t\t\t\t\tthis.dispatchExternal(\"dataLoaded\", rowData);\r\n\t\t\t\t\t\tthis.table.rowManager.setData(rowData, replace, typeof columnsChanged === \"undefined\" ? !replace : columnsChanged);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made\");\r\n\t\t\t\t}\r\n\t\t\t}).catch((error) => {\r\n\t\t\t\tconsole.error(\"Data Load Error: \", error);\r\n\t\t\t\tthis.dispatchExternal(\"dataLoadError\", error);\r\n\r\n\t\t\t\tif(!silent){\r\n\t\t\t\t\tthis.alertError();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tthis.clearAlert();\r\n\t\t\t\t}, this.table.options.dataLoaderErrorTimeout);\r\n\t\t\t})\r\n\t\t\t.finally(() => {\r\n\t\t\t\tthis.loading = false;\r\n\t\t\t})\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"dataLoaded\", data);\r\n\r\n\t\t\tif(!data){\r\n\t\t\t\tdata = [];\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.rowManager.setData(data, replace, typeof columnsChanged === \"undefined\" ? !replace : columnsChanged);\r\n\t\t\treturn Promise.resolve();\r\n\t\t}\r\n\t}\r\n\r\n\tmapParams(params, map){\r\n\t\tvar output = {};\r\n\r\n\t\tfor(let key in params){\r\n\t\t\toutput[map.hasOwnProperty(key) ? map[key] : key] = params[key];\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tobjectInvert(obj){\r\n\t\tvar output = {};\r\n\r\n\t\tfor(let key in obj){\r\n\t\t\toutput[obj[key]] = key;\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tblockActiveLoad(){\r\n\t\tthis.requestOrder++;\r\n\t}\r\n\r\n\talertLoader(){\r\n\t\tvar shouldLoad = typeof this.table.options.dataLoader === \"function\" ? this.table.options.dataLoader() : this.table.options.dataLoader;\r\n\r\n\t\tif(shouldLoad){\r\n\t\t\tthis.table.alertManager.alert(this.table.options.dataLoaderLoading || this.langText(\"data|loading\"));\r\n\t\t}\r\n\t}\r\n\r\n\talertError(){\r\n\t\tthis.table.alertManager.alert(this.table.options.dataLoaderError || this.langText(\"data|error\"), \"error\");\r\n\t}\r\n\r\n\tclearAlert(){\r\n\t\tthis.table.alertManager.clear();\r\n\t}\r\n}","export default class ExternalEventBus {\r\n\r\n\tconstructor(table, optionsList, debug){\r\n\t\tthis.table = table;\r\n\t\tthis.events = {};\r\n\t\tthis.optionsList = optionsList || {};\r\n\t\tthis.subscriptionNotifiers = {};\r\n\r\n\t\tthis.dispatch = debug ? this._debugDispatch.bind(this) : this._dispatch.bind(this);\r\n\t\tthis.debug = debug;\r\n\t}\r\n\r\n\tsubscriptionChange(key, callback){\r\n\t\tif(!this.subscriptionNotifiers[key]){\r\n\t\t\tthis.subscriptionNotifiers[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.subscriptionNotifiers[key].push(callback);\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis._notifiySubscriptionChange(key, true);\r\n\t\t}\r\n\t}\r\n\r\n\tsubscribe(key, callback){\r\n\t\tif(!this.events[key]){\r\n\t\t\tthis.events[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.events[key].push(callback);\r\n\r\n\t\tthis._notifiySubscriptionChange(key, true);\r\n\t}\r\n\r\n\tunsubscribe(key, callback){\r\n\t\tvar index;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tif(callback){\r\n\t\t\t\tindex = this.events[key].findIndex((item) => {\r\n\t\t\t\t\treturn item === callback;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tthis.events[key].splice(index, 1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Cannot remove event, no matching event found:\", key, callback);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tdelete this.events[key];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cannot remove event, no events set on:\", key);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._notifiySubscriptionChange(key, false);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.events[key] && this.events[key].length;\r\n\t}\r\n\r\n\t_notifiySubscriptionChange(key, subscribed){\r\n\t\tvar notifiers = this.subscriptionNotifiers[key];\r\n\r\n\t\tif(notifiers){\r\n\t\t\tnotifiers.forEach((callback)=>{\r\n\t\t\t\tcallback(subscribed);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_dispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args.shift(),\r\n\t\tresult;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tthis.events[key].forEach((callback, i) => {\r\n\t\t\t\tlet callResult = callback.apply(this.table, args);\r\n\r\n\t\t\t\tif(!i){\r\n\t\t\t\t\tresult = callResult;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\t_debugDispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"ExternalEvent:\" + args[0];\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._dispatch(...arguments)\r\n\t}\r\n}","export default class InternalEventBus {\r\n\r\n\tconstructor(debug){\r\n\t\tthis.events = {};\r\n\t\tthis.subscriptionNotifiers = {};\r\n\r\n\t\tthis.dispatch = debug ? this._debugDispatch.bind(this) : this._dispatch.bind(this);\r\n\t\tthis.chain = debug ? this._debugChain.bind(this) : this._chain.bind(this);\r\n\t\tthis.confirm = debug ? this._debugConfirm.bind(this) : this._confirm.bind(this);\r\n\t\tthis.debug = debug;\r\n\t}\r\n\r\n\tsubscriptionChange(key, callback){\r\n\t\tif(!this.subscriptionNotifiers[key]){\r\n\t\t\tthis.subscriptionNotifiers[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.subscriptionNotifiers[key].push(callback);\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis._notifiySubscriptionChange(key, true);\r\n\t\t}\r\n\t}\r\n\r\n\tsubscribe(key, callback, priority = 10000){\r\n\t\tif(!this.events[key]){\r\n\t\t\tthis.events[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.events[key].push({callback, priority});\r\n\r\n\t\tthis.events[key].sort((a, b) => {\r\n\t\t\treturn a.priority - b.priority;\r\n\t\t});\r\n\r\n\t\tthis._notifiySubscriptionChange(key, true);\r\n\t}\r\n\r\n\tunsubscribe(key, callback){\r\n\t\tvar index;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tif(callback){\r\n\t\t\t\tindex = this.events[key].findIndex((item) => {\r\n\t\t\t\t\treturn item.callback === callback;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tthis.events[key].splice(index, 1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Cannot remove event, no matching event found:\", key, callback);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cannot remove event, no events set on:\", key);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._notifiySubscriptionChange(key, false);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.events[key] && this.events[key].length;\r\n\t}\r\n\r\n\t_chain(key, args, initialValue, fallback){\r\n\t\tvar value = initialValue;\r\n\r\n\t\tif(!Array.isArray(args)){\r\n\t\t\targs = [args];\r\n\t\t}\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis.events[key].forEach((subscriber, i) => {\r\n\t\t\t\tvalue = subscriber.callback.apply(this, args.concat([value]));\r\n\t\t\t});\r\n\r\n\t\t\treturn value;\r\n\t\t}else{\r\n\t\t\treturn typeof fallback === \"function\" ? fallback() : fallback;\r\n\t\t}\r\n\t}\r\n\r\n\t_confirm(key, args){\r\n\t\tvar confirmed = false;\r\n\r\n\t\tif(!Array.isArray(args)){\r\n\t\t\targs = [args];\r\n\t\t}\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis.events[key].forEach((subscriber, i) => {\r\n\t\t\t\tif(subscriber.callback.apply(this, args)){\r\n\t\t\t\t\tconfirmed = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn confirmed;\r\n\t}\r\n\r\n\t_notifiySubscriptionChange(key, subscribed){\r\n\t\tvar notifiers = this.subscriptionNotifiers[key];\r\n\r\n\t\tif(notifiers){\r\n\t\t\tnotifiers.forEach((callback)=>{\r\n\t\t\t\tcallback(subscribed);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_dispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args.shift();\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tthis.events[key].forEach((subscriber) => {\r\n\t\t\t\tlet callResult = subscriber.callback.apply(this, args);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_debugDispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._dispatch(...arguments);\r\n\t}\r\n\r\n\t_debugChain(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._chain(...arguments);\r\n\t}\r\n\r\n\t_debugConfirm(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._confirm(...arguments);\r\n\t}\r\n}","import Tabulator from '../Tabulator.js';\r\n\r\nclass TableRegistry {\r\n\r\n\tstatic register(table){\r\n\t\tTableRegistry.tables.push(table);\r\n\t}\r\n\r\n\tstatic deregister(table){\r\n\t\tvar index = TableRegistry.tables.indexOf(table);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tTableRegistry.tables.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\tstatic lookupTable(query, silent){\r\n\t\tvar results = [],\r\n\t\tmatches, match;\r\n\r\n\t\tif(typeof query === \"string\"){\r\n\t\t\tmatches = document.querySelectorAll(query);\r\n\r\n\t\t\tif(matches.length){\r\n\t\t\t\tfor(var i = 0; i < matches.length; i++){\r\n\t\t\t\t\tmatch = TableRegistry.matchElement(matches[i]);\r\n\r\n\t\t\t\t\tif(match){\r\n\t\t\t\t\t\tresults.push(match);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}else if((typeof HTMLElement !== \"undefined\" && query instanceof HTMLElement) || query instanceof Tabulator){\r\n\t\t\tmatch = TableRegistry.matchElement(query);\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tresults.push(match);\r\n\t\t\t}\r\n\t\t}else if(Array.isArray(query)){\r\n\t\t\tquery.forEach(function(item){\r\n\t\t\t\tresults = results.concat(TableRegistry.lookupTable(item));\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Table Connection Error - Invalid Selector\", query);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\tstatic matchElement(element){\r\n\t\treturn TableRegistry.tables.find(function(table){\r\n\t\t\treturn element instanceof Tabulator ? table === element : table.element === element;\r\n\t\t});\r\n\t}\r\n}\r\n\r\nTableRegistry.tables = [];\r\n\r\nexport default TableRegistry;","//resize columns to fit data they contain\r\nexport default function(columns){\r\n\tthis.table.columnManager.renderer.reinitializeColumnWidths(columns);\r\n\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n};","//resize columns to fit data the contain and stretch last column to fill table\r\nexport default function(columns){\r\n\tvar colsWidth = 0,\r\n\ttableWidth = this.table.rowManager.element.clientWidth,\r\n\tgap = 0,\r\n\tlastCol = false;\r\n\r\n\tcolumns.forEach((column, i) => {\r\n\t\tif(!column.widthFixed){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t}\r\n\r\n\t\tif(this.table.options.responsiveLayout ? column.modules.responsive.visible : column.visible){\r\n\t\t\tlastCol = column;\r\n\t\t}\r\n\r\n\t\tif(column.visible){\r\n\t\t\tcolsWidth += column.getWidth();\r\n\t\t}\r\n\t});\r\n\r\n\tif(lastCol){\r\n\t\tgap = tableWidth - colsWidth + lastCol.getWidth();\r\n\r\n\t\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\t\tlastCol.setWidth(0);\r\n\t\t\tthis.table.modules.responsiveLayout.update();\r\n\t\t}\r\n\r\n\t\tif(gap > 0){\r\n\t\t\tlastCol.setWidth(gap);\r\n\t\t}else{\r\n\t\t\tlastCol.reinitializeWidth();\r\n\t\t}\r\n\t}else{\r\n\t\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\t\tthis.table.modules.responsiveLayout.update();\r\n\t\t}\r\n\t}\r\n};","//resize columns to fit data they contain and stretch row to fill table, also used for fitDataTable\r\nexport default function(columns){\r\n\tcolumns.forEach(function(column){\r\n\t\tcolumn.reinitializeWidth();\r\n\t});\r\n\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultModes from './defaults/modes.js';\r\n\r\nclass Layout extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table, \"layout\");\r\n\r\n\t\tthis.mode = null;\r\n\r\n\t\tthis.registerTableOption(\"layout\", \"fitData\"); //layout type\r\n\t\tthis.registerTableOption(\"layoutColumnsOnNewData\", false); //update column widths on setData\r\n\r\n\t\tthis.registerColumnOption(\"widthGrow\");\r\n\t\tthis.registerColumnOption(\"widthShrink\");\r\n\t}\r\n\r\n\t//initialize layout system\r\n\tinitialize(){\r\n\t\tvar layout = this.table.options.layout;\r\n\r\n\t\tif(Layout.modes[layout]){\r\n\t\t\tthis.mode = layout;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Layout Error - invalid mode set, defaulting to 'fitData' : \" + layout);\r\n\t\t\tthis.mode = 'fitData';\r\n\t\t}\r\n\r\n\t\tthis.table.element.setAttribute(\"tabulator-layout\", this.mode);\r\n\t}\r\n\r\n\tgetMode(){\r\n\t\treturn this.mode;\r\n\t}\r\n\r\n\t//trigger table layout\r\n\tlayout(){\r\n\t\tthis.dispatch(\"layout-refreshing\")\r\n\t\tLayout.modes[this.mode].call(this, this.table.columnManager.columnsByIndex);\r\n\r\n\t\tthis.dispatch(\"layout-refreshed\")\r\n\t}\r\n}\r\n\r\nLayout.moduleName = \"layout\";\r\n\r\n//load defaults\r\nLayout.modes = defaultModes;\r\n\r\nexport default Layout;","//resize columns to fit\r\nexport default function(columns){\r\n\tvar totalWidth = this.table.element.clientWidth; //table element width\r\n\tvar fixedWidth = 0; //total width of columns with a defined width\r\n\tvar flexWidth = 0; //total width available to flexible columns\r\n\tvar flexGrowUnits = 0; //total number of widthGrow blocks accross all columns\r\n\tvar flexColWidth = 0; //desired width of flexible columns\r\n\tvar flexColumns = []; //array of flexible width columns\r\n\tvar fixedShrinkColumns = []; //array of fixed width columns that can shrink\r\n\tvar flexShrinkUnits = 0; //total number of widthShrink blocks accross all columns\r\n\tvar overflowWidth = 0; //horizontal overflow width\r\n\tvar gapFill=0; //number of pixels to be added to final column to close and half pixel gaps\r\n\r\n\tfunction calcWidth(width){\r\n\t\tvar colWidth;\r\n\r\n\t\tif(typeof(width) == \"string\"){\r\n\t\t\tif(width.indexOf(\"%\") > -1){\r\n\t\t\t\tcolWidth = (totalWidth / 100) * parseInt(width);\r\n\t\t\t}else{\r\n\t\t\t\tcolWidth = parseInt(width);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcolWidth = width;\r\n\t\t}\r\n\r\n\t\treturn colWidth;\r\n\t}\r\n\r\n\t//ensure columns resize to take up the correct amount of space\r\n\tfunction scaleColumns(columns, freeSpace, colWidth, shrinkCols){\r\n\r\n\t\tvar oversizeCols = [],\r\n\t\toversizeSpace = 0,\r\n\t\tremainingSpace = 0,\r\n\t\tnextColWidth = 0,\r\n\t\tremainingFlexGrowUnits = flexGrowUnits,\r\n\t\tgap = 0,\r\n\t\tchangeUnits = 0,\r\n\t\tundersizeCols = [];\r\n\r\n\t\tfunction calcGrow(col){\r\n\t\t\treturn (colWidth * (col.column.definition.widthGrow || 1));\r\n\t\t}\r\n\r\n\t\tfunction calcShrink(col){\r\n\t\t\treturn (calcWidth(col.width) - (colWidth * (col.column.definition.widthShrink || 0)))\r\n\t\t}\r\n\r\n\t\tcolumns.forEach(function(col, i){\r\n\t\t\tvar width = shrinkCols ? calcShrink(col) : calcGrow(col);\r\n\t\t\tif(col.column.minWidth >= width){\r\n\t\t\t\toversizeCols.push(col);\r\n\t\t\t}else{\r\n\t\t\t\tif(col.column.maxWidth && col.column.maxWidth < width){\r\n\t\t\t\t\tcol.width = col.column.maxWidth;\r\n\t\t\t\t\tfreeSpace -= col.column.maxWidth;\r\n\r\n\t\t\t\t\tremainingFlexGrowUnits -= shrinkCols ? (col.column.definition.widthShrink || 1) : (col.column.definition.widthGrow || 1);\r\n\r\n\t\t\t\t\tif(remainingFlexGrowUnits){\r\n\t\t\t\t\t\tcolWidth = Math.floor(freeSpace/remainingFlexGrowUnits);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tundersizeCols.push(col);\r\n\t\t\t\t\tchangeUnits += shrinkCols ? (col.column.definition.widthShrink || 1) : (col.column.definition.widthGrow || 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(oversizeCols.length){\r\n\t\t\toversizeCols.forEach(function(col){\r\n\t\t\t\toversizeSpace += shrinkCols ? col.width - col.column.minWidth : col.column.minWidth;\r\n\t\t\t\tcol.width = col.column.minWidth;\r\n\t\t\t});\r\n\r\n\t\t\tremainingSpace = freeSpace - oversizeSpace;\r\n\r\n\t\t\tnextColWidth = changeUnits ? Math.floor(remainingSpace/changeUnits) : remainingSpace;\r\n\r\n\t\t\tgap = remainingSpace - (nextColWidth * changeUnits);\r\n\r\n\t\t\tgap += scaleColumns(undersizeCols, remainingSpace, nextColWidth, shrinkCols);\r\n\t\t}else{\r\n\t\t\tgap = changeUnits ? freeSpace - (Math.floor(freeSpace/changeUnits) * changeUnits) : freeSpace;\r\n\r\n\t\t\tundersizeCols.forEach(function(column){\r\n\t\t\t\tcolumn.width = shrinkCols ? calcShrink(column) : calcGrow(column);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn gap;\r\n\t}\r\n\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n\r\n\t//adjust for vertical scrollbar if present\r\n\tif(this.table.rowManager.element.scrollHeight > this.table.rowManager.element.clientHeight){\r\n\t\ttotalWidth -= this.table.rowManager.element.offsetWidth - this.table.rowManager.element.clientWidth;\r\n\t}\r\n\r\n\tcolumns.forEach(function(column){\r\n\t\tvar width, minWidth, colWidth;\r\n\r\n\t\tif(column.visible){\r\n\r\n\t\t\twidth = column.definition.width;\r\n\t\t\tminWidth = parseInt(column.minWidth);\r\n\r\n\t\t\tif(width){\r\n\r\n\t\t\t\tcolWidth = calcWidth(width);\r\n\r\n\t\t\t\tfixedWidth += colWidth > minWidth ? colWidth : minWidth;\r\n\r\n\t\t\t\tif(column.definition.widthShrink){\r\n\t\t\t\t\tfixedShrinkColumns.push({\r\n\t\t\t\t\t\tcolumn:column,\r\n\t\t\t\t\t\twidth:colWidth > minWidth ? colWidth : minWidth\r\n\t\t\t\t\t});\r\n\t\t\t\t\tflexShrinkUnits += column.definition.widthShrink;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tflexColumns.push({\r\n\t\t\t\t\tcolumn:column,\r\n\t\t\t\t\twidth:0,\r\n\t\t\t\t});\r\n\t\t\t\tflexGrowUnits += column.definition.widthGrow || 1;\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\t//calculate available space\r\n\tflexWidth = totalWidth - fixedWidth;\r\n\r\n\t//calculate correct column size\r\n\tflexColWidth = Math.floor(flexWidth / flexGrowUnits)\r\n\r\n\t//generate column widths\r\n\tvar gapFill = scaleColumns(flexColumns, flexWidth, flexColWidth, false);\r\n\r\n\t//increase width of last column to account for rounding errors\r\n\tif(flexColumns.length && gapFill > 0){\r\n\t\tflexColumns[flexColumns.length-1].width += + gapFill;\r\n\t}\r\n\r\n\t//caculate space for columns to be shrunk into\r\n\tflexColumns.forEach(function(col){\r\n\t\tflexWidth -= col.width;\r\n\t});\r\n\r\n\toverflowWidth = Math.abs(gapFill) + flexWidth;\r\n\r\n\t//shrink oversize columns if there is no available space\r\n\tif(overflowWidth > 0 && flexShrinkUnits){\r\n\t\tgapFill = scaleColumns(fixedShrinkColumns, overflowWidth, Math.floor(overflowWidth / flexShrinkUnits), true);\r\n\t}\r\n\r\n\t//decrease width of last column to account for rounding errors\r\n\tif(fixedShrinkColumns.length){\r\n\t\tfixedShrinkColumns[fixedShrinkColumns.length-1].width -= gapFill;\r\n\t}\r\n\r\n\tflexColumns.forEach(function(col){\r\n\t\tcol.column.setWidth(col.width);\r\n\t});\r\n\r\n\tfixedShrinkColumns.forEach(function(col){\r\n\t\tcol.column.setWidth(col.width);\r\n\t});\r\n};","import fitData from './modes/fitData.js';\r\nimport fitDataGeneral from './modes/fitDataGeneral.js';\r\nimport fitDataStretch from './modes/fitDataStretch.js';\r\nimport fitColumns from './modes/fitColumns.js';\r\n\r\nexport default {\r\n\tfitData:fitData,\r\n\tfitDataFill:fitDataGeneral,\r\n\tfitDataTable:fitDataGeneral,\r\n\tfitDataStretch:fitDataStretch,\r\n\tfitColumns:fitColumns ,\r\n};","export default {\r\n\t\"default\":{ //hold default locale text\r\n\t\t\"groups\":{\r\n\t\t\t\"item\":\"item\",\r\n\t\t\t\"items\":\"items\",\r\n\t\t},\r\n\t\t\"columns\":{\r\n\t\t},\r\n\t\t\"data\":{\r\n\t\t\t\"loading\":\"Loading\",\r\n\t\t\t\"error\":\"Error\",\r\n\t\t},\r\n\t\t\"pagination\":{\r\n\t\t\t\"page_size\":\"Page Size\",\r\n\t\t\t\"page_title\":\"Show Page\",\r\n\t\t\t\"first\":\"First\",\r\n\t\t\t\"first_title\":\"First Page\",\r\n\t\t\t\"last\":\"Last\",\r\n\t\t\t\"last_title\":\"Last Page\",\r\n\t\t\t\"prev\":\"Prev\",\r\n\t\t\t\"prev_title\":\"Prev Page\",\r\n\t\t\t\"next\":\"Next\",\r\n\t\t\t\"next_title\":\"Next Page\",\r\n\t\t\t\"all\":\"All\",\r\n\t\t\t\"counter\":{\r\n\t\t\t\t\"showing\": \"Showing\",\r\n\t\t\t\t\"of\": \"of\",\r\n\t\t\t\t\"rows\": \"rows\",\r\n\t\t\t\t\"pages\": \"pages\",\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"headerFilters\":{\r\n\t\t\t\"default\":\"filter column...\",\r\n\t\t\t\"columns\":{}\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defaultLangs from './defaults/langs.js';\r\n\r\nclass Localize extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.locale = \"default\"; //current locale\r\n\t\tthis.lang = false; //current language\r\n\t\tthis.bindings = {}; //update events to call when locale is changed\r\n\t\tthis.langList = {};\r\n\r\n\t\tthis.registerTableOption(\"locale\", false); //current system language\r\n\t\tthis.registerTableOption(\"langs\", {});\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.langList = Helpers.deepClone(Localize.langs);\r\n\r\n\t\tif(this.table.options.columnDefaults.headerFilterPlaceholder !== false){\r\n\t\t\tthis.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder);\r\n\t\t}\r\n\r\n\t\tfor(let locale in this.table.options.langs){\r\n\t\t\tthis.installLang(locale, this.table.options.langs[locale]);\r\n\t\t}\r\n\r\n\t\tthis.setLocale(this.table.options.locale);\r\n\r\n\t\tthis.registerTableFunction(\"setLocale\", this.setLocale.bind(this));\r\n\t\tthis.registerTableFunction(\"getLocale\", this.getLocale.bind(this));\r\n\t\tthis.registerTableFunction(\"getLang\", this.getLang.bind(this));\r\n\t}\r\n\r\n\t//set header placehoder\r\n\tsetHeaderFilterPlaceholder(placeholder){\r\n\t\tthis.langList.default.headerFilters.default = placeholder;\r\n\t}\r\n\r\n\t//set header filter placeholder by column\r\n\tsetHeaderFilterColumnPlaceholder(column, placeholder){\r\n\t\tthis.langList.default.headerFilters.columns[column] = placeholder;\r\n\r\n\t\tif(this.lang && !this.lang.headerFilters.columns[column]){\r\n\t\t\tthis.lang.headerFilters.columns[column] = placeholder;\r\n\t\t}\r\n\t}\r\n\r\n\t//setup a lang description object\r\n\tinstallLang(locale, lang){\r\n\t\tif(this.langList[locale]){\r\n\t\t\tthis._setLangProp(this.langList[locale], lang);\r\n\t\t}else{\r\n\t\t\tthis.langList[locale] = lang;\r\n\t\t}\r\n\t}\r\n\r\n\t_setLangProp(lang, values){\r\n\t\tfor(let key in values){\r\n\t\t\tif(lang[key] && typeof lang[key] == \"object\"){\r\n\t\t\t\tthis._setLangProp(lang[key], values[key])\r\n\t\t\t}else{\r\n\t\t\t\tlang[key] = values[key];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//set current locale\r\n\tsetLocale(desiredLocale){\r\n\t\tdesiredLocale = desiredLocale || \"default\";\r\n\r\n\t\t//fill in any matching languge values\r\n\t\tfunction traverseLang(trans, path){\r\n\t\t\tfor(var prop in trans){\r\n\t\t\t\tif(typeof trans[prop] == \"object\"){\r\n\t\t\t\t\tif(!path[prop]){\r\n\t\t\t\t\t\tpath[prop] = {};\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttraverseLang(trans[prop], path[prop]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tpath[prop] = trans[prop];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//determing correct locale to load\r\n\t\tif(desiredLocale === true && navigator.language){\r\n\t\t\t//get local from system\r\n\t\t\tdesiredLocale = navigator.language.toLowerCase();\r\n\t\t}\r\n\r\n\t\tif(desiredLocale){\r\n\t\t\t//if locale is not set, check for matching top level locale else use default\r\n\t\t\tif(!this.langList[desiredLocale]){\r\n\t\t\t\tlet prefix = desiredLocale.split(\"-\")[0];\r\n\r\n\t\t\t\tif(this.langList[prefix]){\r\n\t\t\t\t\tconsole.warn(\"Localization Error - Exact matching locale not found, using closest match: \", desiredLocale, prefix);\r\n\t\t\t\t\tdesiredLocale = prefix;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Localization Error - Matching locale not found, using default: \", desiredLocale);\r\n\t\t\t\t\tdesiredLocale = \"default\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.locale = desiredLocale;\r\n\r\n\t\t//load default lang template\r\n\t\tthis.lang = Helpers.deepClone(this.langList.default || {});\r\n\r\n\t\tif(desiredLocale != \"default\"){\r\n\t\t\ttraverseLang(this.langList[desiredLocale], this.lang);\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(\"localized\", this.locale, this.lang);\r\n\r\n\t\tthis._executeBindings();\r\n\t}\r\n\r\n\t//get current locale\r\n\tgetLocale(locale){\r\n\t\treturn this.locale;\r\n\t}\r\n\r\n\t//get lang object for given local or current if none provided\r\n\tgetLang(locale){\r\n\t\treturn locale ? this.langList[locale] : this.lang;\r\n\t}\r\n\r\n\t//get text for current locale\r\n\tgetText(path, value){\r\n\t\tvar path = value ? path + \"|\" + value : path,\r\n\t\tpathArray = path.split(\"|\"),\r\n\t\ttext = this._getLangElement(pathArray, this.locale);\r\n\r\n\t\t// if(text === false){\r\n\t\t// \tconsole.warn(\"Localization Error - Matching localized text not found for given path: \", path);\r\n\t\t// }\r\n\r\n\t\treturn text || \"\";\r\n\t}\r\n\r\n\t//traverse langs object and find localized copy\r\n\t_getLangElement(path, locale){\r\n\t\tvar root = this.lang;\r\n\r\n\t\tpath.forEach(function(level){\r\n\t\t\tvar rootPath;\r\n\r\n\t\t\tif(root){\r\n\t\t\t\trootPath = root[level];\r\n\r\n\t\t\t\tif(typeof rootPath != \"undefined\"){\r\n\t\t\t\t\troot = rootPath;\r\n\t\t\t\t}else{\r\n\t\t\t\t\troot = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn root;\r\n\t}\r\n\r\n\t//set update binding\r\n\tbind(path, callback){\r\n\t\tif(!this.bindings[path]){\r\n\t\t\tthis.bindings[path] = [];\r\n\t\t}\r\n\r\n\t\tthis.bindings[path].push(callback);\r\n\r\n\t\tcallback(this.getText(path), this.lang);\r\n\t}\r\n\r\n\t//itterate through bindings and trigger updates\r\n\t_executeBindings(){\r\n\t\tfor(let path in this.bindings){\r\n\t\t\tthis.bindings[path].forEach((binding) => {\r\n\t\t\t\tbinding(this.getText(path), this.lang);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n}\r\n\r\nLocalize.moduleName = \"localize\";\r\n\r\n//load defaults\r\nLocalize.langs = defaultLangs;\r\n\r\nexport default Localize;","import Module from '../../core/Module.js';\r\nimport TableRegistry from '../../core/tools/TableRegistry.js';\r\n\r\nclass Comms extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"tableComms\", this.receive.bind(this));\r\n\t}\r\n\r\n\tgetConnections(selectors){\r\n\t\tvar connections = [],\r\n\t\tconnection;\r\n\r\n\t\tconnection = TableRegistry.lookupTable(selectors);\r\n\r\n\t\tconnection.forEach((con) =>{\r\n\t\t\tif(this.table !== con){\r\n\t\t\t\tconnections.push(con);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn connections;\r\n\t}\r\n\r\n\tsend(selectors, module, action, data){\r\n\t\tvar connections = this.getConnections(selectors);\r\n\r\n\t\tconnections.forEach((connection) => {\r\n\t\t\tconnection.tableComms(this.table.element, module, action, data);\r\n\t\t});\r\n\r\n\t\tif(!connections.length && selectors){\r\n\t\t\tconsole.warn(\"Table Connection Error - No tables matching selector found\", selectors);\r\n\t\t}\r\n\t}\r\n\r\n\treceive(table, module, action, data){\r\n\t\tif(this.table.modExists(module)){\r\n\t\t\treturn this.table.modules[module].commsReceived(table, action, data);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Inter-table Comms Error - no such module:\", module);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nComms.moduleName = \"comms\";\r\n\r\nexport default Comms;","import * as coreModules from '../modules/core.js';\r\nimport TableRegistry from './TableRegistry.js';\r\n\r\nexport default class ModuleBinder {\r\n\t\r\n\tconstructor(tabulator, modules){\r\n\t\tthis.bindStaticFuctionality(tabulator);\r\n\t\tthis.bindModules(tabulator, coreModules, true);\r\n\t\t\r\n\t\tif(modules){\r\n\t\t\tthis.bindModules(tabulator, modules);\r\n\t\t}\r\n\t}\r\n\t\r\n\tbindStaticFuctionality(tabulator){\r\n\t\ttabulator.moduleBindings = {};\r\n\t\t\r\n\t\ttabulator.extendModule = function(name, property, values){\r\n\t\t\tif(tabulator.moduleBindings[name]){\r\n\t\t\t\tvar source = tabulator.moduleBindings[name][property];\r\n\t\t\t\t\r\n\t\t\t\tif(source){\r\n\t\t\t\t\tif(typeof values == \"object\"){\r\n\t\t\t\t\t\tfor(let key in values){\r\n\t\t\t\t\t\t\tsource[key] = values[key];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Module Error - Invalid value type, it must be an object\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Module Error - property does not exist:\", property);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Module Error - module does not exist:\", name);\r\n\t\t\t}\r\n\t\t};\r\n\t\t\r\n\t\ttabulator.registerModule = function(modules){\r\n\t\t\tif(!Array.isArray(modules)){\r\n\t\t\t\tmodules = [modules];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmodules.forEach((mod) => {\r\n\t\t\t\ttabulator.registerModuleBinding(mod)\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\ttabulator.registerModuleBinding = function(mod){\r\n\t\t\ttabulator.moduleBindings[mod.moduleName] = mod;\r\n\t\t};\r\n\t\t\r\n\t\ttabulator.findTable = function(query){\r\n\t\t\tvar results = TableRegistry.lookupTable(query, true);\r\n\t\t\treturn Array.isArray(results) && !results.length ? false : results;\r\n\t\t}\r\n\t\t\r\n\t\t//ensure that module are bound to instantiated function\r\n\t\ttabulator.prototype.bindModules = function(){\r\n\t\t\tvar orderedStartMods = [],\r\n\t\t\torderedEndMods = [],\r\n\t\t\tunOrderedMods = [];\r\n\t\t\t\r\n\t\t\tthis.modules = {};\r\n\t\t\t\r\n\t\t\tfor(var name in tabulator.moduleBindings){\r\n\t\t\t\tlet mod = tabulator.moduleBindings[name];\r\n\t\t\t\tlet module = new mod(this);\r\n\t\t\t\t\r\n\t\t\t\tthis.modules[name] = module;\r\n\t\t\t\t\r\n\t\t\t\tif(mod.prototype.moduleCore){\r\n\t\t\t\t\tthis.modulesCore.push(module);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(mod.moduleInitOrder){\r\n\t\t\t\t\t\tif(mod.moduleInitOrder < 0){\r\n\t\t\t\t\t\t\torderedStartMods.push(module);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\torderedEndMods.push(module);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tunOrderedMods.push(module);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\torderedStartMods.sort((a, b) => a.moduleInitOrder > b.moduleInitOrder ? 1 : -1);\r\n\t\t\torderedEndMods.sort((a, b) => a.moduleInitOrder > b.moduleInitOrder ? 1 : -1);\r\n\t\t\t\r\n\t\t\tthis.modulesRegular = orderedStartMods.concat(unOrderedMods.concat(orderedEndMods));\r\n\t\t}\r\n\t}\r\n\t\r\n\tbindModules(tabulator, modules, core){\r\n\t\tvar mods = Object.values(modules);\r\n\t\t\r\n\t\tif(core){\r\n\t\t\tmods.forEach((mod) => {\r\n\t\t\t\tmod.prototype.moduleCore = true;\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\ttabulator.registerModule(mods);\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from './Helpers.js';\r\n\r\nexport default class Alert extends CoreFeature{\r\n constructor(table){\r\n super(table);\r\n \r\n this.element = this._createAlertElement();\r\n this.msgElement = this._createMsgElement();\r\n this.type = null;\r\n \r\n this.element.appendChild(this.msgElement);\r\n }\r\n \r\n _createAlertElement(){\r\n var el = document.createElement(\"div\");\r\n el.classList.add(\"tabulator-alert\");\r\n return el;\r\n }\r\n \r\n _createMsgElement(){\r\n var el = document.createElement(\"div\");\r\n el.classList.add(\"tabulator-alert-msg\");\r\n el.setAttribute(\"role\", \"alert\");\r\n return el;\r\n }\r\n \r\n _typeClass(){\r\n return \"tabulator-alert-state-\" + this.type;\r\n }\r\n \r\n alert(content, type = \"msg\"){\r\n if(content){\r\n this.clear();\r\n \r\n this.type = type;\r\n \r\n while(this.msgElement.firstChild) this.msgElement.removeChild(this.msgElement.firstChild);\r\n \r\n this.msgElement.classList.add(this._typeClass());\r\n \r\n if(typeof content === \"function\"){\r\n content = content();\r\n }\r\n \r\n if(content instanceof HTMLElement){\r\n this.msgElement.appendChild(content);\r\n }else{\r\n this.msgElement.innerHTML = content;\r\n }\r\n \r\n this.table.element.appendChild(this.element);\r\n }\r\n }\r\n \r\n clear(){\r\n if(this.element.parentNode){\r\n this.element.parentNode.removeChild(this.element);\r\n }\r\n \r\n this.msgElement.classList.remove(this._typeClass());\r\n }\r\n}","'use strict';\r\n\r\nimport defaultOptions from './defaults/options.js';\r\n\r\nimport ColumnManager from './ColumnManager.js';\r\nimport RowManager from './RowManager.js';\r\nimport FooterManager from './FooterManager.js';\r\n\r\nimport InteractionMonitor from './tools/InteractionMonitor.js';\r\nimport ComponentFunctionBinder from './tools/ComponentFunctionBinder.js';\r\nimport DataLoader from './tools/DataLoader.js';\r\n\r\nimport ExternalEventBus from './tools/ExternalEventBus.js';\r\nimport InternalEventBus from './tools/InternalEventBus.js';\r\n\r\nimport TableRegistry from './tools/TableRegistry.js';\r\nimport ModuleBinder from './tools/ModuleBinder.js';\r\n\r\nimport OptionsList from './tools/OptionsList.js';\r\n\r\nimport Alert from './tools/Alert.js';\r\n\r\nclass Tabulator {\r\n\t\r\n\tconstructor(element, options){\r\n\t\t\r\n\t\tthis.options = {};\r\n\t\t\r\n\t\tthis.columnManager = null; // hold Column Manager\r\n\t\tthis.rowManager = null; //hold Row Manager\r\n\t\tthis.footerManager = null; //holder Footer Manager\r\n\t\tthis.alertManager = null; //hold Alert Manager\r\n\t\tthis.vdomHoz = null; //holder horizontal virtual dom\r\n\t\tthis.externalEvents = null; //handle external event messaging\r\n\t\tthis.eventBus = null; //handle internal event messaging\r\n\t\tthis.interactionMonitor = false; //track user interaction\r\n\t\tthis.browser = \"\"; //hold current browser type\r\n\t\tthis.browserSlow = false; //handle reduced functionality for slower browsers\r\n\t\tthis.browserMobile = false; //check if running on mobile, prevent resize cancelling edit on keyboard appearance\r\n\t\tthis.rtl = false; //check if the table is in RTL mode\r\n\t\tthis.originalElement = null; //hold original table element if it has been replaced\r\n\t\t\r\n\t\tthis.componentFunctionBinder = new ComponentFunctionBinder(this); //bind component functions\r\n\t\tthis.dataLoader = false; //bind component functions\r\n\t\t\r\n\t\tthis.modules = {}; //hold all modules bound to this table\r\n\t\tthis.modulesCore = []; //hold core modules bound to this table (for initialization purposes)\r\n\t\tthis.modulesRegular = []; //hold regular modules bound to this table (for initialization purposes)\r\n\t\t\r\n\t\tthis.optionsList = new OptionsList(this, \"table constructor\");\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\t\r\n\t\tif(this.initializeElement(element)){\r\n\t\t\t\r\n\t\t\tthis.initializeCoreSystems(options);\r\n\t\t\t\r\n\t\t\t//delay table creation to allow event bindings immediately after the constructor\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tthis._create();\r\n\t\t\t})\r\n\t\t}\r\n\t\t\r\n\t\tTableRegistry.register(this); //register table for inter-device communication\r\n\t}\r\n\t\r\n\tinitializeElement(element){\r\n\t\tif(typeof HTMLElement !== \"undefined\" && element instanceof HTMLElement){\r\n\t\t\tthis.element = element;\r\n\t\t\treturn true;\r\n\t\t}else if(typeof element === \"string\"){\r\n\t\t\tthis.element = document.querySelector(element);\r\n\t\t\t\r\n\t\t\tif(this.element){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Tabulator Creation Error - no element found matching selector: \", element);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Tabulator Creation Error - Invalid element provided:\", element);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeCoreSystems(options){\r\n\t\tthis.columnManager = new ColumnManager(this);\r\n\t\tthis.rowManager = new RowManager(this);\r\n\t\tthis.footerManager = new FooterManager(this);\r\n\t\tthis.dataLoader = new DataLoader(this);\r\n\t\tthis.alertManager = new Alert(this);\r\n\t\t\r\n\t\tthis.bindModules();\r\n\t\t\r\n\t\tthis.options = this.optionsList.generate(Tabulator.defaultOptions, options)\r\n\t\t\r\n\t\tthis._clearObjectPointers();\r\n\t\t\r\n\t\tthis._mapDeprecatedFunctionality();\r\n\t\t\r\n\t\tthis.externalEvents = new ExternalEventBus(this, this.options, this.options.debugEventsExternal);\r\n\t\tthis.eventBus = new InternalEventBus(this.options.debugEventsInternal);\r\n\t\t\r\n\t\tthis.interactionMonitor = new InteractionMonitor(this);\r\n\t\t\r\n\t\tthis.dataLoader.initialize();\r\n\t\t// this.columnManager.initialize();\r\n\t\t// this.rowManager.initialize();\r\n\t\tthis.footerManager.initialize();\r\n\t}\r\n\t\r\n\t//convert deprecated functionality to new functions\r\n\t_mapDeprecatedFunctionality(){\r\n\t\t//all previously deprecated functionality removed in the 5.0 release\r\n\t}\r\n\t\r\n\t_clearSelection(){\r\n\t\t\r\n\t\tthis.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\tif (window.getSelection) {\r\n\t\t\tif (window.getSelection().empty) { // Chrome\r\n\t\t\t\twindow.getSelection().empty();\r\n\t\t\t} else if (window.getSelection().removeAllRanges) { // Firefox\r\n\t\t\t\twindow.getSelection().removeAllRanges();\r\n\t\t\t}\r\n\t\t} else if (document.selection) { // IE?\r\n\t\t\tdocument.selection.empty();\r\n\t\t}\r\n\t\t\r\n\t\tthis.element.classList.remove(\"tabulator-block-select\");\r\n\t}\r\n\t\r\n\t//create table\r\n\t_create(){\r\n\t\tthis.externalEvents.dispatch(\"tableBuilding\");\r\n\t\tthis.eventBus.dispatch(\"table-building\");\r\n\t\t\r\n\t\tthis._rtlCheck();\r\n\t\t\r\n\t\tthis._buildElement();\r\n\t\t\r\n\t\tthis._initializeTable();\r\n\t\t\r\n\t\tthis._loadInitialData();\r\n\t\t\r\n\t\tthis.initialized = true;\r\n\t\t\r\n\t\tthis.externalEvents.dispatch(\"tableBuilt\");\r\n\t}\r\n\t\r\n\t_rtlCheck(){\r\n\t\tvar style = window.getComputedStyle(this.element);\r\n\t\t\r\n\t\tswitch(this.options.textDirection){\r\n\t\t\tcase\"auto\":\r\n\t\t\tif(style.direction !== \"rtl\"){\r\n\t\t\t\tbreak;\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tcase \"rtl\":\r\n\t\t\tthis.element.classList.add(\"tabulator-rtl\");\r\n\t\t\tthis.rtl = true;\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"ltr\":\r\n\t\t\tthis.element.classList.add(\"tabulator-ltr\");\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\tthis.rtl = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//clear pointers to objects in default config object\r\n\t_clearObjectPointers(){\r\n\t\tthis.options.columns = this.options.columns.slice(0);\r\n\t\t\r\n\t\tif(Array.isArray(this.options.data) && !this.options.reactiveData){\r\n\t\t\tthis.options.data = this.options.data.slice(0);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//build tabulator element\r\n\t_buildElement(){\r\n\t\tvar element = this.element,\r\n\t\toptions = this.options,\r\n\t\tnewElement;\r\n\t\t\r\n\t\tif(element.tagName === \"TABLE\"){\r\n\t\t\tthis.originalElement = this.element;\r\n\t\t\tnewElement = document.createElement(\"div\");\r\n\t\t\t\r\n\t\t\t//transfer attributes to new element\r\n\t\t\tvar attributes = element.attributes;\r\n\t\t\t\r\n\t\t\t// loop through attributes and apply them on div\r\n\t\t\tfor(var i in attributes){\r\n\t\t\t\tif(typeof attributes[i] == \"object\"){\r\n\t\t\t\t\tnewElement.setAttribute(attributes[i].name, attributes[i].value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// replace table with div element\r\n\t\t\telement.parentNode.replaceChild(newElement, element);\r\n\t\t\t\r\n\t\t\tthis.element = element = newElement;\r\n\t\t}\r\n\t\t\r\n\t\telement.classList.add(\"tabulator\");\r\n\t\telement.setAttribute(\"role\", \"grid\");\r\n\t\t\r\n\t\t//empty element\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\t\r\n\t\t//set table height\r\n\t\tif(options.height){\r\n\t\t\toptions.height = isNaN(options.height) ? options.height : options.height + \"px\";\r\n\t\t\telement.style.height = options.height;\r\n\t\t}\r\n\t\t\r\n\t\t//set table min height\r\n\t\tif(options.minHeight !== false){\r\n\t\t\toptions.minHeight = isNaN(options.minHeight) ? options.minHeight : options.minHeight + \"px\";\r\n\t\t\telement.style.minHeight = options.minHeight;\r\n\t\t}\r\n\t\t\r\n\t\t//set table maxHeight\r\n\t\tif(options.maxHeight !== false){\r\n\t\t\toptions.maxHeight = isNaN(options.maxHeight) ? options.maxHeight : options.maxHeight + \"px\";\r\n\t\t\telement.style.maxHeight = options.maxHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//initialize core systems and modules\r\n\t_initializeTable(){\r\n\t\tvar element = this.element,\r\n\t\toptions = this.options;\r\n\t\t\r\n\t\tthis.interactionMonitor.initialize();\r\n\t\t\r\n\t\tthis.columnManager.initialize();\r\n\t\tthis.rowManager.initialize();\r\n\t\t\r\n\t\tthis._detectBrowser();\r\n\t\t\r\n\t\t//initialize core modules\r\n\t\tthis.modulesCore.forEach((mod) => {\r\n\t\t\tmod.initialize();\r\n\t\t})\r\n\t\t\r\n\t\t//build table elements\r\n\t\telement.appendChild(this.columnManager.getElement());\r\n\t\telement.appendChild(this.rowManager.getElement());\r\n\t\t\r\n\t\tif(options.footerElement){\r\n\t\t\tthis.footerManager.activate();\r\n\t\t}\r\n\t\t\r\n\t\tif(options.autoColumns && options.data){\r\n\t\t\t\r\n\t\t\tthis.columnManager.generateColumnsFromRowData(this.options.data);\r\n\t\t}\r\n\t\t\r\n\t\t//initialize regular modules\r\n\t\tthis.modulesRegular.forEach((mod) => {\r\n\t\t\tmod.initialize();\r\n\t\t});\r\n\t\t\r\n\t\tthis.columnManager.setColumns(options.columns);\r\n\t\t\r\n\t\tthis.eventBus.dispatch(\"table-built\");\r\n\t}\r\n\t\r\n\t_loadInitialData(){\r\n\t\tthis.dataLoader.load(this.options.data);\r\n\t}\r\n\t\r\n\t//deconstructor\r\n\tdestroy(){\r\n\t\tvar element = this.element;\r\n\t\t\r\n\t\tTableRegistry.deregister(this); //deregister table from inter-device communication\r\n\t\t\r\n\t\tthis.eventBus.dispatch(\"table-destroy\");\r\n\t\t\r\n\t\t//clear row data\r\n\t\tthis.rowManager.rows.forEach(function(row){\r\n\t\t\trow.wipe();\r\n\t\t});\r\n\t\t\r\n\t\tthis.rowManager.rows = [];\r\n\t\tthis.rowManager.activeRows = [];\r\n\t\tthis.rowManager.displayRows = [];\r\n\t\t\r\n\t\t//clear DOM\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\telement.classList.remove(\"tabulator\");\r\n\t}\r\n\t\r\n\t_detectBrowser(){\r\n\t\tvar ua = navigator.userAgent||navigator.vendor||window.opera;\r\n\t\t\r\n\t\tif(ua.indexOf(\"Trident\") > -1){\r\n\t\t\tthis.browser = \"ie\";\r\n\t\t\tthis.browserSlow = true;\r\n\t\t}else if(ua.indexOf(\"Edge\") > -1){\r\n\t\t\tthis.browser = \"edge\";\r\n\t\t\tthis.browserSlow = true;\r\n\t\t}else if(ua.indexOf(\"Firefox\") > -1){\r\n\t\t\tthis.browser = \"firefox\";\r\n\t\t\tthis.browserSlow = false;\r\n\t\t}else{\r\n\t\t\tthis.browser = \"other\";\r\n\t\t\tthis.browserSlow = false;\r\n\t\t}\r\n\t\t\r\n\t\tthis.browserMobile = /(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ua)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(ua.slice(0,4));\r\n\t}\r\n\t\r\n\tinitGuard(func, msg){\r\n\t\tvar stack, line;\r\n\t\t\r\n\t\tif(this.options.debugInitialization && !this.initialized){\r\n\t\t\tif(!func){\r\n\t\t\t\tstack = new Error().stack.split(\"\\n\");\r\n\t\t\t\t\r\n\t\t\t\tline = stack[0] == \"Error\" ? stack[2] : stack[1];\r\n\t\t\t\t\r\n\t\t\t\tif(line[0] == \" \"){\r\n\t\t\t\t\tfunc = line.trim().split(\" \")[1].split(\".\")[1];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfunc = line.trim().split(\"@\")[0];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconsole.warn(\"Table Not Initialized - Calling the \" + func + \" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function.\" + (msg ? \" \" + msg : \"\"));\r\n\t\t}\r\n\t\t\r\n\t\treturn this.initialized;\r\n\t}\r\n\t\r\n\t////////////////// Data Handling //////////////////\r\n\t//block table redrawing\r\n\tblockRedraw(){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.rowManager.blockRedraw();\r\n\t}\r\n\t\r\n\t//restore table redrawing\r\n\trestoreRedraw(){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.rowManager.restoreRedraw();\r\n\t}\r\n\t\r\n\t//load data\r\n\tsetData(data, params, config){\r\n\t\tthis.initGuard(false, \"To set initial data please use the 'data' property in the table constructor.\");\r\n\t\t\r\n\t\treturn this.dataLoader.load(data, params, config, false);\r\n\t}\r\n\t\r\n\t//clear data\r\n\tclearData(){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tthis.dataLoader.blockActiveLoad();\r\n\t\tthis.rowManager.clearData();\r\n\t}\r\n\t\r\n\t//get table data array\r\n\tgetData(active){\r\n\t\treturn this.rowManager.getData(active);\r\n\t}\r\n\t\r\n\t//get table data array count\r\n\tgetDataCount(active){\r\n\t\treturn this.rowManager.getDataCount(active);\r\n\t}\r\n\t\r\n\t//replace data, keeping table in position with same sort\r\n\treplaceData(data, params, config){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.dataLoader.load(data, params, config, true, true);\r\n\t}\r\n\t\r\n\t//update table data\r\n\tupdateData(data){\r\n\t\tvar responses = 0;\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data){\r\n\t\t\t\tdata.forEach((item) => {\r\n\t\t\t\t\tvar row = this.rowManager.findRow(item[this.options.index]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(row){\r\n\t\t\t\t\t\tresponses++;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trow.updateData(item)\r\n\t\t\t\t\t\t.then(()=>{\r\n\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\tresolve();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\taddData(data, pos, index){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data){\r\n\t\t\t\tthis.rowManager.addRows(data, pos, index)\r\n\t\t\t\t.then((rows) => {\r\n\t\t\t\t\tvar output = [];\r\n\t\t\t\t\t\r\n\t\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\t\toutput.push(row.getComponent());\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tresolve(output);\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//update table data\r\n\tupdateOrAddData(data){\r\n\t\tvar rows = [],\r\n\t\tresponses = 0;\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data){\r\n\t\t\t\tdata.forEach((item) => {\r\n\t\t\t\t\tvar row = this.rowManager.findRow(item[this.options.index]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tresponses++;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(row){\r\n\t\t\t\t\t\trow.updateData(item)\r\n\t\t\t\t\t\t.then(()=>{\r\n\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\trows.push(row.getComponent());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\tresolve(rows);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.rowManager.addRows(item)\r\n\t\t\t\t\t\t.then((newRows)=>{\r\n\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\trows.push(newRows[0].getComponent());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\tresolve(rows);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//get row object\r\n\tgetRow(index){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching row found:\", index);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//get row object\r\n\tgetRowFromPosition(position, active){\r\n\t\tvar row = this.rowManager.getRowFromPosition(position, active);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching row found:\", position);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//delete row from table\r\n\tdeleteRow(index){\r\n\t\tvar foundRows = [];\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(!Array.isArray(index)){\r\n\t\t\tindex = [index];\r\n\t\t}\r\n\t\t\r\n\t\t//find matching rows\r\n\t\tfor(let item of index){\r\n\t\t\tlet row = this.rowManager.findRow(item, true);\r\n\t\t\t\r\n\t\t\tif(row){\r\n\t\t\t\tfoundRows.push(row);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Delete Error - No matching row found:\", item);\r\n\t\t\t\treturn Promise.reject(\"Delete Error - No matching row found\")\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//sort rows into correct order to ensure smooth delete from table\r\n\t\tfoundRows.sort((a, b) => {\r\n\t\t\treturn this.rowManager.rows.indexOf(a) > this.rowManager.rows.indexOf(b) ? 1 : -1;\r\n\t\t});\r\n\t\t\r\n\t\t//delete rows\r\n\t\tfoundRows.forEach((row) =>{\r\n\t\t\trow.delete()\r\n\t\t});\r\n\t\t\r\n\t\tthis.rowManager.reRenderInPosition();\r\n\t\t\r\n\t\treturn Promise.resolve();\r\n\t}\r\n\t\r\n\t//add row to table\r\n\taddRow(data, pos, index){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.rowManager.addRows(data, pos, index)\r\n\t\t.then((rows)=>{\r\n\t\t\treturn rows[0].getComponent();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//update a row if it exitsts otherwise create it\r\n\tupdateOrAddRow(index, data){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.updateData(data)\r\n\t\t\t.then(()=>{\r\n\t\t\t\treturn row.getComponent();\r\n\t\t\t})\r\n\t\t}else{\r\n\t\t\treturn this.rowManager.addRows(data)\r\n\t\t\t.then((rows)=>{\r\n\t\t\t\treturn rows[0].getComponent();\r\n\t\t\t})\r\n\t\t}\r\n\t}\r\n\t\r\n\t//update row data\r\n\tupdateRow(index, data){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.updateData(data)\r\n\t\t\t.then(()=>{\r\n\t\t\t\treturn Promise.resolve(row.getComponent());\r\n\t\t\t})\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Update Error - No matching row found:\", index);\r\n\t\t\treturn Promise.reject(\"Update Error - No matching row found\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t//scroll to row in DOM\r\n\tscrollToRow(index, position, ifVisible){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn this.rowManager.scrollToRow(row, position, ifVisible)\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Scroll Error - No matching row found:\", index);\r\n\t\t\treturn Promise.reject(\"Scroll Error - No matching row found\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveRow(from, to, after){\r\n\t\tvar fromRow = this.rowManager.findRow(from);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(fromRow){\r\n\t\t\tfromRow.moveToRow(to, after);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching row found:\", from);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRows(active){\r\n\t\treturn this.rowManager.getComponents(active);\t\r\n\t}\r\n\t\r\n\t//get position of row in table\r\n\tgetRowPosition(index, active){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn this.rowManager.getRowPosition(row, active);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Position Error - No matching row found:\", index);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t/////////////// Column Functions ///////////////\r\n\tsetColumns(definition){\r\n\t\tthis.initGuard(false, \"To set initial columns please use the 'columns' property in the table constructor\");\r\n\t\t\r\n\t\tthis.columnManager.setColumns(definition);\r\n\t}\r\n\t\r\n\tgetColumns(structured){\r\n\t\treturn this.columnManager.getComponents(structured);\r\n\t}\r\n\t\r\n\tgetColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetColumnDefinitions(){\r\n\t\treturn this.columnManager.getDefinitionTree();\r\n\t}\r\n\t\r\n\tshowColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tcolumn.show();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Show Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\thideColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field); \r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tcolumn.hide();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Hide Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\ttoggleColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tif(column.visible){\r\n\t\t\t\tcolumn.hide();\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.show();\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Visibility Toggle Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColumn(definition, before, field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.columnManager.addColumn(definition, before, column)\r\n\t\t.then((column) => {\r\n\t\t\treturn column.getComponent();\r\n\t\t});\r\n\t}\r\n\t\r\n\tdeleteColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.delete();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Delete Error - No matching column found:\", field);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tupdateColumnDefinition(field, definition){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.updateDefinition(definition)\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Update Error - No matching column found:\", field);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveColumn(from, to, after){\r\n\t\tvar fromColumn = this.columnManager.findColumn(from),\r\n\t\ttoColumn = this.columnManager.findColumn(to);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(fromColumn){\r\n\t\t\tif(toColumn){\r\n\t\t\t\tthis.columnManager.moveColumn(fromColumn, toColumn, after)\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Move Error - No matching column found:\", toColumn);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching column found:\", from);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//scroll to column in DOM\r\n\tscrollToColumn(field, position, ifVisible){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\treturn this.columnManager.scrollToColumn(column, position, ifVisible)\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - No matching column found:\", field);\r\n\t\t\t\treturn Promise.reject(\"Scroll Error - No matching column found\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//////////// General Public Functions ////////////\r\n\t//redraw list without updating data\r\n\tredraw(force){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.columnManager.redraw(force);\r\n\t\tthis.rowManager.redraw(force);\r\n\t}\r\n\t\r\n\tsetHeight(height){\r\n\t\tthis.options.height = isNaN(height) ? height : height + \"px\";\r\n\t\tthis.element.style.height = this.options.height;\r\n\t\tthis.rowManager.initializeRenderer();\r\n\t\tthis.rowManager.redraw();\r\n\t}\r\n\t\r\n\t//////////////////// Event Bus ///////////////////\r\n\t\r\n\ton(key, callback){\r\n\t\tthis.externalEvents.subscribe(key, callback);\r\n\t}\r\n\t\r\n\toff(key, callback){\r\n\t\tthis.externalEvents.unsubscribe(key, callback);\r\n\t}\r\n\t\r\n\tdispatchEvent(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args.shift();\r\n\t\t\r\n\t\tthis.externalEvents.dispatch(...arguments)\r\n\t}\r\n\r\n\t//////////////////// Alerts ///////////////////\r\n\r\n\talert(contents, type){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.alertManager.alert(contents, type);\r\n\t}\r\n\r\n\tclearAlert(){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.alertManager.clear();\r\n\t}\r\n\t\r\n\t////////////// Extension Management //////////////\r\n\tmodExists(plugin, required){\r\n\t\tif(this.modules[plugin]){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tif(required){\r\n\t\t\t\tconsole.error(\"Tabulator Module Not Installed: \" + plugin);\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tmodule(key){\r\n\t\tvar mod = this.modules[key];\r\n\t\t\r\n\t\tif(!mod){\r\n\t\t\tconsole.error(\"Tabulator module not installed: \" + key);\r\n\t\t}\r\n\t\t\r\n\t\treturn mod;\r\n\t}\r\n}\r\n\r\n//default setup options\r\nTabulator.defaultOptions = defaultOptions;\r\n\r\n//bind modules and static functionality\r\nnew ModuleBinder(Tabulator);\r\n\r\nexport default Tabulator;\r\n","export default class PseudoRow {\r\n\r\n\tconstructor (type){\r\n\t\tthis.type = type;\r\n\t\tthis.element = this._createElement();\r\n\t}\r\n\r\n\t_createElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tel.classList.add(\"tabulator-row\");\r\n\t\treturn el;\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\tgetComponent(){\r\n\t\treturn false;\r\n\t}\r\n\r\n\tgetData(){\r\n\t\treturn {};\r\n\t}\r\n\r\n\tgetHeight(){\r\n\t\treturn this.element.outerHeight;\r\n\t}\r\n\r\n\tinitialize(){}\r\n\r\n\treinitialize(){}\r\n\r\n\tnormalizeHeight(){}\r\n\r\n\tgenerateCells(){}\r\n\r\n\treinitializeHeight(){}\r\n\r\n\tcalcHeight(){}\r\n\r\n\tsetCellHeight(){}\r\n\r\n\tclearCellHeight(){}\r\n}"],"names":["CoreFeature","[object Object]","table","this","data","silent","columnsChanged","dataLoader","load","undefined","modules","localize","getText","arguments","bind","getLocale","comms","getConnections","send","layout","getMode","eventBus","subscribe","unsubscribe","key","subscribed","subscriptionChange","dispatch","chain","confirm","externalEvents","options","value","module","Helpers","el","offsetWidth","offsetHeight","box","getBoundingClientRect","top","window","pageYOffset","document","documentElement","clientTop","left","pageXOffset","clientLeft","obj","clone","list","objectProto","__proto__","arrayProto","i","Object","assign","Array","isArray","match","copy","subject","findIndex","item","unshift","deepClone","Popup","element","parent","super","container","_lookupContainer","reversedX","childPopup","blurable","blurCallback","renderedCallback","visible","classList","add","blurEvent","hide","escEvent","_escapeCheck","destroyBinding","popupContainer","querySelector","console","warn","_checkContainerIsParent","body","parentNode","callback","e","touch","MouseEvent","x","touches","pageX","y","pageY","parentOffset","elOffset","position","containerOffset","offset","origin","parentEl","coords","HTMLElement","elementPositionCoords","containerEventCoords","style","appendChild","_fitToScreen","scrollTop","right","Math","max","scrollHeight","parseInt","setTimeout","rowManager","addEventListener","keyCode","removeEventListener","removeChild","Module","name","_handler","optionsList","register","columnManager","func","args","initGuard","component","handler","componentFunctionBinder","priority","registerDataPipelineHandler","registerDisplayPipelineHandler","renderInPosition","refreshActiveData","footerManager","append","prepend","remove","menuEl","menuContainer","content","type","alertManager","alert","clear","Accessor","allowedTypes","registerColumnOption","initializeColumn","transformRow","column","config","forEach","accessor","charAt","toUpperCase","slice","definition","lookupAccessor","params","accessors","row","rowComponent","getComponent","traverse","colCompnent","getFieldValue","setFieldValue","moduleName","generateParamsList","prefix","output","concat","push","serializeParams","encoded","encodeURIComponent","join","url","keys","length","method","toLowerCase","includes","json","headers","Content-Type","JSON","stringify","form","FormData","Ajax","urlGenerator","loaderPromise","registerTableOption","contentTypeFormatters","ajaxRequestFunc","defaultLoaderPromise","ajaxURLGenerator","defaultURLGenerator","ajaxURL","setUrl","setDefaultConfig","ajaxConfig","registerTableFunction","getUrl","requestDataCheck","requestParams","requestData","ajaxParams","call","previousData","generateConfig","sendRequest","defaultConfig","ajaxRequesting","then","ajaxResponse","Promise","reject","contentType","resolve","ajaxContentType","Accept","mode","location","credentials","fetch","response","ok","catch","error","status","statusText","defaultContentTypeFormatters","Clipboard","pasteParser","pasteAction","customSelection","rowRange","blocked","clipboard","clipboardCopyRowRange","plain","html","preventDefault","clipboardCopyFormatter","export","generateExportList","clipboardCopyConfig","clipboardCopyStyled","genereateHTMLTable","generatePlainContent","clipboardData","setData","originalEvent","dispatchExternal","reset","paste","setPasteParser","clipboardPasteParser","setPasteAction","clipboardPasteAction","rowData","columns","col","getKey","range","internal","sel","textRange","getSelection","createRange","selectNodeContents","toString","removeAllRanges","addRange","selection","createTextRange","moveToElementText","select","execCommand","action","pasteActions","parser","pasteParsers","rows","checkPaseOrigin","getPasteData","modExists","mutateData","mutator","valid","target","tagName","edit","currentCell","getData","replace","update","updateOrAddData","insert","addData","headerFindSuccess","columnMap","split","find","title","trim","field","columnsByIndex","shift","CalcComponent","_row","Proxy","get","receiver","handle","transform","getElement","cells","getCells","cell","getCell","CellComponent","_cell","getValue","getOldValue","initialValue","getField","mutate","setValue","setValueActual","checkHeight","Cell","oldValue","height","width","minWidth","loaded","build","generateElement","setWidth","_configureCell","createElement","className","setAttribute","textAlign","hozAlign","vertAlign","display","alignItems","bottom","middle","justifyContent","center","cssClass","val","innerHTML","Node","firstChild","containerOnly","layoutElement","force","setValueProcessData","cellRendered","cellEdited","subscribedExternal","changed","_generateContents","widthStyled","minWidthStyled","maxWidth","maxWidthStyled","reinitializeHeight","heightStyled","redrawBlock","deleteCell","calcs","getCellIndex","ColumnComponent","_column","getDefinition","getTitleDownload","isGroup","show","delete","Column","scrollToColumn","to","after","toColumn","findColumn","moveColumn","nextCol","nextColumn","prevCol","prevColumn","updates","updateDefinition","getWidth","result","reinitializeWidth","renderer","rerenderColumns","maxInitialWidth","variableHeight","headerVertical","headerHozAlign","editableTitle","def","contentElement","titleHolderElement","titleElement","groupElement","createGroupElement","fieldStructure","titleDownload","titleFormatterRendered","mapDefinitions","setField","widthFixed","newCol","attachColumn","checkColumnVisibility","registerColumnField","_initialize","bindModuleColumns","defaults","columnDefaults","generate","defaultOptionList","indexOf","nestedFieldSeparator","_getNestedData","_getFlatData","_setNestedData","_setFlatData","registerColumnPosition","reRegisterPosition","_buildColumnHeaderContent","_buildGroupHeader","_buildColumnHeader","setMinWidth","setMaxWidth","_buildColumnHeaderTitle","langBind","contents","structure","dataObj","paddingTop","colDefs","childWidth","heightInitialized","index","setTo","active","manualHeight","outerHeight","initialized","created","maxHeight","tempData","updatedData","findCell","moveRowActual","blockRedraw","detatchModules","values","topCalcs","botCalcs","genColumn","topElement","botElement","topRow","botRow","topInitialized","initializeColumnCheck","tableRedraw","recalcRowGroup","recalcAll","groupBy","columnCalcs","topCalcParams","botCalcParams","calculations","botInitialized","footerPrepend","generateRow","group","updateData","dataTreeChildColumnCalcs","children","pos","format","formatter","paramKey","results","subGroups","getSubGroups","subGroupResults","groupObj","ColumnCalcs","indent","collapseEl","expandEl","branchEl","registerComponentFunction","expandRow","dataTreeChildField","dummyEl","dataTreeCollapseElement","tabIndex","dataTreeExpandElement","rowDelete","layoutRow","childArray","dataTree","open","controlEl","child","cloneNode","stopPropagation","oldControl","create","allChildren","childData","childRow","collapseRow","Row","initializeRow","defaultDownloaders","csv","setFileContents","fileContents","depth","jsonLines","pdf","header","autoTableParams","fontStyle","fontSize","cellPadding","fillColor","jsPDFParams","colSpan","rowSpan","doc","head","xlsx","sheetName","workbook","utils","tableFeatures","generateSheet","merges","worksheet","SheetNames","sheet","buf","s","Uint8Array","download","downloadFunc","triggerDownload","interceptCallback","groupHeader","blob","Blob","navigator","maskInput","maskLetter","maskLetterChar","maskNumber","symbol","char","isNaN","Download","editor","displayItems","focusedItem","listEl","initialValues","isFilter","filterTimeout","typing","popup","listIteration","cellEl","input","padding","autocomplete","attribs","valueCheck","verticalNavigation","placeholderLoading","filterDelay","emptyValue","clearTimeout","stopImmediatePropagation","_focusItem","_chooseItem","_generateOptions","_sortOptions","itteration","_ajaxRequest","valuesURL","placeholder","label","itemParams","elementAttributes","selected","level","sorter","as","bs","a","String","b","rd","rx","L","a1","isFinite","emptyAlign","filtered","matches","option","term","_clearList","itemFormatter","_groupClick","_styleItem","currentItems","onRendered","editorParams","cellValue","cancel","vertNav","boxSizing","onChange","blurFunc","star","maxStars","size","stars","starChange","nextStar","success","starsHolder","whiteSpace","verticalAlign","getAttribute","progress","min","percent","bar","calcVal","backgroundColor","mouseDrag","mouseDragWidth","updateValue","tristate","indetermValue","indetermState","falseValueSet","checkedValue","trueValue","falseValue","browser","mouseClick","recursionBlock","editedCells","editors","navigatePrev","navigateNext","keybindingNavigateNext","newRow","addRow","nextCell","prevRow","nextRow","allowEdit","elVisible","prevCell","clearEditor","button","self","forceEdit","getRenderMode","bottomEdge","rowEl","rightEdge","leftEdge","renderHorizontal","scrollLeft","rendered","cancelEdit","editIndex","Edit$1","ExportRow","ExportColumn","colVisProp","cloneTableStyle","getDisplayRows","groupData","maxDepth","exportRows","headerDepth","headerEl","bodyEl","styles","setup","rowFormatter","oddRow","evenRow","calcRow","styleCells","getElementsByClassName","mapElementStyles","treeElementField","holder","genereateTableElement","background-color","color","font-weight","font-family","font-size","text-align","border-top","border-left","border-right","border-bottom","padding-top","padding-left","padding-right","getComputedStyle","Export","filterParams","rowVal","filterVal","filterList","headerFilterColumns","prevHeaderFilterChangeCheck","tableInitialized","userSetFilter","userSetHeaderFilterFocus","userRemoveFilter","initialHeaderFilter","getHeaderFilterValue","filterChangeCheck","filter","prevSuccess","Filter","filterFunc","attrType","filterElement","getColumn","normalizeHeight","typingTimer","headerFilterLiveFilterDelay","headerFilter","editorElement","filterMode","ajax","headerFilters","activeRows","getFilters","plaintext","textarea","money","number","sign","decimalSym","thousandSym","negativeSign","integer","link","urlPrefix","formatterParams","image","tickCross","empty","truthy","tick","tickElement","datetime","DT","inputFormat","newDatetime","setZone","invalid","datetimediff","invalidPlaceholder","suffix","unit","lookup","traffic","percentValue","round","colors","floor","legend","legendColor","barEl","barContainer","legendEl","legendAlign","holderEl","buttonTick","buttonCross","rownum","checkbox","selectRow","Format","formatters","entityMap","&","<",">","\"","'","/","leftColumns","rightColumns","leftMargin","rightMargin","rightPadding","initializationMode","layoutCell","groups","leftParents","headersElement","frozen","margin","allCells","calcMargins","paddingLeft","FrozenColumns","refreshData","FrozenRows","GroupComponent","_group","Group","groupManager","hasSubGroups","old","groupList","generator","elementContents","createElements","createValueGroups","arrow","groupKey","groupID","toIndex","generateGroupHeaderContents","marginLeft","noCalc","_visSet","getHeadersAndRows","prev","compoment","groupIDLookups","startOpen","headerGenerator","displayHandler","userGetGroupedData","configureGroupSetup","wipe","rowMoving","groupStartOpen","prevValue","groupRows","moveRowInArray","prevDisplayRow","from","generateGroups","updateGroupRows","groupComponents","headerContent","groupListData","oldGroups","oldRowGroup","groupId","GroupRows","cellUpdated","rowMoved","getRowPosition","history","History","oldRow","rowAdd","deleteActual","_rebindRow","rowMove","hasIndex","originalElement","_extractOptions","fieldIndex","HtmlTableImport","inQuote","importFormat","importer","extension","pickFile","importData","onerror","parsedData","Import","rowClick","rowDblClick","rowContext","rowMouseEnter","rowMouseLeave","rowMouseMove","rowTap","rowDblTap","rowTapHold","cellClick","cellDblClick","cellContext","cellMouseEnter","cellMouseLeave","cellMouseMove","cellTap","cellDblTap","cellTapHold","headerClick","headerDblClick","headerContext","headerMouseEnter","headerMouseLeave","headerMouseMove","headerTap","headerDblTap","headerTapHold","groupClick","groupDblClick","groupContext","groupMouseEnter","groupMouseLeave","subscribers","touchSubscribers","touchWatchers","tap","tapDbl","tapHold","added","eventMap","subscribeTouchEvents","subscriptionChanged","watchers","Interaction","Keybindings","watchKeys","pressedKeys","mergedBindings","actions","bindings","meta","binding","navPrev","navNext","navUp","navDown","scrollPageUp","scrollPageDown","undo","scrollToRow","focus","Menu","rootPopup","columnSubscribers","rowClickMenu","headerContextMenu","initializeColumnHeaderMenu","contextMenu","icon","headerMenu","menu","loadMenu","parentPopup","nestedMenuBlock","itemEl","MoveColumns","placeholderElement","hoverElement","checkTimeout","checkPeriod","moving","toCol","startX","autoScrollMargin","autoScrollTimeout","colEl","nextColWidthLast","prevColWidth","startXMove","moveToCol","nextColWidth","passive","headerElement","clientHeight","toColAfter","_unbindMouseMove","xPos","MoveRows","toRow","toRowAfter","hasHandle","moveHover","endMove","tableRowDropEvent","touchMove","connection","connectionSelectorsTables","connectionElements","connections","connectedTable","connectedRow","movableRowsConnectedTables","connectionSelectorsElements","mousemove","insertBefore","nextSibling","moveRow","tableRowDrop","which","rowHandle","nextRowHeight","diff","startYMove","moveToRow","nextRowHeightLast","setStartPosition","yPos","connectionTables","commsConnections","prototype","fromRow","Mutator","enabled","transformCell","linkCell","ofEl","showingEl","rowsEl","totalRows","valueEl","totalEl","Page","progressiveLoad","pageCounterElement","page","count","displayIndex","initialLoad","dataChanging","pageSizes","setMaxPage","calculatePageSizes","registerDisplayHandler","initializePageCounter","remotePageParams","dispRows","paginationSize","testElRow","testElCell","setPageToRow","firstBut","nextBut","paginationSizeSelector","pageCounter","pageSelectLabel","prevBut","setPage","previousPage","nextPage","paginationElement","pageSizeSelect","lastBut","rowCount","currentRow","rightSize","disabled","end","_setPageButtons","actualStartRow","scrollHorizontal","cookie","cookiePos","localStorage","expireDate","setDate","Persistence","id","defWatcherBlock","persistence","readers","readFunc","persistenceWriterFunc","retreiveData","retreivedData","sort","sorters","initialSort","props","mergeDefinition","current","oldCols","parseColumns","validateSorters","writeFunc","definitions","defStore","moduleInitOrder","Popup$1","initializeRowWatchers","initializeGroupWatchers","headerPopupEl","contentsEl","Print","manualBlock","scrollY","tableEl","printHeader","footerContent","scrollX","ReactiveData","origFuncs","currentVersion","version","defineProperty","pop","splice","childField","configurable","apply","getOwnPropertyDescriptor","ResizeColumns","startColumn","startWidth","deInitializeComponent","resize","nearestColumn","initialNextColumn","handleDown","parentElement","mouseMove","mouseUp","ResizeRows","prevHandle","observer","autoResize","containerHeight","containerWidth","tableHeight","browserMobile","ResizeTable","ResponsiveLayout","hiddenColumns","collapseStartOpen","responsiveLayout","collapseHandleColumn","generateCollapsedRowContent","colCount","working","titleHighlight","text","SelectRow","selecting","lastClickedRow","selectPrev","headerCheckboxElement","toggleRow","shiftKey","rowIdx","fromRowIdx","deselectRows","toggledRows","_rowSelectionChanged","_selectRow","rowInfo","selectedRows","datetime$1","DateTime","isDateTime","fromISO","fromFormat","decimalSeparator","thousandSeparator","string","langLocale","boolean","d","c","calc","alignEmptyValues","aRow","b1","sortList","tableBuilt","setSort","dir","startingDir","columnHeaderSortMulti","rowComponents","sortMode","sortObj","_sortItems","el1Comp","el2","Sort","Tooltip","tooltipSubscriber","headerSubscriber","tooltip","clearPopup","popupInstance","Number","float","parameters","ends","Validate","clearValidation","columnValidate","validate","_buildValidator","validators","validationMode","invalidIndex","invalidCells","ResponsiveLayoutModule","SelectRowModule","SortModule","TooltipModule","ifVisible","rowIndex","elementVertical","VirtualDomHorizontal","rightCol","vDomScrollPosRight","vDomPadLeft","vDomPadRight","fitDataColAvg","visibleRows","isFitData","scroll","cols","colPos","reinitChanged","change","layoutRefresh","removeColRight","fitDataColActualWidthCheck","changes","widthDiff","newWidth","ColumnManager","blockHozScrollEvent","renderClass","renderers","redraw","nextToColumn","parentIndex","nextEl","minHeight","verticalAlignHeaders","updateRows","fromIndex","adjust","offsetLeft","reinitialize","BaiscVertical","VirtualDomVertical","vDomRowHeight","vDomTop","vDomScrollPosBottom","vDomBottomPad","paddingBottom","topOffset","deinitializeHeight","_addBottomRow","bottomDiff","topPad","heightOccupied","vDomWindowBuffer","fillableSpace","getHeight","vDomScrollPosTop","removableRows","vDomBottom","RowManager","tableElement","heightFixer","placeholderContents","firstRender","renderMode","displayRows","displayRowsCount","rowNumColumn","initializePlaceholder","initializeRenderer","_positionPlaceholder","activeIndex","displayRowIterator","regenerateRowNumbers","_clearPlaceholder","setActiveRows","findRowIndex","getRows","skipStage","stage","renderColumns","dataPipeline","displayPipeline","basic","fixedHeight","_clearTable","renderEmptyScroll","_showPlaceholder","otherHeight","redrawBlockRestoreConfig","renderTable","containerElement","InteractionManager","tabulator-cell","subscriber","listenerMap","components","pseudoTrackers","pseudoMouseEnter","pseudoMouseLeave","linkedKeys","listeners","listener","targets","previousTargets","funcName","DataLoader","debug","subscriptionNotifiers","events","_notifiySubscriptionChange","confirmed","notifiers","_confirm","TableRegistry","lastCol","flexGrowUnits","remainingSpace","changeUnits","calcShrink","remainingFlexGrowUnits","shrinkCols","oversizeCols","oversizeSpace","freeSpace","fixedWidth","fixedShrinkColumns","flexColWidth","flexColumns","Layout","Localize","lang","_setLangProp","langList","desiredLocale","locale","path","trans","root","rootPath","items","loading","page_size","next","next_title","all","Comms","con","coreModules","tabulator","registerModule","bindModules","moduleBindings","mod","orderedStartMods","msgElement","Tabulator","vdomHoz","interactionMonitor","ComponentFunctionBinder","initialize","_loadInitialData","attributes","setColumns","ua","Error","responses","parse","findRow","foundRows","plugin","debugEventsExternal","debugInvalidOptions","columnHeaderVertAlign","autoColumns","addRowPos","headerVisible","renderVerticalBuffer","scrollToRowPosition","scrollToColumnIfVisible","rowFormatterPrint","rowFormatterClipboard","rowFormatterHtmlOutput","rowHeight","dataLoaderError","ModuleBinder"],"mappings":";AAAe,MAAMA,EAEpBC,YAAYC,GACXC,KAAKD,MAAQA,EAOdD,WAAWG,EAAMC,EAAQC,GACxB,OAAOH,KAAKD,MAAMK,WAAWC,KAAKJ,OAAMK,OAAWA,OAAWA,EAAWJ,EAAQC,GAOlFL,WACC,OAAOE,KAAKD,MAAMQ,QAAQC,SAASC,WAAWC,WAG/CZ,WACC,OAAOE,KAAKD,MAAMQ,QAAQC,SAASG,QAAQD,WAG5CZ,aACC,OAAOE,KAAKD,MAAMQ,QAAQC,SAASI,aAAaF,WAQjDZ,mBACC,OAAOE,KAAKD,MAAMQ,QAAQM,MAAMC,kBAAkBJ,WAGnDZ,YACC,OAAOE,KAAKD,MAAMQ,QAAQM,MAAME,QAAQL,WAOzCZ,aACC,OAAOE,KAAKD,MAAMQ,QAAQS,OAAOC,UAGlCnB,gBACC,OAAOE,KAAKD,MAAMQ,QAAQS,OAAOA,SAQlClB,YACC,OAAOE,KAAKD,MAAMmB,SAASC,aAAaT,WAGzCZ,cACC,OAAOE,KAAKD,MAAMmB,SAASE,eAAeV,WAG3CZ,WAAWuB,GACV,OAAOrB,KAAKD,MAAMmB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EAKfA,kEAMOjqC,wDAOY,8EAMXoE,EAAK,yEAcb,oDAHa2lC,sCAMJxtC,yDAKK,iHAYbxK,yCAKM,yCAINoF,wDACO6I,wDAKTpO,YAAYgd,OACX,IAAIrS,6BAEJ,6CAGCpF,QAAQC,6HAMKtF,2BAEdA,+BAGmB6Y,wIAYT7Y,kJAWAqK,wIAGoBA,4DAO/BvK,aACC,oCAA2C+T,cAG5BlJ,uMAgBf,GAFA3K,oBAMC,OADAqF,aAAa,oHAUd,GAFArF,2BAKCqF,iEACO,iCAKKrF,wDAYZ,OADAqF,8EACO,8BAITvF,iBACC,IAAIgK,EAAS9J,KAAKkI,cAAc8Q,WAAWnF,GAI3C,OAFA7T,KAAKqI,gDAGJ2F,mFAUD,OAFAhO,+BAKCqF,aAAa,iJAQdrF,uDAKc,mKASdA,0BAIOkI,yPAeOA,wKAWdlI,yKASAA,KAAKwH,gCACLxH,iCAMAA,KAAK2B,eAAeR,mFAQHi2B,+FAWjBp3B,wBAAwBuc,6DAUzBzc,UAAUs4C,KACT,6IAce,yCCz2BFd,mB5BWde,8CAEAC,qBAAoB,yBAGpB9iC,uBAEA6H,WAAU,EAEVk7B,yDAKAl9B,kBAEApb,MAAK,EAELu4C,mFAOA17B,gCAIA27B,mBAEAC,0CAGA5sB,yBACA6sB,uBAEAC,gFAIAC,2BAEA5rB,gBACA6rB,kBAAkB,KAClBC,2BACAC,uBAAuB,KAEvBC,eAEA1yB,kDC5DA2yB,sF2BED,WAIA,qBAEA,IAAIC,UAEJ,SAECr5C,eACCE,UAAYqJ,EACZrJ,oDAIA"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 22d991322..0b6485f5f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tabulator-tables", - "version": "5.2.4", + "version": "5.2.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 2462786eb..369e25bd6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tabulator-tables", - "version": "5.2.4", + "version": "5.2.5", "description": "Interactive table generation JavaScript library", "style": "dist/css/tabulator.css", "main": "dist/js/tabulator.js",